src/server/plugins/postgresql/vfs.h

branch
webdav
changeset 374
77506ec632a4
parent 366
47bc686fafe4
equal deleted inserted replaced
373:f78a585e1a2f 374:77506ec632a4
30 #define WS_PG_VFS_H 30 #define WS_PG_VFS_H
31 31
32 #include "../../public/nsapi.h" 32 #include "../../public/nsapi.h"
33 #include "../../public/vfs.h" 33 #include "../../public/vfs.h"
34 34
35 #include "config.h"
36
35 #include <libpq-fe.h> 37 #include <libpq-fe.h>
36 #include <libpq/libpq-fs.h> 38 #include <libpq/libpq-fs.h>
37 39
38 #ifdef __cplusplus 40 #ifdef __cplusplus
39 extern "C" { 41 extern "C" {
42 #define PG_ETAG_MAXLEN 48 44 #define PG_ETAG_MAXLEN 48
43 45
44 typedef struct PgVFS { 46 typedef struct PgVFS {
45 ResourceData *pg_resource; 47 ResourceData *pg_resource;
46 PGconn *connection; 48 PGconn *connection;
49 char root_resource_id_str[32];
47 int64_t root_resource_id; 50 int64_t root_resource_id;
48 } PgVFS; 51 } PgVFS;
49 52
50 typedef struct PgFile { 53 typedef struct PgFile {
51 int64_t resource_id; 54 int64_t resource_id;
67 70
68 void* pg_vfs_init(ServerConfiguration *cfg, pool_handle_t *pool, WSConfigNode *config); 71 void* pg_vfs_init(ServerConfiguration *cfg, pool_handle_t *pool, WSConfigNode *config);
69 72
70 VFS* pg_vfs_create(Session *sn, Request *rq, pblock *pb, void *initData); 73 VFS* pg_vfs_create(Session *sn, Request *rq, pblock *pb, void *initData);
71 74
72 VFS* pg_vfs_create_from_resourcedata(Session *sn, Request *rq, ResourceData *resdata); 75 VFS* pg_vfs_create_from_resourcedata(Session *sn, Request *rq, PgRepository *repo, ResourceData *resdata);
73 76
74 77
75 /* 78 /*
76 * Resolve a path into a parent_id and resource name 79 * Resolve a path into a parent_id and resource name
77 * 80 *
80 * If the resource is not found, res_errno is set to ENOENT 83 * If the resource is not found, res_errno is set to ENOENT
81 */ 84 */
82 int pg_resolve_path( 85 int pg_resolve_path(
83 PGconn *connection, 86 PGconn *connection,
84 const char *path, 87 const char *path,
88 const char *root_id,
85 int64_t *parent_id, 89 int64_t *parent_id,
86 int64_t *resource_id, 90 int64_t *resource_id,
87 Oid *oid, 91 Oid *oid,
88 const char **resource_name, 92 const char **resource_name,
89 WSBool *iscollection, 93 WSBool *iscollection,

mercurial