#ifndef WEBDAV_H
#define WEBDAV_H
#include "../public/webdav.h"
#include <cx/map.h>
#include <cx/list.h>
#include <cx/buffer.h>
#include <cx/string.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct WebdavType {
webdav_init_func init;
webdav_create_func create;
} WebdavType;
typedef struct DefaultWebdavData {
WebdavVFSProperties vfsproperties;
} DefaultWebdavData;
typedef struct WebdavPropfindRequestList WebdavPropfindRequestList;
struct WebdavPropfindRequestList {
WebdavPropfindRequest *propfind;
WebdavPropfindRequestList *next;
};
WebdavType* webdav_get_type(cxstring dav_class);
void* webdav_init_backend(ServerConfiguration *cfg,
pool_handle_t *pool, WebdavType *dav_class, WSConfigNode *config,
int *error);
int webdav_init(pblock *pb, Session *sn, Request *rq);
int webdav_service(pblock *pb, Session *sn, Request *rq);
int rqbody2buffer(Session *sn, Request *rq, CxBuffer *buf);
int webdav_options(pblock *pb, Session *sn, Request *rq);
int webdav_propfind(pblock *pb, Session *sn, Request *rq);
int webdav_propfind_init(
WebdavBackend *dav,
WebdavPropfindRequest *propfind,
const char *path,
const char *uri,
WebdavPropfindRequestList **out_req);
int webdav_propfind_do(
WebdavBackend *dav,
WebdavPropfindRequest *propfind,
WebdavResponse *response,
VFSContext *vfs,
char *path,
char *uri);
int webdav_proppatch(pblock *pb, Session *sn, Request *rq);
int webdav_mkcol(pblock *pb, Session *sn, Request *rq);
int webdav_post(pblock *pb, Session *sn, Request *rq);
int webdav_delete(pblock *pb, Session *sn, Request *rq);
int webdav_put(pblock *pb, Session *sn, Request *rq);
int webdav_copy(pblock *pb, Session *sn, Request *rq);
int webdav_move(pblock *pb, Session *sn, Request *rq);
int webdav_lock(pblock *pb, Session *sn, Request *rq);
int webdav_unlock(pblock *pb, Session *sn, Request *rq);
int webdav_report(pblock *pb, Session *sn, Request *rq);
int webdav_acl(pblock *pb, Session *sn, Request *rq);
int webdav_search (pblock *pb, Session *sn, Request *rq);
int default_propfind_init(
WebdavPropfindRequest *rq,
const char *path,
const char *href,
WebdavPList **outplist);
int default_propfind_do(
WebdavPropfindRequest *request,
WebdavResponse *response,
VFS_DIR parent,
WebdavResource *resource,
struct stat *s);
int default_propfind_finish(WebdavPropfindRequest *rq);
int default_proppatch_do(
WebdavProppatchRequest *request,
WebdavResource *response,
VFSFile *file,
WebdavPList **setInOut,
WebdavPList **removeInOut);
int default_proppatch_finish(
WebdavProppatchRequest *request,
WebdavResource *response,
VFSFile *file,
WSBool commit);
CxHashKey webdav_property_key(
const char *ns,
const char *name);
CxHashKey webdav_property_key_a(
const CxAllocator *a,
const char *ns,
const char *name);
#ifdef __cplusplus
}
#endif
#endif