diff options
author | Uoti Urpala <uau@symbol.nonexistent.invalid> | 2008-04-26 10:44:59 +0300 |
---|---|---|
committer | Uoti Urpala <uau@symbol.nonexistent.invalid> | 2008-04-26 10:44:59 +0300 |
commit | fb33e286b5c23dbe8d0aeaf63cd3490bed3906e3 (patch) | |
tree | 9e1eb90e7ec461afd59c3411c2be253b75a9f448 /m_config.c | |
parent | 6be229cbbfbe29ad61025051b1d903f5619e0b8a (diff) | |
download | mpv-fb33e286b5c23dbe8d0aeaf63cd3490bed3906e3.tar.bz2 mpv-fb33e286b5c23dbe8d0aeaf63cd3490bed3906e3.tar.xz |
Move global mconfig to mpctx
The global was used in the function cfg_include which handles the
-include option. Make the address available in that function by
creating a new dynamically allocated option in m_config_new that has
the address in the option's private data.
asxparser.c also used the global. Making it available through all ways
the code could get called required a number of relatively straightforward
changes to playtree and menu code.
Diffstat (limited to 'm_config.c')
-rw-r--r-- | m_config.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/m_config.c b/m_config.c index 02a2898dee..fc61494f0d 100644 --- a/m_config.c +++ b/m_config.c @@ -55,8 +55,9 @@ static void m_option_set(const m_config_t *config, const m_option_t *opt, -m_config_t* -m_config_new(void *optstruct) { +m_config_t *m_config_new(void *optstruct, + int includefunc(m_option_t *conf, char *filename)) +{ m_config_t* config; static int initialized = 0; static m_option_type_t profile_opt_type; @@ -80,6 +81,12 @@ m_config_new(void *optstruct) { for (i = 0; self_opts[i].name; i++) self_opts[i].priv = config; m_config_register_options(config, self_opts); + if (includefunc) { + struct m_option *p = talloc_ptrtype(config, p); + *p = (struct m_option){"include", includefunc, CONF_TYPE_FUNC_PARAM, + CONF_NOSAVE, 0, 0, config}; + m_config_add_option(config, p, NULL); + } config->optstruct = optstruct; return config; |