7 /* Maximum length for a single command */
8 #define CMD_MAX_LENGTH 2048
9 /* Maximum number of tokens per command */
10 #define CMD_MAX_TOKENS 64
12 /* Parse an input string */
13 void cmd_parse(char *input); // FIXME: make this handle compound statements, add flag for insert/append?
14 void cmd_parsef(char *fmt, ...);
15 /* Add some commands to the queue to be executed */
16 void cmd_enqueue(int insert, char *input);
17 void cmd_enqueuef(int insert, char *fmt, ...);
18 #define cmd_append(input) cmd_enqueue(0, (input))
19 #define cmd_appendf(...) cmd_enqueue(0, __VA_ARGS__)
20 #define cmd_insert(input) cmd_enqueue(1, (input))
21 #define cmd_insertf(...) cmd_enqueue(1, __VA_ARGS__)
24 /* Attempt to autocomplete an input string */
25 char *cmd_complete(char *input);
27 typedef void (*cmd_handler_t)(int argc, char *argv[]);
29 void cmd_addcommand(char *cmd_name, cmd_handler_t cmd_func);
34 #define CMD_NUM_BUTTONS 2
38 CMD_ATTACK, // Fire primary weapon
39 CMD_ATTACK2, // Fire secondary weapon
42 extern int Console_button_states[CMD_NUM_BUTTONS];
45 /* execute a bound key's command */
46 int cmd_handle_keybinding(unsigned char key);