| 3 |
* screen |
* screen |
| 4 |
* - advanced telnet-based user interactive input / output features |
* - advanced telnet-based user interactive input / output features |
| 5 |
* |
* |
| 6 |
* Copyright (C) 2004-2025 by Leaflet <leaflet@leafok.com> |
* Copyright (C) 2004-2025 Leaflet <leaflet@leafok.com> |
| 7 |
*/ |
*/ |
| 8 |
|
|
| 9 |
#include "bbs.h" |
#include "bbs.h" |
| 26 |
#include <sys/shm.h> |
#include <sys/shm.h> |
| 27 |
#include <sys/types.h> |
#include <sys/types.h> |
| 28 |
|
|
| 29 |
#define ACTIVE_BOARD_HEIGHT 8 |
const char CTRL_SEQ_CLR_LINE[] = "\033[K"; |
| 30 |
|
|
| 31 |
#define STR_TOP_LEFT_MAX_LEN 80 |
static const int ACTIVE_BOARD_HEIGHT = 8; |
| 32 |
#define STR_TOP_MIDDLE_MAX_LEN 40 |
|
| 33 |
#define STR_TOP_RIGHT_MAX_LEN 80 |
static const int STR_TOP_LEFT_MAX_LEN = 80; |
| 34 |
|
static const int STR_TOP_MIDDLE_MAX_LEN = 40; |
| 35 |
|
static const int STR_TOP_RIGHT_MAX_LEN = 80; |
| 36 |
|
|
| 37 |
static size_t get_time_str(char *s, size_t len) |
static size_t get_time_str(char *s, size_t len) |
| 38 |
{ |
{ |
| 129 |
iflush(); |
iflush(); |
| 130 |
} |
} |
| 131 |
|
|
| 132 |
static int _str_input(char *buffer, int buf_size, int max_display_len, int echo_mode) |
static int _str_input(char *buffer, int buf_size, int max_display_len, enum io_echo_t echo_mode) |
| 133 |
{ |
{ |
| 134 |
int ch; |
int ch; |
| 135 |
int offset = 0; |
int offset = 0; |
| 146 |
|
|
| 147 |
while (!SYS_server_exit) |
while (!SYS_server_exit) |
| 148 |
{ |
{ |
| 149 |
ch = igetch_t(MIN(MAX_DELAY_TIME, 60)); |
ch = igetch_t(MIN(BBS_max_user_idle_time, 60)); |
| 150 |
|
|
| 151 |
if (ch == CR) |
if (ch == CR) |
| 152 |
{ |
{ |
| 273 |
return offset; |
return offset; |
| 274 |
} |
} |
| 275 |
|
|
| 276 |
int str_input(char *buffer, int buf_size, int echo_mode) |
int str_input(char *buffer, int buf_size, enum io_echo_t echo_mode) |
| 277 |
{ |
{ |
| 278 |
int len; |
int len; |
| 279 |
|
|
| 316 |
|
|
| 317 |
while (!SYS_server_exit) |
while (!SYS_server_exit) |
| 318 |
{ |
{ |
| 319 |
ch = igetch_t(MIN(MAX_DELAY_TIME, 60)); |
ch = igetch_t(MIN(BBS_max_user_idle_time, 60)); |
| 320 |
|
|
| 321 |
if (ch == CR) |
if (ch == CR) |
| 322 |
{ |
{ |
| 647 |
input_ok = 0; |
input_ok = 0; |
| 648 |
while (!SYS_server_exit && !input_ok) |
while (!SYS_server_exit && !input_ok) |
| 649 |
{ |
{ |
| 650 |
ch = igetch_t(MAX_DELAY_TIME); |
ch = igetch_t(BBS_max_user_idle_time); |
| 651 |
input_ok = 1; |
input_ok = 1; |
| 652 |
|
|
| 653 |
if (ch != KEY_NULL && ch != KEY_TIMEOUT) |
if (ch != KEY_NULL && ch != KEY_TIMEOUT) |