summaryrefslogtreecommitdiff
path: root/src/fileops.h
diff options
context:
space:
mode:
authorRussell Belfer <arrbee@arrbee.com>2011-12-28 23:28:50 -0800
committerRussell Belfer <arrbee@arrbee.com>2011-12-29 00:01:10 -0800
commit73b51450a3194ddaa2ac180a1fea25fdf66971bb (patch)
tree4a6f4f0cfc90ded7f7734da2b6a9353d9bb0890b /src/fileops.h
parentee1f0b1aed7798908d9e038b006b66f868613fc3 (diff)
downloadlibgit2-73b51450a3194ddaa2ac180a1fea25fdf66971bb.tar.gz
Add support for macros and cache flush API.
Add support for git attribute macro definitions. Also, add support for cache flush API to clear the attribute file content cache when needed. Additionally, improved the handling of global and system files, making common utility functions in fileops and converting config and attr to both use the common functions. Adds a bunch more tests and fixed some memory leaks. Note that adding macros required me to use refcounted attribute assignment definitions, which complicated, but probably improved memory usage.
Diffstat (limited to 'src/fileops.h')
-rw-r--r--src/fileops.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/fileops.h b/src/fileops.h
index df135d0db..31f3e6a91 100644
--- a/src/fileops.h
+++ b/src/fileops.h
@@ -165,4 +165,28 @@ extern int git_futils_direach(
extern int git_futils_cmp_path(const char *name1, int len1, int isdir1,
const char *name2, int len2, int isdir2);
+/**
+ * Find a "global" file (i.e. one in a user's home directory).
+ *
+ * @param pathbuf buffer to write the full path into
+ * @param filename name of file to find in the home directory
+ * @return
+ * - GIT_SUCCESS if found;
+ * - GIT_ENOTFOUND if not found;
+ * - GIT_EOSERR on an unspecified OS related error.
+ */
+extern int git_futils_find_global_file(git_buf *path, const char *filename);
+
+/**
+ * Find a "system" file (i.e. one shared for all users of the system).
+ *
+ * @param pathbuf buffer to write the full path into
+ * @param filename name of file to find in the home directory
+ * @return
+ * - GIT_SUCCESS if found;
+ * - GIT_ENOTFOUND if not found;
+ * - GIT_EOSERR on an unspecified OS related error.
+ */
+extern int git_futils_find_system_file(git_buf *path, const char *filename);
+
#endif /* INCLUDE_fileops_h__ */