| 24 |
#include <stdlib.h> |
#include <stdlib.h> |
| 25 |
#include <sys/param.h> |
#include <sys/param.h> |
| 26 |
#include <strings.h> |
#include <strings.h> |
|
|
|
|
#define _POSIX_C_SOURCE 200809L |
|
| 27 |
#include <string.h> |
#include <string.h> |
| 28 |
|
|
| 29 |
#define EDITOR_ESC_DISPLAY_STR "\033[32m*\033[m" |
#define EDITOR_ESC_DISPLAY_STR "\033[32m*\033[m" |
| 136 |
p_data_line[current_data_line_length] = '\0'; |
p_data_line[current_data_line_length] = '\0'; |
| 137 |
} |
} |
| 138 |
|
|
| 139 |
bzero(p_editor_data->p_display_lines + p_editor_data->display_line_total, MAX_EDITOR_DATA_LINES - (size_t)p_editor_data->display_line_total); |
memset(p_editor_data->p_display_lines + p_editor_data->display_line_total, 0, MAX_EDITOR_DATA_LINES - (size_t)p_editor_data->display_line_total); |
| 140 |
|
|
| 141 |
return p_editor_data; |
return p_editor_data; |
| 142 |
} |
} |
| 706 |
if ((ch >= 32 && ch < 127) || (ch > 127 && ch <= 255 && str_len == 2) || // Printable character or GBK |
if ((ch >= 32 && ch < 127) || (ch > 127 && ch <= 255 && str_len == 2) || // Printable character or GBK |
| 707 |
ch == CR || ch == KEY_ESC) // Special character |
ch == CR || ch == KEY_ESC) // Special character |
| 708 |
{ |
{ |
| 709 |
BBS_last_access_tm = time(0); |
BBS_last_access_tm = time(NULL); |
| 710 |
|
|
| 711 |
if (str_len == 0) // ch >= 32 && ch < 127 |
if (str_len == 0) // ch >= 32 && ch < 127 |
| 712 |
{ |
{ |
| 782 |
} |
} |
| 783 |
else if (ch == KEY_DEL || ch == BACKSPACE) // Del |
else if (ch == KEY_DEL || ch == BACKSPACE) // Del |
| 784 |
{ |
{ |
| 785 |
BBS_last_access_tm = time(0); |
BBS_last_access_tm = time(NULL); |
| 786 |
|
|
| 787 |
if (ch == BACKSPACE) |
if (ch == BACKSPACE) |
| 788 |
{ |
{ |
| 1059 |
break; |
break; |
| 1060 |
} |
} |
| 1061 |
|
|
| 1062 |
BBS_last_access_tm = time(0); |
BBS_last_access_tm = time(NULL); |
| 1063 |
|
|
| 1064 |
if (input_ok) |
if (input_ok) |
| 1065 |
{ |
{ |