diff options
author | Doug MacEachern <dougm@apache.org> | 2000-08-02 05:26:45 +0000 |
---|---|---|
committer | Doug MacEachern <dougm@apache.org> | 2000-08-02 05:26:45 +0000 |
commit | 1a1463dbfc6e28b6a5852142b0c87d4abe33c3d9 (patch) | |
tree | 4da0bfd73d36292921960aaabc877a57e680b8c4 /buckets | |
parent | 4dd06339dd5b46bd735c56dc3738146416f52ccf (diff) | |
download | apr-1a1463dbfc6e28b6a5852142b0c87d4abe33c3d9.tar.gz |
prefix libapr functions and types with apr_
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60470 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'buckets')
-rw-r--r-- | buckets/ap_buf.c | 44 | ||||
-rw-r--r-- | buckets/ap_filter.h | 62 | ||||
-rw-r--r-- | buckets/ap_mmap_buf.c | 26 | ||||
-rw-r--r-- | buckets/ap_rmem_buf.c | 24 | ||||
-rw-r--r-- | buckets/ap_rwmem_buf.c | 26 | ||||
-rw-r--r-- | buckets/apr_buf.h | 62 | ||||
-rw-r--r-- | buckets/filters.c | 14 | ||||
-rw-r--r-- | buckets/util_filter.c | 14 | ||||
-rw-r--r-- | buckets/util_filter.h | 20 |
9 files changed, 146 insertions, 146 deletions
diff --git a/buckets/ap_buf.c b/buckets/ap_buf.c index 69de82cd4..9b3e2b2cd 100644 --- a/buckets/ap_buf.c +++ b/buckets/ap_buf.c @@ -63,7 +63,7 @@ #include <sys/uio.h> #include "apr_buf.h" -APR_EXPORT(ap_status_t) ap_bucket_destroy(ap_bucket *e) +APR_EXPORT(apr_status_t) ap_bucket_destroy(ap_bucket *e) { if (e->free) { e->free(e); @@ -72,7 +72,7 @@ APR_EXPORT(ap_status_t) ap_bucket_destroy(ap_bucket *e) return APR_SUCCESS; } -static ap_status_t ap_bucket_list_destroy(ap_bucket *e) +static apr_status_t ap_bucket_list_destroy(ap_bucket *e) { ap_bucket *cur = e; ap_bucket *next; @@ -85,9 +85,9 @@ static ap_status_t ap_bucket_list_destroy(ap_bucket *e) return APR_SUCCESS; } -APR_EXPORT(ap_status_t) ap_brigade_destroy(void *data) +APR_EXPORT(apr_status_t) ap_brigade_destroy(void *data) { - ap_bucket_brigade *b = data; + apr_bucket_brigade *b = data; ap_bucket_list_destroy(b->head); /* The brigade itself is allocated out of a pool, so we don't actually @@ -97,20 +97,20 @@ APR_EXPORT(ap_status_t) ap_brigade_destroy(void *data) return APR_SUCCESS; } -APR_EXPORT(ap_bucket_brigade *) ap_brigade_create(ap_pool_t *p) +APR_EXPORT(apr_bucket_brigade *) ap_brigade_create(apr_pool_t *p) { - ap_bucket_brigade *b; + apr_bucket_brigade *b; - b = ap_palloc(p, sizeof(*b)); + b = apr_palloc(p, sizeof(*b)); b->p = p; b->head = b->tail = NULL; - ap_register_cleanup(b->p, b, ap_brigade_destroy, + apr_register_cleanup(b->p, b, ap_brigade_destroy, ap_brigade_destroy); return b; } -APR_EXPORT(void) ap_brigade_append_buckets(ap_bucket_brigade *b, +APR_EXPORT(void) ap_brigade_append_buckets(apr_bucket_brigade *b, ap_bucket *e) { ap_bucket *cur = e; @@ -128,7 +128,7 @@ APR_EXPORT(void) ap_brigade_append_buckets(ap_bucket_brigade *b, } } -APR_EXPORT(int) ap_brigade_to_iovec(ap_bucket_brigade *b, +APR_EXPORT(int) ap_brigade_to_iovec(apr_bucket_brigade *b, struct iovec *vec, int nvec) { ap_bucket *e; @@ -146,8 +146,8 @@ APR_EXPORT(int) ap_brigade_to_iovec(ap_bucket_brigade *b, return vec - orig; } -APR_EXPORT(void) ap_brigade_catenate(ap_bucket_brigade *a, - ap_bucket_brigade *b) +APR_EXPORT(void) ap_brigade_catenate(apr_bucket_brigade *a, + apr_bucket_brigade *b) { if (b->head) { if (a->tail) { @@ -163,7 +163,7 @@ APR_EXPORT(void) ap_brigade_catenate(ap_bucket_brigade *a, } } -APR_EXPORT(void) ap_consume_buckets(ap_bucket_brigade *b, int nvec) +APR_EXPORT(void) ap_consume_buckets(apr_bucket_brigade *b, int nvec) { int i; @@ -179,14 +179,14 @@ APR_EXPORT(void) ap_consume_buckets(ap_bucket_brigade *b, int nvec) } } -APR_EXPORT(ap_status_t) ap_brigade_to_iol(ap_ssize_t *total_bytes, - ap_bucket_brigade *b, +APR_EXPORT(apr_status_t) ap_brigade_to_iol(apr_ssize_t *total_bytes, + apr_bucket_brigade *b, ap_iol *iol) { - ap_status_t status; + apr_status_t status; int iov_used; struct iovec vec[16]; /* seems like a reasonable number to me */ - ap_ssize_t bytes = 0; + apr_ssize_t bytes = 0; *total_bytes = 0; do { @@ -211,12 +211,12 @@ APR_EXPORT(int) ap_get_bucket_len(ap_bucket *b) return 0; } -APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va) +APR_EXPORT(int) ap_brigade_vputstrs(apr_bucket_brigade *b, va_list va) { ap_bucket *r; const char *x; int j, k, rv; - ap_ssize_t i; + apr_ssize_t i; if (b->tail && b->tail->color == AP_BUCKET_rwmem) { ap_bucket *rw; @@ -263,7 +263,7 @@ APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va) return k; } -APR_EXPORT(int) ap_brigade_printf(ap_bucket_brigade *b, const char *fmt, ...) +APR_EXPORT(int) ap_brigade_printf(apr_bucket_brigade *b, const char *fmt, ...) { va_list ap; int res; @@ -274,7 +274,7 @@ APR_EXPORT(int) ap_brigade_printf(ap_bucket_brigade *b, const char *fmt, ...) return res; } -APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_list va) +APR_EXPORT(int) ap_brigade_vprintf(apr_bucket_brigade *b, const char *fmt, va_list va) { /* THIS IS A HACK. This needs to be replaced with a function to printf * directly into a bucket. I'm being lazy right now. RBB @@ -283,7 +283,7 @@ APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_lis ap_bucket *r; int res, i; - res = ap_vsnprintf(buf, 4096, fmt, va); + res = apr_vsnprintf(buf, 4096, fmt, va); r = ap_bucket_rwmem_create(buf, strlen(buf), &i); ap_brigade_append_buckets(b, r); diff --git a/buckets/ap_filter.h b/buckets/ap_filter.h index 747e810a1..5785b66f9 100644 --- a/buckets/ap_filter.h +++ b/buckets/ap_filter.h @@ -123,11 +123,11 @@ extern "C" { */ /* forward declare some types */ -typedef struct ap_filter_t ap_filter_t; -typedef struct ap_bucket_t ap_bucket_t; +typedef struct apr_filter_t apr_filter_t; +typedef struct apr_bucket_t apr_bucket_t; /* - * ap_filter_bucket_cb: + * apr_filter_bucket_cb: * * This function type is used for filter callbacks. It will be passed a * pointer to "this" filter, and a "bucket" containing the content to be @@ -146,8 +146,8 @@ typedef struct ap_bucket_t ap_bucket_t; * next/prev to insert/remove/replace elements in the bucket list, but * the types and values of the individual buckets should not be altered. */ -typedef void (*ap_filter_bucket_cb)(ap_filter_t *filter, - ap_bucket_t *bucket); +typedef void (*apr_filter_bucket_cb)(apr_filter_t *filter, + apr_bucket_t *bucket); /* * ap_filter_type: @@ -179,7 +179,7 @@ typedef enum { } ap_filter_type; /* - * ap_filter_t: + * apr_filter_t: * * This is the request-time context structure for an installed filter (in * the output filter chain). It provides the callback to use for filtering, @@ -192,21 +192,21 @@ typedef enum { * the state directly with the request. A callback should not change any of * the other fields. */ -struct ap_filter_t { - ap_filter_bucket_cb bucket_cb; +struct apr_filter_t { + apr_filter_bucket_cb bucket_cb; request_rec *r; void *ctx; ap_filter_type ftype; - ap_filter_t *next; + apr_filter_t *next; }; /* * ap_bucket_type: * * This enumeration is used to specify what type of bucket is present when - * an ap_bucket_t is provided. + * an apr_bucket_t is provided. * * AP_BUCKET_PTRLEN: * This bucket type defines a simple pointer/length pair for the content. @@ -245,7 +245,7 @@ struct ap_filter_t { * * AP_BUCKET_FILE: * This bucket type refers to an open file, from the current position - * and extending for ->flen bytes. Since there are some ap_file_t + * and extending for ->flen bytes. Since there are some apr_file_t * implementations/types that are not seekable, it may be impossible to * "rewind" the file's current position after reading the contenxt. * Therefore, it is important to note that once the content has been @@ -277,7 +277,7 @@ typedef enum { } ap_bucket_type; /* - * ap_bucket_t: + * apr_bucket_t: * * The actual bucket definition. The type is determined by the ->type field. * Which fields are valid/useful in the bucket is determined by the type, @@ -287,20 +287,20 @@ typedef enum { * remove, or replace elements in a list of buckets. Generally, a filter * should not change any bucket values other than these link pointers. */ -struct ap_bucket_t { +struct apr_bucket_t { ap_bucket_type type; const char *buf; /* AP_BUCKET_PTRLEN */ - ap_size_t len; /* AP_BUCKET_PTRLEN */ + apr_size_t len; /* AP_BUCKET_PTRLEN */ const char *fmt; /* AP_BUCKET_PRINTF */ va_list va; /* AP_BUCKET_STRINGS, _PRINTF */ - ap_file_t *file; /* AP_BUCKET_FILE */ - ap_ssize_t flen; /* AP_BUCKET_FILE */ + apr_file_t *file; /* AP_BUCKET_FILE */ + apr_ssize_t flen; /* AP_BUCKET_FILE */ - ap_bucket_t *next; /* next bucket in list */ - ap_bucket_t *prev; /* previous bucket in list */ + apr_bucket_t *next; /* next bucket in list */ + apr_bucket_t *prev; /* previous bucket in list */ }; /* @@ -323,25 +323,25 @@ struct ap_bucket_t { * used to send from current-position to the end-of-file. * ap_fc_putbucket(): write a bucket into the filter chain */ -API_EXPORT(void) ap_fc_write(ap_filter_t *filter, const char *buf, - ap_size_t len); -API_EXPORT(void) ap_fc_putc(ap_filter_t *filter, int c); -API_EXPORT(void) ap_fc_puts(ap_filter_t *filter, const char *str); +API_EXPORT(void) ap_fc_write(apr_filter_t *filter, const char *buf, + apr_size_t len); +API_EXPORT(void) ap_fc_putc(apr_filter_t *filter, int c); +API_EXPORT(void) ap_fc_puts(apr_filter_t *filter, const char *str); -API_EXPORT_NONSTD(void) ap_fc_putstrs(ap_filter_t *filter, ...); -API_EXPORT(void) ap_fc_vputstrs(ap_filter_t *filter, va_list va); +API_EXPORT_NONSTD(void) ap_fc_putstrs(apr_filter_t *filter, ...); +API_EXPORT(void) ap_fc_vputstrs(apr_filter_t *filter, va_list va); -API_EXPORT_NONSTD(void) ap_fc_printf(ap_filter_t *filter, +API_EXPORT_NONSTD(void) ap_fc_printf(apr_filter_t *filter, const char *fmt, ...); -API_EXPORT(void) ap_fc_vprintf(ap_filter_t *filter, +API_EXPORT(void) ap_fc_vprintf(apr_filter_t *filter, const char *fmt, va_list va); -API_EXPORT(void) ap_fc_sendfile(ap_filter_t *filter, ap_file_t *file, - ap_ssize_t flen); -#define AP_FC_SENDFILE_ALL ((ap_ssize_t) -1) +API_EXPORT(void) ap_fc_sendfile(apr_filter_t *filter, apr_file_t *file, + apr_ssize_t flen); +#define AP_FC_SENDFILE_ALL ((apr_ssize_t) -1) /* note: bucket->next and ->prev may be changed upon return from this */ -API_EXPORT(void) ap_fc_putbucket(ap_filter_t *filter, ap_bucket_t *bucket); +API_EXPORT(void) ap_fc_putbucket(apr_filter_t *filter, apr_bucket_t *bucket); /* @@ -354,7 +354,7 @@ API_EXPORT(void) ap_fc_putbucket(ap_filter_t *filter, ap_bucket_t *bucket); * The filter's callback and type should be passed. */ API_EXPORT(void) ap_register_filter(const char *name, - ap_filter_bucket_cb bucket_cb, + apr_filter_bucket_cb bucket_cb, ap_filter_type ftype); /* diff --git a/buckets/ap_mmap_buf.c b/buckets/ap_mmap_buf.c index 7f1a3dc6d..c98a49881 100644 --- a/buckets/ap_mmap_buf.c +++ b/buckets/ap_mmap_buf.c @@ -61,21 +61,21 @@ static const char * mmap_get_str(ap_bucket *e) { - ap_bucket_mmap *b = (ap_bucket_mmap *)e->data; + apr_bucket_mmap *b = (apr_bucket_mmap *)e->data; return b->alloc_addr; } static int mmap_get_len(ap_bucket *e) { - ap_bucket_mmap *b = (ap_bucket_mmap *)e->data; + apr_bucket_mmap *b = (apr_bucket_mmap *)e->data; return b->len; } -static ap_status_t mmap_bucket_insert(ap_bucket *e, const void *buf, - ap_size_t nbytes, ap_ssize_t *w) +static apr_status_t mmap_bucket_insert(ap_bucket *e, const void *buf, + apr_size_t nbytes, apr_ssize_t *w) { - ap_bucket_mmap *b = (ap_bucket_mmap *)e->data; - ap_mmap_t *mm = (ap_mmap_t *)buf; + apr_bucket_mmap *b = (apr_bucket_mmap *)e->data; + apr_mmap_t *mm = (apr_mmap_t *)buf; b->alloc_addr = mm->mm; b->len = nbytes; @@ -83,15 +83,15 @@ static ap_status_t mmap_bucket_insert(ap_bucket *e, const void *buf, return APR_SUCCESS; } -static ap_status_t mmap_split(ap_bucket *e, ap_size_t nbyte) +static apr_status_t mmap_split(ap_bucket *e, apr_size_t nbyte) { ap_bucket *newbuck; - ap_bucket_mmap *a = (ap_bucket_mmap *)e->data; - ap_bucket_mmap *b; - ap_ssize_t dump; + apr_bucket_mmap *a = (apr_bucket_mmap *)e->data; + apr_bucket_mmap *b; + apr_ssize_t dump; newbuck = ap_bucket_mmap_create(a->alloc_addr, a->len, &dump); - b = (ap_bucket_mmap *)newbuck->data; + b = (apr_bucket_mmap *)newbuck->data; a->alloc_addr = a->alloc_addr + nbyte; a->len = b->len - nbyte; @@ -105,10 +105,10 @@ static ap_status_t mmap_split(ap_bucket *e, ap_size_t nbyte) } APR_EXPORT(ap_bucket *) ap_bucket_mmap_create(const void *buf, - ap_size_t nbytes, ap_ssize_t *w) + apr_size_t nbytes, apr_ssize_t *w) { ap_bucket *newbuf; - ap_bucket_mmap *b; + apr_bucket_mmap *b; newbuf = calloc(1, sizeof(*newbuf)); b = malloc(sizeof(*b)); diff --git a/buckets/ap_rmem_buf.c b/buckets/ap_rmem_buf.c index 6b2719d65..30886063f 100644 --- a/buckets/ap_rmem_buf.c +++ b/buckets/ap_rmem_buf.c @@ -65,25 +65,25 @@ static const char * rmem_get_str(ap_bucket *e) { - ap_bucket_rmem *b = (ap_bucket_rmem *)e->data; + apr_bucket_rmem *b = (apr_bucket_rmem *)e->data; return b->start; } static int rmem_get_len(ap_bucket *e) { - ap_bucket_rmem *b = (ap_bucket_rmem *)e->data; + apr_bucket_rmem *b = (apr_bucket_rmem *)e->data; return (char *)b->end - (char *)b->start; } -static ap_status_t rmem_split(ap_bucket *e, ap_size_t nbyte) +static apr_status_t rmem_split(ap_bucket *e, apr_size_t nbyte) { ap_bucket *newbuck; - ap_bucket_rmem *a = (ap_bucket_rmem *)e->data; - ap_bucket_rmem *b; - ap_ssize_t dump; + apr_bucket_rmem *a = (apr_bucket_rmem *)e->data; + apr_bucket_rmem *b; + apr_ssize_t dump; newbuck = ap_bucket_rmem_create(a->start, a->alloc_len, &dump); - b = (ap_bucket_rmem *)newbuck->data; + b = (apr_bucket_rmem *)newbuck->data; b->alloc_len = a->alloc_len - nbyte; a->alloc_len = nbyte; @@ -106,10 +106,10 @@ static ap_status_t rmem_split(ap_bucket *e, ap_size_t nbyte) * It is worth noting that if an error occurs, the buffer is in an unknown * state. */ -static ap_status_t rmem_insert(ap_bucket *e, const void *buf, - ap_size_t nbyte, ap_ssize_t *w) +static apr_status_t rmem_insert(ap_bucket *e, const void *buf, + apr_size_t nbyte, apr_ssize_t *w) { - ap_bucket_rmem *b = (ap_bucket_rmem *)e->data; + apr_bucket_rmem *b = (apr_bucket_rmem *)e->data; if (nbyte == 0) { *w = 0; @@ -126,10 +126,10 @@ static ap_status_t rmem_insert(ap_bucket *e, const void *buf, } APR_EXPORT(ap_bucket *) ap_bucket_rmem_create(const void *buf, - ap_size_t nbyte, ap_ssize_t *w) + apr_size_t nbyte, apr_ssize_t *w) { ap_bucket *newbuf; - ap_bucket_rmem *b; + apr_bucket_rmem *b; newbuf = calloc(1, sizeof(*newbuf)); b = malloc(sizeof(*b)); diff --git a/buckets/ap_rwmem_buf.c b/buckets/ap_rwmem_buf.c index b01ef7427..4ee983776 100644 --- a/buckets/ap_rwmem_buf.c +++ b/buckets/ap_rwmem_buf.c @@ -65,31 +65,31 @@ static const char * rwmem_get_str(ap_bucket *e) { - ap_bucket_rwmem *b = (ap_bucket_rwmem *)e->data; + apr_bucket_rwmem *b = (apr_bucket_rwmem *)e->data; return b->start; } static int rwmem_get_len(ap_bucket *e) { - ap_bucket_rwmem *b = (ap_bucket_rwmem *)e->data; + apr_bucket_rwmem *b = (apr_bucket_rwmem *)e->data; return (char *)b->end - (char *)b->start; } static void rwmem_destroy(void *e) { - ap_bucket_rwmem *d = (ap_bucket_rwmem *)e; + apr_bucket_rwmem *d = (apr_bucket_rwmem *)e; free(d->alloc_addr); } -static ap_status_t rwmem_split(ap_bucket *e, ap_size_t nbyte) +static apr_status_t rwmem_split(ap_bucket *e, apr_size_t nbyte) { ap_bucket *newbuck; - ap_bucket_rwmem *a = (ap_bucket_rwmem *)e; - ap_bucket_rwmem *b; - ap_ssize_t dump; + apr_bucket_rwmem *a = (apr_bucket_rwmem *)e; + apr_bucket_rwmem *b; + apr_ssize_t dump; newbuck = ap_bucket_rwmem_create(a->alloc_addr, a->alloc_len, &dump); - b = (ap_bucket_rwmem *)newbuck->data; + b = (apr_bucket_rwmem *)newbuck->data; b->alloc_addr = a->alloc_addr; b->alloc_len = a->alloc_len; @@ -111,12 +111,12 @@ static ap_status_t rwmem_split(ap_bucket *e, ap_size_t nbyte) * It is worth noting that if an error occurs, the buffer is in an unknown * state. */ -static ap_status_t rwmem_insert(ap_bucket *e, const void *buf, - ap_size_t nbyte, ap_ssize_t *w) +static apr_status_t rwmem_insert(ap_bucket *e, const void *buf, + apr_size_t nbyte, apr_ssize_t *w) { int amt; int total; - ap_bucket_rwmem *b = (ap_bucket_rwmem *)e->data; + apr_bucket_rwmem *b = (apr_bucket_rwmem *)e->data; if (nbyte == 0) { *w = 0; @@ -143,10 +143,10 @@ static ap_status_t rwmem_insert(ap_bucket *e, const void *buf, } APR_EXPORT(ap_bucket *) ap_bucket_rwmem_create(const void *buf, - ap_size_t nbyte, ap_ssize_t *w) + apr_size_t nbyte, apr_ssize_t *w) { ap_bucket *newbuf; - ap_bucket_rwmem *b; + apr_bucket_rwmem *b; newbuf = calloc(1, sizeof(*newbuf)); b = malloc(sizeof(*b)); diff --git a/buckets/apr_buf.h b/buckets/apr_buf.h index 3c1d4b59b..6d8c2fcb8 100644 --- a/buckets/apr_buf.h +++ b/buckets/apr_buf.h @@ -169,23 +169,23 @@ struct ap_bucket { const char *(*read)(ap_bucket *e); /* Get the string */ /* Write into a bucket. The buf is a different type based on the - * bucket type used. For example, with AP_BUCKET_mmap it is an ap_mmap_t - * for AP_BUCKET_file it is an ap_file_t, and for AP_BUCKET_rwmem it is + * bucket type used. For example, with AP_BUCKET_mmap it is an apr_mmap_t + * for AP_BUCKET_file it is an apr_file_t, and for AP_BUCKET_rwmem it is * a char *. The nbytes is the amount of actual data in buf. This is * not the sizeof(buf), it is the actual number of bytes in the char * * that buf resolves to. written is how much of that data was inserted * into the bucket. */ - int (*write)(ap_bucket *e, const void *buf, ap_size_t nbytes, ap_ssize_t *w); + int (*write)(ap_bucket *e, const void *buf, apr_size_t nbytes, apr_ssize_t *w); /* Split one bucket into to at the specified position */ - ap_status_t (*split)(ap_bucket *e, ap_size_t nbytes); + apr_status_t (*split)(ap_bucket *e, apr_size_t nbytes); ap_bucket *next; /* The next node in the bucket list */ ap_bucket *prev; /* The prev node in the bucket list */ }; -typedef struct ap_bucket_brigade ap_bucket_brigade; +typedef struct apr_bucket_brigade apr_bucket_brigade; /* * This is the basic bucket brigade. That means it is a list of buckets. * It has a pool out of which the buckets and the bucket brigade are allocated. @@ -196,8 +196,8 @@ typedef struct ap_bucket_brigade ap_bucket_brigade; * the end. By walking the list, it is also possible to insert in the middle * of the list. */ -struct ap_bucket_brigade { - ap_pool_t *p; /* The pool to associate this with. +struct apr_bucket_brigade { + apr_pool_t *p; /* The pool to associate this with. I do not allocate out of the pool, but this lets me register a cleanup to put a limit on the brigade's @@ -208,7 +208,7 @@ struct ap_bucket_brigade { /* ****** Different bucket types *****/ -typedef struct ap_bucket_rmem ap_bucket_rmem; +typedef struct apr_bucket_rmem apr_bucket_rmem; /* * The Read only bucket type. This is basically for memory allocated off the * stack or literal strings. It cannot be modified, and the lifetime is @@ -216,14 +216,14 @@ typedef struct ap_bucket_rmem ap_bucket_rmem; * two different types. This contains a pointer to the front and end of the * string so that it is possible to remove characters at either end. */ -struct ap_bucket_rmem { +struct apr_bucket_rmem { size_t alloc_len; /* how much was allocated */ const void *start; /* Where does the actual data start in the alloc'ed block */ const void *end; /* where does the data actually end? */ }; -typedef struct ap_bucket_rwmem ap_bucket_rwmem; +typedef struct apr_bucket_rwmem apr_bucket_rwmem; /* * The read/write memory bucket type. This is for data that has been * allocated out of the heap. This bucket actually starts by allocating @@ -246,7 +246,7 @@ typedef struct ap_bucket_rwmem ap_bucket_rwmem; * easily add and remove characters at either end. Oh, the start cannot be * after the end either. */ -struct ap_bucket_rwmem { +struct apr_bucket_rwmem { void *alloc_addr; /* Where does the data start */ size_t alloc_len; /* how much was allocated */ void *start; /* Where does the actual data start @@ -254,7 +254,7 @@ struct ap_bucket_rwmem { void *end; /* where does the data actually end? */ }; -typedef struct ap_bucket_mmap ap_bucket_mmap; +typedef struct apr_bucket_mmap apr_bucket_mmap; /* * The mmap bucket type. This is basically just an allocation address and a @@ -262,7 +262,7 @@ typedef struct ap_bucket_mmap ap_bucket_mmap; * has a reference count in it, and a pointer to the beginning and end of * the data the bucket is referencing. */ -struct ap_bucket_mmap { +struct apr_bucket_mmap { void *alloc_addr; /* Where does the mmap start? */ int len; /* The amount of data in the mmap that we are * referencing with this bucket. This may be @@ -274,36 +274,36 @@ struct ap_bucket_mmap { /* ****** Bucket Brigade Functions ***** */ /* Create a new bucket brigade. The bucket brigade is originally empty. */ -APR_EXPORT(ap_bucket_brigade *) ap_brigade_create(ap_pool_t *p); +APR_EXPORT(apr_bucket_brigade *) ap_brigade_create(apr_pool_t *p); /* destroy an enitre bucket brigade. This includes destroying all of the * buckets within the bucket brigade's bucket list. */ -APR_EXPORT(ap_status_t) ap_brigade_destroy(void *b); +APR_EXPORT(apr_status_t) ap_brigade_destroy(void *b); /* append bucket(s) to a bucket_brigade. This is the correct way to add * buckets to the end of a bucket briagdes bucket list. This will accept * a list of buckets of any length. */ -APR_EXPORT(void) ap_brigade_append_buckets(ap_bucket_brigade *b, +APR_EXPORT(void) ap_brigade_append_buckets(apr_bucket_brigade *b, ap_bucket *e); /* consume nbytes from beginning of b -- call ap_bucket_destroy as appropriate, and/or modify start on last element */ -APR_EXPORT(void) ap_brigade_consume(ap_bucket_brigade *, int nbytes); +APR_EXPORT(void) ap_brigade_consume(apr_bucket_brigade *, int nbytes); /* create an iovec of the elements in a bucket_brigade... return number * of elements used. This is useful for writing to a file or to the * network efficiently. */ -APR_EXPORT(int) ap_brigade_to_iovec(ap_bucket_brigade *, +APR_EXPORT(int) ap_brigade_to_iovec(apr_bucket_brigade *, struct iovec *vec, int nvec); /* catenate bucket_brigade b onto bucket_brigade a, bucket_brigade b is * empty after this. Neither bucket brigade can be NULL, but either one of * them can be emtpy when calling this function. */ -APR_EXPORT(void) ap_brigade_catenate(ap_bucket_brigade *a, - ap_bucket_brigade *b); +APR_EXPORT(void) ap_brigade_catenate(apr_bucket_brigade *a, + apr_bucket_brigade *b); /* Destroy the first nvec buckets. This is very much like ap_brigade_consume * except instead of specifying the number of bytes to consume, it consumes @@ -312,7 +312,7 @@ APR_EXPORT(void) ap_brigade_catenate(ap_bucket_brigade *a, * vectors, we would destroy those 16 buckets. My gut is that this is the * wrong approach. I plan to change this soon-ish. */ -APR_EXPORT(void) ap_consume_buckets(ap_bucket_brigade *b, int nvec); +APR_EXPORT(void) ap_consume_buckets(apr_bucket_brigade *b, int nvec); /* save the buf out to the specified iol. This can be used to flush the * data to the disk, or to send it out to the network. This is a poor @@ -320,10 +320,10 @@ APR_EXPORT(void) ap_consume_buckets(ap_bucket_brigade *b, int nvec); * also required. Once filters have been finished, the whole concept of * iol's can just go away, and this function can go away with it. The * correct solution, is to have the functions that are currently calling - * this just call either ap_sendv or ap_writev directly. + * this just call either apr_sendv or apr_writev directly. */ -APR_EXPORT(ap_status_t) ap_brigade_to_iol(ap_ssize_t *total_bytes, - ap_bucket_brigade *a, +APR_EXPORT(apr_status_t) ap_brigade_to_iol(apr_ssize_t *total_bytes, + apr_bucket_brigade *a, ap_iol *iol); /* @@ -337,7 +337,7 @@ APR_EXPORT(ap_status_t) ap_brigade_to_iol(ap_ssize_t *total_bytes, * filters will be removing some of the data. This may be a dubios * optimization, I just don't know. */ -APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va); +APR_EXPORT(int) ap_brigade_vputstrs(apr_bucket_brigade *b, va_list va); /* * Both of these functions evaluate the printf and put the resulting string @@ -345,8 +345,8 @@ APR_EXPORT(int) ap_brigade_vputstrs(ap_bucket_brigade *b, va_list va); * two of them, is that the ap_r* functions needed both. I would love to be * able to remove one, but I don't think it's feasible. */ -APR_EXPORT(int) ap_brigade_printf(ap_bucket_brigade *b, const char *fmt, ...); -APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_list va); +APR_EXPORT(int) ap_brigade_printf(apr_bucket_brigade *b, const char *fmt, ...); +APR_EXPORT(int) ap_brigade_vprintf(apr_bucket_brigade *b, const char *fmt, va_list va); /* ****** Bucket Functions ***** */ @@ -356,7 +356,7 @@ APR_EXPORT(int) ap_brigade_vprintf(ap_bucket_brigade *b, const char *fmt, va_lis * when the bucket with the last reference is destroyed. Rwmem buckets * always have their data destroyed currently. */ -APR_EXPORT(ap_status_t) ap_bucket_destroy(ap_bucket *e); +APR_EXPORT(apr_status_t) ap_bucket_destroy(ap_bucket *e); /* get the length of the data in the bucket that is currently being * referenced. The bucket may contain more data, but if the start or end @@ -379,16 +379,16 @@ APR_EXPORT(int) ap_get_bucket_len(ap_bucket *b); /* Create a read/write memory bucket */ APR_EXPORT(ap_bucket *) ap_bucket_rwmem_create(const void *buf, - ap_size_t nbyte, ap_ssize_t *w); + apr_size_t nbyte, apr_ssize_t *w); /* Create a mmap memory bucket */ APR_EXPORT(ap_bucket *) ap_bucket_mmap_create(const void *buf, - ap_size_t nbytes, ap_ssize_t *w); + apr_size_t nbytes, apr_ssize_t *w); /* Create a read only memory bucket. */ APR_EXPORT(ap_bucket *) ap_bucket_rmem_create(const void *buf, - ap_size_t nbyte, ap_ssize_t *w); + apr_size_t nbyte, apr_ssize_t *w); /* Create an End of Stream bucket */ APR_EXPORT(ap_bucket *) ap_bucket_eos_create(void); diff --git a/buckets/filters.c b/buckets/filters.c index 05a4538e1..d4e7a4810 100644 --- a/buckets/filters.c +++ b/buckets/filters.c @@ -68,7 +68,7 @@ */ typedef struct ap_filter_rec_t { const char *name; - ap_filter_bucket_cb bucket_cb; + apr_filter_bucket_cb bucket_cb; ap_filter_type ftype; struct ap_filter_rec_t *next; @@ -96,17 +96,17 @@ static ap_filter_rec_t *registered_filters = NULL; || (before_this)->r != (f)->r) -static ap_status_t filter_cleanup(void *ctx) +static apr_status_t filter_cleanup(void *ctx) { registered_filters = NULL; return APR_SUCCESS; } API_EXPORT(void) ap_register_filter(const char *name, - ap_filter_bucket_cb bucket_cb, + apr_filter_bucket_cb bucket_cb, ap_filter_type ftype) { - ap_filter_rec_t *frec = ap_palloc(FILTER_POOL, sizeof(*frec)); + ap_filter_rec_t *frec = apr_palloc(FILTER_POOL, sizeof(*frec)); frec->name = name; frec->bucket_cb = bucket_cb; @@ -115,7 +115,7 @@ API_EXPORT(void) ap_register_filter(const char *name, frec->next = registered_filters; registered_filters = frec; - ap_register_cleanup(FILTER_POOL, NULL, filter_cleanup, NULL); + apr_register_cleanup(FILTER_POOL, NULL, filter_cleanup, NULL); } API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r) @@ -124,7 +124,7 @@ API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r) for (; frec != NULL; frec = frec->next) { if (!strcasecmp(name, frec->name)) { - ap_filter_t *f = ap_pcalloc(r->pool, sizeof(*f)); + apr_filter_t *f = apr_pcalloc(r->pool, sizeof(*f)); f->bucket_cb = frec->bucket_cb; f->r = r; @@ -136,7 +136,7 @@ API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r) r->filters = f; } else { - ap_filter_t *fscan = r->filters; + apr_filter_t *fscan = r->filters; while (!INSERT_BEFORE(f, fscan->next)) fscan = fscan->next; f->next = fscan->next; diff --git a/buckets/util_filter.c b/buckets/util_filter.c index 77bdc9872..228491bca 100644 --- a/buckets/util_filter.c +++ b/buckets/util_filter.c @@ -66,7 +66,7 @@ */ typedef struct ap_filter_rec_t { const char *name; - ap_filter_func filter_func; + apr_filter_func filter_func; ap_filter_type ftype; struct ap_filter_rec_t *next; @@ -93,17 +93,17 @@ static ap_filter_rec_t *registered_filters = NULL; || (before_this)->ftype > (f)->ftype) -static ap_status_t filter_cleanup(void *ctx) +static apr_status_t filter_cleanup(void *ctx) { registered_filters = NULL; return APR_SUCCESS; } API_EXPORT(void) ap_register_filter(const char *name, - ap_filter_func filter_func, + apr_filter_func filter_func, ap_filter_type ftype) { - ap_filter_rec_t *frec = ap_palloc(FILTER_POOL, sizeof(*frec)); + ap_filter_rec_t *frec = apr_palloc(FILTER_POOL, sizeof(*frec)); frec->name = name; frec->filter_func = filter_func; @@ -112,7 +112,7 @@ API_EXPORT(void) ap_register_filter(const char *name, frec->next = registered_filters; registered_filters = frec; - ap_register_cleanup(FILTER_POOL, NULL, filter_cleanup, NULL); + apr_register_cleanup(FILTER_POOL, NULL, filter_cleanup, NULL); } API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r) @@ -121,7 +121,7 @@ API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r) for (; frec != NULL; frec = frec->next) { if (!strcasecmp(name, frec->name)) { - ap_filter_t *f = ap_pcalloc(r->pool, sizeof(*f)); + apr_filter_t *f = apr_pcalloc(r->pool, sizeof(*f)); f->filter_func = frec->filter_func; f->ctx = ctx; @@ -132,7 +132,7 @@ API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r) r->filters = f; } else { - ap_filter_t *fscan = r->filters; + apr_filter_t *fscan = r->filters; while (!INSERT_BEFORE(f, fscan->next)) fscan = fscan->next; f->next = fscan->next; diff --git a/buckets/util_filter.h b/buckets/util_filter.h index f2f564a5a..1c523abf9 100644 --- a/buckets/util_filter.h +++ b/buckets/util_filter.h @@ -92,10 +92,10 @@ extern "C" { */ /* forward declare the filter type */ -typedef struct ap_filter_t ap_filter_t; +typedef struct apr_filter_t apr_filter_t; /* - * ap_filter_func: + * apr_filter_func: * * This function type is used for filter callbacks. It will be passed a * pointer to "this" filter, and a "bucket" containing the content to be @@ -114,7 +114,7 @@ typedef struct ap_filter_t ap_filter_t; * next/prev to insert/remove/replace elements in the bucket list, but * the types and values of the individual buckets should not be altered. */ -typedef ap_status_t (*ap_filter_func)(); +typedef apr_status_t (*apr_filter_func)(); /* * ap_filter_type: @@ -146,7 +146,7 @@ typedef enum { } ap_filter_type; /* - * ap_filter_t: + * apr_filter_t: * * This is the request-time context structure for an installed filter (in * the output filter chain). It provides the callback to use for filtering, @@ -159,13 +159,13 @@ typedef enum { * the state directly with the request. A callback should not change any of * the other fields. */ -struct ap_filter_t { - ap_filter_func filter_func; +struct apr_filter_t { + apr_filter_func filter_func; void *ctx; ap_filter_type ftype; - ap_filter_t *next; + apr_filter_t *next; }; /* @@ -178,7 +178,7 @@ struct ap_filter_t { * The filter's callback and type should be passed. */ API_EXPORT(void) ap_register_filter(const char *name, - ap_filter_func filter_func, + apr_filter_func filter_func, ap_filter_type ftype); /* @@ -198,9 +198,9 @@ API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r); /* * Things to do later: - * Add parameters to ap_filter_func type. Those parameters will be something + * Add parameters to apr_filter_func type. Those parameters will be something * like: - * (request_rec *r, ap_filter_t *filter, ap_data_list *the_data) + * (request_rec *r, apr_filter_t *filter, ap_data_list *the_data) * obviously, the request_rec is the current request, and the filter * is the current filter stack. The data_list is a bucket list or * bucket_brigade, but I am trying to keep this patch neutral. (If this |