d3372da9 |
1 | #ifndef _UIMISC_H |
2 | #define _UIMISC_H |
3 | |
4 | #define DC_LOGIN_ERR_SUCCESS 0 |
5 | #define DC_LOGIN_ERR_NOLOGIN 1 |
6 | #define DC_LOGIN_ERR_SERVER 2 |
7 | #define DC_LOGIN_ERR_USER 3 |
8 | #define DC_LOGIN_ERR_CONV 4 |
9 | #define DC_LOGIN_ERR_AUTHFAIL 5 |
10 | |
11 | #define DC_LOGIN_CONV_NOECHO 0 |
12 | #define DC_LOGIN_CONV_ECHO 1 |
13 | #define DC_LOGIN_CONV_INFO 2 |
14 | #define DC_LOGIN_CONV_ERROR 3 |
15 | |
16 | #define DC_FNN_STATE_SYN 0 |
17 | #define DC_FNN_STATE_HS 1 |
18 | #define DC_FNN_STATE_EST 2 |
19 | #define DC_FNN_STATE_DEAD 3 |
20 | |
21 | #define DC_TRNS_WAITING 0 |
22 | #define DC_TRNS_HS 1 |
23 | #define DC_TRNS_MAIN 2 |
24 | #define DC_TRNS_DONE 3 |
25 | |
26 | #define DC_TRNSD_UNKNOWN 0 |
27 | #define DC_TRNSD_UP 1 |
28 | #define DC_TRNSD_DOWN 2 |
29 | |
30 | #define DC_TRNSE_NOERROR 0 |
31 | #define DC_TRNSE_NOTFOUND 1 |
32 | #define DC_TRNSE_NOSLOTS 2 |
33 | |
34 | #include <time.h> |
35 | |
36 | struct dc_fnetnode |
37 | { |
38 | struct dc_fnetnode *next, *prev; |
39 | int id; |
40 | wchar_t *name; |
41 | wchar_t *fnet; |
42 | int state; |
43 | int numusers; |
44 | int found; |
45 | void (*destroycb)(struct dc_fnetnode *fn); |
46 | void *udata; |
47 | }; |
48 | |
49 | struct dc_transfer |
50 | { |
51 | struct dc_transfer *next, *prev; |
52 | int id; |
53 | int dir, state; |
54 | wchar_t *peerid, *peernick; |
55 | wchar_t *path; |
56 | int size, curpos; |
57 | int found; |
58 | int error; |
59 | time_t errortime; |
60 | void (*destroycb)(struct dc_transfer *transfer); |
61 | void *udata; |
62 | }; |
63 | |
64 | void dc_loginasync(char *username, int useauthless, int (*conv)(int, wchar_t *, char **, void *), void (*callback)(int, wchar_t *, void *), void *udata); |
65 | struct dc_fnetnode *dc_findfnetnode(int id); |
66 | void dc_getfnlistasync(void (*callback)(int, void *), void *udata); |
67 | void dc_uimisc_handlenotify(struct dc_response *resp); |
68 | struct dc_transfer *dc_findtransfer(int id); |
69 | void dc_gettrlistasync(void (*callback)(int, void *), void *udata); |
70 | wchar_t **dc_lexsexpr(wchar_t *sexpr); |
71 | void dc_freewcsarr(wchar_t **arr); |
72 | |
73 | extern struct dc_fnetnode *dc_fnetnodes; |
74 | extern struct dc_transfer *dc_transfers; |
75 | |
76 | #endif |