#ifndef WS_WEBDAV_XATTRBACKEND_H
#define WS_WEBDAV_XATTRBACKEND_H
#include "../public/webdav.h"
#include <cx/map.h>
#include <cx/string.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct WebdavXAttrRepository {
char *xattr_name;
} WebdavXAttrRepository;
typedef struct WebdavXAttrBackend {
WebdavXAttrRepository *repo;
} WebdavXAttrBackend;
typedef struct XAttrPropfind {
const char *base_href;
const char *base_path;
} XAttrPropfind;
typedef struct XAttrProppatch {
CxMap *properties;
} XAttrProppatch;
int webdav_init_xattr_backend(
void);
void* webdav_xattr_init(ServerConfiguration *cfg,
pool_handle_t *pool, WSConfigNode *config);
WebdavBackend* webdav_xattr_create(Session *sn, Request *rq, pblock *pb,
void *initData);
int webdav_xattr_propfind_init(
WebdavPropfindRequest *rq,
const char *path,
const char *href,
WebdavPList **outplist);
int webdav_xattr_propfind_do(
WebdavPropfindRequest *request,
WebdavResponse *response,
VFS_DIR parent,
WebdavResource *resource,
struct stat *s);
int webdav_xattr_propfind_finish(WebdavPropfindRequest *rq);
int webdav_xattr_proppatch_do(
WebdavProppatchRequest *request,
WebdavResource *response,
VFSFile *file,
WebdavPList **setInOut,
WebdavPList **removeInOut);
int webdav_xattr_proppatch_finish(
WebdavProppatchRequest *request,
WebdavResource *response,
VFSFile *file,
WSBool commit);
int webdav_xattr_propfind_get_requested_properties(
WebdavPropfindRequest *request,
WebdavResource *resource,
CxAllocator *a,
CxMap *pmap);
int webdav_xattr_propfind_allprop(
WebdavPropfindRequest *request,
WebdavResource *resource,
CxAllocator *a,
CxMap *pmap);
int webdav_xattr_put_prop(CxMap *pmap, WebdavProperty *prop);
CxMap* webdav_xattr_parse_data(CxAllocator *a,
const char *data,
size_t len,
const char *path);
cxmutstr webdav_xattr_serialze_map(CxAllocator *a, CxMap *pmap);
#ifdef __cplusplus
}
#endif
#endif