aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_curl_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_curl_lib.h')
-rw-r--r--src/include/gnunet_curl_lib.h70
1 files changed, 36 insertions, 34 deletions
diff --git a/src/include/gnunet_curl_lib.h b/src/include/gnunet_curl_lib.h
index af0e929a5..64b41ed83 100644
--- a/src/include/gnunet_curl_lib.h
+++ b/src/include/gnunet_curl_lib.h
@@ -54,7 +54,8 @@ typedef void
54 * @brief Buffer data structure we use to buffer the HTTP download 54 * @brief Buffer data structure we use to buffer the HTTP download
55 * before giving it to the JSON parser. 55 * before giving it to the JSON parser.
56 */ 56 */
57struct GNUNET_CURL_DownloadBuffer { 57struct GNUNET_CURL_DownloadBuffer
58{
58 /** 59 /**
59 * Download buffer 60 * Download buffer
60 */ 61 */
@@ -103,8 +104,8 @@ typedef void
103 * @return library context 104 * @return library context
104 */ 105 */
105struct GNUNET_CURL_Context * 106struct GNUNET_CURL_Context *
106GNUNET_CURL_init(GNUNET_CURL_RescheduleCallback cb, 107GNUNET_CURL_init (GNUNET_CURL_RescheduleCallback cb,
107 void *cb_cls); 108 void *cb_cls);
108 109
109 110
110/** 111/**
@@ -134,12 +135,12 @@ GNUNET_CURL_init(GNUNET_CURL_RescheduleCallback cb,
134 * proceed immediately with #GNUNET_CURL_perform(). 135 * proceed immediately with #GNUNET_CURL_perform().
135 */ 136 */
136void 137void
137GNUNET_CURL_get_select_info(struct GNUNET_CURL_Context *ctx, 138GNUNET_CURL_get_select_info (struct GNUNET_CURL_Context *ctx,
138 fd_set *read_fd_set, 139 fd_set *read_fd_set,
139 fd_set *write_fd_set, 140 fd_set *write_fd_set,
140 fd_set *except_fd_set, 141 fd_set *except_fd_set,
141 int *max_fd, 142 int *max_fd,
142 long *timeout); 143 long *timeout);
143 144
144 145
145/** 146/**
@@ -150,8 +151,8 @@ GNUNET_CURL_get_select_info(struct GNUNET_CURL_Context *ctx,
150 * @return #GNUNET_OK if no errors occurred, #GNUNET_SYSERR otherwise. 151 * @return #GNUNET_OK if no errors occurred, #GNUNET_SYSERR otherwise.
151 */ 152 */
152int 153int
153GNUNET_CURL_append_header(struct GNUNET_CURL_Context *ctx, 154GNUNET_CURL_append_header (struct GNUNET_CURL_Context *ctx,
154 const char *header); 155 const char *header);
155 156
156/** 157/**
157 * Run the main event loop for the CURL interaction. 158 * Run the main event loop for the CURL interaction.
@@ -159,7 +160,7 @@ GNUNET_CURL_append_header(struct GNUNET_CURL_Context *ctx,
159 * @param ctx the library context 160 * @param ctx the library context
160 */ 161 */
161void 162void
162GNUNET_CURL_perform(struct GNUNET_CURL_Context *ctx); 163GNUNET_CURL_perform (struct GNUNET_CURL_Context *ctx);
163 164
164 165
165/** 166/**
@@ -171,9 +172,9 @@ GNUNET_CURL_perform(struct GNUNET_CURL_Context *ctx);
171 * @param rc cleans/frees the response 172 * @param rc cleans/frees the response
172 */ 173 */
173void 174void
174GNUNET_CURL_perform2(struct GNUNET_CURL_Context *ctx, 175GNUNET_CURL_perform2 (struct GNUNET_CURL_Context *ctx,
175 GNUNET_CURL_RawParser rp, 176 GNUNET_CURL_RawParser rp,
176 GNUNET_CURL_ResponseCleaner rc); 177 GNUNET_CURL_ResponseCleaner rc);
177 178
178/** 179/**
179 * Cleanup library initialisation resources. This function should be called 180 * Cleanup library initialisation resources. This function should be called
@@ -183,7 +184,7 @@ GNUNET_CURL_perform2(struct GNUNET_CURL_Context *ctx,
183 * @param ctx the library context 184 * @param ctx the library context
184 */ 185 */
185void 186void
186GNUNET_CURL_fini(struct GNUNET_CURL_Context *ctx); 187GNUNET_CURL_fini (struct GNUNET_CURL_Context *ctx);
187 188
188 189
189/** 190/**
@@ -221,11 +222,11 @@ typedef void
221 * @return NULL on error (in this case, @eh is still released!) 222 * @return NULL on error (in this case, @eh is still released!)
222 */ 223 */
223struct GNUNET_CURL_Job * 224struct GNUNET_CURL_Job *
224GNUNET_CURL_job_add(struct GNUNET_CURL_Context *ctx, 225GNUNET_CURL_job_add (struct GNUNET_CURL_Context *ctx,
225 CURL *eh, 226 CURL *eh,
226 int add_json, 227 int add_json,
227 GNUNET_CURL_JobCompletionCallback jcc, 228 GNUNET_CURL_JobCompletionCallback jcc,
228 void *jcc_cls); 229 void *jcc_cls);
229 230
230 231
231/** 232/**
@@ -245,11 +246,11 @@ GNUNET_CURL_job_add(struct GNUNET_CURL_Context *ctx,
245 * @return NULL on error (in this case, @eh is still released!) 246 * @return NULL on error (in this case, @eh is still released!)
246 */ 247 */
247struct GNUNET_CURL_Job * 248struct GNUNET_CURL_Job *
248GNUNET_CURL_job_add2(struct GNUNET_CURL_Context *ctx, 249GNUNET_CURL_job_add2 (struct GNUNET_CURL_Context *ctx,
249 CURL *eh, 250 CURL *eh,
250 const struct curl_slist *job_headers, 251 const struct curl_slist *job_headers,
251 GNUNET_CURL_JobCompletionCallback jcc, 252 GNUNET_CURL_JobCompletionCallback jcc,
252 void *jcc_cls); 253 void *jcc_cls);
253 254
254 255
255/** 256/**
@@ -259,7 +260,7 @@ GNUNET_CURL_job_add2(struct GNUNET_CURL_Context *ctx,
259 * @param job job to cancel 260 * @param job job to cancel
260 */ 261 */
261void 262void
262GNUNET_CURL_job_cancel(struct GNUNET_CURL_Job *job); 263GNUNET_CURL_job_cancel (struct GNUNET_CURL_Job *job);
263 264
264 265
265/* ******* GNUnet SCHEDULER integration ************ */ 266/* ******* GNUnet SCHEDULER integration ************ */
@@ -278,7 +279,7 @@ struct GNUNET_CURL_RescheduleContext;
278 * @return closure for #GNUNET_CURL_gnunet_scheduler_reschedule(). 279 * @return closure for #GNUNET_CURL_gnunet_scheduler_reschedule().
279 */ 280 */
280struct GNUNET_CURL_RescheduleContext * 281struct GNUNET_CURL_RescheduleContext *
281GNUNET_CURL_gnunet_rc_create(struct GNUNET_CURL_Context *ctx); 282GNUNET_CURL_gnunet_rc_create (struct GNUNET_CURL_Context *ctx);
282 283
283/** 284/**
284 * Initialize reschedule context; with custom response parser 285 * Initialize reschedule context; with custom response parser
@@ -287,9 +288,9 @@ GNUNET_CURL_gnunet_rc_create(struct GNUNET_CURL_Context *ctx);
287 * @return closure for #GNUNET_CURL_gnunet_scheduler_reschedule(). 288 * @return closure for #GNUNET_CURL_gnunet_scheduler_reschedule().
288 */ 289 */
289struct GNUNET_CURL_RescheduleContext * 290struct GNUNET_CURL_RescheduleContext *
290GNUNET_CURL_gnunet_rc_create_with_parser(struct GNUNET_CURL_Context *ctx, 291GNUNET_CURL_gnunet_rc_create_with_parser (struct GNUNET_CURL_Context *ctx,
291 GNUNET_CURL_RawParser rp, 292 GNUNET_CURL_RawParser rp,
292 GNUNET_CURL_ResponseCleaner rc); 293 GNUNET_CURL_ResponseCleaner rc);
293 294
294 295
295/** 296/**
@@ -298,7 +299,7 @@ GNUNET_CURL_gnunet_rc_create_with_parser(struct GNUNET_CURL_Context *ctx,
298 * @param rc context to destroy 299 * @param rc context to destroy
299 */ 300 */
300void 301void
301GNUNET_CURL_gnunet_rc_destroy(struct GNUNET_CURL_RescheduleContext *rc); 302GNUNET_CURL_gnunet_rc_destroy (struct GNUNET_CURL_RescheduleContext *rc);
302 303
303 304
304/** 305/**
@@ -311,7 +312,7 @@ GNUNET_CURL_gnunet_rc_destroy(struct GNUNET_CURL_RescheduleContext *rc);
311 * (pointer to a pointer!) 312 * (pointer to a pointer!)
312 */ 313 */
313void 314void
314GNUNET_CURL_gnunet_scheduler_reschedule(void *cls); 315GNUNET_CURL_gnunet_scheduler_reschedule (void *cls);
315 316
316 317
317/** 318/**
@@ -321,7 +322,8 @@ GNUNET_CURL_gnunet_scheduler_reschedule(void *cls);
321 * @param header_name name of the header to send. 322 * @param header_name name of the header to send.
322 */ 323 */
323void 324void
324GNUNET_CURL_enable_async_scope_header(struct GNUNET_CURL_Context *ctx, const char *header_name); 325GNUNET_CURL_enable_async_scope_header (struct GNUNET_CURL_Context *ctx, const
326 char *header_name);
325 327
326 328
327#endif 329#endif