Adding upstream version 3.51.
[syslinux-debian/hramrach.git] / com32 / lib / sys / ansi.h
blob7ea3f83cc57b970f15b223fc0680ab0ac27bf35f
1 /*
2 * ansi.h
3 */
5 #ifndef COM32_LIB_SYS_ANSI_H
6 #define COM32_LIB_SYS_ANSI_H
8 #include <inttypes.h>
10 #define ANSI_MAX_PARMS 16
12 enum ansi_state {
13 st_init,
14 st_esc,
15 st_csi,
16 st_tbl,
17 st_tblc,
20 struct curxy {
21 uint8_t x, y;
22 } __attribute__((packed));
24 struct term_state {
25 struct curxy xy;
26 int attr; /* Current display attribute */
27 int cindex; /* SOH color index */
28 int vtgraphics; /* VT graphics on/off */
29 int intensity;
30 int underline;
31 int blink;
32 int reverse;
33 int fg;
34 int bg;
35 int autocr;
36 struct curxy saved_xy;
37 int cursor;
38 enum ansi_state state;
39 int pvt; /* Private code? */
40 int nparms; /* Number of parameters seen */
41 int parms[ANSI_MAX_PARMS];
45 struct ansi_ops {
46 void (*erase)(const struct term_state *st, int x0, int y0, int x1, int y1);
47 void (*write_char)(int x, int y, uint8_t ch, const struct term_state *st);
48 void (*showcursor)(const struct term_state *st);
49 void (*scroll_up)(const struct term_state *st);
50 void (*set_cursor)(int x, int y, int visible);
53 struct term_info {
54 int rows, cols; /* Screen size */
55 int disabled;
56 struct term_state *ts;
57 const struct ansi_ops *op;
60 void __ansi_init(const struct term_info *ti);
61 void __ansi_putchar(const struct term_info *ti, uint8_t ch);
63 #endif /* COM32_LIB_SYS_ANSI_H */