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 <libpq-fe.h> |
|
36 |
35 #ifdef __cplusplus |
37 #ifdef __cplusplus |
36 extern "C" { |
38 extern "C" { |
37 #endif |
39 #endif |
38 |
40 |
|
41 typedef struct PgVFS { |
|
42 ResourceData *pg_resource; |
|
43 PGconn *connection; |
|
44 } PgVFS; |
|
45 |
|
46 VFS* pg_vfs_create(Session *sn, Request *rq, pblock *pb); |
39 |
47 |
40 SYS_FILE pg_vfs_open(VFSContext *ctx, const char *path, int oflags); |
48 SYS_FILE pg_vfs_open(VFSContext *ctx, const char *path, int oflags); |
41 int pg_vfs_stat(VFSContext *ctx, const char *path, struct stat *buf); |
49 int pg_vfs_stat(VFSContext *ctx, const char *path, struct stat *buf); |
42 int pg_vfs_fstat(VFSContext *ctx, SYS_FILE fd, struct stat *buf); |
50 int pg_vfs_fstat(VFSContext *ctx, SYS_FILE fd, struct stat *buf); |
43 VFS_DIR pg_vfs_opendir(VFSContext *ctx, const char *path); |
51 VFS_DIR pg_vfs_opendir(VFSContext *ctx, const char *path); |