Added 64-bit types to the library.
[doldaconnect.git] / include / doldaconnect / uilib.h
... / ...
CommitLineData
1#ifndef _UILIB_H
2#define _UILIB_H
3
4#include <wchar.h>
5
6#define DC_LATEST 2
7
8typedef long long dc_lnum_t;
9
10struct dc_response
11{
12 struct dc_response *next, *prev;
13 int code, tag;
14 wchar_t *cmdname;
15 void *data;
16 void *internal;
17 struct dc_respline
18 {
19 int argc;
20 wchar_t **argv;
21 } *rlines;
22 size_t linessize;
23 int numlines;
24 int curline;
25};
26
27struct dc_intresp
28{
29 int code;
30 int argc;
31 struct
32 {
33 int type;
34 union
35 {
36 int num;
37 dc_lnum_t lnum;
38 wchar_t *str;
39 double flnum;
40 } val;
41 } *argv;
42};
43
44char *dc_srv_local;
45
46int dc_init(void);
47void dc_cleanup(void);
48void dc_disconnect(void);
49void dc_freeresp(struct dc_response *resp);
50struct dc_response *dc_getresp(void);
51struct dc_response *dc_gettaggedresp(int tag);
52struct dc_response *dc_gettaggedrespsync(int tag);
53int dc_wantwrite(void);
54int dc_getstate(void);
55int dc_queuecmd(int (*callback)(struct dc_response *), void *data, ...);
56int dc_handleread(void);
57int dc_handlewrite(void);
58int dc_connect(char *host);
59int dc_connectsync(char *host, struct dc_response **respbuf);
60int dc_connectsync2(char *host, int rev);
61struct dc_intresp *dc_interpret(struct dc_response *resp);
62void dc_freeires(struct dc_intresp *ires);
63int dc_checkprotocol(struct dc_response *resp, int revision);
64const char *dc_gethostname(void);
65int dc_getfd(void);
66
67#endif