1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 #ifndef WS_WEBDAV_XATTRBACKEND_H
31 #define WS_WEBDAV_XATTRBACKEND_H
32
33 #include "../public/webdav.h"
34
35 #include <cx/map.h>
36 #include <cx/string.h>
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41
42 typedef struct WebdavXAttrRepository {
43 char *xattr_name;
44 } WebdavXAttrRepository;
45
46 typedef struct WebdavXAttrBackend {
47 WebdavXAttrRepository *repo;
48 } WebdavXAttrBackend;
49
50 typedef struct XAttrPropfind {
51 const char *base_href;
52 const char *base_path;
53 } XAttrPropfind;
54
55 typedef struct XAttrProppatch {
56 CxMap *properties;
57 } XAttrProppatch;
58
59
60 int webdav_init_xattr_backend(
void);
61
62
63 void* webdav_xattr_init(ServerConfiguration *cfg,
pool_handle_t *pool, WSConfigNode *config);
64
65 WebdavBackend* webdav_xattr_create(Session *sn, Request *rq, pblock *pb,
void *initData);
66
67
68
69
70 int webdav_xattr_propfind_init(
71 WebdavPropfindRequest *rq,
72 const char *path,
73 const char *href,
74 WebdavPList **outplist);
75 int webdav_xattr_propfind_do(
76 WebdavPropfindRequest *request,
77 WebdavResponse *response,
78 VFS_DIR parent,
79 WebdavResource *resource,
80 struct stat *s);
81 int webdav_xattr_propfind_finish(WebdavPropfindRequest *rq);
82 int webdav_xattr_proppatch_do(
83 WebdavProppatchRequest *request,
84 WebdavResource *response,
85 VFSFile *file,
86 WebdavPList **setInOut,
87 WebdavPList **removeInOut);
88 int webdav_xattr_proppatch_finish(
89 WebdavProppatchRequest *request,
90 WebdavResource *response,
91 VFSFile *file,
92 WSBool commit);
93
94 int webdav_xattr_propfind_get_requested_properties(
95 WebdavPropfindRequest *request,
96 WebdavResource *resource,
97 CxAllocator *a,
98 CxMap *pmap);
99
100 int webdav_xattr_propfind_allprop(
101 WebdavPropfindRequest *request,
102 WebdavResource *resource,
103 CxAllocator *a,
104 CxMap *pmap);
105
106
107
108 int webdav_xattr_put_prop(CxMap *pmap, WebdavProperty *prop);
109
110 CxMap* webdav_xattr_parse_data(CxAllocator *a,
const char *data,
size_t len,
const char *path);
111
112 cxmutstr webdav_xattr_serialze_map(CxAllocator *a, CxMap *pmap);
113
114
115 #ifdef __cplusplus
116 }
117 #endif
118
119 #endif
120
121