From 76d8683e2ed9b40c955ca2fb25bce98fe1a156b8 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 1 May 2018 03:14:30 +0200 Subject: input: rename cmd_parse.h to cmd.h --- input/cmd.h | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ input/cmd_list.c | 2 +- input/cmd_parse.c | 2 +- input/cmd_parse.h | 55 ------------------------------------------------------- input/input.c | 2 -- input/input.h | 2 +- 6 files changed, 58 insertions(+), 60 deletions(-) create mode 100644 input/cmd.h delete mode 100644 input/cmd_parse.h diff --git a/input/cmd.h b/input/cmd.h new file mode 100644 index 0000000000..13a055ff13 --- /dev/null +++ b/input/cmd.h @@ -0,0 +1,55 @@ +/* + * This file is part of mpv. + * + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * mpv is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see . + */ + +#ifndef MP_PARSE_COMMAND_H +#define MP_PARSE_COMMAND_H + +#include "misc/bstr.h" + +struct mp_log; +struct mp_cmd; +struct mpv_node; + +extern const struct mp_cmd_def mp_cmd_list; + +// Parse text and return corresponding struct mp_cmd. +// The location parameter is for error messages. +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, 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. +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 +// function +void mp_cmd_free(struct mp_cmd *cmd); + +void mp_cmd_dump(struct mp_log *log, int msgl, char *header, struct mp_cmd *cmd); + +// This creates a copy of a command (used by the auto repeat stuff). +struct mp_cmd *mp_cmd_clone(struct mp_cmd *cmd); + +extern const struct m_option_type m_option_type_cycle_dir; + +#define OPT_CYCLEDIR(...) \ + OPT_GENERAL(double, __VA_ARGS__, .type = &m_option_type_cycle_dir) + +#endif diff --git a/input/cmd_list.c b/input/cmd_list.c index 23a5da774e..d57b0796e4 100644 --- a/input/cmd_list.c +++ b/input/cmd_list.c @@ -25,7 +25,7 @@ #include "input.h" #include "cmd_list.h" -#include "cmd_parse.h" +#include "cmd.h" // 0: no, 1: maybe, 2: sure static int is_abort_cmd(struct mp_cmd *cmd) diff --git a/input/cmd_parse.c b/input/cmd_parse.c index f401e5b9c7..95f9f9ac50 100644 --- a/input/cmd_parse.c +++ b/input/cmd_parse.c @@ -22,7 +22,7 @@ #include "common/msg.h" #include "options/m_option.h" -#include "cmd_parse.h" +#include "cmd.h" #include "cmd_list.h" #include "input.h" diff --git a/input/cmd_parse.h b/input/cmd_parse.h deleted file mode 100644 index 13a055ff13..0000000000 --- a/input/cmd_parse.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * This file is part of mpv. - * - * mpv is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * mpv is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with mpv. If not, see . - */ - -#ifndef MP_PARSE_COMMAND_H -#define MP_PARSE_COMMAND_H - -#include "misc/bstr.h" - -struct mp_log; -struct mp_cmd; -struct mpv_node; - -extern const struct mp_cmd_def mp_cmd_list; - -// Parse text and return corresponding struct mp_cmd. -// The location parameter is for error messages. -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, 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. -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 -// function -void mp_cmd_free(struct mp_cmd *cmd); - -void mp_cmd_dump(struct mp_log *log, int msgl, char *header, struct mp_cmd *cmd); - -// This creates a copy of a command (used by the auto repeat stuff). -struct mp_cmd *mp_cmd_clone(struct mp_cmd *cmd); - -extern const struct m_option_type m_option_type_cycle_dir; - -#define OPT_CYCLEDIR(...) \ - OPT_GENERAL(double, __VA_ARGS__, .type = &m_option_type_cycle_dir) - -#endif diff --git a/input/input.c b/input/input.c index 03771dc2bb..70e94dcc5d 100644 --- a/input/input.c +++ b/input/input.c @@ -39,8 +39,6 @@ #include "input.h" #include "keycodes.h" -#include "cmd_list.h" -#include "cmd_parse.h" #include "osdep/threads.h" #include "osdep/timer.h" #include "common/msg.h" diff --git a/input/input.h b/input/input.h index 16b203a5e7..6af170319b 100644 --- a/input/input.h +++ b/input/input.h @@ -22,7 +22,7 @@ #include "misc/bstr.h" #include "cmd_list.h" -#include "cmd_parse.h" +#include "cmd.h" // For mp_input_put_key(): release all keys that are down. #define MP_INPUT_RELEASE_ALL -1 -- cgit v1.2.3