]>
Commit | Line | Data |
---|---|---|
72648326 LP |
1 | #pragma once |
2 | ||
3 | /*** | |
4 | This file is part of systemd. | |
5 | ||
6 | Copyright 2014 Lennart Poettering | |
7 | ||
8 | systemd is free software; you can redistribute it and/or modify it | |
9 | under the terms of the GNU Lesser General Public License as published by | |
10 | the Free Software Foundation; either version 2.1 of the License, or | |
11 | (at your option) any later version. | |
12 | ||
13 | systemd is distributed in the hope that it will be useful, but | |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 | Lesser General Public License for more details. | |
17 | ||
18 | You should have received a copy of the GNU Lesser General Public License | |
19 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
20 | ***/ | |
21 | ||
72648326 | 22 | #include <curl/curl.h> |
71d35b6b | 23 | #include <sys/types.h> |
72648326 | 24 | |
72648326 LP |
25 | #include "sd-event.h" |
26 | ||
07630cea LP |
27 | #include "hashmap.h" |
28 | ||
72648326 LP |
29 | typedef struct CurlGlue CurlGlue; |
30 | ||
31 | struct CurlGlue { | |
32 | sd_event *event; | |
33 | CURLM *curl; | |
34 | sd_event_source *timer; | |
35 | Hashmap *ios; | |
36 | Hashmap *translate_fds; | |
37 | ||
38 | void (*on_finished)(CurlGlue *g, CURL *curl, CURLcode code); | |
39 | void *userdata; | |
40 | }; | |
41 | ||
42 | int curl_glue_new(CurlGlue **glue, sd_event *event); | |
43 | CurlGlue* curl_glue_unref(CurlGlue *glue); | |
44 | ||
45 | DEFINE_TRIVIAL_CLEANUP_FUNC(CurlGlue*, curl_glue_unref); | |
46 | ||
47 | int curl_glue_make(CURL **ret, const char *url, void *userdata); | |
48 | int curl_glue_add(CurlGlue *g, CURL *c); | |
49 | void curl_glue_remove_and_free(CurlGlue *g, CURL *c); | |
50 | ||
51 | struct curl_slist *curl_slist_new(const char *first, ...) _sentinel_; | |
52 | int curl_header_strdup(const void *contents, size_t sz, const char *field, char **value); | |
5fa89b2c | 53 | int curl_parse_http_time(const char *t, usec_t *ret); |
72648326 LP |
54 | |
55 | DEFINE_TRIVIAL_CLEANUP_FUNC(CURL*, curl_easy_cleanup); | |
56 | DEFINE_TRIVIAL_CLEANUP_FUNC(struct curl_slist*, curl_slist_free_all); |