summaryrefslogtreecommitdiffstats
path: root/input/cmd_parse.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-11-24 16:48:34 +0100
committerwm4 <wm4@nowhere>2014-11-24 16:48:34 +0100
commitd33ae93b897bc407829c5f3c8b2000a7c31d37bd (patch)
tree2bcf497162349102f5bc002f50e66e53fa291f43 /input/cmd_parse.c
parent0c5fd5a04719a6a7ae63df40bf2f9cac27b14862 (diff)
downloadmpv-d33ae93b897bc407829c5f3c8b2000a7c31d37bd.tar.bz2
mpv-d33ae93b897bc407829c5f3c8b2000a7c31d37bd.tar.xz
input: simplify
Diffstat (limited to 'input/cmd_parse.c')
-rw-r--r--input/cmd_parse.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/input/cmd_parse.c b/input/cmd_parse.c
index 51b56d9565..baeced16f5 100644
--- a/input/cmd_parse.c
+++ b/input/cmd_parse.c
@@ -319,6 +319,11 @@ error:
return NULL;
}
+static struct mp_cmd_def list_def = {
+ .id = MP_CMD_COMMAND_LIST,
+ .name = "list",
+};
+
mp_cmd_t *mp_input_parse_cmd_(struct mp_log *log, bstr str, const char *loc)
{
void *tmp = talloc_new(NULL);
@@ -341,8 +346,9 @@ mp_cmd_t *mp_input_parse_cmd_(struct mp_log *log, bstr str, const char *loc)
struct mp_cmd *list = talloc_ptrtype(NULL, list);
talloc_set_destructor(list, destroy_cmd);
*list = (struct mp_cmd) {
- .id = MP_CMD_COMMAND_LIST,
- .name = "list",
+ .id = list_def.id,
+ .name = (char *)list_def.name,
+ .def = &list_def,
.original = bstrdup(list, original),
};
talloc_steal(list, cmd);