| 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" |
| 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" |
| 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) |
| 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; |
| 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 |
|
|
| 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 |
} |
} |