/[LeafOK_CVS]/lbbs/src/bbs_cmd.c
ViewVC logotype

Diff of /lbbs/src/bbs_cmd.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.5 by sysadm, Sat May 7 09:28:12 2005 UTC Revision 1.7 by sysadm, Mon Apr 28 03:30:59 2025 UTC
# Line 1  Line 1 
1  /***************************************************************************  /***************************************************************************
2                            bbs_cmd.c  -  description                                                    bbs_cmd.c  -  description
3                               -------------------                                                           -------------------
4      begin                : Wed Mar 16 2005          begin                : Wed Mar 16 2005
5      copyright            : (C) 2005 by Leaflet          copyright            : (C) 2005 by Leaflet
6      email                : leaflet@leafok.com          email                : leaflet@leafok.com
7   ***************************************************************************/   ***************************************************************************/
8    
9  /***************************************************************************  /***************************************************************************
# Line 19  Line 19 
19  #include "menu_proc.h"  #include "menu_proc.h"
20    
21  BBS_CMD bbs_cmd_list[MAX_CMD_ID] = {  BBS_CMD bbs_cmd_list[MAX_CMD_ID] = {
22    {"RunMBEM", exec_mbem},          {"RunMBEM", exec_mbem},
23    {"EXITBBS", exitbbs},          {"EXITBBS", exitbbs},
24    {"LICENSE", license},          {"LICENSE", license},
25    {"COPYRIGHT", copyright},          {"COPYRIGHT", copyright},
26    {"RELOADMENU", notify_reload_menu}          {"RELOADMENU", reloadbbsmenu},
27  };          {"SHUTDOWN", shutdownbbs}};
28    
29  int  int exec_cmd(const char *cmd, const char *param)
 exec_cmd (const char *cmd, const char *param)  
30  {  {
31    int i;          int i;
32    
33    for (i = 0; i < MAX_CMD_ID && bbs_cmd_list[i].p_handle != 0; i++)          for (i = 0; i < MAX_CMD_ID && bbs_cmd_list[i].p_handle != 0; i++)
     {  
       if (strcmp (cmd, bbs_cmd_list[i].cmd) == 0)  
34          {          {
35            return ((*(bbs_cmd_list[i].p_handle))(param));                  if (strcmp(cmd, bbs_cmd_list[i].cmd) == 0)
36                    {
37                            return ((*(bbs_cmd_list[i].p_handle))(param));
38                    }
39          }          }
     }  
40    
41    return UNKNOWN_CMD;          return UNKNOWN_CMD;
42  }  }


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1