updated docs
[rlserver.git] / vt100.h
blobaf7e7917821271d1b5a6a275b2535174e3275180
1 #ifndef __RLS_VT100__
2 #define __RLS_VT100__
4 #include <stdint.h>
7 #define VT100_ESC_BUF 24
9 typedef struct vt100
11 int wid, hgt; // size
12 int cx, cy; // cursor position
13 enum
15 CM_NORM = 0,
16 CM_HIDE,
17 CM_BIG
18 } cmode; // cursor mode
19 int att, col; // current attribute and colour
20 uint8_t *screen, *colour, *attrib; // screen data
22 uint8_t esc[VT100_ESC_BUF]; // buffer for escape sequence
23 int esc_len;
25 uint8_t prev_char;
26 } vt100;
29 vt100* init_term (int width, int height);
30 vt100* resize_term (vt100 *term, int width, int height);
31 void term_process (vt100 *term, const char *data, int len);
32 void term_copy_data (vt100 *term, int fd);
34 #endif