--- lbbs/include/menu.h 2025/10/18 12:06:10 1.31 +++ lbbs/include/menu.h 2025/11/19 14:47:08 1.35 @@ -1,18 +1,10 @@ -/*************************************************************************** - menu.h - description - ------------------- - Copyright : (C) 2004-2025 by Leaflet - Email : leaflet@leafok.com - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ +/* SPDX-License-Identifier: GPL-3.0-or-later */ +/* + * menu + * - configurable user interactive menu feature + * + * Copyright (C) 2004-2025 Leaflet + */ #ifndef _MENU_H_ #define _MENU_H_ @@ -22,17 +14,20 @@ #include "trie_dict.h" #include -#define MAX_MENU_NAME_LENGTH 30 -#define MAX_ITEMS_PER_MENU 256 -#define MAX_MENUITEM_NAME_LENGTH 256 -#define MAX_MENUITEM_TEXT_LENGTH 200 -#define MAX_MENUITEM_ACTION_LENGTH 30 -#define MAX_MENUTITLE_TEXT_LENGTH 100 -#define MAX_MENU_SCR_NAME_LENGTH 20 -#define MAX_MENU_SCR_BUF_LENGTH 2000 -#define MAX_MENUS 256 -#define MAX_MENUITEMS 5120 -#define MAX_MENU_DEPTH 50 +enum menu_constant_t +{ + MAX_MENU_NAME_LENGTH = 30, + MAX_ITEMS_PER_MENU = 256, + MAX_MENUITEM_NAME_LENGTH = 256, + MAX_MENUITEM_TEXT_LENGTH = 200, + MAX_MENUITEM_ACTION_LENGTH = 30, + MAX_MENUTITLE_TEXT_LENGTH = 100, + MAX_MENU_SCR_NAME_LENGTH = 20, + MAX_MENU_SCR_BUF_LENGTH = 2000, + MAX_MENUS = 256, + MAX_MENUITEMS = 5120, + MAX_MENU_DEPTH = 50, +}; typedef uint64_t MENU_ID; typedef uint64_t MENU_ITEM_ID; @@ -86,7 +81,8 @@ typedef struct menu_t MENU; struct menu_set_t { - int shmid; + char shm_name[FILE_PATH_LEN]; + size_t shm_size; void *p_reserved; void *p_menu_pool; void *p_menu_item_pool;