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

Diff of /lbbs/src/menu_proc.c

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

Revision 1.11 by sysadm, Tue May 6 05:31:26 2025 UTC Revision 1.24 by sysadm, Sun Jun 8 09:25:25 2025 UTC
# Line 20  Line 20 
20  #include "log.h"  #include "log.h"
21  #include "io.h"  #include "io.h"
22  #include "screen.h"  #include "screen.h"
23    #include "menu.h"
24    #include "user_priv.h"
25    #include "section_list_display.h"
26  #include <dlfcn.h>  #include <dlfcn.h>
27  #include <errno.h>  #include <errno.h>
28  #include <signal.h>  #include <signal.h>
# Line 28  Line 31 
31  #include <time.h>  #include <time.h>
32  #include <unistd.h>  #include <unistd.h>
33    
34  int exec_mbem(const char *str)  int list_section(void *param)
35    {
36            section_list_display(param);
37    
38            return REDRAW;
39    }
40    
41    int exec_mbem(void *param)
42  {  {
43          void *hdll;          void *hdll;
44          int (*func)();          int (*func)();
45          char *c, *s;          char *c, *s;
46          char buf[FILE_PATH_LEN];          char buf[FILE_PATH_LEN];
47    
48          strncpy(buf, str, sizeof(buf) - 1);          strncpy(buf, (const char *)param, sizeof(buf) - 1);
49          buf[sizeof(buf) - 1] = '\0';          buf[sizeof(buf) - 1] = '\0';
50    
51          s = strstr(buf, "@mod:");          s = strstr(buf, "@mod:");
# Line 76  int exec_mbem(const char *str) Line 86  int exec_mbem(const char *str)
86          return REDRAW;          return REDRAW;
87  }  }
88    
89  int exitbbs(const char *s)  int exit_bbs(void *param)
90  {  {
91          return EXITBBS;          return EXITBBS;
92  }  }
93    
94  int license(const char *s)  int license(void *param)
95  {  {
96          display_file_ex(DATA_LICENSE, 1, 1);          display_file(DATA_LICENSE, 0);
97    
98          return REDRAW;          return REDRAW;
99  }  }
100    
101  int copyright(const char *s)  int copyright(void *param)
102  {  {
103          display_file_ex(DATA_COPYRIGHT, 1, 1);          display_file(DATA_COPYRIGHT, 1);
104    
105          return REDRAW;          return REDRAW;
106  }  }
107    
108  int reloadbbsmenu(const char *s)  int reload_bbs_conf(void *param)
109  {  {
110          if (kill(getppid(), SIG_RELOAD_MENU) < 0)          clearscr();
111    
112            if (kill(getppid(), SIGHUP) < 0)
113          {          {
114                  log_error("Send SIG_RELOAD_MENU signal failed (%d)\n", errno);                  log_error("Send SIGHUP signal failed (%d)\n", errno);
115    
116                    prints("发送指令失败\r\n");
117          }          }
118            else
119            {
120                    prints("已发送指令\r\n");
121            }
122    
123            press_any_key();
124    
125          return REDRAW;          return REDRAW;
126  }  }
127    
128  int shutdownbbs(const char *s)  int shutdown_bbs(void *param)
129  {  {
130          if (kill(0, SIGTERM) < 0)          log_common("Notify main process to exit\n");
131    
132            if (kill(getppid(), SIGTERM) < 0)
133          {          {
134                  log_error("Send SIGTERM signal failed (%d)\n", errno);                  log_error("Send SIGTERM signal failed (%d)\n", errno);
135          }          }
136    
137          return REDRAW;          return REDRAW;
138  }  }
139    
140    int favour_section_filter(void *param)
141    {
142            MENU_ITEM *p_menu_item = param;
143    
144            return (is_favor(&BBS_priv, p_menu_item->priv) && checklevel2(&BBS_priv, p_menu_item->level));
145    }


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

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