Adding upstream version 3.31.
[syslinux-debian/hramrach.git] / com32 / lib / sys / ansi.h
blobec2c58cbb5f1689b9e3967a6e96647e771695052
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_soh,
17 st_sohc,
18 st_sohc1,
21 struct curxy {
22 uint8_t x, y;
23 } __attribute__((packed));
25 struct term_state {
26 struct curxy xy;
27 int attr; /* Current display attribute */
28 int cindex; /* SOH color index */
29 int vtgraphics; /* VT graphics on/off */
30 int intensity;
31 int underline;
32 int blink;
33 int reverse;
34 int fg;
35 int bg;
36 int autocr;
37 struct curxy saved_xy;
38 int cursor;
39 enum ansi_state state;
40 int pvt; /* Private code? */
41 int nparms; /* Number of parameters seen */
42 int parms[ANSI_MAX_PARMS];
46 struct ansi_ops {
47 void (*erase)(const struct term_state *st, int x0, int y0, int x1, int y1);
48 void (*write_char)(int x, int y, uint8_t ch, const struct term_state *st);
49 void (*showcursor)(const struct term_state *st);
50 void (*scroll_up)(const struct term_state *st);
51 void (*set_cursor)(int x, int y, int visible);
54 struct term_info {
55 int rows, cols; /* Screen size */
56 int disabled;
57 struct term_state *ts;
58 const struct ansi_ops *op;
61 void __ansi_init(const struct term_info *ti);
62 void __ansi_putchar(const struct term_info *ti, uint8_t ch);
64 #endif /* COM32_LIB_SYS_ANSI_H */