--- lbbs/include/menu.h 2005/03/19 08:23:17 1.2 +++ lbbs/include/menu.h 2005/03/19 14:44:21 1.4 @@ -18,27 +18,29 @@ #define MAX_MENUITEM_LENGTH 50 #define MAX_MENUITEMS 30 #define MAX_MENUNAME_LENGTH 20 -#define MAX_MENUACTION_LENGTH 20 -#define MAX_MENUTITLE_LENGTH 50 -#define MAX_MENUS 256 +#define MAX_MENUACTION_LENGTH 20 +#define MAX_MENUTITLE_LENGTH 50 +#define MAX_MENUS 256 +#define MAX_MENU_DEPTH 50 struct _menu_item { - int col, row; + int row, col, r_row, r_col; char action[MAX_MENUACTION_LENGTH]; - int priv; + int submenu; + int priv, display; char name[MAX_MENUNAME_LENGTH]; char text[MAX_MENUITEM_LENGTH]; }; typedef struct _menu_item MENU_ITEM; struct _menu_title { - int col, row; + int row, col; char text[MAX_MENUTITLE_LENGTH]; }; typedef struct _menu_title MENU_TITLE; struct _menu_screen { - int col, row; + int row, col; char filename[256]; }; typedef struct _menu_screen MENU_SCREEN; @@ -47,15 +49,27 @@ struct _menu { char name[MAX_MENUNAME_LENGTH]; MENU_TITLE title; MENU_SCREEN screen; - MENU_ITEM items[MAX_MENUITEMS]; + MENU_ITEM *items[MAX_MENUITEMS]; int item_count, item_cur_pos; }; typedef struct _menu MENU; struct _menu_set { MENU *p_menu[MAX_MENUS]; + MENU *p_menu_select[MAX_MENU_DEPTH]; int menu_count; + int menu_select_depth; }; typedef struct _menu_set MENU_SET; extern MENU_SET bbs_menu; + +const char * +menu_control (MENU_SET * p_menu_set, int key); + +int +display_menu (MENU * p_menu); + +MENU * +get_menu (MENU_SET * p_menu_set, const char * menu_name); +