51 |
51 |
52 typedef struct DavContext DavContext; |
52 typedef struct DavContext DavContext; |
53 typedef struct DavProxy DavProxy; |
53 typedef struct DavProxy DavProxy; |
54 typedef struct DavSession DavSession; |
54 typedef struct DavSession DavSession; |
55 typedef struct DavResource DavResource; |
55 typedef struct DavResource DavResource; |
56 typedef struct DavResult DavResult; |
56 typedef struct DavResult DavResult; |
57 typedef struct DavNamespace DavNamespace; |
57 typedef struct DavNamespace DavNamespace; |
58 typedef struct DavProperty DavProperty; |
58 typedef struct DavProperty DavProperty; |
59 typedef struct DavPropName DavPropName; |
59 typedef struct DavPropName DavPropName; |
60 typedef struct DavKey DavKey; |
60 typedef struct DavKey DavKey; |
|
61 typedef struct DavXmlNode DavXmlNode; |
61 |
62 |
62 typedef size_t(*dav_read_func)(void*, size_t, size_t, void*); |
63 typedef size_t(*dav_read_func)(void*, size_t, size_t, void*); |
63 typedef size_t(*dav_write_func)(const void*, size_t, size_t, void*); |
64 typedef size_t(*dav_write_func)(const void*, size_t, size_t, void*); |
64 |
65 |
65 enum DavError { |
66 enum DavError { |
85 DAV_NET_AUTH_REQUIRED |
86 DAV_NET_AUTH_REQUIRED |
86 }; |
87 }; |
87 |
88 |
88 typedef enum DavError DavError; |
89 typedef enum DavError DavError; |
89 |
90 |
|
91 enum DavXmlNodeType { |
|
92 DAV_XML_NONE = 0, |
|
93 DAV_XML_ELEMENT, |
|
94 DAV_XML_TEXT |
|
95 }; |
|
96 |
|
97 typedef enum DavXmlNodeType DavXmlNodeType; |
|
98 |
90 #define DAV_SESSION_ENCRYPT_CONTENT 0x0001 |
99 #define DAV_SESSION_ENCRYPT_CONTENT 0x0001 |
91 #define DAV_SESSION_ENCRYPT_NAME 0x0002 |
100 #define DAV_SESSION_ENCRYPT_NAME 0x0002 |
92 #define DAV_SESSION_DECRYPT_CONTENT 0x0004 |
101 #define DAV_SESSION_DECRYPT_CONTENT 0x0004 |
93 #define DAV_SESSION_DECRYPT_NAME 0x0008 |
102 #define DAV_SESSION_DECRYPT_NAME 0x0008 |
94 |
103 |
243 |
269 |
244 int dav_lock(DavResource *res); |
270 int dav_lock(DavResource *res); |
245 int dav_lock_t(DavResource *res, time_t timeout); |
271 int dav_lock_t(DavResource *res, time_t timeout); |
246 int dav_unlock(DavResource *res); |
272 int dav_unlock(DavResource *res); |
247 |
273 |
248 char* dav_get_property(DavResource *res, char *name); |
274 DavXmlNode* dav_get_property(DavResource *res, char *name); |
249 char* dav_get_property_ns(DavResource *res, char *ns, char *name); |
275 DavXmlNode* dav_get_property_ns(DavResource *res, char *ns, char *name); |
|
276 char* dav_get_string_property(DavResource *res, char *name); |
|
277 char* dav_get_string_property_ns(DavResource *res, char *ns, char *name); |
250 void dav_set_property(DavResource *res, char *name, char *value); |
278 void dav_set_property(DavResource *res, char *name, char *value); |
251 void dav_set_property_ns(DavResource *res, char *ns, char *name, char *value); |
279 void dav_set_property_ns(DavResource *res, char *ns, char *name, char *value); |
252 void dav_remove_property(DavResource *res, char *name); |
280 void dav_remove_property(DavResource *res, char *name); |
253 void dav_remove_property_ns(DavResource *res, char *ns, char *name); |
281 void dav_remove_property_ns(DavResource *res, char *ns, char *name); |
254 |
282 |
264 int dav_get_content(DavResource *res, void *stream, dav_write_func write_func); |
292 int dav_get_content(DavResource *res, void *stream, dav_write_func write_func); |
265 |
293 |
266 // private |
294 // private |
267 int dav_propfind(DavSession *sn, DavResource *root, UcxBuffer *rqbuf); |
295 int dav_propfind(DavSession *sn, DavResource *root, UcxBuffer *rqbuf); |
268 |
296 |
|
297 char* dav_xml_getstring(DavXmlNode *node); |
|
298 DavXmlNode* dav_text_node(DavSession *sn, char *text); |
|
299 |
269 #ifdef __cplusplus |
300 #ifdef __cplusplus |
270 } |
301 } |
271 #endif |
302 #endif |
272 |
303 |
273 #endif /* WEBDAV_H */ |
304 #endif /* WEBDAV_H */ |