/[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.32 by sysadm, Mon Oct 13 05:34:27 2025 UTC Revision 1.34 by sysadm, Mon Oct 13 07:13:39 2025 UTC
# Line 141  int shutdown_bbs(void *param) Line 141  int shutdown_bbs(void *param)
141          return REDRAW;          return REDRAW;
142  }  }
143    
144  int favour_section_filter(void *param)  int favor_section_filter(void *param)
145  {  {
146          MENU_ITEM *p_menu_item = param;          MENU_ITEM *p_menu_item = param;
147    
# Line 226  int list_ex_section(void *param) Line 226  int list_ex_section(void *param)
226          return REDRAW;          return REDRAW;
227  }  }
228    
229  int top10_menu(void *param)  int show_top10_menu(void *param)
230  {  {
231            int ch = 0;
232    
233            clearscr();
234            show_top("", BBS_name, "");
235            show_bottom("");
236    
237            if (display_menu(&top10_menu) == 0)
238            {
239                    while (!SYS_server_exit)
240                    {
241                            iflush();
242                            ch = igetch(100);
243                            switch (ch)
244                            {
245                            case KEY_NULL: // broken pipe
246                                    return 0;
247                            case KEY_TIMEOUT:
248                                    if (time(NULL) - BBS_last_access_tm >= MAX_DELAY_TIME)
249                                    {
250                                            return 0;
251                                    }
252                                    continue;
253                            case CR:
254                                    igetch_reset();
255                            default:
256                                    switch (menu_control(&top10_menu, ch))
257                                    {
258                                    case EXITMENU:
259                                            ch = EXITMENU;
260                                            break;
261                                    case REDRAW:
262                                            clearscr();
263                                            show_bottom("");
264                                            display_menu(&top10_menu);
265                                            break;
266                                    case NOREDRAW:
267                                    case UNKNOWN_CMD:
268                                    default:
269                                            break;
270                                    }
271                            }
272    
273                            BBS_last_access_tm = time(NULL);
274    
275                            if (ch == EXITMENU)
276                            {
277                                    break;
278                            }
279                    }
280            }
281            
282          return REDRAW;          return REDRAW;
283  }  }
284    
285  int locate_article(void *param)  int locate_article(void *param)
286  {  {
287            char buf[MAX_MENUITEM_NAME_LENGTH];
288          char *sname, *aid, *saveptr;          char *sname, *aid, *saveptr;
289    
290          sname = strtok_r(param, " ", &saveptr);          strncpy(buf, param, sizeof(buf) - 1);
291          aid = strtok_r(NULL, " ", &saveptr);          buf[sizeof(buf) - 1] = '\0';
292    
293            sname = strtok_r(buf, "|", &saveptr);
294            aid = strtok_r(NULL, "|", &saveptr);
295    
296          if (sname == NULL || aid == NULL)          if (sname == NULL || aid == NULL)
297          {          {
298                  log_error("top10_locate() error: invalid parameter\n", (const char *)param);                  log_error("top10_locate(%s) error: invalid parameter\n", param);
299                  return NOREDRAW;                  return NOREDRAW;
300          }          }
301    


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

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