diff options
Diffstat (limited to 'src/include/gnunet_curl_lib.h')
-rw-r--r-- | src/include/gnunet_curl_lib.h | 70 |
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 | */ |
57 | struct GNUNET_CURL_DownloadBuffer { | 57 | struct 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 | */ |
105 | struct GNUNET_CURL_Context * | 106 | struct GNUNET_CURL_Context * |
106 | GNUNET_CURL_init(GNUNET_CURL_RescheduleCallback cb, | 107 | GNUNET_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 | */ |
136 | void | 137 | void |
137 | GNUNET_CURL_get_select_info(struct GNUNET_CURL_Context *ctx, | 138 | GNUNET_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 | */ |
152 | int | 153 | int |
153 | GNUNET_CURL_append_header(struct GNUNET_CURL_Context *ctx, | 154 | GNUNET_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 | */ |
161 | void | 162 | void |
162 | GNUNET_CURL_perform(struct GNUNET_CURL_Context *ctx); | 163 | GNUNET_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 | */ |
173 | void | 174 | void |
174 | GNUNET_CURL_perform2(struct GNUNET_CURL_Context *ctx, | 175 | GNUNET_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 | */ |
185 | void | 186 | void |
186 | GNUNET_CURL_fini(struct GNUNET_CURL_Context *ctx); | 187 | GNUNET_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 | */ |
223 | struct GNUNET_CURL_Job * | 224 | struct GNUNET_CURL_Job * |
224 | GNUNET_CURL_job_add(struct GNUNET_CURL_Context *ctx, | 225 | GNUNET_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 | */ |
247 | struct GNUNET_CURL_Job * | 248 | struct GNUNET_CURL_Job * |
248 | GNUNET_CURL_job_add2(struct GNUNET_CURL_Context *ctx, | 249 | GNUNET_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 | */ |
261 | void | 262 | void |
262 | GNUNET_CURL_job_cancel(struct GNUNET_CURL_Job *job); | 263 | GNUNET_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 | */ |
280 | struct GNUNET_CURL_RescheduleContext * | 281 | struct GNUNET_CURL_RescheduleContext * |
281 | GNUNET_CURL_gnunet_rc_create(struct GNUNET_CURL_Context *ctx); | 282 | GNUNET_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 | */ |
289 | struct GNUNET_CURL_RescheduleContext * | 290 | struct GNUNET_CURL_RescheduleContext * |
290 | GNUNET_CURL_gnunet_rc_create_with_parser(struct GNUNET_CURL_Context *ctx, | 291 | GNUNET_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 | */ |
300 | void | 301 | void |
301 | GNUNET_CURL_gnunet_rc_destroy(struct GNUNET_CURL_RescheduleContext *rc); | 302 | GNUNET_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 | */ |
313 | void | 314 | void |
314 | GNUNET_CURL_gnunet_scheduler_reschedule(void *cls); | 315 | GNUNET_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 | */ |
323 | void | 324 | void |
324 | GNUNET_CURL_enable_async_scope_header(struct GNUNET_CURL_Context *ctx, const char *header_name); | 325 | GNUNET_CURL_enable_async_scope_header (struct GNUNET_CURL_Context *ctx, const |
326 | char *header_name); | ||
325 | 327 | ||
326 | 328 | ||
327 | #endif | 329 | #endif |