]> granicus.if.org Git - apache/commitdiff
use apr_size_t
authorGreg Stein <gstein@apache.org>
Thu, 16 Nov 2000 00:40:49 +0000 (00:40 +0000)
committerGreg Stein <gstein@apache.org>
Thu, 16 Nov 2000 00:40:49 +0000 (00:40 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86977 13f79535-47bb-0310-9956-ffa450edef68

include/util_xml.h
server/util_xml.c

index 8cdd50b1ad1d2e3f23e0c4b876d4b575961a0e33..82c2e8fbdda37e717ecfd42af0fa7a8dd22e2a4f 100644 (file)
@@ -261,7 +261,8 @@ AP_DECLARE(int) ap_xml_parse_input(request_rec *r, ap_xml_doc **pdoc);
  */
 AP_DECLARE(void) ap_xml_to_text(apr_pool_t *p, const ap_xml_elem *elem,
                                int style, apr_array_header_t *namespaces,
-                               int *ns_map, const char **pbuf, size_t *psize);
+                               int *ns_map, const char **pbuf,
+                                apr_size_t *psize);
 
 /* style argument values: */
 #define AP_XML_X2T_FULL                0       /* start tag, contents, end tag */
index 58a0fb03b56ed12a107da5c9e60e593ef3b5086f..3aa7afc58c6d204fc8529cbade97940a381d4054 100644 (file)
@@ -361,8 +361,7 @@ static void cdata_handler(void *userdata, const char *data, int len)
 AP_DECLARE(int) ap_xml_parse_input(request_rec * r, ap_xml_doc **pdoc)
 {
     int result;
-    ap_xml_ctx ctx =
-    {0};
+    ap_xml_ctx ctx = { 0 };
     XML_Parser parser;
 
     if ((result = ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK)) != OK)
@@ -396,8 +395,8 @@ AP_DECLARE(int) ap_xml_parse_input(request_rec * r, ap_xml_doc **pdoc)
        char *buffer;
        char end;
        int rv;
-       size_t total_read = 0;
-       size_t limit_xml_body = ap_get_limit_xml_body(r);
+       apr_size_t total_read = 0;
+       apr_size_t limit_xml_body = ap_get_limit_xml_body(r);
 
        /* allocate our working buffer */
        buffer = apr_palloc(r->pool, AP_XML_READ_BLOCKSIZE);
@@ -512,8 +511,8 @@ AP_DECLARE(const char *) ap_xml_quote_string(apr_pool_t *p, const char *s,
                                              int quotes)
 {
     const char *scan;
-    int len = 0;
-    int extra = 0;
+    apr_size_t len = 0;
+    apr_size_t extra = 0;
     char *qstr;
     char *qscan;
     char c;
@@ -575,19 +574,19 @@ AP_DECLARE(const char *) ap_xml_quote_string(apr_pool_t *p, const char *s,
                         (ns) < 1000000 ? 6 : (ns) < 10000000 ? 7 : \
                         (ns) < 100000000 ? 8 : (ns) < 1000000000 ? 9 : 10)
 
-static int text_size(const ap_text *t)
+static apr_size_t text_size(const ap_text *t)
 {
-    int size = 0;
+    apr_size_t size = 0;
 
     for (; t; t = t->next)
        size += strlen(t->text);
     return size;
 }
 
-static size_t elem_size(const ap_xml_elem *elem, int style,
-                       apr_array_header_t *namespaces, int *ns_map)
+static apr_size_t elem_size(const ap_xml_elem *elem, int style,
+                            apr_array_header_t *namespaces, int *ns_map)
 {
-    size_t size;
+    apr_size_t size;
 
     if (style == AP_XML_X2T_FULL || style == AP_XML_X2T_FULL_NS_LANG) {
        const ap_xml_attr *attr;
@@ -685,7 +684,7 @@ static size_t elem_size(const ap_xml_elem *elem, int style,
 static char *write_text(char *s, const ap_text *t)
 {
     for (; t; t = t->next) {
-       size_t len = strlen(t->text);
+       apr_size_t len = strlen(t->text);
        memcpy(s, t->text, len);
        s += len;
     }
@@ -696,7 +695,7 @@ static char *write_elem(char *s, const ap_xml_elem *elem, int style,
                        apr_array_header_t *namespaces, int *ns_map)
 {
     const ap_xml_elem *child;
-    size_t len;
+    apr_size_t len;
     int ns;
 
     if (style == AP_XML_X2T_FULL || style == AP_XML_X2T_FULL_NS_LANG) {
@@ -817,10 +816,11 @@ AP_DECLARE(void) ap_xml_quote_elem(apr_pool_t *p, ap_xml_elem *elem)
 /* convert an element to a text string */
 AP_DECLARE(void) ap_xml_to_text(apr_pool_t * p, const ap_xml_elem *elem,
                                 int style, apr_array_header_t *namespaces,
-                                int *ns_map, const char **pbuf, size_t *psize)
+                                int *ns_map, const char **pbuf,
+                                apr_size_t *psize)
 {
     /* get the exact size, plus a null terminator */
-    size_t size = elem_size(elem, style, namespaces, ns_map) + 1;
+    apr_size_t size = elem_size(elem, style, namespaces, ns_map) + 1;
     char *s = apr_palloc(p, size);
 
     (void) write_elem(s, elem, style, namespaces, ns_map);