summaryrefslogtreecommitdiff
path: root/src/fileops.h
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@microsoft.com>2015-01-12 16:16:27 -0600
committerEdward Thomson <ethomson@microsoft.com>2015-01-20 17:12:23 -0600
commit1d50b3649d578f12918b7996ad7b98a438bc0616 (patch)
tree57ee1b06924739f57a3c3b98cffd58ee7d02740d /src/fileops.h
parent93b4a50de1b124bf1808dbe55b9b5352274622e1 (diff)
downloadlibgit2-1d50b3649d578f12918b7996ad7b98a438bc0616.tar.gz
checkout: introduce git_checkout_perfdata
Checkout can now provide performance data about the number of (some) syscalls performed using an optional callback.
Diffstat (limited to 'src/fileops.h')
-rw-r--r--src/fileops.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/fileops.h b/src/fileops.h
index 4f5700a99..65b59522c 100644
--- a/src/fileops.h
+++ b/src/fileops.h
@@ -84,6 +84,13 @@ typedef enum {
GIT_MKDIR_VERIFY_DIR = 64,
} git_futils_mkdir_flags;
+struct git_futils_mkdir_perfdata
+{
+ size_t stat_calls;
+ size_t mkdir_calls;
+ size_t chmod_calls;
+};
+
/**
* Create a directory or entire path.
*
@@ -95,8 +102,15 @@ typedef enum {
* @param base Root for relative path. These directories will never be made.
* @param mode The mode to use for created directories.
* @param flags Combination of the mkdir flags above.
+ * @param perfdata Performance data, use `git_futils_mkdir` if you don't want this data.
* @return 0 on success, else error code
*/
+extern int git_futils_mkdir_withperf(const char *path, const char *base, mode_t mode, uint32_t flags, struct git_futils_mkdir_perfdata *perfdata);
+
+/**
+ * Create a directory or entire path. Similar to `git_futils_mkdir_withperf`
+ * without performance data.
+ */
extern int git_futils_mkdir(const char *path, const char *base, mode_t mode, uint32_t flags);
/**