--- lbbs/src/bbs_cmd.c 2005/05/06 15:48:44 1.4 +++ lbbs/src/bbs_cmd.c 2025/05/06 05:31:26 1.9 @@ -1,44 +1,42 @@ /*************************************************************************** - bbs_cmd.c - description - ------------------- - begin : Wed Mar 16 2005 - copyright : (C) 2005 by Leaflet - email : leaflet@leafok.com + bbs_cmd.c - 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 2 of the License, or * + * the Free Software Foundation; either version 3 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "bbs_cmd.h" #include "menu_proc.h" +#include BBS_CMD bbs_cmd_list[MAX_CMD_ID] = { - {"RunMBEM", exec_mbem}, - {"EXITBBS", exitbbs}, - {"LICENSE", license}, - {"COPYRIGHT", copyright} -}; + {"RunMBEM", exec_mbem}, + {"EXITBBS", exitbbs}, + {"LICENSE", license}, + {"COPYRIGHT", copyright}, + {"RELOADMENU", reloadbbsmenu}, + {"SHUTDOWN", shutdownbbs}}; -static bbs_cmd_max = 4; - -int -exec_cmd (const char *cmd, const char *param) +int exec_cmd(const char *cmd, const char *param) { - int i; + int i; - for (i = 0; i < bbs_cmd_max; i++) - { - if (strcmp (cmd, bbs_cmd_list[i].cmd) == 0) + for (i = 0; i < MAX_CMD_ID && bbs_cmd_list[i].p_handle != 0; i++) { - return ((*(bbs_cmd_list[i].p_handle))(param)); + if (strcmp(cmd, bbs_cmd_list[i].cmd) == 0) + { + return ((*(bbs_cmd_list[i].p_handle))(param)); + } } - } - return UNKNOWN_CMD; + return UNKNOWN_CMD; }