| 14 |
* * |
* * |
| 15 |
***************************************************************************/ |
***************************************************************************/ |
| 16 |
|
|
|
#include "screen.h" |
|
| 17 |
#include "bbs.h" |
#include "bbs.h" |
| 18 |
#include "common.h" |
#include "common.h" |
|
#include "str_process.h" |
|
|
#include "log.h" |
|
|
#include "io.h" |
|
| 19 |
#include "editor.h" |
#include "editor.h" |
| 20 |
#include "file_loader.h" |
#include "file_loader.h" |
| 21 |
#include <fcntl.h> |
#include "io.h" |
| 22 |
|
#include "log.h" |
| 23 |
|
#include "login.h" |
| 24 |
|
#include "screen.h" |
| 25 |
|
#include "str_process.h" |
| 26 |
#include <ctype.h> |
#include <ctype.h> |
|
#include <unistd.h> |
|
|
#include <stdlib.h> |
|
| 27 |
#include <errno.h> |
#include <errno.h> |
| 28 |
#include <sys/types.h> |
#include <fcntl.h> |
| 29 |
#include <sys/stat.h> |
#include <string.h> |
| 30 |
|
#include <stdlib.h> |
| 31 |
|
#include <unistd.h> |
| 32 |
#include <sys/param.h> |
#include <sys/param.h> |
| 33 |
|
#include <sys/stat.h> |
| 34 |
#include <sys/shm.h> |
#include <sys/shm.h> |
| 35 |
|
#include <sys/types.h> |
|
#define _POSIX_C_SOURCE 200809L |
|
|
#include <string.h> |
|
| 36 |
|
|
| 37 |
#define ACTIVE_BOARD_HEIGHT 8 |
#define ACTIVE_BOARD_HEIGHT 8 |
| 38 |
|
|
| 300 |
percentile, |
percentile, |
| 301 |
ctx.msg); |
ctx.msg); |
| 302 |
|
|
| 303 |
len = split_line(buffer, SCREEN_COLS, &eol, &display_len); |
len = split_line(buffer, SCREEN_COLS, &eol, &display_len, 1); |
| 304 |
for (; display_len < SCREEN_COLS; display_len++) |
for (; display_len < SCREEN_COLS; display_len++) |
| 305 |
{ |
{ |
| 306 |
buffer[len++] = ' '; |
buffer[len++] = ' '; |
| 430 |
break; |
break; |
| 431 |
} |
} |
| 432 |
|
|
| 433 |
BBS_last_access_tm = time(0); |
BBS_last_access_tm = time(NULL); |
| 434 |
} |
} |
| 435 |
|
|
| 436 |
continue; |
continue; |
| 494 |
return KEY_NULL; |
return KEY_NULL; |
| 495 |
} |
} |
| 496 |
|
|
| 497 |
|
if (user_online_update("VIEW_FILE") < 0) |
| 498 |
|
{ |
| 499 |
|
log_error("user_online_update(VIEW_FILE) error\n"); |
| 500 |
|
} |
| 501 |
|
|
| 502 |
ret = display_data(p_data, line_total, p_line_offsets, eof_exit, display_file_key_handler, DATA_READ_HELP); |
ret = display_data(p_data, line_total, p_line_offsets, eof_exit, display_file_key_handler, DATA_READ_HELP); |
| 503 |
|
|
| 504 |
if (detach_file_shm(p_shm) < 0) |
if (detach_file_shm(p_shm) < 0) |
| 522 |
|
|
| 523 |
strncpy(str_left_f, str_left, sizeof(str_left_f) - 1); |
strncpy(str_left_f, str_left, sizeof(str_left_f) - 1); |
| 524 |
str_left_f[sizeof(str_left_f) - 1] = '\0'; |
str_left_f[sizeof(str_left_f) - 1] = '\0'; |
| 525 |
len = split_line(str_left_f, STR_TOP_LEFT_MAX_LEN, &eol, &str_left_len); |
len = split_line(str_left_f, STR_TOP_LEFT_MAX_LEN, &eol, &str_left_len, 1); |
| 526 |
str_left_f[len] = '\0'; |
str_left_f[len] = '\0'; |
| 527 |
|
|
| 528 |
strncpy(str_middle_f, str_middle, sizeof(str_middle_f) - 1); |
strncpy(str_middle_f, str_middle, sizeof(str_middle_f) - 1); |
| 529 |
str_middle_f[sizeof(str_middle_f) - 1] = '\0'; |
str_middle_f[sizeof(str_middle_f) - 1] = '\0'; |
| 530 |
len = split_line(str_middle, STR_TOP_MIDDLE_MAX_LEN, &eol, &str_middle_len); |
len = split_line(str_middle, STR_TOP_MIDDLE_MAX_LEN, &eol, &str_middle_len, 1); |
| 531 |
str_middle_f[len] = '\0'; |
str_middle_f[len] = '\0'; |
| 532 |
|
|
| 533 |
strncpy(str_right_f, str_right, sizeof(str_right_f) - 1); |
strncpy(str_right_f, str_right, sizeof(str_right_f) - 1); |
| 534 |
str_right_f[sizeof(str_right_f) - 1] = '\0'; |
str_right_f[sizeof(str_right_f) - 1] = '\0'; |
| 535 |
len = split_line(str_right, STR_TOP_RIGHT_MAX_LEN, &eol, &str_right_len); |
len = split_line(str_right, STR_TOP_RIGHT_MAX_LEN, &eol, &str_right_len, 1); |
| 536 |
str_right_f[len] = '\0'; |
str_right_f[len] = '\0'; |
| 537 |
|
|
| 538 |
moveto(1, 0); |
moveto(1, 0); |
| 563 |
{ |
{ |
| 564 |
strncpy(msg_f, msg, sizeof(msg_f) - 1); |
strncpy(msg_f, msg, sizeof(msg_f) - 1); |
| 565 |
msg_f[sizeof(msg_f) - 1] = '\0'; |
msg_f[sizeof(msg_f) - 1] = '\0'; |
| 566 |
len = split_line(msg_f, 23, &eol, &msg_len); |
len = split_line(msg_f, 23, &eol, &msg_len, 1); |
| 567 |
msg_f[len] = '\0'; |
msg_f[len] = '\0'; |
| 568 |
} |
} |
| 569 |
|
|
| 570 |
len_username = (int)strnlen(BBS_username, sizeof(BBS_username)); |
len_username = (int)strnlen(BBS_username, sizeof(BBS_username)); |
| 571 |
|
|
| 572 |
time_online = time(0) - BBS_login_tm; |
time_online = time(NULL) - BBS_login_tm; |
| 573 |
tm_online = gmtime(&time_online); |
tm_online = gmtime(&time_online); |
| 574 |
if (tm_online->tm_mday > 1) |
if (tm_online->tm_mday > 1) |
| 575 |
{ |
{ |
| 616 |
} |
} |
| 617 |
} |
} |
| 618 |
|
|
| 619 |
if (time(0) - t_last_show >= 10) |
if (time(NULL) - t_last_show >= 10) |
| 620 |
{ |
{ |
| 621 |
line_last = line_current; |
line_last = line_current; |
| 622 |
t_last_show = time(0); |
t_last_show = time(NULL); |
| 623 |
} |
} |
| 624 |
else |
else |
| 625 |
{ |
{ |