]>
Commit | Line | Data |
---|---|---|
e1b22e2b MR |
1 | /* |
2 | * curllib.h | |
3 | * | |
4 | * Copyright 2016 Michael Rasmussen <mir@datanom.net> | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License as published by | |
8 | * the Free Software Foundation; either version 3 of the License, or | |
9 | * (at your option) any later version. | |
10 | * | |
11 | * This program is distributed in the hope that it will be useful, | |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | * GNU General Public License for more details. | |
15 | * | |
16 | * You should have received a copy of the GNU General Public License | |
17 | * along with this program; if not, write to the Free Software | |
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | |
19 | * MA 02110-1301, USA. | |
20 | */ | |
21 | ||
22 | #ifndef __CURLLIB_H__ | |
23 | #define __CURLLIB_H__ | |
24 | ||
25 | #include <glib.h> | |
26 | ||
27 | G_BEGIN_DECLS | |
28 | ||
29 | typedef enum { | |
30 | DELETE, | |
31 | GET, | |
32 | PROPFIND, | |
33 | PUT, | |
34 | REPORT, | |
35 | OPTIONS, | |
36 | LOCK, | |
37 | UNLOCK, | |
38 | } RequestType; | |
39 | ||
40 | typedef struct { | |
41 | RequestType request; | |
42 | GSList* headers; | |
43 | gchar* data; | |
44 | gchar* username; | |
45 | gchar* password; | |
46 | gchar* url; | |
47 | } Request; | |
48 | ||
49 | typedef struct { | |
50 | gint status; | |
51 | GSList* headers; | |
52 | gchar* data; | |
53 | } Response; | |
54 | ||
55 | Request* request_new(); | |
56 | void request_free(Request* request); | |
57 | Response* request_send(Request* request, gboolean debug); | |
58 | void response_free(Response* response); | |
59 | ||
60 | G_END_DECLS | |
61 | ||
62 | #endif | |
63 |