| 17 |
#ifndef _MENU_H_ |
#ifndef _MENU_H_ |
| 18 |
#define _MENU_H_ |
#define _MENU_H_ |
| 19 |
|
|
| 20 |
|
#include "bbs_cmd.h" |
| 21 |
#include "common.h" |
#include "common.h" |
| 22 |
#include "trie_dict.h" |
#include "trie_dict.h" |
|
#include "bbs_cmd.h" |
|
| 23 |
#include <stdint.h> |
#include <stdint.h> |
| 24 |
|
|
| 25 |
#define MAX_MENU_NAME_LENGTH 30 |
#define MAX_MENU_NAME_LENGTH 30 |
| 26 |
#define MAX_ITEMS_PER_MENU 256 |
#define MAX_ITEMS_PER_MENU 256 |
| 27 |
#define MAX_MENUITEM_NAME_LENGTH 256 |
#define MAX_MENUITEM_NAME_LENGTH 256 |
| 28 |
#define MAX_MENUITEM_TEXT_LENGTH 100 |
#define MAX_MENUITEM_TEXT_LENGTH 200 |
| 29 |
#define MAX_MENUITEM_ACTION_LENGTH 30 |
#define MAX_MENUITEM_ACTION_LENGTH 30 |
| 30 |
#define MAX_MENUTITLE_TEXT_LENGTH 50 |
#define MAX_MENUTITLE_TEXT_LENGTH 100 |
| 31 |
#define MAX_MENU_SCR_NAME_LENGTH 20 |
#define MAX_MENU_SCR_NAME_LENGTH 20 |
| 32 |
#define MAX_MENU_SCR_BUF_LENGTH 2000 |
#define MAX_MENU_SCR_BUF_LENGTH 2000 |
| 33 |
#define MAX_MENUS 256 |
#define MAX_MENUS 256 |
| 105 |
int16_t menu_item_r_row[MAX_ITEMS_PER_MENU]; |
int16_t menu_item_r_row[MAX_ITEMS_PER_MENU]; |
| 106 |
int16_t menu_item_r_col[MAX_ITEMS_PER_MENU]; |
int16_t menu_item_r_col[MAX_ITEMS_PER_MENU]; |
| 107 |
int16_t menu_item_page_id[MAX_ITEMS_PER_MENU]; |
int16_t menu_item_page_id[MAX_ITEMS_PER_MENU]; |
| 108 |
|
int8_t allow_exit; |
| 109 |
}; |
}; |
| 110 |
typedef struct menu_set_t MENU_SET; |
typedef struct menu_set_t MENU_SET; |
| 111 |
|
|
| 112 |
extern MENU_SET *p_bbs_menu; |
extern MENU_SET bbs_menu; |
| 113 |
|
extern MENU_SET top10_menu; |
| 114 |
|
|
| 115 |
extern int load_menu(MENU_SET *p_menu_set, const char *conf_file); |
extern int load_menu(MENU_SET *p_menu_set, const char *conf_file); |
| 116 |
extern int unload_menu(MENU_SET *p_menu_set); |
extern int unload_menu(MENU_SET *p_menu_set); |
| 117 |
|
|
| 118 |
|
extern int get_menu_shm_readonly(MENU_SET *p_menu_set); |
| 119 |
extern int set_menu_shm_readonly(MENU_SET *p_menu_set); |
extern int set_menu_shm_readonly(MENU_SET *p_menu_set); |
| 120 |
extern int detach_menu_shm(MENU_SET *p_menu_set); |
extern int detach_menu_shm(MENU_SET *p_menu_set); |
| 121 |
|
|