| 14 |
* * |
* * |
| 15 |
***************************************************************************/ |
***************************************************************************/ |
| 16 |
|
|
|
#define _POSIX_C_SOURCE 200809L |
|
|
|
|
| 17 |
#include "editor.h" |
#include "editor.h" |
| 18 |
#include "bbs.h" |
#include "bbs.h" |
| 19 |
#include "io.h" |
#include "io.h" |
| 22 |
#include "str_process.h" |
#include "str_process.h" |
| 23 |
#include "memory_pool.h" |
#include "memory_pool.h" |
| 24 |
#include <stdlib.h> |
#include <stdlib.h> |
|
#include <sys/param.h> |
|
|
#include <strings.h> |
|
| 25 |
#include <string.h> |
#include <string.h> |
| 26 |
|
#include <sys/param.h> |
| 27 |
|
|
| 28 |
#define EDITOR_ESC_DISPLAY_STR "\033[32m*\033[m" |
#define EDITOR_ESC_DISPLAY_STR "\033[32m*\033[m" |
| 29 |
#define EDITOR_MEM_POOL_LINE_PER_CHUNK 1000 |
#define EDITOR_MEM_POOL_LINE_PER_CHUNK 1000 |
| 278 |
{ |
{ |
| 279 |
if (p_editor_data->display_line_total >= MAX_EDITOR_DATA_LINES) |
if (p_editor_data->display_line_total >= MAX_EDITOR_DATA_LINES) |
| 280 |
{ |
{ |
| 281 |
// log_error("Split line error, display_line_total(%ld) reach limit(%d)\n", |
#ifdef _DEBUG |
| 282 |
// p_editor_data->display_line_total, MAX_EDITOR_DATA_LINES); |
log_error("Split line error, display_line_total(%ld) reach limit(%d)\n", |
| 283 |
|
p_editor_data->display_line_total, MAX_EDITOR_DATA_LINES); |
| 284 |
|
#endif |
| 285 |
|
|
| 286 |
return -2; |
return -2; |
| 287 |
} |
} |
| 288 |
|
|
| 371 |
// Insert blank display line after last_display_line |
// Insert blank display line after last_display_line |
| 372 |
if (p_editor_data->display_line_total >= MAX_EDITOR_DATA_LINES) |
if (p_editor_data->display_line_total >= MAX_EDITOR_DATA_LINES) |
| 373 |
{ |
{ |
| 374 |
// log_error("display_line_total over limit %d >= %d\n", p_editor_data->display_line_total, MAX_EDITOR_DATA_LINES); |
#ifdef _DEBUG |
| 375 |
|
log_error("display_line_total over limit %d >= %d\n", p_editor_data->display_line_total, MAX_EDITOR_DATA_LINES); |
| 376 |
|
#endif |
| 377 |
|
|
| 378 |
// Terminate prior display line with \n, to avoid error on cleanup |
// Terminate prior display line with \n, to avoid error on cleanup |
| 379 |
if (display_line + i - 1 >= 0 && p_editor_data->display_line_lengths[display_line + i - 1] > 0) |
if (display_line + i - 1 >= 0 && p_editor_data->display_line_lengths[display_line + i - 1] > 0) |
| 380 |
{ |
{ |