/[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.3 by sysadm, Tue Mar 22 13:36:13 2005 UTC Revision 1.5 by sysadm, Sat May 7 09:28:12 2005 UTC
# Line 1  Line 1 
1  /***************************************************************************  /***************************************************************************
2                            bbs_cmd.c  -  description                            bbs_cmd.c  -  description
3                               -------------------                               -------------------
4      begin                : Wed Mar 16 2004      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   ***************************************************************************/   ***************************************************************************/
# Line 16  Line 16 
16   ***************************************************************************/   ***************************************************************************/
17    
18  #include "bbs_cmd.h"  #include "bbs_cmd.h"
19    #include "menu_proc.h"
20    
21  BBS_CMD bbs_cmd_list[MAX_CMD_ID] = {  BBS_CMD bbs_cmd_list[MAX_CMD_ID] = {
22    {"EXITBBS", EXITBBS}    {"RunMBEM", exec_mbem},
23    ,    {"EXITBBS", exitbbs},
24    {"BBSNET", BBSNET}    {"LICENSE", license},
25    ,    {"COPYRIGHT", copyright},
26    {"LICENSE", LICENSE}    {"RELOADMENU", notify_reload_menu}
   ,  
   {"COPYRIGHT", COPYRIGHT}  
27  };  };
28    
 static bbs_cmd_max = 4;  
   
29  int  int
30  get_cmd_value (const char *cmd)  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++)
35      {      {
36        if (strcmp (cmd, bbs_cmd_list[i].cmd) == 0)        if (strcmp (cmd, bbs_cmd_list[i].cmd) == 0)
37          {          {
38            return bbs_cmd_list[i].value;            return ((*(bbs_cmd_list[i].p_handle))(param));
39          }          }
40      }      }
41    


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

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