src/server/webdav/operation.h

branch
webdav
changeset 252
5653a9626cc0
parent 247
1df803e06076
child 415
d938228c382e
equal deleted inserted replaced
251:f727a21497bb 252:5653a9626cc0
28 28
29 #ifndef OPERATION_H 29 #ifndef OPERATION_H
30 #define OPERATION_H 30 #define OPERATION_H
31 31
32 #include "../public/webdav.h" 32 #include "../public/webdav.h"
33 #include <ucx/list.h>
34 #include <ucx/map.h>
33 35
34 #ifdef __cplusplus 36 #ifdef __cplusplus
35 extern "C" { 37 extern "C" {
36 #endif 38 #endif
37 39
38 typedef int(*response_close_func)(WebdavOperation *, WebdavResource *); 40 typedef int(*response_close_func)(WebdavOperation *, WebdavResource *);
39 41
40 typedef struct WebdavVFSOperation WebdavVFSOperation; 42 typedef struct WebdavVFSOperation WebdavVFSOperation;
43
44 typedef struct WebdavCopy WebdavCopy;
45 typedef struct CopyResource CopyResource;
41 46
42 struct WebdavOperation { 47 struct WebdavOperation {
43 WebdavBackend *dav; 48 WebdavBackend *dav;
44 Request *rq; 49 Request *rq;
45 Session *sn; 50 Session *sn;
64 VFSContext *vfs; 69 VFSContext *vfs;
65 70
66 char *path; 71 char *path;
67 struct stat *stat; 72 struct stat *stat;
68 int stat_errno; 73 int stat_errno;
74 };
75
76 struct WebdavCopy {
77 WebdavResponse response;
78 Session *sn;
79 Request *rq;
80 CopyResource *current;
81
82 char *src_href;
83 char *src_path;
84 char *dst_href;
85 char *dst_path;
86 };
87
88 struct CopyResource {
89 WebdavResource resource;
90 UcxMap *properties;
69 }; 91 };
70 92
71 enum WebdavVFSOpType { 93 enum WebdavVFSOpType {
72 WEBDAV_VFS_MKDIR = 0, 94 WEBDAV_VFS_MKDIR = 0,
73 WEBDAV_VFS_DELETE 95 WEBDAV_VFS_DELETE
157 179
158 int webdav_vfs_op_do(WebdavVFSOperation *op, WebdavVFSOpType type); 180 int webdav_vfs_op_do(WebdavVFSOperation *op, WebdavVFSOpType type);
159 181
160 int webdav_vfs_unlink(WebdavVFSOperation *op); 182 int webdav_vfs_unlink(WebdavVFSOperation *op);
161 183
184
185 WebdavCopy* webdav_copy_create(
186 Session *sn,
187 Request *rq,
188 VFSContext *vfs,
189 char *from_href,
190 char *from_path,
191 char *to_href,
192 char *to_path);
193
162 #ifdef __cplusplus 194 #ifdef __cplusplus
163 } 195 }
164 #endif 196 #endif
165 197
166 #endif /* OPERATION_H */ 198 #endif /* OPERATION_H */

mercurial