path.c: implement xdg_config_home()
[gitweb.git] / cache.h
diff --git a/cache.h b/cache.h
index f704af5df0984e092fe318e535596921c4ea7122..2cb5371ac213b04bb575cb0dd92f907af18d1d4b 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -828,6 +828,13 @@ char *strip_path_suffix(const char *path, const char *suffix);
 int daemon_avoid_alias(const char *path);
 extern int is_ntfs_dotgit(const char *name);
 
+/**
+ * Return a newly allocated string with the evaluation of
+ * "$XDG_CONFIG_HOME/git/$filename" if $XDG_CONFIG_HOME is non-empty, otherwise
+ * "$HOME/.config/git/$filename". Return NULL upon error.
+ */
+extern char *xdg_config_home(const char *filename);
+
 /* object replacement */
 #define LOOKUP_REPLACE_OBJECT 1
 extern void *read_sha1_file_extended(const unsigned char *sha1, enum object_type *type, unsigned long *size, unsigned flag);