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 /* Add some commands to the queue to be executed */
13 void cmd_enqueue(int insert, char *input);
14 void cmd_enqueuef(int insert, char *fmt, ...);
15 #define cmd_append(input) cmd_enqueue(0, (input))
16 #define cmd_appendf(...) cmd_enqueuef(0, __VA_ARGS__)
17 #define cmd_insert(input) cmd_enqueue(1, (input))
18 #define cmd_insertf(...) cmd_enqueuef(1, __VA_ARGS__)
20 /* Execute pending commands */
21 void cmd_queue_process(void);
23 /* Attempt to autocomplete an input string */
24 char *cmd_complete(char *input);
26 typedef void (*cmd_handler_t)(int argc, char *argv[]);
28 void cmd_addcommand(char *cmd_name, cmd_handler_t cmd_func);
31 /* execute a bound key's command */
32 int cmd_handle_keybinding(unsigned char key);