aboutsummaryrefslogtreecommitdiffstats
path: root/src/prototypes.h
blob: dd7dfeb841bdd939ffbaf528c967867637ef644a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
/* ansi.c */
extern int ansi_dispatch(ANSI *a, Context *c);
extern ANSI *ansi_new_from_terminal(TTY *t, int utf8);
/* crt.c */
extern void crt_erase(CRT *c, CRT_Pos s, CRT_Pos e, int ea, int color);
extern void crt_cls(CRT *c);
extern void crt_scroll_up(CRT *c, CRT_Pos s, CRT_Pos e, int ea, int color);
extern void crt_scroll_down(CRT *c, CRT_Pos s, CRT_Pos e, int ea, int color);
extern void crt_reset(CRT *c);
extern void crt_insert(CRT *c, CRT_CA ca);
/* html.c */
extern ANSI *ansi_new_html(FILE *f);
/* libsympathy.c */
/* render.c */
/* version.c */
/* vt102.c */
extern int vt102_cmd_length[128];
extern int vt102_cmd_termination[128];
extern void vt102_log_line(Context *c, int line);
extern void vt102_history(Context *c, CRT_Pos t, CRT_Pos b);
extern void vt102_clip_cursor(VT102 *v, CRT_Pos tl, CRT_Pos br);
extern void vt102_cursor_normalize(VT102 *v);
extern void vt102_cursor_carriage_return(VT102 *v);
extern void vt102_cursor_advance_line(Context *c);
extern void vt102_cursor_retreat_line(Context *c);
extern void vt102_do_pending_wrap(Context *c);
extern void vt102_cursor_advance(Context *c);
extern void vt102_cursor_retreat(VT102 *v);
extern void vt102_reset_tabs(VT102 *v);
extern void vt102_cursor_advance_tab(VT102 *v);
extern void vt102_cursor_retreat_tab(VT102 *v);
extern int vt102_cursor_home(VT102 *v);
extern int vt102_cursor_absolute(VT102 *v, int x, int y);
extern int vt102_cursor_relative(VT102 *v, int x, int y);
extern void vt102_delete_from_line(VT102 *v, CRT_Pos p);
extern void vt102_insert_into_line(VT102 *v, CRT_Pos p);
extern void vt102_change_mode(VT102 *v, int private, char *ns, int set);
extern void vt102_parse_mode_string(VT102 *v, char *buf, int len);
extern void vt102_change_attr(VT102 *v, char *na);
extern void vt102_parse_attr_string(VT102 *v, char *buf, int len);
extern void vt102_save_state(VT102 *v);
extern void vt102_restore_state(VT102 *v);
extern void vt102_regular_char(Context *c, VT102 *v, uint32_t ch);
extern int vt102_send_id(Context *c, char *buf);
extern void vt102_scs(Context *c, int g, int s);
extern void vt102_parse_csi(Context *c, char *buf, int len);
extern void vt102_parse_esc(Context *c);
extern void vt102_status_line(VT102 *v, char *str);
extern void vt102_parser_reset(VT102_parser *p);
extern void vt102_reset_state(VT102 *v);
extern void vt102_parse_char(Context *c, int ch);
extern void vt102_send(Context *c, uint8_t key);
extern void vt102_reset(VT102 *v);
extern VT102 *vt102_new(int width);
extern void vt102_set_ansi(VT102 *v, int ansi);
extern void vt102_free(VT102 *v);
/* tty.c */
extern void tty_pre_select(TTY *t, fd_set *rfds, fd_set *wfds);
extern int tty_get_status(TTY *t, TTY_Status *s);
extern int tty_get_baud(TTY *t);
extern void tty_set_baud(TTY *t, int rate);
extern void tty_send_break(TTY *t);
extern void tty_set_flow(TTY *t, int flow);
extern void tty_hangup(TTY *t);
extern void tty_parse_reset(Context *c);
extern void tty_analyse(Context *c);
extern TTY_Parser *tty_parser_new(void);
extern void tty_parse(Context *c, uint8_t *buf, int len);
/* keydis.c */
extern KeyDis *keydis_vt102_new(void);
extern KeyDis *keydis_ipc_new(Socket *s);
extern int keydis_key(KeyDis *t, Context *c, int key);
/* history.c */
extern History *history_new(int n);
extern void history_free(History *h);
extern void history_add(History *h, CRT_CA *c);
/* ring.c */
extern int ring_read(Ring *r, void *b, int n);
extern int ring_write(Ring *r, void *b, int n);
extern int ring_space(Ring *r);
extern int ring_bytes(Ring *r);
extern Ring *ring_new(int n);
/* ptty.c */
extern TTY *ptty_open(char *path, char *argv[], int width);
/* terminal.c */
extern int terminal_winches;
extern void terminal_atexit(void);
extern void terminal_getsize(TTY *_t);
extern void terminal_dispatch(void);
extern void terminal_register_handlers(void);
extern TTY *terminal_open(int rfd, int wfd);
/* util.c */
extern int wrap_read(int fd, void *buf, int len);
extern int wrap_write(int fd, void *buf, int len);
extern void set_nonblocking(int fd);
extern void set_blocking(int fd);
extern void default_termios(struct termios *termios);
extern void client_termios(struct termios *termios);
extern int fput_cp(FILE *f, uint32_t ch);
/* log.c */
extern Log *file_log_new(char *fn);
extern void log_f(Log *log, char *fmt, ...);
/* ipc.c */
extern IPC_Msg *ipc_check_for_message_in_slide(Slide *s);
extern void ipc_consume_message_in_slide(Slide *s);
extern int ipc_msg_send(Socket *s, IPC_Msg *m);
extern int ipc_msg_send_debug(Socket *s, char *msg);
extern int ipc_msg_send_history(Socket *s, History_ent *l);
extern int ipc_msg_send_vt102(Socket *s, VT102 *v);
extern int ipc_msg_send_key(Socket *s, int key);
extern int ipc_msg_send_term(Socket *s, void *buf, int len);
extern int ipc_msg_send_status(Socket *s, char *buf);
extern int ipc_msg_send_setbaud(Socket *s, int baud);
extern int ipc_msg_send_sendbreak(Socket *s);
extern int ipc_msg_send_setflow(Socket *s, int flow);
extern int ipc_msg_send_setansi(Socket *s, int ansi);
extern int ipc_msg_send_hangup(Socket *s);
/* slide.c */
extern void slide_free(Slide *s);
extern void slide_consume(Slide *s, int n);
extern void slide_added(Slide *s, int n);
extern Slide *slide_new(int n);
extern void slide_expand(Slide *s, int n);
/* symsocket.c */
extern int wrap_recv(int fd, void *buf, int len);
extern int wrap_send(int fd, void *buf, int len);
extern void socket_free(Socket *s);
extern void socket_free_parent(Socket *s);
extern Socket *socket_listen(char *path);
extern Socket *socket_accept(Socket *l);
extern Socket *socket_connect(char *path);
extern void socket_consume_msg(Socket *s);
extern void socket_pre_select(Socket *s, fd_set *rfds, fd_set *wfds);
extern int socket_post_select(Socket *s, fd_set *rfds, fd_set *wfds);
extern int socket_write(Socket *s, void *buf, int len);
/* serial.c */
extern TTY *serial_open(char *path, int lock_mode);
/* cmd.c */
extern void cmd_parse(Cmd *c, Context *ctx, char *buf);
extern void cmd_show_status(Cmd *c, Context *ctx);
extern int cmd_key(Cmd *c, Context *ctx, int key);
extern int cmd_activate(Cmd *c, Context *ctx);
extern void cmd_new_status(Cmd *c, Context *ctx, char *msg);
extern Cmd *cmd_new(void);
/* lockfile.c */
extern Filelist *filelist_new(void);
extern void filelist_remove(Filelist *fl, Filelist_ent *fle);
extern void filelist_add(Filelist *fl, char *fn);
extern void filelist_free(Filelist *fl);
extern void filelist_print(Filelist *fl, FILE *f);
extern int lockfile_make(char *name);
extern void lockfile_add_places(Filelist *fl, char *leaf);
extern void lockfile_regularize_and_add(Filelist *fl, char *leaf);
extern void lockfile_add_name_from_path(Filelist *fl, char *file);
extern void lockfile_add_name_from_dev(Filelist *fl, dev_t dev);
extern void lockfile_check_dir_for_dev(Filelist *fl, char *dir, dev_t dev);
extern Filelist *lockfile_make_list(char *device);
extern void lockfile_remove_stale(Filelist *fl);
extern Filelist *lockfile_lock(Filelist *fl);
extern void lockfile_unlock(Filelist *fl);
extern int serial_lock_check(Serial_lock *l);
extern void serial_lock_free(Serial_lock *l);
extern Serial_lock *serial_lock_new(char *dev, int mode);
/* utf8.c */
extern void utf8_flush(Context *c);
extern void utf8_parse(Context *c, uint32_t ch);
extern UTF8 *utf8_new(void);
extern int utf8_encode(char *ptr, int ch);
extern void utf8_emit(TTY *t, int ch);
/* vt102_charset.c */
extern uint32_t vt102_charset_c0[128];
extern uint32_t vt102_charset_us[128];
extern uint32_t vt102_charset_uk[128];
extern uint32_t vt102_charset_vt52[128];
extern uint32_t vt102_charset_gl[128];
extern uint32_t *charset_from_csid[];