httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@locus.apache.org
Subject cvs commit: apache-2.0/src/lib/apr/include apr_pools.h apr_tables.h
Date Wed, 05 Jul 2000 20:22:33 GMT
rbb         00/07/05 13:22:30

  Modified:    src/lib/apr/include apr_pools.h apr_tables.h
  Log:
  Clean up apr_pools.h.  This basically moves a lot of comments from the
  top of apr_pools.h to other headers where they belong.  Now, comments
  for a function are near the function they document.  Also, remove some
  duplicated definitions.
  
  Revision  Changes    Path
  1.21      +31 -55    apache-2.0/src/lib/apr/include/apr_pools.h
  
  Index: apr_pools.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_pools.h,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- apr_pools.h	2000/07/05 19:17:52	1.20
  +++ apr_pools.h	2000/07/05 20:22:24	1.21
  @@ -104,11 +104,8 @@
       struct process_chain *next;
   };
   
  -ap_status_t ap_init_alloc(void);	/* Set up everything */
  -void        ap_term_alloc(void);        /* Tear down everything */
  -
  -/* used to guarantee to the ap_pool_t debugging code that the sub ap_pool_t will not be
  - * destroyed before the parent pool
  +/* used to guarantee to the ap_pool_t debugging code that the sub ap_pool_t 
  + * will not be destroyed before the parent pool
    */
   #ifndef POOL_DEBUG
   APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts);
  @@ -117,56 +114,6 @@
   APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, int (apr_abort)(int retcode));
   #endif /* POOL_DEBUG */
   
  -
  -/* Clearing out EVERYTHING in an pool... destroys any sub-pools */
  -
  -/* Preparing for exec() --- close files, etc., but *don't* flush I/O
  - * buffers, *don't* wait for subprocesses, and *don't* free any memory.
  - */
  -
  -/* array and alist management... keeping lists of things.
  - * Common enough to want common support code ...
  - */
  -
  -/* ap_array_pstrcat generates a new string from the ap_pool_t containing
  - * the concatenated sequence of substrings referenced as elements within
  - * the array.  The string will be empty if all substrings are empty or null,
  - * or if there are no elements in the array.
  - * If sep is non-NUL, it will be inserted between elements as a separator.
  - */
  -
  -/* copy_array copies the *entire* array.  copy_array_hdr just copies
  - * the header, and arranges for the elements to be copied if (and only
  - * if) the code subsequently does a push or arraycat.
  - */
  -
  -
  -
  -/* Conceptually, ap_overlap_tables does this:
  -
  -    ap_array_header_t *barr = ap_table_elts(b);
  -    ap_table_entry_t *belt = (ap_table_entry_t *)barr->elts;
  -    int i;
  -
  -    for (i = 0; i < barr->nelts; ++i) {
  -	if (flags & ap_OVERLAP_TABLES_MERGE) {
  -	    ap_table_mergen(a, belt[i].key, belt[i].val);
  -	}
  -	else {
  -	    ap_table_setn(a, belt[i].key, belt[i].val);
  -	}
  -    }
  -
  -    Except that it is more efficient (less space and cpu-time) especially
  -    when b has many elements.
  -
  -    Notice the assumptions on the keys and values in b -- they must be
  -    in an ancestor of a's pool.  In practice b and a are usually from
  -    the same pool.
  -*/
  -#define ap_OVERLAP_TABLES_SET	(0)
  -#define ap_OVERLAP_TABLES_MERGE	(1)
  -
   #ifdef ULTRIX_BRAIN_DEATH
   #define ap_fdopen(d,m) fdopen((d), (char *)(m))
   #else
  @@ -186,8 +133,34 @@
   /*
    * APR memory structure manipulators (pools, tables, and arrays).
    */
  +
   /*
   
  +=head1 ap_status_t ap_init_alloc(void)
  +
  +B<Setup all of the internal structures required to use pools>
  +
  +B<NOTE>:  Programs do B<NOT> need to call this directly.  APR will call this
  +          automatically from ap_initialize. 
  +=cut
  + */
  +ap_status_t ap_init_alloc(void);	/* Set up everything */
  +
  +/*
  +
  +=head1 void ap_term_alloc(void)
  +
  +B<Tear down all of the internal structures required to use pools>
  +
  +B<NOTE>:  Programs do B<NOT> need to call this directly.  APR will call this
  +          automatically from ap_terminate. 
  +
  +=cut
  + */
  +void        ap_term_alloc(void);        /* Tear down everything */
  +
  +/*
  +
   =head1 ap_pool_t *ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retcode))
   
   B<make a sub pool from the current pool>
  @@ -428,6 +401,9 @@
   B<Run all of the child_cleanups, so that any unnecessary files are closed because we
are about to exec a new program>
   
   =cut
  + */
  +/* Preparing for exec() --- close files, etc., but *don't* flush I/O
  + * buffers, *don't* wait for subprocesses, and *don't* free any memory.
    */
   APR_EXPORT(void) ap_cleanup_for_exec(void);
   APR_EXPORT(ap_status_t) ap_getpass(const char *prompt, char *pwbuf, size_t *bufsize);
  
  
  
  1.3       +35 -0     apache-2.0/src/lib/apr/include/apr_tables.h
  
  Index: apr_tables.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_tables.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- apr_tables.h	2000/06/12 20:45:26	1.2
  +++ apr_tables.h	2000/07/05 20:22:25	1.3
  @@ -120,6 +120,11 @@
   APR_EXPORT(void *) ap_push_array(ap_array_header_t *arr);
   APR_EXPORT(void) ap_array_cat(ap_array_header_t *dst,
   			       const ap_array_header_t *src);
  +
  +/* copy_array copies the *entire* array.  copy_array_hdr just copies
  + * the header, and arranges for the elements to be copied if (and only
  + * if) the code subsequently does a push or arraycat.
  + */
   APR_EXPORT(ap_array_header_t *) ap_copy_array(struct ap_pool_t *p,
   						const ap_array_header_t *arr);
   APR_EXPORT(ap_array_header_t *)
  @@ -129,6 +134,13 @@
   	ap_append_arrays(struct ap_pool_t *p,
   			  const ap_array_header_t *first,
   			  const ap_array_header_t *second);
  +
  +/* ap_array_pstrcat generates a new string from the ap_pool_t containing
  + * the concatenated sequence of substrings referenced as elements within
  + * the array.  The string will be empty if all substrings are empty or null,
  + * or if there are no elements in the array.
  + * If sep is non-NUL, it will be inserted between elements as a separator.
  + */
   APR_EXPORT(char *) ap_array_pstrcat(struct ap_pool_t *p,
   				     const ap_array_header_t *arr,
   				     const char sep);
  @@ -158,6 +170,29 @@
   APR_EXPORT(void)
           ap_table_vdo(int (*comp) (void *, const char *, const char *),
                        void *rec, const ap_table_t *t, va_list);                  
  +
  +/* Conceptually, ap_overlap_tables does this:
  +
  +    ap_array_header_t *barr = ap_table_elts(b);
  +    ap_table_entry_t *belt = (ap_table_entry_t *)barr->elts;
  +    int i;
  +
  +    for (i = 0; i < barr->nelts; ++i) {
  +        if (flags & ap_OVERLAP_TABLES_MERGE) {
  +            ap_table_mergen(a, belt[i].key, belt[i].val);
  +        }
  +        else {
  +            ap_table_setn(a, belt[i].key, belt[i].val);
  +        }
  +    }
  +
  +    Except that it is more efficient (less space and cpu-time) especially
  +    when b has many elements.
  +
  +    Notice the assumptions on the keys and values in b -- they must be
  +    in an ancestor of a's pool.  In practice b and a are usually from
  +    the same pool.
  +*/
   #define AP_OVERLAP_TABLES_SET   (0)
   #define AP_OVERLAP_TABLES_MERGE (1)
   APR_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b,
  
  
  

Mime
View raw message