summaryrefslogtreecommitdiffstats
path: root/mpvcore/path.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-12-14 19:50:00 +0100
committerwm4 <wm4@nowhere>2013-12-14 19:54:49 +0100
commit683d7e88e46463497033eb4759ced45ee8b8cc49 (patch)
treeaa99cebe436f180c2d3c2e070ec4d3896386153a /mpvcore/path.h
parentdcf9f77c58691bde3e4e0ac60e5a5d7e1fc95b42 (diff)
downloadmpv-683d7e88e46463497033eb4759ced45ee8b8cc49.tar.bz2
mpv-683d7e88e46463497033eb4759ced45ee8b8cc49.tar.xz
Allow some options taking filenames to refer to mpv config dir
Add the mp_get_user_path() function, and make it expand special path prefixes. Use it for some things in mpv which take filenames (--input-config, --screenshot-template, opengl icc-profile suboption). This allows accessing files in the mpv config dir without hardcoding the config path by prefixing the path with ~~/. Details see manpage additions.
Diffstat (limited to 'mpvcore/path.h')
-rw-r--r--mpvcore/path.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/mpvcore/path.h b/mpvcore/path.h
index bae6956ec7..e0c61321d2 100644
--- a/mpvcore/path.h
+++ b/mpvcore/path.h
@@ -36,6 +36,11 @@ char *mp_find_global_config_file(const char *filename);
// Search for the input filename in the user configuration location.
char *mp_find_user_config_file(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
+// file from the user's home or mpv config directory.
+char *mp_get_user_path(void *talloc_ctx, const char *path);
+
// Return pointer to filename part of path
char *mp_basename(const char *path);