1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
#ifndef INCLUDED_MENU_H #define INCLUDED_MENU_H #include <stdlib.h> #include <stdbool.h> typedef bool (*menu_item_handler)(void); struct menu_item { menu_item_handler handler; const char *label; }; struct menu { size_t item_count; const struct menu_item *items; }; extern bool menu(struct menu); extern bool menu_back(void); extern bool menu_exit(void); #endif