diff options
author | wm4 <wm4@nowhere> | 2014-10-10 22:58:28 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-10-10 22:58:28 +0200 |
commit | c9f45ea93e470159b1bd4c4ddbd5c2c05149d76e (patch) | |
tree | 7bc1da5d3c1cb792f6e3955d732110492e245a7c /input/cmd_parse.h | |
parent | 63903c27bd9947b94ef83dc350568b5797af5281 (diff) | |
download | mpv-c9f45ea93e470159b1bd4c4ddbd5c2c05149d76e.tar.bz2 mpv-c9f45ea93e470159b1bd4c4ddbd5c2c05149d76e.tar.xz |
input: use mpv_node parser for char** command parsers
Minor simplification, also drops some useless stuff.
Diffstat (limited to 'input/cmd_parse.h')
-rw-r--r-- | input/cmd_parse.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/input/cmd_parse.h b/input/cmd_parse.h index 3c08f0b4ba..b5b0c3e0f4 100644 --- a/input/cmd_parse.h +++ b/input/cmd_parse.h @@ -18,6 +18,8 @@ #ifndef MP_PARSE_COMMAND_H #define MP_PARSE_COMMAND_H +#include "misc/bstr.h" + struct mp_log; struct mp_cmd; struct mpv_node; @@ -27,16 +29,11 @@ struct mpv_node; struct mp_cmd *mp_input_parse_cmd_(struct mp_log *log, bstr str, const char *loc); // Similar to mp_input_parse_cmd(), but takes a list of strings instead. -// Also, def_flags contains initial command flags (see mp_cmd_flags; the default -// as used by mp_input_parse_cmd is MP_ON_OSD_AUTO | MP_EXPAND_PROPERTIES). +// Also, MP_ON_OSD_AUTO | MP_EXPAND_PROPERTIES are not set by default. // Keep in mind that these functions (naturally) don't take multiple commands, // i.e. a ";" argument does not start a new command. -// The _strv version is limitted to MP_CMD_MAX_ARGS argv array items. -struct mp_cmd *mp_input_parse_cmd_strv(struct mp_log *log, int def_flags, - const char **argv, const char *location); -struct mp_cmd *mp_input_parse_cmd_bstrv(struct mp_log *log, int def_flags, - int argc, bstr *argv, - const char *location); +struct mp_cmd *mp_input_parse_cmd_strv(struct mp_log *log, const char **argv); + struct mp_cmd *mp_input_parse_cmd_node(struct mp_log *log, struct mpv_node *node); // After getting a command from mp_input_get_cmd you need to free it using this |