From fb33e286b5c23dbe8d0aeaf63cd3490bed3906e3 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Sat, 26 Apr 2008 10:44:59 +0300 Subject: 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. --- parser-mpcmd.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'parser-mpcmd.c') diff --git a/parser-mpcmd.c b/parser-mpcmd.c index 8e5da2cb98..cba28e538a 100644 --- a/parser-mpcmd.c +++ b/parser-mpcmd.c @@ -33,7 +33,9 @@ static int mode = 0; // #define UNSET_GLOBAL (mode = GLOBAL) -static int is_entry_option(char *opt, char *param, play_tree_t** ret) { +static int is_entry_option(struct m_config *mconfig, char *opt, char *param, + play_tree_t** ret) +{ play_tree_t* entry = NULL; *ret = NULL; @@ -42,7 +44,7 @@ static int is_entry_option(char *opt, char *param, play_tree_t** ret) { if(!param) return M_OPT_MISSING_PARAM; - entry = parse_playlist_file(param); + entry = parse_playlist_file(mconfig, param); if(!entry) return -1; else { @@ -174,7 +176,7 @@ m_config_parse_mp_command_line(m_config_t *config, int argc, char **argv) const m_option_t* mp_opt = NULL; play_tree_t* entry = NULL; - tmp = is_entry_option(opt,(i+1 0) { // It's an entry if(entry) { add_entry(&last_parent,&last_entry,entry); -- cgit v1.2.3