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.h apreq_params.h apreq_parsers.c apreq_version.h
Date Mon, 21 Jun 2004 17:49:18 GMT
joes        2004/06/21 10:49:18

  Modified:    src      apreq.c apreq.h apreq_cookie.h apreq_params.h
                        apreq_parsers.c apreq_version.h
  Log:
  Namespace-protect remaining globals (mainly enums), and start a series of doxygen fixes.
  
  Revision  Changes    Path
  1.38      +11 -10    httpd-apreq-2/src/apreq.c
  
  Index: apreq.c
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/src/apreq.c,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- apreq.c	15 Jun 2004 07:55:15 -0000	1.37
  +++ apreq.c	21 Jun 2004 17:49:18 -0000	1.38
  @@ -67,7 +67,8 @@
                                      const apr_array_header_t *arr)
   {
       apreq_value_t *a = *(apreq_value_t **)(arr->elts);
  -    apreq_value_t *v = apreq_char_to_value( apreq_join(p, ", ", arr, AS_IS) );
  +    apreq_value_t *v = apreq_char_to_value( 
  +        apreq_join(p, ", ", arr, APREQ_JOIN_AS_IS) );
       if (arr->nelts > 0)
           v->name = a->name;
       return v;
  @@ -97,7 +98,7 @@
   {
       apr_time_t when;
       apr_time_exp_t tms;
  -    char sep = (type == HTTP) ? ' ' : '-';
  +    char sep = (type == APREQ_EXPIRES_HTTP) ? ' ' : '-';
   
       if (time_str == NULL) {
   	return NULL;
  @@ -196,7 +197,7 @@
   
   	/* done if matches up to capacity of buffer */
   	if ( memcmp(hay, ndl, MIN(nlen, len)) == 0 ) {
  -            if (type == FULL && len < nlen)
  +            if (type == APREQ_MATCH_FULL && len < nlen)
                   hay = NULL;     /* insufficient room for match */
   	    break;
           }
  @@ -220,7 +221,7 @@
   
   	/* done if matches up to capacity of buffer */
   	if ( memcmp(hay, ndl, MIN(nlen, len)) == 0 ) {
  -            if (type == FULL && len < nlen)
  +            if (type == APREQ_MATCH_FULL && len < nlen)
                   hay = NULL;     /* insufficient room for match */
   	    break;
           }
  @@ -478,10 +479,10 @@
       /* Allocated the required space */
   
       switch (mode) {
  -    case ENCODE:
  +    case APREQ_JOIN_ENCODE:
           len += 2 * len;
           break;
  -    case QUOTE:
  +    case APREQ_JOIN_QUOTE:
           len = 2 * (len + n);
           break;
       default:
  @@ -504,7 +505,7 @@
   
       switch (mode) {
   
  -    case ENCODE:
  +    case APREQ_JOIN_ENCODE:
           d += apreq_encode(d, a[0]->data, a[0]->size);
   
           for (j = 1; j < n; ++j) {
  @@ -514,7 +515,7 @@
           }
           break;
   
  -    case DECODE:
  +    case APREQ_JOIN_DECODE:
           len = apreq_decode(d, a[0]->data, a[0]->size);
   
           if (len < 0) {
  @@ -540,7 +541,7 @@
           break;
   
   
  -    case QUOTE:
  +    case APREQ_JOIN_QUOTE:
   
           d += apreq_quote_once(d, a[0]->data, a[0]->size);
   
  @@ -552,7 +553,7 @@
           break;
   
   
  -    case AS_IS:
  +    case APREQ_JOIN_AS_IS:
           memcpy(d,a[0]->data,a[0]->size);
           d += a[0]->size;
   
  
  
  
  1.42      +26 -40    httpd-apreq-2/src/apreq.h
  
  Index: apreq.h
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/src/apreq.h,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- apreq.h	19 Jun 2004 20:03:59 -0000	1.41
  +++ apreq.h	21 Jun 2004 17:49:18 -0000	1.42
  @@ -41,33 +41,17 @@
    * @verbinclude LICENSE
    */
   /** 
  - * @page INSTALL 
  - * @verbinclude INSTALL
  + * @page NOTICE
  + * @verbinclude NOTICE
    */
   /** 
  - * @page FAQ
  - * @include FAQ
  + * @page INSTALL 
  + * @verbinclude INSTALL
    */
   /**
    * @defgroup XS Perl
    * @ingroup GLUE
    */
  -/**
  - * @defgroup TCL TCL
  - * @ingroup GLUE
  - */
  -/**
  - * @defgroup PYTHON Python
  - * @ingroup GLUE
  - */
  -/**
  - * @defgroup PHP PHP
  - * @ingroup GLUE
  - */
  -/**
  - * @defgroup RUBY Ruby
  - * @ingroup GLUE
  - */
   /** 
    * @defgroup XS_Request Apache::Request
    * @ingroup XS
  @@ -83,7 +67,6 @@
    * @ingroup XS
    * @htmlinclude Cookie.html
    */
  -
   /**
    * The objects in apreq.h are used in various contexts:
    *
  @@ -97,7 +80,7 @@
    */
   /**
    * @defgroup Utils Common functions, structures and macros
  - * @ingroup LIBRARY
  + * @ingroup libapreq2
    * @{
    */
   
  @@ -199,19 +182,20 @@
   
   /** @enum apreq_join_t Join type */
   typedef enum { 
  -    AS_IS,      /**< Join the strings without modification */
  -    ENCODE,     /**< Url-encode the strings before joining them */
  -    DECODE,     /**< Url-decode the strings before joining them */
  -    QUOTE       /**< Quote the strings, backslashing existing quote marks. */
  +    APREQ_JOIN_AS_IS,      /**< Join the strings without modification */
  +    APREQ_JOIN_ENCODE,     /**< Url-encode the strings before joining them */
  +    APREQ_JOIN_DECODE,     /**< Url-decode the strings before joining them */
  +    APREQ_JOIN_QUOTE       /**< Quote the strings, backslashing existing quote marks.
*/
   } apreq_join_t;
   
   /**
    * Join an array of values.
  - * @param p   Pool to allocate return value.
  - * @param sep String that is inserted between the joined values.
  - * @param arr Array of values.
  - * @remark    Return string can be upgraded to an apreq_value_t 
  - *            with apreq_stroval.
  + * @param p    Pool to allocate return value.
  + * @param sep  String that is inserted between the joined values.
  + * @param arr  Array of values.
  + * @param mode Join type- see apreq_join_t.
  + * @remark     Return string can be upgraded to an apreq_value_t 
  + *             with apreq_stroval.
    */
   APREQ_DECLARE(const char *) apreq_join(apr_pool_t *p, 
                                          const char *sep, 
  @@ -221,8 +205,8 @@
   
   /** @enum apreq_match_t Match type */
   typedef enum {
  -    FULL,       /**< Full match only. */
  -    PARTIAL     /**< Partial matches are ok. */
  +    APREQ_MATCH_FULL,       /**< Full match only. */
  +    APREQ_MATCH_PARTIAL     /**< Partial matches are ok. */
   } apreq_match_t;
   
   /**
  @@ -323,21 +307,23 @@
   
   /** @enum apreq_expires_t Expiration date format */
   typedef enum {
  -    HTTP,       /**< Use date formatting consistent with RFC 2616 */
  -    NSCOOKIE    /**< Use format consistent with Netscape's Cookie Spec */
  +    APREQ_EXPIRES_HTTP,       /**< Use date formatting consistent with RFC 2616 */
  +    APREQ_EXPIRES_NSCOOKIE    /**< Use format consistent with Netscape's Cookie Spec
*/
   } apreq_expires_t;
   
   /**
    * Returns an RFC-822 formatted time string. Similar to ap_gm_timestr_822.
    *
  - * @param req       The current apreq_request_t object.
  + * @param p       Pool to allocate return string.
    * @param time_str  YMDhms time units (from now) until expiry.
    *                  Understands "now".
  - * @param  type     ::HTTP for RFC822 dates, ::NSCOOKIE for cookie dates.
  + * @param  type     ::APREQ_EXPIRES_HTTP for RFC822 dates,
  + *                  ::APREQ_EXPIRES_NSCOOKIE for Netscape cookie dates.
    * @return      Date string, (time_str is offset from "now") formatted
  - *              either as an ::NSCOOKIE or ::HTTP date
  - * @deprecated  Use apr_rfc822_date instead.  ::NSCOOKIE strings are formatted
  - *              with a '-' (instead of a ' ') character at offsets 7 and 11.
  + *              according to type.
  + * @deprecated  Use apr_rfc822_date instead.  ::APREQ_EXPIRES_NSCOOKIE strings
  + *              are formatted with a '-' (instead of a ' ') character at
  + *              offsets 7 and 11.
    */
   
   APREQ_DECLARE(char *) apreq_expires(apr_pool_t *p, const char *time_str, 
  
  
  
  1.23      +3 -3      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.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- apreq_cookie.h	9 Jun 2004 21:02:05 -0000	1.22
  +++ apreq_cookie.h	21 Jun 2004 17:49:18 -0000	1.23
  @@ -206,16 +206,16 @@
    * Add the cookie to the outgoing "Set-Cookie" headers.
    *
    * @param c The cookie.
  + * @param env Environment.
    */
  -APREQ_DECLARE(apr_status_t) apreq_cookie_bake(const apreq_cookie_t *c, 
  +APREQ_DECLARE(apr_status_t) apreq_cookie_bake(const apreq_cookie_t *c,
                                                 void *env);
   
  -/* XXX: how about baking whole cookie jars, too ??? */
  -
   /**
    * Add the cookie to the outgoing "Set-Cookie2" headers.
    *
    * @param c The cookie.
  + * @param env Environment.
    */
   APREQ_DECLARE(apr_status_t) apreq_cookie_bake2(const apreq_cookie_t *c,
                                                  void *env);
  
  
  
  1.31      +7 -5      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.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- apreq_params.h	19 Jun 2004 20:03:59 -0000	1.30
  +++ apreq_params.h	21 Jun 2004 17:49:18 -0000	1.31
  @@ -91,11 +91,12 @@
   
   
   /**
  - * Returns the first parameter value for the requested key,
  - * NULL if none found. The key is case-insensitive.
  + * Returns the first parameter value with the desired name,
  + * NULL if none found. The name is case-insensitive.
    * @param req The current apreq_request_t object.
  - * @param key Nul-terminated search key.  Returns the first table value 
  + * @param name Nul-terminated search key.  Returns the first table value 
    * if NULL.
  + * @return First matching parameter.
    * @remark Also parses the request as necessary.
    */
   APREQ_DECLARE(apreq_param_t *) apreq_param(const apreq_request_t *req, 
  @@ -171,7 +172,7 @@
   /**
    * Parse a url-encoded string into a param table.
    * @param pool    pool used to allocate the param data.
  - * @param table   table to which the params are added.
  + * @param t       table to which the params are added.
    * @param qs      Query string to url-decode.
    * @return        APR_SUCCESS if successful, error otherwise.
    * @remark        This function uses [&;] as the set of tokens
  @@ -346,7 +347,7 @@
   /**
    * Construct a hook.
    *
  - * @param Pool used to allocate the hook.
  + * @param pool used to allocate the hook.
    * @param hook The hook function.
    * @param next List of other hooks for this hook to call on.
    * @param ctx Hook's internal scratch pad.
  @@ -357,6 +358,7 @@
                           apr_status_t (*hook) APREQ_HOOK_ARGS,
                           apreq_hook_t *next,
                           void *ctx);
  +
   
   /**
    * Add a new hook to the end of the parser's hook list.
  
  
  
  1.49      +3 -2      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.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- apreq_parsers.c	19 Jun 2004 20:03:59 -0000	1.48
  +++ apreq_parsers.c	21 Jun 2004 17:49:18 -0000	1.49
  @@ -702,13 +702,14 @@
               if (match != NULL)
                   idx = match - buf;
               else {
  -                idx = apreq_index(buf + len-blen, blen, bdry, blen, PARTIAL);
  +                idx = apreq_index(buf + len-blen, blen, bdry, blen, 
  +                                  APREQ_MATCH_PARTIAL);
                   if (idx >= 0)
                       idx += len-blen;
               }
           }
           else
  -            idx = apreq_index(buf, len, bdry, blen, PARTIAL);
  +            idx = apreq_index(buf, len, bdry, blen, APREQ_MATCH_PARTIAL);
   
           if (idx > 0)
               apr_bucket_split(e, idx);
  
  
  
  1.14      +1 -1      httpd-apreq-2/src/apreq_version.h
  
  Index: apreq_version.h
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/src/apreq_version.h,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- apreq_version.h	19 Jun 2004 20:03:59 -0000	1.13
  +++ apreq_version.h	21 Jun 2004 17:49:18 -0000	1.14
  @@ -60,7 +60,7 @@
   #define APREQ_MINOR_VERSION       0
   
   /** patch level */
  -#define APREQ_PATCH_VERSION      10
  +#define APREQ_PATCH_VERSION      11
   
   /** 
    *  This symbol is defined for internal, "development" copies of libapreq.
  
  
  

Mime
View raw message