diff options
author | wm4 <wm4@nowhere> | 2014-06-26 18:31:28 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-06-26 19:56:45 +0200 |
commit | 3e1c0e585393928c9931122df74a11f8a28e489d (patch) | |
tree | dcb0b37737ecf6b2ef5eea870c0edca02f59378e /osdep/path.h | |
parent | 0dcde951b9593535bd5da1ae609b55d35f7e36b3 (diff) | |
download | mpv-3e1c0e585393928c9931122df74a11f8a28e489d.tar.bz2 mpv-3e1c0e585393928c9931122df74a11f8a28e489d.tar.xz |
config: make passing talloc context optional for some functions
Until now, the config functions added various allocations to the user-
provided talloc context. Make it so that they're all under the returned
allocation instead. This allows avoiding having to create an extra
temporary context for some callers, and also avoids adding random memory
leaks by accidentally passing a NULL context.
mp_find_all_config_files() has to be changed not to return a pointer
into the middle array for this to work. Make it add paths in order
(instead of reverse), and then reverse the array entries after that.
Also remove the declarations for the win-specific private functions.
Remove STRNULL(); it's barely needed anymore and the functions are
not called with NULL filenames anymore.
Diffstat (limited to 'osdep/path.h')
-rw-r--r-- | osdep/path.h | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/osdep/path.h b/osdep/path.h index c2fe2ba303..c09bedceb0 100644 --- a/osdep/path.h +++ b/osdep/path.h @@ -5,13 +5,7 @@ struct mpv_global; -// Windows config directories -char *mp_get_win_exe_dir(void *talloc_ctx); -char *mp_get_win_exe_subdir(void *talloc_ctx); -char *mp_get_win_app_dir(void *talloc_ctx); - -void mp_add_win_config_dirs(void *talloc_ctx, struct mpv_global *global, - char **dirs, int i); +void mp_add_win_config_dirs(struct mpv_global *global, char **dirs, int i); // Returns Mac OS X application bundle directory. char *mp_get_macosx_bundle_dir(void *talloc_ctx); |