/[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.37 by sysadm, Tue Oct 14 06:27:44 2025 UTC Revision 1.41 by sysadm, Sat Oct 18 12:06:10 2025 UTC
# Line 43  int list_section(void *param) Line 43  int list_section(void *param)
43          return REDRAW;          return REDRAW;
44  }  }
45    
46    typedef union exec_handler_t{
47            void *p;
48            int (*handler)();
49    } exec_handler;
50    
51  int exec_mbem(void *param)  int exec_mbem(void *param)
52  {  {
53          void *hdll;          void *hdll;
54          int (*func)();          exec_handler func;
55          char *c, *s;          char *c, *s;
56          char buf[FILE_PATH_LEN];          char buf[FILE_PATH_LEN];
57    
# Line 69  int exec_mbem(void *param) Line 74  int exec_mbem(void *param)
74                  {                  {
75                          char *error;                          char *error;
76    
77                          if ((func = dlsym(hdll, c ? c : "mod_main")) != NULL)                          if ((func.p = dlsym(hdll, c ? c : "mod_main")) != NULL)
78                                  func();                          {
79                                    func.handler();
80                            }
81                          else if ((error = dlerror()) != NULL)                          else if ((error = dlerror()) != NULL)
82                          {                          {
83                                  clearscr();                                  clearscr();
# Line 110  int copyright(void *param) Line 117  int copyright(void *param)
117          return REDRAW;          return REDRAW;
118  }  }
119    
120    int version(void *param)
121    {
122            display_file(DATA_VERSION, 1);
123    
124            return REDRAW;
125    }
126    
127  int reload_bbs_conf(void *param)  int reload_bbs_conf(void *param)
128  {  {
129          clearscr();          clearscr();
# Line 237  int show_top10_menu(void *param) Line 251  int show_top10_menu(void *param)
251                  return NOREDRAW;                  return NOREDRAW;
252          }          }
253          show_top10 = 1;          show_top10 = 1;
254            
255          clearscr();          clearscr();
256          show_top("", BBS_name, "");          show_top("", BBS_name, "");
257          show_bottom("");          show_bottom("");
# Line 248  int show_top10_menu(void *param) Line 262  int show_top10_menu(void *param)
262                  {                  {
263                          iflush();                          iflush();
264                          ch = igetch(100);                          ch = igetch(100);
265    
266                            if (ch != KEY_NULL && ch != KEY_TIMEOUT)
267                            {
268                                    BBS_last_access_tm = time(NULL);
269                            }
270    
271                          switch (ch)                          switch (ch)
272                          {                          {
273                          case KEY_NULL: // broken pipe                          case KEY_NULL: // broken pipe
274                                    log_error("KEY_NULL\n");
275                                  show_top10 = 0;                                  show_top10 = 0;
276                                  return 0;                                  return 0;
277                          case KEY_TIMEOUT:                          case KEY_TIMEOUT:
278                                  if (time(NULL) - BBS_last_access_tm >= MAX_DELAY_TIME)                                  if (time(NULL) - BBS_last_access_tm >= MAX_DELAY_TIME)
279                                  {                                  {
280                                            log_error("User input timeout\n");
281                                          show_top10 = 0;                                          show_top10 = 0;
282                                          return 0;                                          return 0;
283                                  }                                  }
284                                  continue;                                  continue;
285                          case CR:                          case CR:
                                 igetch_reset();  
286                          default:                          default:
287                                  switch (menu_control(&top10_menu, ch))                                  switch (menu_control(&top10_menu, ch))
288                                  {                                  {
# Line 280  int show_top10_menu(void *param) Line 301  int show_top10_menu(void *param)
301                                  }                                  }
302                          }                          }
303    
                         BBS_last_access_tm = time(NULL);  
   
304                          if (ch == EXITMENU)                          if (ch == EXITMENU)
305                          {                          {
306                                  break;                                  break;
307                          }                          }
308                  }                  }
309          }          }
310            
311          show_top10 = 0;          show_top10 = 0;
312          return REDRAW;          return REDRAW;
313  }  }


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

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