src/server/webdav/operation.h

branch
webdav
changeset 245
a193c42fc809
parent 241
4adad7faf452
child 246
155bdef7fe7e
equal deleted inserted replaced
244:e59abb210584 245:a193c42fc809
34 #ifdef __cplusplus 34 #ifdef __cplusplus
35 extern "C" { 35 extern "C" {
36 #endif 36 #endif
37 37
38 typedef int(*response_close_func)(WebdavOperation *, WebdavResource *); 38 typedef int(*response_close_func)(WebdavOperation *, WebdavResource *);
39
40 typedef struct WebdavVFSOperation WebdavVFSOperation;
39 41
40 struct WebdavOperation { 42 struct WebdavOperation {
41 WebdavBackend *dav; 43 WebdavBackend *dav;
42 Request *rq; 44 Request *rq;
43 Session *sn; 45 Session *sn;
51 response_close_func response_close; 53 response_close_func response_close;
52 54
53 VFS_DIR parent; /* current directory */ 55 VFS_DIR parent; /* current directory */
54 struct stat *stat; /* current stat object */ 56 struct stat *stat; /* current stat object */
55 }; 57 };
58
59 struct WebdavVFSOperation {
60 WebdavBackend *dav;
61 Request *rq;
62 Session *sn;
63
64 VFSContext *vfs;
65
66 char *path;
67 struct stat *stat;
68 int stat_errno;
69 };
70
71 enum WebdavVFSOpType {
72 WEBDAV_VFS_MKDIR = 0,
73 WEBDAV_VFS_DELETE
74 };
75
76 typedef enum WebdavVFSOpType WebdavVFSOpType;
77
78 typedef int(*vfs_op_func)(WebdavVFSRequest *, WSBool *);
79 typedef int(*vfs_op_finish_func)(WebdavVFSRequest *, WSBool);
56 80
57 /* 81 /*
58 * counts the number of backends 82 * counts the number of backends
59 */ 83 */
60 size_t webdav_num_backends(WebdavBackend *dav); 84 size_t webdav_num_backends(WebdavBackend *dav);
99 123
100 int webdav_op_proppatch_close_resource( 124 int webdav_op_proppatch_close_resource(
101 WebdavOperation *op, 125 WebdavOperation *op,
102 WebdavResource *resource); 126 WebdavResource *resource);
103 127
128
129 WebdavVFSOperation* webdav_vfs_op(
130 Session *sn,
131 Request *rq,
132 WebdavBackend *dav,
133 WSBool precondition);
134
135 int webdav_vfs_stat(WebdavVFSOperation *op);
136
137 int webdav_vfs_op_do(WebdavVFSOperation *op, WebdavVFSOpType type);
138
139 int webdav_vfs_unlink(WebdavVFSOperation *op);
140
104 #ifdef __cplusplus 141 #ifdef __cplusplus
105 } 142 }
106 #endif 143 #endif
107 144
108 #endif /* OPERATION_H */ 145 #endif /* OPERATION_H */

mercurial