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/buckets ap_buf.c ap_eos_buf.c ap_mmap_buf.c ap_rmem_buf.c ap_rwmem_buf.c apr_buf.h
Date Thu, 20 Jul 2000 16:14:33 GMT
rbb         00/07/20 09:14:31

  Modified:    src/lib/apr/buckets ap_buf.c ap_eos_buf.c ap_mmap_buf.c
                        ap_rmem_buf.c ap_rwmem_buf.c apr_buf.h
  Log:
  Remove the ap_bucket_new function.  This was basically a case statement
  around a couple of other functions.  This keeps people from implementing
  their own bucket types and plugging them into the server.  With this change
  buckets are created by ap_bucket_foo_create, and modified/used with the
  function pointers.
  
  Revision  Changes    Path
  1.15      +2 -27     apache-2.0/src/lib/apr/buckets/ap_buf.c
  
  Index: ap_buf.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/buckets/ap_buf.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- ap_buf.c	2000/07/18 00:32:31	1.14
  +++ ap_buf.c	2000/07/20 16:14:24	1.15
  @@ -63,31 +63,6 @@
   #include <sys/uio.h>
   #include "apr_buf.h"
   
  -/* We are creating a new bucket here.  The buckets that are created
  - * have the correct function pointers and types when they are created. 
  - */
  -APR_EXPORT(ap_bucket *) ap_bucket_new(ap_bucket_color_e color)
  -{
  -    /* TODO: keep a free list of ap_bufels... and allocate them in big chunks */
  -    switch (color) {
  -        case AP_BUCKET_rwmem:
  -            return ap_rwmem_create();
  -        case AP_BUCKET_mmap:
  -            return ap_mmap_bucket_create();
  -        case AP_BUCKET_rmem:
  -            return ap_rmem_create();
  -        case AP_BUCKET_eos:
  -            return ap_eos_create();
  -        case AP_BUCKET_file:
  -        case AP_BUCKET_filename:
  -        case AP_BUCKET_cached_entity:
  -        case AP_BUCKET_URI:
  -            /* not implemented yet */
  -            return NULL;
  -    }
  -    return NULL;
  -}
  -
   APR_EXPORT(ap_status_t) ap_bucket_destroy(ap_bucket *e)
   {
       if (e->free) {
  @@ -278,7 +253,7 @@
       }
       
       for (k = 0;;) {
  -        r = ap_bucket_new(AP_BUCKET_rwmem);
  +        r = ap_bucket_rwmem_create();
           x = va_arg(va, const char *);
           if (x == NULL)
               break;
  @@ -319,7 +294,7 @@
   
       res = ap_vsnprintf(buf, 4096, fmt, va);
   
  -    r = ap_bucket_new(AP_BUCKET_rwmem);
  +    r = ap_bucket_rwmem_create();
       res = r->insert(r, buf, strlen(buf), &i);
       ap_bucket_brigade_append_buckets(b, r);
   
  
  
  
  1.4       +1 -1      apache-2.0/src/lib/apr/buckets/ap_eos_buf.c
  
  Index: ap_eos_buf.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/buckets/ap_eos_buf.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ap_eos_buf.c	2000/07/18 00:32:31	1.3
  +++ ap_eos_buf.c	2000/07/20 16:14:24	1.4
  @@ -69,7 +69,7 @@
       return 0;
   }
   
  -APR_EXPORT(ap_bucket *) ap_eos_create(void)
  +APR_EXPORT(ap_bucket *) ap_bucket_eos_create(void)
   {
       ap_bucket *newbuf;
   
  
  
  
  1.7       +2 -2      apache-2.0/src/lib/apr/buckets/ap_mmap_buf.c
  
  Index: ap_mmap_buf.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/buckets/ap_mmap_buf.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ap_mmap_buf.c	2000/07/18 00:32:31	1.6
  +++ ap_mmap_buf.c	2000/07/20 16:14:24	1.7
  @@ -89,7 +89,7 @@
       ap_bucket_mmap *a = (ap_bucket_mmap *)e->data;
       ap_bucket_mmap *b;
   
  -    newbuck = ap_bucket_new(AP_BUCKET_mmap);
  +    newbuck = ap_bucket_mmap_create();
       b = (ap_bucket_mmap *)newbuck->data;
       a->alloc_addr = a->alloc_addr + nbyte;
       a->len = b->len - nbyte;
  @@ -103,7 +103,7 @@
       return APR_SUCCESS;
   }
   
  -APR_EXPORT(ap_bucket *) ap_mmap_bucket_create(void)
  +APR_EXPORT(ap_bucket *) ap_bucket_mmap_create(void)
   {
       ap_bucket *newbuf;
       ap_bucket_mmap *b;
  
  
  
  1.8       +2 -2      apache-2.0/src/lib/apr/buckets/ap_rmem_buf.c
  
  Index: ap_rmem_buf.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/buckets/ap_rmem_buf.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ap_rmem_buf.c	2000/07/18 00:32:31	1.7
  +++ ap_rmem_buf.c	2000/07/20 16:14:24	1.8
  @@ -81,7 +81,7 @@
       ap_bucket_rmem *a = (ap_bucket_rmem *)e->data; 
       ap_bucket_rmem *b; 
   
  -    newbuck = ap_bucket_new(AP_BUCKET_rmem);
  +    newbuck = ap_bucket_rmem_create();
       b = (ap_bucket_rmem *)newbuck->data;
   
       b->alloc_len = a->alloc_len - nbyte;
  @@ -124,7 +124,7 @@
       return APR_SUCCESS;
   }
   
  -APR_EXPORT(ap_bucket *) ap_rmem_create(void)
  +APR_EXPORT(ap_bucket *) ap_bucket_rmem_create(void)
   {
       ap_bucket *newbuf;
       ap_bucket_rmem *b;
  
  
  
  1.8       +2 -2      apache-2.0/src/lib/apr/buckets/ap_rwmem_buf.c
  
  Index: ap_rwmem_buf.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/buckets/ap_rwmem_buf.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ap_rwmem_buf.c	2000/07/18 00:32:31	1.7
  +++ ap_rwmem_buf.c	2000/07/20 16:14:24	1.8
  @@ -87,7 +87,7 @@
       ap_bucket_rwmem *a = (ap_bucket_rwmem *)e;
       ap_bucket_rwmem *b;
   
  -    newbuck = ap_bucket_new(AP_BUCKET_rwmem);
  +    newbuck = ap_bucket_rwmem_create();
       b = (ap_bucket_rwmem *)newbuck;
   
       b->alloc_addr = a->alloc_addr;
  @@ -141,7 +141,7 @@
       return APR_SUCCESS;
   }
   
  -APR_EXPORT(ap_bucket *) ap_rwmem_create(void)
  +APR_EXPORT(ap_bucket *) ap_bucket_rwmem_create(void)
   {
       ap_bucket *newbuf;
       ap_bucket_rwmem *b;
  
  
  
  1.16      +4 -7      apache-2.0/src/lib/apr/buckets/apr_buf.h
  
  Index: apr_buf.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/buckets/apr_buf.h,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- apr_buf.h	2000/07/18 00:32:31	1.15
  +++ apr_buf.h	2000/07/20 16:14:24	1.16
  @@ -184,9 +184,6 @@
   
   /*   ******  Bucket Functions  *****  */
   
  -/* allocate a bucket of type color */
  -APR_EXPORT(ap_bucket *) ap_bucket_new(ap_bucket_color_e color);
  -
   /* destroy a bucket */
   APR_EXPORT(ap_status_t) ap_bucket_destroy(ap_bucket *e);
   
  @@ -200,16 +197,16 @@
   APR_EXPORT(int) ap_get_bucket_len(ap_bucket *b);
   
   /* Create a read/write memory bucket */
  -APR_EXPORT(ap_bucket *) ap_rwmem_create(void);
  +APR_EXPORT(ap_bucket *) ap_bucket_rwmem_create(void);
   
   /* Create a mmap memory bucket */
  -APR_EXPORT(ap_bucket *) ap_mmap_bucket_create(void);
  +APR_EXPORT(ap_bucket *) ap_bucket_mmap_create(void);
   
   /* Create a read only memory bucket. */
  -APR_EXPORT(ap_bucket *) ap_rmem_create(void);
  +APR_EXPORT(ap_bucket *) ap_bucket_rmem_create(void);
   
   /* Create an End of Stream bucket */
  -APR_EXPORT(ap_bucket *) ap_eos_create(void);
  +APR_EXPORT(ap_bucket *) ap_bucket_eos_create(void);
   
   #endif
   
  
  
  

Mime
View raw message