summaryrefslogtreecommitdiffstats
path: root/options/m_config.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-09-02 15:58:15 +0200
committerwm4 <wm4@nowhere>2016-09-02 15:58:15 +0200
commit72c6bf1345235801dc8916a907360fd7e2514933 (patch)
tree7d8405e476d821e0222b63570ff1581300e9d96b /options/m_config.h
parent2c917219cffc74fcc64f04113fe260f2b88d5841 (diff)
downloadmpv-72c6bf1345235801dc8916a907360fd7e2514933.tar.bz2
mpv-72c6bf1345235801dc8916a907360fd7e2514933.tar.xz
m_config: add some convenience functions
To be used by the following commits.
Diffstat (limited to 'options/m_config.h')
-rw-r--r--options/m_config.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/options/m_config.h b/options/m_config.h
index 101565745f..e1fbb758b6 100644
--- a/options/m_config.h
+++ b/options/m_config.h
@@ -304,6 +304,20 @@ struct m_config_cache *m_config_cache_alloc(void *ta_parent,
// data itself will (e.g. string options might be reallocated).
bool m_config_cache_update(struct m_config_cache *cache);
+// Like m_config_cache_alloc(), but return the struct (m_config_cache->opts)
+// directly, with no way to update the config.
+// Warning: does currently not set the child as its own talloc root, which
+// means the only way to free the struct is by freeing ta_parent.
+void *mp_get_config_group(void *ta_parent, struct mpv_global *global,
+ const struct m_sub_options *group);
+
+
+// Read a single global option in a thread-safe way. For multiple options,
+// use m_config_cache. The option must exist and match the provided type (the
+// type is used as a sanity check only). Performs semi-expensive lookup.
+void mp_read_option_raw(struct mpv_global *global, const char *name,
+ const struct m_option_type *type, void *dst);
+
struct m_config *mp_get_root_config(struct mpv_global *global);
#endif /* MPLAYER_M_CONFIG_H */