Wed, 13 Dec 2017 20:01:14 +0100
Added tag v1.1.1 for changeset 7954fdacdb5c
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1 | /* |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
3 | * |
185
cd42cccee550
updated copyright notice
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
182
diff
changeset
|
4 | * Copyright 2016 Olaf Wintermann. All rights reserved. |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
5 | * |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
6 | * Redistribution and use in source and binary forms, with or without |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
7 | * modification, are permitted provided that the following conditions are met: |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
8 | * |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
9 | * 1. Redistributions of source code must retain the above copyright |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
10 | * notice, this list of conditions and the following disclaimer. |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
11 | * |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
12 | * 2. Redistributions in binary form must reproduce the above copyright |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
13 | * notice, this list of conditions and the following disclaimer in the |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
14 | * documentation and/or other materials provided with the distribution. |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
15 | * |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
26 | * POSSIBILITY OF SUCH DAMAGE. |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
27 | */ |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
28 | |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
29 | #ifndef WEBDAV_H |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
30 | #define WEBDAV_H |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
31 | |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
32 | #include <inttypes.h> |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
33 | #include <ucx/map.h> |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
34 | #include <ucx/mempool.h> |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
35 | #include <ucx/list.h> |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
36 | #include <ucx/buffer.h> |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
37 | #include <curl/curl.h> |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
38 | #include <libxml/tree.h> |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
39 | |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
40 | #ifdef __cplusplus |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
41 | extern "C" { |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
42 | #endif |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
43 | |
182
ca07f14f7bfe
added override option for copy/move
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
181
diff
changeset
|
44 | typedef int DavBool; |
208
1fb26aca5093
added API for webdav locking
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
207
diff
changeset
|
45 | #ifndef TRUE |
221
e22c29b7ee2f
using locks in dav-sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
208
diff
changeset
|
46 | #define TRUE 1 |
208
1fb26aca5093
added API for webdav locking
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
207
diff
changeset
|
47 | #endif |
1fb26aca5093
added API for webdav locking
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
207
diff
changeset
|
48 | #ifndef FALSE |
1fb26aca5093
added API for webdav locking
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
207
diff
changeset
|
49 | #define FALSE 0 |
1fb26aca5093
added API for webdav locking
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
207
diff
changeset
|
50 | #endif |
221
e22c29b7ee2f
using locks in dav-sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
208
diff
changeset
|
51 | |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
52 | typedef struct DavContext DavContext; |
36 | 53 | typedef struct DavProxy DavProxy; |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
54 | typedef struct DavSession DavSession; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
55 | typedef struct DavResource DavResource; |
331
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
56 | typedef struct DavResult DavResult; |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
57 | typedef struct DavNamespace DavNamespace; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
58 | typedef struct DavProperty DavProperty; |
84
7fca3788261d
added info command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
75
diff
changeset
|
59 | typedef struct DavPropName DavPropName; |
40
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
60 | typedef struct DavKey DavKey; |
331
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
61 | typedef struct DavXmlNode DavXmlNode; |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
62 | |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
63 | typedef size_t(*dav_read_func)(void*, size_t, size_t, void*); |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
64 | typedef size_t(*dav_write_func)(const void*, size_t, size_t, void*); |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
65 | |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
66 | enum DavError { |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
67 | DAV_OK = 0, |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
68 | DAV_ERROR, |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
69 | DAV_NOT_FOUND, |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
70 | DAV_UNAUTHORIZED, |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
71 | DAV_FORBIDDEN, |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
72 | DAV_METHOD_NOT_ALLOWED, |
100
f4127c4d1018
improved error messages
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
84
diff
changeset
|
73 | DAV_CONFLICT, |
207
de23f8881e9f
fixed hash verification and head requests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
206
diff
changeset
|
74 | DAV_LOCKED, |
100
f4127c4d1018
improved error messages
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
84
diff
changeset
|
75 | DAV_UNSUPPORTED_PROTOCOL, |
f4127c4d1018
improved error messages
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
84
diff
changeset
|
76 | DAV_COULDNT_RESOLVE_PROXY, |
f4127c4d1018
improved error messages
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
84
diff
changeset
|
77 | DAV_COULDNT_RESOLVE_HOST, |
f4127c4d1018
improved error messages
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
84
diff
changeset
|
78 | DAV_COULDNT_CONNECT, |
f4127c4d1018
improved error messages
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
84
diff
changeset
|
79 | DAV_TIMEOUT, |
135
664aeaec8d25
replaced old davql (still buggy)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
134
diff
changeset
|
80 | DAV_SSL_ERROR, |
150
37fb12574acd
added checksums for encrypted resources
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
147
diff
changeset
|
81 | DAV_QL_ERROR, |
238
b167226fb804
added support for error codes 407,413,414 and 511
Mike Becker <universe@uap-core.de>
parents:
228
diff
changeset
|
82 | DAV_CONTENT_VERIFICATION_ERROR, |
b167226fb804
added support for error codes 407,413,414 and 511
Mike Becker <universe@uap-core.de>
parents:
228
diff
changeset
|
83 | DAV_REQUEST_ENTITY_TOO_LARGE, |
b167226fb804
added support for error codes 407,413,414 and 511
Mike Becker <universe@uap-core.de>
parents:
228
diff
changeset
|
84 | DAV_REQUEST_URL_TOO_LONG, |
b167226fb804
added support for error codes 407,413,414 and 511
Mike Becker <universe@uap-core.de>
parents:
228
diff
changeset
|
85 | DAV_PROXY_AUTH_REQUIRED, |
b167226fb804
added support for error codes 407,413,414 and 511
Mike Becker <universe@uap-core.de>
parents:
228
diff
changeset
|
86 | DAV_NET_AUTH_REQUIRED |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
87 | }; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
88 | |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
89 | typedef enum DavError DavError; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
90 | |
331
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
91 | enum DavXmlNodeType { |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
92 | DAV_XML_NONE = 0, |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
93 | DAV_XML_ELEMENT, |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
94 | DAV_XML_TEXT |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
95 | }; |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
96 | |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
97 | typedef enum DavXmlNodeType DavXmlNodeType; |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
98 | |
43
03076907b58a
added file name encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
99 | #define DAV_SESSION_ENCRYPT_CONTENT 0x0001 |
03076907b58a
added file name encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
100 | #define DAV_SESSION_ENCRYPT_NAME 0x0002 |
03076907b58a
added file name encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
101 | #define DAV_SESSION_DECRYPT_CONTENT 0x0004 |
03076907b58a
added file name encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
102 | #define DAV_SESSION_DECRYPT_NAME 0x0008 |
40
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
103 | |
68
f6d3db6113d3
added verbose option + encryption flag fixes
Mike Becker <universe@uap-core.de>
parents:
43
diff
changeset
|
104 | #define DAV_SESSION_CONTENT_ENCRYPTION 0x0005 |
43
03076907b58a
added file name encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
105 | #define DAV_SESSION_FULL_ENCRYPTION 0x000f |
03076907b58a
added file name encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
106 | |
03076907b58a
added file name encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
107 | |
206
527d0fde484e
changed libidav property namespace and version number
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
186
diff
changeset
|
108 | #define DAV_NS "http://davutils.org/" |
40
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
109 | |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
110 | struct DavNamespace { |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
111 | char *prefix; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
112 | char *name; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
113 | }; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
114 | |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
115 | struct DavResource { |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
116 | DavSession *session; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
117 | DavResource *prev; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
118 | DavResource *next; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
119 | DavResource *parent; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
120 | DavResource *children; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
121 | char *name; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
122 | char *path; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
123 | char *href; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
124 | uint64_t contentlength; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
125 | char *contenttype; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
126 | time_t creationdate; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
127 | time_t lastmodified; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
128 | void *data; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
129 | int iscollection; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
130 | }; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
131 | |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
132 | struct DavSession { |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
133 | DavContext *context; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
134 | CURL *handle; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
135 | char *base_url; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
136 | UcxMempool *mp; |
43
03076907b58a
added file name encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
137 | UcxMap *pathcache; |
40
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
138 | DavKey *key; |
208
1fb26aca5093
added API for webdav locking
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
207
diff
changeset
|
139 | void *locks; |
38
b855f76e965b
code cleanup + experimental login prompt
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
36
diff
changeset
|
140 | uint32_t flags; |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
141 | DavError error; |
225
a297c2e28fa1
improved error handling in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
221
diff
changeset
|
142 | char *errorstr; |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
143 | }; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
144 | |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
145 | struct DavContext { |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
146 | UcxMap *namespaces; |
40
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
147 | UcxMap *keys; |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
148 | UcxList *sessions; |
36 | 149 | DavProxy *http_proxy; |
150 | DavProxy *https_proxy; | |
151 | }; | |
152 | ||
153 | struct DavProxy { | |
154 | char *url; | |
155 | char *username; | |
156 | char *password; | |
157 | char *no_proxy; | |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
158 | }; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
159 | |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
160 | struct DavProperty { |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
161 | DavNamespace *ns; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
162 | char *name; |
331
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
163 | DavXmlNode *value; |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
164 | }; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
165 | |
84
7fca3788261d
added info command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
75
diff
changeset
|
166 | struct DavPropName { |
7fca3788261d
added info command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
75
diff
changeset
|
167 | char *ns; |
7fca3788261d
added info command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
75
diff
changeset
|
168 | char *name; |
7fca3788261d
added info command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
75
diff
changeset
|
169 | }; |
7fca3788261d
added info command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
75
diff
changeset
|
170 | |
128
649eb328674a
implemented minimal executor features and added missing ucx files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
171 | struct DavResult { |
124
41939c8f3f9c
expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
100
diff
changeset
|
172 | DavResource *result; |
41939c8f3f9c
expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
100
diff
changeset
|
173 | int status; |
41939c8f3f9c
expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
100
diff
changeset
|
174 | }; |
41939c8f3f9c
expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
100
diff
changeset
|
175 | |
40
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
176 | #define DAV_KEY_AES128 0 |
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
177 | #define DAV_KEY_AES256 1 |
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
178 | |
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
179 | struct DavKey { |
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
180 | char *name; |
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
181 | int type; |
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
182 | void *data; |
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
183 | size_t length; |
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
184 | }; |
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
185 | |
331
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
186 | struct DavXmlNode { |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
187 | DavXmlNodeType type; |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
188 | |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
189 | char *namespace; |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
190 | char *name; |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
191 | |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
192 | DavXmlNode *prev; |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
193 | DavXmlNode *next; |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
194 | DavXmlNode *children; |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
195 | DavXmlNode *parent; |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
196 | |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
197 | // TODO: attributes |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
198 | |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
199 | char *content; |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
200 | size_t contentlength; |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
201 | }; |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
202 | |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
203 | DavContext* dav_context_new(); |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
204 | void dav_context_destroy(DavContext *ctx); |
40
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
205 | |
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
206 | void dav_context_add_key(DavContext *context, DavKey *key); |
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
207 | DavKey* dav_context_get_key(DavContext *context, char *name); |
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
208 | |
317
7eea57f6d847
adds namespace config element
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
315
diff
changeset
|
209 | int dav_add_namespace(DavContext *context, const char *prefix, const char *ns); |
7eea57f6d847
adds namespace config element
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
315
diff
changeset
|
210 | DavNamespace* dav_get_namespace(DavContext *context, const char *prefix); |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
211 | |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
212 | DavSession* dav_session_new(DavContext *context, char *base_url); |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
213 | DavSession* dav_session_new_auth( |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
214 | DavContext *context, |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
215 | char *base_url, |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
216 | char *user, |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
217 | char *password); |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
218 | void dav_session_set_auth(DavSession *sn, char *user, char *password); |
43
03076907b58a
added file name encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
219 | void dav_session_enable_encryption(DavSession *sn, DavKey *key, int flags); |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
220 | |
39
3e55bed345f9
added some aes functions + ucx update
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
38
diff
changeset
|
221 | void dav_session_destroy(DavSession *sn); |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
222 | |
39
3e55bed345f9
added some aes functions + ucx update
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
38
diff
changeset
|
223 | void* dav_session_malloc(DavSession *sn, size_t size); |
3e55bed345f9
added some aes functions + ucx update
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
38
diff
changeset
|
224 | void* dav_session_calloc(DavSession *sn, size_t nelm, size_t size); |
3e55bed345f9
added some aes functions + ucx update
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
38
diff
changeset
|
225 | void* dav_session_realloc(DavSession *sn, void *ptr, size_t size); |
3e55bed345f9
added some aes functions + ucx update
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
38
diff
changeset
|
226 | void dav_session_free(DavSession *sn, void *ptr); |
225
a297c2e28fa1
improved error handling in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
221
diff
changeset
|
227 | char* dav_session_strdup(DavSession *sn, const char *str); |
39
3e55bed345f9
added some aes functions + ucx update
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
38
diff
changeset
|
228 | |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
229 | |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
230 | DavResource* dav_get(DavSession *sn, char *path, char *properties); |
40
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
231 | |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
232 | UcxList* parse_properties_string(DavContext *context, sstr_t str); |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
233 | |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
234 | DavResource* dav_query(DavSession *sn, char *query, ...); |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
235 | |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
236 | UcxKey dav_property_key(char *ns, char *name); |
134
4bccc18820e8
implemented execution of field list expressions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
128
diff
changeset
|
237 | void dav_get_property_namespace_str( |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
238 | DavContext *ctx, |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
239 | char *prefixed_name, |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
240 | char **ns, |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
241 | char **name); |
134
4bccc18820e8
implemented execution of field list expressions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
128
diff
changeset
|
242 | DavNamespace* dav_get_property_namespace( |
4bccc18820e8
implemented execution of field list expressions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
128
diff
changeset
|
243 | DavContext *ctx, |
4bccc18820e8
implemented execution of field list expressions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
128
diff
changeset
|
244 | char *prefixed_name, |
4bccc18820e8
implemented execution of field list expressions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
128
diff
changeset
|
245 | char **name); |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
246 | |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
247 | /* ------------------------ resource functions ------------------------ */ |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
248 | |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
249 | DavResource* dav_resource_new(DavSession *sn, char *path); |
42
6518b035a9df
added some api functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
40
diff
changeset
|
250 | DavResource* dav_resource_new_child(DavSession *sn, DavResource *parent, char *name); |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
251 | DavResource* dav_resource_new_href(DavSession *sn, char *href); |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
252 | |
43
03076907b58a
added file name encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
253 | void dav_resource_free(DavResource *res); |
03076907b58a
added file name encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
254 | void dav_resource_free_all(DavResource *res); |
03076907b58a
added file name encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
255 | |
03076907b58a
added file name encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
256 | char* dav_resource_get_href(DavResource *resource); |
03076907b58a
added file name encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
257 | |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
258 | DavResource* dav_create_child(DavResource *parent, char *name); |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
259 | int dav_delete(DavResource *res); |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
260 | int dav_create(DavResource *res); |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
261 | int dav_exists(DavResource *res); |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
262 | |
181
a8f8cdbf85df
implemented webdav copy and move method
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
178
diff
changeset
|
263 | int dav_copy(DavResource *res, char *newpath); |
a8f8cdbf85df
implemented webdav copy and move method
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
178
diff
changeset
|
264 | int dav_move(DavResource *res, char *newpath); |
182
ca07f14f7bfe
added override option for copy/move
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
181
diff
changeset
|
265 | int dav_copy_o(DavResource *res, char *newpath, DavBool override); |
ca07f14f7bfe
added override option for copy/move
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
181
diff
changeset
|
266 | int dav_move_o(DavResource *res, char *newpath, DavBool override); |
186
05d11fbcaeb3
improved copy/move
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
185
diff
changeset
|
267 | int dav_copyto(DavResource *res, char *url, DavBool override); |
05d11fbcaeb3
improved copy/move
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
185
diff
changeset
|
268 | int dav_moveto(DavResource *res, char *url, DavBool override); |
181
a8f8cdbf85df
implemented webdav copy and move method
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
178
diff
changeset
|
269 | |
208
1fb26aca5093
added API for webdav locking
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
207
diff
changeset
|
270 | int dav_lock(DavResource *res); |
315
7db4dbf4e6f9
adds lock timeout
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
298
diff
changeset
|
271 | int dav_lock_t(DavResource *res, time_t timeout); |
208
1fb26aca5093
added API for webdav locking
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
207
diff
changeset
|
272 | int dav_unlock(DavResource *res); |
207
de23f8881e9f
fixed hash verification and head requests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
206
diff
changeset
|
273 | |
331
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
274 | DavXmlNode* dav_get_property(DavResource *res, char *name); |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
275 | DavXmlNode* dav_get_property_ns(DavResource *res, char *ns, char *name); |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
276 | char* dav_get_string_property(DavResource *res, char *name); |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
277 | char* dav_get_string_property_ns(DavResource *res, char *ns, char *name); |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
278 | void dav_set_property(DavResource *res, char *name, char *value); |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
279 | void dav_set_property_ns(DavResource *res, char *ns, char *name, char *value); |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
280 | void dav_remove_property(DavResource *res, char *name); |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
281 | void dav_remove_property_ns(DavResource *res, char *ns, char *name); |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
282 | |
84
7fca3788261d
added info command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
75
diff
changeset
|
283 | DavPropName* dav_get_property_names(DavResource *res, size_t *count); |
7fca3788261d
added info command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
75
diff
changeset
|
284 | |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
285 | void dav_set_content(DavResource *res, void *stream, dav_read_func read_func); |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
286 | void dav_set_content_data(DavResource *res, char *content, size_t length); |
178
e137883e620f
using content-length header in dav put
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
150
diff
changeset
|
287 | void dav_set_content_length(DavResource *res, size_t length); |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
288 | |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
289 | int dav_load(DavResource *res); |
298
755b8198b071
dav get-property shouldn't send an allprop propfind request
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
238
diff
changeset
|
290 | int dav_load_prop(DavResource *res, DavPropName *properties, size_t numprop); |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
291 | int dav_store(DavResource *res); |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
292 | int dav_get_content(DavResource *res, void *stream, dav_write_func write_func); |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
293 | |
43
03076907b58a
added file name encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
294 | // private |
135
664aeaec8d25
replaced old davql (still buggy)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
134
diff
changeset
|
295 | int dav_propfind(DavSession *sn, DavResource *root, UcxBuffer *rqbuf); |
43
03076907b58a
added file name encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
296 | |
331
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
297 | char* dav_xml_getstring(DavXmlNode *node); |
338
c7f3fe4abdb2
dav get-property supports xml property output
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
331
diff
changeset
|
298 | DavBool dav_xml_isstring(DavXmlNode *node); |
331
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
299 | DavXmlNode* dav_text_node(DavSession *sn, char *text); |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
300 | |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
301 | #ifdef __cplusplus |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
302 | } |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
303 | #endif |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
304 | |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
305 | #endif /* WEBDAV_H */ |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
306 |