diff options
author | Uoti Urpala <uau@mplayer2.org> | 2012-03-21 02:23:35 +0200 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2012-03-25 22:30:38 +0300 |
commit | 215035b31abc4bc17e0af231952f410b4165e00c (patch) | |
tree | f7a3173722488e89ee26af8a8178a7b1b95fc674 /input/input.h | |
parent | ae0a38ddf8fe2b0db0dae3c072c322eaaff57dcd (diff) | |
download | mpv-215035b31abc4bc17e0af231952f410b4165e00c.tar.bz2 mpv-215035b31abc4bc17e0af231952f410b4165e00c.tar.xz |
input.c: simplify command definitions
Change command definitions to allow writing the command definition
table in more readable format.
Diffstat (limited to 'input/input.h')
-rw-r--r-- | input/input.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/input/input.h b/input/input.h index 4058ce3d99..4cd006fa9a 100644 --- a/input/input.h +++ b/input/input.h @@ -19,6 +19,8 @@ #ifndef MPLAYER_INPUT_H #define MPLAYER_INPUT_H +#include <stdbool.h> + // All command IDs enum mp_command_type { MP_CMD_SEEK, @@ -153,14 +155,11 @@ enum mp_command_type { }; // The arg types -#define MP_CMD_ARG_INT 0 -#define MP_CMD_ARG_FLOAT 1 -#define MP_CMD_ARG_STRING 2 -#define MP_CMD_ARG_VOID 3 +#define MP_CMD_ARG_INT 1 +#define MP_CMD_ARG_FLOAT 2 +#define MP_CMD_ARG_STRING 3 -#ifndef MP_CMD_MAX_ARGS #define MP_CMD_MAX_ARGS 10 -#endif // Error codes for the drivers @@ -180,19 +179,19 @@ struct input_ctx; struct mp_cmd_arg { int type; + bool optional; union { int i; float f; char *s; - void *v; } v; }; typedef struct mp_cmd { int id; char *name; - int nargs; struct mp_cmd_arg args[MP_CMD_MAX_ARGS]; + int nargs; int pausing; struct mp_cmd *queue_prev; struct mp_cmd *queue_next; |