/* ansi.c */
-void ansi_write(ANSI *a, char *buf, int n);
-void ansi_getsize(ANSI *a);
void ansi_move(ANSI *a, CRT_Pos p);
void ansi_showhide_cursor(ANSI *a, int hide);
void ansi_force_attr_normal(ANSI *a);
+void ansi_set_color(ANSI *a, int color);
void ansi_set_attr(ANSI *a, int attr);
void ansi_render(ANSI *a, CRT_CA ca);
void ansi_cls(ANSI *a);
+int ansi_scroll_up(ANSI *a, CRT_Pos s, CRT_Pos e);
+void ansi_spot_scroll_up(ANSI *a, CRT *c);
+void ansi_spot_scroll(ANSI *a, CRT *c);
void ansi_draw(ANSI *a, CRT *c);
void ansi_reset(ANSI *a);
-void ansi_parse_char(ANSI *a, int c, VT102 *v);
-void ansi_parse(ANSI *a, char *buf, int len, VT102 *v);
-int ansi_dispatch(ANSI *a, VT102 *v);
+void ansi_flush_escape(ANSI *a, Context *c);
+void ansi_parse_deckey(ANSI *a, Context *c);
+void ansi_parse_ansikey(ANSI *a, Context *c);
+void ansi_parse_escape(ANSI *a, Context *c);
+void ansi_check_escape(ANSI *a, Context *c);
+void ansi_parse_char(ANSI *a, Context *c, int ch);
+void ansi_parse(ANSI *a, Context *c, char *buf, int len);
+int ansi_dispatch(ANSI *a, Context *c);
/* crt.c */
void crt_erase(CRT *c, CRT_Pos s, CRT_Pos e, int ea);
void crt_cls(CRT *c);
struct termios old;
void testy(void);
/* render.c */
-/* testtty.c */
-int open_fd_to_bash(void);
/* version.c */
/* vt102.c */
void vt102_log_line(VT102 *v, int line);
void vt102_parse_attr_string(VT102 *v, char *buf, int len);
void vt102_save_state(VT102 *v);
void vt102_restore_state(VT102 *v);
+void vt102_scs(VT102 *c, int g, int s);
void vt102_parse_esc(VT102 *v, int c);
void vt102_parse_csi(VT102 *v, char *buf, int len);
void vt102_status_line(VT102 *v, char *str);
-void vt102_parse_char(VT102 *v, int c);
-int vt102_parse(VT102 *v, char *buf, int len);
+void vt102_parse_char(VT102 *v, int c, TTY *tty);
+int vt102_parse(VT102 *v, char *buf, int len, TTY *t);
void vt102_parser_reset(VT102_parser *p);
-void vt102_send(VT102 *v, uint8_t key);
+void vt102_send(VT102 *v, uint8_t key, TTY *tty);
void vt102_reset(VT102 *v);
-int vt102_dispatch(VT102 *v);
-VT102 *vt102_new(TTY *t);
+int vt102_dispatch(VT102 *v, TTY *tty);
+int vt102_dispatch_one(VT102 *v, TTY *tty);
+VT102 *vt102_new(void);
void vt102_free(VT102 *v);
+/* tty.c */
+/* history.c */
+History *history_new(int n);
+void history_free(History *h);
+void history_add(History *h, CRT_CA *c);
+/* ring.c */
+int ring_read(Ring *r, void *b, int n);
+int ring_write(Ring *r, void *b, int n);
+Ring *ring_new(int n);
+/* ptty.c */
+TTY *ptty_open(char *path, char *argv[]);