diff options
author | Uoti Urpala <uau@mplayer2.org> | 2011-07-26 05:58:00 +0300 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2011-07-26 06:02:03 +0300 |
commit | ea4cc89f36e064b3224d633df8bc08cc49178d51 (patch) | |
tree | f4c01859f55ea7b9b5b632c8370134f00d50a2ee /parser-cfg.c | |
parent | 3bdcbba49663cfef679fe1ac17bbec311a474e60 (diff) | |
download | mpv-ea4cc89f36e064b3224d633df8bc08cc49178d51.tar.bz2 mpv-ea4cc89f36e064b3224d633df8bc08cc49178d51.tar.xz |
options: move command line preparse together with parse
Diffstat (limited to 'parser-cfg.c')
-rw-r--r-- | parser-cfg.c | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/parser-cfg.c b/parser-cfg.c index 562200c56a..2d0e3ee3cd 100644 --- a/parser-cfg.c +++ b/parser-cfg.c @@ -261,43 +261,3 @@ out: --recursion_depth; return ret; } - -extern int mp_msg_levels[]; - -/// Parse the command line option that must be handled at startup. -int m_config_preparse_command_line(m_config_t *config, int argc, char **argv) -{ - int msg_lvl, i, r, ret = 0; - char* arg; - - // Hack to shutup the parser error messages. - msg_lvl = mp_msg_levels[MSGT_CFGPARSER]; - mp_msg_levels[MSGT_CFGPARSER] = -11; - - config->mode = M_COMMAND_LINE_PRE_PARSE; - - for(i = 1 ; i < argc ; i++) { - const m_option_t* opt; - arg = argv[i]; - // Ignore non option - if(arg[0] != '-' || arg[1] == 0) continue; - arg++; - // No more options after -- - if(arg[0] == '-' && arg[1] == 0) break; - - opt = m_config_get_option(config,arg); - // Ignore invalid option - if(!opt) continue; - // Set, non-pre-parse options will be ignored - r = m_config_set_option(config,arg, - i+1 < argc ? argv[i+1] : NULL); - if(r < 0) ret = r; - else i += r; - } - - mp_msg_levels[MSGT_CFGPARSER] = msg_lvl; - - return ret; -} - -///@} |