1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 #include "init.h"
30
31 #include "resource.h"
32 #include "vfs.h"
33 #include "webdav.h"
34
35 int pg_init(pblock *pb, Session *sn, Request *rq) {
36 if(resourcepool_register_type(
"postgresql", pg_get_resource_type())) {
37 log_ereport(
LOG_FAILURE,
"pg-init: Cannot register resourcepool type");
38 return REQ_ABORTED;
39 }
40
41 if(pg_register_vfs(pb)) {
42 log_ereport(
LOG_FAILURE,
"pg-init: Cannot register vfs type");
43 return REQ_ABORTED;
44 }
45
46 if(pg_register_webdav_backend(pb)) {
47 log_ereport(
LOG_FAILURE,
"pg-init: Cannot register dav type");
48 return REQ_ABORTED;
49 }
50
51 return REQ_PROCEED;
52 }
53
54 int pg_register_vfs(pblock *pb) {
55 return vfs_register_type(
"postgresql", pg_vfs_init, pg_vfs_create);
56 }
57
58 int pg_register_webdav_backend(pblock *pb) {
59 if(webdav_register_backend(
"postgresql", pg_webdav_init, pg_webdav_create)) {
60 return 1;
61 }
62 return 0;
63 }
64
65