Wed, 07 Feb 2024 17:11:55 +0100
add support for progress callbacks in dav_store()
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 | * |
361
b6f2462ee055
adds xattr lib and tag support
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
355
diff
changeset
|
4 | * Copyright 2018 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> |
795
05647e862a17
add new config parser
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
790
diff
changeset
|
33 | #include <stdbool.h> |
747
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
736
diff
changeset
|
34 | #include <cx/map.h> |
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
736
diff
changeset
|
35 | #include <cx/mempool.h> |
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
736
diff
changeset
|
36 | #include <cx/linked_list.h> |
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
736
diff
changeset
|
37 | #include <cx/string.h> |
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
736
diff
changeset
|
38 | #include <cx/buffer.h> |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
39 | #include <curl/curl.h> |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
40 | #include <libxml/tree.h> |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
41 | |
805
bff983370565
make DavContext mt-safe
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
42 | #ifndef _WIN32 |
bff983370565
make DavContext mt-safe
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
43 | #include <pthread.h> |
bff983370565
make DavContext mt-safe
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
44 | #else |
bff983370565
make DavContext mt-safe
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
45 | #include <Windows.h> |
bff983370565
make DavContext mt-safe
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
46 | #endif |
bff983370565
make DavContext mt-safe
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
47 | |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
48 | #ifdef __cplusplus |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
49 | extern "C" { |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
50 | #endif |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
51 | |
560
a816e805e5db
store origin of file conflicts
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
555
diff
changeset
|
52 | typedef char DavBool; |
208
1fb26aca5093
added API for webdav locking
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
207
diff
changeset
|
53 | #ifndef TRUE |
221
e22c29b7ee2f
using locks in dav-sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
208
diff
changeset
|
54 | #define TRUE 1 |
208
1fb26aca5093
added API for webdav locking
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
207
diff
changeset
|
55 | #endif |
1fb26aca5093
added API for webdav locking
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
207
diff
changeset
|
56 | #ifndef FALSE |
1fb26aca5093
added API for webdav locking
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
207
diff
changeset
|
57 | #define FALSE 0 |
1fb26aca5093
added API for webdav locking
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
207
diff
changeset
|
58 | #endif |
221
e22c29b7ee2f
using locks in dav-sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
208
diff
changeset
|
59 | |
728 | 60 | typedef struct DavContext DavContext; |
61 | typedef struct DavProxy DavProxy; | |
62 | typedef struct DavSession DavSession; | |
63 | typedef struct DavResource DavResource; | |
64 | typedef struct DavResult DavResult; | |
65 | typedef struct DavNamespace DavNamespace; | |
66 | typedef struct DavProperty DavProperty; | |
67 | typedef struct DavPropName DavPropName; | |
68 | typedef struct DavKey DavKey; | |
69 | typedef struct DavNSInfo DavNSInfo; | |
70 | typedef struct DavXmlNode DavXmlNode; | |
71 | typedef struct DavXmlAttr DavXmlAttr; | |
72 | ||
73 | typedef struct DavInputStream DavInputStream; | |
74 | typedef struct DavOutputStream DavOutputStream; | |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
75 | |
805
bff983370565
make DavContext mt-safe
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
76 | #ifndef _WIN32 |
bff983370565
make DavContext mt-safe
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
77 | #define DAV_MUTEX pthread_mutex_t |
bff983370565
make DavContext mt-safe
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
78 | #else |
bff983370565
make DavContext mt-safe
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
79 | #define DAV_MUTEX HANDLE |
bff983370565
make DavContext mt-safe
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
80 | #endif |
bff983370565
make DavContext mt-safe
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
81 | |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
82 | 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
|
83 | typedef size_t(*dav_write_func)(const void*, size_t, size_t, void*); |
478
baa63fef5c5c
fixes redirects
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
475
diff
changeset
|
84 | typedef int(*dav_seek_func)(const void *, long, int); |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
85 | |
354
067ea2315a8a
moves auth prompt functionality to libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
338
diff
changeset
|
86 | typedef int(*dav_auth_func)(DavSession *, void *); |
355
5da2cf15eb44
adds primitive progress indicator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
354
diff
changeset
|
87 | typedef void(*dav_progress_func)(DavResource *, int64_t, int64_t, void *); |
354
067ea2315a8a
moves auth prompt functionality to libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
338
diff
changeset
|
88 | |
788
9b9420041d8e
add request/response body to verbose output / add DavSession logfunc
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
747
diff
changeset
|
89 | |
9b9420041d8e
add request/response body to verbose output / add DavSession logfunc
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
747
diff
changeset
|
90 | typedef void(*dav_rqlog_func)( |
9b9420041d8e
add request/response body to verbose output / add DavSession logfunc
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
747
diff
changeset
|
91 | DavSession *sn, |
9b9420041d8e
add request/response body to verbose output / add DavSession logfunc
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
747
diff
changeset
|
92 | const char *method, |
9b9420041d8e
add request/response body to verbose output / add DavSession logfunc
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
747
diff
changeset
|
93 | const char *url, |
9b9420041d8e
add request/response body to verbose output / add DavSession logfunc
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
747
diff
changeset
|
94 | const char *request_body, |
9b9420041d8e
add request/response body to verbose output / add DavSession logfunc
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
747
diff
changeset
|
95 | size_t request_bodylen, |
9b9420041d8e
add request/response body to verbose output / add DavSession logfunc
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
747
diff
changeset
|
96 | int status, |
9b9420041d8e
add request/response body to verbose output / add DavSession logfunc
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
747
diff
changeset
|
97 | const char *response_body, |
9b9420041d8e
add request/response body to verbose output / add DavSession logfunc
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
747
diff
changeset
|
98 | size_t response_bodylen); |
9b9420041d8e
add request/response body to verbose output / add DavSession logfunc
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
747
diff
changeset
|
99 | |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
100 | enum DavError { |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
101 | DAV_OK = 0, |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
102 | DAV_ERROR, |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
103 | DAV_NOT_FOUND, |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
104 | DAV_UNAUTHORIZED, |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
105 | DAV_FORBIDDEN, |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
106 | DAV_METHOD_NOT_ALLOWED, |
100
f4127c4d1018
improved error messages
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
84
diff
changeset
|
107 | DAV_CONFLICT, |
207
de23f8881e9f
fixed hash verification and head requests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
206
diff
changeset
|
108 | DAV_LOCKED, |
100
f4127c4d1018
improved error messages
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
84
diff
changeset
|
109 | DAV_UNSUPPORTED_PROTOCOL, |
f4127c4d1018
improved error messages
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
84
diff
changeset
|
110 | DAV_COULDNT_RESOLVE_PROXY, |
f4127c4d1018
improved error messages
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
84
diff
changeset
|
111 | DAV_COULDNT_RESOLVE_HOST, |
f4127c4d1018
improved error messages
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
84
diff
changeset
|
112 | DAV_COULDNT_CONNECT, |
f4127c4d1018
improved error messages
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
84
diff
changeset
|
113 | DAV_TIMEOUT, |
135
664aeaec8d25
replaced old davql (still buggy)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
134
diff
changeset
|
114 | DAV_SSL_ERROR, |
150
37fb12574acd
added checksums for encrypted resources
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
147
diff
changeset
|
115 | 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
|
116 | DAV_CONTENT_VERIFICATION_ERROR, |
491
fdc2fb090cc7
adds versioning support for dav-sync push
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
478
diff
changeset
|
117 | DAV_PRECONDITION_FAILED, |
238
b167226fb804
added support for error codes 407,413,414 and 511
Mike Becker <universe@uap-core.de>
parents:
228
diff
changeset
|
118 | 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
|
119 | 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
|
120 | 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
|
121 | DAV_NET_AUTH_REQUIRED |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
122 | }; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
123 | |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
124 | typedef enum DavError DavError; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
125 | |
331
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
126 | enum DavXmlNodeType { |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
127 | DAV_XML_NONE = 0, |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
128 | DAV_XML_ELEMENT, |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
129 | DAV_XML_TEXT |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
130 | }; |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
131 | |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
132 | typedef enum DavXmlNodeType DavXmlNodeType; |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
133 | |
43
03076907b58a
added file name encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
134 | #define DAV_SESSION_ENCRYPT_CONTENT 0x0001 |
03076907b58a
added file name encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
135 | #define DAV_SESSION_ENCRYPT_NAME 0x0002 |
606
aa49966e4e85
add new session flags for properties encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
605
diff
changeset
|
136 | #define DAV_SESSION_ENCRYPT_PROPERTIES 0x0004 |
aa49966e4e85
add new session flags for properties encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
605
diff
changeset
|
137 | #define DAV_SESSION_DECRYPT_CONTENT 0x0008 |
aa49966e4e85
add new session flags for properties encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
605
diff
changeset
|
138 | #define DAV_SESSION_DECRYPT_NAME 0x0010 |
aa49966e4e85
add new session flags for properties encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
605
diff
changeset
|
139 | #define DAV_SESSION_DECRYPT_PROPERTIES 0x0020 |
aa49966e4e85
add new session flags for properties encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
605
diff
changeset
|
140 | #define DAV_SESSION_STORE_HASH 0x0040 |
40
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
141 | |
606
aa49966e4e85
add new session flags for properties encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
605
diff
changeset
|
142 | #define DAV_SESSION_CONTENT_ENCRYPTION 0x0009 |
aa49966e4e85
add new session flags for properties encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
605
diff
changeset
|
143 | #define DAV_SESSION_FULL_ENCRYPTION 0x003f |
43
03076907b58a
added file name encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
144 | |
03076907b58a
added file name encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
145 | |
607
5dc7fe41e8f8
move some properties to new namespace
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
606
diff
changeset
|
146 | #define DAV_NS "http://davutils.org/" |
5dc7fe41e8f8
move some properties to new namespace
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
606
diff
changeset
|
147 | #define DAV_PROPS_NS "http://davutils.org/props/" |
40
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
148 | |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
149 | struct DavNamespace { |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
150 | char *prefix; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
151 | char *name; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
152 | }; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
153 | |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
154 | struct DavResource { |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
155 | DavSession *session; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
156 | DavResource *prev; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
157 | DavResource *next; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
158 | DavResource *parent; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
159 | DavResource *children; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
160 | char *name; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
161 | char *path; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
162 | char *href; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
163 | uint64_t contentlength; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
164 | char *contenttype; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
165 | time_t creationdate; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
166 | time_t lastmodified; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
167 | void *data; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
168 | int iscollection; |
525
26a1d5b9d9d2
improves metadata support in dav-sync push
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
520
diff
changeset
|
169 | int exists; |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
170 | }; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
171 | |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
172 | struct DavSession { |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
173 | DavContext *context; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
174 | CURL *handle; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
175 | char *base_url; |
747
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
736
diff
changeset
|
176 | CxMempool *mp; |
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
736
diff
changeset
|
177 | CxMap *pathcache; |
40
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
178 | DavKey *key; |
208
1fb26aca5093
added API for webdav locking
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
207
diff
changeset
|
179 | void *locks; |
38
b855f76e965b
code cleanup + experimental login prompt
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
36
diff
changeset
|
180 | uint32_t flags; |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
181 | DavError error; |
225
a297c2e28fa1
improved error handling in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
221
diff
changeset
|
182 | char *errorstr; |
354
067ea2315a8a
moves auth prompt functionality to libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
338
diff
changeset
|
183 | |
067ea2315a8a
moves auth prompt functionality to libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
338
diff
changeset
|
184 | int(*auth_prompt)(DavSession *sn, void *userdata); |
067ea2315a8a
moves auth prompt functionality to libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
338
diff
changeset
|
185 | void *authprompt_userdata; |
355
5da2cf15eb44
adds primitive progress indicator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
354
diff
changeset
|
186 | |
788
9b9420041d8e
add request/response body to verbose output / add DavSession logfunc
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
747
diff
changeset
|
187 | dav_rqlog_func logfunc; |
9b9420041d8e
add request/response body to verbose output / add DavSession logfunc
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
747
diff
changeset
|
188 | |
355
5da2cf15eb44
adds primitive progress indicator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
354
diff
changeset
|
189 | void(*get_progress)(DavResource *res, int64_t total, int64_t now, void *userdata); |
5da2cf15eb44
adds primitive progress indicator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
354
diff
changeset
|
190 | void(*put_progress)(DavResource *res, int64_t total, int64_t now, void *userdata); |
5da2cf15eb44
adds primitive progress indicator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
354
diff
changeset
|
191 | void *progress_userdata; |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
192 | }; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
193 | |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
194 | struct DavContext { |
805
bff983370565
make DavContext mt-safe
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
195 | CxMap *namespaces; |
bff983370565
make DavContext mt-safe
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
196 | CxMap *namespaceinfo; |
bff983370565
make DavContext mt-safe
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
197 | CxMap *keys; |
bff983370565
make DavContext mt-safe
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
198 | CxList *sessions; |
bff983370565
make DavContext mt-safe
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
199 | DavProxy *http_proxy; |
bff983370565
make DavContext mt-safe
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
200 | DavProxy *https_proxy; |
bff983370565
make DavContext mt-safe
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
201 | DAV_MUTEX mutex; |
bff983370565
make DavContext mt-safe
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
202 | DavBool mtsafe; |
36 | 203 | }; |
204 | ||
205 | struct DavProxy { | |
206 | char *url; | |
207 | char *username; | |
208 | char *password; | |
209 | char *no_proxy; | |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
210 | }; |
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 | struct DavProperty { |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
213 | DavNamespace *ns; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
214 | char *name; |
331
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
215 | DavXmlNode *value; |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
216 | }; |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
217 | |
84
7fca3788261d
added info command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
75
diff
changeset
|
218 | struct DavPropName { |
7fca3788261d
added info command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
75
diff
changeset
|
219 | char *ns; |
7fca3788261d
added info command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
75
diff
changeset
|
220 | char *name; |
7fca3788261d
added info command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
75
diff
changeset
|
221 | }; |
7fca3788261d
added info command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
75
diff
changeset
|
222 | |
128
649eb328674a
implemented minimal executor features and added missing ucx files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
124
diff
changeset
|
223 | struct DavResult { |
124
41939c8f3f9c
expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
100
diff
changeset
|
224 | DavResource *result; |
41939c8f3f9c
expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
100
diff
changeset
|
225 | int status; |
41939c8f3f9c
expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
100
diff
changeset
|
226 | }; |
41939c8f3f9c
expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
100
diff
changeset
|
227 | |
40
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
228 | #define DAV_KEY_AES128 0 |
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
229 | #define DAV_KEY_AES256 1 |
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
230 | |
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
231 | struct DavKey { |
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
232 | char *name; |
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
233 | int type; |
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
234 | void *data; |
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
235 | size_t length; |
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
236 | }; |
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
237 | |
609
dc3d70848c7c
implement encrypted properties
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
607
diff
changeset
|
238 | struct DavNSInfo { |
dc3d70848c7c
implement encrypted properties
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
607
diff
changeset
|
239 | char *prefix; |
dc3d70848c7c
implement encrypted properties
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
607
diff
changeset
|
240 | DavBool encrypt; |
dc3d70848c7c
implement encrypted properties
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
607
diff
changeset
|
241 | }; |
dc3d70848c7c
implement encrypted properties
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
607
diff
changeset
|
242 | |
331
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
243 | struct DavXmlNode { |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
244 | DavXmlNodeType type; |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
245 | |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
246 | char *namespace; |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
247 | char *name; |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
248 | |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
249 | DavXmlNode *prev; |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
250 | DavXmlNode *next; |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
251 | DavXmlNode *children; |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
252 | DavXmlNode *parent; |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
253 | |
520
da2b0cc44e4f
adds xml attribute support and xattr property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
505
diff
changeset
|
254 | DavXmlAttr *attributes; |
331
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
255 | |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
256 | char *content; |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
257 | size_t contentlength; |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
258 | }; |
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
259 | |
520
da2b0cc44e4f
adds xml attribute support and xattr property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
505
diff
changeset
|
260 | struct DavXmlAttr { |
da2b0cc44e4f
adds xml attribute support and xattr property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
505
diff
changeset
|
261 | char *name; |
da2b0cc44e4f
adds xml attribute support and xattr property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
505
diff
changeset
|
262 | char *value; |
da2b0cc44e4f
adds xml attribute support and xattr property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
505
diff
changeset
|
263 | DavXmlAttr *next; |
da2b0cc44e4f
adds xml attribute support and xattr property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
505
diff
changeset
|
264 | }; |
da2b0cc44e4f
adds xml attribute support and xattr property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
505
diff
changeset
|
265 | |
587
3c917df041b8
add func for creating the content of crypto-prop properties
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
560
diff
changeset
|
266 | DavContext* dav_context_new(void); |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
267 | void dav_context_destroy(DavContext *ctx); |
805
bff983370565
make DavContext mt-safe
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
268 | void dav_context_set_mtsafe(DavContext *ctx, DavBool enable); |
bff983370565
make DavContext mt-safe
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
269 | |
bff983370565
make DavContext mt-safe
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
270 | void dav_context_lock(DavContext *ctx); |
bff983370565
make DavContext mt-safe
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
271 | void dav_context_unlock(DavContext *ctx); |
40
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
272 | |
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
273 | void dav_context_add_key(DavContext *context, DavKey *key); |
747
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
736
diff
changeset
|
274 | DavKey* dav_context_get_key(DavContext *context, const char *name); |
40
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
275 | |
317
7eea57f6d847
adds namespace config element
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
315
diff
changeset
|
276 | 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
|
277 | DavNamespace* dav_get_namespace(DavContext *context, const char *prefix); |
747
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
736
diff
changeset
|
278 | DavNamespace* dav_get_namespace_s(DavContext *context, cxstring prefix); |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
279 | |
609
dc3d70848c7c
implement encrypted properties
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
607
diff
changeset
|
280 | int dav_enable_namespace_encryption(DavContext *context, const char *ns, DavBool encrypt); |
dc3d70848c7c
implement encrypted properties
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
607
diff
changeset
|
281 | int dav_namespace_is_encrypted(DavContext *context, const char *ns); |
dc3d70848c7c
implement encrypted properties
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
607
diff
changeset
|
282 | |
805
bff983370565
make DavContext mt-safe
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
283 | int dav_context_add_session(DavContext *context, DavSession *sn); |
bff983370565
make DavContext mt-safe
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
284 | int dav_context_remove_session(DavContext *context, DavSession *sn); |
bff983370565
make DavContext mt-safe
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
796
diff
changeset
|
285 | |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
286 | 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
|
287 | DavSession* dav_session_new_auth( |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
288 | DavContext *context, |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
289 | char *base_url, |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
290 | char *user, |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
291 | char *password); |
806
673a803d2203
fix session dup
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
805
diff
changeset
|
292 | DavSession* dav_session_clone(DavSession *sn); |
796
81e0f67386a6
remove old config loader
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
795
diff
changeset
|
293 | void dav_session_set_auth(DavSession *sn, const char *user, const char *password); |
81e0f67386a6
remove old config loader
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
795
diff
changeset
|
294 | void dav_session_set_auth_s(DavSession *sn, cxstring user, cxstring password); |
497
411bd1098175
fixes DavSession creation in dav-sync with enabled encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
491
diff
changeset
|
295 | void dav_session_set_baseurl(DavSession *sn, char *base_url); |
43
03076907b58a
added file name encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
296 | 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
|
297 | |
354
067ea2315a8a
moves auth prompt functionality to libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
338
diff
changeset
|
298 | void dav_session_set_authcallback(DavSession *sn, dav_auth_func func, void *userdata); |
355
5da2cf15eb44
adds primitive progress indicator
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
354
diff
changeset
|
299 | void dav_session_set_progresscallback(DavSession *sn, dav_progress_func get, dav_progress_func put, void *userdata); |
354
067ea2315a8a
moves auth prompt functionality to libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
338
diff
changeset
|
300 | |
39
3e55bed345f9
added some aes functions + ucx update
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
38
diff
changeset
|
301 | void dav_session_destroy(DavSession *sn); |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
302 | |
790
7110b37f2a6b
fix dav_context_destroy
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
788
diff
changeset
|
303 | void dav_session_destructor(DavSession *sn); |
7110b37f2a6b
fix dav_context_destroy
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
788
diff
changeset
|
304 | |
39
3e55bed345f9
added some aes functions + ucx update
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
38
diff
changeset
|
305 | 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
|
306 | 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
|
307 | 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
|
308 | 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
|
309 | 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
|
310 | |
478
baa63fef5c5c
fixes redirects
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
475
diff
changeset
|
311 | void dav_set_effective_href(DavSession *sn, DavResource *resource); |
747
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
736
diff
changeset
|
312 | DavResource* dav_get(DavSession *sn, char *path, const char *properties); |
40
a95ee94b9204
supports whitespace in paths
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
39
diff
changeset
|
313 | |
747
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
736
diff
changeset
|
314 | CxList* parse_properties_string(DavContext *context, cxstring str); |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
315 | |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
316 | DavResource* dav_query(DavSession *sn, char *query, ...); |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
317 | |
747
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
736
diff
changeset
|
318 | cxmutstr dav_property_key(const char *ns, const char *name); |
134
4bccc18820e8
implemented execution of field list expressions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
128
diff
changeset
|
319 | void dav_get_property_namespace_str( |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
320 | DavContext *ctx, |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
321 | char *prefixed_name, |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
322 | char **ns, |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
323 | char **name); |
134
4bccc18820e8
implemented execution of field list expressions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
128
diff
changeset
|
324 | DavNamespace* dav_get_property_namespace( |
4bccc18820e8
implemented execution of field list expressions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
128
diff
changeset
|
325 | DavContext *ctx, |
4bccc18820e8
implemented execution of field list expressions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
128
diff
changeset
|
326 | char *prefixed_name, |
4bccc18820e8
implemented execution of field list expressions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
128
diff
changeset
|
327 | char **name); |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
328 | |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
329 | /* ------------------------ resource functions ------------------------ */ |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
330 | |
747
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
736
diff
changeset
|
331 | DavResource* dav_resource_new(DavSession *sn, const char *path); |
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
736
diff
changeset
|
332 | DavResource* dav_resource_new_child(DavSession *sn, DavResource *parent, const char *name); |
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
736
diff
changeset
|
333 | DavResource* dav_resource_new_href(DavSession *sn, const char *href); |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
334 | |
43
03076907b58a
added file name encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
335 | void dav_resource_free(DavResource *res); |
03076907b58a
added file name encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
336 | void dav_resource_free_all(DavResource *res); |
03076907b58a
added file name encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
337 | |
03076907b58a
added file name encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
338 | char* dav_resource_get_href(DavResource *resource); |
03076907b58a
added file name encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
339 | |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
340 | DavResource* dav_create_child(DavResource *parent, char *name); |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
341 | int dav_delete(DavResource *res); |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
342 | int dav_create(DavResource *res); |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
343 | int dav_exists(DavResource *res); |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
344 | |
181
a8f8cdbf85df
implemented webdav copy and move method
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
178
diff
changeset
|
345 | int dav_copy(DavResource *res, char *newpath); |
a8f8cdbf85df
implemented webdav copy and move method
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
178
diff
changeset
|
346 | 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
|
347 | 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
|
348 | 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
|
349 | int dav_copyto(DavResource *res, char *url, DavBool override); |
05d11fbcaeb3
improved copy/move
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
185
diff
changeset
|
350 | 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
|
351 | |
208
1fb26aca5093
added API for webdav locking
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
207
diff
changeset
|
352 | int dav_lock(DavResource *res); |
315
7db4dbf4e6f9
adds lock timeout
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
298
diff
changeset
|
353 | 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
|
354 | int dav_unlock(DavResource *res); |
207
de23f8881e9f
fixed hash verification and head requests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
206
diff
changeset
|
355 | |
331
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
356 | DavXmlNode* dav_get_property(DavResource *res, char *name); |
505 | 357 | DavXmlNode* dav_get_property_ns(DavResource *res, const char *ns, const char *name); |
609
dc3d70848c7c
implement encrypted properties
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
607
diff
changeset
|
358 | DavXmlNode* dav_get_encrypted_property_ns(DavResource *res, const char *ns, const char *name); |
331
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
359 | 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
|
360 | char* dav_get_string_property_ns(DavResource *res, char *ns, char *name); |
361
b6f2462ee055
adds xattr lib and tag support
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
355
diff
changeset
|
361 | void dav_set_string_property(DavResource *res, char *name, char *value); |
b6f2462ee055
adds xattr lib and tag support
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
355
diff
changeset
|
362 | void dav_set_string_property_ns(DavResource *res, char *ns, char *name, char *value); |
b6f2462ee055
adds xattr lib and tag support
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
355
diff
changeset
|
363 | void dav_set_property(DavResource *res, char *name, DavXmlNode *value); |
b6f2462ee055
adds xattr lib and tag support
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
355
diff
changeset
|
364 | void dav_set_property_ns(DavResource *res, char *ns, char *name, DavXmlNode *value); |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
365 | void dav_remove_property(DavResource *res, char *name); |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
366 | void dav_remove_property_ns(DavResource *res, char *ns, char *name); |
605
bbc66c72661a
add new api for encrypted properties
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
587
diff
changeset
|
367 | void dav_set_encrypted_property_ns(DavResource *res, char *ns, char *name, DavXmlNode *value); |
bbc66c72661a
add new api for encrypted properties
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
587
diff
changeset
|
368 | void dav_set_encrypted_string_property_ns(DavResource *res, char *ns, char *name, char *value); |
bbc66c72661a
add new api for encrypted properties
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
587
diff
changeset
|
369 | void dav_remove_encrypted_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
|
370 | |
84
7fca3788261d
added info command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
75
diff
changeset
|
371 | DavPropName* dav_get_property_names(DavResource *res, size_t *count); |
7fca3788261d
added info command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
75
diff
changeset
|
372 | |
478
baa63fef5c5c
fixes redirects
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
475
diff
changeset
|
373 | void dav_set_content(DavResource *res, void *stream, dav_read_func read_func, dav_seek_func seek_func); |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
374 | 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
|
375 | 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
|
376 | |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
377 | 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
|
378 | 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
|
379 | int dav_store(DavResource *res); |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
380 | 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
|
381 | |
728 | 382 | DavInputStream* dav_inputstream_open(DavResource *res); |
383 | size_t dav_read(void *buf, size_t size, size_t nitems, DavInputStream *in); | |
384 | void dav_inputstream_close(DavInputStream *in); | |
385 | ||
386 | DavOutputStream* dav_outputstream_open(DavResource *res); | |
387 | size_t dav_write(const void *buf, size_t size, size_t nitems, DavOutputStream *out); | |
388 | int dav_outputstream_close(DavOutputStream *out); | |
389 | ||
788
9b9420041d8e
add request/response body to verbose output / add DavSession logfunc
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
747
diff
changeset
|
390 | void dav_verbose_log( |
9b9420041d8e
add request/response body to verbose output / add DavSession logfunc
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
747
diff
changeset
|
391 | DavSession *sn, |
9b9420041d8e
add request/response body to verbose output / add DavSession logfunc
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
747
diff
changeset
|
392 | const char *method, |
9b9420041d8e
add request/response body to verbose output / add DavSession logfunc
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
747
diff
changeset
|
393 | const char *url, |
9b9420041d8e
add request/response body to verbose output / add DavSession logfunc
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
747
diff
changeset
|
394 | const char *request_body, |
9b9420041d8e
add request/response body to verbose output / add DavSession logfunc
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
747
diff
changeset
|
395 | size_t request_bodylen, |
9b9420041d8e
add request/response body to verbose output / add DavSession logfunc
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
747
diff
changeset
|
396 | int status, |
9b9420041d8e
add request/response body to verbose output / add DavSession logfunc
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
747
diff
changeset
|
397 | const char *response_body, |
9b9420041d8e
add request/response body to verbose output / add DavSession logfunc
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
747
diff
changeset
|
398 | size_t response_bodylen); |
9b9420041d8e
add request/response body to verbose output / add DavSession logfunc
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
747
diff
changeset
|
399 | |
43
03076907b58a
added file name encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
400 | // private |
747
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
736
diff
changeset
|
401 | int dav_propfind(DavSession *sn, DavResource *root, CxBuffer *rqbuf); |
43
03076907b58a
added file name encryption
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
42
diff
changeset
|
402 | |
475
52e4171d42ce
adds minimal deltav implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
373
diff
changeset
|
403 | |
52e4171d42ce
adds minimal deltav implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
373
diff
changeset
|
404 | /* --------------------------- DeltaV ---------------------------- */ |
52e4171d42ce
adds minimal deltav implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
373
diff
changeset
|
405 | |
52e4171d42ce
adds minimal deltav implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
373
diff
changeset
|
406 | int dav_versioncontrol(DavResource *res); |
52e4171d42ce
adds minimal deltav implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
373
diff
changeset
|
407 | int dav_checkout(DavResource *res); |
52e4171d42ce
adds minimal deltav implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
373
diff
changeset
|
408 | int dav_checkin(DavResource *res); |
52e4171d42ce
adds minimal deltav implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
373
diff
changeset
|
409 | int dav_uncheckout(DavResource *res); |
52e4171d42ce
adds minimal deltav implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
373
diff
changeset
|
410 | DavResource* dav_versiontree(DavResource *res, char *properties); |
52e4171d42ce
adds minimal deltav implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
373
diff
changeset
|
411 | |
361
b6f2462ee055
adds xattr lib and tag support
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
355
diff
changeset
|
412 | /* ------------------------ xml functions ------------------------ */ |
331
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
413 | 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
|
414 | DavBool dav_xml_isstring(DavXmlNode *node); |
373
dcc03142eb5f
dav info prints simplified xml values
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
371
diff
changeset
|
415 | DavXmlNode* dav_xml_nextelm(DavXmlNode *node); |
736
40be8db6fe45
fix dav-sync push creating finfo elements without using the mempool, which could lead to crashes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
728
diff
changeset
|
416 | DavXmlNode* dav_text_node(DavSession *sn, const char *text); |
40be8db6fe45
fix dav-sync push creating finfo elements without using the mempool, which could lead to crashes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
728
diff
changeset
|
417 | DavXmlNode* dav_text_element(DavSession *sn, const char *ns, const char *name, const char *text); |
331
9ca1e4706acc
adds initial support for xml properties in libidav
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
317
diff
changeset
|
418 | |
361
b6f2462ee055
adds xattr lib and tag support
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
355
diff
changeset
|
419 | DavXmlNode* dav_copy_node(DavXmlNode *node); |
b6f2462ee055
adds xattr lib and tag support
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
355
diff
changeset
|
420 | |
736
40be8db6fe45
fix dav-sync push creating finfo elements without using the mempool, which could lead to crashes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
728
diff
changeset
|
421 | void dav_free_xml_node_sn(DavSession *sn, DavXmlNode *node); |
40be8db6fe45
fix dav-sync push creating finfo elements without using the mempool, which could lead to crashes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
728
diff
changeset
|
422 | void dav_free_xml_node(DavXmlNode *node); |
40be8db6fe45
fix dav-sync push creating finfo elements without using the mempool, which could lead to crashes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
728
diff
changeset
|
423 | |
361
b6f2462ee055
adds xattr lib and tag support
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
355
diff
changeset
|
424 | DavXmlNode* dav_xml_createnode(const char *ns, const char *name); |
b6f2462ee055
adds xattr lib and tag support
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
355
diff
changeset
|
425 | DavXmlNode* dav_xml_createnode_with_text(const char *ns, const char *name, const char *text); |
b6f2462ee055
adds xattr lib and tag support
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
355
diff
changeset
|
426 | DavXmlNode* dav_xml_createtextnode(const char *text); |
b6f2462ee055
adds xattr lib and tag support
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
355
diff
changeset
|
427 | void dav_xml_add_child(DavXmlNode *node, DavXmlNode *child); |
520
da2b0cc44e4f
adds xml attribute support and xattr property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
505
diff
changeset
|
428 | void dav_xml_add_attr(DavXmlNode *node, const char *name, const char *value); |
526
e3c0440bd599
adds metadata support to dav-sync pull
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
525
diff
changeset
|
429 | char* dav_xml_get_attr(DavXmlNode *node, const char *name); |
361
b6f2462ee055
adds xattr lib and tag support
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
355
diff
changeset
|
430 | |
371
604e7e335b3b
adds support for xml properties in set-property command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
361
diff
changeset
|
431 | DavXmlNode* dav_parse_xml(DavSession *sn, const char *str, size_t len); |
604e7e335b3b
adds support for xml properties in set-property command
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
361
diff
changeset
|
432 | |
33
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
433 | #ifdef __cplusplus |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
434 | } |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
435 | #endif |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
436 | |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
437 | #endif /* WEBDAV_H */ |
0bbbb0341606
some code cleanup and bug fixes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
438 |