Sat, 25 Jan 2020 09:00:27 +0100
fix multistatus response and add propfind tests
59
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1 | /* |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
3 | * |
236
e81d3e517b57
fix response href
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
230
diff
changeset
|
4 | * Copyright 2020 Olaf Wintermann. All rights reserved. |
59
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
5 | * |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
6 | * Redistribution and use in source and binary forms, with or without |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
7 | * modification, are permitted provided that the following conditions are met: |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
8 | * |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
9 | * 1. Redistributions of source code must retain the above copyright |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
10 | * notice, this list of conditions and the following disclaimer. |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
11 | * |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
12 | * 2. Redistributions in binary form must reproduce the above copyright |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
13 | * notice, this list of conditions and the following disclaimer in the |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
14 | * documentation and/or other materials provided with the distribution. |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
15 | * |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
ab25c0a231d0
some fixes and new public APIs
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 |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
26 | * POSSIBILITY OF SUCH DAMAGE. |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
27 | */ |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
28 | |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
29 | #ifndef WS_WEBDAV_H |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
30 | #define WS_WEBDAV_H |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
31 | |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
32 | #include "nsapi.h" |
211
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
33 | #include "vfs.h" |
59
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
34 | |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
35 | #include <sys/file.h> |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
36 | #include <sys/stat.h> |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
37 | #include <inttypes.h> |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
38 | |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
39 | #ifdef __cplusplus |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
40 | extern "C" { |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
41 | #endif |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
42 | |
211
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
43 | typedef struct WebdavBackend WebdavBackend; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
44 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
45 | typedef struct WebdavProperty WebdavProperty; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
46 | typedef struct WebdavPList WebdavPList; |
212
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
47 | typedef struct WebdavNSList WebdavNSList; |
59
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
48 | |
215
68e824ba4a4f
add plist iterator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
212
diff
changeset
|
49 | typedef struct WebdavPListIterator WebdavPListIterator; |
68e824ba4a4f
add plist iterator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
212
diff
changeset
|
50 | |
211
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
51 | typedef enum WebdavLockScope WebdavLockScope; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
52 | typedef enum WebdavLockType WebdavLockType; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
53 | |
212
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
54 | typedef enum WebdavValueType WebdavValueType; |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
55 | |
211
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
56 | typedef struct WebdavPropfindRequest WebdavPropfindRequest; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
57 | typedef struct WebdavProppatchRequest WebdavProppatchRequest; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
58 | typedef struct WebdavLockRequest WebdavLockRequest; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
59 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
60 | typedef struct WebdavResponse WebdavResponse; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
61 | typedef struct WebdavResource WebdavResource; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
62 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
63 | typedef struct WebdavVFSProperties WebdavVFSProperties; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
64 | |
217
8ed14d76db42
add backend chaining
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
216
diff
changeset
|
65 | typedef struct WebdavOperation WebdavOperation; |
8ed14d76db42
add backend chaining
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
216
diff
changeset
|
66 | |
212
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
67 | typedef struct WSXmlData WSXmlData; |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
68 | typedef struct WSText WSText; |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
69 | |
211
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
70 | typedef struct _xmlNs WSNamespace; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
71 | typedef struct _xmlNode WSXmlNode; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
72 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
73 | #define WS_NODE_ELEMENT 1 |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
74 | #define WS_NODE_TEXT 3 |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
75 | #define WS_NODE_CDATA 4 |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
76 | #define WS_NODE_ENTITY_REF 5 |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
77 | |
223
bbaec8415c10
add xml tree iterator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
222
diff
changeset
|
78 | typedef int(*wsxml_func)(WSXmlNode *, void *); |
bbaec8415c10
add xml tree iterator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
222
diff
changeset
|
79 | |
211
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
80 | /* propfind settings */ |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
81 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
82 | /* |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
83 | * Don't use the vfs to stat files or read the directory children |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
84 | */ |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
85 | #define WS_PROPFIND_NO_VFS 0x01 |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
86 | |
212
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
87 | |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
88 | enum WebdavValueType { |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
89 | WS_VALUE_NO_TYPE = 0, |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
90 | WS_VALUE_XML_NODE, |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
91 | WS_VALUE_XML_DATA, |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
92 | WS_VALUE_TEXT |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
93 | }; |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
94 | |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
95 | struct WSText { |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
96 | char *str; |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
97 | size_t length; |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
98 | }; |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
99 | |
211
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
100 | struct WebdavProperty { |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
101 | WSNamespace *namespace; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
102 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
103 | const char *name; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
104 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
105 | char *lang; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
106 | |
212
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
107 | union { |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
108 | WSXmlNode *node; |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
109 | WSXmlData *data; |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
110 | WSText text; |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
111 | } value; |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
112 | WebdavValueType vtype; |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
113 | }; |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
114 | |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
115 | struct WSXmlData { |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
116 | WebdavNSList *namespaces; |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
117 | char *data; |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
118 | size_t length; |
211
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
119 | }; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
120 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
121 | struct WebdavPList { |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
122 | WebdavProperty *property; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
123 | WebdavPList *prev; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
124 | WebdavPList *next; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
125 | }; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
126 | |
212
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
127 | struct WebdavNSList { |
222
5f05e56cb8e2
create namespace definition lists when properties are added to a multistatus response
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
217
diff
changeset
|
128 | WSNamespace *namespace; |
212
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
129 | WebdavNSList *prev; |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
130 | WebdavNSList *next; |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
131 | }; |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
132 | |
215
68e824ba4a4f
add plist iterator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
212
diff
changeset
|
133 | struct WebdavPListIterator { |
68e824ba4a4f
add plist iterator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
212
diff
changeset
|
134 | WebdavPList **list; |
68e824ba4a4f
add plist iterator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
212
diff
changeset
|
135 | WebdavPList *cur; |
68e824ba4a4f
add plist iterator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
212
diff
changeset
|
136 | WebdavPList *next; |
68e824ba4a4f
add plist iterator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
212
diff
changeset
|
137 | size_t index; |
68e824ba4a4f
add plist iterator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
212
diff
changeset
|
138 | }; |
68e824ba4a4f
add plist iterator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
212
diff
changeset
|
139 | |
211
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
140 | enum WebdavLockScope { |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
141 | WEBDAV_LOCK_EXCLUSIVE = 0, |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
142 | WEBDAV_LOCK_SHARED, |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
143 | WEBDAV_LOCK_SCOPE_UNKNOWN |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
144 | }; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
145 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
146 | enum WebdavLockType { |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
147 | WEBDAV_LOCK_WRITE = 0, |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
148 | WEBDAV_LOCK_TYPE_UNKNOWN |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
149 | }; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
150 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
151 | struct WebdavPropfindRequest { |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
152 | Session *sn; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
153 | Request *rq; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
154 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
155 | void *doc; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
156 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
157 | /* |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
158 | * list of requested properties |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
159 | */ |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
160 | WebdavPList *properties; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
161 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
162 | /* |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
163 | * number of properties |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
164 | */ |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
165 | size_t propcount; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
166 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
167 | WSBool allprop; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
168 | WSBool propname; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
169 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
170 | int depth; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
171 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
172 | /* |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
173 | * custom userdata for the backend |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
174 | */ |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
175 | void *userdata; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
176 | }; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
177 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
178 | struct WebdavProppatchRequest { |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
179 | Session *sn; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
180 | Request *rq; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
181 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
182 | void *doc; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
183 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
184 | WebdavPList *set; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
185 | size_t setcount; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
186 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
187 | WebdavPList *remove; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
188 | size_t removecount; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
189 | }; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
190 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
191 | struct WebdavLockRequest { |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
192 | Session *sn; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
193 | Request *rq; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
194 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
195 | void *doc; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
196 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
197 | WebdavLockScope scope; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
198 | WebdavLockType type; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
199 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
200 | WSXmlNode *owner; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
201 | }; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
202 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
203 | struct WebdavVFSProperties { |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
204 | uint32_t getcontentlength:1; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
205 | uint32_t getlastmodified:1; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
206 | uint32_t getresourcetype:1; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
207 | uint32_t getetag:1; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
208 | uint32_t creationdate:1; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
209 | }; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
210 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
211 | struct WebdavResponse { |
217
8ed14d76db42
add backend chaining
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
216
diff
changeset
|
212 | WebdavOperation *op; |
8ed14d76db42
add backend chaining
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
216
diff
changeset
|
213 | |
211
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
214 | WebdavResource* (*addresource)(WebdavResponse*, const char*); |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
215 | }; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
216 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
217 | struct WebdavResource { |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
218 | char *href; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
219 | |
217
8ed14d76db42
add backend chaining
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
216
diff
changeset
|
220 | WSBool isclosed; |
8ed14d76db42
add backend chaining
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
216
diff
changeset
|
221 | |
211
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
222 | /* |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
223 | * int addprop(WebdavResource *res, WebdavProperty *property, int status); |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
224 | * |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
225 | * Adds a property to the resource |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
226 | */ |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
227 | int (*addproperty)(WebdavResource*, WebdavProperty*, int); |
217
8ed14d76db42
add backend chaining
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
216
diff
changeset
|
228 | |
8ed14d76db42
add backend chaining
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
216
diff
changeset
|
229 | /* |
8ed14d76db42
add backend chaining
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
216
diff
changeset
|
230 | * int close(WebdavResource *res); |
8ed14d76db42
add backend chaining
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
216
diff
changeset
|
231 | * |
8ed14d76db42
add backend chaining
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
216
diff
changeset
|
232 | * Closes a resource object |
8ed14d76db42
add backend chaining
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
216
diff
changeset
|
233 | */ |
8ed14d76db42
add backend chaining
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
216
diff
changeset
|
234 | int (*close)(WebdavResource*); |
211
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
235 | }; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
236 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
237 | struct WebdavBackend { |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
238 | /* |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
239 | * int propfind_init( |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
240 | * WebdavPropfindRequest *rq, |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
241 | * const char *path, |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
242 | * WebdavPList **outplist); |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
243 | * |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
244 | * Initializes a propfind request. This is called once for each propfind |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
245 | * request and should initialize everything needed for generating the |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
246 | * multistatus response. |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
247 | * |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
248 | */ |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
249 | int (*propfind_init)(WebdavPropfindRequest *, const char *, WebdavPList **); |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
250 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
251 | /* |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
252 | * int propfind_do( |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
253 | * WebdavPropfindRequest *rq, |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
254 | * WebdavResponse *response, |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
255 | * VFS_DIR parent, |
217
8ed14d76db42
add backend chaining
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
216
diff
changeset
|
256 | * WebdavResource *resource, |
211
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
257 | * struct stat *s); |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
258 | * |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
259 | * This function is called for the requsted resource and for all children |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
260 | * if WS_PROPFIND_NO_VFS_CHILDREN is not set. |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
261 | */ |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
262 | int (*propfind_do)( |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
263 | WebdavPropfindRequest *, |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
264 | WebdavResponse *, |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
265 | VFS_DIR, |
217
8ed14d76db42
add backend chaining
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
216
diff
changeset
|
266 | WebdavResource *, |
211
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
267 | struct stat *); |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
268 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
269 | /* |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
270 | * int propfind_finish(WebdavPropfindRequest *rq); |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
271 | * |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
272 | * Finishes a propfind request. |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
273 | */ |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
274 | int (*propfind_finish)(WebdavPropfindRequest *); |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
275 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
276 | /* |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
277 | * See the WS_PROPFIND_ macros for informations about the settings |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
278 | */ |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
279 | uint32_t settings; |
212
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
280 | |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
281 | |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
282 | /* |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
283 | * next Backend |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
284 | */ |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
285 | WebdavBackend *next; |
211
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
286 | }; |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
287 | |
212
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
288 | /* |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
289 | * gets the requested depth |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
290 | * |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
291 | * in case of infinity, -1 is returned |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
292 | * if no depth is specified, 0 is returned |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
293 | */ |
211
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
294 | int webdav_getdepth(Request *rq); |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
295 | |
227
3c23855f7b46
remove nsdef from WebdavProperty
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
225
diff
changeset
|
296 | int webdav_plist_add( |
3c23855f7b46
remove nsdef from WebdavProperty
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
225
diff
changeset
|
297 | pool_handle_t *pool, |
3c23855f7b46
remove nsdef from WebdavProperty
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
225
diff
changeset
|
298 | WebdavPList **begin, |
3c23855f7b46
remove nsdef from WebdavProperty
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
225
diff
changeset
|
299 | WebdavPList **end, |
3c23855f7b46
remove nsdef from WebdavProperty
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
225
diff
changeset
|
300 | WebdavProperty *prop); |
3c23855f7b46
remove nsdef from WebdavProperty
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
225
diff
changeset
|
301 | |
212
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
302 | WebdavPList* webdav_plist_clone(pool_handle_t *pool, WebdavPList *list); |
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
303 | |
216
ce2866ec97f6
add webdav_plist_iterator_remove_current tests and fix some plist related bugs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
215
diff
changeset
|
304 | size_t webdav_plist_size(WebdavPList *list); |
212
d7e7ea9c6bc6
refactore webdav backend struct
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
211
diff
changeset
|
305 | |
230
ca50e1ebdc4d
readd namespace handling to msresponse_addproperty
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
227
diff
changeset
|
306 | int webdav_nslist_add( |
ca50e1ebdc4d
readd namespace handling to msresponse_addproperty
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
227
diff
changeset
|
307 | pool_handle_t *pool, |
ca50e1ebdc4d
readd namespace handling to msresponse_addproperty
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
227
diff
changeset
|
308 | WebdavNSList **begin, |
ca50e1ebdc4d
readd namespace handling to msresponse_addproperty
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
227
diff
changeset
|
309 | WebdavNSList **end, |
ca50e1ebdc4d
readd namespace handling to msresponse_addproperty
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
227
diff
changeset
|
310 | WSNamespace *ns); |
ca50e1ebdc4d
readd namespace handling to msresponse_addproperty
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
227
diff
changeset
|
311 | |
215
68e824ba4a4f
add plist iterator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
212
diff
changeset
|
312 | WebdavPListIterator webdav_plist_iterator(WebdavPList **list); |
68e824ba4a4f
add plist iterator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
212
diff
changeset
|
313 | int webdav_plist_iterator_next(WebdavPListIterator *i, WebdavPList **cur); |
68e824ba4a4f
add plist iterator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
212
diff
changeset
|
314 | void webdav_plist_iterator_remove_current(WebdavPListIterator *i); |
68e824ba4a4f
add plist iterator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
212
diff
changeset
|
315 | |
211
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
316 | WSNamespace* webdav_dav_namespace(void); |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
317 | WebdavProperty* webdav_dav_property( |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
318 | pool_handle_t *pool, |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
319 | const char *name); |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
320 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
321 | int webdav_property_set_value( |
222
5f05e56cb8e2
create namespace definition lists when properties are added to a multistatus response
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
217
diff
changeset
|
322 | WebdavProperty *property, |
211
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
323 | pool_handle_t *pool, |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
324 | char *value); |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
325 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
326 | WebdavVFSProperties webdav_vfs_properties( |
237
ee1680ef1ef2
handle missing properties in multistatus.c
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
236
diff
changeset
|
327 | WebdavPList **plistInOut, |
211
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
328 | WSBool removefromlist, |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
329 | uint32_t flags); |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
330 | |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
331 | int webdav_add_vfs_properties( |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
332 | WebdavResource *res, |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
333 | pool_handle_t *pool, |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
334 | WebdavVFSProperties properties, |
2160585200ac
add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
107
diff
changeset
|
335 | struct stat *s); |
59
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
336 | |
223
bbaec8415c10
add xml tree iterator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
222
diff
changeset
|
337 | int wsxml_iterator( |
bbaec8415c10
add xml tree iterator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
222
diff
changeset
|
338 | pool_handle_t *pool, |
bbaec8415c10
add xml tree iterator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
222
diff
changeset
|
339 | WSXmlNode *node, |
bbaec8415c10
add xml tree iterator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
222
diff
changeset
|
340 | wsxml_func begincb, |
bbaec8415c10
add xml tree iterator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
222
diff
changeset
|
341 | wsxml_func endcb, |
bbaec8415c10
add xml tree iterator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
222
diff
changeset
|
342 | void *udata); |
bbaec8415c10
add xml tree iterator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
222
diff
changeset
|
343 | |
225
e4f3e1433098
add function for getting all namespace definitions that are required for an element
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
223
diff
changeset
|
344 | WebdavNSList* wsxml_get_required_namespaces( |
e4f3e1433098
add function for getting all namespace definitions that are required for an element
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
223
diff
changeset
|
345 | pool_handle_t *pool, |
e4f3e1433098
add function for getting all namespace definitions that are required for an element
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
223
diff
changeset
|
346 | WSXmlNode *node, |
e4f3e1433098
add function for getting all namespace definitions that are required for an element
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
223
diff
changeset
|
347 | int *error); |
e4f3e1433098
add function for getting all namespace definitions that are required for an element
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
223
diff
changeset
|
348 | |
59
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
349 | #ifdef __cplusplus |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
350 | } |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
351 | #endif |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
352 | |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
353 | #endif /* WS_WEBDAV_H */ |
ab25c0a231d0
some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
354 |