2013-12-26 16:10:35 +00:00
|
|
|
/*
|
2015-04-13 07:36:54 +00:00
|
|
|
* This file is part of mpv.
|
2013-12-26 16:10:35 +00:00
|
|
|
*
|
2015-04-13 07:36:54 +00:00
|
|
|
* mpv is free software; you can redistribute it and/or modify
|
2013-12-26 16:10:35 +00:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
2015-04-13 07:36:54 +00:00
|
|
|
* mpv is distributed in the hope that it will be useful,
|
2013-12-26 16:10:35 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
2015-04-13 07:36:54 +00:00
|
|
|
* with mpv. If not, see <http://www.gnu.org/licenses/>.
|
2013-12-26 16:10:35 +00:00
|
|
|
*/
|
2015-04-13 07:36:54 +00:00
|
|
|
|
2013-12-26 16:10:35 +00:00
|
|
|
#ifndef MP_PARSE_COMMAND_H
|
|
|
|
#define MP_PARSE_COMMAND_H
|
|
|
|
|
2014-10-10 20:58:28 +00:00
|
|
|
#include "misc/bstr.h"
|
|
|
|
|
2013-12-26 16:10:35 +00:00
|
|
|
struct mp_log;
|
|
|
|
struct mp_cmd;
|
2014-10-10 20:37:11 +00:00
|
|
|
struct mpv_node;
|
2013-12-26 16:10:35 +00:00
|
|
|
|
|
|
|
// 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.
|
2014-10-10 20:58:28 +00:00
|
|
|
// Also, MP_ON_OSD_AUTO | MP_EXPAND_PROPERTIES are not set by default.
|
2013-12-26 16:10:35 +00:00
|
|
|
// Keep in mind that these functions (naturally) don't take multiple commands,
|
|
|
|
// i.e. a ";" argument does not start a new command.
|
2014-10-10 20:58:28 +00:00
|
|
|
struct mp_cmd *mp_input_parse_cmd_strv(struct mp_log *log, const char **argv);
|
|
|
|
|
2014-10-10 20:37:11 +00:00
|
|
|
struct mp_cmd *mp_input_parse_cmd_node(struct mp_log *log, struct mpv_node *node);
|
2013-12-26 16:10:35 +00:00
|
|
|
|
|
|
|
// 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);
|
|
|
|
|
2014-10-23 12:40:38 +00:00
|
|
|
void mp_cmd_dump(struct mp_log *log, int msgl, char *header, struct mp_cmd *cmd);
|
|
|
|
|
2013-12-26 16:10:35 +00:00
|
|
|
// 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
|