| 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() |
| 209 |
ch = igetch(100); // 0.1 second |
ch = igetch(100); // 0.1 second |
| 210 |
if (ch == KEY_NULL || ch == KEY_TIMEOUT) // Ignore received bytes if no futher input |
if (ch == KEY_NULL || ch == KEY_TIMEOUT) // Ignore received bytes if no futher input |
| 211 |
{ |
{ |
| 212 |
#ifdef _DEBUG |
log_debug("Ignore %d bytes of incomplete UTF8 character\n", str_len); |
|
log_error("Ignore %d bytes of incomplete UTF8 character\n", str_len); |
|
|
#endif |
|
| 213 |
str_len = 0; |
str_len = 0; |
| 214 |
break; |
break; |
| 215 |
} |
} |
| 531 |
ch = igetch(100); // 0.1 second |
ch = igetch(100); // 0.1 second |
| 532 |
if (ch == KEY_NULL || ch == KEY_TIMEOUT) // Ignore received bytes if no futher input |
if (ch == KEY_NULL || ch == KEY_TIMEOUT) // Ignore received bytes if no futher input |
| 533 |
{ |
{ |
| 534 |
#ifdef _DEBUG |
log_debug("Ignore %d bytes of incomplete UTF8 character\n", str_len); |
|
log_error("Ignore %d bytes of incomplete UTF8 character\n", str_len); |
|
|
#endif |
|
| 535 |
str_len = 0; |
str_len = 0; |
| 536 |
break; |
break; |
| 537 |
} |
} |
| 699 |
if (ch != KEY_NULL && ch != KEY_TIMEOUT) |
if (ch != KEY_NULL && ch != KEY_TIMEOUT) |
| 700 |
{ |
{ |
| 701 |
BBS_last_access_tm = time(NULL); |
BBS_last_access_tm = time(NULL); |
| 702 |
|
|
| 703 |
|
// Refresh current action |
| 704 |
|
if (user_online_update(NULL) < 0) |
| 705 |
|
{ |
| 706 |
|
log_error("user_online_update(NULL) error\n"); |
| 707 |
|
} |
| 708 |
} |
} |
| 709 |
|
|
| 710 |
// extended key handler |
// extended key handler |
| 716 |
switch (ch) |
switch (ch) |
| 717 |
{ |
{ |
| 718 |
case KEY_NULL: |
case KEY_NULL: |
| 719 |
log_error("KEY_NULL\n"); |
log_debug("KEY_NULL\n"); |
| 720 |
goto cleanup; |
goto cleanup; |
| 721 |
case KEY_TIMEOUT: |
case KEY_TIMEOUT: |
| 722 |
log_error("User input timeout\n"); |
log_error("User input timeout\n"); |