From cb250d490c14872f03bb0320179e48d05fe2539d Mon Sep 17 00:00:00 2001 From: Kenneth Zhou Date: Wed, 18 Jun 2014 19:55:40 -0400 Subject: 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 --- options/path.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'options/path.h') 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 */ -- cgit v1.2.3