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); |