X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fevent_client.h;h=b136c2e670a975d1516398c235fe18c347d82967;hb=15fc2bf9cd4d2a34fd91aa16c4f632ee46e72dd8;hp=9c13039914c6338c49512a456629913828333470;hpb=cc799e45c4a9c09723847fb394f376a3b45bec2d;p=citadel.git diff --git a/citadel/event_client.h b/citadel/event_client.h index 9c1303991..b136c2e67 100644 --- a/citadel/event_client.h +++ b/citadel/event_client.h @@ -23,7 +23,46 @@ #include #include +#ifndef __ASYNCIO__ +#define __ASYNCIO__ typedef struct AsyncIO AsyncIO; +#endif +#ifndef __CIT_CONTEXT__ +#define __CIT_CONTEXT__ +typedef struct CitContext CitContext; +#endif + +typedef enum __eIOState { + eDBQ, + eQDBNext, + eDBAttach, + eDBNext, + eDBStop, + eDBX, + eDBTerm, + eIOQ, + eIOAttach, + eIOConnectSock, + eIOAbort, + eIOTimeout, + eIOConnfail, + eIOConnfailNow, + eIOConnNow, + eIOConnWait, + eCurlQ, + eCurlStart, + eCurlShutdown, + eCurlNewIO, + eCurlGotIO, + eCurlGotData, + eCurlGotStatus, + eCaresStart, + eCaresDoneIO, + eCaresFinished, + eCaresX, + eKill, + eExit +}eIOState; typedef enum _eNextState { eSendDNSQuery, @@ -45,6 +84,8 @@ typedef enum _eNextState { eAbort }eNextState; +void SetEVState(AsyncIO *IO, eIOState State); + typedef eNextState (*IO_CallBack)(AsyncIO *IO); typedef eReadState (*IO_LineReaderCallback)(AsyncIO *IO); typedef void (*ParseDNSAnswerCb)(AsyncIO*, unsigned char*, int); @@ -70,6 +111,8 @@ typedef struct _DNSQueryParts { ParseDNSAnswerCb DNS_CB; IO_CallBack PostDNS; + const char *QueryTYPE; + const char *QStr; int DNSStatus; void *VParsedDNSReply; FreeDNSReply DNSReplyFree; @@ -164,7 +207,7 @@ struct AsyncIO { /* Context specific data; Hint: put AsyncIO in there */ void *Data; /* application specific data */ - void *CitContext; /* Citadel Session context... */ + CitContext *CitContext; /* Citadel Session context... */ }; typedef struct _IOAddHandler { @@ -235,9 +278,11 @@ void FreeAsyncIOContents(AsyncIO *IO); eNextState NextDBOperation(AsyncIO *IO, IO_CallBack CB); eNextState QueueDBOperation(AsyncIO *IO, IO_CallBack CB); +eNextState EventQueueDBOperation(AsyncIO *IO, IO_CallBack CB); void StopDBWatchers(AsyncIO *IO); eNextState QueueEventContext(AsyncIO *IO, IO_CallBack CB); eNextState QueueCurlContext(AsyncIO *IO); +eNextState DBQueueEventContext(AsyncIO *IO, IO_CallBack CB); eNextState EvConnectSock(AsyncIO *IO, double conn_timeout, @@ -296,9 +341,10 @@ int InitcURLIOStruct(AsyncIO *IO, IO_CallBack Terminate, IO_CallBack DBTerminate, IO_CallBack ShutdownAbort); - +void KillAsyncIOContext(AsyncIO *IO); void StopCurlWatchers(AsyncIO *IO); +eNextState CurlQueueDBOperation(AsyncIO *IO, IO_CallBack CB); eNextState ReAttachIO(AsyncIO *IO, void *pData,