#ifndef MULTISTATUS_H
#define MULTISTATUS_H
#include "../public/webdav.h"
#include <cx/map.h>
#include <cx/buffer.h>
#include <libxml/tree.h>
#include "../util/writer.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct Multistatus Multistatus;
typedef struct MSResponse MSResponse;
typedef struct PropertyOkList PropertyOkList;
typedef struct PropertyErrorList PropertyErrorList;
struct Multistatus {
WebdavResponse response;
Session *sn;
Request *rq;
MSResponse *first;
MSResponse *current;
CxMap *namespaces;
WSBool proppatch;
};
struct MSResponse {
WebdavResource resource;
Multistatus *multistatus;
CxMap *properties;
PropertyErrorList *errors;
PropertyOkList *plist_begin;
PropertyOkList *plist_end;
MSResponse *next;
WSBool closing;
};
struct PropertyOkList {
WebdavProperty *property;
WebdavNSList *nsdef;
PropertyOkList *next;
};
struct PropertyErrorList {
PropertyErrorList *next;
WebdavPList *begin;
WebdavPList *end;
int status;
};
Multistatus* multistatus_response(Session *sn, Request *rq);
int multistatus_send(Multistatus *ms,
SYS_NETFD out);
WebdavResource * multistatus_addresource(
WebdavResponse *response,
const char *path);
int msresponse_addproperty(
WebdavResource *res,
WebdavProperty *property,
int status);
int msresponse_close(WebdavResource *res);
#ifdef __cplusplus
}
#endif
#endif