summaryrefslogtreecommitdiffstats
path: root/options/path.h
diff options
context:
space:
mode:
authorKenneth Zhou <knthzh@gmail.com>2014-06-18 19:55:40 -0400
committerwm4 <wm4@nowhere>2014-06-26 19:37:25 +0200
commitcb250d490c14872f03bb0320179e48d05fe2539d (patch)
treedd27e22fcbb6e306175d041eb2b2c714b7079645 /options/path.h
parent8bb7d427e2180067f13f8dc5c5105029e9e00be7 (diff)
downloadmpv-cb250d490c14872f03bb0320179e48d05fe2539d.tar.bz2
mpv-cb250d490c14872f03bb0320179e48d05fe2539d.tar.xz
Basic xdg directory implementation
Search $XDG_CONFIG_HOME and $XDG_CONFIG_DIRS for config files. This also negates the need to have separate user and global variants of mp_find_config_file() Closes #864, #109. Signed-off-by: wm4 <wm4@nowhere>
Diffstat (limited to 'options/path.h')
-rw-r--r--options/path.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/options/path.h b/options/path.h
index 0d23dcbe9b..30ca34d205 100644
--- a/options/path.h
+++ b/options/path.h
@@ -32,13 +32,10 @@ struct mpv_global;
char *mp_find_config_file(void *talloc_ctx, struct mpv_global *global,
const char *filename);
-// Search for the input filename in the global configuration location.
-char *mp_find_global_config_file(void *talloc_ctx, struct mpv_global *global,
- const char *filename);
-
-// Search for the input filename in the user configuration location.
-char *mp_find_user_config_file(void *talloc_ctx, struct mpv_global *global,
- const char *filename);
+// Find all instances of the given config file. Paths are returned in order
+// from lowest to highest priority.
+char **mp_find_all_config_files(void *talloc_ctx, struct mpv_global *global,
+ const char *filename);
// Normally returns a talloc_strdup'ed copy of the path, except for special
// paths starting with '~'. Used to allow the user explicitly reference a
@@ -77,6 +74,7 @@ bool mp_is_url(bstr path);
bstr mp_split_proto(bstr path, bstr *out_url);
+void mp_mkdirp(const char *dir);
void mp_mk_config_dir(struct mpv_global *global, char *subdir);
#endif /* MPLAYER_PATH_H */