* Note: this is a teeny bit of overkill since we know there are no
* '<' or '>' characters, but who cares.
*/
- return ap_xml_quote_string(p, e_uri, 0);
+ return apr_xml_quote_string(p, e_uri, 0);
}
static void dav_send_multistatus(request_rec *r, int status,
for (i = namespaces->nelts; i--; ) {
ap_rprintf(r, " xmlns:ns%d=\"%s\"", i,
- AP_XML_GET_URI_ITEM(namespaces, i));
+ APR_XML_GET_URI_ITEM(namespaces, i));
}
}
ap_rputs(">" DEBUG_CR, r);
for (; first != NULL; first = first->next) {
- ap_text *t;
+ apr_text *t;
if (first->propresult.xmlns == NULL) {
ap_rputs("<D:response>", r);
/* generate DAV:supported-method-set OPTIONS response */
static dav_error *dav_gen_supported_methods(request_rec *r,
- const ap_xml_elem *elem,
+ const apr_xml_elem *elem,
const apr_table_t *methods,
- ap_text_header *body)
+ apr_text_header *body)
{
const apr_array_header_t *arr;
const apr_table_entry_t *elts;
- ap_xml_elem *child;
- ap_xml_attr *attr;
+ apr_xml_elem *child;
+ apr_xml_attr *attr;
char *s;
int i;
- ap_text_append(r->pool, body, "<D:supported-method-set>" DEBUG_CR);
+ apr_text_append(r->pool, body, "<D:supported-method-set>" DEBUG_CR);
if (elem->first_child == NULL) {
/* show all supported methods */
"<D:supported-method D:name=\"%s\"/>"
DEBUG_CR,
elts[i].key);
- ap_text_append(r->pool, body, s);
+ apr_text_append(r->pool, body, s);
}
}
else {
/* check for support of specific methods */
for (child = elem->first_child; child != NULL; child = child->next) {
- if (child->ns == AP_XML_NS_DAV_ID
+ if (child->ns == APR_XML_NS_DAV_ID
&& strcmp(child->name, "supported-method") == 0) {
const char *name = NULL;
/* go through attributes to find method name */
for (attr = child->attr; attr != NULL; attr = attr->next) {
- if (attr->ns == AP_XML_NS_DAV_ID
+ if (attr->ns == APR_XML_NS_DAV_ID
&& strcmp(attr->name, "name") == 0)
name = attr->value;
}
"<D:supported-method D:name=\"%s\"/>"
DEBUG_CR,
name);
- ap_text_append(r->pool, body, s);
+ apr_text_append(r->pool, body, s);
}
}
}
}
- ap_text_append(r->pool, body, "</D:supported-method-set>" DEBUG_CR);
+ apr_text_append(r->pool, body, "</D:supported-method-set>" DEBUG_CR);
return NULL;
}
/* generate DAV:supported-live-property-set OPTIONS response */
static dav_error *dav_gen_supported_live_props(request_rec *r,
const dav_resource *resource,
- const ap_xml_elem *elem,
- ap_text_header *body)
+ const apr_xml_elem *elem,
+ apr_text_header *body)
{
dav_lockdb *lockdb;
dav_propdb *propdb;
- ap_xml_elem *child;
- ap_xml_attr *attr;
+ apr_xml_elem *child;
+ apr_xml_attr *attr;
dav_error *err;
/* open lock database, to report on supported lock properties */
err);
}
- ap_text_append(r->pool, body, "<D:supported-live-property-set>" DEBUG_CR);
+ apr_text_append(r->pool, body, "<D:supported-live-property-set>" DEBUG_CR);
if (elem->first_child == NULL) {
/* show all supported live properties */
else {
/* check for support of specific live property */
for (child = elem->first_child; child != NULL; child = child->next) {
- if (child->ns == AP_XML_NS_DAV_ID
+ if (child->ns == APR_XML_NS_DAV_ID
&& strcmp(child->name, "supported-live-property") == 0) {
const char *name = NULL;
const char *nmspace = NULL;
/* go through attributes to find name and namespace */
for (attr = child->attr; attr != NULL; attr = attr->next) {
- if (attr->ns == AP_XML_NS_DAV_ID) {
+ if (attr->ns == APR_XML_NS_DAV_ID) {
if (strcmp(attr->name, "name") == 0)
name = attr->value;
else if (strcmp(attr->name, "namespace") == 0)
}
}
- ap_text_append(r->pool, body, "</D:supported-live-property-set>" DEBUG_CR);
+ apr_text_append(r->pool, body, "</D:supported-live-property-set>" DEBUG_CR);
dav_close_propdb(propdb);
/* generate DAV:supported-report-set OPTIONS response */
static dav_error *dav_gen_supported_reports(request_rec *r,
const dav_resource *resource,
- const ap_xml_elem *elem,
+ const apr_xml_elem *elem,
const dav_hooks_vsn *vsn_hooks,
- ap_text_header *body)
+ apr_text_header *body)
{
- ap_xml_elem *child;
- ap_xml_attr *attr;
+ apr_xml_elem *child;
+ apr_xml_attr *attr;
dav_error *err;
char *s;
- ap_text_append(r->pool, body, "<D:supported-report-set>" DEBUG_CR);
+ apr_text_append(r->pool, body, "<D:supported-report-set>" DEBUG_CR);
if (vsn_hooks != NULL) {
const dav_report_elem *reports;
"<D:supported-report D:name=\"%s\" "
"D:namespace=\"%s\"/>" DEBUG_CR,
rp->name, rp->nmspace);
- ap_text_append(r->pool, body, s);
+ apr_text_append(r->pool, body, s);
}
}
else {
/* check for support of specific report */
for (child = elem->first_child; child != NULL; child = child->next) {
- if (child->ns == AP_XML_NS_DAV_ID
+ if (child->ns == APR_XML_NS_DAV_ID
&& strcmp(child->name, "supported-report") == 0) {
const char *name = NULL;
const char *nmspace = NULL;
/* go through attributes to find name and namespace */
for (attr = child->attr; attr != NULL; attr = attr->next) {
- if (attr->ns == AP_XML_NS_DAV_ID) {
+ if (attr->ns == APR_XML_NS_DAV_ID) {
if (strcmp(attr->name, "name") == 0)
name = attr->value;
else if (strcmp(attr->name, "namespace") == 0)
"D:namespace=\"%s\"/>"
DEBUG_CR,
rp->name, rp->nmspace);
- ap_text_append(r->pool, body, s);
+ apr_text_append(r->pool, body, s);
break;
}
}
}
}
- ap_text_append(r->pool, body, "</D:supported-report-set>" DEBUG_CR);
+ apr_text_append(r->pool, body, "</D:supported-report-set>" DEBUG_CR);
return NULL;
}
const apr_array_header_t *arr;
const apr_table_entry_t *elts;
apr_table_t *methods = apr_table_make(r->pool, 12);
- ap_text_header vsn_options = { 0 };
- ap_text_header body = { 0 };
- ap_text *t;
+ apr_text_header vsn_options = { 0 };
+ apr_text_header body = { 0 };
+ apr_text *t;
int text_size;
int result;
int i;
apr_array_header_t *uri_ary;
- ap_xml_doc *doc;
- const ap_xml_elem *elem;
+ apr_xml_doc *doc;
+ const apr_xml_elem *elem;
dav_error *err;
/* resolve the resource */
int core_option = 0;
dav_error *err = NULL;
- if (elem->ns == AP_XML_NS_DAV_ID) {
+ if (elem->ns == APR_XML_NS_DAV_ID) {
if (strcmp(elem->name, "supported-method-set") == 0) {
err = dav_gen_supported_methods(r, elem, methods, &body);
core_option = 1;
static void dav_cache_badprops(dav_walker_ctx *ctx)
{
- const ap_xml_elem *elem;
- ap_text_header hdr = { 0 };
+ const apr_xml_elem *elem;
+ apr_text_header hdr = { 0 };
/* just return if we built the thing already */
if (ctx->propstat_404 != NULL) {
return;
}
- ap_text_append(ctx->w.pool, &hdr,
- "<D:propstat>" DEBUG_CR
- "<D:prop>" DEBUG_CR);
+ apr_text_append(ctx->w.pool, &hdr,
+ "<D:propstat>" DEBUG_CR
+ "<D:prop>" DEBUG_CR);
elem = dav_find_child(ctx->doc->root, "prop");
for (elem = elem->first_child; elem; elem = elem->next) {
- ap_text_append(ctx->w.pool, &hdr,
- ap_xml_empty_elem(ctx->w.pool, elem));
+ apr_text_append(ctx->w.pool, &hdr,
+ apr_xml_empty_elem(ctx->w.pool, elem));
}
- ap_text_append(ctx->w.pool, &hdr,
- "</D:prop>" DEBUG_CR
- "<D:status>HTTP/1.1 404 Not Found</D:status>" DEBUG_CR
- "</D:propstat>" DEBUG_CR);
+ apr_text_append(ctx->w.pool, &hdr,
+ "</D:prop>" DEBUG_CR
+ "<D:status>HTTP/1.1 404 Not Found</D:status>" DEBUG_CR
+ "</D:propstat>" DEBUG_CR);
ctx->propstat_404 = hdr.first;
}
int depth;
dav_error *err;
int result;
- ap_xml_doc *doc;
- const ap_xml_elem *child;
+ apr_xml_doc *doc;
+ const apr_xml_elem *child;
dav_walker_ctx ctx = { { 0 } };
dav_response *multi_status;
return DONE;
}
-static ap_text * dav_failed_proppatch(apr_pool_t *p,
+static apr_text * dav_failed_proppatch(apr_pool_t *p,
apr_array_header_t *prop_ctx)
{
- ap_text_header hdr = { 0 };
+ apr_text_header hdr = { 0 };
int i = prop_ctx->nelts;
dav_prop_ctx *ctx = (dav_prop_ctx *)prop_ctx->elts;
dav_error *err424_set = NULL;
/* ### might be nice to sort by status code and description */
for ( ; i-- > 0; ++ctx ) {
- ap_text_append(p, &hdr,
- "<D:propstat>" DEBUG_CR
- "<D:prop>");
- ap_text_append(p, &hdr, ap_xml_empty_elem(p, ctx->prop));
- ap_text_append(p, &hdr, "</D:prop>" DEBUG_CR);
+ apr_text_append(p, &hdr,
+ "<D:propstat>" DEBUG_CR
+ "<D:prop>");
+ apr_text_append(p, &hdr, apr_xml_empty_elem(p, ctx->prop));
+ apr_text_append(p, &hdr, "</D:prop>" DEBUG_CR);
if (ctx->err == NULL) {
/* nothing was assigned here yet, so make it a 424 */
"HTTP/1.1 %d (status)"
"</D:status>" DEBUG_CR,
ctx->err->status);
- ap_text_append(p, &hdr, s);
+ apr_text_append(p, &hdr, s);
/* ### we should use compute_desc if necessary... */
if (ctx->err->desc != NULL) {
- ap_text_append(p, &hdr, "<D:responsedescription>" DEBUG_CR);
- ap_text_append(p, &hdr, ctx->err->desc);
- ap_text_append(p, &hdr, "</D:responsedescription>" DEBUG_CR);
+ apr_text_append(p, &hdr, "<D:responsedescription>" DEBUG_CR);
+ apr_text_append(p, &hdr, ctx->err->desc);
+ apr_text_append(p, &hdr, "</D:responsedescription>" DEBUG_CR);
}
- ap_text_append(p, &hdr, "</D:propstat>" DEBUG_CR);
+ apr_text_append(p, &hdr, "</D:propstat>" DEBUG_CR);
}
return hdr.first;
}
-static ap_text * dav_success_proppatch(apr_pool_t *p, apr_array_header_t *prop_ctx)
+static apr_text * dav_success_proppatch(apr_pool_t *p, apr_array_header_t *prop_ctx)
{
- ap_text_header hdr = { 0 };
+ apr_text_header hdr = { 0 };
int i = prop_ctx->nelts;
dav_prop_ctx *ctx = (dav_prop_ctx *)prop_ctx->elts;
* ### this code assumes everything will return status==200.
*/
- ap_text_append(p, &hdr,
- "<D:propstat>" DEBUG_CR
- "<D:prop>" DEBUG_CR);
+ apr_text_append(p, &hdr,
+ "<D:propstat>" DEBUG_CR
+ "<D:prop>" DEBUG_CR);
for ( ; i-- > 0; ++ctx ) {
- ap_text_append(p, &hdr, ap_xml_empty_elem(p, ctx->prop));
+ apr_text_append(p, &hdr, apr_xml_empty_elem(p, ctx->prop));
}
- ap_text_append(p, &hdr,
+ apr_text_append(p, &hdr,
"</D:prop>" DEBUG_CR
"<D:status>HTTP/1.1 200 OK</D:status>" DEBUG_CR
"</D:propstat>" DEBUG_CR);
dav_error *err;
dav_resource *resource;
int result;
- ap_xml_doc *doc;
- ap_xml_elem *child;
+ apr_xml_doc *doc;
+ apr_xml_elem *child;
dav_propdb *propdb;
int failure = 0;
dav_response resp = { 0 };
- ap_text *propstat_text;
+ apr_text *propstat_text;
apr_array_header_t *ctx_list;
dav_prop_ctx *ctx;
dav_auto_version_info av_info;
/* do a first pass to ensure that all "remove" properties exist */
for (child = doc->root->first_child; child; child = child->next) {
int is_remove;
- ap_xml_elem *prop_group;
- ap_xml_elem *one_prop;
+ apr_xml_elem *prop_group;
+ apr_xml_elem *one_prop;
/* Ignore children that are not set/remove */
- if (child->ns != AP_XML_NS_DAV_ID
+ if (child->ns != APR_XML_NS_DAV_ID
|| (!(is_remove = strcmp(child->name, "remove") == 0)
&& strcmp(child->name, "set") != 0)) {
continue;
int result;
int depth;
int new_lock_request = 0;
- ap_xml_doc *doc;
+ apr_xml_doc *doc;
dav_lock *lock;
dav_response *multi_response = NULL;
dav_lockdb *lockdb;
const dav_hooks_locks *locks_hooks = DAV_GET_HOOKS_LOCKS(r);
const dav_hooks_vsn *vsn_hooks = DAV_GET_HOOKS_VSN(r);
dav_error *err;
- ap_xml_doc *doc;
+ apr_xml_doc *doc;
const char *target = NULL;
int result;
/* note: doc == NULL if no request body */
if (doc != NULL) {
- const ap_xml_elem *child;
+ const apr_xml_elem *child;
apr_size_t tsize;
if (!dav_validate_root(doc, "version-control")) {
}
/* get version URI */
- ap_xml_to_text(r->pool, child, AP_XML_X2T_INNER, NULL, NULL,
- &target, &tsize);
+ apr_xml_to_text(r->pool, child, APR_XML_X2T_INNER, NULL, NULL,
+ &target, &tsize);
if (tsize == 0) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
"An \"href\" element does not contain a URI.");
const dav_hooks_vsn *vsn_hooks = DAV_GET_HOOKS_VSN(r);
dav_error *err;
int result;
- ap_xml_doc *doc;
+ apr_xml_doc *doc;
int apply_to_vsn = 0;
int is_unreserved = 0;
int is_fork_ok = 0;
return result;
if (doc != NULL) {
- const ap_xml_elem *aset;
+ const apr_xml_elem *aset;
if (!dav_validate_root(doc, "checkout")) {
/* This supplies additional information for the default msg. */
create_activity = 1;
}
else {
- const ap_xml_elem *child = aset->first_child;
+ const apr_xml_elem *child = aset->first_child;
activities = apr_array_make(r->pool, 1, sizeof(const char *));
for (; child != NULL; child = child->next) {
- if (child->ns == AP_XML_NS_DAV_ID
+ if (child->ns == APR_XML_NS_DAV_ID
&& strcmp(child->name, "href") == 0) {
const char *href;
const dav_hooks_vsn *vsn_hooks = DAV_GET_HOOKS_VSN(r);
dav_error *err;
int result;
- ap_xml_doc *doc;
+ apr_xml_doc *doc;
int keep_checked_out = 0;
/* If no versioning provider, decline the request */
dav_resource *resource;
dav_resource *version = NULL;
const dav_hooks_vsn *vsn_hooks = DAV_GET_HOOKS_VSN(r);
- ap_xml_doc *doc;
- ap_xml_elem *child;
+ apr_xml_doc *doc;
+ apr_xml_elem *child;
int is_label = 0;
int depth;
int result;
}
/* get the target value (a label or a version URI) */
- ap_xml_to_text(r->pool, child, AP_XML_X2T_INNER, NULL, NULL,
- &target, &tsize);
+ apr_xml_to_text(r->pool, child, APR_XML_X2T_INNER, NULL, NULL,
+ &target, &tsize);
if (tsize == 0) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
"A \"label-name\" or \"href\" element does not contain "
{
dav_resource *resource;
const dav_hooks_vsn *vsn_hooks = DAV_GET_HOOKS_VSN(r);
- ap_xml_doc *doc;
- ap_xml_elem *child;
+ apr_xml_doc *doc;
+ apr_xml_elem *child;
int depth;
int result;
apr_size_t tsize;
return HTTP_BAD_REQUEST;
}
- ap_xml_to_text(r->pool, child, AP_XML_X2T_INNER, NULL, NULL,
- &ctx.label, &tsize);
+ apr_xml_to_text(r->pool, child, APR_XML_X2T_INNER, NULL, NULL,
+ &ctx.label, &tsize);
if (tsize == 0) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
"A \"label-name\" element does not contain "
const dav_hooks_vsn *vsn_hooks = DAV_GET_HOOKS_VSN(r);
int result;
int label_allowed;
- ap_xml_doc *doc;
+ apr_xml_doc *doc;
dav_error *err;
/* If no versioning provider, decline the request */
dav_resource *resource;
const dav_hooks_vsn *vsn_hooks = DAV_GET_HOOKS_VSN(r);
dav_error *err;
- ap_xml_doc *doc;
+ apr_xml_doc *doc;
int result;
/* if no versioning provider, or the provider does not support workspaces,
const dav_hooks_vsn *vsn_hooks = DAV_GET_HOOKS_VSN(r);
dav_error *err;
int result;
- ap_xml_doc *doc;
- ap_xml_elem *source_elem;
- ap_xml_elem *href_elem;
- ap_xml_elem *prop_elem;
+ apr_xml_doc *doc;
+ apr_xml_elem *source_elem;
+ apr_xml_elem *href_elem;
+ apr_xml_elem *prop_elem;
const char *source;
int no_auto_merge;
int no_checkout;
APR_IMPLEMENT_EXTERNAL_HOOK_VOID(dav, DAV, insert_all_liveprops,
(request_rec *r, const dav_resource *resource,
- dav_prop_insert what, ap_text_header *phdr),
+ dav_prop_insert what, apr_text_header *phdr),
(r, resource, what, phdr))
/* contains results from one of the getprop functions */
typedef struct
{
- ap_text * propstats; /* <propstat> element text */
- ap_text * xmlns; /* namespace decls for <response> elem */
+ apr_text * propstats; /* <propstat> element text */
+ apr_text * xmlns; /* namespace decls for <response> elem */
} dav_get_props_result;
/* holds the contents of a <response> element */
int dav_get_depth(request_rec *r, int def_depth);
-int dav_validate_root(const ap_xml_doc *doc, const char *tagname);
-ap_xml_elem *dav_find_child(const ap_xml_elem *elem, const char *tagname);
+int dav_validate_root(const apr_xml_doc *doc, const char *tagname);
+apr_xml_elem *dav_find_child(const apr_xml_elem *elem, const char *tagname);
/* gather up all the CDATA into a single string */
-DAV_DECLARE(const char *) dav_xml_get_cdata(const ap_xml_elem *elem, apr_pool_t *pool,
+DAV_DECLARE(const char *) dav_xml_get_cdata(const apr_xml_elem *elem, apr_pool_t *pool,
int strip_white);
/*
*/
APR_DECLARE_EXTERNAL_HOOK(dav, DAV, void, insert_all_liveprops,
(request_rec *r, const dav_resource *resource,
- dav_prop_insert what, ap_text_header *phdr))
+ dav_prop_insert what, apr_text_header *phdr))
const dav_hooks_locks *dav_get_lock_hooks(request_rec *r);
const dav_hooks_propdb *dav_get_propdb_hooks(request_rec *r);
*/
dav_prop_insert (*insert_prop)(const dav_resource *resource,
int propid, dav_prop_insert what,
- ap_text_header *phdr);
+ apr_text_header *phdr);
/*
** Determine whether a given property is writable.
** database. Note: it will be set to zero on entry.
*/
dav_error * (*patch_validate)(const dav_resource *resource,
- const ap_xml_elem *elem,
+ const apr_xml_elem *elem,
int operation,
void **context,
int *defer_to_dead);
/* ### doc... */
dav_error * (*patch_exec)(const dav_resource *resource,
- const ap_xml_elem *elem,
+ const apr_xml_elem *elem,
int operation,
void *context,
dav_liveprop_rollback **rollback_ctx);
int dav_get_liveprop_ns_count(void);
/* ### docco */
-void dav_add_all_liveprop_xmlns(apr_pool_t *p, ap_text_header *phdr);
+void dav_add_all_liveprop_xmlns(apr_pool_t *p, apr_text_header *phdr);
/*
** The following three functions are part of mod_dav's internal handling
const dav_hooks_liveprop **hooks);
void dav_core_insert_all_liveprops(request_rec *r,
const dav_resource *resource,
- dav_prop_insert what, ap_text_header *phdr);
+ dav_prop_insert what, apr_text_header *phdr);
void dav_core_register_uris(apr_pool_t *p);
dav_error * dav_lock_parse_lockinfo(request_rec *r,
const dav_resource *resrouce,
dav_lockdb *lockdb,
- const ap_xml_doc *doc,
+ const apr_xml_doc *doc,
dav_lock **lock_request);
int dav_unlock(request_rec *r, const dav_resource *resource,
const dav_locktoken *locktoken);
dav_get_props_result dav_get_props(
dav_propdb *db,
- ap_xml_doc *doc);
+ apr_xml_doc *doc);
dav_get_props_result dav_get_allprops(
dav_propdb *db,
dav_propdb *propdb,
const char *ns_uri,
const char *propname,
- ap_text_header *body);
+ apr_text_header *body);
/*
** 3-phase property modification.
#define DAV_PROP_OP_DELETE 2 /* delete a prop value */
/* ### add a GET? */
- ap_xml_elem *prop; /* property to affect */
+ apr_xml_elem *prop; /* property to affect */
dav_error *err; /* error (if any) */
request_rec *r; /* original request */
/* for PROPFIND operations */
- ap_xml_doc *doc;
+ apr_xml_doc *doc;
int propfind_type;
#define DAV_PROPFIND_IS_ALLPROP 1
#define DAV_PROPFIND_IS_PROPNAME 2
#define DAV_PROPFIND_IS_PROP 3
- ap_text *propstat_404; /* (cached) propstat giving a 404 error */
+ apr_text *propstat_404; /* (cached) propstat giving a 404 error */
const dav_if_header *if_header; /* for validation */
const dav_locktoken *locktoken; /* for UNLOCK */
* individual text item to 63 characters, to conform to the limit
* used by MS Web Folders.
*/
- void (*get_vsn_options)(apr_pool_t *p, ap_text_header *phdr);
+ void (*get_vsn_options)(apr_pool_t *p, apr_text_header *phdr);
/* Get the value of a specific option for an OPTIONS request.
* The option being requested is given by the parsed XML
* appended to the "option" text object.
*/
dav_error * (*get_option)(const dav_resource *resource,
- const ap_xml_elem *elem,
- ap_text_header *option);
+ const apr_xml_elem *elem,
+ apr_text_header *option);
/* Determine whether a non-versioned (or non-existent) resource
* is versionable. Returns != 0 if resource can be versioned.
** contains the parsed report request body.
** Returns 0 if the Label header is not allowed.
*/
- int (*report_label_header_allowed)(const ap_xml_doc *doc);
+ int (*report_label_header_allowed)(const apr_xml_doc *doc);
/*
** Generate a report on a resource. Since a provider is free
*/
dav_error * (*deliver_report)(request_rec *r,
const dav_resource *resource,
- const ap_xml_doc *doc,
+ const apr_xml_doc *doc,
ap_filter_t *output);
/*
** it should be set to NULL.
*/
dav_error * (*make_workspace)(dav_resource *resource,
- ap_xml_doc *doc);
+ apr_xml_doc *doc);
/*
** Determine whether a null resource can be created as an activity.
*/
dav_error * (*merge)(dav_resource *target, dav_resource *source,
int no_auto_merge, int no_checkout,
- ap_xml_elem *prop_elem,
+ apr_xml_elem *prop_elem,
ap_filter_t *output);
};
#define DAV_EMPTY_VALUE "\0" /* TWO null terms */
-/* the namespace URI was not found; no ID is available */
-#define AP_XML_NS_ERROR_NOT_FOUND (AP_XML_NS_ERROR_BASE)
-
struct dav_propdb {
apr_pool_t *p; /* the pool we should use */
request_rec *r; /* the request record */
return DAV_PROPID_CORE_UNKNOWN;
}
-static void dav_find_liveprop(dav_propdb *propdb, ap_xml_elem *elem)
+static void dav_find_liveprop(dav_propdb *propdb, apr_xml_elem *elem)
{
const char *ns_uri;
dav_elem_private *priv = elem->priv;
const dav_hooks_liveprop *hooks;
- if (elem->ns == AP_XML_NS_NONE)
+ if (elem->ns == APR_XML_NS_NONE)
ns_uri = NULL;
- else if (elem->ns == AP_XML_NS_DAV_ID)
+ else if (elem->ns == APR_XML_NS_DAV_ID)
ns_uri = "DAV:";
else
- ns_uri = AP_XML_GET_URI_ITEM(propdb->ns_xlate, elem->ns);
+ ns_uri = APR_XML_GET_URI_ITEM(propdb->ns_xlate, elem->ns);
priv->propid = dav_find_liveprop_provider(propdb, ns_uri, elem->name,
&hooks);
static dav_error * dav_insert_coreprop(dav_propdb *propdb,
int propid, const char *name,
dav_prop_insert what,
- ap_text_header *phdr,
+ apr_text_header *phdr,
dav_prop_insert *inserted)
{
const char *value = NULL;
/* use D: prefix to refer to the DAV: namespace URI */
s = apr_psprintf(propdb->p, "<D:%s/>" DEBUG_CR, name);
}
- ap_text_append(propdb->p, phdr, s);
+ apr_text_append(propdb->p, phdr, s);
*inserted = what;
}
}
static dav_error * dav_insert_liveprop(dav_propdb *propdb,
- const ap_xml_elem *elem,
+ const apr_xml_elem *elem,
dav_prop_insert what,
- ap_text_header *phdr,
+ apr_text_header *phdr,
dav_prop_insert *inserted)
{
dav_elem_private *priv = elem->priv;
}
static void dav_insert_xmlns(apr_pool_t *p, const char *pre_prefix, int ns,
- const char *ns_uri, ap_text_header *phdr)
+ const char *ns_uri, apr_text_header *phdr)
{
const char *s;
s = apr_psprintf(p, " xmlns:%s%d=\"%s\"", pre_prefix, ns, ns_uri);
- ap_text_append(p, phdr, s);
+ apr_text_append(p, phdr, s);
}
static dav_error *dav_really_open_db(dav_propdb *propdb, int ro)
dav_get_props_result dav_get_allprops(dav_propdb *propdb, dav_prop_insert what)
{
const dav_hooks_db *db_hooks = propdb->db_hooks;
- ap_text_header hdr = { 0 };
- ap_text_header hdr_ns = { 0 };
+ apr_text_header hdr = { 0 };
+ apr_text_header hdr_ns = { 0 };
dav_get_props_result result = { 0 };
int found_contenttype = 0;
int found_contentlang = 0;
}
/* initialize the result with some start tags... */
- ap_text_append(propdb->p, &hdr,
- "<D:propstat>" DEBUG_CR
- "<D:prop>" DEBUG_CR);
+ apr_text_append(propdb->p, &hdr,
+ "<D:propstat>" DEBUG_CR
+ "<D:prop>" DEBUG_CR);
/* if there ARE properties, then scan them */
if (propdb->db != NULL) {
/* if not just reporting on supported live props,
* terminate the result */
if (what != DAV_PROP_INSERT_SUPPORTED) {
- ap_text_append(propdb->p, &hdr,
- "</D:prop>" DEBUG_CR
- "<D:status>HTTP/1.1 200 OK</D:status>" DEBUG_CR
- "</D:propstat>" DEBUG_CR);
+ apr_text_append(propdb->p, &hdr,
+ "</D:prop>" DEBUG_CR
+ "<D:status>HTTP/1.1 200 OK</D:status>" DEBUG_CR
+ "</D:propstat>" DEBUG_CR);
}
result.propstats = hdr.first;
return result;
}
-dav_get_props_result dav_get_props(dav_propdb *propdb, ap_xml_doc *doc)
+dav_get_props_result dav_get_props(dav_propdb *propdb, apr_xml_doc *doc)
{
const dav_hooks_db *db_hooks = propdb->db_hooks;
- ap_xml_elem *elem = dav_find_child(doc->root, "prop");
- ap_text_header hdr_good = { 0 };
- ap_text_header hdr_bad = { 0 };
- ap_text_header hdr_ns = { 0 };
+ apr_xml_elem *elem = dav_find_child(doc->root, "prop");
+ apr_text_header hdr_good = { 0 };
+ apr_text_header hdr_bad = { 0 };
+ apr_text_header hdr_ns = { 0 };
int have_good = 0;
dav_get_props_result result = { 0 };
char *marks_liveprop;
the marks */
/* we will ALWAYS provide a "good" result, even if it is EMPTY */
- ap_text_append(propdb->p, &hdr_good,
+ apr_text_append(propdb->p, &hdr_good,
"<D:propstat>" DEBUG_CR
"<D:prop>" DEBUG_CR);
/* make sure we've started our "bad" propstat */
if (hdr_bad.first == NULL) {
- ap_text_append(propdb->p, &hdr_bad,
- "<D:propstat>" DEBUG_CR
- "<D:prop>" DEBUG_CR);
+ apr_text_append(propdb->p, &hdr_bad,
+ "<D:propstat>" DEBUG_CR
+ "<D:prop>" DEBUG_CR);
}
/* output this property's name (into the bad propstats) */
dav_output_prop_name(propdb->p, &name, xi, &hdr_bad);
}
- ap_text_append(propdb->p, &hdr_good,
+ apr_text_append(propdb->p, &hdr_good,
"</D:prop>" DEBUG_CR
"<D:status>HTTP/1.1 200 OK</D:status>" DEBUG_CR
"</D:propstat>" DEBUG_CR);
/* we may not have any "bad" results */
if (hdr_bad.first != NULL) {
/* "close" the bad propstat */
- ap_text_append(propdb->p, &hdr_bad,
- "</D:prop>" DEBUG_CR
- "<D:status>HTTP/1.1 404 Not Found</D:status>" DEBUG_CR
- "</D:propstat>" DEBUG_CR);
+ apr_text_append(propdb->p, &hdr_bad,
+ "</D:prop>" DEBUG_CR
+ "<D:status>HTTP/1.1 404 Not Found</D:status>" DEBUG_CR
+ "</D:propstat>" DEBUG_CR);
/* if there are no good props, then just return the bad */
if (!have_good) {
void dav_get_liveprop_supported(dav_propdb *propdb,
const char *ns_uri,
const char *propname,
- ap_text_header *body)
+ apr_text_header *body)
{
int propid;
const dav_hooks_liveprop *hooks;
void dav_prop_validate(dav_prop_ctx *ctx)
{
dav_propdb *propdb = ctx->propdb;
- ap_xml_elem *prop = ctx->prop;
+ apr_xml_elem *prop = ctx->prop;
dav_elem_private *priv;
priv = ctx->prop->priv = apr_pcalloc(propdb->p, sizeof(*priv));