summaryrefslogtreecommitdiffstats
path: root/osdep/path.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:36:56 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:36:56 +0000
commit51de1d8436100f725f3576aefa24a2bd2057bc28 (patch)
treec6d1d5264b6d40a8d7ca34129f36b7d61e188af3 /osdep/path.h
parentInitial commit. (diff)
downloadmpv-51de1d8436100f725f3576aefa24a2bd2057bc28.tar.xz
mpv-51de1d8436100f725f3576aefa24a2bd2057bc28.zip
Adding upstream version 0.37.0.upstream/0.37.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'osdep/path.h')
-rw-r--r--osdep/path.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/osdep/path.h b/osdep/path.h
new file mode 100644
index 0000000..2c00ea5
--- /dev/null
+++ b/osdep/path.h
@@ -0,0 +1,32 @@
+#ifndef OSDEP_PATH_H
+#define OSDEP_PATH_H
+
+// Return a platform-specific path, identified by the type parameter. If the
+// return value is allocated, talloc_ctx is used as talloc parent context.
+//
+// The following type values are defined:
+// "home" the native mpv-specific user config dir
+// "old_home" same as "home", but lesser priority (compatibility)
+// "osxbundle" OSX bundle resource path
+// "global" the least priority, global config file location
+// "desktop" path to desktop contents
+//
+// These additional types are also defined. However, they are not necessarily
+// implemented on every platform. Unlike some other type values that are
+// platform specific (like "osxbundle"), the value of "home" is returned
+// instead if these types are not explicitly defined.
+// "cache" the native mpv-specific user cache dir
+// "state" the native mpv-specific user state dir
+//
+// It is allowed to return a static string, so the caller must set talloc_ctx
+// to something other than NULL to avoid memory leaks.
+typedef const char *(*mp_get_platform_path_cb)(void *talloc_ctx, const char *type);
+
+// Conforming to mp_get_platform_path_cb.
+const char *mp_get_platform_path_darwin(void *talloc_ctx, const char *type);
+const char *mp_get_platform_path_uwp(void *talloc_ctx, const char *type);
+const char *mp_get_platform_path_win(void *talloc_ctx, const char *type);
+const char *mp_get_platform_path_osx(void *talloc_ctx, const char *type);
+const char *mp_get_platform_path_unix(void *talloc_ctx, const char *type);
+
+#endif