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

Diff of /lbbs/src/bbs_main.c

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

Revision 1.99 by sysadm, Wed Nov 5 01:04:05 2025 UTC Revision 1.103 by sysadm, Sat Nov 8 08:21:31 2025 UTC
# Line 11  Line 11 
11  #include "bbs.h"  #include "bbs.h"
12  #include "bbs_cmd.h"  #include "bbs_cmd.h"
13  #include "bbs_main.h"  #include "bbs_main.h"
14    #include "bwf.h"
15  #include "common.h"  #include "common.h"
16  #include "database.h"  #include "database.h"
17  #include "editor.h"  #include "editor.h"
# Line 21  Line 22 
22  #include "screen.h"  #include "screen.h"
23  #include "section_list.h"  #include "section_list.h"
24  #include "section_list_display.h"  #include "section_list_display.h"
25    #include "str_process.h"
26  #include "trie_dict.h"  #include "trie_dict.h"
27  #include "user_list.h"  #include "user_list.h"
28  #include "user_priv.h"  #include "user_priv.h"
# Line 138  int bbs_center() Line 140  int bbs_center()
140                  if (ch != KEY_NULL && ch != KEY_TIMEOUT)                  if (ch != KEY_NULL && ch != KEY_TIMEOUT)
141                  {                  {
142                          BBS_last_access_tm = time(NULL);                          BBS_last_access_tm = time(NULL);
143    #ifdef _DEBUG
144                            log_error("Debug: BBS_last_access_tm is updated\n");
145    #endif
146                  }                  }
147    
148                  if (bbs_menu.choose_step == 0 && time(NULL) - t_last_action >= 10)                  if (bbs_menu.choose_step == 0 && time(NULL) - t_last_action >= 10)
# Line 200  int bbs_charset_select() Line 205  int bbs_charset_select()
205          int ch;          int ch;
206    
207          snprintf(msg, sizeof(msg),          snprintf(msg, sizeof(msg),
208                           "\rChoose character set in 5 seconds [UTF-8, GBK]: [U/g]");                           "\rChoose character set in 3 seconds [UTF-8, GBK]: [U/g]");
209    
210          while (!SYS_server_exit)          while (!SYS_server_exit)
211          {          {
212                  ch = press_any_key_ex(msg, 5);                  ch = press_any_key_ex(msg, 3);
213                  switch (ch)                  switch (toupper(ch))
214                  {                  {
215                  case KEY_NULL:                  case KEY_NULL:
216                          return -1;                          return -1;
217                  case KEY_TIMEOUT:                  case KEY_TIMEOUT:
218                  case CR:                  case CR:
                 case 'u':  
219                  case 'U':                  case 'U':
220                          return 0;                          break;
                 case 'g':  
221                  case 'G':                  case 'G':
222                          if (io_conv_init("GBK") < 0)                          if (io_conv_init("GBK") < 0)
223                          {                          {
224                                  log_error("io_conv_init(%s) error\n", "GBK");                                  log_error("io_conv_init(%s) error\n", "GBK");
225                                  return -1;                                  return -1;
226                          }                          }
227                          return 0;                          break;
228                    default:
229                            continue;
230                    }
231    
232                    break;
233            }
234    
235            snprintf(msg, sizeof(msg),
236                             "\rChoose wide-character display in 3 seconds [Fixed, Dynamic]: [F/d]");
237    
238            while (!SYS_server_exit)
239            {
240                    ch = press_any_key_ex(msg, 3);
241                    switch (toupper(ch))
242                    {
243                    case KEY_NULL:
244                            return -1;
245                    case KEY_TIMEOUT:
246                    case CR:
247                    case 'F':
248                            UTF8_fixed_width = 1;
249                            break;
250                    case 'D':
251                            UTF8_fixed_width = 0;
252                            break;
253                  default:                  default:
254                          continue;                          continue;
255                  }                  }
256    
257                    break;
258          }          }
259    
260          return 0;          return 0;
# Line 274  int bbs_main() Line 304  int bbs_main()
304          }          }
305    
306          // Set default charset          // Set default charset
307          if (io_conv_init(BBS_DEFAULT_CHARSET) < 0)          if (io_conv_init(BBS_default_charset) < 0)
308          {          {
309                  log_error("io_conv_init(%s) error\n", BBS_DEFAULT_CHARSET);                  log_error("io_conv_init(%s) error\n", BBS_default_charset);
310                  goto cleanup;                  goto cleanup;
311          }          }
312    
# Line 389  cleanup: Line 419  cleanup:
419          detach_article_block_shm();          detach_article_block_shm();
420          detach_trie_dict_shm();          detach_trie_dict_shm();
421    
422            // Cleanup BWF
423            bwf_unload();
424    
425          return 0;          return 0;
426  }  }


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

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