5 #include <doldaconnect/uilib.h>
6 #include <doldaconnect/uimisc.h>
8 void authcallback(int err, wchar_t *reason, void *data)
10 printf("Logged in: %i\n", err);
13 int main(int argc, char **argv)
18 struct dc_response *resp;
19 struct dc_intresp *ires;
22 fd = dc_connect("localhost", -1);
30 if(poll(&pfd, 1, -1) < 0)
35 if((pfd.revents & POLLIN) && dc_handleread())
37 if((pfd.revents & POLLOUT) && dc_handlewrite())
39 while((resp = dc_getresp()) != NULL)
41 if(resp->cmdname == NULL)
43 printf("Connected\n");
44 dc_loginasync(NULL, 0, NULL, authcallback, NULL);