00001 #ifndef _PDICTCLIENT_H_
00002 #define _PDICTCLIENT_H_
00003
00004 #include "pdict.h"
00005
00006 typedef struct pdc_session pdc_session_t;
00007 typedef int pdc_listen_id_t;
00008
00009 int CCONV pdc_init(void);
00010
00011 pdc_session_t * CCONV
00012 pdc_session_alloc(int readfd,
00013 int(*readfunc)(int, void *, unsigned int, char *, int),
00014 int writefd,
00015 int(*writefunc)(int, const void *, unsigned int, char *, int),
00016 int(*closefunc)(int, char *, int),
00017 void *cleanupPtr,
00018 void (*cleanupFunc)(void *));
00019
00020 void
00021 pdc_session_free(pdc_session_t *pdcs);
00022
00023
00024 void CCONV pdc_async_set(pdc_session_t *pdcs,
00025 const char *key,
00026 const char *val,
00027 int len,
00028 int remove_on_close,
00029 void (*error)(const char *errdesc, void *arg),
00030 void *arg);
00031
00032 pdc_listen_id_t CCONV
00033 pdc_listen(pdc_session_t *pdcs,
00034 const char *pattern,
00035 void (*cb)(const char *, const char *, unsigned int, pdict_reason_t, void *),
00036 void *ptr,
00037 char *errdesc,
00038 int errlen);
00039
00040 int CCONV
00041 pdc_disable_periodic_reports(pdc_session_t *pdc,
00042 char *errdesc,
00043 int errlen);
00044
00045 void CCONV
00046 pdc_async_disable_periodic_reports(pdc_session_t *pdc,
00047 void (*error)(const char *errdesc, void *arg),
00048 void *arg);
00049
00050 int CCONV
00051 pdc_enable_periodic_reports(pdc_session_t *pdc,
00052 int periodms,
00053 char *errdesc,
00054 int errlen);
00055
00056 void CCONV
00057 pdc_async_enable_periodic_reports(pdc_session_t *pdc,
00058 int periodms,
00059 void (*error)(const char *errdesc, void *arg),
00060 void *arg);
00061
00062 int CCONV
00063 pdc_ignore(pdc_session_t *pdcs,
00064 pdc_listen_id_t id,
00065 char *errdesc,
00066 int errlen);
00067
00068 void CCONV
00069 pdc_async_ignore(pdc_session_t *pdcs,
00070 pdc_listen_id_t id,
00071 void (*error)(const char *errdesc, void *arg),
00072 void *arg);
00073
00074 int CCONV
00075 pdc_flush(pdc_session_t *pdc,
00076 char *errdesc,
00077 int errlen);
00078
00079 int CCONV
00080 pdc_quit(pdc_session_t *pdc,
00081 char *errdesc,
00082 int errlen);
00083
00084 int CCONV
00085 pdc_remove(pdc_session_t *pdc,
00086 const char *pattern,
00087 char *errdesc,
00088 int errlen);
00089
00090 void CCONV
00091 pdc_async_remove(pdc_session_t *pdcs,
00092 const char *pattern,
00093 void (*error)(const char *errdesc, void *arg),
00094 void *arg);
00095
00096 int CCONV
00097 pdc_get(pdc_session_t *pdcs,
00098 const char *pattern,
00099 char *results,
00100 int resultslen,
00101 char *errdesc,
00102 int errlen);
00103
00104 int CCONV
00105 pdc_get_server_session_id(pdc_session_t *pdc,
00106 int *id,
00107 char *errdesc,
00108 int errlen);
00109
00110 int CCONV
00111 pdc_readthread_join(pdc_session_t *pdcs,
00112 void **status);
00113
00114 void CCONV
00115 pdc_async_authorize(pdc_session_t *pdcs,
00116 const char *version,
00117 char *password,
00118 void (*success) (void *arg, void (*error)(const char *errdesc, void *arg)),
00119 void (*error)(const char *errdesc, void *arg),
00120 void *arg);
00121
00122 void
00123 cleanup_pending(pdc_session_t *pdcs, void *arg);
00124
00125 void
00126 wait_pending(pdc_session_t *pdcs);
00127
00128 #endif