httpd-apreq-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject cvs commit: httpd-apreq-2/src apreq.c apreq.h apreq_cookie.c apreq_cookie.h apreq_env.h apreq_params.c apreq_params.h apreq_parsers.c apreq_parsers.h apreq_tables.c apreq_tables.h
Date Tue, 20 May 2003 20:11:00 GMT
joes        2003/05/20 13:11:00

  Modified:    src      apreq.c apreq.h apreq_cookie.c apreq_cookie.h
                        apreq_env.h apreq_params.c apreq_params.h
                        apreq_parsers.c apreq_parsers.h apreq_tables.c
                        apreq_tables.h
  Log:
  s/apreq_tables/apr_tables/g, phase 1:  Update core to only use apr_tables, but (for now) still build apreq_tables into libapreq.so
  
  Revision  Changes    Path
  1.18      +6 -6      httpd-apreq-2/src/apreq.c
  
  Index: apreq.c
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/src/apreq.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- apreq.c	6 May 2003 02:11:36 -0000	1.17
  +++ apreq.c	20 May 2003 20:10:59 -0000	1.18
  @@ -63,9 +63,9 @@
   
   APREQ_DECLARE(apreq_value_t *)apreq_make_value(apr_pool_t  *p, 
                                                  const char  *name,
  -                                               const apr_ssize_t nlen,
  +                                               const apr_size_t nlen,
                                                  const char  *val, 
  -                                               const apr_ssize_t vlen)
  +                                               const apr_size_t vlen)
   {
       apreq_value_t *v = apr_palloc(p, vlen + nlen + 1 + sizeof *v);
       if (v == NULL)
  @@ -144,7 +144,7 @@
   
       when = apr_time_now();
       if ( strcasecmp(time_str,"now") != 0 ) 
  -        when += apreq_atol(time_str);
  +        when += apreq_atoi64t(time_str);
   
       if ( apr_time_exp_gmt(&tms, when) != APR_SUCCESS )
           return NULL;
  @@ -159,7 +159,7 @@
   
   /* used for specifying file & byte sizes */
   
  -APREQ_DECLARE(apr_int64_t) apreq_atoi64(const char *s)
  +APREQ_DECLARE(apr_int64_t) apreq_atoi64f(const char *s)
   {
       apr_int64_t n = 0;
       char *p;
  @@ -185,13 +185,13 @@
   
   /* converts date offsets (e.g. "+3M") to seconds */
   
  -APREQ_DECLARE(long) apreq_atol(const char *s) 
  +APREQ_DECLARE(apr_int64_t) apreq_atoi64t(const char *s) 
   {
       apr_int64_t n = 0;
       char *p;
       if (s == NULL)
           return 0;
  -    n = (long)apr_strtoi64(s, &p, 0); /* XXX: what about overflow? */
  +    n = apr_strtoi64(s, &p, 0); /* XXX: what about overflow? */
   
       if (p == NULL)
           return n;
  
  
  
  1.18      +105 -17   httpd-apreq-2/src/apreq.h
  
  Index: apreq.h
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/src/apreq.h,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- apreq.h	6 May 2003 02:11:36 -0000	1.17
  +++ apreq.h	20 May 2003 20:10:59 -0000	1.18
  @@ -4,10 +4,29 @@
   #include "apr_tables.h" 
   #include <stddef.h>
   
  +#ifndef apr_table_nelts
  +#define apr_table_nelts(t) apr_table_elts(t)->nelts
  +#endif
  +
   #ifdef  __cplusplus
    extern "C" {
   #endif 
   
  +/**
  + * @defgoup apreq  General Purpose structs, macros & functions.
  + * @ingroup APREQ
  + *
  + * The objects in apreq.h are used in various contexts:
  + *
  + *    1)  apreq_value_t - the base struct for params & cookies
  + *    2)  string <-> array converters
  + *    3)  substring search functions
  + *    4)  simple encoders & decoders for urlencoded strings
  + *    5)  simple time, date, & file-size converters
  + *
  + * @{
  + */
  +
   /* XXX temporary workaround for Win32 */
   #ifndef WIN32
   #define APREQ_DECLARE(d)                APR_DECLARE(d)
  @@ -29,6 +48,12 @@
   
   #define APREQ_NELTS                     8
   
  +/**
  + * 
  + * apreq_value_t
  + *
  + */
  +
   typedef struct apreq_value_t {
       const char          *name;
       apr_status_t         status;
  @@ -41,28 +66,49 @@
   typedef apreq_value_t *(apreq_value_copy_t)(apr_pool_t *p,
                                               const apreq_value_t *v);
   
  +
   #define apreq_attr_to_type(T,A,P) ( (T*) ((char*)(P)-offsetof(T,A)) )
   #define apreq_char_to_value(ptr)  apreq_attr_to_type(apreq_value_t, data, ptr)
   
   #define apreq_strtoval(ptr)  apreq_char_to_value(ptr)
   #define apreq_strlen(ptr) (apreq_strtoval(ptr)->size)
   
  +/**
  + * construcs an apreq_value_t from the name/value info
  + * supplied by the arguments.
  + */
  +
   APREQ_DECLARE(apreq_value_t *) apreq_make_value(apr_pool_t *p, 
                                                   const char *name,
  -                                                const apr_ssize_t nlen,
  +                                                const apr_size_t nlen,
                                                   const char *val, 
  -                                                const apr_ssize_t vlen);
  +                                                const apr_size_t vlen);
  +
  +/**
  + *
  + */
   
   APREQ_DECLARE(apreq_value_t *) apreq_copy_value(apr_pool_t *p, 
                                                   const apreq_value_t *val);
   
  +/**
  + *
  + */
  +
   APREQ_DECLARE(apreq_value_t *) apreq_merge_values(apr_pool_t *p, 
                                               const apr_array_header_t *arr);
   
  +/**
  + *
  + */
   
   APR_INLINE
   APREQ_DECLARE(const char *)apreq_enctype(void *env);
   
  +/**
  + *
  + */
  +
   typedef enum { AS_IS, ENCODE, DECODE, QUOTE } apreq_join_t;
   
   APREQ_DECLARE(const char *) apreq_join(apr_pool_t *p, 
  @@ -71,48 +117,90 @@
                                          apreq_join_t mode);
   
   
  +/**
  + *
  + */
   typedef enum {FULL, PARTIAL} apreq_match_t;
   
  -char *apreq_memmem(char* hay, apr_size_t haylen, 
  -                   const char* ndl, apr_size_t ndllen, 
  -                   const apreq_match_t type);
  +APREQ_DECLARE(char *) apreq_memmem(char* hay, apr_size_t haylen, 
  +                                   const char* ndl, apr_size_t ndllen, 
  +                                   const apreq_match_t type);
   
  -apr_ssize_t apreq_index(const char* hay, apr_size_t haylen, 
  +/**
  + *
  + */
  +APREQ_DECLARE(apr_ssize_t) apreq_index(const char* hay, apr_size_t haylen, 
                           const char* ndl, apr_size_t ndllen, 
                           const apreq_match_t type);
  +/**
  + *
  + */
  +
  +APREQ_DECLARE(apr_size_t) apreq_quote(char *dest, const char *src, const apr_size_t slen);
  +
  +/**
  + *
  + */
   
  -/* url-escapes non-alphanumeric characters */
  -apr_size_t apreq_quote(char *dest, const char *src, const apr_size_t slen);
  -apr_size_t apreq_encode(char *dest, const char *src, const apr_size_t slen);
  -apr_ssize_t apreq_decode(char *dest, const char *src, const apr_size_t slen);
  +APREQ_DECLARE(apr_size_t) apreq_encode(char *dest, const char *src, const apr_size_t slen);
  +
  +/**
  + *
  + */
  +
  +APREQ_DECLARE(apr_ssize_t) apreq_decode(char *dest, const char *src, const apr_size_t slen);
  +
  +/**
  + *
  + */
   
   APREQ_DECLARE(char *) apreq_escape(apr_pool_t *p, 
                                      const char *src, const apr_size_t slen);
   
  +/**
  + *
  + *
  + */
  +
   APREQ_DECLARE(apr_ssize_t) apreq_unescape(char *str);
   #define apreq_unescape(str) apreq_decode(str,str,strlen(str))
   
  +
   /**
    * Returns an RFC-822 formatted time string. Similar to ap_gm_timestr_822.
    *
    * @param req The current apreq_request_t object.
    * @param ts  YMDhms time units (from now) until expiry.
    *            Understands "now".
  + *
  + * returns date string, (time_str is offset from "now") formatted
  + * either as an ::NSCOOKIE or ::HTTP date
  + *
    */
   
  -/* returns date string, (time_str is offset from "now") formatted
  - * either as an ::NSCOOKIE or ::HTTP date */
  -
   typedef enum {HTTP, NSCOOKIE} apreq_expires_t;
   
   APREQ_DECLARE(char *) apreq_expires(apr_pool_t *p, const char *time_str, 
                                       const apreq_expires_t type);
   
  -/* file sizes (KMG) to bytes */
  -apr_int64_t apreq_atoi64(const char *s);
  +/**
  + * file sizes (KMG) to bytes
  + *
  + *
  + */
  +
  +APREQ_DECLARE(apr_int64_t) apreq_atoi64f(const char *s);
  +
  +/**
  + * "time" strings (YMDhms) to seconds
  + *
  + *
  + */
  +
  +APREQ_DECLARE(apr_int64_t) apreq_atoi64t(const char *s);
  +
   
  -/* "time" strings (YMDhms) to seconds */
  -long apreq_atol(const char *s);
  +/** @} */
   
   #ifdef __cplusplus
    }
  
  
  
  1.13      +50 -55    httpd-apreq-2/src/apreq_cookie.c
  
  Index: apreq_cookie.c
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/src/apreq_cookie.c,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- apreq_cookie.c	6 May 2003 02:11:36 -0000	1.12
  +++ apreq_cookie.c	20 May 2003 20:10:59 -0000	1.13
  @@ -62,31 +62,26 @@
   #include "apr_lib.h"
   
   
  -APREQ_DECLARE(int) (apreq_jar_items)(apreq_jar_t *jar)
  -{
  -    return apreq_jar_items(jar);
  -}
  -
   APREQ_DECLARE(apreq_cookie_t *) (apreq_cookie)(const apreq_jar_t *jar, 
                                                  const char *name)
   {
       return apreq_cookie(jar,name);
   }
   
  -APREQ_DECLARE(apr_status_t) (apreq_add_cookie)(apreq_jar_t *jar, 
  +APREQ_DECLARE(void) (apreq_add_cookie)(apreq_jar_t *jar, 
                                          const apreq_cookie_t *c)
   {
  -    return apreq_add_cookie(jar,c);
  +    apreq_add_cookie(jar,c);
   }
   
   APREQ_DECLARE(void) apreq_cookie_expires(apr_pool_t *p,
                                            apreq_cookie_t *c, 
                                            const char *time_str)
   {
  -    if ( c->version == NETSCAPE )
  +    if (c->version == NETSCAPE)
           c->time.expires = apreq_expires(p, time_str, NSCOOKIE);
       else
  -        c->time.max_age = apreq_atol(time_str);
  +        c->time.max_age = apreq_atoi64t(time_str);
   }
   
   static int has_rfc_cookie(void *ctx, const char *key, const char *val)
  @@ -106,7 +101,7 @@
           if (j == NULL || apreq_jar_nelts(j) == 0) 
               return APREQ_COOKIE_VERSION;
   
  -        else if (apreq_table_do(has_rfc_cookie, NULL, j->cookies) == 1)
  +        else if (apr_table_do(has_rfc_cookie, NULL, j->cookies) == 1)
               return NETSCAPE;
   
           else
  @@ -121,8 +116,6 @@
                                         char *attr,
                                         char *val)
   {
  -    dAPREQ_LOG;
  -
       if ( attr[0] ==  '-' || attr[0] == '$' )
           ++attr;
   
  @@ -215,31 +208,36 @@
       return c;
   }
   
  -static APR_INLINE apr_status_t get_pair(const char **data,
  -                                        const char **n, apr_size_t *nlen,
  -                                        const char **v, apr_size_t *vlen)
  +APR_INLINE
  +static apr_status_t get_pair(const char **data,
  +                             const char **n, apr_size_t *nlen,
  +                             const char **v, apr_size_t *vlen)
   {
       const char *d = *data;
       unsigned char in_quotes = 0;
   
       *n = d;
   
  -    while( *d != '=' && !apr_isspace(*d) )
  +    while (*d != '=' && !apr_isspace(*d)) {
           if (*d++ == 0)  {
               /*error: no '=' sign detected */
               *data = d-1;
               return APR_NOTFOUND;
           }
  +    }
  +
       *nlen = d - *n;
   
  -    do ++d; while ( *d == '=' || apr_isspace(*d) );
  +    do ++d;
  +    while (*d == '=' || apr_isspace(*d));
   
       *v = d;
   
       for (;;++d) {
           switch (*d) {
   
  -        case ';': case ',':
  +        case ';':
  +        case ',':
               if (in_quotes)
                   break;
               /* else fall through */
  @@ -273,8 +271,8 @@
       return APR_SUCCESS;
   }
   
  -APREQ_DECLARE(apreq_jar_t *) apreq_jar(void *env, 
  -                                       const char *data)
  +
  +APREQ_DECLARE(apreq_jar_t *) apreq_jar(void *env, const char *hdr)
   {
       apr_pool_t *p = apreq_env_pool(env);
   
  @@ -286,11 +284,9 @@
       const char *name, *value; 
       apr_size_t nlen, vlen;
   
  -    dAPREQ_LOG;
  -
       /* initialize jar */
       
  -    if (data == NULL) {
  +    if (hdr == NULL) {
           /* use the environment's cookie data */
   
           j = apreq_env_jar(env, NULL);
  @@ -300,28 +296,28 @@
           j = apr_palloc(p, sizeof *j);
           j->pool = p;
           j->env = env;
  -        j->cookies = apreq_table_make(p, APREQ_NELTS);
  +        j->cookies = apr_table_make(p, APREQ_NELTS);
   
  -        data = apreq_env_cookie(env);
  +        hdr = apreq_env_cookie(env);
   
           /* XXX: potential race condition here 
              between env_jar fetch and env_jar set.  */
   
           apreq_env_jar(env,j);
   
  -        if (data == NULL)
  +        if (hdr == NULL)
               return j;
       }
       else {
           j = apr_palloc(p, sizeof *j);
           j->pool = p;
           j->env = env;
  -        j->cookies = apreq_table_make(p, APREQ_NELTS);
  +        j->cookies = apr_table_make(p, APREQ_NELTS);
       }
   
  -    origin = data;
  +    origin = hdr;
   
  -    apreq_log(APREQ_DEBUG 0, env, "parsing cookie data: %s", data);
  +    apreq_log(APREQ_DEBUG 0, env, "parsing cookie data: %s", hdr);
   
       /* parse data */
   
  @@ -330,49 +326,49 @@
       c = NULL;
       version = NETSCAPE;
   
  -    while (apr_isspace(*data))
  -        ++data;
  +    while (apr_isspace(*hdr))
  +        ++hdr;
   
       /* XXX cheat: assume "$..." => "$Version" => RFC Cookie header */
   
  -    if (*data == '$') { 
  +    if (*hdr == '$') { 
           version = RFC;
  -        while (*data && !apr_isspace(*data))
  -            ++data;
  +        while (*hdr && !apr_isspace(*hdr))
  +            ++hdr;
       }
   
       for (;;) {
           apr_status_t status;
   
  -        while (*data == ';' || apr_isspace(*data))
  -            ++data;
  +        while (*hdr == ';' || apr_isspace(*hdr))
  +            ++hdr;
   
  -        switch (*data) {
  +        switch (*hdr) {
   
           case 0:
               /* this is the normal exit point for apreq_jar */
               return j;
   
           case ',':
  -            ++data;
  +            ++hdr;
               goto parse_cookie_header;
   
           case '$':
               if (c == NULL) {
                   apreq_log(APREQ_ERROR APR_BADCH, env,
                         "Saw attribute, expecting NAME=VALUE cookie pair: %s",
  -                          data);
  +                          hdr);
                   return j;
               }
               else if (version == NETSCAPE) {
                   c->v.status = APR_EMISMATCH;
                   apreq_log(APREQ_ERROR c->v.status, env, 
                             "Saw attribute in a Netscape Cookie header: %s", 
  -                          data);
  +                          hdr);
                   return j;
               }
   
  -            status = get_pair(&data, &name, &nlen, &value, &vlen);
  +            status = get_pair(&hdr, &name, &nlen, &value, &vlen);
   
               if (status == APR_SUCCESS)
                   apreq_cookie_attr(p, c, apr_pstrmemdup(p, name, nlen),
  @@ -380,12 +376,12 @@
               else {
                   c->v.status = status;
                   apreq_log(APREQ_WARN c->v.status, env,
  -                           "Ignoring bad attribute pair: %s", data);
  +                           "Ignoring bad attribute pair: %s", hdr);
               }
               break;
   
           default:
  -            status = get_pair(&data, &name, &nlen, &value, &vlen);
  +            status = get_pair(&hdr, &name, &nlen, &value, &vlen);
   
               if (status == APR_SUCCESS) {
                   c = apreq_make_cookie(p, version, name, nlen, 
  @@ -396,7 +392,7 @@
               }
               else {
                   apreq_log(APREQ_WARN status, env,
  -                          "Skipping bad NAME=VALUE pair: %s", data);
  +                          "Skipping bad NAME=VALUE pair: %s", hdr);
               }
           }
       }
  @@ -425,7 +421,7 @@
       
   #define ADD_ATTR(name) do { strcpy(f,c->name ? "; " #name "=%s" : \
                                       "%.0s"); f+= strlen(f); } while (0)
  -#define NONNULL(attr) (attr ? attr : "")
  +#define NULL2EMPTY(attr) (attr ? attr : "")
   
   
       if (c->version == NETSCAPE) {
  @@ -440,7 +436,7 @@
               strcpy(f, "; secure");
   
           return apr_snprintf(buf, len, format, c->v.name, c->v.data,
  -            NONNULL(c->path), NONNULL(c->domain), c->time.expires);
  +           NULL2EMPTY(c->path), NULL2EMPTY(c->domain), c->time.expires);
       }
   
       /* c->version == RFC */
  @@ -456,17 +452,17 @@
   
   #undef ADD_ATTR
   
  -    strcpy(f, c->time.max_age >= 0 ? "; max-age=%ld" : "");
  +    strcpy(f, c->time.max_age >= 0 ? "; max-age=%" APR_INT64_T_FMT : "");
   
       f += strlen(f);
   
       if (c->secure)
           strcpy(f, "; secure");
   
  -    return apr_snprintf(buf, len, format, c->v.name, c->v.data,
  -                        c->version, NONNULL(c->path), NONNULL(c->domain), 
  -                        NONNULL(c->port), NONNULL(c->comment), 
  -                        NONNULL(c->commentURL), c->time.max_age);
  +    return apr_snprintf(buf, len, format, c->v.name, c->v.data, c->version,
  +                        NULL2EMPTY(c->path), NULL2EMPTY(c->domain), 
  +                        NULL2EMPTY(c->port), NULL2EMPTY(c->comment), 
  +                        NULL2EMPTY(c->commentURL), c->time.max_age);
   }
   
   
  @@ -477,7 +473,7 @@
       char s[APREQ_COOKIE_LENGTH];
       int n = apreq_serialize_cookie(s, APREQ_COOKIE_LENGTH, c);
   
  -    if ( n < APREQ_COOKIE_LENGTH )
  +    if (n < APREQ_COOKIE_LENGTH)
           return apr_pstrmemdup(p, s, n);
       else
           return NULL;
  @@ -487,7 +483,6 @@
                                                 void *env)
   {
       char *s = apreq_cookie_as_string(apreq_env_pool(env),c);
  -    dAPREQ_LOG;
   
       if (s == NULL) {
           apreq_log(APREQ_ERROR APR_ENAMETOOLONG, env, 
  @@ -503,7 +498,6 @@
                                                  void *env)
   {
       char *s = apreq_cookie_as_string(apreq_env_pool(env),c);
  -    dAPREQ_LOG;
   
       if ( s == NULL ) {
           apreq_log(APREQ_ERROR APR_ENAMETOOLONG, env,
  @@ -522,7 +516,8 @@
   
   
   
  -/* The functions below belong somewhere else, since they
  +
  +/* XXX: The functions below belong somewhere else, since they
      generally make use of "common conventions" for cookie values. 
      (whereas the cookie specs regard values as opaque) */
   
  
  
  
  1.12      +22 -27    httpd-apreq-2/src/apreq_cookie.h
  
  Index: apreq_cookie.h
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/src/apreq_cookie.h,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- apreq_cookie.h	6 May 2003 02:11:36 -0000	1.11
  +++ apreq_cookie.h	20 May 2003 20:10:59 -0000	1.12
  @@ -1,14 +1,15 @@
   #ifndef APREQ_COOKIE_H
   #define APREQ_COOKIE_H
   
  -#include "apreq_tables.h"
  +#include "apreq.h"
  +#include "apr_tables.h"
   
   #ifdef  __cplusplus
   extern "C" {
   #endif 
   
   typedef struct apreq_jar_t {
  -    apreq_table_t *cookies;
  +    apr_table_t   *cookies;
       apr_pool_t    *pool;
       void          *env;
   } apreq_jar_t;
  @@ -31,8 +32,8 @@
       char           *commentURL;
   
       union {
  -        long        max_age; 
  -        const char *expires; 
  +        apr_int64_t   max_age; 
  +        const char   *expires; 
       } time;
   
       apreq_value_t   v;           /* "raw" value (extended struct) */
  @@ -45,17 +46,8 @@
   #define apreq_cookie_name(c)  ((c)->v.name)
   #define apreq_cookie_value(c) ((c)->v.data)
   
  -
  -/**
  - * Returns the number of cookies in the jar.
  - *
  - * @param jar The cookie jar.
  - * @remark    Shouldn't this be called apreq_jar_nelts?
  - */
  -
  -int apreq_jar_items(apreq_jar_t *jar);
  -#define apreq_jar_items(j) apreq_table_nelts(j->cookies)
  -#define apreq_jar_nelts(j) apreq_table_nelts(j->cookies)
  +#define apreq_jar_items(j) apr_table_nelts(j->cookies)
  +#define apreq_jar_nelts(j) apr_table_nelts(j->cookies)
   
   /**
    * Fetches a cookie from the jar
  @@ -64,9 +56,10 @@
    * @param name  The name of the desired cookie.
    */
   
  -apreq_cookie_t *apreq_cookie(const apreq_jar_t *jar, const char *name);
  +APREQ_DECLARE(apreq_cookie_t *)apreq_cookie(const apreq_jar_t *jar,
  +                                            const char *name);
   #define apreq_cookie(j,k) apreq_value_to_cookie(apreq_char_to_value( \
  -                              apreq_table_get((j)->cookies,k)))
  +                              apr_table_get((j)->cookies,k)))
   
   /**
    * Adds a cookie by pushing it to the bottom of the jar.
  @@ -75,26 +68,28 @@
    * @param c The cookie to add.
    */
   
  -apr_status_t apreq_add_cookie(apreq_jar_t *jar, const apreq_cookie_t *c);
  -#define apreq_add_cookie(jar,c)  apreq_table_add(jar->cookies, &(c)->v)
  +APREQ_DECLARE(void) apreq_add_cookie(apreq_jar_t *jar, 
  +                                     const apreq_cookie_t *c);
  +#define apreq_add_cookie(j,c) apr_table_addn((j)->cookies,\
  +                                            (c)->v.name,(c)->v.data)
   
   /**
    * Parse the incoming "Cookie:" headers into a cookie jar.
    * 
    * @param env The current environment.
  - * @param data  String to parse as a HTTP-merged "Cookie" header.
  - * @remark "data = NULL" has special semantics.  In this case,
  - * apreq_jar_parse will attempt to fetch a cached jar from the
  - * environment ctx via apreq_env_jar.  Failing that, it replace
  - * data with the result of apreq_env_cookie(ctx), parse that,
  - * and store the resulting jar back within the environment.
  - * This Orcish maneuver is designed to mimimize parsing work,
  + * @param hdr  String to parse as a HTTP-merged "Cookie" header.
  + * @remark "data = NULL" has special behavior.  In this case,
  + * apreq_jar(env,NULL) will attempt to fetch a cached object from the
  + * environment via apreq_env_jar.  Failing that, it will replace
  + * "hdr" with the result of apreq_env_cookie(env), parse that,
  + * and store the resulting object back within the environment.
  + * This maneuver is designed to mimimize parsing work,
    * since generating the cookie jar is relatively expensive.
    *
    */
   
   
  -APREQ_DECLARE(apreq_jar_t *) apreq_jar(void *env, const char *data);
  +APREQ_DECLARE(apreq_jar_t *) apreq_jar(void *env, const char *hdr);
   
   /**
    * Returns a new cookie, made from the argument list.
  
  
  
  1.13      +4 -6      httpd-apreq-2/src/apreq_env.h
  
  Index: apreq_env.h
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/src/apreq_env.h,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- apreq_env.h	6 May 2003 02:11:36 -0000	1.12
  +++ apreq_env.h	20 May 2003 20:10:59 -0000	1.13
  @@ -13,10 +13,6 @@
   #endif
   
   
  -#ifdef  __cplusplus
  - extern "C" {
  -#endif 
  -
   #define APREQ_LOG_EMERG     LOG_EMERG     /* system is unusable */
   #define APREQ_LOG_ALERT     LOG_ALERT     /* action must be taken immediately */
   #define APREQ_LOG_CRIT      LOG_CRIT      /* critical conditions */
  @@ -49,7 +45,9 @@
   #define APREQ_WARN   APREQ_LOG_MARK, APREQ_LOG_WARNING,
   #define APREQ_ERROR  APREQ_LOG_MARK, APREQ_LOG_ERR,
   
  -#define dAPREQ_LOG  /* APREQ_LOG(*apreq_log) = APREQ_ENV.log */
  +#ifdef  __cplusplus
  + extern "C" {
  +#endif 
   
   extern const char apreq_env[];
   
  @@ -67,7 +65,7 @@
                                                      apreq_request_t *req);
   
   
  -APREQ_DECLARE(const char *) apreq_env_args(void *env);
  +APREQ_DECLARE(const char *) apreq_env_query_string(void *env);
   APREQ_DECLARE(const char *) apreq_env_header_in(void *env, const char *name);
   
   
  
  
  
  1.16      +65 -66    httpd-apreq-2/src/apreq_params.c
  
  Index: apreq_params.c
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/src/apreq_params.c,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- apreq_params.c	6 May 2003 02:11:36 -0000	1.15
  +++ apreq_params.c	20 May 2003 20:10:59 -0000	1.16
  @@ -67,9 +67,9 @@
   
   APREQ_DECLARE(apreq_param_t *) apreq_make_param(apr_pool_t *p, 
                                                   const char *name, 
  -                                                const apr_ssize_t nlen, 
  +                                                const apr_size_t nlen, 
                                                   const char *val, 
  -                                                const apr_ssize_t vlen)
  +                                                const apr_size_t vlen)
   {
       apreq_param_t *param = apr_palloc(p, nlen + vlen + 1 + sizeof *param);
       apreq_value_t *v = &param->v;
  @@ -89,23 +89,23 @@
       return param;
   }
   
  -APREQ_DECLARE(apreq_request_t *) apreq_request(void *env, const char *args)
  +APREQ_DECLARE(apreq_request_t *) apreq_request(void *env, const char *qs)
   {
       apreq_request_t *req;
       apr_pool_t *p;
       apr_status_t s;
   
  -    if (args == NULL) {
  +    if (qs == NULL) {
           apreq_request_t *old_req = apreq_env_request(env,NULL);
           if (old_req != NULL)
               return old_req;
   
           p = apreq_env_pool(env);
  -        args = apreq_env_args(env);
  +        qs = apreq_env_query_string(env);
   
           req = apr_palloc(p, sizeof *req);
           req->env      = env;
  -        req->args     = apreq_make_table(p, APREQ_NELTS);
  +        req->args     = apr_table_make(p, APREQ_NELTS);
           req->cfg      = NULL;
           req->body     = NULL;
           req->parser   = apreq_parser(env, NULL);
  @@ -126,15 +126,15 @@
   
           req = apr_palloc(p, sizeof *req);
           req->env      = env;
  -        req->args     = apreq_make_table(p, APREQ_NELTS);
  +        req->args     = apr_table_make(p, APREQ_NELTS);
           req->cfg      = NULL;
           req->body     = NULL;
           req->parser   = apreq_parser(env, NULL);
           /* XXX need to install copy/merge callbacks for apreq_param_t */ 
       }
   
  -    s = (args == NULL) ? APR_SUCCESS : 
  -        apreq_split_params(p, req->args, args);
  +    s = (qs == NULL) ? APR_SUCCESS : 
  +        apreq_parse_query_string(p, req->args, qs);
   
       return req;
   }
  @@ -143,20 +143,20 @@
   APREQ_DECLARE(apreq_param_t *)apreq_param(const apreq_request_t *req, 
                                             const char *name)
   {
  -    const char *val = apreq_table_get(req->args, name);
  +    const char *val = apr_table_get(req->args, name);
   
       if (val)
           return UPGRADE(val);
       else if (req->body == NULL)
           return NULL;
   
  -    val = apreq_table_get(req->body, name);
  +    val = apr_table_get(req->body, name);
       if (val == NULL) {
           apreq_cfg_t *cfg = req->cfg;
   
           if (cfg && cfg->read_bytes) {
               apreq_env_read(req->env, APR_NONBLOCK_READ, cfg->read_bytes);
  -            val = apreq_table_get(req->body, name);
  +            val = apr_table_get(req->body, name);
           }
       }
       return val ? UPGRADE(val) : NULL;
  @@ -164,60 +164,11 @@
   
   
   APR_INLINE
  -APREQ_DECLARE(apreq_table_t *) apreq_params(apr_pool_t *pool,
  -                                            const apreq_request_t *req)
  +APREQ_DECLARE(apr_table_t *) apreq_params(apr_pool_t *pool,
  +                                          const apreq_request_t *req)
   {
  -    return req->body ? apreq_table_overlay(pool, req->args, req->body) :
  -        apreq_table_copy(pool, req->args);
  -}
  -
  -
  -APREQ_DECLARE(apr_status_t) apreq_split_params(apr_pool_t *pool,
  -                                               apreq_table_t *t,
  -                                               const char *data)
  -{
  -    const char *start = data;
  -    apr_size_t nlen = 0;
  -    apr_status_t status = APR_SUCCESS;
  -
  -    for (;;++data) {
  -        switch (*data) {
  -
  -        case '=':
  -            if (nlen == 0) {
  -                nlen = data - start;
  -                break;
  -            }
  -            else
  -                return APR_BADARG;
  -
  -        case '&':
  -        case ';': 
  -        case 0:
  -            if (data > start) {
  -                apr_size_t vlen = 0;
  -                if (nlen == 0)
  -                    nlen = data - start;
  -                else
  -                    vlen = data - start - nlen - 1;
  -
  -                status = apreq_table_add(t, p2v(
  -                                apreq_decode_param( pool, start,
  -                                                    nlen, vlen )));
  -
  -                if (status != APR_SUCCESS)
  -                    return status;
  -            }
  -
  -            if (*data == 0)
  -                return status;
  -
  -            nlen = 0;
  -            start = data + 1;
  -            status = APR_INCOMPLETE;
  -        }
  -    }
  -    return status;
  +    return req->body ? apr_table_overlay(pool, req->args, req->body) :
  +        apr_table_copy(pool, req->args);
   }
   
   
  @@ -280,6 +231,54 @@
       return v->data;
   }
   
  +APREQ_DECLARE(apr_status_t) apreq_parse_query_string(apr_pool_t *pool,
  +                                                     apr_table_t *t,
  +                                                     const char *qs)
  +{
  +    const char *start = qs;
  +    apr_size_t nlen = 0;
  +
  +    for (;;++qs) {
  +        switch (*qs) {
  +
  +        case '=':
  +            if (nlen == 0) {
  +                nlen = qs - start;
  +                break;
  +            }
  +            else
  +                return APR_BADCH;
  +
  +        case '&':
  +        case ';': 
  +        case 0:
  +            if (qs > start) {
  +                apr_size_t vlen = 0;
  +                apreq_param_t *param;
  +                if (nlen == 0)
  +                    nlen = qs - start;
  +                else
  +                    vlen = qs - start - nlen - 1;
  +
  +                param = apreq_decode_param(pool, start, nlen, vlen);
  +
  +                if (param)
  +                    apr_table_add(t, param->v.name, param->v.data);
  +                else
  +                    return APR_BADARG;
  +            }
  +
  +            if (*qs == 0)
  +                return APR_SUCCESS;
  +
  +            nlen = 0;
  +            start = qs + 1;
  +        }
  +    }
  +    /* not reached */
  +    return APR_INCOMPLETE;
  +}
  +
   APREQ_DECLARE(apr_status_t) apreq_parse_request(apreq_request_t *req, 
                                                   apr_bucket_brigade *bb)
   {
  @@ -291,7 +290,7 @@
           return APR_EINIT;
   
       if (req->body == NULL)
  -        req->body = apreq_table_make(apreq_env_pool(req->env),APREQ_NELTS);
  +        req->body = apr_table_make(apreq_env_pool(req->env),APREQ_NELTS);
   
       return apreq_run_parser(req->parser, req->cfg, req->body, bb);
   }
  
  
  
  1.13      +25 -16    httpd-apreq-2/src/apreq_params.h
  
  Index: apreq_params.h
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/src/apreq_params.h,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- apreq_params.h	6 May 2003 02:11:36 -0000	1.12
  +++ apreq_params.h	20 May 2003 20:10:59 -0000	1.13
  @@ -59,9 +59,8 @@
   #ifndef APREQ_PARAM_H
   #define APREQ_PARAM_H
   
  -#include "apreq_tables.h"
  +#include "apreq.h"
   #include "apreq_parsers.h"
  -#include "apr_buckets.h"
   
   #ifdef __cplusplus
   extern "C" {
  @@ -78,40 +77,50 @@
   typedef struct apreq_param_t {
       enum { ASCII, UTF_8, UTF_16, ISO_LATIN_1 } charset;
       char                *language;
  -    apreq_table_t       *info;
  +    apr_table_t         *info;
   
       apr_bucket_brigade  *bb;
   
       apreq_value_t        v;
   } apreq_param_t;
   
  -#define apreq_value_to_param(ptr) apreq_attr_to_type(apreq_param_t, \
  -                                                      v, ptr)
  +#define apreq_value_to_param(ptr) apreq_attr_to_type(apreq_param_t, v, ptr)
   #define apreq_param_name(p)  ((p)->v.name)
   #define apreq_param_value(p) ((p)->v.data)
   
   APREQ_DECLARE(apreq_param_t *) apreq_make_param(apr_pool_t *p, 
                                                   const char *name, 
  -                                                const apr_ssize_t nlen, 
  +                                                const apr_size_t nlen, 
                                                   const char *val, 
  -                                                const apr_ssize_t vlen);
  +                                                const apr_size_t vlen);
   
   
   typedef struct apreq_request_t {
  -    apreq_table_t      *args;         /* query_string params */
  -    apreq_table_t      *body;
  +    apr_table_t        *args;         /* query_string */
  +    apr_table_t        *body;         /* post data */
       apreq_parser_t     *parser;
       apreq_cfg_t        *cfg;
       void               *env;
   } apreq_request_t;
   
  +
   /**
    * Creates an apreq_request_t object.
    * @param env The current request environment.
  - * @param args Local query string.
  + * @param qs  The query string.
  + * @remark "qs = NULL" has special behavior.  In this case,
  + * apreq_request(env,NULL) will attempt to fetch a cached object
  + * from the environment via apreq_env_request.  Failing that, it will
  + * replace "qs" with the result of apreq_env_query_string(env), 
  + * parse that, and store the resulting apreq_request_t object back 
  + * within the environment.  This maneuver is designed to both mimimize
  + * parsing work and allow the environent to place the parsed POST data in
  + * req->body (otherwise the caller may need to do this manually).
  + * For details on this, see the environment's documentation for
  + * the apreq_env_read function.
    */
   
  -APREQ_DECLARE(apreq_request_t *)apreq_request(void *env, const char *args);
  +APREQ_DECLARE(apreq_request_t *)apreq_request(void *env, const char *qs);
   
   
   /**
  @@ -137,8 +146,8 @@
    */
   
   APR_INLINE
  -APREQ_DECLARE(apreq_table_t *) apreq_params(apr_pool_t *p,
  -                                            const apreq_request_t *req);
  +APREQ_DECLARE(apr_table_t *) apreq_params(apr_pool_t *p,
  +                                          const apreq_request_t *req);
   
   
   /**
  @@ -153,9 +162,6 @@
    apreq_join(pool, ", ", apreq_params(req,pool,key), mode)
   
   
  -APREQ_DECLARE(apr_status_t)  apreq_split_params(apr_pool_t *pool,
  -                                                apreq_table_t *t, 
  -                                                const char *data);
   
   APREQ_DECLARE(apreq_param_t *) apreq_decode_param(apr_pool_t *pool, 
                                                     const char *word,
  @@ -165,6 +171,9 @@
   APREQ_DECLARE(char *) apreq_encode_param(apr_pool_t *pool, 
                                            const apreq_param_t *param);
   
  +APREQ_DECLARE(apr_status_t) apreq_parse_query_string(apr_pool_t *pool,
  +                                                     apr_table_t *t, 
  +                                                     const char *qs);
   
   APREQ_DECLARE(apr_status_t)apreq_parse_request(apreq_request_t *req, 
                                                  apr_bucket_brigade *bb);
  
  
  
  1.24      +33 -23    httpd-apreq-2/src/apreq_parsers.c
  
  Index: apreq_parsers.c
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/src/apreq_parsers.c,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- apreq_parsers.c	6 May 2003 19:34:19 -0000	1.23
  +++ apreq_parsers.c	20 May 2003 20:10:59 -0000	1.24
  @@ -74,17 +74,21 @@
   #define CRLF    "\015\012"
   #endif
   
  +#ifndef apr_table_pool
  +#define apr_table_pool(t) ((apr_array_header_t *)(t))->pool
  +#endif
   
   APREQ_DECLARE(apreq_parser_t *) apreq_make_parser(apr_pool_t *pool,
                                                     const char *type,
                                                     APREQ_DECLARE_PARSER(*parser),
  -                                                  apreq_hook_t *hook)
  +                                                  apreq_hook_t *hook,
  +                                                  void *ctx)
   {
       apreq_parser_t *p = apr_palloc(pool, APREQ_CTX_MAXSIZE + sizeof *p);
  -    p->name = apr_pstrdup(pool,type);
  +    p->content_type = apr_pstrdup(pool,type);
       p->parser = parser;
       p->hook = hook;
  -
  +    p->ctx = ctx;
       return p;
   }
   APREQ_DECLARE(apreq_hook_t *) apreq_make_hook(apr_pool_t *pool,
  @@ -125,10 +129,12 @@
           return NULL;
   
       if (!strncasecmp(type, APREQ_URL_ENCTYPE,strlen(APREQ_URL_ENCTYPE)))
  -        return apreq_make_parser(pool, type, apreq_parse_urlencoded, hook);
  +        return apreq_make_parser(pool, type, 
  +                                 apreq_parse_urlencoded, hook, NULL);
   
       else if (!strncasecmp(type,APREQ_MFD_ENCTYPE,strlen(APREQ_MFD_ENCTYPE)))
  -        return apreq_make_parser(pool, type, apreq_parse_multipart, hook);
  +        return apreq_make_parser(pool, type, 
  +                                 apreq_parse_multipart, hook, NULL);
   
       else
           return NULL;
  @@ -139,12 +145,12 @@
   
   /******************** application/x-www-form-urlencoded ********************/
   
  -static apr_status_t split_urlword(apreq_table_t *t,
  +static apr_status_t split_urlword(apr_table_t *t,
                                     apr_bucket_brigade *bb, 
                                     const apr_size_t nlen,
                                     const apr_size_t vlen)
   {
  -    apr_pool_t *pool = apreq_table_pool(t);
  +    apr_pool_t *pool = apr_table_pool(t);
       apreq_param_t *param = apr_palloc(pool, nlen + vlen + 1 + sizeof *param);
       apr_size_t total, off;
       apreq_value_t *v = &param->v;
  @@ -222,7 +228,7 @@
   
       v->data[off] = 0;
       v->size = off;
  -    apreq_table_add(t, v);
  +    apr_table_addn(t, v->name, v->data);
       return v->status = APR_SUCCESS;
   }
   
  @@ -232,7 +238,7 @@
   
   APREQ_DECLARE_PARSER(apreq_parse_urlencoded)
   {
  -    apr_pool_t *pool = apreq_table_pool(t);
  +    apr_pool_t *pool = apr_table_pool(t);
       apr_ssize_t nlen, vlen;
       apr_bucket *e;
       struct url_ctx *ctx;
  @@ -306,7 +312,7 @@
   /********************* header parsing utils ********************/
   
   
  -static apr_status_t split_header(apr_pool_t *pool, apreq_table_t *t, 
  +static apr_status_t split_header(apr_pool_t *pool, apr_table_t *t, 
                                    apr_bucket_brigade *bb,
                                    const apr_size_t nlen, 
                                    const apr_size_t glen,
  @@ -392,7 +398,7 @@
   
       v->data[v->size] = 0;
   
  -    apreq_table_add(t, v);
  +    apr_table_addn(t, v->name, v->data);
       return APR_SUCCESS;
   
   }
  @@ -403,7 +409,7 @@
   
   APREQ_DECLARE_PARSER(apreq_parse_headers)
   {
  -    apr_pool_t *pool = apreq_table_pool(t);
  +    apr_pool_t *pool = apr_table_pool(t);
       apr_ssize_t nlen, glen, vlen;
       apr_bucket *e;
       struct hdr_ctx *ctx;
  @@ -584,7 +590,7 @@
   
   struct mfd_ctx {
       void                        *hook_data;
  -    apreq_table_t               *info;
  +    apr_table_t                 *info;
       apr_bucket_brigade          *bb;
       apreq_parser_t              *hdr_parser;
       const apr_strmatch_pattern  *pattern;
  @@ -755,7 +761,7 @@
   
   APREQ_DECLARE_PARSER(apreq_parse_multipart)
   {
  -    apr_pool_t *pool = apreq_table_pool(t);
  +    apr_pool_t *pool = apr_table_pool(t);
       struct mfd_ctx *ctx = parser->ctx;
   
   #define MFD_INIT     0
  @@ -772,7 +778,7 @@
   
           ctx = apr_pcalloc(pool, sizeof *ctx);
   
  -        ct = strchr(parser->name, ';');
  +        ct = strchr(parser->content_type, ';');
           if (ct == NULL) {
               return APR_EINIT;
           }
  @@ -790,7 +796,8 @@
   
           ctx->bdry[4 + blen] = 0;
           ctx->pattern = apr_strmatch_precompile(pool,ctx->bdry,1);
  -        ctx->hdr_parser = apreq_make_parser(pool,"",apreq_parse_headers,NULL);
  +        ctx->hdr_parser = apreq_make_parser(pool,"",apreq_parse_headers,
  +                                            NULL,NULL);
           ctx->info = NULL;
   
           if (ctx->bb == NULL)
  @@ -838,7 +845,7 @@
               apr_size_t nlen, flen;
   
               if (ctx->info == NULL)
  -                ctx->info = apreq_make_table(pool, APREQ_NELTS);
  +                ctx->info = apr_table_make(pool, APREQ_NELTS);
   
               s = apreq_run_parser(ctx->hdr_parser, cfg, ctx->info, bb);
   
  @@ -849,7 +856,7 @@
                       printf("header parser failed: %d\n", s);
                       return s;
                   }
  -            cd = apreq_table_get(ctx->info, "Content-Disposition");
  +            cd = apr_table_get(ctx->info, "Content-Disposition");
   
               if (cd == NULL) {
                   ctx->status = MFD_ERROR;
  @@ -880,7 +887,7 @@
                   param->bb = apr_brigade_create(pool, 
                                                  apr_bucket_alloc_create(pool));
   
  -                apreq_table_add(t, &param->v);
  +                apr_table_addn(t, param->v.name, param->v.data);
                   ctx->status = MFD_UPLOAD;
               }
           }
  @@ -925,7 +932,7 @@
                   apr_brigade_flatten(ctx->bb, v->data, &len);
                   v->size = len;
                   v->data[v->size] = 0;
  -                apreq_table_add(t, v);
  +                apr_table_addn(t, v->name, v->data);
                   ctx->status = MFD_NEXTLINE;
                   goto mfd_parse_brigade;
   
  @@ -945,11 +952,14 @@
                                              ctx->pattern, ctx->bdry);
               apreq_param_t *param;
               const apr_array_header_t *arr;
  +            apr_table_entry_t *e;
   
  -            arr = apreq_table_elts(t);
  -            param = apreq_value_to_param(*(apreq_value_t **)
  +            arr = apr_table_elts(t);
  +            e = (apr_table_entry_t *)arr->elts;
  +            param = apreq_value_to_param(apreq_strtoval(e[arr->nelts-1].val));
  +/*            param = apreq_value_to_param(*(apreq_value_t **)
                          (arr->elts + (arr->elt_size * (arr->nelts-1))));
  -
  +*/
               switch (s) {
   
               case APR_INCOMPLETE:
  
  
  
  1.11      +17 -21    httpd-apreq-2/src/apreq_parsers.h
  
  Index: apreq_parsers.h
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/src/apreq_parsers.h,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- apreq_parsers.h	6 May 2003 19:34:19 -0000	1.10
  +++ apreq_parsers.h	20 May 2003 20:10:59 -0000	1.11
  @@ -1,7 +1,8 @@
   #ifndef APREQ_PARSERS_H
   #define APREQ_PARSERS_H
   
  -#include "apreq_tables.h"
  +#include "apreq.h"
  +#include "apr_tables.h"
   #include "apr_buckets.h"
   
   #ifdef  __cplusplus
  @@ -22,16 +23,16 @@
   } apreq_cfg_t;
   
   
  -#define APREQ_DECLARE_PARSER(f) apr_status_t(f)(apreq_parser_t *parser, \
  -                                        const apreq_cfg_t *cfg,         \
  -                                        apreq_table_t *t,               \
  -                                        apr_bucket_brigade *bb)
  -
  -#define APREQ_DECLARE_HOOK(f) apr_status_t(f)(apreq_hook_t *hook,   \
  -                                      apr_pool_t *pool,             \
  -                                      const apreq_cfg_t *cfg,       \
  -                                      apr_bucket_brigade *out,      \
  -                                      apr_bucket_brigade *in)
  +#define APREQ_DECLARE_PARSER(f) apr_status_t (f)(apreq_parser_t *parser, \
  +                                         const apreq_cfg_t *cfg,         \
  +                                         apr_table_t *t,                 \
  +                                         apr_bucket_brigade *bb)
  +
  +#define APREQ_DECLARE_HOOK(f) apr_status_t (f)(apreq_hook_t *hook,   \
  +                                       apr_pool_t *pool,             \
  +                                       const apreq_cfg_t *cfg,       \
  +                                       apr_bucket_brigade *out,      \
  +                                       apr_bucket_brigade *in)
   
   #define APREQ_CTX_MAXSIZE  128
   #define apreq_run_parser(psr,cfg,t,bb) psr->parser(psr,cfg,t,bb)
  @@ -48,7 +49,7 @@
   
   struct apreq_parser_t {
       APREQ_DECLARE_PARSER  (*parser);
  -    const char             *name;
  +    const char             *content_type;
       apreq_hook_t           *hook;
       void                   *ctx;
   };
  @@ -61,21 +62,16 @@
   APREQ_DECLARE(apreq_parser_t *) apreq_make_parser(apr_pool_t *pool,
                                                     const char *enctype,
                                                     APREQ_DECLARE_PARSER(*parser),
  -                                                  apreq_hook_t *hook);
  -
  -APREQ_DECLARE(apr_status_t)apreq_add_hook(apreq_parser_t *p, 
  -                                          apreq_hook_t *h);
  +                                                  apreq_hook_t *hook,
  +                                                  void *ctx);
   
   APREQ_DECLARE(apreq_hook_t *) apreq_make_hook(apr_pool_t *pool,
                                                 APREQ_DECLARE_HOOK(*hook),
                                                 apreq_hook_t *next,
                                                 void *ctx);
   
  -APREQ_DECLARE(apr_status_t) apreq_copy_parser(apr_pool_t *p, 
  -                                              const apreq_value_t *v);
  -
  -APREQ_DECLARE(apr_status_t) apreq_merge_parsers(apr_pool_t *p,
  -                                                const apr_array_header_t *a);
  +APREQ_DECLARE(apr_status_t)apreq_add_hook(apreq_parser_t *p, 
  +                                          apreq_hook_t *h);
   
   APREQ_DECLARE(apreq_parser_t *)apreq_parser(void *env, apreq_hook_t *hook);
   
  
  
  
  1.31      +5 -5      httpd-apreq-2/src/apreq_tables.c
  
  Index: apreq_tables.c
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/src/apreq_tables.c,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- apreq_tables.c	6 May 2003 19:34:19 -0000	1.30
  +++ apreq_tables.c	20 May 2003 20:10:59 -0000	1.31
  @@ -542,9 +542,9 @@
   }
   
   APREQ_DECLARE(apreq_table_t *)apreq_table_import(apr_pool_t *p, 
  -                                                 const apr_table_t *s) 
  +                                                 apr_table_t *s) 
   {
  -    apreq_table_t *t = apreq_table_make(p,APREQ_NELTS);
  +    apreq_table_t *t = apreq_table_make(p, APREQ_NELTS);
       const apr_array_header_t *a = apr_table_elts(s);
       const apr_table_entry_t *e = (const apr_table_entry_t *)a->elts;
       const apr_table_entry_t *end = e + a->nelts;
  @@ -555,7 +555,7 @@
                                               e->val, e->val ? 
                                                       strlen(e->val) :
                                                       0);
  -        apreq_table_add(t, v);
  +        apreq_table_addv(t, v);
       }
       return t;
   }
  @@ -855,8 +855,8 @@
   }
   
   
  -APREQ_DECLARE(apr_status_t) apreq_table_add(apreq_table_t *t, 
  -                                            const apreq_value_t *val)
  +APREQ_DECLARE(apr_status_t) apreq_table_addv(apreq_table_t *t, 
  +                                             const apreq_value_t *val)
   {
       const char *key = val->name;
       apreq_table_entry_t *elt = table_push(t);
  
  
  
  1.18      +3 -3      httpd-apreq-2/src/apreq_tables.h
  
  Index: apreq_tables.h
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/src/apreq_tables.h,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- apreq_tables.h	6 May 2003 02:11:36 -0000	1.17
  +++ apreq_tables.h	20 May 2003 20:10:59 -0000	1.18
  @@ -126,7 +126,7 @@
    * @param t The APR table to copy
    */
   APREQ_DECLARE(apreq_table_t *)apreq_table_import(apr_pool_t *p, 
  -                                                 const apr_table_t *t);
  +                                                 apr_table_t *t);
   
   /**
    * Delete all of the elements from a table
  @@ -263,8 +263,8 @@
    * @param val The value to add.
    * @remark This function does not make copies.
    */
  -APREQ_DECLARE(apr_status_t) apreq_table_add(apreq_table_t *t, 
  -                                            const apreq_value_t *v);
  +APREQ_DECLARE(apr_status_t) apreq_table_addv(apreq_table_t *t,
  +                                             const apreq_value_t *v);
   
   /**
    * Merge two tables into one new table
  
  
  

Mime
View raw message