| 6 |
* Copyright (C) 2004-2025 Leaflet <leaflet@leafok.com> |
* Copyright (C) 2004-2025 Leaflet <leaflet@leafok.com> |
| 7 |
*/ |
*/ |
| 8 |
|
|
| 9 |
|
#ifdef HAVE_CONFIG_H |
| 10 |
|
#include "config.h" |
| 11 |
|
#endif |
| 12 |
|
|
| 13 |
#include "bbs.h" |
#include "bbs.h" |
| 14 |
#include "common.h" |
#include "common.h" |
| 15 |
#include "editor.h" |
#include "editor.h" |
| 28 |
#include <wchar.h> |
#include <wchar.h> |
| 29 |
#include <sys/param.h> |
#include <sys/param.h> |
| 30 |
#include <sys/stat.h> |
#include <sys/stat.h> |
|
#include <sys/shm.h> |
|
| 31 |
#include <sys/types.h> |
#include <sys/types.h> |
| 32 |
|
|
| 33 |
const char CTRL_SEQ_CLR_LINE[] = "\033[K"; |
const char CTRL_SEQ_CLR_LINE[] = "\033[K"; |
| 88 |
void clearscr() |
void clearscr() |
| 89 |
{ |
{ |
| 90 |
prints("\033[2J"); |
prints("\033[2J"); |
| 91 |
moveto(0, 0); |
moveto(1, 1); |
| 92 |
} |
} |
| 93 |
|
|
| 94 |
inline int press_any_key() |
inline int press_any_key() |
| 703 |
if (ch != KEY_NULL && ch != KEY_TIMEOUT) |
if (ch != KEY_NULL && ch != KEY_TIMEOUT) |
| 704 |
{ |
{ |
| 705 |
BBS_last_access_tm = time(NULL); |
BBS_last_access_tm = time(NULL); |
| 706 |
|
|
| 707 |
|
// Refresh current action |
| 708 |
|
if (user_online_update(NULL) < 0) |
| 709 |
|
{ |
| 710 |
|
log_error("user_online_update(NULL) error\n"); |
| 711 |
|
} |
| 712 |
} |
} |
| 713 |
|
|
| 714 |
// extended key handler |
// extended key handler |
| 720 |
switch (ch) |
switch (ch) |
| 721 |
{ |
{ |
| 722 |
case KEY_NULL: |
case KEY_NULL: |
| 723 |
|
#ifdef _DEBUG |
| 724 |
log_error("KEY_NULL\n"); |
log_error("KEY_NULL\n"); |
| 725 |
|
#endif |
| 726 |
goto cleanup; |
goto cleanup; |
| 727 |
case KEY_TIMEOUT: |
case KEY_TIMEOUT: |
| 728 |
log_error("User input timeout\n"); |
log_error("User input timeout\n"); |
| 878 |
int display_file(const char *filename, int eof_exit) |
int display_file(const char *filename, int eof_exit) |
| 879 |
{ |
{ |
| 880 |
int ret; |
int ret; |
| 881 |
const void *p_shm; |
void *p_shm; |
| 882 |
size_t data_len; |
size_t data_len; |
| 883 |
long line_total; |
long line_total; |
| 884 |
const void *p_data; |
const void *p_data; |