src/server/public/vfs.h

Thu, 15 Aug 2024 22:38:03 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Thu, 15 Aug 2024 22:38:03 +0200
changeset 549
b26bec196a2e
parent 366
47bc686fafe4
permissions
-rw-r--r--

fix http_stream_parse_chunk_header: check if the chunk starts with a digit

59
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
1 /*
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
3 *
211
2160585200ac add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 189
diff changeset
4 * Copyright 2018 Olaf Wintermann. All rights reserved.
59
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
5 *
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
6 * Redistribution and use in source and binary forms, with or without
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
7 * modification, are permitted provided that the following conditions are met:
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
8 *
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
9 * 1. Redistributions of source code must retain the above copyright
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
10 * notice, this list of conditions and the following disclaimer.
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
11 *
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
12 * 2. Redistributions in binary form must reproduce the above copyright
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
13 * notice, this list of conditions and the following disclaimer in the
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
14 * documentation and/or other materials provided with the distribution.
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
15 *
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ab25c0a231d0 some fixes and new public APIs
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
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
26 * POSSIBILITY OF SUCH DAMAGE.
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
27 */
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
28
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
29 #ifndef WS_VFS_H
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
30 #define WS_VFS_H
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
31
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
32 #include "nsapi.h"
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
33 #include "acl.h"
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
34
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
35 #ifdef __cplusplus
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
36 extern "C" {
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
37 #endif
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
38
165
6942a8c3e737 refactors vfs code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 66
diff changeset
39 #define VFS_CHECKS_ACL 0x0001
6942a8c3e737 refactors vfs code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 66
diff changeset
40
59
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
41 typedef struct VFS_IO VFS_IO;
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
42 typedef struct VFS_DIRIO VFS_DIRIO;
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
43 typedef struct VFSFile VFSFile;
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
44 typedef struct VFSDir VFSDir;
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
45 typedef struct VFSEntry VFSEntry;
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
46
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
47 #define VFS_DIR VFSDir*
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
48 #define VFS_ENTRY VFSEntry
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
49
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
50 struct VFS {
241
4adad7faf452 add proppatch op
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 211
diff changeset
51 SYS_FILE (*open)(VFSContext *ctx, const char *path, int oflags);
4adad7faf452 add proppatch op
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 211
diff changeset
52 int (*stat)(VFSContext *ctx, const char *path, struct stat *buf);
59
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
53 int (*fstat)(VFSContext *ctx, SYS_FILE fd, struct stat *buf);
241
4adad7faf452 add proppatch op
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 211
diff changeset
54 VFS_DIR (*opendir)(VFSContext *ctx, const char *path);
211
2160585200ac add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 189
diff changeset
55 VFS_DIR (*fdopendir)(VFSContext *ctx, SYS_FILE fd);
241
4adad7faf452 add proppatch op
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 211
diff changeset
56 int (*mkdir)(VFSContext *ctx, const char *path);
4adad7faf452 add proppatch op
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 211
diff changeset
57 int (*unlink)(VFSContext *ctx, const char *path);
247
1df803e06076 implement webdav delete for collections
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 241
diff changeset
58 int (*rmdir)(VFSContext *Ctx, const char *path);
165
6942a8c3e737 refactors vfs code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 66
diff changeset
59 uint32_t flags;
211
2160585200ac add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 189
diff changeset
60 void *instance;
59
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
61 };
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
62
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
63 struct VFSContext {
65
14722c5f8856 added chunked transfer encoding
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 59
diff changeset
64 pool_handle_t *pool;
59
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
65 Session *sn;
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
66 Request *rq;
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
67 VFS *vfs;
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
68 User *user;
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
69 ACLListHandle *acllist;
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
70 uint32_t aclreqaccess;
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
71 int vfs_errno;
286
864e2d701dd4 set error status code directly in vfs_* calls
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 277
diff changeset
72 WSBool error_response_set;
59
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
73 };
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
74
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
75 struct VFSFile {
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
76 VFSContext *ctx;
211
2160585200ac add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 189
diff changeset
77 VFS_IO *io; /* IO functions */
2160585200ac add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 189
diff changeset
78 void *data; /* private data used by the VFSFile implementation */
2160585200ac add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 189
diff changeset
79 int fd; /* native file descriptor if available, or -1 */
59
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
80 };
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
81
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
82 struct VFSDir {
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
83 VFSContext *ctx;
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
84 VFS_DIRIO *io;
211
2160585200ac add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 189
diff changeset
85 void *data; /* private data used by the VFSDir implementation */
2160585200ac add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 189
diff changeset
86 int fd; /* native file descriptor if available, or -1 */
59
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
87 };
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
88
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
89 struct VFSEntry {
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
90 char *name;
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
91 struct stat stat;
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
92 void *stat_extra;
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
93 int stat_errno;
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
94 };
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
95
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
96 struct VFS_IO {
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
97 ssize_t (*read)(SYS_FILE fd, void *buf, size_t nbyte);
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
98 ssize_t (*write)(SYS_FILE fd, const void *buf, size_t nbyte);
189
a2438f6d1e73 adds vfs pread/pwrite functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 172
diff changeset
99 ssize_t (*pread)(SYS_FILE fd, void *buf, size_t nbyte, off_t offset);
a2438f6d1e73 adds vfs pread/pwrite functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 172
diff changeset
100 ssize_t (*pwrite)(SYS_FILE fd, const void *buf, size_t nbyte, off_t offset);
66
74babc0082b7 added authentication cache
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 65
diff changeset
101 off_t (*seek)(SYS_FILE fd, off_t offset, int whence);
59
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
102 void (*close)(SYS_FILE fd);
172
5580517faafc adds public aio and poll api and asynchronous send_range function
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 165
diff changeset
103 int (*opt_aioread)(aiocb_s *aiocb);
5580517faafc adds public aio and poll api and asynchronous send_range function
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 165
diff changeset
104 int (*opt_aiowrite)(aiocb_s *aiocb);
345
5832e10fc59a add optional getetag function to VFS API
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 286
diff changeset
105 const char* (*opt_getetag)(SYS_FILE fd);
59
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
106 };
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
107
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
108 struct VFS_DIRIO {
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
109 int (*readdir)(VFS_DIR dir, VFS_ENTRY *entry, int getstat);
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
110 void (*close)(VFS_DIR dir);
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
111 };
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
112
366
47bc686fafe4 add new dav config element
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 345
diff changeset
113 typedef void*(*vfs_init_func)(ServerConfiguration *cfg, pool_handle_t *pool, WSConfigNode *config);
47bc686fafe4 add new dav config element
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 345
diff changeset
114 typedef VFS*(*vfs_create_func)(Session *sn, Request *rq, pblock *pb, void *initData);
276
0cb4eda146c4 add function to create a postgresql-based VFS
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
115
59
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
116 /*
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
117 * registers a new VFS
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
118 */
366
47bc686fafe4 add new dav config element
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 345
diff changeset
119 int vfs_register_type(const char *name, vfs_init_func vfsInit, vfs_create_func vfsCreate);
59
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
120
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
121 /*
277
7608af69739f add support for vfsclass parameter in nametrans safs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 276
diff changeset
122 * Create a new VFS instance
7608af69739f add support for vfsclass parameter in nametrans safs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 276
diff changeset
123 */
366
47bc686fafe4 add new dav config element
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 345
diff changeset
124 VFS* vfs_create(Session *sn, Request *rq, const char *vfs_class, pblock *pb, void *initData);
277
7608af69739f add support for vfsclass parameter in nametrans safs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 276
diff changeset
125
7608af69739f add support for vfsclass parameter in nametrans safs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 276
diff changeset
126 /*
59
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
127 * creates a VFSContext for a Request
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
128 * vfs calls will do ACL checks
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
129 */
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
130 VFSContext* vfs_request_context(Session *sn, Request *rq);
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
131
241
4adad7faf452 add proppatch op
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 211
diff changeset
132 SYS_FILE vfs_open(VFSContext *ctx, const char *path, int oflags);
4adad7faf452 add proppatch op
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 211
diff changeset
133 SYS_FILE vfs_openRO(VFSContext *ctx, const char *path);
4adad7faf452 add proppatch op
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 211
diff changeset
134 SYS_FILE vfs_openWO(VFSContext *ctx, const char *path);
4adad7faf452 add proppatch op
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 211
diff changeset
135 SYS_FILE vfs_openRW(VFSContext *ctx, const char *path);
4adad7faf452 add proppatch op
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 211
diff changeset
136 int vfs_stat(VFSContext *ctx, const char *path, struct stat *buf);
59
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
137 int vfs_fstat(VFSContext *ctx, SYS_FILE fd, struct stat *buf);
345
5832e10fc59a add optional getetag function to VFS API
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 286
diff changeset
138 const char * vfs_getetag(SYS_FILE fd);
59
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
139 void vfs_close(SYS_FILE fd);
241
4adad7faf452 add proppatch op
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 211
diff changeset
140 VFS_DIR vfs_opendir(VFSContext *ctx, const char *path);
211
2160585200ac add propfind/proppatch parser and first iteration of the new webdav api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 189
diff changeset
141 VFS_DIR vfs_fdopendir(VFSContext *ctx, SYS_FILE fd);
59
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
142 int vfs_readdir(VFS_DIR dir, VFS_ENTRY *entry);
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
143 int vfs_readdir_stat(VFS_DIR dir, VFS_ENTRY *entry);
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
144 void vfs_closedir(VFS_DIR dir);
241
4adad7faf452 add proppatch op
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 211
diff changeset
145 int vfs_mkdir(VFSContext *ctx, const char *path);
4adad7faf452 add proppatch op
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 211
diff changeset
146 int vfs_unlink(VFSContext *ctx, const char *path);
247
1df803e06076 implement webdav delete for collections
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 241
diff changeset
147 int vfs_rmdir(VFSContext *ctx, const char *path);
59
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
148
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
149 #ifdef __cplusplus
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
150 }
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
151 #endif
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
152
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
153 #endif /* WS_VFS_H */
ab25c0a231d0 some fixes and new public APIs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
154

mercurial