d3372da9 |
1 | #ifndef _UILIB_H |
2 | #define _UILIB_H |
3 | |
4 | #include <wchar.h> |
5 | |
691f0a70 |
6 | #define DC_LATEST 1 |
7 | |
d3372da9 |
8 | struct dc_response |
9 | { |
10 | struct dc_response *next, *prev; |
11 | int code, tag; |
12 | wchar_t *cmdname; |
13 | void *data; |
14 | void *internal; |
34a61ecb |
15 | struct dc_respline |
d3372da9 |
16 | { |
17 | int argc; |
18 | wchar_t **argv; |
19 | } *rlines; |
113b3e9a |
20 | size_t linessize; |
d3372da9 |
21 | int numlines; |
22 | int curline; |
23 | }; |
24 | |
25 | struct dc_intresp |
26 | { |
27 | int code; |
28 | int argc; |
29 | struct |
30 | { |
31 | int type; |
32 | union |
33 | { |
34 | int num; |
35 | wchar_t *str; |
36 | double flnum; |
37 | } val; |
38 | } *argv; |
39 | }; |
40 | |
41 | int dc_init(void); |
42 | void dc_cleanup(void); |
43 | void dc_disconnect(void); |
44 | void dc_freeresp(struct dc_response *resp); |
45 | struct dc_response *dc_getresp(void); |
46 | struct dc_response *dc_gettaggedresp(int tag); |
47 | struct dc_response *dc_gettaggedrespsync(int tag); |
48 | int dc_wantwrite(void); |
49 | int dc_getstate(void); |
50 | int dc_queuecmd(int (*callback)(struct dc_response *), void *data, ...); |
51 | int dc_handleread(void); |
52 | int dc_handlewrite(void); |
12383d48 |
53 | int dc_connect(char *host); |
d3372da9 |
54 | struct dc_intresp *dc_interpret(struct dc_response *resp); |
55 | void dc_freeires(struct dc_intresp *ires); |
691f0a70 |
56 | int dc_checkprotocol(struct dc_response *resp, int revision); |
d3372da9 |
57 | const char *dc_gethostname(void); |
58 | |
59 | #endif |