#include "init.h"
#include "resource.h"
#include "vfs.h"
#include "webdav.h"
int pg_init(pblock *pb, Session *sn, Request *rq) {
if(resourcepool_register_type(
"postgresql", pg_get_resource_type())) {
log_ereport(
LOG_FAILURE,
"pg-init: Cannot register resourcepool type");
return REQ_ABORTED;
}
if(pg_register_vfs(pb)) {
log_ereport(
LOG_FAILURE,
"pg-init: Cannot register vfs type");
return REQ_ABORTED;
}
if(pg_register_webdav_backend(pb)) {
log_ereport(
LOG_FAILURE,
"pg-init: Cannot register dav type");
return REQ_ABORTED;
}
return REQ_PROCEED;
}
int pg_register_vfs(pblock *pb) {
return vfs_register_type(
"postgresql", pg_vfs_init, pg_vfs_create);
}
int pg_register_webdav_backend(pblock *pb) {
if(webdav_register_backend(
"postgresql", pg_webdav_init, pg_webdav_create)) {
return 1;
}
return 0;
}