--- a/src/server/plugins/postgresql/vfs.h Fri Jan 28 16:01:05 2022 +0100 +++ b/src/server/plugins/postgresql/vfs.h Sun Jan 30 15:25:29 2022 +0100 @@ -42,8 +42,24 @@ ResourceData *pg_resource; PGconn *connection; } PgVFS; - + +typedef struct PgFile { + int64_t resource_id; + int64_t parent_id; + WSBool iscollection; +} PgFile; + VFS* pg_vfs_create(Session *sn, Request *rq, pblock *pb); + + +/* + * Resolve a path into a parent_id and resource name + * + * Only absolute paths are supported, therefore path[0] must be '/' + * + * If the resource is not found, ctx->vfs_errno is set to ENOENT + */ +int pg_resolve_path(VFSContext *ctx, const char *path, int64_t *parent_id, int64_t *resource_id, const char **resource_name, WSBool *iscollection); SYS_FILE pg_vfs_open(VFSContext *ctx, const char *path, int oflags); int pg_vfs_stat(VFSContext *ctx, const char *path, struct stat *buf);