From: William A. Rowe Jr Date: Sun, 23 Jun 2002 06:42:13 +0000 (+0000) Subject: The real pain. ap->apr xml and text types. X-Git-Tag: 2.0.40~398 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f931b8a7c0aef6c6a0e1b038722143b64fe37860;p=apache The real pain. ap->apr xml and text types. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95862 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/dav/main/liveprop.c b/modules/dav/main/liveprop.c index e65f3f636b..3e1a6fa035 100644 --- a/modules/dav/main/liveprop.c +++ b/modules/dav/main/liveprop.c @@ -56,7 +56,7 @@ #include "apr_hash.h" #include "apr_errno.h" #include "apr_strings.h" -#include "util_xml.h" /* for ap_text_header */ +#include "util_xml.h" /* for apr_text_header */ #include "mod_dav.h" @@ -101,7 +101,7 @@ int dav_get_liveprop_ns_count(void) return dav_liveprop_count; } -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) { apr_hash_index_t *idx = apr_hash_first(p, dav_liveprop_uris); @@ -113,7 +113,7 @@ void dav_add_all_liveprop_xmlns(apr_pool_t *p, ap_text_header *phdr) apr_hash_this(idx, &key, NULL, &val); s = apr_psprintf(p, " xmlns:lp%d=\"%s\"", (int)val, (const char *)key); - ap_text_append(p, phdr, s); + apr_text_append(p, phdr, s); } } diff --git a/modules/dav/main/mod_dav.c b/modules/dav/main/mod_dav.c index 2c5cf92b34..81fef1bb4d 100644 --- a/modules/dav/main/mod_dav.c +++ b/modules/dav/main/mod_dav.c @@ -447,7 +447,7 @@ static const char *dav_xml_escape_uri(apr_pool_t *p, const char *uri) * 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, @@ -467,7 +467,7 @@ 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)); } } @@ -475,7 +475,7 @@ static void dav_send_multistatus(request_rec *r, int status, ap_rputs(">" DEBUG_CR, r); for (; first != NULL; first = first->next) { - ap_text *t; + apr_text *t; if (first->propresult.xmlns == NULL) { ap_rputs("", r); @@ -1178,18 +1178,18 @@ static int dav_method_delete(request_rec *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, "" DEBUG_CR); + apr_text_append(r->pool, body, "" DEBUG_CR); if (elem->first_child == NULL) { /* show all supported methods */ @@ -1204,19 +1204,19 @@ static dav_error *dav_gen_supported_methods(request_rec *r, "" 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; } @@ -1233,26 +1233,26 @@ static dav_error *dav_gen_supported_methods(request_rec *r, "" DEBUG_CR, name); - ap_text_append(r->pool, body, s); + apr_text_append(r->pool, body, s); } } } } - ap_text_append(r->pool, body, "" DEBUG_CR); + apr_text_append(r->pool, body, "" 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 */ @@ -1277,7 +1277,7 @@ static dav_error *dav_gen_supported_live_props(request_rec *r, err); } - ap_text_append(r->pool, body, "" DEBUG_CR); + apr_text_append(r->pool, body, "" DEBUG_CR); if (elem->first_child == NULL) { /* show all supported live properties */ @@ -1289,14 +1289,14 @@ static dav_error *dav_gen_supported_live_props(request_rec *r, 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) @@ -1322,7 +1322,7 @@ static dav_error *dav_gen_supported_live_props(request_rec *r, } } - ap_text_append(r->pool, body, "" DEBUG_CR); + apr_text_append(r->pool, body, "" DEBUG_CR); dav_close_propdb(propdb); @@ -1335,16 +1335,16 @@ static dav_error *dav_gen_supported_live_props(request_rec *r, /* 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, "" DEBUG_CR); + apr_text_append(r->pool, body, "" DEBUG_CR); if (vsn_hooks != NULL) { const dav_report_elem *reports; @@ -1368,20 +1368,20 @@ static dav_error *dav_gen_supported_reports(request_rec *r, "" 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) @@ -1411,7 +1411,7 @@ static dav_error *dav_gen_supported_reports(request_rec *r, "D:namespace=\"%s\"/>" DEBUG_CR, rp->name, rp->nmspace); - ap_text_append(r->pool, body, s); + apr_text_append(r->pool, body, s); break; } } @@ -1421,7 +1421,7 @@ static dav_error *dav_gen_supported_reports(request_rec *r, } } - ap_text_append(r->pool, body, "" DEBUG_CR); + apr_text_append(r->pool, body, "" DEBUG_CR); return NULL; } @@ -1495,15 +1495,15 @@ static int dav_method_options(request_rec *r) 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 */ @@ -1737,7 +1737,7 @@ static int dav_method_options(request_rec *r) 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; @@ -1783,28 +1783,28 @@ static int dav_method_options(request_rec *r) 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, - "" DEBUG_CR - "" DEBUG_CR); + apr_text_append(ctx->w.pool, &hdr, + "" DEBUG_CR + "" 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, - "" DEBUG_CR - "HTTP/1.1 404 Not Found" DEBUG_CR - "" DEBUG_CR); + apr_text_append(ctx->w.pool, &hdr, + "" DEBUG_CR + "HTTP/1.1 404 Not Found" DEBUG_CR + "" DEBUG_CR); ctx->propstat_404 = hdr.first; } @@ -1868,8 +1868,8 @@ static int dav_method_propfind(request_rec *r) 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; @@ -1994,10 +1994,10 @@ static int dav_method_propfind(request_rec *r) 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; @@ -2007,11 +2007,11 @@ static ap_text * dav_failed_proppatch(apr_pool_t *p, /* ### might be nice to sort by status code and description */ for ( ; i-- > 0; ++ctx ) { - ap_text_append(p, &hdr, - "" DEBUG_CR - ""); - ap_text_append(p, &hdr, ap_xml_empty_elem(p, ctx->prop)); - ap_text_append(p, &hdr, "" DEBUG_CR); + apr_text_append(p, &hdr, + "" DEBUG_CR + ""); + apr_text_append(p, &hdr, apr_xml_empty_elem(p, ctx->prop)); + apr_text_append(p, &hdr, "" DEBUG_CR); if (ctx->err == NULL) { /* nothing was assigned here yet, so make it a 424 */ @@ -2040,24 +2040,24 @@ static ap_text * dav_failed_proppatch(apr_pool_t *p, "HTTP/1.1 %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, "" DEBUG_CR); - ap_text_append(p, &hdr, ctx->err->desc); - ap_text_append(p, &hdr, "" DEBUG_CR); + apr_text_append(p, &hdr, "" DEBUG_CR); + apr_text_append(p, &hdr, ctx->err->desc); + apr_text_append(p, &hdr, "" DEBUG_CR); } - ap_text_append(p, &hdr, "" DEBUG_CR); + apr_text_append(p, &hdr, "" 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; @@ -2066,15 +2066,15 @@ static ap_text * dav_success_proppatch(apr_pool_t *p, apr_array_header_t *prop_c * ### this code assumes everything will return status==200. */ - ap_text_append(p, &hdr, - "" DEBUG_CR - "" DEBUG_CR); + apr_text_append(p, &hdr, + "" DEBUG_CR + "" 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, "" DEBUG_CR "HTTP/1.1 200 OK" DEBUG_CR "" DEBUG_CR); @@ -2129,12 +2129,12 @@ static int dav_method_proppatch(request_rec *r) 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; @@ -2201,11 +2201,11 @@ static int dav_method_proppatch(request_rec *r) /* 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; @@ -2862,7 +2862,7 @@ static int dav_method_lock(request_rec *r) 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; @@ -3119,7 +3119,7 @@ static int dav_method_vsn_control(request_rec *r) 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; @@ -3143,7 +3143,7 @@ static int dav_method_vsn_control(request_rec *r) /* 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")) { @@ -3169,8 +3169,8 @@ static int dav_method_vsn_control(request_rec *r) } /* 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."); @@ -3305,7 +3305,7 @@ static int dav_method_checkout(request_rec *r) 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; @@ -3320,7 +3320,7 @@ static int dav_method_checkout(request_rec *r) 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. */ @@ -3350,12 +3350,12 @@ static int dav_method_checkout(request_rec *r) 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; @@ -3511,7 +3511,7 @@ static int dav_method_checkin(request_rec *r) 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 */ @@ -3583,8 +3583,8 @@ static int dav_method_update(request_rec *r) 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; @@ -3645,8 +3645,8 @@ static int dav_method_update(request_rec *r) } /* 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 " @@ -3791,8 +3791,8 @@ static int dav_method_label(request_rec *r) { 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; @@ -3859,8 +3859,8 @@ static int dav_method_label(request_rec *r) 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 " @@ -3918,7 +3918,7 @@ static int dav_method_report(request_rec *r) 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 */ @@ -3969,7 +3969,7 @@ static int dav_method_make_workspace(request_rec *r) 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, @@ -4098,10 +4098,10 @@ static int dav_method_merge(request_rec *r) 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; @@ -4712,5 +4712,5 @@ APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(dav, DAV, int, find_liveprop, 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)) diff --git a/modules/dav/main/mod_dav.h b/modules/dav/main/mod_dav.h index e9b895b472..4793c3f6fd 100644 --- a/modules/dav/main/mod_dav.h +++ b/modules/dav/main/mod_dav.h @@ -477,8 +477,8 @@ DAV_DECLARE(void) dav_buffer_place_mem(apr_pool_t *p, dav_buffer *pbuf, /* contains results from one of the getprop functions */ typedef struct { - ap_text * propstats; /* element text */ - ap_text * xmlns; /* namespace decls for elem */ + apr_text * propstats; /* element text */ + apr_text * xmlns; /* namespace decls for elem */ } dav_get_props_result; /* holds the contents of a element */ @@ -532,11 +532,11 @@ typedef enum { 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); /* @@ -661,7 +661,7 @@ APR_DECLARE_EXTERNAL_HOOK(dav, DAV, int, find_liveprop, */ 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); @@ -782,7 +782,7 @@ struct dav_hooks_liveprop */ 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. @@ -835,14 +835,14 @@ struct dav_hooks_liveprop ** 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); @@ -914,7 +914,7 @@ DAV_DECLARE(int) dav_get_liveprop_ns_index(const char *uri); 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 @@ -925,7 +925,7 @@ int dav_core_find_liveprop(const dav_resource *resource, 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); @@ -1248,7 +1248,7 @@ const char *dav_lock_get_activelock(request_rec *r, dav_lock *locks, 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); @@ -1510,7 +1510,7 @@ void dav_close_propdb(dav_propdb *db); 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, @@ -1520,7 +1520,7 @@ void dav_get_liveprop_supported( dav_propdb *propdb, const char *ns_uri, const char *propname, - ap_text_header *body); + apr_text_header *body); /* ** 3-phase property modification. @@ -1567,7 +1567,7 @@ typedef struct dav_prop_ctx #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) */ @@ -1650,13 +1650,13 @@ typedef struct dav_walker_ctx 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 */ @@ -2051,7 +2051,7 @@ struct dav_hooks_vsn * 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 @@ -2059,8 +2059,8 @@ struct dav_hooks_vsn * 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. @@ -2163,7 +2163,7 @@ struct dav_hooks_vsn ** 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 @@ -2187,7 +2187,7 @@ struct dav_hooks_vsn */ 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); /* @@ -2274,7 +2274,7 @@ struct dav_hooks_vsn ** 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. @@ -2308,7 +2308,7 @@ struct dav_hooks_vsn */ 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); }; diff --git a/modules/dav/main/props.c b/modules/dav/main/props.c index 44c3398c04..155cc53a61 100644 --- a/modules/dav/main/props.c +++ b/modules/dav/main/props.c @@ -205,9 +205,6 @@ #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 */ @@ -298,19 +295,19 @@ static int dav_find_liveprop_provider(dav_propdb *propdb, 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); @@ -371,7 +368,7 @@ static void dav_do_prop_subreq(dav_propdb *propdb) 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; @@ -471,7 +468,7 @@ static dav_error * dav_insert_coreprop(dav_propdb *propdb, /* use D: prefix to refer to the DAV: namespace URI */ s = apr_psprintf(propdb->p, "" DEBUG_CR, name); } - ap_text_append(propdb->p, phdr, s); + apr_text_append(propdb->p, phdr, s); *inserted = what; } @@ -480,9 +477,9 @@ static dav_error * dav_insert_coreprop(dav_propdb *propdb, } 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; @@ -521,12 +518,12 @@ static void dav_output_prop_name(apr_pool_t *pool, } 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) @@ -604,8 +601,8 @@ void dav_close_propdb(dav_propdb *propdb) 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; @@ -621,9 +618,9 @@ dav_get_props_result dav_get_allprops(dav_propdb *propdb, dav_prop_insert what) } /* initialize the result with some start tags... */ - ap_text_append(propdb->p, &hdr, - "" DEBUG_CR - "" DEBUG_CR); + apr_text_append(propdb->p, &hdr, + "" DEBUG_CR + "" DEBUG_CR); /* if there ARE properties, then scan them */ if (propdb->db != NULL) { @@ -717,10 +714,10 @@ dav_get_props_result dav_get_allprops(dav_propdb *propdb, dav_prop_insert what) /* if not just reporting on supported live props, * terminate the result */ if (what != DAV_PROP_INSERT_SUPPORTED) { - ap_text_append(propdb->p, &hdr, - "" DEBUG_CR - "HTTP/1.1 200 OK" DEBUG_CR - "" DEBUG_CR); + apr_text_append(propdb->p, &hdr, + "" DEBUG_CR + "HTTP/1.1 200 OK" DEBUG_CR + "" DEBUG_CR); } result.propstats = hdr.first; @@ -728,13 +725,13 @@ dav_get_props_result dav_get_allprops(dav_propdb *propdb, dav_prop_insert what) 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; @@ -745,7 +742,7 @@ dav_get_props_result dav_get_props(dav_propdb *propdb, ap_xml_doc *doc) 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, "" DEBUG_CR "" DEBUG_CR); @@ -873,16 +870,16 @@ dav_get_props_result dav_get_props(dav_propdb *propdb, ap_xml_doc *doc) /* make sure we've started our "bad" propstat */ if (hdr_bad.first == NULL) { - ap_text_append(propdb->p, &hdr_bad, - "" DEBUG_CR - "" DEBUG_CR); + apr_text_append(propdb->p, &hdr_bad, + "" DEBUG_CR + "" 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, "" DEBUG_CR "HTTP/1.1 200 OK" DEBUG_CR "" DEBUG_CR); @@ -893,10 +890,10 @@ dav_get_props_result dav_get_props(dav_propdb *propdb, ap_xml_doc *doc) /* we may not have any "bad" results */ if (hdr_bad.first != NULL) { /* "close" the bad propstat */ - ap_text_append(propdb->p, &hdr_bad, - "" DEBUG_CR - "HTTP/1.1 404 Not Found" DEBUG_CR - "" DEBUG_CR); + apr_text_append(propdb->p, &hdr_bad, + "" DEBUG_CR + "HTTP/1.1 404 Not Found" DEBUG_CR + "" DEBUG_CR); /* if there are no good props, then just return the bad */ if (!have_good) { @@ -918,7 +915,7 @@ dav_get_props_result dav_get_props(dav_propdb *propdb, ap_xml_doc *doc) 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; @@ -942,7 +939,7 @@ void dav_get_liveprop_supported(dav_propdb *propdb, 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)); diff --git a/modules/dav/main/std_liveprop.c b/modules/dav/main/std_liveprop.c index d44d54bbcd..9da27e9415 100644 --- a/modules/dav/main/std_liveprop.c +++ b/modules/dav/main/std_liveprop.c @@ -95,7 +95,7 @@ static const dav_liveprop_group dav_core_liveprop_group = static dav_prop_insert dav_core_insert_prop(const dav_resource *resource, int propid, dav_prop_insert what, - ap_text_header *phdr) + apr_text_header *phdr) { const char *value; const char *s; @@ -172,7 +172,7 @@ static dav_prop_insert dav_core_insert_prop(const dav_resource *resource, else { s = apr_psprintf(p, "" DEBUG_CR, global_ns, info->name); } - ap_text_append(p, phdr, s); + apr_text_append(p, phdr, s); /* we inserted what was asked for */ return what; @@ -187,7 +187,7 @@ static int dav_core_is_writable(const dav_resource *resource, int propid) } static dav_error * dav_core_patch_validate(const dav_resource *resource, - const ap_xml_elem *elem, + const apr_xml_elem *elem, int operation, void **context, int *defer_to_dead) { @@ -216,7 +216,7 @@ int dav_core_find_liveprop(const dav_resource *resource, 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_insert_prop(resource, DAV_PROPID_resourcetype, what, phdr); diff --git a/modules/dav/main/util.c b/modules/dav/main/util.c index 9a4bc24cfb..023fd7994b 100644 --- a/modules/dav/main/util.c +++ b/modules/dav/main/util.c @@ -325,31 +325,31 @@ dav_lookup_result dav_lookup_uri(const char *uri, request_rec * r, */ /* validate that the root element uses a given DAV: tagname (TRUE==valid) */ -int dav_validate_root(const ap_xml_doc *doc, const char *tagname) +int dav_validate_root(const apr_xml_doc *doc, const char *tagname) { return doc->root && - doc->root->ns == AP_XML_NS_DAV_ID && + doc->root->ns == APR_XML_NS_DAV_ID && strcmp(doc->root->name, tagname) == 0; } /* find and return the (unique) child with a given DAV: tagname */ -ap_xml_elem *dav_find_child(const ap_xml_elem *elem, const char *tagname) +apr_xml_elem *dav_find_child(const apr_xml_elem *elem, const char *tagname) { - ap_xml_elem *child = elem->first_child; + apr_xml_elem *child = elem->first_child; for (; child; child = child->next) - if (child->ns == AP_XML_NS_DAV_ID && !strcmp(child->name, tagname)) + if (child->ns == APR_XML_NS_DAV_ID && !strcmp(child->name, tagname)) return child; return NULL; } /* 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_size_t len = 0; - ap_text *scan; - const ap_xml_elem *child; + apr_text *scan; + const apr_xml_elem *child; char *cdata; char *s; apr_size_t tlen; @@ -481,7 +481,7 @@ DAV_DECLARE(void) dav_xmlns_generate(dav_xmlns_info *xi, s = apr_psprintf(xi->pool, " xmlns:%s=\"%s\"", (const char *)prefix, (const char *)uri); - ap_text_append(xi->pool, phdr, s); + apr_text_append(xi->pool, phdr, s); } } @@ -1580,7 +1580,7 @@ dav_error * dav_validate_request(request_rec *r, dav_resource *resource, ** to construct a standard 207 response. */ if (err == NULL && response != NULL && *response != NULL) { - ap_text *propstat = NULL; + apr_text *propstat = NULL; if ((flags & DAV_VALIDATE_USE_424) != 0) { /* manufacture a 424 error to hold the multistatus response(s) */ diff --git a/modules/dav/main/util_lock.c b/modules/dav/main/util_lock.c index 348248a4e0..991e43019a 100644 --- a/modules/dav/main/util_lock.c +++ b/modules/dav/main/util_lock.c @@ -200,12 +200,12 @@ const char *dav_lock_get_activelock(request_rec *r, dav_lock *lock, dav_error * dav_lock_parse_lockinfo(request_rec *r, const dav_resource *resource, dav_lockdb *lockdb, - const ap_xml_doc *doc, + const apr_xml_doc *doc, dav_lock **lock_request) { apr_pool_t *p = r->pool; dav_error *err; - ap_xml_elem *child; + apr_xml_elem *child; dav_lock *lock; if (!dav_validate_root(doc, "lockinfo")) { @@ -254,14 +254,14 @@ dav_error * dav_lock_parse_lockinfo(request_rec *r, const char *text; /* quote all the values in the element */ - ap_xml_quote_elem(p, child); + apr_xml_quote_elem(p, child); /* ** Store a full element with namespace definitions ** and an xml:lang definition, if applicable. */ - ap_xml_to_text(p, child, AP_XML_X2T_FULL_NS_LANG, doc->namespaces, - NULL, &text, NULL); + apr_xml_to_text(p, child, APR_XML_X2T_FULL_NS_LANG, doc->namespaces, + NULL, &text, NULL); lock->owner = text; continue;