On Thu, 31 Jan 2002, William A. Rowe, Jr. wrote:

> +1 ... offer patches !-)

okay... you and justin asked for it :)  attached is a patch to fix up all
the naming and add apu_strings.c to the build.  separately attached is
apu_strings.h and apu_strings.c which implement the apr_getword* functions
now (i added it to the 'misc' directory for this patch).

this is a quick stab at it - i wish the apr-util naming conventions were
more consistent (e.g. files start with apu) -

sterling

 srclib/apr-util/include/apu_strings.h
? srclib/apr-util/misc/apu_strings.c
Index: include/httpd.h
===================================================================
RCS file: /home/cvspublic/httpd-2.0/include/httpd.h,v
retrieving revision 1.176
diff -u -r1.176 httpd.h
--- include/httpd.h     29 Jan 2002 19:02:03 -0000      1.176
+++ include/httpd.h     1 Feb 2002 06:35:05 -0000
@@ -1125,79 +1125,6 @@
    char **) */
 
 /**
- * Get the characters until the first occurance of a specified character
- * @param p The pool to allocate memory from
- * @param line The string to get the characters from
- * @param stop The character to stop at
- * @return A copy of the characters up to the first stop character
- */
-AP_DECLARE(char *) ap_getword(apr_pool_t *p, const char **line, char stop);
-/**
- * Get the characters until the first occurance of a specified character
- * @param p The pool to allocate memory from
- * @param line The string to get the characters from
- * @param stop The character to stop at
- * @return A copy of the characters up to the first stop character
- * @note This is the same as ap_getword(), except it doesn't use const char **.
- */
-AP_DECLARE(char *) ap_getword_nc(apr_pool_t *p, char **line, char stop);
-
-/**
- * Get the first word from a given string.  A word is defined as all characters
- * up to the first whitespace.
- * @param p The pool to allocate memory from
- * @param line The string to traverse
- * @return The first word in the line
- */
-AP_DECLARE(char *) ap_getword_white(apr_pool_t *p, const char **line);
-/**
- * Get the first word from a given string.  A word is defined as all characters
- * up to the first whitespace.
- * @param p The pool to allocate memory from
- * @param line The string to traverse
- * @return The first word in the line
- * @note The same as ap_getword_white(), except it doesn't use const char **.
- */
-AP_DECLARE(char *) ap_getword_white_nc(apr_pool_t *p, char **line);
-
-/**
- * Get all characters from the first occurance of @a stop to the first '\0'
- * @param p The pool to allocate memory from
- * @param line The line to traverse
- * @param stop The character to start at
- * @return A copy of all caracters after the first occurance of the specified
- *         character
- */
-AP_DECLARE(char *) ap_getword_nulls(apr_pool_t *p, const char **line,
-                                   char stop);
-/**
- * Get all characters from the first occurance of @a stop to the first '\0'
- * @param p The pool to allocate memory from
- * @param line The line to traverse
- * @param stop The character to start at
- * @return A copy of all caracters after the first occurance of the specified
- *         character
- * @note The same as ap_getword_nulls(), except it doesn't use const char **.
- */
-AP_DECLARE(char *) ap_getword_nulls_nc(apr_pool_t *p, char **line, char stop);
-
-/**
- * Get the second word in the string paying attention to quoting
- * @param p The pool to allocate from
- * @param line The line to traverse
- * @return A copy of the string
- */
-AP_DECLARE(char *) ap_getword_conf(apr_pool_t *p, const char **line);
-/**
- * Get the second word in the string paying attention to quoting
- * @param p The pool to allocate from
- * @param line The line to traverse
- * @return A copy of the string
- * @note The same as ap_getword_conf(), except it doesn't use const char **.
- */
-AP_DECLARE(char *) ap_getword_conf_nc(apr_pool_t *p, char **line);
-
-/**
  * Check a string for any ${ENV} environment variable construct and replace 
  * each them by the value of that environment variable, if it exists. If the 
  * environment value does not exist, leave the ${ENV} construct alone; it 
Index: modules/aaa/mod_auth.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/aaa/mod_auth.c,v
retrieving revision 1.37
diff -u -r1.37 mod_auth.c
--- modules/aaa/mod_auth.c      27 Dec 2001 21:51:23 -0000      1.37
+++ modules/aaa/mod_auth.c      1 Feb 2002 06:35:06 -0000
@@ -71,6 +71,7 @@
  */
 
 #include "apr_strings.h"
+#include "apu_strings.h"
 #include "apr_lib.h"            /* for apr_password_validate */
 
 #include "ap_config.h"
@@ -144,11 +145,11 @@
             continue;
         }
         rpw = l;
-        w = ap_getword(r->pool, &rpw, ':');
+        w = apr_getword(r->pool, &rpw, ':');
 
         if (!strcmp(user, w)) {
             ap_cfg_closefile(f);
-            return ap_getword(r->pool, &rpw, ':');
+            return apr_getword(r->pool, &rpw, ':');
         }
     }
     ap_cfg_closefile(f);
@@ -179,10 +180,10 @@
         ll = l;
         apr_pool_clear(sp);
 
-        group_name = ap_getword(sp, &ll, ':');
+        group_name = apr_getword(sp, &ll, ':');
 
         while (ll[0]) {
-            w = ap_getword_conf(sp, &ll);
+            w = apr_getword_conf(sp, &ll);
             if (!strcmp(w, user)) {
                 apr_table_setn(grps, apr_pstrdup(p, group_name), "in");
                 break;
@@ -285,13 +286,13 @@
         method_restricted = 1;
 
         t = reqs[x].requirement;
-        w = ap_getword_white(r->pool, &t);
+        w = apr_getword_white(r->pool, &t);
         if (!strcmp(w, "valid-user")) {
             return OK;
         }
         if (!strcmp(w, "user")) {
             while (t[0]) {
-                w = ap_getword_conf(r->pool, &t);
+                w = apr_getword_conf(r->pool, &t);
                 if (!strcmp(user, w)) {
                     return OK;
                 }
@@ -303,7 +304,7 @@
             }
 
             while (t[0]) {
-                w = ap_getword_conf(r->pool, &t);
+                w = apr_getword_conf(r->pool, &t);
                 if (apr_table_get(grpstatus, w)) {
                     return OK;
                 }
Index: modules/aaa/mod_auth_dbm.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/aaa/mod_auth_dbm.c,v
retrieving revision 1.41
diff -u -r1.41 mod_auth_dbm.c
--- modules/aaa/mod_auth_dbm.c  7 Jan 2002 18:10:54 -0000       1.41
+++ modules/aaa/mod_auth_dbm.c  1 Feb 2002 06:35:07 -0000
@@ -307,7 +307,7 @@
             continue;
 
         t = reqs[x].requirement;
-        w = ap_getword_white(r->pool, &t);
+        w = apr_getword_white(r->pool, &t);
 
         if (!strcmp(w, "group") && conf->auth_dbmgrpfile) {
             const char *orig_groups, *groups;
@@ -325,10 +325,10 @@
             }
             orig_groups = groups;
             while (t[0]) {
-                w = ap_getword_white(r->pool, &t);
+                w = apr_getword_white(r->pool, &t);
                 groups = orig_groups;
                 while (groups[0]) {
-                    v = ap_getword(r->pool, &groups, ',');
+                    v = apr_getword(r->pool, &groups, ',');
                     if (!strcmp(v, w))
                         return OK;
                 }
Index: modules/aaa/mod_auth_digest.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/aaa/mod_auth_digest.c,v
retrieving revision 1.59
diff -u -r1.59 mod_auth_digest.c
--- modules/aaa/mod_auth_digest.c       29 Jan 2002 00:23:30 -0000      1.59
+++ modules/aaa/mod_auth_digest.c       1 Feb 2002 06:35:12 -0000
@@ -864,7 +864,7 @@
         return !OK;
     }
 
-    resp->scheme = ap_getword_white(r->pool, &auth_line);
+    resp->scheme = apr_getword_white(r->pool, &auth_line);
     if (strcasecmp(resp->scheme, "Digest")) {
         resp->auth_hdr_sts = NOT_DIGEST;
         return !OK;
@@ -1430,8 +1430,8 @@
             continue;
         }
         rpw = l;
-        w = ap_getword(r->pool, &rpw, ':');
-        x = ap_getword(r->pool, &rpw, ':');
+        w = apr_getword(r->pool, &rpw, ':');
+        x = apr_getword(r->pool, &rpw, ':');
 
         if (x && w && !strcmp(user, w) && !strcmp(realm, x)) {
             ap_cfg_closefile(f);
@@ -1901,10 +1901,10 @@
         ll = l;
         apr_pool_clear(sp);
 
-        group_name = ap_getword(sp, &ll, ':');
+        group_name = apr_getword(sp, &ll, ':');
 
         while (ll[0]) {
-            w = ap_getword_conf(sp, &ll);
+            w = apr_getword_conf(sp, &ll);
             if (!strcmp(w, user)) {
                 apr_table_setn(grps, apr_pstrdup(r->pool, group_name), "in");
                 break;
@@ -1960,13 +1960,13 @@
         method_restricted = 1;
 
         t = reqs[x].requirement;
-        w = ap_getword_white(r->pool, &t);
+        w = apr_getword_white(r->pool, &t);
         if (!strcasecmp(w, "valid-user")) {
             return OK;
         }
         else if (!strcasecmp(w, "user")) {
             while (t[0]) {
-                w = ap_getword_conf(r->pool, &t);
+                w = apr_getword_conf(r->pool, &t);
                 if (!strcmp(user, w)) {
                     return OK;
                 }
@@ -1978,7 +1978,7 @@
             }
 
             while (t[0]) {
-                w = ap_getword_conf(r->pool, &t);
+                w = apr_getword_conf(r->pool, &t);
                 if (apr_table_get(grpstatus, w)) {
                     return OK;
                 }
Index: modules/arch/win32/mod_win32.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/arch/win32/mod_win32.c,v
retrieving revision 1.9
diff -u -r1.9 mod_win32.c
--- modules/arch/win32/mod_win32.c      18 Dec 2001 21:56:16 -0000      1.9
+++ modules/arch/win32/mod_win32.c      1 Feb 2002 06:35:13 -0000
@@ -302,7 +302,7 @@
             const char *cgiarg = cgiargs;
             argtaken = 1;
             for (;;) {
-                char *w = ap_getword_nulls(p, &cgiarg, '+');
+                char *w = apr_getword_nulls(p, &cgiarg, '+');
                 if (!*w) {
                     break;
                 }
@@ -394,7 +394,7 @@
     if (!argtaken) {
         const char *cgiarg = cgiargs;
         for (;;) {
-            char *w = ap_getword_nulls(p, &cgiarg, '+');
+            char *w = apr_getword_nulls(p, &cgiarg, '+');
             if (!*w) {
                 break;
             }
Index: modules/dav/main/util.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/dav/main/util.c,v
retrieving revision 1.36
diff -u -r1.36 util.c
--- modules/dav/main/util.c     22 Jan 2002 19:00:22 -0000      1.36
+++ modules/dav/main/util.c     1 Feb 2002 06:35:18 -0000
@@ -499,7 +499,7 @@
      * we don't understand anything.
      */
 
-    while ((val = ap_getword_white(r->pool, &timeout)) && strlen(val)) {
+    while ((val = apr_getword_white(r->pool, &timeout)) && strlen(val)) {
        if (!strncmp(val, "Infinite", 8)) {
            return DAV_TIMEOUT_INFINITE;
        }
Index: modules/experimental/mod_ext_filter.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/experimental/mod_ext_filter.c,v
retrieving revision 1.20
diff -u -r1.20 mod_ext_filter.c
--- modules/experimental/mod_ext_filter.c       25 Jan 2002 01:11:46 -0000      1.20
+++ modules/experimental/mod_ext_filter.c       1 Feb 2002 06:35:20 -0000
@@ -199,7 +199,7 @@
 
         /* parms now has the command-line to parse */
         while (filter->numArgs < 30 &&
-               strlen(filter->args[filter->numArgs] = ap_getword_white_nc(p, 
&parms))) {
+               strlen(filter->args[filter->numArgs] = apr_getword_white_nc(p, 
+&parms))) {
             ++filter->numArgs;
         }
         if (filter->numArgs < 1) {
@@ -211,7 +211,7 @@
     else
     {
         /* simple path */
-        filter->args[0] = ap_getword_white(p, args);
+        filter->args[0] = apr_getword_white(p, args);
         if (!filter->args[0]) {
             return "Invalid cmd= parameter";
         }
@@ -229,7 +229,7 @@
     const char *name;
     ef_filter_t *filter;
 
-    name = ap_getword_white(cmd->pool, &args);
+    name = apr_getword_white(cmd->pool, &args);
     if (!name) {
         return "Filter name not found";
     }
@@ -249,12 +249,12 @@
             ++args;
         }
 
-        /* Nasty parsing...  I wish I could simply use ap_getword_white()
-         * here and then look at the token, but ap_getword_white() doesn't
+        /* Nasty parsing...  I wish I could simply use apr_getword_white()
+         * here and then look at the token, but apr_getword_white() doesn't
          * do the right thing when we have cmd="word word word"
          */
         if (!strncasecmp(args, "preservescontentlength", 22)) {
-            token = ap_getword_white(cmd->pool, &args);
+            token = apr_getword_white(cmd->pool, &args);
             if (!strcasecmp(token, "preservescontentlength")) {
                 filter->preserves_content_length = 1;
             }
@@ -268,7 +268,7 @@
 
         if (!strncasecmp(args, "mode=", 5)) {
             args += 5;
-            token = ap_getword_white(cmd->pool, &args);
+            token = apr_getword_white(cmd->pool, &args);
             if (!strcasecmp(token, "output")) {
                 filter->mode = OUTPUT_FILTER;
             }
@@ -284,13 +284,13 @@
 
         if (!strncasecmp(args, "intype=", 7)) {
             args += 7;
-            filter->intype = ap_getword_white(cmd->pool, &args);
+            filter->intype = apr_getword_white(cmd->pool, &args);
             continue;
         }
 
         if (!strncasecmp(args, "outtype=", 8)) {
             args += 8;
-            filter->outtype = ap_getword_white(cmd->pool, &args);
+            filter->outtype = apr_getword_white(cmd->pool, &args);
             continue;
         }
 
Index: modules/generators/mod_autoindex.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/generators/mod_autoindex.c,v
retrieving revision 1.92
diff -u -r1.92 mod_autoindex.c
--- modules/generators/mod_autoindex.c  27 Jan 2002 07:44:07 -0000      1.92
+++ modules/generators/mod_autoindex.c  1 Feb 2002 06:35:28 -0000
@@ -68,6 +68,7 @@
  */
 
 #include "apr_strings.h"
+#include "apu_strings.h"
 #include "apr_fnmatch.h"
 #include "apr_strings.h"
 #include "apr_lib.h"
@@ -254,7 +255,7 @@
         if (cl == NULL) {
             return "missing closing paren";
         }
-        alt = ap_getword_nc(cmd->pool, &iconbak, ',');
+        alt = apr_getword_nc(cmd->pool, &iconbak, ',');
         *cl = '\0';                             /* Lose closing paren */
         add_alt(cmd, d, &alt[1], to);
     }
@@ -355,7 +356,7 @@
     while (optstr[0]) {
         int option = 0;
 
-        w = ap_getword_conf(cmd->pool, &optstr);
+        w = apr_getword_conf(cmd->pool, &optstr);
         if ((*w == '+') || (*w == '-')) {
             action = *(w++);
         }
Index: modules/generators/mod_cgi.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/generators/mod_cgi.c,v
retrieving revision 1.116
diff -u -r1.116 mod_cgi.c
--- modules/generators/mod_cgi.c        31 Dec 2001 05:58:59 -0000      1.116
+++ modules/generators/mod_cgi.c        1 Feb 2002 06:35:28 -0000
@@ -71,6 +71,7 @@
 
 #include "apr.h"
 #include "apr_strings.h"
+#include "apu_strings.h"
 #include "apr_thread_proc.h"    /* for RLIMIT stuff */
 #include "apr_optional.h"
 #include "apr_buckets.h"
@@ -524,7 +525,7 @@
     *argv = apr_palloc(p, (numwords + 2) * sizeof(char *));
     (*argv)[0] = *cmd;
     for (x = 1, idx = 1; x < numwords; x++) {
-        w = ap_getword_nulls(p, &args, '+');
+        w = apr_getword_nulls(p, &args, '+');
         ap_unescape_url(w);
         (*argv)[idx++] = ap_escape_shell_cmd(p, w);
     }
Index: modules/generators/mod_cgid.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/generators/mod_cgid.c,v
retrieving revision 1.111
diff -u -r1.111 mod_cgid.c
--- modules/generators/mod_cgid.c       28 Jan 2002 18:30:07 -0000      1.111
+++ modules/generators/mod_cgid.c       1 Feb 2002 06:35:31 -0000
@@ -214,7 +214,7 @@
     av[idx++] = apr_pstrdup(p, av0);
 
     for (x = 1; x <= numwords; x++) {
-        w = ap_getword_nulls(p, &args, '+');
+        w = apr_getword_nulls(p, &args, '+');
         if (strcmp(w, "")) {
             ap_unescape_url(w);
             av[idx++] = ap_escape_shell_cmd(p, w);
@@ -271,18 +271,18 @@
     data = apr_pcalloc(r->pool, len + 1); /* get a cleared byte for final '\0' */
     i = read(fd, data, len); 
 
-    r->filename = ap_getword(r->pool, (const char **)&data, '\n'); 
-    *argv0 = ap_getword(r->pool, (const char **)&data, '\n'); 
+    r->filename = apr_getword(r->pool, (const char **)&data, '\n'); 
+    *argv0 = apr_getword(r->pool, (const char **)&data, '\n'); 
 
-    r->uri = ap_getword(r->pool, (const char **)&data, '\n'); 
+    r->uri = apr_getword(r->pool, (const char **)&data, '\n'); 
     
     environ = apr_pcalloc(r->pool, (j + 2) *sizeof(char *)); 
     i = 0; 
     for (i = 0; i < j; i++) { 
-        environ[i] = ap_getword(r->pool, (const char **)&data, '\n'); 
+        environ[i] = apr_getword(r->pool, (const char **)&data, '\n'); 
     } 
     *env = environ; 
-    r->args = ap_getword(r->pool, (const char **)&data, '\n'); 
+    r->args = apr_getword(r->pool, (const char **)&data, '\n'); 
   
     read(fd, &i, sizeof(int)); 
      
Index: modules/http/http_protocol.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/http/http_protocol.c,v
retrieving revision 1.390
diff -u -r1.390 http_protocol.c
--- modules/http/http_protocol.c        25 Jan 2002 01:11:46 -0000      1.390
+++ modules/http/http_protocol.c        1 Feb 2002 06:35:38 -0000
@@ -65,6 +65,7 @@
 
 #include "apr.h"
 #include "apr_strings.h"
+#include "apu_strings.h"
 #include "apr_buckets.h"
 #include "apr_lib.h"
 #include "apr_signal.h"
@@ -2519,7 +2520,7 @@
     /* this brigade holds what we will be sending */
     bsend = apr_brigade_create(r->pool);
 
-    while ((current = ap_getword(r->pool, &r->range, ','))
+    while ((current = apr_getword(r->pool, &r->range, ','))
            && (rv = parse_byterange(current, clength, &range_start,
                                     &range_end))) {
         apr_bucket *e2;
Index: modules/http/mod_mime.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/http/mod_mime.c,v
retrieving revision 1.76
diff -u -r1.76 mod_mime.c
--- modules/http/mod_mime.c     8 Dec 2001 02:04:51 -0000       1.76
+++ modules/http/mod_mime.c     1 Feb 2002 06:35:40 -0000
@@ -65,6 +65,7 @@
 
 #include "apr.h"
 #include "apr_strings.h"
+#include "apu_strings.h"
 #include "apr_lib.h"
 #include "apr_hash.h"
 
@@ -453,10 +454,10 @@
 
         if (l[0] == '#')
             continue;
-        ct = ap_getword_conf(p, &ll);
+        ct = apr_getword_conf(p, &ll);
 
         while (ll[0]) {
-            char *ext = ap_getword_conf(p, &ll);
+            char *ext = apr_getword_conf(p, &ll);
             ap_str_tolower(ext);   /* ??? */
             apr_hash_set(mime_type_extensions, ext, APR_HASH_KEY_STRING, ct);
         }
@@ -757,12 +758,12 @@
      * The base name is always the first exception (i.e., "txt.html" has
      * a basename of "txt" even though it might look like an extension).
      */
-    ext = ap_getword(r->pool, &fn, '.');
+    ext = apr_getword(r->pool, &fn, '.');
     *((const char **) apr_array_push(exception_list)) = ext;
 
     /* Parse filename extensions which can be in any order 
      */
-    while (*fn && (ext = ap_getword(r->pool, &fn, '.'))) {
+    while (*fn && (ext = apr_getword(r->pool, &fn, '.'))) {
         const extension_info *exinfo = NULL;
         int found;
 
@@ -839,7 +840,7 @@
             if (exinfo->input_filters && r->proxyreq == PROXYREQ_NONE) {
                 const char *filter, *filters = exinfo->input_filters;
                 while (*filters 
-                    && (filter = ap_getword(r->pool, &filters, ';'))) {
+                    && (filter = apr_getword(r->pool, &filters, ';'))) {
                     ap_add_input_filter(filter, NULL, r, r->connection);
                 }
                 if (conf->multimatch & MULTIMATCH_FILTERS)
@@ -848,7 +849,7 @@
             if (exinfo->output_filters && r->proxyreq == PROXYREQ_NONE) {
                 const char *filter, *filters = exinfo->output_filters;
                 while (*filters 
-                    && (filter = ap_getword(r->pool, &filters, ';'))) {
+                    && (filter = apr_getword(r->pool, &filters, ';'))) {
                     ap_add_output_filter(filter, NULL, r, r->connection);
                 }
                 if (conf->multimatch & MULTIMATCH_FILTERS)
Index: modules/loggers/mod_log_config.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/loggers/mod_log_config.c,v
retrieving revision 1.77
diff -u -r1.77 mod_log_config.c
--- modules/loggers/mod_log_config.c    28 Jan 2002 23:49:39 -0000      1.77
+++ modules/loggers/mod_log_config.c    1 Feb 2002 06:35:43 -0000
@@ -182,6 +182,7 @@
  * --- rst */
 
 #include "apr_strings.h"
+#include "apu_strings.h"
 #include "apr_lib.h"
 #include "apr_hash.h"
 #include "apr_optional.h"
@@ -662,7 +663,7 @@
 
         case '{':
             ++s;
-            it->arg = ap_getword(p, &s, '}');
+            it->arg = apr_getword(p, &s, '}');
             break;
 
         case '0':
Index: modules/mappers/mod_imap.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/mappers/mod_imap.c,v
retrieving revision 1.34
diff -u -r1.34 mod_imap.c
--- modules/mappers/mod_imap.c  19 Aug 2001 05:48:19 -0000      1.34
+++ modules/mappers/mod_imap.c  1 Feb 2002 06:35:45 -0000
@@ -703,7 +703,7 @@
         * ap_cfg_getline has removed leading/trailing whitespace.
         *
         * note that we're tokenizing as we go... if we were to use the
-        * ap_getword() class of functions we would end up allocating extra
+        * apr_getword() class of functions we would end up allocating extra
         * memory for every line of the map file
         */
         string_pos = input;
Index: modules/mappers/mod_userdir.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/mappers/mod_userdir.c,v
retrieving revision 1.41
diff -u -r1.41 mod_userdir.c
--- modules/mappers/mod_userdir.c       10 Jan 2002 09:11:32 -0000      1.41
+++ modules/mappers/mod_userdir.c       1 Feb 2002 06:35:46 -0000
@@ -92,6 +92,7 @@
  */
 
 #include "apr_strings.h"
+#include "apu_strings.h"
 #include "apr_user.h"
 
 #define APR_WANT_STRFUNC
@@ -157,7 +158,7 @@
                                                  &userdir_module);
     char *username;
     const char *usernames = arg;
-    char *kw = ap_getword_conf(cmd->pool, &usernames);
+    char *kw = apr_getword_conf(cmd->pool, &usernames);
     apr_table_t *usertable;
 
     /*
@@ -198,7 +199,7 @@
      * the appropriate table.
      */
     while (*usernames) {
-        username = ap_getword_conf(cmd->pool, &usernames);
+        username = apr_getword_conf(cmd->pool, &usernames);
         apr_table_setn(usertable, username, kw);
     }
     return NULL;
@@ -233,7 +234,7 @@
     }
 
     dname = name + 2;
-    w = ap_getword(r->pool, &dname, '/');
+    w = apr_getword(r->pool, &dname, '/');
 
     /*
      * The 'dname' funny business involves backing it up to capture the '/'
@@ -272,12 +273,12 @@
      */
 
     while (*userdirs) {
-        const char *userdir = ap_getword_conf(r->pool, &userdirs);
+        const char *userdir = apr_getword_conf(r->pool, &userdirs);
         char *filename = NULL;
         apr_status_t rv;
 
         if (ap_strchr_c(userdir, '*'))
-            x = ap_getword(r->pool, &userdir, '*');
+            x = apr_getword(r->pool, &userdir, '*');
 
        if (userdir[0] == '\0' || ap_os_is_path_absolute(r->pool, userdir)) {
             if (x) {
Index: modules/metadata/mod_expires.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/metadata/mod_expires.c,v
retrieving revision 1.35
diff -u -r1.35 mod_expires.c
--- modules/metadata/mod_expires.c      28 Aug 2001 19:54:54 -0000      1.35
+++ modules/metadata/mod_expires.c      1 Feb 2002 06:35:47 -0000
@@ -270,7 +270,7 @@
 
     /* <base>
      */
-    word = ap_getword_conf(p, &code);
+    word = apr_getword_conf(p, &code);
     if (!strncasecmp(word, "now", 1) ||
         !strncasecmp(word, "access", 1)) {
         base = 'A';
@@ -285,9 +285,9 @@
 
     /* [plus]
      */
-    word = ap_getword_conf(p, &code);
+    word = apr_getword_conf(p, &code);
     if (!strncasecmp(word, "plus", 1)) {
-        word = ap_getword_conf(p, &code);
+        word = apr_getword_conf(p, &code);
     }
 
     /* {<num> <type>}*
@@ -305,7 +305,7 @@
 
         /* <type>
          */
-        word = ap_getword_conf(p, &code);
+        word = apr_getword_conf(p, &code);
         if (word[0]) {
             /* do nothing */
         }
@@ -344,7 +344,7 @@
 
         /* next <num>
          */
-        word = ap_getword_conf(p, &code);
+        word = apr_getword_conf(p, &code);
     }
 
     *real_code = apr_psprintf(p, "%c%d", base, modifier);
Index: modules/metadata/mod_headers.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/metadata/mod_headers.c,v
retrieving revision 1.36
diff -u -r1.36 mod_headers.c
--- modules/metadata/mod_headers.c      28 Jan 2002 23:49:39 -0000      1.36
+++ modules/metadata/mod_headers.c      1 Feb 2002 06:35:48 -0000
@@ -301,7 +301,7 @@
     /* grab the argument if there is one */
     if (*s == '{') {
         ++s;
-        tag->arg = ap_getword(p,&s,'}');
+        tag->arg = apr_getword(p,&s,'}');
     }
 
     tag_handler = (const char * (*)(request_rec *,char 
*))apr_hash_get(format_tag_hash, s++, 1);
@@ -439,10 +439,10 @@
     const char *envclause;
 
     s = apr_pstrdup(cmd->pool, args);
-    action = ap_getword_conf(cmd->pool, &s);
-    hdr = ap_getword_conf(cmd->pool, &s);
-    val = *s ? ap_getword_conf(cmd->pool, &s) : NULL;
-    envclause = *s ? ap_getword_conf(cmd->pool, &s) : NULL;
+    action = apr_getword_conf(cmd->pool, &s);
+    hdr = apr_getword_conf(cmd->pool, &s);
+    val = *s ? apr_getword_conf(cmd->pool, &s) : NULL;
+    envclause = *s ? apr_getword_conf(cmd->pool, &s) : NULL;
 
     return header_inout_cmd(hdr_out, cmd, indirconf, action, hdr, val, envclause);
 }
Index: modules/metadata/mod_setenvif.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/metadata/mod_setenvif.c,v
retrieving revision 1.32
diff -u -r1.32 mod_setenvif.c
--- modules/metadata/mod_setenvif.c     22 Nov 2001 01:43:33 -0000      1.32
+++ modules/metadata/mod_setenvif.c     1 Feb 2002 06:35:50 -0000
@@ -123,6 +123,7 @@
 
 #include "apr.h"
 #include "apr_strings.h"
+#include "apu_strings.h"
 
 #define APR_WANT_STRFUNC
 #include "apr_want.h"
@@ -243,7 +244,7 @@
                                               &setenvif_module);
     entries = (sei_entry *) sconf->conditionals->elts;
     /* get regex */
-    regex = ap_getword_conf(cmd->pool, &args);
+    regex = apr_getword_conf(cmd->pool, &args);
     if (!*regex) {
         return apr_pstrcat(cmd->pool, "Missing regular expression for ",
                          cmd->cmd->name, NULL);
@@ -330,13 +331,13 @@
     }
 
     for ( ; ; ) {
-       feature = ap_getword_conf(cmd->pool, &args);
+       feature = apr_getword_conf(cmd->pool, &args);
        if (!*feature) {
            break;
        }
         beenhere++;
 
-        var = ap_getword(cmd->pool, &feature, '=');
+        var = apr_getword(cmd->pool, &feature, '=');
         if (*feature) {
             apr_table_setn(new->features, var, feature);
         }
@@ -362,7 +363,7 @@
     char *fname;
 
     /* get header name */
-    fname = ap_getword_conf(cmd->pool, &args);
+    fname = apr_getword_conf(cmd->pool, &args);
     if (!*fname) {
         return apr_pstrcat(cmd->pool, "Missing header-field name for ",
                          cmd->cmd->name, NULL);
Index: modules/metadata/mod_usertrack.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/metadata/mod_usertrack.c,v
retrieving revision 1.34
diff -u -r1.34 mod_usertrack.c
--- modules/metadata/mod_usertrack.c    1 Oct 2001 15:47:12 -0000       1.34
+++ modules/metadata/mod_usertrack.c    1 Feb 2002 06:35:51 -0000
@@ -277,9 +277,9 @@
      * CookieExpires "[plus] {<num> <type>}*"
      */
 
-    word = ap_getword_conf(parms->pool, &arg);
+    word = apr_getword_conf(parms->pool, &arg);
     if (!strncasecmp(word, "plus", 1)) {
-        word = ap_getword_conf(parms->pool, &arg);
+        word = apr_getword_conf(parms->pool, &arg);
     };
 
     /* {<num> <type>}* */
@@ -291,7 +291,7 @@
             return "bad expires code, numeric value expected.";
 
         /* <type> */
-        word = ap_getword_conf(parms->pool, &arg);
+        word = apr_getword_conf(parms->pool, &arg);
         if (!word[0])
             return "bad expires code, missing <type>";
 
@@ -316,7 +316,7 @@
         modifier = modifier + factor * num;
 
         /* next <num> */
-        word = ap_getword_conf(parms->pool, &arg);
+        word = apr_getword_conf(parms->pool, &arg);
     }
 
     cls->expires = modifier;
Index: modules/proxy/mod_proxy.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/proxy/mod_proxy.c,v
retrieving revision 1.70
diff -u -r1.70 mod_proxy.c
--- modules/proxy/mod_proxy.c   1 Feb 2002 04:07:48 -0000       1.70
+++ modules/proxy/mod_proxy.c   1 Feb 2002 06:35:53 -0000
@@ -906,7 +906,7 @@
             return "<Proxy > block must specify a path";
     }
 
-    cmd->path = ap_getword_conf(cmd->pool, &arg);
+    cmd->path = apr_getword_conf(cmd->pool, &arg);
     cmd->override = OR_ALL|ACCESS_CONF;
 
     if (!strncasecmp(cmd->path, "proxy:", 6))
@@ -920,7 +920,7 @@
        r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED);
     }
     else if (!strcmp(cmd->path, "~")) {
-       cmd->path = ap_getword_conf(cmd->pool, &arg);
+       cmd->path = apr_getword_conf(cmd->pool, &arg);
         if (!cmd->path)
             return "<Proxy ~ > block must specify a path";
         if (strncasecmp(cmd->path, "proxy:", 6))
Index: modules/proxy/proxy_ftp.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/proxy/proxy_ftp.c,v
retrieving revision 1.105
diff -u -r1.105 proxy_ftp.c
--- modules/proxy/proxy_ftp.c   31 Jan 2002 14:48:51 -0000      1.105
+++ modules/proxy/proxy_ftp.c   1 Feb 2002 06:35:58 -0000
@@ -716,7 +716,7 @@
 
         case 257: {
             const char *dirp = ftpmessage;
-            cwd = ap_getword_conf(r->pool, &dirp);
+            cwd = apr_getword_conf(r->pool, &dirp);
         }
     }
     return cwd;
@@ -874,14 +874,14 @@
      * still smaller that the URL is logged regularly.
      */
     if ((password = apr_table_get(r->headers_in, "Authorization")) != NULL
-        && strcasecmp(ap_getword(r->pool, &password, ' '), "Basic") == 0
+        && strcasecmp(apr_getword(r->pool, &password, ' '), "Basic") == 0
         && (password = ap_pbase64decode(r->pool, password))[0] != ':') {
         /*
          * Note that this allocation has to be made from r->connection->pool
          * because it has the lifetime of the connection.  The other
          * allocations are temporary and can be tossed away any time.
          */
-        user = ap_getword_nulls(r->connection->pool, &password, ':');
+        user = apr_getword_nulls(r->connection->pool, &password, ':');
         r->ap_auth_type = "Basic";
         r->user = r->parsed_uri.user = user;
     }
Index: modules/ssl/mod_ssl.h
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/ssl/mod_ssl.h,v
retrieving revision 1.55
diff -u -r1.55 mod_ssl.h
--- modules/ssl/mod_ssl.h       18 Jan 2002 23:26:46 -0000      1.55
+++ modules/ssl/mod_ssl.h       1 Feb 2002 06:36:03 -0000
@@ -102,6 +102,7 @@
 #include "util_filter.h"
 #include "mpm.h"
 #include "apr_strings.h"
+#include "apu_strings.h"
 #include "apr_tables.h"
 #include "apr_lib.h"
 #include "apr_fnmatch.h"
Index: modules/ssl/ssl_engine_config.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/ssl/ssl_engine_config.c,v
retrieving revision 1.20
diff -u -r1.20 ssl_engine_config.c
--- modules/ssl/ssl_engine_config.c     29 Nov 2001 06:15:01 -0000      1.20
+++ modules/ssl/ssl_engine_config.c     1 Feb 2002 06:36:03 -0000
@@ -784,7 +784,7 @@
 
     first = TRUE;
     while (cpLine[0] != NUL) {
-        w = ap_getword_conf(cmd->pool, &cpLine);
+        w = apr_getword_conf(cmd->pool, &cpLine);
         action = NUL;
 
         if (*w == '+' || *w == '-') {
@@ -863,7 +863,7 @@
     sc = mySrvConfig(cmd->server);
     options = SSL_PROTOCOL_NONE;
     while (opt[0] != NUL) {
-        w = ap_getword_conf(cmd->pool, &opt);
+        w = apr_getword_conf(cmd->pool, &opt);
 
         action = NUL;
         if (*w == '+' || *w == '-')
@@ -905,7 +905,7 @@
     sc = mySrvConfig(cmd->server);
     options = SSL_PROTOCOL_NONE;
     while (opt[0] != NUL) {
-        w = ap_getword_conf(cmd->pool, &opt);
+        w = apr_getword_conf(cmd->pool, &opt);
 
         action = NUL;
         if (*w == '+' || *w == '-')
Index: modules/ssl/ssl_engine_kernel.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/ssl/ssl_engine_kernel.c,v
retrieving revision 1.40
diff -u -r1.40 ssl_engine_kernel.c
--- modules/ssl/ssl_engine_kernel.c     31 Jan 2002 14:55:05 -0000      1.40
+++ modules/ssl/ssl_engine_kernel.c     1 Feb 2002 06:36:07 -0000
@@ -852,11 +852,11 @@
      * password.
      */
     if ((cpAL = apr_table_get(r->headers_in, "Authorization")) != NULL) {
-        if (strcEQ(ap_getword(r->pool, &cpAL, ' '), "Basic")) {
+        if (strcEQ(apr_getword(r->pool, &cpAL, ' '), "Basic")) {
             while (*cpAL == ' ' || *cpAL == '\t')
                 cpAL++;
             cpAL = ap_pbase64decode(r->pool, cpAL);
-            cpUN = ap_getword_nulls(r->pool, &cpAL, ':');
+            cpUN = apr_getword_nulls(r->pool, &cpAL, ':');
             cpPW = cpAL;
             if (cpUN[0] == '/' && strEQ(cpPW, "password"))
                 return HTTP_FORBIDDEN;
Index: os/unix/unixd.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/os/unix/unixd.c,v
retrieving revision 1.46
diff -u -r1.46 unixd.c
--- os/unix/unixd.c     17 Jan 2002 22:59:48 -0000      1.46
+++ os/unix/unixd.c     1 Feb 2002 06:36:09 -0000
@@ -268,7 +268,7 @@
         return;
     }
 
-    if ((str = ap_getword_conf(cmd->pool, &arg))) {
+    if ((str = apr_getword_conf(cmd->pool, &arg))) {
         if (!strcasecmp(str, "max")) {
             cur = limit->rlim_max;
         }
@@ -282,7 +282,7 @@
         return;
     }
 
-    if (arg2 && (str = ap_getword_conf(cmd->pool, &arg2))) {
+    if (arg2 && (str = apr_getword_conf(cmd->pool, &arg2))) {
         max = atol(str);
     }
 
Index: server/config.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/config.c,v
retrieving revision 1.144
diff -u -r1.144 config.c
--- server/config.c     28 Jan 2002 23:49:39 -0000      1.144
+++ server/config.c     1 Feb 2002 06:36:13 -0000
@@ -73,6 +73,7 @@
 
 #include "apr.h"
 #include "apr_strings.h"
+#include "apu_strings.h"
 #include "apr_portable.h"
 #include "apr_file_io.h"
 
@@ -660,7 +661,7 @@
        return cmd->AP_NO_ARGS(parms, mconfig);
 
     case TAKE1:
-       w = ap_getword_conf(parms->pool, &args);
+       w = apr_getword_conf(parms->pool, &args);
 
        if (*w == '\0' || *args != 0)
            return apr_pstrcat(parms->pool, cmd->name, " takes one argument",
@@ -669,8 +670,8 @@
        return cmd->AP_TAKE1(parms, mconfig, w);
 
     case TAKE2:
-       w = ap_getword_conf(parms->pool, &args);
-       w2 = ap_getword_conf(parms->pool, &args);
+       w = apr_getword_conf(parms->pool, &args);
+       w2 = apr_getword_conf(parms->pool, &args);
 
        if (*w == '\0' || *w2 == '\0' || *args != 0)
            return apr_pstrcat(parms->pool, cmd->name, " takes two arguments",
@@ -680,8 +681,8 @@
 
     case TAKE12:
 
-       w = ap_getword_conf(parms->pool, &args);
-       w2 = ap_getword_conf(parms->pool, &args);
+       w = apr_getword_conf(parms->pool, &args);
+       w2 = apr_getword_conf(parms->pool, &args);
 
        if (*w == '\0' || *args != 0)
            return apr_pstrcat(parms->pool, cmd->name, " takes 1-2 arguments",
@@ -691,9 +692,9 @@
 
     case TAKE3:
 
-       w = ap_getword_conf(parms->pool, &args);
-       w2 = ap_getword_conf(parms->pool, &args);
-       w3 = ap_getword_conf(parms->pool, &args);
+       w = apr_getword_conf(parms->pool, &args);
+       w2 = apr_getword_conf(parms->pool, &args);
+       w3 = apr_getword_conf(parms->pool, &args);
 
        if (*w == '\0' || *w2 == '\0' || *w3 == '\0' || *args != 0)
            return apr_pstrcat(parms->pool, cmd->name, " takes three arguments",
@@ -703,9 +704,9 @@
 
     case TAKE23:
 
-       w = ap_getword_conf(parms->pool, &args);
-       w2 = ap_getword_conf(parms->pool, &args);
-       w3 = *args ? ap_getword_conf(parms->pool, &args) : NULL;
+       w = apr_getword_conf(parms->pool, &args);
+       w2 = apr_getword_conf(parms->pool, &args);
+       w3 = *args ? apr_getword_conf(parms->pool, &args) : NULL;
 
        if (*w == '\0' || *w2 == '\0' || *args != 0)
            return apr_pstrcat(parms->pool, cmd->name,
@@ -716,9 +717,9 @@
 
     case TAKE123:
 
-       w = ap_getword_conf(parms->pool, &args);
-       w2 = *args ? ap_getword_conf(parms->pool, &args) : NULL;
-       w3 = *args ? ap_getword_conf(parms->pool, &args) : NULL;
+       w = apr_getword_conf(parms->pool, &args);
+       w2 = *args ? apr_getword_conf(parms->pool, &args) : NULL;
+       w3 = *args ? apr_getword_conf(parms->pool, &args) : NULL;
 
        if (*w == '\0' || *args != 0)
            return apr_pstrcat(parms->pool, cmd->name,
@@ -729,9 +730,9 @@
 
     case TAKE13:
 
-       w = ap_getword_conf(parms->pool, &args);
-       w2 = *args ? ap_getword_conf(parms->pool, &args) : NULL;
-       w3 = *args ? ap_getword_conf(parms->pool, &args) : NULL;
+       w = apr_getword_conf(parms->pool, &args);
+       w2 = *args ? apr_getword_conf(parms->pool, &args) : NULL;
+       w3 = *args ? apr_getword_conf(parms->pool, &args) : NULL;
 
        if (*w == '\0' || (w2 && *w2 && !w3) || *args != 0)
            return apr_pstrcat(parms->pool, cmd->name,
@@ -742,7 +743,7 @@
 
     case ITERATE:
 
-       while (*(w = ap_getword_conf(parms->pool, &args)) != '\0')
+       while (*(w = apr_getword_conf(parms->pool, &args)) != '\0')
            {
            if ((errmsg = cmd->AP_TAKE1(parms, mconfig, w)))
                return errmsg;
@@ -752,14 +753,14 @@
 
     case ITERATE2:
 
-       w = ap_getword_conf(parms->pool, &args);
+       w = apr_getword_conf(parms->pool, &args);
 
        if (*w == '\0' || *args == 0)
            return apr_pstrcat(parms->pool, cmd->name,
                            " requires at least two arguments",
                            cmd->errmsg ? ", " : NULL, cmd->errmsg, NULL);
 
-       while (*(w2 = ap_getword_conf(parms->pool, &args)) != '\0')
+       while (*(w2 = apr_getword_conf(parms->pool, &args)) != '\0')
            {
            if ((errmsg = cmd->AP_TAKE2(parms, mconfig, w, w2)))
                return errmsg;
@@ -769,7 +770,7 @@
 
     case FLAG:
 
-       w = ap_getword_conf(parms->pool, &args);
+       w = apr_getword_conf(parms->pool, &args);
 
        if (*w == '\0' || (strcasecmp(w, "on") && strcasecmp(w, "off")))
            return apr_pstrcat(parms->pool, cmd->name, " must be On or Off",
@@ -856,7 +857,7 @@
 #else
     args = ap_resolve_env(temp_pool, l); 
 #endif
-    cmd_name = ap_getword_conf(p, &args);
+    cmd_name = apr_getword_conf(p, &args);
     if (*cmd_name == '\0') {
        /* Note: this branch should not occur. An empty line should have
         * triggered the exit further above.
@@ -1218,7 +1219,7 @@
 #else
         args = ap_resolve_env(cmd->temp_pool, l);
 #endif
-        cmd_name = ap_getword_conf(cmd->pool, &args);
+        cmd_name = apr_getword_conf(cmd->pool, &args);
         if (cmd_name[0] == '<') {
             if (cmd_name[1] == '/') {
                 cmd_name[strlen(cmd_name) - 1] = '\0';
@@ -1509,7 +1510,7 @@
          * name, ignoring case sensitivity and aliases
          */
         filename = ap_make_full_path(r->pool, d,
-                                     ap_getword_conf(r->pool, &access_name));
+                                     apr_getword_conf(r->pool, &access_name));
         status = ap_pcfg_openfile(&f, r->pool, filename);
 
         if (status == APR_SUCCESS) {
Index: server/core.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/core.c,v
retrieving revision 1.141
diff -u -r1.141 core.c
--- server/core.c       30 Jan 2002 01:57:53 -0000      1.141
+++ server/core.c       1 Feb 2002 06:36:21 -0000
@@ -1071,7 +1071,7 @@
 
     d->override = OR_NONE;
     while (l[0]) {
-        w = ap_getword_conf(cmd->pool, &l);
+        w = apr_getword_conf(cmd->pool, &l);
        if (!strcasecmp(w, "Limit")) {
            d->override |= OR_LIMIT;
        }
@@ -1110,7 +1110,7 @@
     char action;
 
     while (l[0]) {
-        char *w = ap_getword_conf(cmd->pool, &l);
+        char *w = apr_getword_conf(cmd->pool, &l);
        action = '\0';
 
        if (*w == '+' || *w == '-') {
@@ -1200,7 +1200,7 @@
         action = '*';
         bit = ETAG_UNSET;
         valid = 1;
-        token = ap_getword_conf(cmd->pool, &args);
+        token = apr_getword_conf(cmd->pool, &args);
         if ((*token == '+') || (*token == '-')) {
             action = *token;
             token++;
@@ -1335,7 +1335,7 @@
 
 AP_CORE_DECLARE_NONSTD(const char *) ap_limit_section(cmd_parms *cmd, void *dummy,
                                                  const char *arg) {
-    const char *limited_methods = ap_getword(cmd->pool, &arg, '>');
+    const char *limited_methods = apr_getword(cmd->pool, &arg, '>');
     void *tog = cmd->cmd->cmd_data;
     apr_int64_t limited = 0;
     const char *errmsg;
@@ -1346,7 +1346,7 @@
     }
 
     while (limited_methods[0]) {
-        char *method = ap_getword_conf(cmd->pool, &limited_methods);
+        char *method = apr_getword_conf(cmd->pool, &limited_methods);
         int methnum;
 
         /* check for builtin or module registered method number */
@@ -1427,11 +1427,11 @@
             return "<Directory > block must specify a path";
     }
 
-    cmd->path = ap_getword_conf(cmd->pool, &arg);
+    cmd->path = apr_getword_conf(cmd->pool, &arg);
     cmd->override = OR_ALL|ACCESS_CONF;
 
     if (!strcmp(cmd->path, "~")) {
-       cmd->path = ap_getword_conf(cmd->pool, &arg);
+       cmd->path = apr_getword_conf(cmd->pool, &arg);
         if (!cmd->path)
             return "<Directory ~ > block must specify a path";
     }
@@ -1510,14 +1510,14 @@
 
     arg=apr_pstrndup(cmd->pool, arg, endp-arg);
 
-    cmd->path = ap_getword_conf(cmd->pool, &arg);
+    cmd->path = apr_getword_conf(cmd->pool, &arg);
     cmd->override = OR_ALL|ACCESS_CONF;
 
     if (thiscmd->cmd_data) { /* <LocationMatch> */
        r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED);
     }
     else if (!strcmp(cmd->path, "~")) {
-       cmd->path = ap_getword_conf(cmd->pool, &arg);
+       cmd->path = apr_getword_conf(cmd->pool, &arg);
        r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED);
     }
 
@@ -1569,7 +1569,7 @@
 
     arg=apr_pstrndup(cmd->pool, arg, endp-arg);
 
-    cmd->path = ap_getword_conf(cmd->pool, &arg);
+    cmd->path = apr_getword_conf(cmd->pool, &arg);
     /* Only if not an .htaccess file */
     if (!old_path) {
        cmd->override = OR_ALL|ACCESS_CONF;
@@ -1579,7 +1579,7 @@
         r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED|USE_ICASE);
     }
     else if (!strcmp(cmd->path, "~")) {
-       cmd->path = ap_getword_conf(cmd->pool, &arg);
+       cmd->path = apr_getword_conf(cmd->pool, &arg);
        r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED|USE_ICASE);
     }
     else {
@@ -1759,7 +1759,7 @@
        return "ServerAlias only used in <VirtualHost>";
     }
     while (*arg) {
-       char **item, *name = ap_getword_conf(cmd->pool, &arg);
+       char **item, *name = apr_getword_conf(cmd->pool, &arg);
        if (ap_is_matchexp(name)) {
            item = (char **)apr_array_push(cmd->server->wild_names);
        }
@@ -2000,7 +2000,7 @@
         return err;
     }
 
-    if ((str = ap_getword_conf(cmd->pool, &arg))) {
+    if ((str = apr_getword_conf(cmd->pool, &arg))) {
         if (!strcasecmp(str, "emerg")) {
            cmd->server->loglevel = APLOG_EMERG;
        }
@@ -3539,14 +3539,14 @@
     const char *filter, *filters = conf->output_filters;
 
     if (filters) {
-        while (*filters && (filter = ap_getword(r->pool, &filters, ';'))) {
+        while (*filters && (filter = apr_getword(r->pool, &filters, ';'))) {
             ap_add_output_filter(filter, NULL, r, r->connection);
         }
     }
 
     filters = conf->input_filters;
     if (filters) {
-        while (*filters && (filter = ap_getword(r->pool, &filters, ';'))) {
+        while (*filters && (filter = apr_getword(r->pool, &filters, ';'))) {
             ap_add_input_filter(filter, NULL, r, r->connection);
         }
     }
Index: server/protocol.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/protocol.c,v
retrieving revision 1.77
diff -u -r1.77 protocol.c
--- server/protocol.c   30 Jan 2002 04:37:29 -0000      1.77
+++ server/protocol.c   1 Feb 2002 06:36:24 -0000
@@ -607,7 +607,7 @@
 
     r->request_time = apr_time_now();
     ll = r->the_request;
-    r->method = ap_getword_white(r->pool, &ll);
+    r->method = apr_getword_white(r->pool, &ll);
 
 #if 0
 /* XXX If we want to keep track of the Method, the protocol module should do
@@ -615,7 +615,7 @@
  * sometime.   rbb */
     ap_update_connection_status(AP_CHILD_THREAD_FROM_ID(conn->id), "Method", 
r->method); 
 #endif
-    uri = ap_getword_white(r->pool, &ll);
+    uri = apr_getword_white(r->pool, &ll);
 
     /* Provide quick information about the request method as soon as known */
 
@@ -1018,7 +1018,7 @@
         return HTTP_UNAUTHORIZED;
     }
 
-    if (strcasecmp(ap_getword(r->pool, &auth_line, ' '), "Basic")) {
+    if (strcasecmp(apr_getword(r->pool, &auth_line, ' '), "Basic")) {
         /* Client tried to authenticate using wrong auth scheme */
         ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
                      "client used wrong authentication scheme: %s", r->uri);
@@ -1035,7 +1035,7 @@
      * because it has the lifetime of the connection.  The other allocations
      * are temporary and can be tossed away any time.
      */
-    r->user = ap_getword_nulls (r->pool, &t, ':');
+    r->user = apr_getword_nulls (r->pool, &t, ':');
     r->ap_auth_type = "Basic";
 
     *pw = t;
Index: server/util.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/util.c,v
retrieving revision 1.119
diff -u -r1.119 util.c
--- server/util.c       27 Jan 2002 07:49:05 -0000      1.119
+++ server/util.c       1 Feb 2002 06:36:28 -0000
@@ -638,167 +638,6 @@
     return n;
 }
 
-AP_DECLARE(char *) ap_getword_nc(apr_pool_t *atrans, char **line, char stop)
-{
-    return ap_getword(atrans, (const char **) line, stop);
-}
-
-AP_DECLARE(char *) ap_getword(apr_pool_t *atrans, const char **line, char stop)
-{
-    const char *pos = *line;
-    int len;
-    char *res;
-
-    while ((*pos != stop) && *pos) {
-        ++pos;
-    }
-
-    len = pos - *line;
-    res = (char *)apr_palloc(atrans, len + 1);
-    memcpy(res, *line, len);
-    res[len] = 0;
-
-    if (stop) {
-        while (*pos == stop) {
-            ++pos;
-        }
-    }
-    *line = pos;
-
-    return res;
-}
-
-AP_DECLARE(char *) ap_getword_white_nc(apr_pool_t *atrans, char **line)
-{
-    return ap_getword_white(atrans, (const char **) line);
-}
-
-AP_DECLARE(char *) ap_getword_white(apr_pool_t *atrans, const char **line)
-{
-    int pos = -1, x;
-    char *res;
-
-    for (x = 0; (*line)[x]; x++) {
-       if (apr_isspace((*line)[x])) {
-           pos = x;
-           break;
-       }
-    }
-
-    if (pos == -1) {
-       res = apr_pstrdup(atrans, *line);
-       *line += strlen(*line);
-       return res;
-    }
-
-    res = apr_palloc(atrans, pos + 1);
-    apr_cpystrn(res, *line, pos + 1);
-
-    while (apr_isspace((*line)[pos]))
-       ++pos;
-
-    *line += pos;
-
-    return res;
-}
-
-AP_DECLARE(char *) ap_getword_nulls_nc(apr_pool_t *atrans, char **line, char stop)
-{
-    return ap_getword_nulls(atrans, (const char **) line, stop);
-}
-
-AP_DECLARE(char *) ap_getword_nulls(apr_pool_t *atrans, const char **line, char stop)
-{
-    const char *pos = ap_strchr_c(*line, stop);
-    char *res;
-
-    if (!pos) {
-       res = apr_pstrdup(atrans, *line);
-       *line += strlen(*line);
-       return res;
-    }
-
-    res = apr_pstrndup(atrans, *line, pos - *line);
-
-    ++pos;
-
-    *line = pos;
-
-    return res;
-}
-
-/* Get a word, (new) config-file style --- quoted strings and backslashes
- * all honored
- */
-
-static char *substring_conf(apr_pool_t *p, const char *start, int len, char quote)
-{
-    char *result = apr_palloc(p, len + 2);
-    char *resp = result;
-    int i;
-
-    for (i = 0; i < len; ++i) {
-       if (start[i] == '\\' && (start[i + 1] == '\\'
-                                || (quote && start[i + 1] == quote)))
-           *resp++ = start[++i];
-       else
-           *resp++ = start[i];
-    }
-
-    *resp++ = '\0';
-#if RESOLVE_ENV_PER_TOKEN
-    return ap_resolve_env(p,result);
-#else
-    return result;
-#endif
-}
-
-AP_DECLARE(char *) ap_getword_conf_nc(apr_pool_t *p, char **line)
-{
-    return ap_getword_conf(p, (const char **) line);
-}
-
-AP_DECLARE(char *) ap_getword_conf(apr_pool_t *p, const char **line)
-{
-    const char *str = *line, *strend;
-    char *res;
-    char quote;
-
-    while (*str && apr_isspace(*str))
-       ++str;
-
-    if (!*str) {
-       *line = str;
-       return "";
-    }
-
-    if ((quote = *str) == '"' || quote == '\'') {
-       strend = str + 1;
-       while (*strend && *strend != quote) {
-           if (*strend == '\\' && strend[1] && strend[1] == quote)
-               strend += 2;
-           else
-               ++strend;
-       }
-       res = substring_conf(p, str + 1, strend - str - 1, quote);
-
-       if (*strend == quote)
-           ++strend;
-    }
-    else {
-       strend = str;
-       while (*strend && !apr_isspace(*strend))
-           ++strend;
-
-       res = substring_conf(p, str, strend - str, 0);
-    }
-
-    while (*strend && apr_isspace(*strend))
-       ++strend;
-    *line = strend;
-    return res;
-}
-
 /* Check a string for any ${ENV} environment variable
  * construct and replace each them by the value of
  * that environment variable, if it exists. If the
Index: server/vhost.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/vhost.c,v
retrieving revision 1.67
diff -u -r1.67 vhost.c
--- server/vhost.c      26 Dec 2001 21:25:54 -0000      1.67
+++ server/vhost.c      1 Feb 2002 06:36:30 -0000
@@ -265,7 +265,8 @@
     /* start the list of addreses */
     addrs = &s->addrs;
     while (hostname[0]) {
-        err = get_addresses(p, ap_getword_conf(p, &hostname), &addrs, s->port);
+        err = get_addresses(p, apr_getword_conf(p, &hostname), &addrs, 
+                            s->port);
         if (err) {
             *addrs = NULL;
             return err;
Index: srclib/apr-util/misc/Makefile.in
===================================================================
RCS file: /home/cvspublic/apr-util/misc/Makefile.in,v
retrieving revision 1.6
diff -u -r1.6 Makefile.in
--- srclib/apr-util/misc/Makefile.in    18 Jan 2002 20:49:23 -0000      1.6
+++ srclib/apr-util/misc/Makefile.in    1 Feb 2002 06:36:33 -0000
@@ -5,7 +5,7 @@
 top_srcdir=@abs_srcdir@
 INCLUDES=-I$(top_builddir)/include -I$(top_srcdir)/include @APR_INCLUDES@ 
@APRUTIL_INCLUDES@
 
-TARGETS = apr_date.lo apr_rmm.lo
+TARGETS = apr_date.lo apu_strings.lo apr_rmm.lo
 CLEAN_TARGETS = 
 
 # bring in rules.mk for standard functionality
/* ====================================================================
 * The Apache Software License, Version 1.1
 *
 * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
 * reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution,
 *    if any, must include the following acknowledgment:
 *       "This product includes software developed by the
 *        Apache Software Foundation (http://www.apache.org/)."
 *    Alternately, this acknowledgment may appear in the software itself,
 *    if and wherever such third-party acknowledgments normally appear.
 *
 * 4. The names "Apache" and "Apache Software Foundation" must
 *    not be used to endorse or promote products derived from this
 *    software without prior written permission. For written
 *    permission, please contact [EMAIL PROTECTED]
 *
 * 5. Products derived from this software may not be called "Apache",
 *    nor may "Apache" appear in their name, without prior written
 *    permission of the Apache Software Foundation.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of the Apache Software Foundation.  For more
 * information on the Apache Software Foundation, please see
 * <http://www.apache.org/>.
 *
 * Portions of this software are based upon public domain software
 * originally written at the National Center for Supercomputing Applications,
 * University of Illinois, Urbana-Champaign.
 */

/*
 * apu_strings.c: string parsing utility routines
 * We should add other platform independant functions from apr_strings.c
 * like apr_pstrndup into apr-util (this file).
 */

#if APR_HAVE_STDLIB_H
#include <stdlib.h>
#endif

#include "apr_strings.h"
#include "apu_strings.h"

APU_DECLARE(char *) apr_getword_nc(apr_pool_t *atrans, char **line, char stop)
{
    return apr_getword(atrans, (const char **) line, stop);
}

APU_DECLARE(char *) apr_getword(apr_pool_t *atrans, const char **line, 
                               char stop)
{
    const char *pos = *line;
    int len;
    char *res;

    while ((*pos != stop) && *pos) {
        ++pos;
    }

    len = pos - *line;
    res = (char *)apr_palloc(atrans, len + 1);
    memcpy(res, *line, len);
    res[len] = 0;

    if (stop) {
        while (*pos == stop) {
            ++pos;
        }
    }
    *line = pos;

    return res;
}

APU_DECLARE(char *) apr_getword_white_nc(apr_pool_t *atrans, char **line)
{
    return apr_getword_white(atrans, (const char **) line);
}

APU_DECLARE(char *) apr_getword_white(apr_pool_t *atrans, const char **line)
{
    int pos = -1, x;
    char *res;

    for (x = 0; (*line)[x]; x++) {
        if (apr_isspace((*line)[x])) {
            pos = x;
            break;
        }
    }

    if (pos == -1) {
        res = apr_pstrdup(atrans, *line);
        *line += strlen(*line);
        return res;
    }

    res = apr_palloc(atrans, pos + 1);
    apr_cpystrn(res, *line, pos + 1);

    while (apr_isspace((*line)[pos]))
        ++pos;

    *line += pos;

    return res;
}

APU_DECLARE(char *) apr_getword_nulls_nc(apr_pool_t *atrans, char **line, char stop)
{
    return apr_getword_nulls(atrans, (const char **) line, stop);
}

APU_DECLARE(char *) apr_getword_nulls(apr_pool_t *atrans, const char **line, 
                                      char stop)
{
    const char *pos = strchr(*line, stop);
    char *res;

    if (!pos) {
        res = apr_pstrdup(atrans, *line);
        *line += strlen(*line);
        return res;
    }

    res = apr_pstrndup(atrans, *line, pos - *line);

    ++pos;

    *line = pos;

    return res;
}

/* Get a word, (new) config-file style --- quoted strings and backslashes
 * all honored
 */

static char *substring_conf(apr_pool_t *p, const char *start, int len, char quote)
{
    char *result = apr_palloc(p, len + 2);
    char *resp = result;
    int i;

    for (i = 0; i < len; ++i) {
        if (start[i] == '\\' && (start[i + 1] == '\\'
                                 || (quote && start[i + 1] == quote)))
            *resp++ = start[++i];
        else
            *resp++ = start[i];
    }

    *resp++ = '\0';
#if RESOLVE_ENV_PER_TOKEN
    return apr_resolve_env(p,result);
#else
    return result;
#endif
}

APU_DECLARE(char *) apr_getword_conf_nc(apr_pool_t *p, char **line)
{
    return apr_getword_conf(p, (const char **) line);
}

APU_DECLARE(char *) apr_getword_conf(apr_pool_t *p, const char **line)
{
    const char *str = *line, *strend;
    char *res;
    char quote;

    while (*str && apr_isspace(*str))
        ++str;

    if (!*str) {
        *line = str;
        return "";
    }

    if ((quote = *str) == '"' || quote == '\'') {
        strend = str + 1;
        while (*strend && *strend != quote) {
            if (*strend == '\\' && strend[1] && strend[1] == quote)
                strend += 2;
            else
                ++strend;
        }
        res = substring_conf(p, str + 1, strend - str - 1, quote);

        if (*strend == quote)
            ++strend;
    }
    else {
        strend = str;
        while (*strend && !apr_isspace(*strend))
            ++strend;

        res = substring_conf(p, str, strend - str, 0);
    }

    while (*strend && apr_isspace(*strend))
        ++strend;
    *line = strend;
    return res;
}

/* ====================================================================
 * The Apache Software License, Version 1.1
 *
 * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
 * reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution,
 *    if any, must include the following acknowledgment:
 *       "This product includes software developed by the
 *        Apache Software Foundation (http://www.apache.org/)."
 *    Alternately, this acknowledgment may appear in the software itself,
 *    if and wherever such third-party acknowledgments normally appear.
 *
 * 4. The names "Apache" and "Apache Software Foundation" must
 *    not be used to endorse or promote products derived from this
 *    software without prior written permission. For written
 *    permission, please contact [EMAIL PROTECTED]
 *
 * 5. Products derived from this software may not be called "Apache",
 *    nor may "Apache" appear in their name, without prior written
 *    permission of the Apache Software Foundation.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of the Apache Software Foundation.  For more
 * information on the Apache Software Foundation, please see
 * <http://www.apache.org/>.
 *
 * Portions of this software are based upon public domain software
 * originally written at the National Center for Supercomputing Applications,
 * University of Illinois, Urbana-Champaign.
 */

#include "apu.h"
#include "apr.h"
#include "apr_lib.h"
#include "apr_pools.h"


/**
 * Get the characters until the first occurance of a specified character
 * @param p The pool to allocate memory from
 * @param line The string to get the characters from
 * @param stop The character to stop at
 * @return A copy of the characters up to the first stop character
 */
APU_DECLARE(char *) apr_getword(apr_pool_t *p, const char **line, char stop);

/**
 * Get the characters until the first occurance of a specified character
 * @param p The pool to allocate memory from
 * @param line The string to get the characters from
 * @param stop The character to stop at
 * @return A copy of the characters up to the first stop character
 * @note This is the same as apr_getword(),except it doesn't use const char **.
 */
APU_DECLARE(char *) apr_getword_nc(apr_pool_t *p, char **line, char stop);

/**
 * Get the first word from a given string.  A word is defined as all characters
 * up to the first whitespace.
 * @param p The pool to allocate memory from
 * @param line The string to traverse
 * @return The first word in the line
 */
APU_DECLARE(char *) apr_getword_white(apr_pool_t *p, const char **line);
/**
 * Get the first word from a given string.  A word is defined as all characters
 * up to the first whitespace.
 * @param p The pool to allocate memory from
 * @param line The string to traverse
 * @return The first word in the line
 * @note The same as apr_getword_white(), except it doesn't use const char **.
 */
APU_DECLARE(char *) apr_getword_white_nc(apr_pool_t *p, char **line);

/**
 * Get all characters from the first occurance of @a stop to the first '\0'
 * @param p The pool to allocate memory from
 * @param line The line to traverse
 * @param stop The character to start at
 * @return A copy of all caracters after the first occurance of the specified
 *         character
 */
APU_DECLARE(char *) apr_getword_nulls(apr_pool_t *p, const char **line,
                                    char stop);
/**
 * Get all characters from the first occurance of @a stop to the first '\0'
 * @param p The pool to allocate memory from
 * @param line The line to traverse
 * @param stop The character to start at
 * @return A copy of all caracters after the first occurance of the specified
 *         character
 * @note The same as apr_getword_nulls(), except it doesn't use const char **.
 */
APU_DECLARE(char *) apr_getword_nulls_nc(apr_pool_t *p, char **line, char stop);

/**
 * Get the second word in the string paying attention to quoting
 * @param p The pool to allocate from
 * @param line The line to traverse
 * @return A copy of the string
 */
APU_DECLARE(char *) apr_getword_conf(apr_pool_t *p, const char **line);
/**
 * Get the second word in the string paying attention to quoting
 * @param p The pool to allocate from
 * @param line The line to traverse
 * @return A copy of the string
 * @note The same as apr_getword_conf(), except it doesn't use const char **.
 */
APU_DECLARE(char *) apr_getword_conf_nc(apr_pool_t *p, char **line);

Reply via email to