/[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.4 by sysadm, Fri May 6 15:48:44 2005 UTC Revision 1.8 by sysadm, Wed Apr 30 09:18:19 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 17  Line 17 
17    
18  #include "bbs_cmd.h"  #include "bbs_cmd.h"
19  #include "menu_proc.h"  #include "menu_proc.h"
20    #include <string.h>
21    
22  BBS_CMD bbs_cmd_list[MAX_CMD_ID] = {  BBS_CMD bbs_cmd_list[MAX_CMD_ID] = {
23    {"RunMBEM", exec_mbem},          {"RunMBEM", exec_mbem},
24    {"EXITBBS", exitbbs},          {"EXITBBS", exitbbs},
25    {"LICENSE", license},          {"LICENSE", license},
26    {"COPYRIGHT", copyright}          {"COPYRIGHT", copyright},
27  };          {"RELOADMENU", reloadbbsmenu},
28            {"SHUTDOWN", shutdownbbs}};
29    
30  static bbs_cmd_max = 4;  int exec_cmd(const char *cmd, const char *param)
   
 int  
 exec_cmd (const char *cmd, const char *param)  
31  {  {
32    int i;          int i;
33    
34    for (i = 0; i < bbs_cmd_max; 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)  
35          {          {
36            return ((*(bbs_cmd_list[i].p_handle))(param));                  if (strcmp(cmd, bbs_cmd_list[i].cmd) == 0)
37                    {
38                            return ((*(bbs_cmd_list[i].p_handle))(param));
39                    }
40          }          }
     }  
41    
42    return UNKNOWN_CMD;          return UNKNOWN_CMD;
43  }  }


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

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