| 20 |
#include <stddef.h> |
#include <stddef.h> |
| 21 |
|
|
| 22 |
#define CTRL_SEQ_CLR_LINE "\033[K" |
#define CTRL_SEQ_CLR_LINE "\033[K" |
| 23 |
|
#define MSG_EXT_MAX_LEN 200 |
| 24 |
|
|
| 25 |
typedef int (*display_data_key_handler)(int *key, char *msg, size_t msg_len); |
struct display_ctx_t |
| 26 |
|
{ |
| 27 |
|
int reach_begin; // of data |
| 28 |
|
int reach_end; // of data |
| 29 |
|
long line_top; // current screen |
| 30 |
|
long line_bottom; // current screen |
| 31 |
|
char msg[MSG_EXT_MAX_LEN]; |
| 32 |
|
}; |
| 33 |
|
typedef struct display_ctx_t DISPLAY_CTX; |
| 34 |
|
|
| 35 |
|
typedef int (*display_data_key_handler)(int *p_key, DISPLAY_CTX *p_ctx); |
| 36 |
|
|
| 37 |
extern void moveto(int row, int col); |
extern void moveto(int row, int col); |
| 38 |
extern void clrtoeol(); |
extern void clrtoeol(); |