1 #ifndef __TERMINFO_CORE_H
2 #define __TERMINFO_CORE_H
6 #define terminfo_move(x, y) current_term->move(current_term, x, y)
7 #define terminfo_move_relative(oldx, oldy, x, y) current_term->move_relative(current_term, oldx, oldy, x, y)
8 #define terminfo_set_cursor_visible(set) current_term->set_cursor_visible(current_term, set)
9 #define terminfo_scroll(y1, y2, count) current_term->scroll(current_term, y1, y2, count)
10 #define terminfo_clear() current_term->clear(current_term)
11 #define terminfo_clrtoeol() current_term->clrtoeol(current_term)
12 #define terminfo_repeat(chr, count) current_term->repeat(current_term, chr, count)
13 #define terminfo_set_fg(color) current_term->set_fg(current_term, color)
14 #define terminfo_set_bg(color) current_term->set_bg(current_term, color)
15 #define terminfo_set_normal() current_term->set_normal(current_term)
16 #define terminfo_set_bold() current_term->set_bold(current_term)
17 #define terminfo_set_uline(set) current_term->set_uline(current_term, set)
18 #define terminfo_set_standout(set) current_term->set_standout(current_term, set)
19 #define terminfo_is_colors_set(term) (term->TI_fg[0] != NULL)
20 #define terminfo_beep(term) current_term->beep(current_term)
22 typedef struct _TERM_REC TERM_REC;
26 void (*move)(TERM_REC *term, int x, int y);
27 void (*move_relative)(TERM_REC *term, int oldx, int oldy, int x, int y);
28 void (*set_cursor_visible)(TERM_REC *term, int set);
29 void (*scroll)(TERM_REC *term, int y1, int y2, int count);
31 void (*clear)(TERM_REC *term);
32 void (*clrtoeol)(TERM_REC *term);
33 void (*repeat)(TERM_REC *term, int chr, int count);
35 void (*set_fg)(TERM_REC *term, int color);
36 void (*set_bg)(TERM_REC *term, int color);
37 void (*set_normal)(TERM_REC *term);
38 void (*set_bold)(TERM_REC *term);
39 void (*set_uline)(TERM_REC *term, int set);
40 void (*set_standout)(TERM_REC *term, int set);
42 void (*beep)(TERM_REC *term);
45 char buffer1[1024], buffer2[1024];
48 struct termios tio, old_tio;
54 const char *TI_smcup, *TI_rmcup, *TI_cup;
55 const char *TI_hpa, *TI_vpa, *TI_cub1, *TI_cuf1;
56 const char *TI_civis, *TI_cnorm;
59 const char *TI_csr, *TI_wind;
60 const char *TI_ri, *TI_rin, *TI_ind, *TI_indn;
61 const char *TI_il, *TI_il1, *TI_dl, *TI_dl1;
64 const char *TI_clear, *TI_ed; /* + *TI_dl, *TI_dl1; */
66 /* Clearing to end of line */
69 /* Repeating character */
74 const char *TI_sgr0; /* turn off all attributes */
75 const char *TI_smul, *TI_rmul; /* underline on/off */
76 const char *TI_smso, *TI_rmso; /* standout on/off */
77 const char *TI_bold, *TI_blink;
78 const char *TI_setaf, *TI_setab, *TI_setf, *TI_setb;
80 /* Colors - generated and dynamically allocated */
81 char *TI_fg[16], *TI_bg[16], *TI_normal;
87 extern TERM_REC *current_term;
89 TERM_REC *terminfo_core_init(FILE *in, FILE *out);
90 void terminfo_core_deinit(TERM_REC *term);
92 /* Setup colors - if force is set, use ANSI-style colors if
93 terminal capabilities don't contain color codes */
94 void terminfo_setup_colors(TERM_REC *term, int force);
96 /* Terminal was resized - ask the width/height from terminfo again */
97 void terminfo_resize(TERM_REC *term);
99 void terminfo_cont(TERM_REC *term);
100 void terminfo_stop(TERM_REC *term);