src/server/plugins/postgresql/vfs.h

branch
webdav
changeset 346
784b24381bed
parent 345
5832e10fc59a
child 366
47bc686fafe4
equal deleted inserted replaced
345:5832e10fc59a 346:784b24381bed
37 37
38 #ifdef __cplusplus 38 #ifdef __cplusplus
39 extern "C" { 39 extern "C" {
40 #endif 40 #endif
41 41
42 #define PG_ETAG_MAXLEN 48
43
42 typedef struct PgVFS { 44 typedef struct PgVFS {
43 ResourceData *pg_resource; 45 ResourceData *pg_resource;
44 PGconn *connection; 46 PGconn *connection;
45 } PgVFS; 47 } PgVFS;
46 48
47 typedef struct PgFile { 49 typedef struct PgFile {
48 int64_t resource_id; 50 int64_t resource_id;
49 int64_t parent_id; 51 int64_t parent_id;
50 WSBool iscollection; 52 WSBool iscollection;
51 Oid oid; 53 Oid oid;
52 int fd; 54 int fd;
53 int oflags; 55 int oflags;
54 56 char etag[PG_ETAG_MAXLEN];
55 struct stat s; 57 struct stat s;
56 } PgFile; 58 } PgFile;
57 59
58 typedef struct PgDir { 60 typedef struct PgDir {
59 VFSFile *file; 61 VFSFile *file;
60 PGresult *result; 62 PGresult *result;
61 int row; 63 int row;
62 int nrows; 64 int nrows;
63 } PgDir; 65 } PgDir;
64 66
65 VFS* pg_vfs_create(Session *sn, Request *rq, pblock *pb); 67 VFS* pg_vfs_create(Session *sn, Request *rq, pblock *pb);
66 68
67 VFS* pg_vfs_create_from_resourcedata(Session *sn, Request *rq, ResourceData *resdata); 69 VFS* pg_vfs_create_from_resourcedata(Session *sn, Request *rq, ResourceData *resdata);
81 int64_t *resource_id, 83 int64_t *resource_id,
82 Oid *oid, 84 Oid *oid,
83 const char **resource_name, 85 const char **resource_name,
84 WSBool *iscollection, 86 WSBool *iscollection,
85 struct stat *s, 87 struct stat *s,
88 char *etag,
86 int *res_errno); 89 int *res_errno);
87 90
88 void pg_set_stat( 91 void pg_set_stat(
89 struct stat *s, 92 struct stat *s,
90 const char *iscollection, 93 const char *iscollection,

mercurial