| 17 |
#ifndef _SCREEN_H_ |
#ifndef _SCREEN_H_ |
| 18 |
#define _SCREEN_H_ |
#define _SCREEN_H_ |
| 19 |
|
|
| 20 |
extern int screen_rows; |
#include <stddef.h> |
|
extern int screen_cols; |
|
| 21 |
|
|
| 22 |
extern void moveto(int row, int col); |
#define CTRL_SEQ_CLR_LINE "\033[K" |
| 23 |
|
#define MSG_EXT_MAX_LEN 400 |
| 24 |
|
|
| 25 |
extern void clrtoeol(); |
struct display_ctx_t |
| 26 |
|
{ |
| 27 |
|
int reach_begin; |
| 28 |
|
int reach_end; |
| 29 |
|
long line_top; |
| 30 |
|
long line_bottom; |
| 31 |
|
char msg[MSG_EXT_MAX_LEN]; |
| 32 |
|
}; |
| 33 |
|
typedef struct display_ctx_t DISPLAY_CTX; |
| 34 |
|
|
| 35 |
extern void clrline(int line_begin, int line_end); |
typedef int (*display_data_key_handler)(int *p_key, DISPLAY_CTX *p_ctx); |
| 36 |
|
|
| 37 |
|
extern void moveto(int row, int col); |
| 38 |
|
extern void clrtoeol(); |
| 39 |
|
extern void clrline(int line_begin, int line_end); |
| 40 |
extern void clrtobot(int line_begin); |
extern void clrtobot(int line_begin); |
|
|
|
| 41 |
extern void clearscr(); |
extern void clearscr(); |
| 42 |
|
|
| 43 |
extern int press_any_key(); |
extern int press_any_key(); |
| 44 |
|
extern int press_any_key_ex(const char *msg, int sec); |
| 45 |
|
|
| 46 |
extern void set_input_echo(int echo); |
extern void set_input_echo(int echo); |
| 47 |
|
|
| 48 |
extern int str_input(char *buffer, int buffer_length, int echo_mode); |
extern int str_input(char *buffer, int buffer_length, int echo_mode); |
| 49 |
|
extern int get_data(int row, int col, char *prompt, char *buffer, int buffer_length, int max_display_len); |
| 50 |
|
|
| 51 |
extern int get_data(int row, int col, char *prompt, char *buffer, int buffer_length, int echo_mode); |
// eof_exit = 0 : Do not exit at EOF |
| 52 |
|
// 1 : Prompt for any key at EOF, then exit |
| 53 |
extern int display_file(const char *filename); |
// 2 : Exit at EOF without prompt |
| 54 |
|
extern int display_data(const void *p_data, long display_line_total, const long *p_line_offsets, int eof_exit, |
| 55 |
extern int display_file_ex(const char *filename, int begin_line, int wait); |
display_data_key_handler key_handler, const char *help_filename); |
| 56 |
|
extern int display_file(const char *filename, int eof_exit); |
|
extern int show_top(char *status); |
|
| 57 |
|
|
| 58 |
extern int show_bottom(char *msg); |
extern int show_top(const char *str_left, const char *str_center, const char *str_right); |
| 59 |
|
extern int show_bottom(const char *msg); |
| 60 |
|
|
| 61 |
extern int show_active_board(); |
extern int show_active_board(); |
| 62 |
|
|