unlink global struct and request structs
[citadel.git] / citadel / modules / eventclient / serv_curl.h
1 #include <curl/curl.h>
2
3
4 typedef struct _evcurl_request_data 
5 {
6         CURL *chnd;
7         char errdesc[CURL_ERROR_SIZE];
8         int attached;
9         char* PlainPostData;
10         long PlainPostDataLen;
11         StrBuf *PostData;
12         StrBuf *ReplyData;
13         ParsedURL *URL;
14         struct curl_slist * headers;
15 } evcurl_request_data;
16
17
18
19
20
21 #define OPT(s, v) \
22         do { \
23                 sta = curl_easy_setopt(chnd, (CURLOPT_##s), (v)); \
24                 if (sta)  {                                             \
25                         CtdlLogPrintf(CTDL_ERR, "error setting option " #s " on curl handle: %s", curl_easy_strerror(sta)); \
26         } } while (0)
27
28
29 int evcurl_init(evcurl_request_data *handle, 
30                 void *CustomData, 
31                 const char* Desc,
32                 int CallBack);
33
34 void evcurl_handle_start(evcurl_request_data *handle);