2013-09-18 16:42:18 +00:00
|
|
|
#ifndef OSDEP_PATH_H
|
|
|
|
#define OSDEP_PATH_H
|
|
|
|
|
2015-05-01 19:13:44 +00:00
|
|
|
// 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)
|
2024-02-20 20:24:54 +00:00
|
|
|
// "osxbundle" macOS bundle resource path
|
2015-05-01 19:13:44 +00:00
|
|
|
// "global" the least priority, global config file location
|
2015-05-02 14:14:51 +00:00
|
|
|
// "desktop" path to desktop contents
|
2015-05-01 19:13:44 +00:00
|
|
|
//
|
2023-05-03 00:29:27 +00:00
|
|
|
// 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.
|
2023-05-03 00:42:23 +00:00
|
|
|
// "cache" the native mpv-specific user cache dir
|
2023-05-03 00:29:27 +00:00
|
|
|
// "state" the native mpv-specific user state dir
|
|
|
|
//
|
2015-05-01 19:13:44 +00:00
|
|
|
// 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);
|
2014-06-18 23:55:40 +00:00
|
|
|
|
2015-05-01 19:13:44 +00:00
|
|
|
// Conforming to mp_get_platform_path_cb.
|
2022-11-08 00:02:22 +00:00
|
|
|
const char *mp_get_platform_path_darwin(void *talloc_ctx, const char *type);
|
2017-06-27 11:50:58 +00:00
|
|
|
const char *mp_get_platform_path_uwp(void *talloc_ctx, const char *type);
|
2015-05-01 19:13:44 +00:00
|
|
|
const char *mp_get_platform_path_win(void *talloc_ctx, const char *type);
|
2024-02-27 15:55:29 +00:00
|
|
|
const char *mp_get_platform_path_mac(void *talloc_ctx, const char *type);
|
2015-05-01 19:13:44 +00:00
|
|
|
const char *mp_get_platform_path_unix(void *talloc_ctx, const char *type);
|
2013-09-18 17:26:26 +00:00
|
|
|
|
2013-09-18 16:42:18 +00:00
|
|
|
#endif
|