Basic UI with commands

This commit is contained in:
2020-06-12 11:40:48 -07:00
parent b4d90769ba
commit 78859dc4fa
8 changed files with 236 additions and 27 deletions

19
ui/commands.h Normal file
View File

@@ -0,0 +1,19 @@
#ifndef UI_COMMANDS_H_
#define UI_COMMANDS_H_
#include <stdbool.h>
#include "model.h"
typedef struct ui_command {
const char *command;
const char *help_text;
bool (*handler)(ui_state *);
} ui_command;
#define UI_NUM_COMMANDS 3
extern ui_command ui_commands[];
bool handle_command(ui_state *state);
#endif // UI_COMMANDS_H_