diff options
195 files changed, 3484 insertions, 3484 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 diff --git a/dso/aix/dso.c b/dso/aix/dso.c index 9c92aa04d..5e10b4ce2 100644 --- a/dso/aix/dso.c +++ b/dso/aix/dso.c @@ -132,21 +132,21 @@ struct dl_info { * add the basic "wrappers" here. */ -ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, - ap_pool_t *ctx) +apr_status_t apr_dso_load(apr_dso_handle_t **res_handle, const char *path, + apr_pool_t *ctx) { void *os_handle = dlopen((char *)path, RTLD_NOW | RTLD_GLOBAL); if(os_handle == NULL) return APR_EDSOOPEN; - *res_handle = ap_pcalloc(ctx, sizeof(*res_handle)); + *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); (*res_handle)->handle = (void*)os_handle; (*res_handle)->cont = ctx; return APR_SUCCESS; } -ap_status_t ap_dso_unload(ap_dso_handle_t *handle) +apr_status_t apr_dso_unload(apr_dso_handle_t *handle) { if (dlclose(handle->handle) != 0) return APR_EINIT; @@ -154,8 +154,8 @@ ap_status_t ap_dso_unload(ap_dso_handle_t *handle) return APR_SUCCESS; } -ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, - ap_dso_handle_t *handle, +apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, + apr_dso_handle_t *handle, const char *symname) { void *retval = dlsym(handle->handle, symname); diff --git a/dso/aix/dso.h b/dso/aix/dso.h index ae89f9ee5..6b7ca8ea7 100644 --- a/dso/aix/dso.h +++ b/dso/aix/dso.h @@ -68,8 +68,8 @@ void *dlsym(void *handle, const char *symbol); const char *dlerror(void); int dlclose(void *handle); -struct ap_dso_handle_t { - ap_pool_t *cont; +struct apr_dso_handle_t { + apr_pool_t *cont; void *handle; }; diff --git a/dso/beos/dso.c b/dso/beos/dso.c index c6ed29f1f..6a29f1efc 100644 --- a/dso/beos/dso.c +++ b/dso/beos/dso.c @@ -56,21 +56,21 @@ #if APR_HAS_DSO -ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, - ap_pool_t *ctx) +apr_status_t apr_dso_load(apr_dso_handle_t **res_handle, const char *path, + apr_pool_t *ctx) { image_id newid; if((newid = load_add_on(path)) < B_NO_ERROR) return APR_EINIT; - *res_handle = ap_pcalloc(ctx, sizeof(*res_handle)); + *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); (*res_handle)->handle = newid; (*res_handle)->cont = ctx; return APR_SUCCESS; } -ap_status_t ap_dso_unload(ap_dso_handle_t *handle) +apr_status_t apr_dso_unload(apr_dso_handle_t *handle) { if(unload_add_on(handle->handle) < B_NO_ERROR) return APR_EINIT; @@ -78,7 +78,7 @@ ap_status_t ap_dso_unload(ap_dso_handle_t *handle) return APR_SUCCESS; } -ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, ap_dso_handle_t *handle, +apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_handle_t *handle, const char *symname) { int err; @@ -95,7 +95,7 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, ap_dso_handle_t *handle, return APR_SUCCESS; } -const char *ap_dso_error(ap_dso_handle_t *dso, char *buffer, ap_size_t buflen) +const char *apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr_size_t buflen) { strncpy(strerror(errno), buffer, buflen); return buffer; diff --git a/dso/beos/dso.h b/dso/beos/dso.h index 71a75ef58..476e71c8f 100644 --- a/dso/beos/dso.h +++ b/dso/beos/dso.h @@ -66,9 +66,9 @@ #if APR_HAS_DSO -struct ap_dso_handle_t { +struct apr_dso_handle_t { image_id handle; /* Handle to the DSO loaded */ - ap_pool_t *cont; + apr_pool_t *cont; }; #endif diff --git a/dso/os2/dso.c b/dso/os2/dso.c index 5bd913b2e..d7706f138 100644 --- a/dso/os2/dso.c +++ b/dso/os2/dso.c @@ -60,38 +60,38 @@ #if APR_HAS_DSO -static ap_status_t dso_cleanup(void *thedso) +static apr_status_t dso_cleanup(void *thedso) { - ap_dso_handle_t *dso = thedso; - return ap_dso_unload(dso); + apr_dso_handle_t *dso = thedso; + return apr_dso_unload(dso); } -ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, ap_pool_t *ctx) +apr_status_t apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) { char failed_module[20]; HMODULE handle; int rc; - *res_handle = ap_pcalloc(ctx, sizeof(*res_handle)); + *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); (*res_handle)->cont = ctx; (*res_handle)->load_error = APR_SUCCESS; (*res_handle)->failed_module = NULL; if ((rc = DosLoadModule(failed_module, sizeof(failed_module), path, &handle)) != 0) { (*res_handle)->load_error = APR_OS2_STATUS(rc); - (*res_handle)->failed_module = ap_pstrdup(ctx, failed_module); + (*res_handle)->failed_module = apr_pstrdup(ctx, failed_module); return APR_OS2_STATUS(rc); } (*res_handle)->handle = handle; - ap_register_cleanup(ctx, *res_handle, dso_cleanup, ap_null_cleanup); + apr_register_cleanup(ctx, *res_handle, dso_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_dso_unload(ap_dso_handle_t *handle) +apr_status_t apr_dso_unload(apr_dso_handle_t *handle) { int rc; @@ -108,8 +108,8 @@ ap_status_t ap_dso_unload(ap_dso_handle_t *handle) -ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, - ap_dso_handle_t *handle, +apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, + apr_dso_handle_t *handle, const char *symname) { PFN func; @@ -127,14 +127,14 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, -char *ap_dso_error(ap_dso_handle_t *dso, char *buffer, ap_size_t buflen) +char *apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr_size_t buflen) { char message[200]; - ap_strerror(dso->load_error, message, sizeof(message)); + apr_strerror(dso->load_error, message, sizeof(message)); strcat(message, " ("); strcat(message, dso->failed_module); strcat(message, ")"); - ap_cpystrn(buffer, message, buflen); + apr_cpystrn(buffer, message, buflen); return buffer; } diff --git a/dso/os2/dso.h b/dso/os2/dso.h index b37e1a54c..1597c81d1 100644 --- a/dso/os2/dso.h +++ b/dso/os2/dso.h @@ -66,10 +66,10 @@ #if APR_HAS_DSO -struct ap_dso_handle_t { - ap_pool_t *cont; /* Context for returning error strings */ +struct apr_dso_handle_t { + apr_pool_t *cont; /* Context for returning error strings */ HMODULE handle; /* Handle to the DSO loaded */ - ap_status_t load_error; + apr_status_t load_error; char *failed_module; }; diff --git a/dso/unix/dso.c b/dso/unix/dso.c index c3e815fa6..9a6a0e0fb 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -56,8 +56,8 @@ #if APR_HAS_DSO -ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, - ap_pool_t *ctx) +apr_status_t apr_dso_load(apr_dso_handle_t **res_handle, const char *path, + apr_pool_t *ctx) { #if defined(HPUX) || defined(HPUX10) || defined(HPUX11) shl_t os_handle = shl_load(path, BIND_IMMEDIATE|BIND_VERBOSE|BIND_NOSTART, 0L); @@ -68,7 +68,7 @@ ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, void *os_handle = dlopen(path, RTLD_NOW | RTLD_GLOBAL); #endif - *res_handle = ap_pcalloc(ctx, sizeof(**res_handle)); + *res_handle = apr_pcalloc(ctx, sizeof(**res_handle)); if(os_handle == NULL) { #if defined(HPUX) || defined(HPUX10) || defined(HPUX11) @@ -86,7 +86,7 @@ ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, return APR_SUCCESS; } -ap_status_t ap_dso_unload(ap_dso_handle_t *handle) +apr_status_t apr_dso_unload(apr_dso_handle_t *handle) { #if defined(HPUX) || defined(HPUX10) || defined(HPUX11) shl_unload((shl_t)handle->handle); @@ -99,8 +99,8 @@ ap_status_t ap_dso_unload(ap_dso_handle_t *handle) return APR_SUCCESS; } -ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, - ap_dso_handle_t *handle, +apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, + apr_dso_handle_t *handle, const char *symname) { #if defined(HPUX) || defined(HPUX10) || defined(HPUX11) @@ -141,7 +141,7 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, #endif /* not HP-UX; use dlsym()/dlerror() */ } -const char *ap_dso_error(ap_dso_handle_t *dso, char *buffer, ap_size_t buflen) +const char *apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr_size_t buflen) { if (dso->errormsg) return dso->errormsg; diff --git a/dso/unix/dso.h b/dso/unix/dso.h index ef8aa572a..fc9b8325e 100644 --- a/dso/unix/dso.h +++ b/dso/unix/dso.h @@ -85,8 +85,8 @@ #define DLSYM_NEEDS_UNDERSCORE #endif -struct ap_dso_handle_t { - ap_pool_t *cont; +struct apr_dso_handle_t { + apr_pool_t *cont; void *handle; const char *errormsg; }; diff --git a/dso/win32/dso.c b/dso/win32/dso.c index fadde87b9..732e86fc9 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -56,11 +56,11 @@ #if APR_HAS_DSO -ap_status_t ap_dso_load(struct ap_dso_handle_t **res_handle, const char *path, - ap_pool_t *ctx) +apr_status_t apr_dso_load(struct apr_dso_handle_t **res_handle, const char *path, + apr_pool_t *ctx) { HINSTANCE os_handle = LoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); - *res_handle = ap_pcalloc(ctx, sizeof(*res_handle)); + *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); if(os_handle == NULL) { (*res_handle)->load_error = GetLastError(); @@ -73,7 +73,7 @@ ap_status_t ap_dso_load(struct ap_dso_handle_t **res_handle, const char *path, return APR_SUCCESS; } -ap_status_t ap_dso_unload(struct ap_dso_handle_t *handle) +apr_status_t apr_dso_unload(struct apr_dso_handle_t *handle) { if (!FreeLibrary(handle->handle)) { return GetLastError(); @@ -81,8 +81,8 @@ ap_status_t ap_dso_unload(struct ap_dso_handle_t *handle) return APR_SUCCESS; } -ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, - struct ap_dso_handle_t *handle, +apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, + struct apr_dso_handle_t *handle, const char *symname) { FARPROC retval = GetProcAddress(handle->handle, symname); @@ -95,9 +95,9 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, return APR_SUCCESS; } -const char *ap_dso_error(ap_dso_handle_t *dso, char *buf, ap_size_t bufsize) +const char *apr_dso_error(apr_dso_handle_t *dso, char *buf, apr_size_t bufsize) { - return ap_strerror(dso->load_error, buf, bufsize); + return apr_strerror(dso->load_error, buf, bufsize); } #endif diff --git a/dso/win32/dso.h b/dso/win32/dso.h index 73ab8b1ed..32bf6b7be 100644 --- a/dso/win32/dso.h +++ b/dso/win32/dso.h @@ -63,10 +63,10 @@ #if APR_HAS_DSO -struct ap_dso_handle_t { - ap_pool_t *cont; +struct apr_dso_handle_t { + apr_pool_t *cont; void *handle; - ap_status_t load_error; + apr_status_t load_error; }; #endif diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c index 34f973ec6..05674c69e 100644 --- a/file_io/os2/dir.c +++ b/file_io/os2/dir.c @@ -60,23 +60,23 @@ #define INCL_DOS #include <os2.h> -static ap_status_t dir_cleanup(void *thedir) +static apr_status_t dir_cleanup(void *thedir) { - ap_dir_t *dir = thedir; - return ap_closedir(dir); + apr_dir_t *dir = thedir; + return apr_closedir(dir); } -ap_status_t ap_opendir(ap_dir_t **new, const char *dirname, ap_pool_t *cntxt) +apr_status_t apr_opendir(apr_dir_t **new, const char *dirname, apr_pool_t *cntxt) { - ap_dir_t *thedir = (ap_dir_t *)ap_palloc(cntxt, sizeof(ap_dir_t)); + apr_dir_t *thedir = (apr_dir_t *)apr_palloc(cntxt, sizeof(apr_dir_t)); if (thedir == NULL) return APR_ENOMEM; thedir->cntxt = cntxt; - thedir->dirname = ap_pstrdup(cntxt, dirname); + thedir->dirname = apr_pstrdup(cntxt, dirname); if (thedir->dirname == NULL) return APR_ENOMEM; @@ -84,13 +84,13 @@ ap_status_t ap_opendir(ap_dir_t **new, const char *dirname, ap_pool_t *cntxt) thedir->handle = 0; thedir->validentry = FALSE; *new = thedir; - ap_register_cleanup(cntxt, thedir, dir_cleanup, ap_null_cleanup); + apr_register_cleanup(cntxt, thedir, dir_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_closedir(ap_dir_t *thedir) +apr_status_t apr_closedir(apr_dir_t *thedir) { int rv = 0; @@ -107,14 +107,14 @@ ap_status_t ap_closedir(ap_dir_t *thedir) -ap_status_t ap_readdir(ap_dir_t *thedir) +apr_status_t apr_readdir(apr_dir_t *thedir) { int rv; ULONG entries = 1; if (thedir->handle == 0) { thedir->handle = HDIR_CREATE; - rv = DosFindFirst(ap_pstrcat(thedir->cntxt, thedir->dirname, "/*", NULL), &thedir->handle, + rv = DosFindFirst(apr_pstrcat(thedir->cntxt, thedir->dirname, "/*", NULL), &thedir->handle, FILE_ARCHIVED|FILE_DIRECTORY|FILE_SYSTEM|FILE_HIDDEN|FILE_READONLY, &thedir->entry, sizeof(thedir->entry), &entries, FIL_STANDARD); } else { @@ -136,28 +136,28 @@ ap_status_t ap_readdir(ap_dir_t *thedir) -ap_status_t ap_rewinddir(ap_dir_t *thedir) +apr_status_t apr_rewinddir(apr_dir_t *thedir) { - return ap_closedir(thedir); + return apr_closedir(thedir); } -ap_status_t ap_make_dir(const char *path, ap_fileperms_t perm, ap_pool_t *cont) +apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *cont) { return APR_OS2_STATUS(DosCreateDir(path, NULL)); } -ap_status_t ap_remove_dir(const char *path, ap_pool_t *cont) +apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) { return APR_OS2_STATUS(DosDeleteDir(path)); } -ap_status_t ap_dir_entry_size(ap_ssize_t *size, ap_dir_t *thedir) +apr_status_t apr_dir_entry_size(apr_ssize_t *size, apr_dir_t *thedir) { if (thedir->validentry) { *size = thedir->entry.cbFile; @@ -169,7 +169,7 @@ ap_status_t ap_dir_entry_size(ap_ssize_t *size, ap_dir_t *thedir) -ap_status_t ap_dir_entry_mtime(ap_time_t *time, ap_dir_t *thedir) +apr_status_t apr_dir_entry_mtime(apr_time_t *time, apr_dir_t *thedir) { if (thedir->validentry) { ap_os2_time_to_ap_time(time, thedir->entry.fdateLastWrite, thedir->entry.ftimeLastWrite); @@ -181,7 +181,7 @@ ap_status_t ap_dir_entry_mtime(ap_time_t *time, ap_dir_t *thedir) -ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, ap_dir_t *thedir) +apr_status_t apr_dir_entry_ftype(ap_filetype_e *type, apr_dir_t *thedir) { int rc; HFILE hFile; @@ -193,7 +193,7 @@ ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, ap_dir_t *thedir) *type = APR_DIR; return APR_SUCCESS; } else { - rc = DosOpen(ap_pstrcat(thedir->cntxt, thedir->dirname, "/", thedir->entry.achName, NULL) , + rc = DosOpen(apr_pstrcat(thedir->cntxt, thedir->dirname, "/", thedir->entry.achName, NULL) , &hFile, &action, 0, 0, OPEN_ACTION_FAIL_IF_NEW|OPEN_ACTION_OPEN_IF_EXISTS, OPEN_SHARE_DENYNONE|OPEN_ACCESS_READONLY, NULL); @@ -216,7 +216,7 @@ ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, ap_dir_t *thedir) -ap_status_t ap_get_dir_filename(char **new, ap_dir_t *thedir) +apr_status_t apr_get_dir_filename(char **new, apr_dir_t *thedir) { if (thedir->validentry) { *new = thedir->entry.achName; diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c index d3cedd6a7..a921d096b 100644 --- a/file_io/os2/filedup.c +++ b/file_io/os2/filedup.c @@ -60,13 +60,13 @@ #define INCL_DOS #include <os2.h> -ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) +apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { int rv; - ap_file_t *dup_file; + apr_file_t *dup_file; if (*new_file == NULL) { - dup_file = (ap_file_t *)ap_palloc(p, sizeof(ap_file_t)); + dup_file = (apr_file_t *)apr_palloc(p, sizeof(apr_file_t)); if (dup_file == NULL) { return APR_ENOMEM; @@ -84,7 +84,7 @@ ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) return APR_OS2_STATUS(rv); } - dup_file->fname = ap_pstrdup(dup_file->cntxt, old_file->fname); + dup_file->fname = apr_pstrdup(dup_file->cntxt, old_file->fname); dup_file->buffered = old_file->buffered; dup_file->isopen = old_file->isopen; dup_file->flags = old_file->flags; @@ -92,8 +92,8 @@ ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) dup_file->pipe = old_file->pipe; if (*new_file == NULL) { - ap_register_cleanup(dup_file->cntxt, dup_file, apr_file_cleanup, - ap_null_cleanup); + apr_register_cleanup(dup_file->cntxt, dup_file, apr_file_cleanup, + apr_null_cleanup); *new_file = dup_file; } diff --git a/file_io/os2/fileio.h b/file_io/os2/fileio.h index 738e17f2e..6aa1be1c5 100644 --- a/file_io/os2/fileio.h +++ b/file_io/os2/fileio.h @@ -67,14 +67,14 @@ #define APR_FILE_BUFSIZE 4096 -struct ap_file_t { - ap_pool_t *cntxt; +struct apr_file_t { + apr_pool_t *cntxt; HFILE filedes; char * fname; int isopen; int buffered; int eof_hit; - ap_int32_t flags; + apr_int32_t flags; int timeout; int pipe; HEV pipeSem; @@ -85,19 +85,19 @@ struct ap_file_t { unsigned long dataRead; // amount of valid data read into buffer int direction; // buffer being used for 0 = read, 1 = write unsigned long filePtr; // position in file of handle - ap_lock_t *mutex; // mutex semaphore, must be owned to access the above fields + apr_lock_t *mutex; // mutex semaphore, must be owned to access the above fields }; -struct ap_dir_t { - ap_pool_t *cntxt; +struct apr_dir_t { + apr_pool_t *cntxt; char *dirname; ULONG handle; FILEFINDBUF3 entry; int validentry; }; -ap_status_t apr_file_cleanup(void *); -ap_status_t ap_os2_time_to_ap_time(ap_time_t *result, FDATE os2date, FTIME os2time); +apr_status_t apr_file_cleanup(void *); +apr_status_t ap_os2_time_to_ap_time(apr_time_t *result, FDATE os2date, FTIME os2time); #endif /* ! FILE_IO_H */ diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c index 96d0deb2d..43dc3f152 100644 --- a/file_io/os2/filestat.c +++ b/file_io/os2/filestat.c @@ -61,7 +61,7 @@ #include <os2.h> -static void FS3_to_finfo(ap_finfo_t *finfo, FILESTATUS3 *fstatus) +static void FS3_to_finfo(apr_finfo_t *finfo, FILESTATUS3 *fstatus) { finfo->protection = (fstatus->attrFile & FILE_READONLY) ? 0555 : 0777; @@ -82,7 +82,7 @@ static void FS3_to_finfo(ap_finfo_t *finfo, FILESTATUS3 *fstatus) -static ap_status_t handle_type(ap_filetype_e *ftype, HFILE file) +static apr_status_t handle_type(ap_filetype_e *ftype, HFILE file) { ULONG filetype, fileattr, rc; @@ -110,7 +110,7 @@ static ap_status_t handle_type(ap_filetype_e *ftype, HFILE file) -ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile) +apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile) { ULONG rc; FILESTATUS3 fstatus; @@ -137,13 +137,13 @@ ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile) return APR_OS2_STATUS(rc); } -ap_status_t ap_setfileperms(const char *fname, ap_fileperms_t perms) +apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms) { return APR_ENOTIMPL; } -ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) +apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) { ULONG rc; FILESTATUS3 fstatus; @@ -156,7 +156,7 @@ ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) FS3_to_finfo(finfo, &fstatus); return APR_SUCCESS; } else if (rc == ERROR_INVALID_ACCESS) { - memset(finfo, 0, sizeof(ap_finfo_t)); + memset(finfo, 0, sizeof(apr_finfo_t)); finfo->protection = 0444; finfo->filetype = APR_CHR; return APR_SUCCESS; diff --git a/file_io/os2/maperrorcode.c b/file_io/os2/maperrorcode.c index 209eec026..5fa398151 100644 --- a/file_io/os2/maperrorcode.c +++ b/file_io/os2/maperrorcode.c @@ -115,7 +115,7 @@ static int errormap[][2] = { #define MAPSIZE (sizeof(errormap)/sizeof(errormap[0])) -int ap_canonical_error(ap_status_t err) +int apr_canonical_error(apr_status_t err) { int rv = -1, index; @@ -129,7 +129,7 @@ int ap_canonical_error(ap_status_t err) if (index<MAPSIZE) rv = errormap[index][1]; else - fprintf(stderr, "ap_canonical_error: Unknown OS/2 error code %d\n", err ); + fprintf(stderr, "apr_canonical_error: Unknown OS/2 error code %d\n", err ); return rv; } diff --git a/file_io/os2/open.c b/file_io/os2/open.c index 0e77ad27c..14c28617d 100644 --- a/file_io/os2/open.c +++ b/file_io/os2/open.c @@ -58,21 +58,21 @@ #include "apr_portable.h" #include <string.h> -ap_status_t apr_file_cleanup(void *thefile) +apr_status_t apr_file_cleanup(void *thefile) { - ap_file_t *file = thefile; - return ap_close(file); + apr_file_t *file = thefile; + return apr_close(file); } -ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fileperms_t perm, ap_pool_t *cntxt) +apr_status_t apr_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cntxt) { int oflags = 0; int mflags = OPEN_FLAGS_FAIL_ON_ERROR|OPEN_SHARE_DENYNONE; int rv; ULONG action; - ap_file_t *dafile = (ap_file_t *)ap_palloc(cntxt, sizeof(ap_file_t)); + apr_file_t *dafile = (apr_file_t *)apr_palloc(cntxt, sizeof(apr_file_t)); *new = dafile; dafile->cntxt = cntxt; @@ -95,8 +95,8 @@ ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fil dafile->buffered = (flag & APR_BUFFERED) > 0; if (dafile->buffered) { - dafile->buffer = ap_palloc(cntxt, APR_FILE_BUFSIZE); - rv = ap_create_lock(&dafile->mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, cntxt); + dafile->buffer = apr_palloc(cntxt, APR_FILE_BUFSIZE); + rv = apr_create_lock(&dafile->mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, cntxt); if (rv) return rv; @@ -135,26 +135,26 @@ ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fil return APR_OS2_STATUS(rv); dafile->isopen = TRUE; - dafile->fname = ap_pstrdup(cntxt, fname); + dafile->fname = apr_pstrdup(cntxt, fname); dafile->filePtr = 0; dafile->bufpos = 0; dafile->dataRead = 0; dafile->direction = 0; dafile->pipe = FALSE; - ap_register_cleanup(dafile->cntxt, dafile, apr_file_cleanup, ap_null_cleanup); + apr_register_cleanup(dafile->cntxt, dafile, apr_file_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_close(ap_file_t *file) +apr_status_t apr_close(apr_file_t *file) { ULONG rc; - ap_status_t status; + apr_status_t status; if (file && file->isopen) { - ap_flush(file); + apr_flush(file); rc = DosClose(file->filedes); if (rc == 0) { @@ -170,14 +170,14 @@ ap_status_t ap_close(ap_file_t *file) } if (file->buffered) - ap_destroy_lock(file->mutex); + apr_destroy_lock(file->mutex); return APR_SUCCESS; } -ap_status_t ap_remove_file(const char *path, ap_pool_t *cntxt) +apr_status_t apr_remove_file(const char *path, apr_pool_t *cntxt) { ULONG rc = DosDelete(path); return APR_OS2_STATUS(rc); @@ -185,8 +185,8 @@ ap_status_t ap_remove_file(const char *path, ap_pool_t *cntxt) -ap_status_t ap_rename_file(const char *from_path, const char *to_path, - ap_pool_t *p) +apr_status_t apr_rename_file(const char *from_path, const char *to_path, + apr_pool_t *p) { ULONG rc = DosMove(from_path, to_path); @@ -203,7 +203,7 @@ ap_status_t ap_rename_file(const char *from_path, const char *to_path, -ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file) +apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file) { if (file == NULL) { return APR_ENOFILE; @@ -215,11 +215,11 @@ ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file) -ap_status_t ap_put_os_file(ap_file_t **file, ap_os_file_t *thefile, ap_pool_t *cont) +apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont) { - ap_os_file_t *dafile = thefile; + apr_os_file_t *dafile = thefile; if ((*file) == NULL) { - (*file) = (ap_file_t *)ap_palloc(cont, sizeof(ap_file_t)); + (*file) = (apr_file_t *)apr_palloc(cont, sizeof(apr_file_t)); (*file)->cntxt = cont; } (*file)->filedes = *dafile; @@ -233,7 +233,7 @@ ap_status_t ap_put_os_file(ap_file_t **file, ap_os_file_t *thefile, ap_pool_t *c -ap_status_t ap_eof(ap_file_t *fptr) +apr_status_t apr_eof(apr_file_t *fptr) { if (!fptr->isopen || fptr->eof_hit == 1) { return APR_EOF; @@ -243,9 +243,9 @@ ap_status_t ap_eof(ap_file_t *fptr) -ap_status_t ap_open_stderr(ap_file_t **thefile, ap_pool_t *cont) +apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) { - (*thefile) = ap_palloc(cont, sizeof(ap_file_t)); + (*thefile) = apr_palloc(cont, sizeof(apr_file_t)); if ((*thefile) == NULL) { return APR_ENOMEM; } diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c index 8c4482188..c3b01aa8e 100644 --- a/file_io/os2/pipe.c +++ b/file_io/os2/pipe.c @@ -60,7 +60,7 @@ #include <string.h> #include <process.h> -ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) +apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) { ULONG filedes[2]; ULONG rc, action; @@ -90,7 +90,7 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) return APR_OS2_STATUS(rc); } - (*in) = (ap_file_t *)ap_palloc(cont, sizeof(ap_file_t)); + (*in) = (apr_file_t *)apr_palloc(cont, sizeof(apr_file_t)); rc = DosCreateEventSem(NULL, &(*in)->pipeSem, DC_SEM_SHARED, FALSE); if (rc) { @@ -114,31 +114,31 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) (*in)->cntxt = cont; (*in)->filedes = filedes[0]; - (*in)->fname = ap_pstrdup(cont, pipename); + (*in)->fname = apr_pstrdup(cont, pipename); (*in)->isopen = TRUE; (*in)->buffered = FALSE; (*in)->flags = 0; (*in)->pipe = 1; (*in)->timeout = -1; - ap_register_cleanup(cont, *in, apr_file_cleanup, ap_null_cleanup); + apr_register_cleanup(cont, *in, apr_file_cleanup, apr_null_cleanup); - (*out) = (ap_file_t *)ap_palloc(cont, sizeof(ap_file_t)); + (*out) = (apr_file_t *)apr_palloc(cont, sizeof(apr_file_t)); (*out)->cntxt = cont; (*out)->filedes = filedes[1]; - (*out)->fname = ap_pstrdup(cont, pipename); + (*out)->fname = apr_pstrdup(cont, pipename); (*out)->isopen = TRUE; (*out)->buffered = FALSE; (*out)->flags = 0; (*out)->pipe = 1; (*out)->timeout = -1; - ap_register_cleanup(cont, *out, apr_file_cleanup, ap_null_cleanup); + apr_register_cleanup(cont, *out, apr_file_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_create_namedpipe(const char *filename, ap_fileperms_t perm, ap_pool_t *cont) +apr_status_t apr_create_namedpipe(const char *filename, apr_fileperms_t perm, apr_pool_t *cont) { /* Not yet implemented, interface not suitable */ return APR_ENOTIMPL; @@ -146,7 +146,7 @@ ap_status_t ap_create_namedpipe(const char *filename, ap_fileperms_t perm, ap_po -ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout) +apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout) { if (thepipe->pipe == 1) { thepipe->timeout = timeout; diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 234689aaa..5bf040ac3 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -62,7 +62,7 @@ #include <os2.h> #include <malloc.h> -ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) +apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_ssize_t *nbytes) { ULONG rc = 0; ULONG bytesread; @@ -77,10 +77,10 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) ULONG blocksize; ULONG size = *nbytes; - ap_lock(thefile->mutex); + apr_lock(thefile->mutex); if (thefile->direction == 1) { - ap_flush(thefile); + apr_flush(thefile); thefile->bufpos = 0; thefile->direction = 0; thefile->dataRead = 0; @@ -106,7 +106,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) } *nbytes = rc == 0 ? pos - (char *)buf : 0; - ap_unlock(thefile->mutex); + apr_unlock(thefile->mutex); return APR_OS2_STATUS(rc); } else { if (thefile->pipe) @@ -138,7 +138,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) -ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) +apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_ssize_t *nbytes) { ULONG rc = 0; ULONG byteswritten; @@ -153,7 +153,7 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) int blocksize; int size = *nbytes; - ap_lock(thefile->mutex); + apr_lock(thefile->mutex); if ( thefile->direction == 0 ) { // Position file pointer for writing at the offset we are logically reading from @@ -166,7 +166,7 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) while (rc == 0 && size > 0) { if (thefile->bufpos == APR_FILE_BUFSIZE) // write buffer is full - rc = ap_flush(thefile); + rc = apr_flush(thefile); blocksize = size > APR_FILE_BUFSIZE - thefile->bufpos ? APR_FILE_BUFSIZE - thefile->bufpos : size; memcpy(thefile->buffer + thefile->bufpos, pos, blocksize); @@ -175,7 +175,7 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) size -= blocksize; } - ap_unlock(thefile->mutex); + apr_unlock(thefile->mutex); return APR_OS2_STATUS(rc); } else { rc = DosWrite(thefile->filedes, buf, *nbytes, &byteswritten); @@ -194,7 +194,7 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) #ifdef HAVE_WRITEV -ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec, ap_size_t nvec, ap_ssize_t *nbytes) +apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_ssize_t *nbytes) { int bytes; if ((bytes = writev(thefile->filedes, vec, nvec)) < 0) { @@ -210,7 +210,7 @@ ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec, ap_size_t nve -ap_status_t ap_putc(char ch, ap_file_t *thefile) +apr_status_t apr_putc(char ch, apr_file_t *thefile) { ULONG rc; ULONG byteswritten; @@ -230,15 +230,15 @@ ap_status_t ap_putc(char ch, ap_file_t *thefile) -ap_status_t ap_ungetc(char ch, ap_file_t *thefile) +apr_status_t apr_ungetc(char ch, apr_file_t *thefile) { - ap_off_t offset = -1; - return ap_seek(thefile, APR_CUR, &offset); + apr_off_t offset = -1; + return apr_seek(thefile, APR_CUR, &offset); } -ap_status_t ap_getc(char *ch, ap_file_t *thefile) +apr_status_t apr_getc(char *ch, apr_file_t *thefile) { ULONG rc; int bytesread; @@ -248,7 +248,7 @@ ap_status_t ap_getc(char *ch, ap_file_t *thefile) } bytesread = 1; - rc = ap_read(thefile, ch, &bytesread); + rc = apr_read(thefile, ch, &bytesread); if (rc) { return rc; @@ -264,17 +264,17 @@ ap_status_t ap_getc(char *ch, ap_file_t *thefile) -ap_status_t ap_puts(const char *str, ap_file_t *thefile) +apr_status_t apr_puts(const char *str, apr_file_t *thefile) { - ap_ssize_t len; + apr_ssize_t len; len = strlen(str); - return ap_write(thefile, str, &len); + return apr_write(thefile, str, &len); } -ap_status_t ap_flush(ap_file_t *thefile) +apr_status_t apr_flush(apr_file_t *thefile) { if (thefile->buffered) { ULONG written = 0; @@ -299,15 +299,15 @@ ap_status_t ap_flush(ap_file_t *thefile) -ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) +apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) { ssize_t readlen; - ap_status_t rv = APR_SUCCESS; + apr_status_t rv = APR_SUCCESS; int i; for (i = 0; i < len-1; i++) { readlen = 1; - rv = ap_read(thefile, str+i, &readlen); + rv = apr_read(thefile, str+i, &readlen); if (readlen != 1) { rv = APR_EOF; @@ -325,7 +325,7 @@ ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) -APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) +APR_EXPORT(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) { int cc; va_list ap; @@ -337,8 +337,8 @@ APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) return 0; } va_start(ap, format); - len = ap_vsnprintf(buf, HUGE_STRING_LEN, format, ap); - cc = ap_puts(buf, fptr); + len = apr_vsnprintf(buf, HUGE_STRING_LEN, format, ap); + cc = apr_puts(buf, fptr); va_end(ap); free(buf); return (cc == APR_SUCCESS) ? len : -1; @@ -346,7 +346,7 @@ APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) -ap_status_t ap_file_check_read(ap_file_t *fd) +apr_status_t ap_file_check_read(apr_file_t *fd) { int rc; diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c index e303cf41c..948f423f6 100644 --- a/file_io/os2/seek.c +++ b/file_io/os2/seek.c @@ -63,13 +63,13 @@ -static ap_status_t setptr(ap_file_t *thefile, unsigned long pos ) +static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) { long newbufpos; ULONG rc; if (thefile->direction == 1) { - ap_flush(thefile); + apr_flush(thefile); thefile->bufpos = thefile->direction = thefile->dataRead = 0; } @@ -89,7 +89,7 @@ static ap_status_t setptr(ap_file_t *thefile, unsigned long pos ) -ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where, ap_off_t *offset) +apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) { if (!thefile->isopen) { return APR_EBADF; @@ -97,7 +97,7 @@ ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where, ap_off_t *offset) if (thefile->buffered) { int rc = EINVAL; - ap_finfo_t finfo; + apr_finfo_t finfo; switch (where) { case APR_SET: @@ -109,7 +109,7 @@ ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where, ap_off_t *offset) break; case APR_END: - rc = ap_getfileinfo(&finfo, thefile); + rc = apr_getfileinfo(&finfo, thefile); if (rc == APR_SUCCESS) rc = setptr(thefile, finfo.size - *offset); break; diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index f1599d1de..2bddb4a31 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -56,9 +56,9 @@ #include "apr_strings.h" #include "apr_portable.h" -static ap_status_t dir_cleanup(void *thedir) +static apr_status_t dir_cleanup(void *thedir) { - ap_dir_t *dir = thedir; + apr_dir_t *dir = thedir; if (closedir(dir->dirstruct) == 0) { return APR_SUCCESS; } @@ -67,50 +67,50 @@ static ap_status_t dir_cleanup(void *thedir) } } -ap_status_t ap_opendir(ap_dir_t **new, const char *dirname, ap_pool_t *cont) +apr_status_t apr_opendir(apr_dir_t **new, const char *dirname, apr_pool_t *cont) { /* On some platforms (e.g., Linux+GNU libc), d_name[] in struct * dirent is declared with enough storage for the name. On other * platforms (e.g., Solaris 8 for Intel), d_name is declared as a * one-byte array. Note: gcc evaluates this at compile time. */ - ap_size_t dirent_size = + apr_size_t dirent_size = (sizeof((*new)->entry->d_name) > 1 ? sizeof(struct dirent) : sizeof (struct dirent) + 255); - (*new) = (ap_dir_t *)ap_palloc(cont, sizeof(ap_dir_t)); + (*new) = (apr_dir_t *)apr_palloc(cont, sizeof(apr_dir_t)); (*new)->cntxt = cont; - (*new)->dirname = ap_pstrdup(cont, dirname); + (*new)->dirname = apr_pstrdup(cont, dirname); (*new)->dirstruct = opendir(dirname); - (*new)->entry = ap_pcalloc(cont, dirent_size); + (*new)->entry = apr_pcalloc(cont, dirent_size); if ((*new)->dirstruct == NULL) { return errno; } else { - ap_register_cleanup((*new)->cntxt, (void *)(*new), dir_cleanup, - ap_null_cleanup); + apr_register_cleanup((*new)->cntxt, (void *)(*new), dir_cleanup, + apr_null_cleanup); return APR_SUCCESS; } } -ap_status_t ap_closedir(ap_dir_t *thedir) +apr_status_t apr_closedir(apr_dir_t *thedir) { - ap_status_t rv; + apr_status_t rv; if ((rv = dir_cleanup(thedir)) == APR_SUCCESS) { - ap_kill_cleanup(thedir->cntxt, thedir, dir_cleanup); + apr_kill_cleanup(thedir->cntxt, thedir, dir_cleanup); return APR_SUCCESS; } return rv; } -ap_status_t ap_readdir(ap_dir_t *thedir) +apr_status_t apr_readdir(apr_dir_t *thedir) { #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \ && !defined(READDIR_IS_THREAD_SAFE) - ap_status_t ret; + apr_status_t ret; #endif #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \ @@ -135,15 +135,15 @@ ap_status_t ap_readdir(ap_dir_t *thedir) #endif } -ap_status_t ap_rewinddir(ap_dir_t *thedir) +apr_status_t apr_rewinddir(apr_dir_t *thedir) { rewinddir(thedir->dirstruct); return APR_SUCCESS; } -ap_status_t ap_make_dir(const char *path, ap_fileperms_t perm, ap_pool_t *cont) +apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *cont) { - mode_t mode = ap_unix_perms2mode(perm); + mode_t mode = apr_unix_perms2mode(perm); if (mkdir(path, mode) == 0) { return APR_SUCCESS; @@ -153,7 +153,7 @@ ap_status_t ap_make_dir(const char *path, ap_fileperms_t perm, ap_pool_t *cont) } } -ap_status_t ap_remove_dir(const char *path, ap_pool_t *cont) +apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) { if (rmdir(path) == 0) { return APR_SUCCESS; @@ -163,7 +163,7 @@ ap_status_t ap_remove_dir(const char *path, ap_pool_t *cont) } } -ap_status_t ap_dir_entry_size(ap_ssize_t *size, ap_dir_t *thedir) +apr_status_t apr_dir_entry_size(apr_ssize_t *size, apr_dir_t *thedir) { struct stat filestat; char *fname = NULL; @@ -172,7 +172,7 @@ ap_status_t ap_dir_entry_size(ap_ssize_t *size, ap_dir_t *thedir) *size = -1; return APR_ENOFILE; } - fname = ap_pstrcat(thedir->cntxt, thedir->dirname, "/", + fname = apr_pstrcat(thedir->cntxt, thedir->dirname, "/", thedir->entry->d_name, NULL); if (stat(fname, &filestat) == -1) { *size = -1; @@ -183,7 +183,7 @@ ap_status_t ap_dir_entry_size(ap_ssize_t *size, ap_dir_t *thedir) return APR_SUCCESS; } -ap_status_t ap_dir_entry_mtime(ap_time_t *mtime, ap_dir_t *thedir) +apr_status_t apr_dir_entry_mtime(apr_time_t *mtime, apr_dir_t *thedir) { struct stat filestat; char *fname = NULL; @@ -193,18 +193,18 @@ ap_status_t ap_dir_entry_mtime(ap_time_t *mtime, ap_dir_t *thedir) return APR_ENOFILE; } - fname = ap_pstrcat(thedir->cntxt, thedir->dirname, "/", + fname = apr_pstrcat(thedir->cntxt, thedir->dirname, "/", thedir->entry->d_name, NULL); if (stat(fname, &filestat) == -1) { *mtime = -1; return errno; } - ap_ansi_time_to_ap_time(mtime, filestat.st_mtime); + apr_ansi_time_to_ap_time(mtime, filestat.st_mtime); return APR_SUCCESS; } -ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, ap_dir_t *thedir) +apr_status_t apr_dir_entry_ftype(ap_filetype_e *type, apr_dir_t *thedir) { struct stat filestat; char *fname = NULL; @@ -214,7 +214,7 @@ ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, ap_dir_t *thedir) return APR_ENOFILE; } - fname = ap_pstrcat(thedir->cntxt, thedir->dirname, "/", + fname = apr_pstrcat(thedir->cntxt, thedir->dirname, "/", thedir->entry->d_name, NULL); if (stat(fname, &filestat) == -1) { *type = APR_REG; @@ -240,18 +240,18 @@ ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, ap_dir_t *thedir) return APR_SUCCESS; } -ap_status_t ap_get_dir_filename(char **new, ap_dir_t *thedir) +apr_status_t apr_get_dir_filename(char **new, apr_dir_t *thedir) { /* Detect End-Of-File */ if (thedir == NULL || thedir->entry == NULL) { *new = NULL; return APR_ENOENT; } - (*new) = ap_pstrdup(thedir->cntxt, thedir->entry->d_name); + (*new) = apr_pstrdup(thedir->cntxt, thedir->entry->d_name); return APR_SUCCESS; } -ap_status_t ap_get_os_dir(ap_os_dir_t **thedir, ap_dir_t *dir) +apr_status_t apr_get_os_dir(apr_os_dir_t **thedir, apr_dir_t *dir) { if (dir == NULL) { return APR_ENODIR; @@ -260,11 +260,11 @@ ap_status_t ap_get_os_dir(ap_os_dir_t **thedir, ap_dir_t *dir) return APR_SUCCESS; } -ap_status_t ap_put_os_dir(ap_dir_t **dir, ap_os_dir_t *thedir, - ap_pool_t *cont) +apr_status_t apr_put_os_dir(apr_dir_t **dir, apr_os_dir_t *thedir, + apr_pool_t *cont) { if ((*dir) == NULL) { - (*dir) = (ap_dir_t *)ap_pcalloc(cont, sizeof(ap_dir_t)); + (*dir) = (apr_dir_t *)apr_pcalloc(cont, sizeof(apr_dir_t)); (*dir)->cntxt = cont; } (*dir)->dirstruct = thedir; diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index 2a5135e82..f9ba9cd21 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -68,16 +68,16 @@ #else #include "fileio.h" #endif -/* A file to put ALL of the accessor functions for ap_file_t types. */ +/* A file to put ALL of the accessor functions for apr_file_t types. */ -ap_status_t ap_get_filename(char **fname, ap_file_t *thefile) +apr_status_t apr_get_filename(char **fname, apr_file_t *thefile) { - *fname = ap_pstrdup(thefile->cntxt, thefile->fname); + *fname = apr_pstrdup(thefile->cntxt, thefile->fname); return APR_SUCCESS; } #if !defined(OS2) && !defined(WIN32) -mode_t ap_unix_perms2mode(ap_fileperms_t perms) +mode_t apr_unix_perms2mode(apr_fileperms_t perms) { mode_t mode = 0; @@ -105,9 +105,9 @@ mode_t ap_unix_perms2mode(ap_fileperms_t perms) return mode; } -ap_fileperms_t ap_unix_mode2perms(mode_t mode) +apr_fileperms_t apr_unix_mode2perms(mode_t mode) { - ap_fileperms_t perms = 0; + apr_fileperms_t perms = 0; if (mode & S_IRUSR) perms |= APR_UREAD; @@ -134,13 +134,13 @@ ap_fileperms_t ap_unix_mode2perms(mode_t mode) } #endif -ap_status_t ap_get_filedata(void **data, const char *key, ap_file_t *file) +apr_status_t apr_get_filedata(void **data, const char *key, apr_file_t *file) { - return ap_get_userdata(data, key, file->cntxt); + return apr_get_userdata(data, key, file->cntxt); } -ap_status_t ap_set_filedata(ap_file_t *file, void *data, const char *key, - ap_status_t (*cleanup) (void *)) +apr_status_t apr_set_filedata(apr_file_t *file, void *data, const char *key, + apr_status_t (*cleanup) (void *)) { - return ap_set_userdata(data, key, cleanup, file->cntxt); + return apr_set_userdata(data, key, cleanup, file->cntxt); } diff --git a/file_io/unix/filedup.c b/file_io/unix/filedup.c index b1f4f5e4b..06956fac5 100644 --- a/file_io/unix/filedup.c +++ b/file_io/unix/filedup.c @@ -56,12 +56,12 @@ #include "apr_strings.h" #include "apr_portable.h" -ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) +apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { int have_file = 0; if ((*new_file) == NULL) { - (*new_file) = (ap_file_t *)ap_pcalloc(p, sizeof(ap_file_t)); + (*new_file) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); if ((*new_file) == NULL) { return APR_ENOMEM; } @@ -76,18 +76,18 @@ ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) else { (*new_file)->filedes = dup(old_file->filedes); } - (*new_file)->fname = ap_pstrdup(p, old_file->fname); + (*new_file)->fname = apr_pstrdup(p, old_file->fname); (*new_file)->buffered = old_file->buffered; if ((*new_file)->buffered) { #if APR_HAS_THREADS - ap_create_lock(&((*new_file)->thlock), APR_MUTEX, APR_INTRAPROCESS, NULL, + apr_create_lock(&((*new_file)->thlock), APR_MUTEX, APR_INTRAPROCESS, NULL, p); #endif - (*new_file)->buffer = ap_palloc(p, APR_FILE_BUFSIZE); + (*new_file)->buffer = apr_palloc(p, APR_FILE_BUFSIZE); } (*new_file)->blocking = old_file->blocking; /* this is the way dup() works */ - ap_register_cleanup((*new_file)->cntxt, (void *)(*new_file), ap_unix_file_cleanup, - ap_null_cleanup); + apr_register_cleanup((*new_file)->cntxt, (void *)(*new_file), apr_unix_file_cleanup, + apr_null_cleanup); return APR_SUCCESS; } diff --git a/file_io/unix/fileio.h b/file_io/unix/fileio.h index c91bb453d..2f202d90e 100644 --- a/file_io/unix/fileio.h +++ b/file_io/unix/fileio.h @@ -112,14 +112,14 @@ #define APR_FILE_BUFSIZE 4096 -struct ap_file_t { - ap_pool_t *cntxt; +struct apr_file_t { + apr_pool_t *cntxt; int filedes; char * fname; int oflags; int eof_hit; int pipe; - ap_interval_time_t timeout; + apr_interval_time_t timeout; int buffered; enum {BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking; int ungetchar; /* Last char provided by an unget op. (-1 = no char)*/ @@ -131,21 +131,21 @@ struct ap_file_t { int direction; /* buffer being used for 0 = read, 1 = write */ unsigned long filePtr; /* position in file of handle */ #if APR_HAS_THREADS - struct ap_lock_t *thlock; + struct apr_lock_t *thlock; #endif }; -struct ap_dir_t { - ap_pool_t *cntxt; +struct apr_dir_t { + apr_pool_t *cntxt; char *dirname; DIR *dirstruct; struct dirent *entry; }; -ap_status_t ap_unix_file_cleanup(void *); +apr_status_t apr_unix_file_cleanup(void *); -mode_t ap_unix_perms2mode(ap_fileperms_t perms); -ap_fileperms_t ap_unix_mode2perms(mode_t mode); +mode_t apr_unix_perms2mode(apr_fileperms_t perms); +apr_fileperms_t apr_unix_mode2perms(mode_t mode); #endif /* ! FILE_IO_H */ diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c index 5085901ba..07fc4281f 100644 --- a/file_io/unix/filestat.c +++ b/file_io/unix/filestat.c @@ -80,21 +80,21 @@ static ap_filetype_e filetype_from_mode(int mode) return type; } -ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile) +apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile) { struct stat info; if (fstat(thefile->filedes, &info) == 0) { - finfo->protection = ap_unix_mode2perms(info.st_mode); + finfo->protection = apr_unix_mode2perms(info.st_mode); finfo->filetype = filetype_from_mode(info.st_mode); finfo->user = info.st_uid; finfo->group = info.st_gid; finfo->size = info.st_size; finfo->inode = info.st_ino; finfo->device = info.st_dev; - ap_ansi_time_to_ap_time(&finfo->atime, info.st_atime); - ap_ansi_time_to_ap_time(&finfo->mtime, info.st_mtime); - ap_ansi_time_to_ap_time(&finfo->ctime, info.st_ctime); + apr_ansi_time_to_ap_time(&finfo->atime, info.st_atime); + apr_ansi_time_to_ap_time(&finfo->mtime, info.st_mtime); + apr_ansi_time_to_ap_time(&finfo->ctime, info.st_ctime); return APR_SUCCESS; } else { @@ -102,30 +102,30 @@ ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile) } } -ap_status_t ap_setfileperms(const char *fname, ap_fileperms_t perms) +apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms) { - mode_t mode = ap_unix_perms2mode(perms); + mode_t mode = apr_unix_perms2mode(perms); if (chmod(fname, mode) == -1) return errno; return APR_SUCCESS; } -ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) +apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) { struct stat info; if (stat(fname, &info) == 0) { - finfo->protection = ap_unix_mode2perms(info.st_mode); + finfo->protection = apr_unix_mode2perms(info.st_mode); finfo->filetype = filetype_from_mode(info.st_mode); finfo->user = info.st_uid; finfo->group = info.st_gid; finfo->size = info.st_size; finfo->inode = info.st_ino; finfo->device = info.st_dev; - ap_ansi_time_to_ap_time(&finfo->atime, info.st_atime); - ap_ansi_time_to_ap_time(&finfo->mtime, info.st_mtime); - ap_ansi_time_to_ap_time(&finfo->ctime, info.st_ctime); + apr_ansi_time_to_ap_time(&finfo->atime, info.st_atime); + apr_ansi_time_to_ap_time(&finfo->mtime, info.st_mtime); + apr_ansi_time_to_ap_time(&finfo->ctime, info.st_ctime); return APR_SUCCESS; } else { @@ -133,21 +133,21 @@ ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) } } -ap_status_t ap_lstat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) +apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) { struct stat info; if (lstat(fname, &info) == 0) { - finfo->protection = ap_unix_mode2perms(info.st_mode); + finfo->protection = apr_unix_mode2perms(info.st_mode); finfo->filetype = filetype_from_mode(info.st_mode); finfo->user = info.st_uid; finfo->group = info.st_gid; finfo->size = info.st_size; finfo->inode = info.st_ino; finfo->device = info.st_dev; - ap_ansi_time_to_ap_time(&finfo->atime, info.st_atime); - ap_ansi_time_to_ap_time(&finfo->mtime, info.st_mtime); - ap_ansi_time_to_ap_time(&finfo->ctime, info.st_ctime); + apr_ansi_time_to_ap_time(&finfo->atime, info.st_atime); + apr_ansi_time_to_ap_time(&finfo->mtime, info.st_mtime); + apr_ansi_time_to_ap_time(&finfo->ctime, info.st_ctime); return APR_SUCCESS; } else { diff --git a/file_io/unix/fullrw.c b/file_io/unix/fullrw.c index b88a7e5c7..9e5e31589 100644 --- a/file_io/unix/fullrw.c +++ b/file_io/unix/fullrw.c @@ -55,16 +55,16 @@ #include "apr_file_io.h" -ap_status_t ap_full_read(ap_file_t *thefile, void *buf, ap_size_t nbytes, - ap_size_t *bytes_read) +apr_status_t apr_full_read(apr_file_t *thefile, void *buf, apr_size_t nbytes, + apr_size_t *bytes_read) { - ap_status_t status; - ap_size_t total_read = 0; + apr_status_t status; + apr_size_t total_read = 0; do { - ap_ssize_t amt = (ap_ssize_t)nbytes; + apr_ssize_t amt = (apr_ssize_t)nbytes; - status = ap_read(thefile, buf, &amt); + status = apr_read(thefile, buf, &amt); buf = (char *)buf + amt; nbytes -= amt; total_read += amt; @@ -76,16 +76,16 @@ ap_status_t ap_full_read(ap_file_t *thefile, void *buf, ap_size_t nbytes, return status; } -ap_status_t ap_full_write(ap_file_t *thefile, const void *buf, - ap_size_t nbytes, ap_size_t *bytes_written) +apr_status_t apr_full_write(apr_file_t *thefile, const void *buf, + apr_size_t nbytes, apr_size_t *bytes_written) { - ap_status_t status; - ap_size_t total_written = 0; + apr_status_t status; + apr_size_t total_written = 0; do { - ap_ssize_t amt = (ap_ssize_t)nbytes; + apr_ssize_t amt = (apr_ssize_t)nbytes; - status = ap_write(thefile, buf, &amt); + status = apr_write(thefile, buf, &amt); buf = (char *)buf + amt; nbytes -= amt; total_written += amt; diff --git a/file_io/unix/open.c b/file_io/unix/open.c index a7c88cada..199c2ae75 100644 --- a/file_io/unix/open.c +++ b/file_io/unix/open.c @@ -56,9 +56,9 @@ #include "apr_strings.h" #include "apr_portable.h" -ap_status_t ap_unix_file_cleanup(void *thefile) +apr_status_t apr_unix_file_cleanup(void *thefile) { - ap_file_t *file = thefile; + apr_file_t *file = thefile; int rv; rv = close(file->filedes); @@ -67,7 +67,7 @@ ap_status_t ap_unix_file_cleanup(void *thefile) file->filedes = -1; #if APR_HAS_THREADS if (file->thlock) { - return ap_destroy_lock(file->thlock); + return apr_destroy_lock(file->thlock); } #endif return APR_SUCCESS; @@ -78,15 +78,15 @@ ap_status_t ap_unix_file_cleanup(void *thefile) } } -ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fileperms_t perm, ap_pool_t *cont) +apr_status_t apr_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont) { int oflags = 0; #if APR_HAS_THREADS - ap_status_t rv; + apr_status_t rv; #endif if ((*new) == NULL) { - (*new) = (ap_file_t *)ap_pcalloc(cont, sizeof(ap_file_t)); + (*new) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); } (*new)->cntxt = cont; @@ -106,15 +106,15 @@ ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fil return APR_EACCES; } - (*new)->fname = ap_pstrdup(cont, fname); + (*new)->fname = apr_pstrdup(cont, fname); (*new)->blocking = BLK_ON; (*new)->buffered = (flag & APR_BUFFERED) > 0; if ((*new)->buffered) { - (*new)->buffer = ap_palloc(cont, APR_FILE_BUFSIZE); + (*new)->buffer = apr_palloc(cont, APR_FILE_BUFSIZE); #if APR_HAS_THREADS - rv = ap_create_lock(&((*new)->thlock), APR_MUTEX, APR_INTRAPROCESS, + rv = apr_create_lock(&((*new)->thlock), APR_MUTEX, APR_INTRAPROCESS, NULL, cont); if (rv) { return rv; @@ -146,7 +146,7 @@ ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fil (*new)->filedes = open(fname, oflags, 0666); } else { - (*new)->filedes = open(fname, oflags, ap_unix_perms2mode(perm)); + (*new)->filedes = open(fname, oflags, apr_unix_perms2mode(perm)); } if ((*new)->filedes < 0) { @@ -166,27 +166,27 @@ ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, ap_fil (*new)->bufpos = 0; (*new)->dataRead = 0; (*new)->direction = 0; - ap_register_cleanup((*new)->cntxt, (void *)(*new), ap_unix_file_cleanup, - ap_null_cleanup); + apr_register_cleanup((*new)->cntxt, (void *)(*new), apr_unix_file_cleanup, + apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_close(ap_file_t *file) +apr_status_t apr_close(apr_file_t *file) { - ap_status_t flush_rv = APR_SUCCESS, rv; + apr_status_t flush_rv = APR_SUCCESS, rv; if (file->buffered) { - flush_rv = ap_flush(file); + flush_rv = apr_flush(file); } - if ((rv = ap_unix_file_cleanup(file)) == APR_SUCCESS) { - ap_kill_cleanup(file->cntxt, file, ap_unix_file_cleanup); + if ((rv = apr_unix_file_cleanup(file)) == APR_SUCCESS) { + apr_kill_cleanup(file->cntxt, file, apr_unix_file_cleanup); return APR_SUCCESS; } return rv ? rv : flush_rv; } -ap_status_t ap_remove_file(const char *path, ap_pool_t *cont) +apr_status_t apr_remove_file(const char *path, apr_pool_t *cont) { if (unlink(path) == 0) { return APR_SUCCESS; @@ -196,8 +196,8 @@ ap_status_t ap_remove_file(const char *path, ap_pool_t *cont) } } -ap_status_t ap_rename_file(const char *from_path, const char *to_path, - ap_pool_t *p) +apr_status_t apr_rename_file(const char *from_path, const char *to_path, + apr_pool_t *p) { if (rename(from_path, to_path) != 0) { return errno; @@ -205,7 +205,7 @@ ap_status_t ap_rename_file(const char *from_path, const char *to_path, return APR_SUCCESS; } -ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file) +apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file) { if (file == NULL) { return APR_ENOFILE; @@ -215,13 +215,13 @@ ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file) return APR_SUCCESS; } -ap_status_t ap_put_os_file(ap_file_t **file, ap_os_file_t *thefile, - ap_pool_t *cont) +apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, + apr_pool_t *cont) { int *dafile = thefile; if ((*file) == NULL) { - (*file) = ap_pcalloc(cont, sizeof(ap_file_t)); + (*file) = apr_pcalloc(cont, sizeof(apr_file_t)); (*file)->cntxt = cont; } (*file)->eof_hit = 0; @@ -235,7 +235,7 @@ ap_status_t ap_put_os_file(ap_file_t **file, ap_os_file_t *thefile, return APR_SUCCESS; } -ap_status_t ap_eof(ap_file_t *fptr) +apr_status_t apr_eof(apr_file_t *fptr) { if (fptr->eof_hit == 1) { return APR_EOF; @@ -243,7 +243,7 @@ ap_status_t ap_eof(ap_file_t *fptr) return APR_SUCCESS; } -ap_status_t ap_ferror(ap_file_t *fptr) +apr_status_t apr_ferror(apr_file_t *fptr) { /* This function should be removed ASAP. It is next on my list once * I am sure nobody is using it. @@ -251,12 +251,12 @@ ap_status_t ap_ferror(ap_file_t *fptr) return APR_SUCCESS; } -/* ap_open_stderr() could just call ap_put_os_file() with +/* apr_open_stderr() could just call apr_put_os_file() with * STDERR_FILENO for the descriptor... */ -ap_status_t ap_open_stderr(ap_file_t **thefile, ap_pool_t *cont) +apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) { - (*thefile) = ap_pcalloc(cont, sizeof(ap_file_t)); + (*thefile) = apr_pcalloc(cont, sizeof(apr_file_t)); if ((*thefile) == NULL) { return APR_ENOMEM; } diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c index 0c666d674..aa23bcc3e 100644 --- a/file_io/unix/pipe.c +++ b/file_io/unix/pipe.c @@ -55,7 +55,7 @@ #include "fileio.h" #include "apr_strings.h" -static ap_status_t pipeblock(ap_file_t *thepipe) +static apr_status_t pipeblock(apr_file_t *thepipe) { #if !BEOS /* this code won't work on BeOS */ int fd_flags; @@ -91,7 +91,7 @@ static ap_status_t pipeblock(ap_file_t *thepipe) return APR_SUCCESS; } -static ap_status_t pipenonblock(ap_file_t *thepipe) +static apr_status_t pipenonblock(apr_file_t *thepipe) { #if !BEOS /* this code won't work on BeOS */ int fd_flags = fcntl(thepipe->filedes, F_GETFL, 0); @@ -126,7 +126,7 @@ static ap_status_t pipenonblock(ap_file_t *thepipe) return APR_SUCCESS; } -ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout) +apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout) { if (thepipe->pipe == 1) { thepipe->timeout = timeout; @@ -145,7 +145,7 @@ ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout) return APR_EINVAL; } -ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) +apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) { int filedes[2]; @@ -153,11 +153,11 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) return errno; } - (*in) = (ap_file_t *)ap_pcalloc(cont, sizeof(ap_file_t)); + (*in) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); (*in)->cntxt = cont; (*in)->filedes = filedes[0]; (*in)->pipe = 1; - (*in)->fname = ap_pstrdup(cont, "PIPE"); + (*in)->fname = apr_pstrdup(cont, "PIPE"); (*in)->buffered = 0; (*in)->blocking = BLK_ON; (*in)->timeout = -1; @@ -166,11 +166,11 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) (*in)->thlock = NULL; #endif - (*out) = (ap_file_t *)ap_pcalloc(cont, sizeof(ap_file_t)); + (*out) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); (*out)->cntxt = cont; (*out)->filedes = filedes[1]; (*out)->pipe = 1; - (*out)->fname = ap_pstrdup(cont, "PIPE"); + (*out)->fname = apr_pstrdup(cont, "PIPE"); (*out)->buffered = 0; (*out)->blocking = BLK_ON; (*out)->timeout = -1; @@ -181,10 +181,10 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_create_namedpipe(const char *filename, - ap_fileperms_t perm, ap_pool_t *cont) +apr_status_t apr_create_namedpipe(const char *filename, + apr_fileperms_t perm, apr_pool_t *cont) { - mode_t mode = ap_unix_perms2mode(perm); + mode_t mode = apr_unix_perms2mode(perm); if (mkfifo(filename, mode) == -1) { return errno; diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index a3fb36ee0..6fdb136c2 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -62,7 +62,7 @@ #endif #ifdef USE_WAIT_FOR_IO -static ap_status_t wait_for_io_or_timeout(ap_file_t *file, int for_read) +static apr_status_t wait_for_io_or_timeout(apr_file_t *file, int for_read) { struct timeval tv, *tvptr; fd_set fdset; @@ -101,10 +101,10 @@ static ap_status_t wait_for_io_or_timeout(ap_file_t *file, int for_read) /* problems: * 1) ungetchar not used for buffered files */ -ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) +apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_ssize_t *nbytes) { - ap_ssize_t rv; - ap_ssize_t bytes_read; + apr_ssize_t rv; + apr_ssize_t bytes_read; if (*nbytes <= 0) { *nbytes = 0; @@ -113,15 +113,15 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) if (thefile->buffered) { char *pos = (char *)buf; - ap_uint64_t blocksize; - ap_uint64_t size = *nbytes; + apr_uint64_t blocksize; + apr_uint64_t size = *nbytes; #if APR_HAS_THREADS - ap_lock(thefile->thlock); + apr_lock(thefile->thlock); #endif if (thefile->direction == 1) { - ap_flush(thefile); + apr_flush(thefile); thefile->bufpos = 0; thefile->direction = 0; thefile->dataRead = 0; @@ -156,7 +156,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) rv = 0; } #if APR_HAS_THREADS - ap_unlock(thefile->thlock); + apr_unlock(thefile->thlock); #endif return rv; } @@ -181,7 +181,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && thefile->timeout != 0) { - ap_status_t arv = wait_for_io_or_timeout(thefile, 1); + apr_status_t arv = wait_for_io_or_timeout(thefile, 1); if (arv != APR_SUCCESS) { *nbytes = bytes_read; return arv; @@ -205,9 +205,9 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) } } -ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) +apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_ssize_t *nbytes) { - ap_size_t rv; + apr_size_t rv; if (thefile->buffered) { char *pos = (char *)buf; @@ -215,14 +215,14 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) int size = *nbytes; #if APR_HAS_THREADS - ap_lock(thefile->thlock); + apr_lock(thefile->thlock); #endif if ( thefile->direction == 0 ) { /* Position file pointer for writing at the offset we are * logically reading from */ - ap_int64_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; + apr_int64_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; if (offset != thefile->filePtr) lseek(thefile->filedes, offset, SEEK_SET); thefile->bufpos = thefile->dataRead = 0; @@ -232,7 +232,7 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) rv = 0; while (rv == 0 && size > 0) { if (thefile->bufpos == APR_FILE_BUFSIZE) /* write buffer is full*/ - ap_flush(thefile); + apr_flush(thefile); blocksize = size > APR_FILE_BUFSIZE - thefile->bufpos ? APR_FILE_BUFSIZE - thefile->bufpos : size; @@ -243,19 +243,19 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) } #if APR_HAS_THREADS - ap_unlock(thefile->thlock); + apr_unlock(thefile->thlock); #endif return rv; } else { do { rv = write(thefile->filedes, buf, *nbytes); - } while (rv == (ap_size_t)-1 && errno == EINTR); + } while (rv == (apr_size_t)-1 && errno == EINTR); #ifdef USE_WAIT_FOR_IO - if (rv == (ap_size_t)-1 && + if (rv == (apr_size_t)-1 && (errno == EAGAIN || errno == EWOULDBLOCK) && thefile->timeout != 0) { - ap_status_t arv = wait_for_io_or_timeout(thefile, 0); + apr_status_t arv = wait_for_io_or_timeout(thefile, 0); if (arv != APR_SUCCESS) { *nbytes = 0; return arv; @@ -263,11 +263,11 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) else { do { rv = write(thefile->filedes, buf, *nbytes); - } while (rv == (ap_size_t)-1 && errno == EINTR); + } while (rv == (apr_size_t)-1 && errno == EINTR); } } #endif - if (rv == (ap_size_t)-1) { + if (rv == (apr_size_t)-1) { (*nbytes) = 0; return errno; } @@ -276,8 +276,8 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) } } -ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec, - ap_size_t nvec, ap_ssize_t *nbytes) +apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, + apr_size_t nvec, apr_ssize_t *nbytes) { #ifdef HAVE_WRITEV int bytes; @@ -292,11 +292,11 @@ ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec, } #else *nbytes = vec[0].iov_len; - return ap_write(thefile, vec[0].iov_base, nbytes); + return apr_write(thefile, vec[0].iov_base, nbytes); #endif } -ap_status_t ap_putc(char ch, ap_file_t *thefile) +apr_status_t apr_putc(char ch, apr_file_t *thefile) { if (write(thefile->filedes, &ch, 1) != 1) { return errno; @@ -304,20 +304,20 @@ ap_status_t ap_putc(char ch, ap_file_t *thefile) return APR_SUCCESS; } -ap_status_t ap_ungetc(char ch, ap_file_t *thefile) +apr_status_t apr_ungetc(char ch, apr_file_t *thefile) { thefile->ungetchar = (unsigned char)ch; return APR_SUCCESS; } -ap_status_t ap_getc(char *ch, ap_file_t *thefile) +apr_status_t apr_getc(char *ch, apr_file_t *thefile) { - ap_ssize_t nbytes = 1; + apr_ssize_t nbytes = 1; - return ap_read(thefile, ch, &nbytes); + return apr_read(thefile, ch, &nbytes); } -ap_status_t ap_puts(const char *str, ap_file_t *thefile) +apr_status_t apr_puts(const char *str, apr_file_t *thefile) { ssize_t rv; int len; @@ -330,10 +330,10 @@ ap_status_t ap_puts(const char *str, ap_file_t *thefile) return APR_SUCCESS; } -ap_status_t ap_flush(ap_file_t *thefile) +apr_status_t apr_flush(apr_file_t *thefile) { if (thefile->buffered) { - ap_int64_t written = 0; + apr_int64_t written = 0; int rc = 0; if (thefile->direction == 1 && thefile->bufpos) { @@ -352,10 +352,10 @@ ap_status_t ap_flush(ap_file_t *thefile) return APR_SUCCESS; } -ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) +apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) { - ap_status_t rv = APR_SUCCESS; /* get rid of gcc warning */ - ap_ssize_t nbytes; + apr_status_t rv = APR_SUCCESS; /* get rid of gcc warning */ + apr_ssize_t nbytes; char *final = str + len - 1; if (len <= 1) { @@ -366,7 +366,7 @@ ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) while (str < final) { /* leave room for trailing '\0' */ nbytes = 1; - rv = ap_read(thefile, str, &nbytes); + rv = apr_read(thefile, str, &nbytes); if (rv != APR_SUCCESS) { break; } @@ -383,7 +383,7 @@ ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) return rv; } -APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) +APR_EXPORT(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) { int cc; va_list ap; @@ -395,8 +395,8 @@ APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) return 0; } va_start(ap, format); - len = ap_vsnprintf(buf, HUGE_STRING_LEN, format, ap); - cc = ap_puts(buf, fptr); + len = apr_vsnprintf(buf, HUGE_STRING_LEN, format, ap); + cc = apr_puts(buf, fptr); va_end(ap); free(buf); return (cc == APR_SUCCESS) ? len : -1; diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index 1fcb0cbab..3ab2aca93 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -54,13 +54,13 @@ #include "fileio.h" -static ap_status_t setptr(ap_file_t *thefile, unsigned long pos ) +static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) { long newbufpos; int rc; if (thefile->direction == 1) { - ap_flush(thefile); + apr_flush(thefile); thefile->bufpos = thefile->direction = thefile->dataRead = 0; } @@ -85,14 +85,14 @@ static ap_status_t setptr(ap_file_t *thefile, unsigned long pos ) } -ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where, ap_off_t *offset) +apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) { - ap_off_t rv; + apr_off_t rv; if (thefile->buffered) { int rc = EINVAL; - ap_finfo_t finfo; + apr_finfo_t finfo; switch (where) { case APR_SET: @@ -104,7 +104,7 @@ ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where, ap_off_t *offset) break; case APR_END: - rc = ap_getfileinfo(&finfo, thefile); + rc = apr_getfileinfo(&finfo, thefile); if (rc == APR_SUCCESS) rc = setptr(thefile, finfo.size - *offset); break; diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 7dd3704bd..a9ce5d3fa 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -72,47 +72,47 @@ #include <sys/stat.h> #endif -ap_status_t dir_cleanup(void *thedir) +apr_status_t dir_cleanup(void *thedir) { - ap_dir_t *dir = thedir; + apr_dir_t *dir = thedir; if (!CloseHandle(dir->dirhand)) { return GetLastError(); } return APR_SUCCESS; } -ap_status_t ap_opendir(ap_dir_t **new, const char *dirname, ap_pool_t *cont) +apr_status_t apr_opendir(apr_dir_t **new, const char *dirname, apr_pool_t *cont) { char * temp; - (*new) = ap_pcalloc(cont, sizeof(ap_dir_t)); + (*new) = apr_pcalloc(cont, sizeof(apr_dir_t)); (*new)->cntxt = cont; (*new)->entry = NULL; temp = canonical_filename((*new)->cntxt, dirname); if (temp[strlen(temp)] == '/') { - (*new)->dirname = ap_pstrcat(cont, dirname, "*", NULL); + (*new)->dirname = apr_pstrcat(cont, dirname, "*", NULL); } else { - (*new)->dirname = ap_pstrcat(cont, dirname, "/*", NULL); + (*new)->dirname = apr_pstrcat(cont, dirname, "/*", NULL); } (*new)->dirhand = INVALID_HANDLE_VALUE; - ap_register_cleanup((*new)->cntxt, (void *)(*new), dir_cleanup, - ap_null_cleanup); + apr_register_cleanup((*new)->cntxt, (void *)(*new), dir_cleanup, + apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_closedir(ap_dir_t *thedir) +apr_status_t apr_closedir(apr_dir_t *thedir) { if (!FindClose(thedir->dirhand)) { return GetLastError(); } - ap_kill_cleanup(thedir->cntxt, thedir, dir_cleanup); + apr_kill_cleanup(thedir->cntxt, thedir, dir_cleanup); return APR_SUCCESS; } -ap_status_t ap_readdir(ap_dir_t *thedir) +apr_status_t apr_readdir(apr_dir_t *thedir) { if (thedir->dirhand == INVALID_HANDLE_VALUE) { - thedir->entry = ap_pcalloc(thedir->cntxt, sizeof(WIN32_FIND_DATA)); + thedir->entry = apr_pcalloc(thedir->cntxt, sizeof(WIN32_FIND_DATA)); thedir->dirhand = FindFirstFile(thedir->dirname, thedir->entry); if (thedir->dirhand == INVALID_HANDLE_VALUE) { return GetLastError(); @@ -125,25 +125,25 @@ ap_status_t ap_readdir(ap_dir_t *thedir) return APR_SUCCESS; } -ap_status_t ap_rewinddir(ap_dir_t *thedir) +apr_status_t apr_rewinddir(apr_dir_t *thedir) { - ap_status_t stat; - ap_pool_t *cont = thedir->cntxt; - char *temp = ap_pstrdup(cont, thedir->dirname); + apr_status_t stat; + apr_pool_t *cont = thedir->cntxt; + char *temp = apr_pstrdup(cont, thedir->dirname); temp[strlen(temp) - 2] = '\0'; /*remove the \* at the end */ if (thedir->dirhand == INVALID_HANDLE_VALUE) { return APR_SUCCESS; } - if ((stat = ap_closedir(thedir)) == APR_SUCCESS) { - if ((stat = ap_opendir(&thedir, temp, cont)) == APR_SUCCESS) { - ap_readdir(thedir); + if ((stat = apr_closedir(thedir)) == APR_SUCCESS) { + if ((stat = apr_opendir(&thedir, temp, cont)) == APR_SUCCESS) { + apr_readdir(thedir); return APR_SUCCESS; } } return stat; } -ap_status_t ap_make_dir(const char *path, ap_fileperms_t perm, ap_pool_t *cont) +apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *cont) { if (!CreateDirectory(path, NULL)) { return GetLastError(); @@ -151,7 +151,7 @@ ap_status_t ap_make_dir(const char *path, ap_fileperms_t perm, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_remove_dir(const char *path, ap_pool_t *cont) +apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) { char *temp = canonical_filename(cont, path); if (!RemoveDirectory(temp)) { @@ -160,7 +160,7 @@ ap_status_t ap_remove_dir(const char *path, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_dir_entry_size(ap_ssize_t *size, ap_dir_t *thedir) +apr_status_t apr_dir_entry_size(apr_ssize_t *size, apr_dir_t *thedir) { if (thedir == NULL || thedir->entry == NULL) { return APR_ENODIR; @@ -170,7 +170,7 @@ ap_status_t ap_dir_entry_size(ap_ssize_t *size, ap_dir_t *thedir) return APR_SUCCESS; } -ap_status_t ap_dir_entry_mtime(ap_time_t *time, ap_dir_t *thedir) +apr_status_t apr_dir_entry_mtime(apr_time_t *time, apr_dir_t *thedir) { if (thedir == NULL || thedir->entry == NULL) { return APR_ENODIR; @@ -179,7 +179,7 @@ ap_status_t ap_dir_entry_mtime(ap_time_t *time, ap_dir_t *thedir) return APR_SUCCESS; } -ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, ap_dir_t *thedir) +apr_status_t apr_dir_entry_ftype(ap_filetype_e *type, apr_dir_t *thedir) { switch(thedir->entry->dwFileAttributes) { case FILE_ATTRIBUTE_DIRECTORY: { @@ -197,13 +197,13 @@ ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, ap_dir_t *thedir) } } -ap_status_t ap_get_dir_filename(char **new, ap_dir_t *thedir) +apr_status_t apr_get_dir_filename(char **new, apr_dir_t *thedir) { - (*new) = ap_pstrdup(thedir->cntxt, thedir->entry->cFileName); + (*new) = apr_pstrdup(thedir->cntxt, thedir->entry->cFileName); return APR_SUCCESS; } -ap_status_t ap_get_os_dir(ap_os_dir_t **thedir, ap_dir_t *dir) +apr_status_t apr_get_os_dir(apr_os_dir_t **thedir, apr_dir_t *dir) { if (dir == NULL) { return APR_ENODIR; @@ -212,13 +212,13 @@ ap_status_t ap_get_os_dir(ap_os_dir_t **thedir, ap_dir_t *dir) return APR_SUCCESS; } -ap_status_t ap_put_os_dir(ap_dir_t **dir, ap_os_dir_t *thedir, ap_pool_t *cont) +apr_status_t apr_put_os_dir(apr_dir_t **dir, apr_os_dir_t *thedir, apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; } if ((*dir) == NULL) { - (*dir) = (ap_dir_t *)ap_pcalloc(cont, sizeof(ap_dir_t)); + (*dir) = (apr_dir_t *)apr_pcalloc(cont, sizeof(apr_dir_t)); (*dir)->cntxt = cont; } (*dir)->dirhand = thedir; diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 9e8538700..67eae006e 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -58,7 +58,7 @@ #include "apr_strings.h" #include <string.h> -ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) +apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) { BOOLEAN isStdHandle = FALSE; HANDLE hCurrentProcess = GetCurrentProcess(); @@ -68,8 +68,8 @@ ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) p = old_file->cntxt; } - (*new_file) = (ap_file_t *) ap_pcalloc(p, - sizeof(ap_file_t)); + (*new_file) = (apr_file_t *) apr_pcalloc(p, + sizeof(apr_file_t)); if ((*new_file) == NULL) { return APR_ENOMEM; } @@ -104,9 +104,9 @@ ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) } (*new_file)->cntxt = old_file->cntxt; - (*new_file)->fname = ap_pstrdup(old_file->cntxt, old_file->fname); - (*new_file)->demonfname = ap_pstrdup(old_file->cntxt, old_file->demonfname); - (*new_file)->lowerdemonfname = ap_pstrdup(old_file->cntxt, old_file->lowerdemonfname); + (*new_file)->fname = apr_pstrdup(old_file->cntxt, old_file->fname); + (*new_file)->demonfname = apr_pstrdup(old_file->cntxt, old_file->demonfname); + (*new_file)->lowerdemonfname = apr_pstrdup(old_file->cntxt, old_file->lowerdemonfname); (*new_file)->append = old_file->append; /* (*new_file)->protection = old_file->protection; (*new_file)->user = old_file->user; @@ -118,8 +118,8 @@ ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) (*new_file)->buffered = FALSE; if (!isStdHandle) { - ap_register_cleanup((*new_file)->cntxt, (void *)(*new_file), file_cleanup, - ap_null_cleanup); + apr_register_cleanup((*new_file)->cntxt, (void *)(*new_file), file_cleanup, + apr_null_cleanup); } return APR_SUCCESS; diff --git a/file_io/win32/fileio.h b/file_io/win32/fileio.h index 232c4d057..bfdda7421 100644 --- a/file_io/win32/fileio.h +++ b/file_io/win32/fileio.h @@ -87,7 +87,7 @@ #define APR_FILE_BUFSIZE 4096 -/* quick run-down of fields in windows' ap_file_t structure that may have +/* quick run-down of fields in windows' apr_file_t structure that may have * obvious uses. * fname -- the filename as passed to the open call. * dwFileAttricutes -- Attributes used to open the file. @@ -100,12 +100,12 @@ * correctly when writing to a file with this flag set TRUE. */ -struct ap_file_t { - ap_pool_t *cntxt; +struct apr_file_t { + apr_pool_t *cntxt; HANDLE filehand; BOOLEAN pipe; // Is this a pipe of a file? OVERLAPPED *pOverlapped; - ap_interval_time_t timeout; + apr_interval_time_t timeout; /* File specific info */ char *fname; @@ -117,38 +117,38 @@ struct ap_file_t { int ungetchar; // Last char provided by an unget op. (-1 = no char) int append; off_t size; - ap_time_t atime; - ap_time_t mtime; - ap_time_t ctime; + apr_time_t atime; + apr_time_t mtime; + apr_time_t ctime; /* Stuff for buffered mode */ char *buffer; - ap_ssize_t bufpos; // Read/Write position in buffer - ap_ssize_t dataRead; // amount of valid data read into buffer + apr_ssize_t bufpos; // Read/Write position in buffer + apr_ssize_t dataRead; // amount of valid data read into buffer int direction; // buffer being used for 0 = read, 1 = write - ap_ssize_t filePtr; // position in file of handle - ap_lock_t *mutex; // mutex semaphore, must be owned to access the above fields + apr_ssize_t filePtr; // position in file of handle + apr_lock_t *mutex; // mutex semaphore, must be owned to access the above fields /* Pipe specific info */ }; -struct ap_dir_t { - ap_pool_t *cntxt; +struct apr_dir_t { + apr_pool_t *cntxt; char *dirname; HANDLE dirhand; WIN32_FIND_DATA *entry; }; -ap_status_t file_cleanup(void *); -/*mode_t get_fileperms(ap_fileperms_t); +apr_status_t file_cleanup(void *); +/*mode_t get_fileperms(apr_fileperms_t); */ -APR_EXPORT(char *) ap_os_systemcase_filename(struct ap_pool_t *pCont, +APR_EXPORT(char *) ap_os_systemcase_filename(struct apr_pool_t *pCont, const char *szFile); -char * canonical_filename(struct ap_pool_t *pCont, const char *szFile); +char * canonical_filename(struct apr_pool_t *pCont, const char *szFile); -ap_status_t ap_create_nt_pipe(ap_file_t **in, ap_file_t **out, +apr_status_t ap_create_nt_pipe(apr_file_t **in, apr_file_t **out, BOOLEAN bAsyncRead, BOOLEAN bAsyncWrite, - ap_pool_t *p); + apr_pool_t *p); #endif /* ! FILE_IO_H */ diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index f66fbf936..05082aacd 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -79,7 +79,7 @@ static ap_filetype_e filetype_from_mode(int mode) return type; } -BOOLEAN is_exe(const char* fname, ap_pool_t *cont) { +BOOLEAN is_exe(const char* fname, apr_pool_t *cont) { const char* exename; const char* ext; exename = strrchr(fname, '/'); @@ -101,7 +101,7 @@ BOOLEAN is_exe(const char* fname, ap_pool_t *cont) { return FALSE; } -ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile) +apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile) { BY_HANDLE_FILE_INFORMATION FileInformation; DWORD FileType; @@ -182,12 +182,12 @@ ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile) return APR_SUCCESS; } -ap_status_t ap_setfileperms(const char *fname, ap_fileperms_t perms) +apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms) { return APR_ENOTIMPL; } -ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) +apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) { /* WIN32_FILE_ATTRIBUTE_DATA is an exact subset of the first * entries of WIN32_FIND_DATA @@ -195,7 +195,7 @@ ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont) WIN32_FIND_DATA FileInformation; HANDLE hFind; ap_oslevel_e os_level; - ap_status_t rv = APR_SUCCESS; + apr_status_t rv = APR_SUCCESS; memset(finfo,'\0', sizeof(*finfo)); diff --git a/file_io/win32/open.c b/file_io/win32/open.c index 3944ffcd0..689453a0b 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -64,9 +64,9 @@ #include <sys/stat.h> #include "misc.h" -ap_status_t file_cleanup(void *thefile) +apr_status_t file_cleanup(void *thefile) { - ap_file_t *file = thefile; + apr_file_t *file = thefile; CloseHandle(file->filehand); file->filehand = INVALID_HANDLE_VALUE; if (file->pOverlapped) { @@ -75,18 +75,18 @@ ap_status_t file_cleanup(void *thefile) return APR_SUCCESS; } -ap_status_t ap_open(ap_file_t **new, const char *fname, - ap_int32_t flag, ap_fileperms_t perm, ap_pool_t *cont) +apr_status_t apr_open(apr_file_t **new, const char *fname, + apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont) { DWORD oflags = 0; DWORD createflags = 0; DWORD attributes = 0; DWORD sharemode = FILE_SHARE_READ | FILE_SHARE_WRITE; ap_oslevel_e level; - ap_status_t rv; + apr_status_t rv; if ((*new) == NULL) { - (*new) = (ap_file_t *)ap_pcalloc(cont, sizeof(ap_file_t)); + (*new) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); } (*new)->cntxt = cont; @@ -105,14 +105,14 @@ ap_status_t ap_open(ap_file_t **new, const char *fname, (*new)->buffered = (flag & APR_BUFFERED) > 0; if ((*new)->buffered) { - (*new)->buffer = ap_palloc(cont, APR_FILE_BUFSIZE); - rv = ap_create_lock(&(*new)->mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, cont); + (*new)->buffer = apr_palloc(cont, APR_FILE_BUFSIZE); + rv = apr_create_lock(&(*new)->mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, cont); if (rv) return rv; } - (*new)->fname = ap_pstrdup(cont, fname); + (*new)->fname = apr_pstrdup(cont, fname); (*new)->demonfname = canonical_filename((*new)->cntxt, fname); (*new)->lowerdemonfname = strlwr((*new)->demonfname); @@ -178,26 +178,26 @@ ap_status_t ap_open(ap_file_t **new, const char *fname, (*new)->direction = 0; (*new)->filePtr = 0; - ap_register_cleanup((*new)->cntxt, (void *)(*new), file_cleanup, - ap_null_cleanup); + apr_register_cleanup((*new)->cntxt, (void *)(*new), file_cleanup, + apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_close(ap_file_t *file) +apr_status_t apr_close(apr_file_t *file) { - ap_status_t stat; + apr_status_t stat; if ((stat = file_cleanup(file)) == APR_SUCCESS) { - ap_kill_cleanup(file->cntxt, file, file_cleanup); + apr_kill_cleanup(file->cntxt, file, file_cleanup); if (file->buffered) - ap_destroy_lock(file->mutex); + apr_destroy_lock(file->mutex); return APR_SUCCESS; } return stat; } -ap_status_t ap_remove_file(const char *path, ap_pool_t *cont) +apr_status_t apr_remove_file(const char *path, apr_pool_t *cont) { char *temp = canonical_filename(cont, path); @@ -209,8 +209,8 @@ ap_status_t ap_remove_file(const char *path, ap_pool_t *cont) } } -ap_status_t ap_rename_file(const char *from_path, const char *to_path, - ap_pool_t *p) +apr_status_t apr_rename_file(const char *from_path, const char *to_path, + apr_pool_t *p) { const char *from_canon = canonical_filename(p, from_path); const char *to_canon = canonical_filename(p, to_path); @@ -235,7 +235,7 @@ ap_status_t ap_rename_file(const char *from_path, const char *to_path, return err; } -ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file) +apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file) { if (file == NULL) { return APR_ENOFILE; @@ -244,21 +244,21 @@ ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file) return APR_SUCCESS; } -ap_status_t ap_put_os_file(ap_file_t **file, ap_os_file_t *thefile, - ap_pool_t *cont) +apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, + apr_pool_t *cont) { if ((*file) == NULL) { if (cont == NULL) { return APR_ENOPOOL; } - (*file) = (ap_file_t *)ap_pcalloc(cont, sizeof(ap_file_t)); + (*file) = (apr_file_t *)apr_pcalloc(cont, sizeof(apr_file_t)); (*file)->cntxt = cont; } (*file)->filehand = *thefile; return APR_SUCCESS; } -ap_status_t ap_eof(ap_file_t *fptr) +apr_status_t apr_eof(apr_file_t *fptr) { if (fptr->eof_hit == 1) { return APR_EOF; @@ -266,9 +266,9 @@ ap_status_t ap_eof(ap_file_t *fptr) return APR_SUCCESS; } -ap_status_t ap_open_stderr(ap_file_t **thefile, ap_pool_t *cont) +apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) { - (*thefile) = ap_pcalloc(cont, sizeof(ap_file_t)); + (*thefile) = apr_pcalloc(cont, sizeof(apr_file_t)); if ((*thefile) == NULL) { return APR_ENOMEM; } diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 85eb51f02..732ba577f 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -63,13 +63,13 @@ #include <sys/stat.h> #include "misc.h" -ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout) +apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout) { thepipe->timeout = timeout; return APR_SUCCESS; } -ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *p) +apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *p) { SECURITY_ATTRIBUTES sa; @@ -77,9 +77,9 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *p) sa.bInheritHandle = TRUE; sa.lpSecurityDescriptor = NULL; - (*in) = (ap_file_t *)ap_pcalloc(p, sizeof(ap_file_t)); + (*in) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); (*in)->cntxt = p; - (*in)->fname = ap_pstrdup(p, "PIPE"); + (*in)->fname = apr_pstrdup(p, "PIPE"); (*in)->pipe = 1; (*in)->timeout = -1; (*in)->ungetchar = -1; @@ -89,9 +89,9 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *p) (*in)->dataRead = 0; (*in)->direction = 0; - (*out) = (ap_file_t *)ap_pcalloc(p, sizeof(ap_file_t)); + (*out) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); (*out)->cntxt = p; - (*out)->fname = ap_pstrdup(p, "PIPE"); + (*out)->fname = apr_pstrdup(p, "PIPE"); (*out)->pipe = 1; (*out)->timeout = -1; (*out)->ungetchar = -1; @@ -109,7 +109,7 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *p) } /* ap_create_nt_pipe() - * An internal (for now) APR function created for use by ap_create_process() + * An internal (for now) APR function created for use by apr_create_process() * when setting up pipes to communicate with the child process. * ap_create_nt_pipe() allows setting the blocking mode of each end of * the pipe when the pipe is created (rather than after the pipe is created). @@ -118,7 +118,7 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *p) * * In general, we don't want to enable child side pipe handles for async i/o. * This prevents us from enabling both ends of the pipe for async i/o in - * ap_create_pipe. + * apr_create_pipe. * * Why not use NamedPipes on NT which support setting pipe state to * non-blocking? On NT, even though you can set a pipe non-blocking, @@ -128,9 +128,9 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *p) * * wgs */ -ap_status_t ap_create_nt_pipe(ap_file_t **in, ap_file_t **out, +apr_status_t ap_create_nt_pipe(apr_file_t **in, apr_file_t **out, BOOLEAN bAsyncRead, BOOLEAN bAsyncWrite, - ap_pool_t *p) + apr_pool_t *p) { ap_oslevel_e level; SECURITY_ATTRIBUTES sa; @@ -143,9 +143,9 @@ ap_status_t ap_create_nt_pipe(ap_file_t **in, ap_file_t **out, sa.bInheritHandle = TRUE; sa.lpSecurityDescriptor = NULL; - (*in) = (ap_file_t *)ap_pcalloc(p, sizeof(ap_file_t)); + (*in) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); (*in)->cntxt = p; - (*in)->fname = ap_pstrdup(p, "PIPE"); + (*in)->fname = apr_pstrdup(p, "PIPE"); (*in)->pipe = 1; (*in)->timeout = -1; (*in)->ungetchar = -1; @@ -156,9 +156,9 @@ ap_status_t ap_create_nt_pipe(ap_file_t **in, ap_file_t **out, (*in)->direction = 0; (*in)->pOverlapped = NULL; - (*out) = (ap_file_t *)ap_pcalloc(p, sizeof(ap_file_t)); + (*out) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); (*out)->cntxt = p; - (*out)->fname = ap_pstrdup(p, "PIPE"); + (*out)->fname = apr_pstrdup(p, "PIPE"); (*out)->pipe = 1; (*out)->timeout = -1; (*out)->ungetchar = -1; @@ -174,7 +174,7 @@ ap_status_t ap_create_nt_pipe(ap_file_t **in, ap_file_t **out, dwOpenMode = PIPE_ACCESS_INBOUND; if (bAsyncRead) { dwOpenMode |= FILE_FLAG_OVERLAPPED; - (*in)->pOverlapped = (OVERLAPPED*) ap_pcalloc(p, sizeof(OVERLAPPED)); + (*in)->pOverlapped = (OVERLAPPED*) apr_pcalloc(p, sizeof(OVERLAPPED)); (*in)->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); /* register a cleanup for the event handle... */ } @@ -196,7 +196,7 @@ ap_status_t ap_create_nt_pipe(ap_file_t **in, ap_file_t **out, dwOpenMode = FILE_ATTRIBUTE_NORMAL; if (bAsyncWrite) { dwOpenMode |= FILE_FLAG_OVERLAPPED; - (*out)->pOverlapped = (OVERLAPPED*) ap_pcalloc(p, sizeof(OVERLAPPED)); + (*out)->pOverlapped = (OVERLAPPED*) apr_pcalloc(p, sizeof(OVERLAPPED)); (*out)->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); } diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 6fe52f388..e9bd33405 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -64,9 +64,9 @@ * read_with_timeout() * Uses async i/o to emulate unix non-blocking i/o with timeouts. */ -static ap_status_t read_with_timeout(ap_file_t *file, void *buf, ap_ssize_t len, ap_ssize_t *nbytes) +static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_ssize_t len, apr_ssize_t *nbytes) { - ap_status_t rv; + apr_status_t rv; *nbytes = 0; /* Handle the zero timeout non-blocking case */ @@ -143,9 +143,9 @@ static ap_status_t read_with_timeout(ap_file_t *file, void *buf, ap_ssize_t len, return rv; } -ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *len) +apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_ssize_t *len) { - ap_ssize_t rv; + apr_ssize_t rv; DWORD bytes_read = 0; if (*len <= 0) { @@ -167,13 +167,13 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *len) } if (thefile->buffered) { char *pos = (char *)buf; - ap_ssize_t blocksize; - ap_ssize_t size = *len; + apr_ssize_t blocksize; + apr_ssize_t size = *len; - ap_lock(thefile->mutex); + apr_lock(thefile->mutex); if (thefile->direction == 1) { - ap_flush(thefile); + apr_flush(thefile); thefile->bufpos = 0; thefile->direction = 0; thefile->dataRead = 0; @@ -207,10 +207,10 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *len) if (*len) { rv = 0; } - ap_unlock(thefile->mutex); + apr_unlock(thefile->mutex); } else { /* Unbuffered i/o */ - ap_ssize_t nbytes; + apr_ssize_t nbytes; rv = read_with_timeout(thefile, buf, *len, &nbytes); *len = nbytes; } @@ -218,9 +218,9 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *len) return rv; } -ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) +apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_ssize_t *nbytes) { - ap_status_t rv; + apr_status_t rv; DWORD bwrote; if (thefile->buffered) { @@ -228,11 +228,11 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) int blocksize; int size = *nbytes; - ap_lock(thefile->mutex); + apr_lock(thefile->mutex); if (thefile->direction == 0) { // Position file pointer for writing at the offset we are logically reading from - ap_ssize_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; + apr_ssize_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; if (offset != thefile->filePtr) SetFilePointer(thefile->filehand, offset, NULL, FILE_BEGIN); thefile->bufpos = thefile->dataRead = 0; @@ -241,7 +241,7 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) while (rv == 0 && size > 0) { if (thefile->bufpos == APR_FILE_BUFSIZE) // write buffer is full - rv = ap_flush(thefile); + rv = apr_flush(thefile); blocksize = size > APR_FILE_BUFSIZE - thefile->bufpos ? APR_FILE_BUFSIZE - thefile->bufpos : size; memcpy(thefile->buffer + thefile->bufpos, pos, blocksize); @@ -250,7 +250,7 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) size -= blocksize; } - ap_unlock(thefile->mutex); + apr_unlock(thefile->mutex); return rv; } else { if (!thefile->pipe && thefile->append) { @@ -271,10 +271,10 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes) /* * Too bad WriteFileGather() is not supported on 95&98 (or NT prior to SP2) */ -ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec, ap_size_t nvec, - ap_ssize_t *nbytes) +apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, + apr_ssize_t *nbytes) { - ap_status_t rv = APR_SUCCESS; + apr_status_t rv = APR_SUCCESS; int i; DWORD bwrote = 0; char *buf; @@ -283,7 +283,7 @@ ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec, ap_size_t nve for (i = 0; i < nvec; i++) { buf = vec[i].iov_base; bwrote = vec[i].iov_len; - rv = ap_write(thefile, buf, &bwrote); + rv = apr_write(thefile, buf, &bwrote); *nbytes += bwrote; if (rv != APR_SUCCESS) { break; @@ -292,26 +292,26 @@ ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec, ap_size_t nve return rv; } -ap_status_t ap_putc(char ch, ap_file_t *thefile) +apr_status_t apr_putc(char ch, apr_file_t *thefile) { DWORD len = 1; - return ap_write(thefile, &ch, &len); + return apr_write(thefile, &ch, &len); } -ap_status_t ap_ungetc(char ch, ap_file_t *thefile) +apr_status_t apr_ungetc(char ch, apr_file_t *thefile) { thefile->ungetchar = (unsigned char) ch; return APR_SUCCESS; } -ap_status_t ap_getc(char *ch, ap_file_t *thefile) +apr_status_t apr_getc(char *ch, apr_file_t *thefile) { - ap_status_t rc; + apr_status_t rc; int bread; bread = 1; - rc = ap_read(thefile, ch, &bread); + rc = apr_read(thefile, ch, &bread); if (rc) { return rc; @@ -324,22 +324,22 @@ ap_status_t ap_getc(char *ch, ap_file_t *thefile) return APR_SUCCESS; } -ap_status_t ap_puts(const char *str, ap_file_t *thefile) +apr_status_t apr_puts(const char *str, apr_file_t *thefile) { DWORD len = strlen(str); - return ap_write(thefile, str, &len); + return apr_write(thefile, str, &len); } -ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) +apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) { - ap_ssize_t readlen; - ap_status_t rv = APR_SUCCESS; + apr_ssize_t readlen; + apr_status_t rv = APR_SUCCESS; int i; for (i = 0; i < len-1; i++) { readlen = 1; - rv = ap_read(thefile, str+i, &readlen); + rv = apr_read(thefile, str+i, &readlen); if (readlen != 1) { rv = APR_EOF; @@ -357,11 +357,11 @@ ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) return rv; } -ap_status_t ap_flush(ap_file_t *thefile) +apr_status_t apr_flush(apr_file_t *thefile) { if (thefile->buffered) { DWORD written = 0; - ap_status_t rc = 0; + apr_status_t rc = 0; if (thefile->direction == 1 && thefile->bufpos) { rc = WriteFile(thefile->filehand, thefile->buffer, thefile->bufpos, &written, NULL ) ? 0 : GetLastError(); @@ -378,7 +378,7 @@ ap_status_t ap_flush(ap_file_t *thefile) } } -static int printf_flush(ap_vformatter_buff_t *vbuff) +static int printf_flush(apr_vformatter_buff_t *vbuff) { /* I would love to print this stuff out to the file, but I will * get that working later. :) For now, just return. @@ -386,7 +386,7 @@ static int printf_flush(ap_vformatter_buff_t *vbuff) return -1; } -APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) +APR_EXPORT(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) { int cc; va_list ap; @@ -398,8 +398,8 @@ APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) return 0; } va_start(ap, format); - len = ap_vsnprintf(buf, HUGE_STRING_LEN, format, ap); - cc = ap_puts(buf, fptr); + len = apr_vsnprintf(buf, HUGE_STRING_LEN, format, ap); + cc = apr_puts(buf, fptr); va_end(ap); free(buf); return (cc == APR_SUCCESS) ? len : -1; diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c index 9ab9404e4..b2aaa5cbf 100644 --- a/file_io/win32/seek.c +++ b/file_io/win32/seek.c @@ -57,13 +57,13 @@ #include <errno.h> #include <string.h> -static ap_status_t setptr(ap_file_t *thefile, unsigned long pos ) +static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) { long newbufpos; DWORD rc; if (thefile->direction == 1) { - ap_flush(thefile); + apr_flush(thefile); thefile->bufpos = thefile->direction = thefile->dataRead = 0; } @@ -86,14 +86,14 @@ static ap_status_t setptr(ap_file_t *thefile, unsigned long pos ) -ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where, ap_off_t *offset) +apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) { DWORD howmove; DWORD rv; if (thefile->buffered) { int rc = APR_EINVAL; - ap_finfo_t finfo; + apr_finfo_t finfo; switch (where) { case APR_SET: @@ -105,7 +105,7 @@ ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where, ap_off_t *offset) break; case APR_END: - rc = ap_getfileinfo(&finfo, thefile); + rc = apr_getfileinfo(&finfo, thefile); if (rc == APR_SUCCESS) rc = setptr(thefile, finfo.size - *offset); break; diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c index a357a90dc..8af33873e 100644 --- a/i18n/unix/xlate.c +++ b/i18n/unix/xlate.c @@ -75,8 +75,8 @@ #define min(x,y) ((x) <= (y) ? (x) : (y)) #endif -struct ap_xlate_t { - ap_pool_t *pool; +struct apr_xlate_t { + apr_pool_t *pool; char *frompage; char *topage; char *sbcs_table; @@ -156,10 +156,10 @@ static const char *handle_special_names(const char *page) } } -static ap_status_t ap_xlate_cleanup(void *convset) +static apr_status_t ap_xlate_cleanup(void *convset) { #ifdef HAVE_ICONV - ap_xlate_t *old = convset; + apr_xlate_t *old = convset; if (old->ich != (iconv_t)-1) { if (iconv_close(old->ich)) { @@ -171,7 +171,7 @@ static ap_status_t ap_xlate_cleanup(void *convset) } #ifdef HAVE_ICONV -static void check_sbcs(ap_xlate_t *convset) +static void check_sbcs(apr_xlate_t *convset) { char inbuf[256], outbuf[256]; char *inbufptr = inbuf, *outbufptr = outbuf; @@ -193,7 +193,7 @@ static void check_sbcs(ap_xlate_t *convset) * close the iconv descriptor */ - convset->sbcs_table = ap_palloc(convset->pool, sizeof(outbuf)); + convset->sbcs_table = apr_palloc(convset->pool, sizeof(outbuf)); memcpy(convset->sbcs_table, outbuf, sizeof(outbuf)); iconv_close(convset->ich); convset->ich = (iconv_t)-1; @@ -203,11 +203,11 @@ static void check_sbcs(ap_xlate_t *convset) } #endif /* HAVE_ICONV */ -ap_status_t ap_xlate_open(ap_xlate_t **convset, const char *topage, - const char *frompage, ap_pool_t *pool) +apr_status_t ap_xlate_open(apr_xlate_t **convset, const char *topage, + const char *frompage, apr_pool_t *pool) { - ap_status_t status; - ap_xlate_t *new; + apr_status_t status; + apr_xlate_t *new; int found = 0; *convset = NULL; @@ -215,14 +215,14 @@ ap_status_t ap_xlate_open(ap_xlate_t **convset, const char *topage, topage = handle_special_names(topage); frompage = handle_special_names(frompage); - new = (ap_xlate_t *)ap_pcalloc(pool, sizeof(ap_xlate_t)); + new = (apr_xlate_t *)apr_pcalloc(pool, sizeof(apr_xlate_t)); if (!new) { return APR_ENOMEM; } new->pool = pool; - new->topage = ap_pstrdup(pool, topage); - new->frompage = ap_pstrdup(pool, frompage); + new->topage = apr_pstrdup(pool, topage); + new->frompage = apr_pstrdup(pool, frompage); if (!new->topage || !new->frompage) { return APR_ENOMEM; } @@ -248,8 +248,8 @@ ap_status_t ap_xlate_open(ap_xlate_t **convset, const char *topage, if (found) { *convset = new; - ap_register_cleanup(pool, (void *)new, ap_xlate_cleanup, - ap_null_cleanup); + apr_register_cleanup(pool, (void *)new, ap_xlate_cleanup, + apr_null_cleanup); status = APR_SUCCESS; } else { @@ -260,17 +260,17 @@ ap_status_t ap_xlate_open(ap_xlate_t **convset, const char *topage, return status; } -ap_status_t ap_xlate_get_sb(ap_xlate_t *convset, int *onoff) +apr_status_t ap_xlate_get_sb(apr_xlate_t *convset, int *onoff) { *onoff = convset->sbcs_table != NULL; return APR_SUCCESS; } -ap_status_t ap_xlate_conv_buffer(ap_xlate_t *convset, const char *inbuf, - ap_size_t *inbytes_left, char *outbuf, - ap_size_t *outbytes_left) +apr_status_t ap_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, + apr_size_t *inbytes_left, char *outbuf, + apr_size_t *outbytes_left) { - ap_status_t status = APR_SUCCESS; + apr_status_t status = APR_SUCCESS; #ifdef HAVE_ICONV size_t translated; @@ -329,7 +329,7 @@ ap_status_t ap_xlate_conv_buffer(ap_xlate_t *convset, const char *inbuf, return status; } -ap_int32_t ap_xlate_conv_byte(ap_xlate_t *convset, unsigned char inchar) +apr_int32_t ap_xlate_conv_byte(apr_xlate_t *convset, unsigned char inchar) { if (convset->sbcs_table) { return convset->sbcs_table[inchar]; @@ -339,12 +339,12 @@ ap_int32_t ap_xlate_conv_byte(ap_xlate_t *convset, unsigned char inchar) } } -ap_status_t ap_xlate_close(ap_xlate_t *convset) +apr_status_t ap_xlate_close(apr_xlate_t *convset) { - ap_status_t status; + apr_status_t status; if ((status = ap_xlate_cleanup(convset)) == APR_SUCCESS) { - ap_kill_cleanup(convset->pool, convset, ap_xlate_cleanup); + apr_kill_cleanup(convset->pool, convset, ap_xlate_cleanup); } return status; diff --git a/include/apr_dso.h b/include/apr_dso.h index bcd333b96..07cf2c716 100644 --- a/include/apr_dso.h +++ b/include/apr_dso.h @@ -66,8 +66,8 @@ extern "C" { #endif -typedef struct ap_dso_handle_t ap_dso_handle_t; -typedef void * ap_dso_handle_sym_t; +typedef struct apr_dso_handle_t apr_dso_handle_t; +typedef void * apr_dso_handle_sym_t; /** * Load a DSO library. @@ -75,14 +75,14 @@ typedef void * ap_dso_handle_sym_t; * @param path Path to the DSO library * @param ctx Pool to use. */ -ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, - ap_pool_t *ctx); +apr_status_t apr_dso_load(apr_dso_handle_t **res_handle, const char *path, + apr_pool_t *ctx); /** * Close a DSO library. * @param handle handle to close. */ -ap_status_t ap_dso_unload(ap_dso_handle_t *handle); +apr_status_t apr_dso_unload(apr_dso_handle_t *handle); /** * Load a symbol from a DSO handle. @@ -90,7 +90,7 @@ ap_status_t ap_dso_unload(ap_dso_handle_t *handle); * @param handle handle to load from. * @param symname Name of the symbol to load. */ -ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, ap_dso_handle_t *handle, +apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_handle_t *handle, const char *symname); /** @@ -99,7 +99,7 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, ap_dso_handle_t *handle, * @param buf handle to load from. * @param bufsize Name of the symbol to load. */ -const char *ap_dso_error(ap_dso_handle_t *dso, char *buf, ap_size_t bufsize); +const char *apr_dso_error(apr_dso_handle_t *dso, char *buf, apr_size_t bufsize); #ifdef __cplusplus } diff --git a/include/apr_errno.h b/include/apr_errno.h index e5512c625..e777adc6a 100644 --- a/include/apr_errno.h +++ b/include/apr_errno.h @@ -66,7 +66,7 @@ extern "C" { * @package Error Codes */ -typedef int ap_status_t; +typedef int apr_status_t; /** * Convert an APR error to a canonical error @@ -74,7 +74,7 @@ typedef int ap_status_t; * @return The canonical error value * @tip see apr/APRDesgin for an explanation of why this is necessary. */ -int ap_canonical_error(ap_status_t err); +int apr_canonical_error(apr_status_t err); /* @@ -113,7 +113,7 @@ int ap_canonical_error(ap_status_t err); * APR_ENOTHDKEY APR was not given a thread key structure * APR_ENOSHMAVAIL There is no more shared memory available * APR_EDSOOPEN APR was unable to open the dso object. For more - * information call ap_dso_error(). + * information call apr_dso_error(). * </PRE> * * <PRE> diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 77a5c6bf4..32ae5eb74 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -73,7 +73,7 @@ extern "C" { typedef enum {APR_NOFILE, APR_REG, APR_DIR, APR_CHR, APR_BLK, APR_PIPE, APR_LNK, APR_SOCK} ap_filetype_e; -/* Flags for ap_open */ +/* Flags for apr_open */ #define APR_READ 1 /* Open the file for reading */ #define APR_WRITE 2 /* Open the file for writing */ #define APR_CREATE 4 /* Create the file if not there */ @@ -85,7 +85,7 @@ typedef enum {APR_NOFILE, APR_REG, APR_DIR, APR_CHR, APR_BLK, APR_PIPE, APR_LNK, #define APR_BUFFERED 128 /* Open the file for buffered I/O */ #define APR_DELONCLOSE 256 /* Delete the file after close */ -/* flags for ap_seek */ +/* flags for apr_seek */ #define APR_SET SEEK_SET #define APR_CUR SEEK_CUR #define APR_END SEEK_END @@ -106,28 +106,28 @@ typedef enum {APR_NOFILE, APR_REG, APR_DIR, APR_CHR, APR_BLK, APR_PIPE, APR_LNK, #define APR_OS_DEFAULT 0xFFF /* should be same as whence type in lseek, POSIX defines this as int */ -typedef ap_int32_t ap_seek_where_t; - -typedef struct ap_file_t ap_file_t; -typedef struct ap_finfo_t ap_finfo_t; -typedef struct ap_dir_t ap_dir_t; -typedef ap_int32_t ap_fileperms_t; -typedef uid_t ap_uid_t; -typedef gid_t ap_gid_t; -typedef ino_t ap_ino_t; -typedef dev_t ap_dev_t; - -struct ap_finfo_t { - ap_fileperms_t protection; +typedef apr_int32_t apr_seek_where_t; + +typedef struct apr_file_t apr_file_t; +typedef struct apr_finfo_t apr_finfo_t; +typedef struct apr_dir_t apr_dir_t; +typedef apr_int32_t apr_fileperms_t; +typedef uid_t apr_uid_t; +typedef gid_t apr_gid_t; +typedef ino_t apr_ino_t; +typedef dev_t apr_dev_t; + +struct apr_finfo_t { + apr_fileperms_t protection; ap_filetype_e filetype; - ap_uid_t user; - ap_gid_t group; - ap_ino_t inode; - ap_dev_t device; - ap_off_t size; - ap_time_t atime; - ap_time_t mtime; - ap_time_t ctime; + apr_uid_t user; + apr_gid_t group; + apr_ino_t inode; + apr_dev_t device; + apr_off_t size; + apr_time_t atime; + apr_time_t mtime; + apr_time_t ctime; }; /* Function definitions */ @@ -155,14 +155,14 @@ struct ap_finfo_t { * default permissions will be used. *arg1 must point to a valid file_t, * or NULL (in which case it will be allocated) */ -ap_status_t ap_open(ap_file_t **new_file, const char *fname, ap_int32_t flag, - ap_fileperms_t perm, ap_pool_t *cont); +apr_status_t apr_open(apr_file_t **new_file, const char *fname, apr_int32_t flag, + apr_fileperms_t perm, apr_pool_t *cont); /** * Close the specified file. * @param file The file descriptor to close. */ -ap_status_t ap_close(ap_file_t *file); +apr_status_t apr_close(apr_file_t *file); /** * delete the specified file. @@ -170,7 +170,7 @@ ap_status_t ap_close(ap_file_t *file); * @param cont The pool to use. * @tip If the file is open, it won't be removed until all instances are closed. */ -ap_status_t ap_remove_file(const char *path, ap_pool_t *cont); +apr_status_t apr_remove_file(const char *path, apr_pool_t *cont); /** * rename the specified file. @@ -180,36 +180,36 @@ ap_status_t ap_remove_file(const char *path, ap_pool_t *cont); * @tip If a file exists at the new location, then it will be overwritten. * Moving files or directories across devices may not be possible. */ -ap_status_t ap_rename_file(const char *from_path, const char *to_path, - ap_pool_t *pool); +apr_status_t apr_rename_file(const char *from_path, const char *to_path, + apr_pool_t *pool); /** * Are we at the end of the file * @param fptr The apr file we are testing. * @tip Returns APR_EOF if we are at the end of file, APR_SUCCESS otherwise. */ -ap_status_t ap_eof(ap_file_t *fptr); +apr_status_t apr_eof(apr_file_t *fptr); /** * Is there an error on the stream? * @param fptr The apr file we are testing. * @tip Returns -1 if the error indicator is set, APR_SUCCESS otherwise. */ -ap_status_t ap_ferror(ap_file_t *fptr); +apr_status_t apr_ferror(apr_file_t *fptr); /** * open standard error as an apr file pointer. * @param thefile The apr file to use as stderr. * @param cont The pool to allocate the file out of. */ -ap_status_t ap_open_stderr(ap_file_t **thefile, ap_pool_t *cont); +apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont); /** * Read data from the specified file. * @param thefile The file descriptor to read from. * @param buf The buffer to store the data to. * @param nbytes On entry, the number of bytes to read; on exit, the number of bytes read. - * @tip ap_read will read up to the specified number of bytes, but never + * @tip apr_read will read up to the specified number of bytes, but never * more. If there isn't enough data to fill that number of bytes, all * of the available data is read. The third argument is modified to * reflect the number of bytes read. If a char was put back into the @@ -220,14 +220,14 @@ ap_status_t ap_open_stderr(ap_file_t **thefile, ap_pool_t *cont); * * APR_EINTR is never returned. */ -ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes); +apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_ssize_t *nbytes); /** * Write data to the specified file. * @param thefile The file descriptor to write to. * @param buf The buffer which contains the data. * @param nbytes On entry, the number of bytes to write; on exit, the number of bytes written. - * @tip ap_write will write up to the specified number of bytes, but never + * @tip apr_write will write up to the specified number of bytes, but never * more. If the OS cannot write that many bytes, it will write as many * as it can. The third argument is modified to reflect the * number * of bytes written. @@ -236,7 +236,7 @@ ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes); * * APR_EINTR is never returned. */ -ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes); +apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_ssize_t *nbytes); /** * Write data from iovec array to the specified file. @@ -249,12 +249,12 @@ ap_status_t ap_write(ap_file_t *thefile, const void *buf, ap_ssize_t *nbytes); * @tip It is possible for both bytes to be written and an error to be returned. * APR_EINTR is never returned. * - * ap_writev is available even if the underlying operating system + * apr_writev is available even if the underlying operating system * * doesn't provide writev(). */ -ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec, - ap_size_t nvec, ap_ssize_t *nbytes); +apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, + apr_size_t nvec, apr_ssize_t *nbytes); /** * Read data from the specified file. @@ -262,7 +262,7 @@ ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec, * @param buf The buffer to store the data to. * @param nbytes The number of bytes to read. * @param bytes_read If non-NULL, this will contain the number of bytes read. - * @tip ap_read will read up to the specified number of bytes, but never + * @tip apr_read will read up to the specified number of bytes, but never * more. If there isn't enough data to fill that number of bytes, * then the process/thread will block until it is available or EOF * is reached. If a char was put back into the stream via ungetc, @@ -273,8 +273,8 @@ ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec, * * APR_EINTR is never returned. */ -ap_status_t ap_full_read(ap_file_t *thefile, void *buf, ap_size_t nbytes, - ap_size_t *bytes_read); +apr_status_t apr_full_read(apr_file_t *thefile, void *buf, apr_size_t nbytes, + apr_size_t *bytes_read); /** * Write data to the specified file. @@ -282,7 +282,7 @@ ap_status_t ap_full_read(ap_file_t *thefile, void *buf, ap_size_t nbytes, * @param buf The buffer which contains the data. * @param nbytes The number of bytes to write. * @param bytes_written If non-NULL, this will contain the number of bytes written. - * @tip ap_write will write up to the specified number of bytes, but never + * @tip apr_write will write up to the specified number of bytes, but never * more. If the OS cannot write that many bytes, the process/thread * will block until they can be written. Exceptional error such as * "out of space" or "pipe closed" will terminate with an error. @@ -291,29 +291,29 @@ ap_status_t ap_full_read(ap_file_t *thefile, void *buf, ap_size_t nbytes, * * APR_EINTR is never returned. */ -ap_status_t ap_full_write(ap_file_t *thefile, const void *buf, - ap_size_t nbytes, ap_size_t *bytes_written); +apr_status_t apr_full_write(apr_file_t *thefile, const void *buf, + apr_size_t nbytes, apr_size_t *bytes_written); /** * put a character into the specified file. * @param ch The character to write. * @param thefile The file descriptor to write to */ -ap_status_t ap_putc(char ch, ap_file_t *thefile); +apr_status_t apr_putc(char ch, apr_file_t *thefile); /** * get a character from the specified file. * @param ch The character to write. * @param thefile The file descriptor to write to */ -ap_status_t ap_getc(char *ch, ap_file_t *thefile); +apr_status_t apr_getc(char *ch, apr_file_t *thefile); /** * put a character back onto a specified stream. * @param ch The character to write. * @param thefile The file descriptor to write to */ -ap_status_t ap_ungetc(char ch, ap_file_t *thefile); +apr_status_t apr_ungetc(char ch, apr_file_t *thefile); /** * Get a string from a specified file. @@ -321,36 +321,36 @@ ap_status_t ap_ungetc(char ch, ap_file_t *thefile); * @param len The length of the string * @param thefile The file descriptor to read from */ -ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile); +apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile); /** * Put the string into a specified file. * @param str The string to write. * @param thefile The file descriptor to write to */ -ap_status_t ap_puts(const char *str, ap_file_t *thefile); +apr_status_t apr_puts(const char *str, apr_file_t *thefile); /** * Flush the file's buffer. * @param thefile The file descriptor to flush */ -ap_status_t ap_flush(ap_file_t *thefile); +apr_status_t apr_flush(apr_file_t *thefile); /** * duplicate the specified file descriptor. * @param new_file The structure to duplicate into. * @param old_file The file to duplicate. * @param p The pool to use for the new file. - * @tip *arg1 must point to a valid ap_file_t, or point to NULL + * @tip *arg1 must point to a valid apr_file_t, or point to NULL */ -ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p); +apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p); /** * get the specified file's stats. * @param finfo Where to store the information about the file. * @param thefile The file to get information about. */ -ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile); +apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile); /** * set the specified file's permission bits. @@ -362,7 +362,7 @@ ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile); * * Platforms which do not implement this feature will return APR_ENOTIMPL. */ -ap_status_t ap_setfileperms(const char *fname, ap_fileperms_t perms); +apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms); /** * get the specified file's stats. The file is specified by filename, @@ -371,7 +371,7 @@ ap_status_t ap_setfileperms(const char *fname, ap_fileperms_t perms); * @param fname The name of the file to stat. * @param cont the pool to use to allocate the new file. */ -ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont); +apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont); /** * get the specified file's stats. The file is specified by filename, @@ -381,7 +381,7 @@ ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont); * @param fname The name of the file to stat. * @param cont the pool to use to allocate the new file. */ -ap_status_t ap_lstat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont); +apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont); /** * Move the read/write file offset to a specified byte within a file. @@ -395,7 +395,7 @@ ap_status_t ap_lstat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont); * @tip The third argument is modified to be the offset the pointer was actually moved to. */ -ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where,ap_off_t *offset); +apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where,apr_off_t *offset); /** * Open the specified directory. @@ -403,26 +403,26 @@ ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where,ap_off_t *offset); * @param dirname The full path to the directory (use / on all systems) * @param cont The pool to use. */ -ap_status_t ap_opendir(ap_dir_t **new_dir, const char *dirname, ap_pool_t *cont); +apr_status_t apr_opendir(apr_dir_t **new_dir, const char *dirname, apr_pool_t *cont); /** * close the specified directory. * @param thedir the directory descriptor to close. */ -ap_status_t ap_closedir(ap_dir_t *thedir); +apr_status_t apr_closedir(apr_dir_t *thedir); /** * Read the next entry from the specified directory. * @param thedir the directory descriptor to read from, and fill out. * @tip All systems return . and .. as the first two files. */ -ap_status_t ap_readdir(ap_dir_t *thedir); +apr_status_t apr_readdir(apr_dir_t *thedir); /** * Rewind the directory to the first entry. * @param thedir the directory descriptor to rewind. */ -ap_status_t ap_rewinddir(ap_dir_t *thedir); +apr_status_t apr_rewinddir(apr_dir_t *thedir); /** * Create a new directory on the file system. @@ -430,15 +430,15 @@ ap_status_t ap_rewinddir(ap_dir_t *thedir); * @param perm Permissions for the new direcoty. * @param cont the pool to use. */ -ap_status_t ap_make_dir(const char *path, ap_fileperms_t perm, - ap_pool_t *cont); +apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, + apr_pool_t *cont); /** * Remove directory from the file system. * @param path the path for the directory to be removed. (use / on all systems) * @param cont the pool to use. */ -ap_status_t ap_remove_dir(const char *path, ap_pool_t *cont); +apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont); /** * Create an anonymous pipe. @@ -446,7 +446,7 @@ ap_status_t ap_remove_dir(const char *path, ap_pool_t *cont); * @param out The file descriptor to use as output from the pipe. * @param cont The pool to operate on. */ -ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont); +apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont); /** * Create a named pipe. @@ -454,8 +454,8 @@ ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont); * @param perm The permissions for the newly created pipe. * @param cont The pool to operate on. */ -ap_status_t ap_create_namedpipe(const char *filename, ap_fileperms_t perm, - ap_pool_t *cont); +apr_status_t apr_create_namedpipe(const char *filename, apr_fileperms_t perm, + apr_pool_t *cont); /** * Set the timeout value for a pipe or manipulate the blocking state. @@ -463,7 +463,7 @@ ap_status_t ap_create_namedpipe(const char *filename, ap_fileperms_t perm, * @param timeoutThe timeout value in microseconds. Values < 0 mean wait * forever, 0 means do not wait at all. */ -ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout); +apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout); /**accessor and general file_io functions. */ @@ -472,14 +472,14 @@ ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout); * @param new_path The path of the file. * @param thefile The currently open file. */ -ap_status_t ap_get_filename(char **new_path, ap_file_t *thefile); +apr_status_t apr_get_filename(char **new_path, apr_file_t *thefile); /** * Get the file name of the current directory entry. * @param new_path the file name of the directory entry. * @param thedir the currently open directory. */ -ap_status_t ap_get_dir_filename(char **new_path, ap_dir_t *thedir); +apr_status_t apr_get_dir_filename(char **new_path, apr_dir_t *thedir); /** * Return the data associated with the current file. @@ -487,7 +487,7 @@ ap_status_t ap_get_dir_filename(char **new_path, ap_dir_t *thedir); * @param key The key to use for retreiving data associated with this file. * @param file The currently open file. */ -ap_status_t ap_get_filedata(void **data, const char *key, ap_file_t *file); +apr_status_t apr_get_filedata(void **data, const char *key, apr_file_t *file); /** * Set the data associated with the current file. @@ -496,29 +496,29 @@ ap_status_t ap_get_filedata(void **data, const char *key, ap_file_t *file); * @param key The key to use for assocaiteing data with the file. * @param cleanup The cleanup routine to use when the file is destroyed. */ -ap_status_t ap_set_filedata(ap_file_t *file, void *data, const char *key, - ap_status_t (*cleanup) (void *)); +apr_status_t apr_set_filedata(apr_file_t *file, void *data, const char *key, + apr_status_t (*cleanup) (void *)); /** * Get the size of the current directory entry. * @param size the size of the directory entry. * @param thedir the currently open directory. */ -ap_status_t ap_dir_entry_size(ap_ssize_t *size, ap_dir_t *thedir); +apr_status_t apr_dir_entry_size(apr_ssize_t *size, apr_dir_t *thedir); /** * Get the last modified time of the current directory entry. * @param mtime the last modified time of the directory entry. * @param thedir the currently open directory. */ -ap_status_t ap_dir_entry_mtime(ap_time_t *mtime, ap_dir_t *thedir); +apr_status_t apr_dir_entry_mtime(apr_time_t *mtime, apr_dir_t *thedir); /** * Get the file type of the current directory entry. * @param type the file type of the directory entry. * @param thedir the currently open directory. */ -ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, ap_dir_t *thedir); +apr_status_t apr_dir_entry_ftype(ap_filetype_e *type, apr_dir_t *thedir); /** * Write a string to a file using a printf format. @@ -526,9 +526,9 @@ ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, ap_dir_t *thedir); * @param format The format string * @param ... The values to substitute in the format string * @return The number of bytes written - * @deffunc int ap_fprintf(ap_file_t *fptr, const char *format, ...) + * @deffunc int apr_fprintf(apr_file_t *fptr, const char *format, ...) */ -APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) +APR_EXPORT(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) __attribute__((format(printf,2,3))); #ifdef __cplusplus diff --git a/include/apr_fnmatch.h b/include/apr_fnmatch.h index b04e679cf..e15663337 100644 --- a/include/apr_fnmatch.h +++ b/include/apr_fnmatch.h @@ -66,19 +66,19 @@ extern "C" { * FNM_PERIOD -- Period must be matched by period * FNM_CASE_BLIND -- Compare characters case-insensitively. * </PRE> - * @deffunc ap_status_t ap_fnmatch(const char *pattern, const char *strings, int flags) + * @deffunc apr_status_t apr_fnmatch(const char *pattern, const char *strings, int flags) */ -APR_EXPORT(ap_status_t) ap_fnmatch(const char *pattern, const char *strings, +APR_EXPORT(apr_status_t) apr_fnmatch(const char *pattern, const char *strings, int flags); /** * Determine if the given pattern is a regular expression. * @param pattern The pattern to search for glob characters. * @return non-zero if pattern has any glob characters in it - * @deffunc int ap_is_fnmatch(const char *pattern) + * @deffunc int apr_is_fnmatch(const char *pattern) */ -APR_EXPORT(int) ap_is_fnmatch(const char *pattern); +APR_EXPORT(int) apr_is_fnmatch(const char *pattern); #ifdef __cplusplus } diff --git a/include/apr_general.h b/include/apr_general.h index 944e1bc83..33b9e3496 100644 --- a/include/apr_general.h +++ b/include/apr_general.h @@ -81,7 +81,7 @@ extern "C" { #define MAXIMUM_WAIT_OBJECTS 64 -typedef int ap_signum_t; +typedef int apr_signum_t; #ifdef SIGHUP #define APR_SIGHUP SIGHUP @@ -253,7 +253,7 @@ int strncasecmp(const char *a, const char *b, size_t n); * @param length size of the buffer */ /* TODO: I'm not sure this is the best place to put this prototype...*/ -ap_status_t ap_generate_random_bytes(unsigned char * buf, int length); +apr_status_t apr_generate_random_bytes(unsigned char * buf, int length); #endif /* Memory allocation/Pool debugging options... @@ -272,25 +272,25 @@ ap_status_t ap_generate_random_bytes(unsigned char * buf, int length); #define ALLOC_STATS */ -typedef struct ap_pool_t { +typedef struct apr_pool_t { union block_hdr *first; union block_hdr *last; struct cleanup *cleanups; struct process_chain *subprocesses; - struct ap_pool_t *sub_pools; - struct ap_pool_t *sub_next; - struct ap_pool_t *sub_prev; - struct ap_pool_t *parent; + struct apr_pool_t *sub_pools; + struct apr_pool_t *sub_next; + struct apr_pool_t *sub_prev; + struct apr_pool_t *parent; char *free_first_avail; #ifdef ALLOC_USE_MALLOC void *allocation_list; #endif #ifdef POOL_DEBUG - struct ap_pool_t *joined; + struct apr_pool_t *joined; #endif int (*apr_abort)(int retcode); struct datastruct *prog_data; -}ap_pool_t; +}apr_pool_t; /* pool functions */ @@ -299,10 +299,10 @@ typedef struct ap_pool_t { * @param newcont The pool we have just created. * @param cont The parent pool. If this is NULL, the new pool is a root * pool. If it is non-NULL, the new pool will inherit all - * of it's parent pool's attributes, except the ap_pool_t will + * of it's parent pool's attributes, except the apr_pool_t will * be a sub-pool. */ -ap_status_t ap_create_pool(ap_pool_t **newcont, ap_pool_t *cont); +apr_status_t apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont); /** * Set the data associated with the current pool @@ -319,9 +319,9 @@ ap_status_t ap_create_pool(ap_pool_t **newcont, ap_pool_t *cont); * It is advised that steps are taken to ensure that a unique * key is used at all times. */ -ap_status_t ap_set_userdata(const void *data, const char *key, - ap_status_t (*cleanup) (void *), - ap_pool_t *cont); +apr_status_t apr_set_userdata(const void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_pool_t *cont); /** * Return the data associated with the current pool. @@ -329,13 +329,13 @@ ap_status_t ap_set_userdata(const void *data, const char *key, * @param key The user data associated with the pool. * @param cont The current pool. */ -ap_status_t ap_get_userdata(void **data, const char *key, ap_pool_t *cont); +apr_status_t apr_get_userdata(void **data, const char *key, apr_pool_t *cont); /** * Setup any APR internal data structures. This MUST be the first function * called for any APR program. */ -ap_status_t ap_initialize(void); +apr_status_t apr_initialize(void); /** * Tear down any APR internal data structures which aren't torn down @@ -343,7 +343,7 @@ ap_status_t ap_initialize(void); * @tip An APR program must call this function at termination once it * has stopped using APR services. */ -void ap_terminate(void); +void apr_terminate(void); /** * Set the APR_ABORT function. @@ -354,7 +354,7 @@ void ap_terminate(void); * then APR will return an error and expect the calling program to * deal with the error accordingly. */ -ap_status_t ap_set_abort(int (*apr_abort)(int retcode), ap_pool_t *cont); +apr_status_t apr_set_abort(int (*apr_abort)(int retcode), apr_pool_t *cont); /** * Return a human readable string describing the specified error. @@ -362,7 +362,7 @@ ap_status_t ap_set_abort(int (*apr_abort)(int retcode), ap_pool_t *cont); * @param buf A buffer to hold the error string. * @param bufsize Size of the buffer to hold the string. */ -char *ap_strerror(ap_status_t statcode, char *buf, ap_size_t bufsize); +char *apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize); #ifdef __cplusplus } diff --git a/include/apr_getopt.h b/include/apr_getopt.h index a3e5b2c68..55266153a 100644 --- a/include/apr_getopt.h +++ b/include/apr_getopt.h @@ -65,7 +65,7 @@ APR_VAR_IMPORT char * /** * Parse the command line options passed to the program. - * @param nargc The number of arguments passed to ap_getopt to parse + * @param nargc The number of arguments passed to apr_getopt to parse * @param nargv The array of command line options to parse * @param ostr A string of characters that are acceptable options to the * program. Characters followed by ":" are required to have an @@ -80,11 +80,11 @@ APR_VAR_IMPORT char * * </PRE> * @param cont The pool to operate on. * @tip Arguments 2 and 3 are most commonly argc and argv from main(argc, argv) - * @deffunc ap_status_t ap_getopt(ap_int32_t nargc, char *const *nargv, const char *ostr, ap_int32_t *rv, ap_pool_t *cont) + * @deffunc apr_status_t apr_getopt(apr_int32_t nargc, char *const *nargv, const char *ostr, apr_int32_t *rv, apr_pool_t *cont) */ -APR_EXPORT(ap_status_t) ap_getopt(ap_int32_t nargc, char *const *nargv, - const char *ostr, ap_int32_t *rv, - ap_pool_t *cont); +APR_EXPORT(apr_status_t) apr_getopt(apr_int32_t nargc, char *const *nargv, + const char *ostr, apr_int32_t *rv, + apr_pool_t *cont); #endif /* ! APR_GETOPT_H */ diff --git a/include/apr_hash.h b/include/apr_hash.h index 02e3ca0bd..c4be2d980 100644 --- a/include/apr_hash.h +++ b/include/apr_hash.h @@ -72,19 +72,19 @@ extern "C" { /* * Abstract type for hash tables. */ -typedef struct ap_hash_t ap_hash_t; +typedef struct apr_hash_t apr_hash_t; /* * Abstract type for scanning hash tables. */ -typedef struct ap_hash_index_t ap_hash_index_t; +typedef struct apr_hash_index_t apr_hash_index_t; /** * Create a hash table within a pool. * @param pool The pool to allocate the hash table out of * @return The hash table just created */ -APR_EXPORT(ap_hash_t *) ap_make_hash(ap_pool_t *pool); +APR_EXPORT(apr_hash_t *) apr_make_hash(apr_pool_t *pool); /** * Associate a value with a key in a hash table. @@ -95,7 +95,7 @@ APR_EXPORT(ap_hash_t *) ap_make_hash(ap_pool_t *pool); * @param val Value to associate with the key * @tip If the value is NULL the hash entry is deleted. */ -APR_EXPORT(void) ap_hash_set(ap_hash_t *ht, const void *key, size_t klen, +APR_EXPORT(void) apr_hash_set(apr_hash_t *ht, const void *key, size_t klen, const void *val); /** @@ -106,7 +106,7 @@ APR_EXPORT(void) ap_hash_set(ap_hash_t *ht, const void *key, size_t klen, * If the length is 0 it is assumed to be strlen(key)+1 * @return Returns NULL if the key is not present. */ -APR_EXPORT(void) *ap_hash_get(ap_hash_t *ht, const void *key, size_t klen); +APR_EXPORT(void) *apr_hash_get(apr_hash_t *ht, const void *key, size_t klen); /** * Start iterating over the entries in a hash table. @@ -115,13 +115,13 @@ APR_EXPORT(void) *ap_hash_get(ap_hash_t *ht, const void *key, size_t klen); * @tip Example: * <PRE> * - * int sum_values(ap_hash_t *ht) + * int sum_values(apr_hash_t *ht) * { - * ap_hash_index_t *hi; + * apr_hash_index_t *hi; * void *val; * int sum = 0; - * for (hi = ap_hash_first(ht); hi; hi = ap_hash_next(hi)) { - * ap_hash_this(hi, NULL, NULL, &val); + * for (hi = apr_hash_first(ht); hi; hi = apr_hash_next(hi)) { + * apr_hash_this(hi, NULL, NULL, &val); * sum += *(int *)val; * } * return sum; @@ -133,14 +133,14 @@ APR_EXPORT(void) *ap_hash_get(ap_hash_t *ht, const void *key, size_t klen); * progress at the same time. * </PRE> */ -APR_EXPORT(ap_hash_index_t *) ap_hash_first(ap_hash_t *ht); +APR_EXPORT(apr_hash_index_t *) apr_hash_first(apr_hash_t *ht); /** * Continue iterating over the entries in a hash table. * @param hi The iteration state * @return a pointer to the updated iteration state. NULL if there are no more * entries. */ -APR_EXPORT(ap_hash_index_t *) ap_hash_next(ap_hash_index_t *hi); +APR_EXPORT(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi); /** * Get the current entry's details from the iteration state. @@ -151,7 +151,7 @@ APR_EXPORT(ap_hash_index_t *) ap_hash_next(ap_hash_index_t *hi); * @tip The return pointers should point to a variable that will be set to the * corresponding data, or they may be NULL if the data isn't interesting. */ -APR_EXPORT(void) ap_hash_this(ap_hash_index_t *hi, const void **key, +APR_EXPORT(void) apr_hash_this(apr_hash_index_t *hi, const void **key, size_t *klen, void **val); #ifdef __cplusplus diff --git a/include/apr_lib.h b/include/apr_lib.h index e5e76ee18..3e4c84bd5 100644 --- a/include/apr_lib.h +++ b/include/apr_lib.h @@ -89,10 +89,10 @@ extern "C" { /* * Structure used by the variable-formatter routines. */ -typedef struct ap_vformatter_buff_t { +typedef struct apr_vformatter_buff_t { char *curpos; char *endpos; -} ap_vformatter_buff_t; +} apr_vformatter_buff_t; /** * return the final element of the pathname @@ -105,9 +105,9 @@ typedef struct ap_vformatter_buff_t { * "gum" -> "gum" * "wi\\n32\\stuff" -> "stuff" * </PRE> - * @deffunc const char * ap_filename_of_pathname(const char *pathname) + * @deffunc const char * apr_filename_of_pathname(const char *pathname) */ -APR_EXPORT(const char *) ap_filename_of_pathname(const char *pathname); +APR_EXPORT(const char *) apr_filename_of_pathname(const char *pathname); /* These macros allow correct support of 8-bit characters on systems which * support 8-bit characters. Pretty dumb how the cast is required, but @@ -145,7 +145,7 @@ APR_EXPORT(const char *) ap_filename_of_pathname(const char *pathname); #endif /* WIN32 */ /** - * ap_vformatter() is a generic printf-style formatting routine + * apr_vformatter() is a generic printf-style formatting routine * with some extensions. * @param flush_func The function to call when the buffer is full * @param c The buffer to write to @@ -165,96 +165,96 @@ APR_EXPORT(const char *) ap_filename_of_pathname(const char *pathname); * work as expected at all, but that seems to be a fair trade-off * for the increased robustness of having printf-warnings work. * - * Additionally, ap_vformatter allows for arbitrary output methods + * Additionally, apr_vformatter allows for arbitrary output methods * using the ap_vformatter_buff and flush_func. * * The ap_vformatter_buff has two elements curpos and endpos. - * curpos is where ap_vformatter will write the next byte of output. + * curpos is where apr_vformatter will write the next byte of output. * It proceeds writing output to curpos, and updating curpos, until * either the end of output is reached, or curpos == endpos (i.e. the * buffer is full). * - * If the end of output is reached, ap_vformatter returns the + * If the end of output is reached, apr_vformatter returns the * number of bytes written. * * When the buffer is full, the flush_func is called. The flush_func * can return -1 to indicate that no further output should be attempted, - * and ap_vformatter will return immediately with -1. Otherwise + * and apr_vformatter will return immediately with -1. Otherwise * the flush_func should flush the buffer in whatever manner is - * appropriate, re ap_pool_t nitialize curpos and endpos, and return 0. + * appropriate, re apr_pool_t nitialize curpos and endpos, and return 0. * * Note that flush_func is only invoked as a result of attempting to * write another byte at curpos when curpos >= endpos. So for * example, it's possible when the output exactly matches the buffer * space available that curpos == endpos will be true when - * ap_vformatter returns. + * apr_vformatter returns. * - * ap_vformatter does not call out to any other code, it is entirely + * apr_vformatter does not call out to any other code, it is entirely * self-contained. This allows the callers to do things which are - * otherwise "unsafe". For example, ap_psprintf uses the "scratch" + * otherwise "unsafe". For example, apr_psprintf uses the "scratch" * space at the unallocated end of a block, and doesn't actually - * complete the allocation until ap_vformatter returns. ap_psprintf - * would be completely broken if ap_vformatter were to call anything - * that used a ap_pool_t. Similarly http_bprintf() uses the "scratch" + * complete the allocation until apr_vformatter returns. apr_psprintf + * would be completely broken if apr_vformatter were to call anything + * that used a apr_pool_t. Similarly http_bprintf() uses the "scratch" * space at the end of its output buffer, and doesn't actually note * that the space is in use until it either has to flush the buffer - * or until ap_vformatter returns. + * or until apr_vformatter returns. * </PRE> - * @deffunc int ap_vformatter(int (*flush_func)(ap_vformatter_buff_t *b), ap_vformatter_buff_t *c, const char *fmt, va_list ap) + * @deffunc int apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b), apr_vformatter_buff_t *c, const char *fmt, va_list ap) */ -APR_EXPORT(int) ap_vformatter(int (*flush_func)(ap_vformatter_buff_t *b), - ap_vformatter_buff_t *c, const char *fmt, +APR_EXPORT(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b), + apr_vformatter_buff_t *c, const char *fmt, va_list ap); /** * Validate any password encypted with any algorithm that APR understands * @param passwd The password to validate * @param hash The password to validate against - * @deffunc ap_status_t ap_validate_password(const char *passwd, const char *hash) + * @deffunc apr_status_t apr_validate_password(const char *passwd, const char *hash) */ -APR_EXPORT(ap_status_t) ap_validate_password(const char *passwd, const char *hash); +APR_EXPORT(apr_status_t) apr_validate_password(const char *passwd, const char *hash); /* - * These are snprintf implementations based on ap_vformatter(). + * These are snprintf implementations based on apr_vformatter(). * * Note that various standards and implementations disagree on the return * value of snprintf, and side-effects due to %n in the formatting string. - * ap_snprintf behaves as follows: + * apr_snprintf behaves as follows: * * Process the format string until the entire string is exhausted, or * the buffer fills. If the buffer fills then stop processing immediately * (so no further %n arguments are processed), and return the buffer * length. In all cases the buffer is NUL terminated. * - * In no event does ap_snprintf return a negative number. It's not possible + * In no event does apr_snprintf return a negative number. It's not possible * to distinguish between an output which was truncated, and an output which * exactly filled the buffer. */ /** - *snprintf routine based on ap_vformatter. This means it understands the + *snprintf routine based on apr_vformatter. This means it understands the *same extensions.> * @param buf The buffer to write to * @param len The size of the buffer * @param format The format string * @param ... The arguments to use to fill out the format string. - * @deffunc int ap_snprintf(char *buf, size_t len, const char *format, ...) + * @deffunc int apr_snprintf(char *buf, size_t len, const char *format, ...) */ -APR_EXPORT_NONSTD(int) ap_snprintf(char *buf, size_t len, +APR_EXPORT_NONSTD(int) apr_snprintf(char *buf, size_t len, const char *format, ...) __attribute__((format(printf,3,4))); /** - * vsnprintf routine based on ap_vformatter. This means it understands the + * vsnprintf routine based on apr_vformatter. This means it understands the * same extensions. * @param buf The buffer to write to * @param len The size of the buffer * @param format The format string * @param ap The arguments to use to fill out the format string. - * @deffunc int ap_vsnprintf(char *buf, size_t len, const char *format, va_list ap) + * @deffunc int apr_vsnprintf(char *buf, size_t len, const char *format, va_list ap) */ -APR_EXPORT(int) ap_vsnprintf(char *buf, size_t len, const char *format, +APR_EXPORT(int) apr_vsnprintf(char *buf, size_t len, const char *format, va_list ap); /** @@ -262,9 +262,9 @@ APR_EXPORT(int) ap_vsnprintf(char *buf, size_t len, const char *format, * @param prompt The prompt to display * @param pwbuf Where to store the password * @param bufsize The length of the password string. - * @deffunc ap_status_t ap_getpass(const char *prompt, char *pwbuf, size_t *bufsize) + * @deffunc apr_status_t apr_getpass(const char *prompt, char *pwbuf, size_t *bufsize) */ -APR_EXPORT(ap_status_t) ap_getpass(const char *prompt, char *pwbuf, size_t *bufsize); +APR_EXPORT(apr_status_t) apr_getpass(const char *prompt, char *pwbuf, size_t *bufsize); /** * Register a process to be killed when a pool dies. @@ -273,14 +273,14 @@ APR_EXPORT(ap_status_t) ap_getpass(const char *prompt, char *pwbuf, size_t *bufs * @param how How to kill the process, one of: * <PRE> * kill_never -- process is never sent any signals - * kill_always -- process is sent SIGKILL on ap_pool_t cleanup + * kill_always -- process is sent SIGKILL on apr_pool_t cleanup * kill_after_timeout -- SIGTERM, wait 3 seconds, SIGKILL * just_wait -- wait forever for the process to complete * kill_only_once -- send SIGTERM and then wait * </PRE> - * @deffunc void ap_note_subprocess(struct ap_pool_t *a, ap_proc_t *pid, enum kill_conditions how) + * @deffunc void apr_note_subprocess(struct apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how) */ -APR_EXPORT(void) ap_note_subprocess(struct ap_pool_t *a, ap_proc_t *pid, +APR_EXPORT(void) apr_note_subprocess(struct apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how); #ifdef __cplusplus diff --git a/include/apr_lock.h b/include/apr_lock.h index 333bc5c91..8557d1011 100644 --- a/include/apr_lock.h +++ b/include/apr_lock.h @@ -66,11 +66,11 @@ extern "C" { * @package APR lock library */ -typedef enum {APR_CROSS_PROCESS, APR_INTRAPROCESS, APR_LOCKALL} ap_lockscope_e; +typedef enum {APR_CROSS_PROCESS, APR_INTRAPROCESS, APR_LOCKALL} apr_lockscope_e; -typedef enum {APR_MUTEX, APR_READWRITE} ap_locktype_e; +typedef enum {APR_MUTEX, APR_READWRITE} apr_locktype_e; -typedef struct ap_lock_t ap_lock_t; +typedef struct apr_lock_t apr_lock_t; /* Function definitions */ @@ -96,21 +96,21 @@ typedef struct ap_lock_t ap_lock_t; * @tip APR_CROSS_PROCESS may lock both processes and threads, but it is * only guaranteed to lock processes. */ -ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, - ap_lockscope_e scope, const char *fname, - ap_pool_t *cont); +apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, + apr_lockscope_e scope, const char *fname, + apr_pool_t *cont); /** * Lock a protected region. * @param lock The lock to set. */ -ap_status_t ap_lock(ap_lock_t *lock); +apr_status_t apr_lock(apr_lock_t *lock); /** * Unlock a protected region. * @param lock The lock to reset. */ -ap_status_t ap_unlock(ap_lock_t *lock); +apr_status_t apr_unlock(apr_lock_t *lock); /** * Free the memory associated with a lock. @@ -118,7 +118,7 @@ ap_status_t ap_unlock(ap_lock_t *lock); * @tip If the lock is currently active when it is destroyed, it * will be unlocked first. */ -ap_status_t ap_destroy_lock(ap_lock_t *lock); +apr_status_t apr_destroy_lock(apr_lock_t *lock); /** * Re-open a lock in a child process. @@ -126,15 +126,15 @@ ap_status_t ap_destroy_lock(ap_lock_t *lock); * @param fname A file name to use if the lock mechanism requires one. This * argument should always be provided. The lock code itself will * determine if it should be used. This filename should be the - * same one that was passed to ap_create_lock + * same one that was passed to apr_create_lock * @param cont The pool to operate on. * @tip This function doesn't always do something, it depends on the * locking mechanism chosen for the platform, but it is a good * idea to call it regardless, because it makes the code more * portable. */ -ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, - ap_pool_t *cont); +apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, + apr_pool_t *cont); /** * Return the pool associated with the current lock. @@ -142,7 +142,7 @@ ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, * @param key The key to use when retreiving data associated with this lock * @param data The user data associated with the lock. */ -ap_status_t ap_get_lockdata(ap_lock_t *lock, const char *key, void *data); +apr_status_t apr_get_lockdata(apr_lock_t *lock, const char *key, void *data); /** * Return the pool associated with the current lock. @@ -151,8 +151,8 @@ ap_status_t ap_get_lockdata(ap_lock_t *lock, const char *key, void *data); * @param key The key to use when associating data with this lock * @param cleanup The cleanup to use when the lock is destroyed. */ -ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, const char *key, - ap_status_t (*cleanup) (void *)); +apr_status_t apr_set_lockdata(apr_lock_t *lock, void *data, const char *key, + apr_status_t (*cleanup) (void *)); #ifdef __cplusplus } diff --git a/include/apr_md5.h b/include/apr_md5.h index 774bfef11..412f1a7a1 100644 --- a/include/apr_md5.h +++ b/include/apr_md5.h @@ -107,26 +107,26 @@ typedef struct { UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ unsigned char buffer[64]; /* input buffer */ #if APR_HAS_XLATE - ap_xlate_t *xlate; /* translation handle */ + apr_xlate_t *xlate; /* translation handle */ #endif } ap_md5_ctx_t; /** * MD5 Initialize. Begins an MD5 operation, writing a new context. * @param context The MD5 context to initialize. - * @deffunc ap_status_t ap_MD5Init(ap_md5_ctx_t *context) + * @deffunc apr_status_t apr_MD5Init(ap_md5_ctx_t *context) */ -APR_EXPORT(ap_status_t) ap_MD5Init(ap_md5_ctx_t *context); +APR_EXPORT(apr_status_t) apr_MD5Init(ap_md5_ctx_t *context); /** * MD5 translation setup. Provides the APR translation handle to be used * for translating the content before calculating the digest. * @param context The MD5 content to set the translation for. * @param xlate The translation handle to use for this MD5 context - * @deffunc ap_status_t ap_MD5SetXlate(ap_md5_ctx_t *context, ap_xlate_t *xlate) + * @deffunc apr_status_t ap_MD5SetXlate(ap_md5_ctx_t *context, apr_xlate_t *xlate) */ #if APR_HAS_XLATE -APR_EXPORT(ap_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, ap_xlate_t *xlate); +APR_EXPORT(apr_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, apr_xlate_t *xlate); #else #define ap_MD5SetXlate(context, xlate) APR_ENOTIMPL #endif @@ -137,9 +137,9 @@ APR_EXPORT(ap_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, ap_xlate_t *xlate) * @param context The MD5 content to update. * @param input next message block to update * @param inputLen The length of the next message block - * @deffunc ap_status_t ap_MD5Update(ap_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen) + * @deffunc apr_status_t apr_MD5Update(ap_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen) */ -APR_EXPORT(ap_status_t) ap_MD5Update(ap_md5_ctx_t *context, +APR_EXPORT(apr_status_t) apr_MD5Update(ap_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen); @@ -148,9 +148,9 @@ APR_EXPORT(ap_status_t) ap_MD5Update(ap_md5_ctx_t *context, * message digest and zeroing the context * @param digest The final MD5 digest * @param context The MD5 content we are finalizing. - * @deffunc ap_status_t ap_MD5Final(unsigned char digest[MD5_DIGESTSIZE], ap_md5_ctx_t *context) + * @deffunc apr_status_t apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], ap_md5_ctx_t *context) */ -APR_EXPORT(ap_status_t) ap_MD5Final(unsigned char digest[MD5_DIGESTSIZE], +APR_EXPORT(apr_status_t) apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], ap_md5_ctx_t *context); /** @@ -159,9 +159,9 @@ APR_EXPORT(ap_status_t) ap_MD5Final(unsigned char digest[MD5_DIGESTSIZE], * @param salt The salt to use for the encoding * @param result The string to store the encoded password in * @param nbytes The length of the string - * @deffunc ap_status_t ap_MD5Encode(const char *password, const char *salt, char *result, size_t nbytes) + * @deffunc apr_status_t apr_MD5Encode(const char *password, const char *salt, char *result, size_t nbytes) */ -APR_EXPORT(ap_status_t) ap_MD5Encode(const char *password, const char *salt, +APR_EXPORT(apr_status_t) apr_MD5Encode(const char *password, const char *salt, char *result, size_t nbytes); #ifdef __cplusplus diff --git a/include/apr_mmap.h b/include/apr_mmap.h index 3334ac177..7b57a50f8 100644 --- a/include/apr_mmap.h +++ b/include/apr_mmap.h @@ -68,15 +68,15 @@ extern "C" { * @package APR MMAP library */ -typedef struct ap_mmap_t ap_mmap_t; +typedef struct apr_mmap_t apr_mmap_t; /* As far as I can tell the only really sane way to store an MMAP is as a * void * and a length. BeOS requires this area_id, but that's just a little * something extra. I am exposing this type, because it doesn't make much * sense to keep it private, and opening it up makes some stuff easier in * Apache. */ -struct ap_mmap_t { - ap_pool_t *cntxt; +struct apr_mmap_t { + apr_pool_t *cntxt; #ifdef BEOS area_id area; #endif @@ -94,14 +94,14 @@ struct ap_mmap_t { * @param size The size of the file * @param cntxt The pool to use when creating the mmap. */ -ap_status_t ap_mmap_create(ap_mmap_t ** newmmap, ap_file_t *file, ap_off_t offset, - ap_size_t size, ap_pool_t *cntxt); +apr_status_t apr_mmap_create(apr_mmap_t ** newmmap, apr_file_t *file, apr_off_t offset, + apr_size_t size, apr_pool_t *cntxt); /** * Remove a mmap'ed. * @param mmap The mmap'ed file. */ -ap_status_t ap_mmap_delete(ap_mmap_t *mmap); +apr_status_t apr_mmap_delete(apr_mmap_t *mmap); /** * Move the pointer into the mmap'ed file to the specified offset. @@ -109,7 +109,7 @@ ap_status_t ap_mmap_delete(ap_mmap_t *mmap); * @param mmap The mmap'ed file. * @param offset The offset to move to. */ -ap_status_t ap_mmap_offset(void **addr, ap_mmap_t *mmap, ap_off_t offset); +apr_status_t apr_mmap_offset(void **addr, apr_mmap_t *mmap, apr_off_t offset); #ifdef __cplusplus } diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 375b071e4..ad0b3087d 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -108,7 +108,7 @@ typedef enum {APR_SHUTDOWN_READ, APR_SHUTDOWN_WRITE, */ #if (!APR_HAVE_IN_ADDR) struct in_addr { - ap_uint32_t s_addr; + apr_uint32_t s_addr; } #endif @@ -122,17 +122,17 @@ struct in_addr { #define ap_inet_addr inet_network #endif -typedef struct ap_socket_t ap_socket_t; -typedef struct ap_pollfd_t ap_pollfd_t; -typedef struct ap_hdtr_t ap_hdtr_t; -typedef struct in_addr ap_in_addr; +typedef struct apr_socket_t apr_socket_t; +typedef struct apr_pollfd_t apr_pollfd_t; +typedef struct apr_hdtr_t apr_hdtr_t; +typedef struct in_addr apr_in_addr; #if APR_HAS_SENDFILE /* Define flags passed in on ap_sendfile() */ #define APR_SENDFILE_DISCONNECT_SOCKET 1 /* A structure to encapsulate headers and trailers for ap_sendfile */ -struct ap_hdtr_t { +struct apr_hdtr_t { struct iovec* headers; int numheaders; struct iovec* trailers; @@ -147,7 +147,7 @@ struct ap_hdtr_t { * @param new_sock The new socket that has been setup. * @param cont The pool to use */ -ap_status_t ap_create_tcp_socket(ap_socket_t **new_sock, ap_pool_t *cont); +apr_status_t apr_create_tcp_socket(apr_socket_t **new_sock, apr_pool_t *cont); /** * Shutdown either reading, writing, or both sides of a tcp socket. @@ -161,13 +161,13 @@ ap_status_t ap_create_tcp_socket(ap_socket_t **new_sock, ap_pool_t *cont); * @tip This does not actually close the socket descriptor, it just * controls which calls are still valid on the socket. */ -ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how); +apr_status_t apr_shutdown(apr_socket_t *thesocket, ap_shutdown_how_e how); /** * Close a tcp socket. * @param thesocket The socket to close */ -ap_status_t ap_close_socket(ap_socket_t *thesocket); +apr_status_t apr_close_socket(apr_socket_t *thesocket); /** * Bind the socket to it's assocaited port @@ -175,7 +175,7 @@ ap_status_t ap_close_socket(ap_socket_t *thesocket); * @tip This is where we will find out if there is any other process * using the selected port. */ -ap_status_t ap_bind(ap_socket_t *sock); +apr_status_t apr_bind(apr_socket_t *sock); /** * Listen to a bound socketi for connections. @@ -184,7 +184,7 @@ ap_status_t ap_bind(ap_socket_t *sock); * listen queue. If this value is less than zero, the listen * queue size is set to zero. */ -ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog); +apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog); /** * Accept a new connection request @@ -194,8 +194,8 @@ ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog); * @param sock The socket we are listening on. * @param connection_pool The pool for the new socket. */ -ap_status_t ap_accept(ap_socket_t **new_sock, ap_socket_t *sock, - ap_pool_t *connection_pool); +apr_status_t apr_accept(apr_socket_t **new_sock, apr_socket_t *sock, + apr_pool_t *connection_pool); /** * Issue a connection request to a socket either on the same machine @@ -205,14 +205,14 @@ ap_status_t ap_accept(ap_socket_t **new_sock, ap_socket_t *sock, * APR assumes that the sockaddr_in in the apr_socket is * completely filled out. */ -ap_status_t ap_connect(ap_socket_t *sock, char *hostname); +apr_status_t apr_connect(apr_socket_t *sock, char *hostname); /** * Get name of the machine we are currently connected to. * @param name A buffer to store the hostname in. * @param sock The socket to examine. */ -ap_status_t ap_get_remote_hostname(char **name, ap_socket_t *sock); +apr_status_t apr_get_remote_hostname(char **name, apr_socket_t *sock); /** * Get name of the current machine @@ -221,7 +221,7 @@ ap_status_t ap_get_remote_hostname(char **name, ap_socket_t *sock); * buffer provided. * @param cont The pool to use. */ -ap_status_t ap_gethostname(char *buf, int len, ap_pool_t *cont); +apr_status_t apr_gethostname(char *buf, int len, apr_pool_t *cont); /** * Return the pool associated with the current socket> @@ -229,7 +229,7 @@ ap_status_t ap_gethostname(char *buf, int len, ap_pool_t *cont); * @param key The key to associate with the user data. * @param sock The currently open socket. */ -ap_status_t ap_get_socketdata(void **data, const char *key, ap_socket_t *sock); +apr_status_t apr_get_socketdata(void **data, const char *key, apr_socket_t *sock); /** * Set the pool associated with the current socket. @@ -238,8 +238,8 @@ ap_status_t ap_get_socketdata(void **data, const char *key, ap_socket_t *sock); * @param key The key to associate with the data. * @param cleanup The cleanup to call when the socket is destroyed. */ -ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, const char *key, - ap_status_t (*cleanup) (void*)); +apr_status_t apr_set_socketdata(apr_socket_t *sock, void *data, const char *key, + apr_status_t (*cleanup) (void*)); /** * Send data over a network. @@ -250,14 +250,14 @@ ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, const char *key, * @tip * <PRE> * This functions acts like a blocking write by default. To change - * this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option. + * this behavior, use apr_setsocketopt with the APR_SO_TIMEOUT option. * * It is possible for both bytes to be sent and an error to be returned. * * APR_EINTR is never returned. * </PRE> */ -ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len); +apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_ssize_t *len); /** * Send multiple packets of data over a network. @@ -268,7 +268,7 @@ ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len); * @tip * <PRE> * This functions acts like a blocking write by default. To change - * this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option. + * this behavior, use apr_setsocketopt with the APR_SO_TIMEOUT option. * The number of bytes actually sent is stored in argument 3. * * It is possible for both bytes to be sent and an error to be returned. @@ -276,8 +276,8 @@ ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len); * APR_EINTR is never returned. * </PRE> */ -ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec, - ap_int32_t nvec, ap_ssize_t *len); +apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, + apr_int32_t nvec, apr_ssize_t *len); #if APR_HAS_SENDFILE /** @@ -290,11 +290,11 @@ ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec, * @param len Number of bytes to send * @param flags APR flags that are mapped to OS specific flags * @tip This functions acts like a blocking write by default. To change - * this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option. + * this behavior, use apr_setsocketopt with the APR_SO_TIMEOUT option. * The number of bytes actually sent is stored in argument 5. */ -ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, ap_hdtr_t *hdtr, - ap_off_t *offset, ap_size_t *len, ap_int32_t flags); +apr_status_t ap_sendfile(apr_socket_t *sock, apr_file_t *file, apr_hdtr_t *hdtr, + apr_off_t *offset, apr_size_t *len, apr_int32_t flags); #endif /** @@ -306,7 +306,7 @@ ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, ap_hdtr_t *hdtr, * @tip * <PRE> * This functions acts like a blocking read by default. To change - * this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option. + * this behavior, use apr_setsocketopt with the APR_SO_TIMEOUT option. * The number of bytes actually sent is stored in argument 3. * * It is possible for both bytes to be received and an APR_EOF or @@ -315,7 +315,7 @@ ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, ap_hdtr_t *hdtr, * APR_EINTR is never returned. * </PRE> */ -ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len); +apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_ssize_t *len); /** * Setup socket options for the specified socket @@ -337,7 +337,7 @@ ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len); * </PRE> * @param on Are we turning the option on or off. */ -ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on); +apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on); /** * Query socket options for the specified socket @@ -361,7 +361,7 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on); * </PRE> * @param on Socket option returned on the call. */ -ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t* on); +apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t* on); /** * Associate a local port with a socket. @@ -371,30 +371,30 @@ ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t* on); * that this socket is going to use this port if possible. If * the port is already used, we won't find out about it here. */ -ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port); +apr_status_t apr_set_local_port(apr_socket_t *sock, apr_uint32_t port); /** * Assocaite a remote port with a socket. * @param sock The socket to enquire about. * @param port The local port this socket will be dealing with. * @tip This does not make a connection to the remote port, it is just - * telling apr which port ap_connect() should attempt to connect to. + * telling apr which port apr_connect() should attempt to connect to. */ -ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port); +apr_status_t apr_set_remote_port(apr_socket_t *sock, apr_uint32_t port); /** * Return the local port with a socket. * @param port The local port this socket is associated with. * @param sock The socket to enquire about. */ -ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock); +apr_status_t apr_get_local_port(apr_uint32_t *port, apr_socket_t *sock); /** * Return the remote port associated with a socket. * @param port The remote port this socket is associated with. * @param sock The socket to enquire about. */ -ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock); +apr_status_t apr_get_remote_port(apr_uint32_t *port, apr_socket_t *sock); /** * Assocaite a local socket addr with an apr socket. @@ -404,44 +404,44 @@ ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock); * @tip This does not bind the two together, it is just telling apr * that this socket is going to use this address if possible. */ -ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, const char *addr); +apr_status_t apr_set_local_ipaddr(apr_socket_t *sock, const char *addr); /** * Assocaite a remote socket addr with an apr socket. * @param sock The socket to use * @param addr The IP address to attach to the socket. * @tip This does not make a connection to the remote address, it is just - * telling apr which address ap_connect() should attempt to connect to. + * telling apr which address apr_connect() should attempt to connect to. */ -ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr); +apr_status_t apr_set_remote_ipaddr(apr_socket_t *sock, const char *addr); /** * Return the local IP address associated with an apr socket. * @param addr The local IP address associated with the socket. * @param sock The socket to use */ -ap_status_t ap_get_local_ipaddr(char **addr, ap_socket_t *sock); +apr_status_t apr_get_local_ipaddr(char **addr, apr_socket_t *sock); /** * Return the remote IP address associated with an apr socket. * @param addr The remote IP address associated with the socket. * @param sock The socket to use */ -ap_status_t ap_get_remote_ipaddr(char **addr, ap_socket_t *sock); +apr_status_t apr_get_remote_ipaddr(char **addr, apr_socket_t *sock); /** * Return the local socket name as a BSD style struct sockaddr_in. * @param name The local name associated with the socket. * @param sock The socket to use */ -ap_status_t ap_get_local_name(struct sockaddr_in **name, ap_socket_t *sock); +apr_status_t apr_get_local_name(struct sockaddr_in **name, apr_socket_t *sock); /** * Return the remote socket name as a BSD style struct sockaddr_in. * @param name The remote name associated with the socket. * @param sock The socket to use */ -ap_status_t ap_get_remote_name(struct sockaddr_in **name, ap_socket_t *sock); +apr_status_t apr_get_remote_name(struct sockaddr_in **name, apr_socket_t *sock); /** * Setup the memory required for poll to operate properly> @@ -449,8 +449,8 @@ ap_status_t ap_get_remote_name(struct sockaddr_in **name, ap_socket_t *sock); * @param num The number of socket descriptors to be polled. * @param cont The pool to operate on. */ -ap_status_t ap_setup_poll(ap_pollfd_t **new_poll, ap_int32_t num, - ap_pool_t *cont); +apr_status_t apr_setup_poll(apr_pollfd_t **new_poll, apr_int32_t num, + apr_pool_t *cont); /** * Poll the sockets in the poll structure @@ -468,7 +468,7 @@ ap_status_t ap_setup_poll(ap_pollfd_t **new_poll, ap_int32_t num, * socket has been signalled, or the timeout has expired. * </PRE> */ -ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, ap_interval_time_t timeout); +apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, apr_interval_time_t timeout); /** * Add a socket to the poll structure. @@ -481,8 +481,8 @@ ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, ap_interval_time_t ti * APR_POLLOUT -- signal if write will not block * </PRE> */ -ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, ap_socket_t *socket, - ap_int16_t event); +apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, apr_socket_t *socket, + apr_int16_t event); /** * Modify a socket in the poll structure with mask. @@ -495,14 +495,14 @@ ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, ap_socket_t *socket, * APR_POLLOUT -- signal if write will not block * </PRE> */ -ap_status_t ap_mask_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock, - ap_int16_t events); +apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock, + apr_int16_t events); /** * Remove a socket from the poll structure. * @param aprset The poll structure we will be using. * @param sock The socket to remove from the current poll structure. */ -ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock); +apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock); /** * Remove all sockets from the poll structure. @@ -514,7 +514,7 @@ ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock); * APR_POLLOUT -- signal if write will not block * </PRE> */ -ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t events); +apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t events); /** * Get the return events for the specified socket. @@ -531,8 +531,8 @@ ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t events); * @param sock The socket we wish to get information about. * @param aprset The poll structure we will be using. */ -ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, - ap_pollfd_t *aprset); +apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, + apr_pollfd_t *aprset); /** * Return the data associated with the current poll. @@ -540,7 +540,7 @@ ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, * @param key The key to use for retreiving data associated with a poll struct. * @param data The user data associated with the pollfd. */ -ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, const char *key, void *data); +apr_status_t apr_get_polldata(apr_pollfd_t *pollfd, const char *key, void *data); /** * Set the data associated with the current poll. @@ -549,8 +549,8 @@ ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, const char *key, void *data); * @param key The user data to associate with the pollfd. * @param cleanup The cleanup function */ -ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, const char *key, - ap_status_t (*cleanup) (void *)); +apr_status_t apr_set_polldata(apr_pollfd_t *pollfd, void *data, const char *key, + apr_status_t (*cleanup) (void *)); /** * Convert a File type to a socket so that it can be used in a poll operation. @@ -560,7 +560,7 @@ ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, const char *key, * ability to poll files for data to be read/written/exceptions will * have the APR_FILES_AS_SOCKETS macro defined as true. */ -ap_status_t ap_socket_from_file(ap_socket_t **newsock, ap_file_t *file); +apr_status_t apr_socket_from_file(apr_socket_t **newsock, apr_file_t *file); #ifdef __cplusplus } diff --git a/include/apr_pools.h b/include/apr_pools.h index e84555cc1..75df3e01c 100644 --- a/include/apr_pools.h +++ b/include/apr_pools.h @@ -73,14 +73,14 @@ extern "C" { * Instead, we maintain pools, and allocate items (both memory and I/O * handlers) from the pools --- currently there are two, one for per * transaction info, and one for config info. When a transaction is over, - * we can delete everything in the per-transaction ap_pool_t without fear, and + * we can delete everything in the per-transaction apr_pool_t without fear, and * without thinking too hard about it either. * * rst */ /* Arenas for configuration info and transaction info - * --- actual layout of the ap_pool_t structure is private to + * --- actual layout of the apr_pool_t structure is private to * alloc.c. */ @@ -96,14 +96,14 @@ extern "C" { enum kill_conditions { kill_never, /* process is never sent any signals */ - kill_always, /* process is sent SIGKILL on ap_pool_t cleanup */ + kill_always, /* process is sent SIGKILL on apr_pool_t cleanup */ kill_after_timeout, /* SIGTERM, wait 3 seconds, SIGKILL */ just_wait, /* wait forever for the process to complete */ kill_only_once /* send SIGTERM and then wait */ }; struct process_chain { - ap_proc_t *pid; + apr_proc_t *pid; enum kill_conditions kill_how; struct process_chain *next; }; @@ -151,9 +151,9 @@ struct process_chain { #endif #define ap_pool_join(a,b) #else -APR_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub); -APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts); -APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b); +APR_EXPORT(void) ap_pool_join(apr_pool_t *p, apr_pool_t *sub); +APR_EXPORT(apr_pool_t *) ap_find_pool(const void *ts); +APR_EXPORT(int) ap_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); #endif #ifdef ULTRIX_BRAIN_DEATH @@ -169,16 +169,16 @@ APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b); /** * Setup all of the internal structures required to use pools * @tip Programs do NOT need to call this directly. APR will call this - * automatically from ap_initialize. + * automatically from apr_initialize. */ -ap_status_t ap_init_alloc(void); /* Set up everything */ +apr_status_t apr_init_alloc(void); /* Set up everything */ /** * Tear down all of the internal structures required to use pools * @tip Programs do NOT need to call this directly. APR will call this - * automatically from ap_terminate. + * automatically from apr_terminate. */ -void ap_term_alloc(void); /* Tear down everything */ +void apr_term_alloc(void); /* Tear down everything */ /** * make a sub pool from the current pool @@ -188,41 +188,41 @@ void ap_term_alloc(void); /* Tear down everything */ * @tip The apr_abort function provides a way to quit the program if the * machine is out of memory. By default, APR will return with an * error. - * @deffunc ap_pool_t *ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retcode)) + * @deffunc apr_pool_t *apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int retcode)) */ -APR_EXPORT(ap_pool_t *) ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retcode)); +APR_EXPORT(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int retcode)); /** * clear all memory in the pool * @param p The pool to clear * @tip This does not actually free the memory, it just allows the pool * to re-use this memory for the next allocation. - * @deffunc void ap_clear_pool(ap_pool_t *p) + * @deffunc void apr_clear_pool(apr_pool_t *p) */ -APR_EXPORT(void) ap_clear_pool(ap_pool_t *p); +APR_EXPORT(void) apr_clear_pool(apr_pool_t *p); /** * destroy the pool * @param p The pool to destroy * @tip This will actually free the memory - * @deffunc void ap_destroy_pool(ap_pool_t *p) + * @deffunc void apr_destroy_pool(apr_pool_t *p) */ -APR_EXPORT(void) ap_destroy_pool(ap_pool_t *p); +APR_EXPORT(void) apr_destroy_pool(apr_pool_t *p); /** * report the number of bytes currently in the pool * @param p The pool to inspect * @return The number of bytes - * @deffunc ap_size_t ap_bytes_in_pool(ap_pool_t *p) + * @deffunc apr_size_t apr_bytes_in_pool(apr_pool_t *p) */ -APR_EXPORT(ap_size_t) ap_bytes_in_pool(ap_pool_t *p); +APR_EXPORT(apr_size_t) apr_bytes_in_pool(apr_pool_t *p); /** * report the number of bytes currently in the list of free blocks * @return The number of bytes - * @deffunc ap_size_t ap_bytes_in_free_blocks(void) + * @deffunc apr_size_t apr_bytes_in_free_blocks(void) */ -APR_EXPORT(ap_size_t) ap_bytes_in_free_blocks(void); +APR_EXPORT(apr_size_t) apr_bytes_in_free_blocks(void); /** * Determine if pool a is an ancestor of pool b @@ -230,27 +230,27 @@ APR_EXPORT(ap_size_t) ap_bytes_in_free_blocks(void); * @param b The pool to search for * @return True if a is an ancestor of b, NULL is considered an ancestor * of all pools. - * @deffunc int ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) + * @deffunc int ap_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) */ -APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b); +APR_EXPORT(int) ap_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); /** * Allocate a block of memory from a pool * @param c The pool to allocate out of * @param reqsize The amount of memory to allocate * @return The allocated memory - * @deffunc void *ap_palloc(ap_pool_t *c, ap_size_t reqsize) + * @deffunc void *apr_palloc(apr_pool_t *c, apr_size_t reqsize) */ -APR_EXPORT(void *) ap_palloc(ap_pool_t *c, ap_size_t reqsize); +APR_EXPORT(void *) apr_palloc(apr_pool_t *c, apr_size_t reqsize); /** * Allocate a block of memory from a pool and set all of the memory to 0 * @param p The pool to allocate out of * @param size The amount of memory to allocate * @return The allocated memory - * @deffunc void *ap_pcalloc(ap_pool_t *p, ap_size_t size) + * @deffunc void *apr_pcalloc(apr_pool_t *p, apr_size_t size) */ -APR_EXPORT(void *) ap_pcalloc(ap_pool_t *p, ap_size_t size); +APR_EXPORT(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); /** * Register a function to be called when a pool is cleared or destroyed @@ -259,31 +259,31 @@ APR_EXPORT(void *) ap_pcalloc(ap_pool_t *p, ap_size_t size); * @param plain_cleanup The function to call when the pool is cleared * or destroyed * @param child_cleanup The function to call when a child process is created - * @deffunc void ap_register_cleanup(ap_pool_t *p, const void *data, ap_status_t (*plain_cleanup) (void *), ap_status_t (*child_cleanup) (void *)) + * @deffunc void apr_register_cleanup(apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup) (void *), apr_status_t (*child_cleanup) (void *)) */ -APR_EXPORT(void) ap_register_cleanup(ap_pool_t *p, const void *data, - ap_status_t (*plain_cleanup) (void *), - ap_status_t (*child_cleanup) (void *)); +APR_EXPORT(void) apr_register_cleanup(apr_pool_t *p, const void *data, + apr_status_t (*plain_cleanup) (void *), + apr_status_t (*child_cleanup) (void *)); /** * remove a previously registered cleanup function * @param p The pool remove the cleanup from * @param data The data to remove from cleanup * @param cleanup The function to remove from cleanup - * @deffunc void ap_kill_cleanup(ap_pool_t *p, const void *data, ap_status_t (*cleanup) (void *)) + * @deffunc void apr_kill_cleanup(apr_pool_t *p, const void *data, apr_status_t (*cleanup) (void *)) */ -APR_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, const void *data, - ap_status_t (*cleanup) (void *)); +APR_EXPORT(void) apr_kill_cleanup(apr_pool_t *p, const void *data, + apr_status_t (*cleanup) (void *)); /** * Run the specified cleanup function immediately and unregister it * @param p The pool remove the cleanup from * @param data The data to remove from cleanup * @param cleanup The function to remove from cleanup - * @deffunc ap_status_t ap_run_cleanup(ap_pool_t *p, void *data, ap_status_t (*cleanup) (void *)) + * @deffunc apr_status_t apr_run_cleanup(apr_pool_t *p, void *data, apr_status_t (*cleanup) (void *)) */ -APR_EXPORT(ap_status_t) ap_run_cleanup(ap_pool_t *p, void *data, - ap_status_t (*cleanup) (void *)); +APR_EXPORT(apr_status_t) apr_run_cleanup(apr_pool_t *p, void *data, + apr_status_t (*cleanup) (void *)); /* Preparing for exec() --- close files, etc., but *don't* flush I/O * buffers, *don't* wait for subprocesses, and *don't* free any memory. @@ -291,19 +291,19 @@ APR_EXPORT(ap_status_t) ap_run_cleanup(ap_pool_t *p, void *data, /** * Run all of the child_cleanups, so that any unnecessary files are * closed because we are about to exec a new program - * @deffunc void ap_cleanup_for_exec(void) + * @deffunc void apr_cleanup_for_exec(void) */ -APR_EXPORT(void) ap_cleanup_for_exec(void); +APR_EXPORT(void) apr_cleanup_for_exec(void); /** * An empty cleanup function * @param data The data to cleanup - * @deffunc ap_status_t ap_null_cleanup(void *data) + * @deffunc apr_status_t apr_null_cleanup(void *data) */ -APR_EXPORT_NONSTD(ap_status_t) ap_null_cleanup(void *data); +APR_EXPORT_NONSTD(apr_status_t) apr_null_cleanup(void *data); -/* used to guarantee to the ap_pool_t debugging code that the sub ap_pool_t will not be +/* used to guarantee to the apr_pool_t debugging code that the sub apr_pool_t will not be * destroyed before the parent pool */ #ifndef POOL_DEBUG diff --git a/include/apr_portable.h b/include/apr_portable.h index 4401d5b23..16be3b8f1 100644 --- a/include/apr_portable.h +++ b/include/apr_portable.h @@ -91,33 +91,33 @@ extern "C" { #ifdef WIN32 /* The primitives for Windows types */ -typedef HANDLE ap_os_file_t; -typedef HANDLE ap_os_dir_t; -typedef SOCKET ap_os_sock_t; -typedef HANDLE ap_os_lock_t; -typedef HANDLE ap_os_thread_t; -typedef PROCESS_INFORMATION ap_os_proc_t; -typedef DWORD ap_os_threadkey_t; -typedef FILETIME ap_os_imp_time_t; -typedef SYSTEMTIME ap_os_exp_time_t; +typedef HANDLE apr_os_file_t; +typedef HANDLE apr_os_dir_t; +typedef SOCKET apr_os_sock_t; +typedef HANDLE apr_os_lock_t; +typedef HANDLE apr_os_thread_t; +typedef PROCESS_INFORMATION apr_os_proc_t; +typedef DWORD apr_os_threadkey_t; +typedef FILETIME apr_os_imp_time_t; +typedef SYSTEMTIME apr_os_exp_time_t; #elif defined(OS2) #define INCL_DOS #include <os2.h> -typedef HFILE ap_os_file_t; -typedef HDIR ap_os_dir_t; -typedef int ap_os_sock_t; -typedef HMTX ap_os_lock_t; -typedef TID ap_os_thread_t; -typedef PID ap_os_proc_t; -typedef PULONG ap_os_threadkey_t; -typedef struct timeval ap_os_imp_time_t; -typedef struct tm ap_os_exp_time_t; +typedef HFILE apr_os_file_t; +typedef HDIR apr_os_dir_t; +typedef int apr_os_sock_t; +typedef HMTX apr_os_lock_t; +typedef TID apr_os_thread_t; +typedef PID apr_os_proc_t; +typedef PULONG apr_os_threadkey_t; +typedef struct timeval apr_os_imp_time_t; +typedef struct tm apr_os_exp_time_t; #elif defined(BEOS) #include <kernel/OS.h> -struct ap_os_lock_t { +struct apr_os_lock_t { /* Inter proc */ sem_id sem_interproc; int32 ben_interproc; @@ -126,15 +126,15 @@ struct ap_os_lock_t { int32 ben_intraproc; }; -typedef int ap_os_file_t; -typedef DIR ap_os_dir_t; -typedef int ap_os_sock_t; -typedef struct ap_os_lock_t ap_os_lock_t; -typedef thread_id ap_os_thread_t; -typedef thread_id ap_os_proc_t; -typedef int ap_os_threadkey_t; -typedef struct timeval ap_os_imp_time_t; -typedef struct tm ap_os_exp_time_t; +typedef int apr_os_file_t; +typedef DIR apr_os_dir_t; +typedef int apr_os_sock_t; +typedef struct apr_os_lock_t apr_os_lock_t; +typedef thread_id apr_os_thread_t; +typedef thread_id apr_os_proc_t; +typedef int apr_os_threadkey_t; +typedef struct timeval apr_os_imp_time_t; +typedef struct tm apr_os_exp_time_t; #else /* Any other OS should go above this one. This is the lowest common @@ -150,7 +150,7 @@ union semun { }; #endif -struct ap_os_lock_t { +struct apr_os_lock_t { #if APR_USE_SYSVSEM_SERIALIZE int crossproc; #elif APR_USE_FCNTL_SERIALIZE @@ -170,17 +170,17 @@ struct ap_os_lock_t { #endif }; -typedef int ap_os_file_t; -typedef DIR ap_os_dir_t; -typedef int ap_os_sock_t; -typedef struct ap_os_lock_t ap_os_lock_t; +typedef int apr_os_file_t; +typedef DIR apr_os_dir_t; +typedef int apr_os_sock_t; +typedef struct apr_os_lock_t apr_os_lock_t; #if APR_HAS_THREADS && APR_HAVE_PTHREAD_H -typedef pthread_t ap_os_thread_t; -typedef pthread_key_t ap_os_threadkey_t; +typedef pthread_t apr_os_thread_t; +typedef pthread_key_t apr_os_threadkey_t; #endif -typedef pid_t ap_os_proc_t; -typedef struct timeval ap_os_imp_time_t; -typedef struct tm ap_os_exp_time_t; +typedef pid_t apr_os_proc_t; +typedef struct timeval apr_os_imp_time_t; +typedef struct tm apr_os_exp_time_t; #endif /** @@ -190,42 +190,42 @@ typedef struct tm ap_os_exp_time_t; * @tip On Unix, it is only possible to get a file descriptor from * an apr file type. */ -ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file); +apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file); /** * convert the dir from apr type to os specific type. * @param thedir The os specific dir we are converting to * @param dir The apr dir to convert. */ -ap_status_t ap_get_os_dir(ap_os_dir_t **thedir, ap_dir_t *dir); +apr_status_t apr_get_os_dir(apr_os_dir_t **thedir, apr_dir_t *dir); /** * Convert the socket from an apr type to an OS specific socket * @param thesock The socket to convert. * @param sock The os specifc equivelant of the apr socket.. */ -ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock); +apr_status_t apr_get_os_sock(apr_os_sock_t *thesock, apr_socket_t *sock); /** * Convert the lock from os specific type to apr type * @param oslock The os specific lock we are converting to. * @param lock The apr lock to convert. */ -ap_status_t ap_get_os_lock(ap_os_lock_t *oslock, ap_lock_t *lock); +apr_status_t apr_get_os_lock(apr_os_lock_t *oslock, apr_lock_t *lock); /** * Get the exploded time in the platforms native format. * @param ostime the native time format * @param aprtime the time to convert */ -ap_status_t ap_get_os_exp_time(ap_os_exp_time_t **ostime, ap_exploded_time_t *aprtime); +apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime, ap_exploded_time_t *aprtime); /** * Get the imploded time in the platforms native format. * @param ostime the native time format * @param aprtimethe time to convert */ -ap_status_t ap_get_os_imp_time(ap_os_imp_time_t **ostime, ap_time_t *aprtime); +apr_status_t apr_get_os_imp_time(apr_os_imp_time_t **ostime, apr_time_t *aprtime); #if APR_HAS_THREADS /** @@ -233,14 +233,14 @@ ap_status_t ap_get_os_imp_time(ap_os_imp_time_t **ostime, ap_time_t *aprtime); * @param thethd The apr thread to convert * @param thd The os specific thread we are converting to */ -ap_status_t ap_get_os_thread(ap_os_thread_t **thethd, ap_thread_t *thd); +apr_status_t apr_get_os_thread(apr_os_thread_t **thethd, apr_thread_t *thd); /** * convert the thread private memory key to os specific type from an apr type. * @param thekey The apr handle we are converting from. * @param key The os specific handle we are converting to. */ -ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *thekey, ap_threadkey_t *key); +apr_status_t apr_get_os_threadkey(apr_os_threadkey_t *thekey, apr_threadkey_t *key); #endif /** @@ -251,8 +251,8 @@ ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *thekey, ap_threadkey_t *key); * @tip On Unix, it is only possible to put a file descriptor into * an apr file type. */ -ap_status_t ap_put_os_file(ap_file_t **file, ap_os_file_t *thefile, - ap_pool_t *cont); +apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, + apr_pool_t *cont); /** * convert the dir from os specific type to apr type. @@ -260,8 +260,8 @@ ap_status_t ap_put_os_file(ap_file_t **file, ap_os_file_t *thefile, * @param thedir The os specific dir to convert * @param cont The pool to use when creating to apr directory. */ -ap_status_t ap_put_os_dir(ap_dir_t **dir, ap_os_dir_t *thedir, - ap_pool_t *cont); +apr_status_t apr_put_os_dir(apr_dir_t **dir, apr_os_dir_t *thedir, + apr_pool_t *cont); /** * Convert a socket from the os specific type to the apr type @@ -269,8 +269,8 @@ ap_status_t ap_put_os_dir(ap_dir_t **dir, ap_os_dir_t *thedir, * @param thesock The socket to convert to. * @param cont The socket we are converting to an apr type. */ -ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_sock_t *thesock, - ap_pool_t *cont); +apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, + apr_pool_t *cont); /** * Convert the lock from os specific type to apr type @@ -278,8 +278,8 @@ ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_sock_t *thesock, * @param thelock The os specific lock to convert. * @param cont The pool to use if it is needed. */ -ap_status_t ap_put_os_lock(ap_lock_t **lock, ap_os_lock_t *thelock, - ap_pool_t *cont); +apr_status_t apr_put_os_lock(apr_lock_t **lock, apr_os_lock_t *thelock, + apr_pool_t *cont); /** * Put the imploded time in the APR format. @@ -287,7 +287,7 @@ ap_status_t ap_put_os_lock(ap_lock_t **lock, ap_os_lock_t *thelock, * @param ostime the time to convert * @param cont the pool to use if necessary */ -ap_status_t ap_put_os_imp_time(ap_time_t *aprtime, ap_os_imp_time_t **ostime, ap_pool_t *cont); +apr_status_t apr_put_os_imp_time(apr_time_t *aprtime, apr_os_imp_time_t **ostime, apr_pool_t *cont); /** * Put the exploded time in the APR format. @@ -295,7 +295,7 @@ ap_status_t ap_put_os_imp_time(ap_time_t *aprtime, ap_os_imp_time_t **ostime, ap * @param ostime the time to convert * @param cont the pool to use if necessary */ -ap_status_t ap_put_os_exp_time(ap_exploded_time_t *aprtime, ap_os_exp_time_t **ostime, ap_pool_t *cont); +apr_status_t apr_put_os_exp_time(ap_exploded_time_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont); #if APR_HAS_THREADS /** @@ -304,8 +304,8 @@ ap_status_t ap_put_os_exp_time(ap_exploded_time_t *aprtime, ap_os_exp_time_t **o * @param thethd The os specific thread to convert * @param cont The pool to use if it is needed. */ -ap_status_t ap_put_os_thread(ap_thread_t **thd, ap_os_thread_t *thethd, - ap_pool_t *cont); +apr_status_t apr_put_os_thread(apr_thread_t **thd, apr_os_thread_t *thethd, + apr_pool_t *cont); /** * convert the thread private memory key from os specific type to apr type. @@ -313,8 +313,8 @@ ap_status_t ap_put_os_thread(ap_thread_t **thd, ap_os_thread_t *thethd, * @param thekey The os specific handle to convert * @param cont The pool to use if it is needed. */ -ap_status_t ap_put_os_threadkey(ap_threadkey_t **key, ap_os_threadkey_t *thekey, - ap_pool_t *cont); +apr_status_t apr_put_os_threadkey(apr_threadkey_t **key, apr_os_threadkey_t *thekey, + apr_pool_t *cont); #endif #ifdef __cplusplus diff --git a/include/apr_shmem.h b/include/apr_shmem.h index dd0559b10..1b0ef860c 100644 --- a/include/apr_shmem.h +++ b/include/apr_shmem.h @@ -68,14 +68,14 @@ extern "C" { #endif /* __cplusplus */ #if APR_USES_ANONYMOUS_SHM -typedef void ap_shm_name_t; +typedef void apr_shm_name_t; #elif APR_USES_FILEBASED_SHM -typedef char * ap_shm_name_t; +typedef char * apr_shm_name_t; #elif APR_USES_KEYBASED_SHM -typedef key_t ap_shm_name_t; +typedef key_t apr_shm_name_t; #endif -typedef struct shmem_t ap_shmem_t; +typedef struct shmem_t apr_shmem_t; /** * Create a pool of shared memory for use later. @@ -85,34 +85,34 @@ typedef struct shmem_t ap_shmem_t; * that require it. * @param cont The pool to use */ -ap_status_t ap_shm_init(ap_shmem_t **m, ap_size_t reqsize, const char *file, ap_pool_t *cont); +apr_status_t apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, const char *file, apr_pool_t *cont); /** * Destroy the shared memory block. * @param m The shared memory block to destroy. */ -ap_status_t ap_shm_destroy(ap_shmem_t *m); +apr_status_t apr_shm_destroy(apr_shmem_t *m); /** * allocate memory from the block of shared memory. * @param c The shared memory block to destroy. * @param reqsize How much memory to allocate */ -void *ap_shm_malloc(ap_shmem_t *c, ap_size_t reqsize); +void *apr_shm_malloc(apr_shmem_t *c, apr_size_t reqsize); /** * allocate memory from the block of shared memory and initialize it to zero. * @param shared The shared memory block to destroy. * @param size How much memory to allocate */ -void *ap_shm_calloc(ap_shmem_t *shared, ap_size_t size); +void *apr_shm_calloc(apr_shmem_t *shared, apr_size_t size); /** * free shared memory previously allocated. * @param shared The shared memory block to destroy. * @param entity The actual data to free. */ -ap_status_t ap_shm_free(ap_shmem_t *shared, void *entity); +apr_status_t apr_shm_free(apr_shmem_t *shared, void *entity); /** * Get the name of the shared memory segment if not using anonymous @@ -126,7 +126,7 @@ ap_status_t ap_shm_free(ap_shmem_t *shared, void *entity); * memory is based on a key value such as shmctl. If the * shared memory is anonymous, the name is NULL. */ -ap_status_t ap_get_shm_name(ap_shmem_t *c, ap_shm_name_t **name); +apr_status_t apr_get_shm_name(apr_shmem_t *c, apr_shm_name_t **name); /** * Set the name of the shared memory segment if not using anonymous @@ -139,20 +139,20 @@ ap_status_t ap_get_shm_name(ap_shmem_t *c, ap_shm_name_t **name); * memory. APR_SUCCESS if we are using named shared memory * and we were able to assign the name correctly. */ -ap_status_t ap_set_shm_name(ap_shmem_t *c, ap_shm_name_t *name); +apr_status_t apr_set_shm_name(apr_shmem_t *c, apr_shm_name_t *name); /** * Open the shared memory block in a child process. * @param The shared memory block to open in the child. */ -ap_status_t ap_open_shmem(ap_shmem_t *c); +apr_status_t apr_open_shmem(apr_shmem_t *c); /** * Determine how much memory is available in the specified shared memory block * @param c The shared memory block to open in the child. * @param avail The amount of space available in the shared memory block. */ -ap_status_t ap_shm_avail(ap_shmem_t *c, ap_size_t *avail); +apr_status_t apr_shm_avail(apr_shmem_t *c, apr_size_t *avail); #ifdef __cplusplus } diff --git a/include/apr_strings.h b/include/apr_strings.h index 9e0c1c373..fa16c4295 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -98,7 +98,7 @@ extern "C" { * this returns <0, if they are equivalent it returns 0, and if the * first string is greater than second string it retuns >0. */ -int ap_strnatcmp(char const *a, char const *b); +int apr_strnatcmp(char const *a, char const *b); /** * Do a natural order comparison of two strings ignoring the case of the @@ -109,16 +109,16 @@ int ap_strnatcmp(char const *a, char const *b); * this returns <0, if they are equivalent it returns 0, and if the * first string is greater than second string it retuns >0. */ -int ap_strnatcasecmp(char const *a, char const *b); +int apr_strnatcasecmp(char const *a, char const *b); /** * duplicate a string into memory allocated out of a pool * @param p The pool to allocate out of * @param s The string to allocate * @return The new string - * @deffunc char *ap_pstrdup(ap_pool_t *p, const char *s) + * @deffunc char *apr_pstrdup(apr_pool_t *p, const char *s) */ -APR_EXPORT(char *) ap_pstrdup(ap_pool_t *p, const char *s); +APR_EXPORT(char *) apr_pstrdup(apr_pool_t *p, const char *s); /** * duplicate the first n characters ofa string into memory allocated @@ -127,18 +127,18 @@ APR_EXPORT(char *) ap_pstrdup(ap_pool_t *p, const char *s); * @param s The string to allocate * @param n The number of characters to duplicate * @return The new string - * @deffunc char *ap_pstrndup(ap_pool_t *p, const char *s, ap_size_t n) + * @deffunc char *apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n) */ -APR_EXPORT(char *) ap_pstrndup(ap_pool_t *p, const char *s, ap_size_t n); +APR_EXPORT(char *) apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n); /** * Concatenate multiple strings, allocating memory out a pool * @param p The pool to allocate out of * @param ... The strings to concatenate. The final string must be NULL * @return The new string - * @deffunc char *ap_pstrcat(ap_pool_t *p, ...) + * @deffunc char *apr_pstrcat(apr_pool_t *p, ...) */ -APR_EXPORT_NONSTD(char *) ap_pstrcat(ap_pool_t *p, ...); +APR_EXPORT_NONSTD(char *) apr_pstrcat(apr_pool_t *p, ...); /** * printf-style style printing routine. The data is output to a string @@ -147,9 +147,9 @@ APR_EXPORT_NONSTD(char *) ap_pstrcat(ap_pool_t *p, ...); * @param fmt The format of the string * @param ap The arguments to use while printing the data * @return The new string - * @deffunc char *ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) + * @deffunc char *apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap) */ -APR_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap); +APR_EXPORT(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap); /** * printf-style style printing routine. The data is output to a string @@ -158,9 +158,9 @@ APR_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap); * @param fmt The format of the string * @param ... The arguments to use while printing the data * @return The new string - * @deffunc char *ap_psprintf(ap_pool_t *p, const char *fmt, ...) + * @deffunc char *apr_psprintf(apr_pool_t *p, const char *fmt, ...) */ -APR_EXPORT_NONSTD(char *) ap_psprintf(ap_pool_t *p, const char *fmt, ...); +APR_EXPORT_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...); /** * copy n characters from src to des> @@ -177,18 +177,18 @@ APR_EXPORT_NONSTD(char *) ap_psprintf(ap_pool_t *p, const char *fmt, ...); * destination string, we return a pointer to the terminating '\0' * to allow us to check for truncation. * </PRE> - * @deffunc char *ap_cpystrn(char *dst, const char *src, size_t dst_size) + * @deffunc char *apr_cpystrn(char *dst, const char *src, size_t dst_size) */ -APR_EXPORT(char *) ap_cpystrn(char *dst, const char *src, size_t dst_size); +APR_EXPORT(char *) apr_cpystrn(char *dst, const char *src, size_t dst_size); /** * Strip spaces from a string * @param dest The destination string. It is okay to modify the string * in place. Namely dest == src * @param src The string to rid the spaces from. - * @deffunc char *ap_collapse_spaces(char *dest, const char *src) + * @deffunc char *apr_collapse_spaces(char *dest, const char *src) */ -APR_EXPORT(char *) ap_collapse_spaces(char *dest, const char *src); +APR_EXPORT(char *) apr_collapse_spaces(char *dest, const char *src); /** * Convert the arguments to a program from one string to an array of @@ -196,11 +196,11 @@ APR_EXPORT(char *) ap_collapse_spaces(char *dest, const char *src); * @param str The arguments to convert * @param argv_out Output location. This is a pointer to an array of strings. * @param token_context Pool to use. - * @deffunc ap_status_t ap_tokenize_to_argv(const char *arg_str, char ***argv_out, ap_pool_t *token_context); + * @deffunc apr_status_t apr_tokenize_to_argv(const char *arg_str, char ***argv_out, apr_pool_t *token_context); */ -APR_EXPORT(ap_status_t) ap_tokenize_to_argv(const char *arg_str, +APR_EXPORT(apr_status_t) apr_tokenize_to_argv(const char *arg_str, char ***argv_out, - ap_pool_t *token_context); + apr_pool_t *token_context); #ifdef __cplusplus } diff --git a/include/apr_tables.h b/include/apr_tables.h index 76079f935..837f4bcad 100644 --- a/include/apr_tables.h +++ b/include/apr_tables.h @@ -79,110 +79,110 @@ extern "C" { * and tables are opaque structures to applications, but arrays are * published. */ -typedef struct ap_table_t ap_table_t; -typedef struct ap_array_header_t { - ap_pool_t *cont; +typedef struct apr_table_t apr_table_t; +typedef struct apr_array_header_t { + apr_pool_t *cont; int elt_size; int nelts; int nalloc; char *elts; -} ap_array_header_t; +} apr_array_header_t; -struct ap_table_t { +struct apr_table_t { /* This has to be first to promote backwards compatibility with - * older modules which cast a ap_table_t * to an ap_array_header_t *... + * older modules which cast a apr_table_t * to an apr_array_header_t *... * they should use the table_elts() function for most of the * cases they do this for. */ - ap_array_header_t a; + apr_array_header_t a; #ifdef MAKE_TABLE_PROFILE void *creator; #endif }; -typedef struct ap_table_entry_t { +typedef struct apr_table_entry_t { char *key; /* maybe NULL in future; * check when iterating thru table_elts */ char *val; -} ap_table_entry_t; +} apr_table_entry_t; -/* XXX: these know about the definition of struct ap_table_t in alloc.c. That +/* XXX: these know about the definition of struct apr_table_t in alloc.c. That * definition is not here because it is supposed to be private, and by not * placing it here we are able to get compile-time diagnostics from modules - * written which assume that a ap_table_t is the same as an ap_array_header_t. -djg + * written which assume that a apr_table_t is the same as an apr_array_header_t. -djg */ -#define ap_table_elts(t) ((ap_array_header_t *)(t)) -#define ap_is_empty_table(t) (((t) == NULL)||(((ap_array_header_t *)(t))->nelts == 0)) +#define ap_table_elts(t) ((apr_array_header_t *)(t)) +#define ap_is_empty_table(t) (((t) == NULL)||(((apr_array_header_t *)(t))->nelts == 0)) -APR_EXPORT(ap_array_header_t *) ap_make_array(struct ap_pool_t *p, int nelts, +APR_EXPORT(apr_array_header_t *) apr_make_array(struct apr_pool_t *p, int nelts, int elt_size); -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); +APR_EXPORT(void *) apr_push_array(apr_array_header_t *arr); +APR_EXPORT(void) apr_array_cat(apr_array_header_t *dst, + const apr_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 *) - ap_copy_array_hdr(struct ap_pool_t *p, - const ap_array_header_t *arr); -APR_EXPORT(ap_array_header_t *) - 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 +APR_EXPORT(apr_array_header_t *) apr_copy_array(struct apr_pool_t *p, + const apr_array_header_t *arr); +APR_EXPORT(apr_array_header_t *) + apr_copy_array_hdr(struct apr_pool_t *p, + const apr_array_header_t *arr); +APR_EXPORT(apr_array_header_t *) + apr_append_arrays(struct apr_pool_t *p, + const apr_array_header_t *first, + const apr_array_header_t *second); + +/* apr_array_pstrcat generates a new string from the apr_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, +APR_EXPORT(char *) apr_array_pstrcat(struct apr_pool_t *p, + const apr_array_header_t *arr, const char sep); -APR_EXPORT(ap_table_t *) ap_make_table(struct ap_pool_t *p, int nelts); -APR_EXPORT(ap_table_t *) ap_copy_table(struct ap_pool_t *p, const ap_table_t *t); -APR_EXPORT(void) ap_clear_table(ap_table_t *t); -APR_EXPORT(const char *) ap_table_get(const ap_table_t *t, const char *key); -APR_EXPORT(void) ap_table_set(ap_table_t *t, const char *key, +APR_EXPORT(apr_table_t *) apr_make_table(struct apr_pool_t *p, int nelts); +APR_EXPORT(apr_table_t *) apr_copy_table(struct apr_pool_t *p, const apr_table_t *t); +APR_EXPORT(void) apr_clear_table(apr_table_t *t); +APR_EXPORT(const char *) apr_table_get(const apr_table_t *t, const char *key); +APR_EXPORT(void) apr_table_set(apr_table_t *t, const char *key, const char *val); -APR_EXPORT(void) ap_table_setn(ap_table_t *t, const char *key, +APR_EXPORT(void) apr_table_setn(apr_table_t *t, const char *key, const char *val); -APR_EXPORT(void) ap_table_unset(ap_table_t *t, const char *key); -APR_EXPORT(void) ap_table_merge(ap_table_t *t, const char *key, +APR_EXPORT(void) apr_table_unset(apr_table_t *t, const char *key); +APR_EXPORT(void) apr_table_merge(apr_table_t *t, const char *key, const char *val); -APR_EXPORT(void) ap_table_mergen(ap_table_t *t, const char *key, +APR_EXPORT(void) apr_table_mergen(apr_table_t *t, const char *key, const char *val); -APR_EXPORT(void) ap_table_add(ap_table_t *t, const char *key, +APR_EXPORT(void) apr_table_add(apr_table_t *t, const char *key, const char *val); -APR_EXPORT(void) ap_table_addn(ap_table_t *t, const char *key, +APR_EXPORT(void) apr_table_addn(apr_table_t *t, const char *key, const char *val); -APR_EXPORT(ap_table_t *) ap_overlay_tables(struct ap_pool_t *p, - const ap_table_t *overlay, - const ap_table_t *base); +APR_EXPORT(apr_table_t *) apr_overlay_tables(struct apr_pool_t *p, + const apr_table_t *overlay, + const apr_table_t *base); APR_EXPORT(void) - ap_table_do(int (*comp) (void *, const char *, const char *), - void *rec, const ap_table_t *t, ...); + apr_table_do(int (*comp) (void *, const char *, const char *), + void *rec, const apr_table_t *t, ...); APR_EXPORT(void) - ap_table_vdo(int (*comp) (void *, const char *, const char *), - void *rec, const ap_table_t *t, va_list); + apr_table_vdo(int (*comp) (void *, const char *, const char *), + void *rec, const apr_table_t *t, va_list); -/* Conceptually, ap_overlap_tables does this: +/* Conceptually, apr_overlap_tables does this: - ap_array_header_t *barr = ap_table_elts(b); - ap_table_entry_t *belt = (ap_table_entry_t *)barr->elts; + apr_array_header_t *barr = ap_table_elts(b); + apr_table_entry_t *belt = (apr_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); + apr_table_mergen(a, belt[i].key, belt[i].val); } else { - ap_table_setn(a, belt[i].key, belt[i].val); + apr_table_setn(a, belt[i].key, belt[i].val); } } @@ -195,7 +195,7 @@ APR_EXPORT(void) */ #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, +APR_EXPORT(void) apr_overlap_tables(apr_table_t *a, const apr_table_t *b, unsigned flags); #ifdef __cplusplus diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index b04664c22..d9d94d773 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -71,8 +71,8 @@ extern "C" { * @package APR Thread library */ -typedef enum {APR_SHELLCMD, APR_PROGRAM} ap_cmdtype_e; -typedef enum {APR_WAIT, APR_NOWAIT} ap_wait_how_e; +typedef enum {APR_SHELLCMD, APR_PROGRAM} apr_cmdtype_e; +typedef enum {APR_WAIT, APR_NOWAIT} apr_wait_how_e; #define APR_NO_PIPE 0 #define APR_FULL_BLOCK 1 @@ -99,23 +99,23 @@ typedef enum {APR_WAIT, APR_NOWAIT} ap_wait_how_e; * us knowing ... buggy os? */ #endif /* APR_HAS_OTHER_CHILD */ -typedef struct ap_proc_t { +typedef struct apr_proc_t { pid_t pid; - ap_file_t *in; /* Parent's side of pipe to child's stdin */ - ap_file_t *out; /* Parent's side of pipe to child's stdout */ - ap_file_t *err; /* Parent's side of pipe to child's stdouterr */ -} ap_proc_t; + apr_file_t *in; /* Parent's side of pipe to child's stdin */ + apr_file_t *out; /* Parent's side of pipe to child's stdout */ + apr_file_t *err; /* Parent's side of pipe to child's stdouterr */ +} apr_proc_t; -typedef struct ap_thread_t ap_thread_t; -typedef struct ap_threadattr_t ap_threadattr_t; -typedef struct ap_procattr_t ap_procattr_t; +typedef struct apr_thread_t apr_thread_t; +typedef struct apr_threadattr_t apr_threadattr_t; +typedef struct apr_procattr_t apr_procattr_t; -typedef struct ap_threadkey_t ap_threadkey_t; +typedef struct apr_threadkey_t apr_threadkey_t; #if APR_HAS_OTHER_CHILD -typedef struct ap_other_child_rec_t ap_other_child_rec_t; +typedef struct apr_other_child_rec_t apr_other_child_rec_t; #endif /* APR_HAS_OTHER_CHILD */ -typedef void *(APR_THREAD_FUNC *ap_thread_start_t)(void *); +typedef void *(APR_THREAD_FUNC *apr_thread_start_t)(void *); /* Thread Function definitions */ @@ -124,20 +124,20 @@ typedef void *(APR_THREAD_FUNC *ap_thread_start_t)(void *); * @param new_attr The newly created threadattr. * @param cont The pool to use */ -ap_status_t ap_create_threadattr(ap_threadattr_t **new_attr, ap_pool_t *cont); +apr_status_t apr_create_threadattr(apr_threadattr_t **new_attr, apr_pool_t *cont); /** * Set if newly created threads should be created in detach mode. * @param attr The threadattr to affect * @param on Thread detach state on or off */ -ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on); +apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on); /** * Get the detach mode for this threadattr. * @param attr The threadattr to reference */ -ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr); +apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr); /** * Create a new thread of execution @@ -147,29 +147,29 @@ ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr); * @param data Any data to be passed to the starting function * @param cont The pool to use */ -ap_status_t ap_create_thread(ap_thread_t **new_thread, ap_threadattr_t *attr, - ap_thread_start_t func, void *data, - ap_pool_t *cont); +apr_status_t apr_create_thread(apr_thread_t **new_thread, apr_threadattr_t *attr, + apr_thread_start_t func, void *data, + apr_pool_t *cont); /** * stop the current thread * @param thd The thread to stop * @param retval The return value to pass back to any thread that cares */ -ap_status_t ap_thread_exit(ap_thread_t *thd, ap_status_t *retval); +apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval); /** * block until the desired thread stops executing. * @param retval The return value from the dead thread. * @param thd The thread to join */ -ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd); +apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd); /** * detach a thread * @param thd The thread to detach */ -ap_status_t ap_thread_detach(ap_thread_t *thd); +apr_status_t apr_thread_detach(apr_thread_t *thd); /** * Return the pool associated with the current thread. @@ -177,7 +177,7 @@ ap_status_t ap_thread_detach(ap_thread_t *thd); * @param key The key to associate with the data * @param thread The currently open thread. */ -ap_status_t ap_get_threaddata(void **data, const char *key, ap_thread_t *thread); +apr_status_t apr_get_threaddata(void **data, const char *key, apr_thread_t *thread); /** * Return the pool associated with the current thread. @@ -186,9 +186,9 @@ ap_status_t ap_get_threaddata(void **data, const char *key, ap_thread_t *thread) * @param cleanup The cleanup routine to use when the thread is destroyed. * @param thread The currently open thread. */ -ap_status_t ap_set_threaddata(void *data, const char *key, - ap_status_t (*cleanup) (void *), - ap_thread_t *thread); +apr_status_t apr_set_threaddata(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_thread_t *thread); /** * Create and initialize a new thread private address space @@ -196,28 +196,28 @@ ap_status_t ap_set_threaddata(void *data, const char *key, * @param dest The destructor to use when freeing the private memory. * @param cont The pool to use */ -ap_status_t ap_create_thread_private(ap_threadkey_t **key, void (*dest)(void *), - ap_pool_t *cont); +apr_status_t apr_create_thread_private(apr_threadkey_t **key, void (*dest)(void *), + apr_pool_t *cont); /** * Get a pointer to the thread private memory * @param new_mem The data stored in private memory * @param key The handle for the desired thread private memory */ -ap_status_t ap_get_thread_private(void **new_mem, ap_threadkey_t *key); +apr_status_t apr_get_thread_private(void **new_mem, apr_threadkey_t *key); /** * Set the data to be stored in thread private memory * @param priv The data to be stored in private memory * @param key The handle for the desired thread private memory */ -ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key); +apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key); /** * Free the thread private memory * @param key The handle for the desired thread private memory */ -ap_status_t ap_delete_thread_private(ap_threadkey_t *key); +apr_status_t apr_delete_thread_private(apr_threadkey_t *key); /** * Return the pool associated with the current threadkey. @@ -225,7 +225,7 @@ ap_status_t ap_delete_thread_private(ap_threadkey_t *key); * @param key The key associated with the data * @param threadkey The currently open threadkey. */ -ap_status_t ap_get_threadkeydata(void **data, const char *key, ap_threadkey_t *threadkey); +apr_status_t apr_get_threadkeydata(void **data, const char *key, apr_threadkey_t *threadkey); /** * Return the pool associated with the current threadkey. @@ -234,9 +234,9 @@ ap_status_t ap_get_threadkeydata(void **data, const char *key, ap_threadkey_t *t * @param cleanup The cleanup routine to use when the file is destroyed. * @param threadkey The currently open threadkey. */ -ap_status_t ap_set_threadkeydata(void *data, const char *key, - ap_status_t (*cleanup) (void *), - ap_threadkey_t *threadkey); +apr_status_t apr_set_threadkeydata(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_threadkey_t *threadkey); /* Process Function definitions */ @@ -249,7 +249,7 @@ ap_status_t ap_set_threadkeydata(void *data, const char *key, * @param new_attr The newly created procattr. * @param cont The pool to use */ -ap_status_t ap_createprocattr_init(ap_procattr_t **new_attr, ap_pool_t *cont); +apr_status_t apr_createprocattr_init(apr_procattr_t **new_attr, apr_pool_t *cont); /** * Determine if any of stdin, stdout, or stderr should be linked to pipes @@ -259,14 +259,14 @@ ap_status_t ap_createprocattr_init(ap_procattr_t **new_attr, ap_pool_t *cont); * @param out Should stdout be a pipe back to the parent? * @param err Should stderr be a pipe back to the parent? */ -ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, - ap_int32_t out, ap_int32_t err); +apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, + apr_int32_t out, apr_int32_t err); /** - * Set the child_in and/or parent_in values to existing ap_file_t values. + * Set the child_in and/or parent_in values to existing apr_file_t values. * @param attr The procattr we care about. - * @param child_in ap_file_t value to use as child_in. Must be a valid file. - * @param parent_in ap_file_t value to use as parent_in. Must be a valid file. + * @param child_in apr_file_t value to use as child_in. Must be a valid file. + * @param parent_in apr_file_t value to use as parent_in. Must be a valid file. * @tip This is NOT a required initializer function. This is * useful if you have already opened a pipe (or multiple files) * that you wish to use, perhaps persistently across mutiple @@ -274,36 +274,36 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, * extra function calls by not creating your own pipe since this * creates one in the process space for you. */ -ap_status_t ap_setprocattr_childin(struct ap_procattr_t *attr, ap_file_t *child_in, - ap_file_t *parent_in); +apr_status_t apr_setprocattr_childin(struct apr_procattr_t *attr, apr_file_t *child_in, + apr_file_t *parent_in); /** - * Set the child_out and parent_out values to existing ap_file_t values. + * Set the child_out and parent_out values to existing apr_file_t values. * @param attr The procattr we care about. - * @param child_out ap_file_t value to use as child_out. Must be a valid file. - * @param parent_out ap_file_t value to use as parent_out. Must be a valid file. + * @param child_out apr_file_t value to use as child_out. Must be a valid file. + * @param parent_out apr_file_t value to use as parent_out. Must be a valid file. * @tip This is NOT a required initializer function. This is * useful if you have already opened a pipe (or multiple files) * that you wish to use, perhaps persistently across mutiple * process invocations - such as a log file. */ -ap_status_t ap_setprocattr_childout(struct ap_procattr_t *attr, - ap_file_t *child_out, - ap_file_t *parent_out); +apr_status_t apr_setprocattr_childout(struct apr_procattr_t *attr, + apr_file_t *child_out, + apr_file_t *parent_out); /** - * Set the child_err and parent_err values to existing ap_file_t values. + * Set the child_err and parent_err values to existing apr_file_t values. * @param attr The procattr we care about. - * @param child_err ap_file_t value to use as child_err. Must be a valid file. - * @param parent_err ap_file_t value to use as parent_err. Must be a valid file. + * @param child_err apr_file_t value to use as child_err. Must be a valid file. + * @param parent_err apr_file_t value to use as parent_err. Must be a valid file. * @tip This is NOT a required initializer function. This is * useful if you have already opened a pipe (or multiple files) * that you wish to use, perhaps persistently across mutiple * process invocations - such as a log file. */ -ap_status_t ap_setprocattr_childerr(struct ap_procattr_t *attr, - ap_file_t *child_err, - ap_file_t *parent_err); +apr_status_t apr_setprocattr_childerr(struct apr_procattr_t *attr, + apr_file_t *child_err, + apr_file_t *parent_err); /** * Set which directory the child process should start executing in. @@ -312,7 +312,7 @@ ap_status_t ap_setprocattr_childerr(struct ap_procattr_t *attr, * the parent currently resides in, when the createprocess call * is made. */ -ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, const char *dir); +apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, const char *dir); /** * Set what type of command the child process will call. @@ -323,14 +323,14 @@ ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, const char *dir); * APR_PROGRAM -- Executable program (default) * </PRE> */ -ap_status_t ap_setprocattr_cmdtype(ap_procattr_t *attr, ap_cmdtype_e cmd); +apr_status_t apr_setprocattr_cmdtype(apr_procattr_t *attr, apr_cmdtype_e cmd); /** * Determine if the chlid should start in detached state. * @param attr The procattr we care about. * @param detach Should the child start in detached state? Default is no. */ -ap_status_t ap_setprocattr_detach(ap_procattr_t *attr, ap_int32_t detach); +apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t detach); #if APR_HAVE_STRUCT_RLIMIT /** @@ -344,7 +344,7 @@ ap_status_t ap_setprocattr_detach(ap_procattr_t *attr, ap_int32_t detach); * </PRE> * @param limit Value to set the limit to. */ -ap_status_t ap_setprocattr_limit(ap_procattr_t *attr, ap_int32_t what, +apr_status_t apr_setprocattr_limit(apr_procattr_t *attr, apr_int32_t what, struct rlimit *limit); #endif @@ -355,7 +355,7 @@ ap_status_t ap_setprocattr_limit(ap_procattr_t *attr, ap_int32_t what, * @param proc The resulting process handle. * @param cont The pool to use. */ -ap_status_t ap_fork(ap_proc_t *proc, ap_pool_t *cont); +apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont); #endif /** @@ -364,15 +364,15 @@ ap_status_t ap_fork(ap_proc_t *proc, ap_pool_t *cont); * @param progname The program to run * @param const_args the arguments to pass to the new program. The first * one should be the program name. - * @param env The new environment ap_table_t for the new process. This + * @param env The new environment apr_table_t for the new process. This * should be a list of NULL-terminated strings. * @param attr the procattr we should use to determine how to create the new * process * @param cont The pool to use. */ -ap_status_t ap_create_process(ap_proc_t *new_proc, const char *progname, +apr_status_t apr_create_process(apr_proc_t *new_proc, const char *progname, char *const args[], char **env, - ap_procattr_t *attr, ap_pool_t *cont); + apr_procattr_t *attr, apr_pool_t *cont); /** * Wait for a child process to die @@ -389,7 +389,7 @@ ap_status_t ap_create_process(ap_proc_t *new_proc, const char *progname, * APR_CHILD_NOTDONE -- child is still running. * </PRE> */ -ap_status_t ap_wait_proc(ap_proc_t *proc, ap_wait_how_e waithow); +apr_status_t apr_wait_proc(apr_proc_t *proc, apr_wait_how_e waithow); /** @@ -409,13 +409,13 @@ ap_status_t ap_wait_proc(ap_proc_t *proc, ap_wait_how_e waithow); * @param p Pool to allocate child information out of. */ -ap_status_t ap_wait_all_procs(ap_proc_t *proc, ap_wait_t *status, - ap_wait_how_e waithow, ap_pool_t *p); +apr_status_t apr_wait_all_procs(apr_proc_t *proc, ap_wait_t *status, + apr_wait_how_e waithow, apr_pool_t *p); /** * Detach the process from the controlling terminal. */ -ap_status_t ap_detach(void); +apr_status_t apr_detach(void); #if APR_HAS_OTHER_CHILD /** @@ -430,9 +430,9 @@ ap_status_t ap_detach(void); * OC_REASON_UNWRITABLE. * @param p The pool to use for allocating memory. */ -void ap_register_other_child(ap_proc_t *pid, +void apr_register_other_child(apr_proc_t *pid, void (*maintenance) (int reason, void *, int status), - void *data, ap_file_t *write_fd, ap_pool_t *p); + void *data, apr_file_t *write_fd, apr_pool_t *p); /** * Stop watching the specified process. @@ -443,7 +443,7 @@ void ap_register_other_child(ap_proc_t *pid, * themself by loading ocr->next before calling any maintenance * function. */ -void ap_unregister_other_child(void *data); +void apr_unregister_other_child(void *data); /** * Check on the specified process. If it is gone, call the maintenance @@ -451,19 +451,19 @@ void ap_unregister_other_child(void *data); * @param pid The process to check. * @param status The status to pass to the maintenance function. */ -ap_status_t ap_reap_other_child(ap_proc_t *pid, int status); +apr_status_t apr_reap_other_child(apr_proc_t *pid, int status); /** * Loop through all registered other_children and call the appropriate * maintenance function when necessary. */ -void ap_check_other_child(void); +void apr_check_other_child(void); /** * Ensure all the registered write_fds are still writable, otherwise * invoke the maintenance functions as appropriate. */ -void ap_probe_writable_fds(void); +void apr_probe_writable_fds(void); #endif /* APR_HAS_OTHER_CHILD */ /** @@ -471,7 +471,7 @@ void ap_probe_writable_fds(void); * @param proc The process to terminate. * @param sig How to kill the process. */ -ap_status_t ap_kill(ap_proc_t *proc, int sig); +apr_status_t apr_kill(apr_proc_t *proc, int sig); #ifdef __cplusplus } #endif diff --git a/include/apr_time.h b/include/apr_time.h index d4adbe509..aea367c74 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -70,10 +70,10 @@ APR_VAR_IMPORT const char ap_month_snames[12][4]; APR_VAR_IMPORT const char ap_day_snames[7][4]; /* number of microseconds since 00:00:00 january 1, 1970 UTC */ -typedef ap_int64_t ap_time_t; +typedef apr_int64_t apr_time_t; /* intervals for I/O timeouts, in microseconds */ -typedef ap_int32_t ap_interval_time_t; +typedef apr_int32_t apr_interval_time_t; #ifdef WIN32 #define AP_USEC_PER_SEC ((LONGLONG) 1000000) @@ -90,46 +90,46 @@ typedef ap_int32_t ap_interval_time_t; /** * return the current time */ -ap_time_t ap_now(void); +apr_time_t apr_now(void); /* a structure similar to ANSI struct tm with the following differences: - tm_usec isn't an ANSI field - tm_gmtoff isn't an ANSI field (it's a bsdism) */ typedef struct { - ap_int32_t tm_usec; /* microseconds past tm_sec */ - ap_int32_t tm_sec; /* (0-61) seconds past tm_min */ - ap_int32_t tm_min; /* (0-59) minutes past tm_hour */ - ap_int32_t tm_hour; /* (0-23) hours past midnight */ - ap_int32_t tm_mday; /* (1-31) day of the month */ - ap_int32_t tm_mon; /* (0-11) month of the year */ - ap_int32_t tm_year; /* year since 1900 */ - ap_int32_t tm_wday; /* (0-6) days since sunday */ - ap_int32_t tm_yday; /* (0-365) days since jan 1 */ - ap_int32_t tm_isdst; /* daylight saving time */ - ap_int32_t tm_gmtoff; /* seconds east of UTC */ + apr_int32_t tm_usec; /* microseconds past tm_sec */ + apr_int32_t tm_sec; /* (0-61) seconds past tm_min */ + apr_int32_t tm_min; /* (0-59) minutes past tm_hour */ + apr_int32_t tm_hour; /* (0-23) hours past midnight */ + apr_int32_t tm_mday; /* (1-31) day of the month */ + apr_int32_t tm_mon; /* (0-11) month of the year */ + apr_int32_t tm_year; /* year since 1900 */ + apr_int32_t tm_wday; /* (0-6) days since sunday */ + apr_int32_t tm_yday; /* (0-365) days since jan 1 */ + apr_int32_t tm_isdst; /* daylight saving time */ + apr_int32_t tm_gmtoff; /* seconds east of UTC */ } ap_exploded_time_t; /** - * convert an ansi time_t to an ap_time_t - * @param result the resulting ap_time_t + * convert an ansi time_t to an apr_time_t + * @param result the resulting apr_time_t * @param input the time_t to convert */ -ap_status_t ap_ansi_time_to_ap_time(ap_time_t *result, time_t input); +apr_status_t apr_ansi_time_to_ap_time(apr_time_t *result, time_t input); /** * convert a time to its human readable components in GMT timezone * @param result the exploded time * @param input the time to explode */ -ap_status_t ap_explode_gmt(ap_exploded_time_t *result, ap_time_t input); +apr_status_t apr_explode_gmt(ap_exploded_time_t *result, apr_time_t input); /** * convert a time to its human readable components in local timezone * @param result the exploded time * @param input the time to explode */ -ap_status_t ap_explode_localtime(ap_exploded_time_t *result, ap_time_t input); +apr_status_t apr_explode_localtime(ap_exploded_time_t *result, apr_time_t input); /** * Convert time value from human readable format to number of seconds @@ -137,36 +137,36 @@ ap_status_t ap_explode_localtime(ap_exploded_time_t *result, ap_time_t input); * @param result the resulting imploded time * @param input the input exploded time */ -ap_status_t ap_implode_time(ap_time_t *result, ap_exploded_time_t *input); +apr_status_t apr_implode_time(apr_time_t *result, ap_exploded_time_t *input); /** * Sleep for the specified number of micro-seconds. * @param t desired amount of time to sleep. * @tip May sleep for longer than the specified time. */ -void ap_sleep(ap_interval_time_t t); +void apr_sleep(apr_interval_time_t t); #define AP_RFC822_DATE_LEN (30) /** - * ap_rfc822_date formats dates in the RFC822 + * apr_rfc822_date formats dates in the RFC822 * format in an efficient manner. it is a fixed length * format and requires the indicated amount of storage * including trailing \0 * @param date_str String to write to. * @param t the time to convert */ -ap_status_t ap_rfc822_date(char *date_str, ap_time_t t); +apr_status_t apr_rfc822_date(char *date_str, apr_time_t t); #define AP_CTIME_LEN (25) /** - * ap_ctime formats dates in the ctime() format + * apr_ctime formats dates in the ctime() format * in an efficient manner. it is a fixed length format * and requires the indicated amount of storage * including trailing \0 * @param date_str String to write to. * @param t the time to convert */ -ap_status_t ap_ctime(char *date_str, ap_time_t t); +apr_status_t apr_ctime(char *date_str, apr_time_t t); /** * formats the exploded time according to the format specified @@ -176,7 +176,7 @@ ap_status_t ap_ctime(char *date_str, ap_time_t t); * @param format The format for the time string * @param tm The time to convert */ -ap_status_t ap_strftime(char *s, ap_size_t *retsize, ap_size_t max, const char *format, ap_exploded_time_t *tm); +apr_status_t apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, const char *format, ap_exploded_time_t *tm); #ifdef __cplusplus } diff --git a/include/apr_xlate.h b/include/apr_xlate.h index 4d0f5bdfe..ffbbcc9fc 100644 --- a/include/apr_xlate.h +++ b/include/apr_xlate.h @@ -77,7 +77,7 @@ extern "C" { #if ! APR_HAS_XLATE -typedef void ap_xlate_t; +typedef void apr_xlate_t; /* For platforms where we don't bother with translating between charsets, * these are macros which always return failure. @@ -102,7 +102,7 @@ typedef void ap_xlate_t; #else /* ! APR_HAS_XLATE */ -typedef struct ap_xlate_t ap_xlate_t; +typedef struct apr_xlate_t apr_xlate_t; /** * Set up for converting text from one charset to another. @@ -125,8 +125,8 @@ typedef struct ap_xlate_t ap_xlate_t; * names to indicate the charset of the current locale. * </PRE> */ -ap_status_t ap_xlate_open(ap_xlate_t **convset, const char *topage, - const char *frompage, ap_pool_t *pool); +apr_status_t ap_xlate_open(apr_xlate_t **convset, const char *topage, + const char *frompage, apr_pool_t *pool); #define APR_DEFAULT_CHARSET (const char *)0 #define APR_LOCALE_CHARSET (const char *)1 @@ -138,7 +138,7 @@ ap_status_t ap_xlate_open(ap_xlate_t **convset, const char *topage, * @param onoff Output: whether or not the conversion is single-byte-only */ -ap_status_t ap_xlate_get_sb(ap_xlate_t *convset, int *onoff); +apr_status_t ap_xlate_get_sb(apr_xlate_t *convset, int *onoff); /** * Convert a buffer of text from one codepage to another. @@ -151,9 +151,9 @@ ap_status_t ap_xlate_get_sb(ap_xlate_t *convset, int *onoff); * @param outbytes_left Input: the size of the output buffer * Output: the amount of the output buffer not yet used */ -ap_status_t ap_xlate_conv_buffer(ap_xlate_t *convset, const char *inbuf, - ap_size_t *inbytes_left, char *outbuf, - ap_size_t *outbytes_left); +apr_status_t ap_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, + apr_size_t *inbytes_left, char *outbuf, + apr_size_t *outbytes_left); /** * The purpose of ap_xlate_conv_char is to translate one character @@ -164,7 +164,7 @@ ap_status_t ap_xlate_conv_buffer(ap_xlate_t *convset, const char *inbuf, * @param inchar The character to convert * @param outchar The converted character */ -ap_status_t ap_xlate_conv_char(ap_xlate_t *convset, char inchar, char outchar); +apr_status_t ap_xlate_conv_char(apr_xlate_t *convset, char inchar, char outchar); /** * Convert a single-byte character from one charset to another. @@ -174,13 +174,13 @@ ap_status_t ap_xlate_conv_char(ap_xlate_t *convset, char inchar, char outchar); * @tip This only works when converting between single-byte character sets. -1 will be returned if the conversion can't be performed. */ -ap_int32_t ap_xlate_conv_byte(ap_xlate_t *convset, unsigned char inchar); +apr_int32_t ap_xlate_conv_byte(apr_xlate_t *convset, unsigned char inchar); /** * Close a codepage translation handle. * @param convset The codepage translation handle to close */ -ap_status_t ap_xlate_close(ap_xlate_t *convset); +apr_status_t ap_xlate_close(apr_xlate_t *convset); #endif /* ! APR_HAS_XLATE */ diff --git a/include/arch/aix/dso.h b/include/arch/aix/dso.h index ae89f9ee5..6b7ca8ea7 100644 --- a/include/arch/aix/dso.h +++ b/include/arch/aix/dso.h @@ -68,8 +68,8 @@ void *dlsym(void *handle, const char *symbol); const char *dlerror(void); int dlclose(void *handle); -struct ap_dso_handle_t { - ap_pool_t *cont; +struct apr_dso_handle_t { + apr_pool_t *cont; void *handle; }; diff --git a/include/arch/beos/dso.h b/include/arch/beos/dso.h index 71a75ef58..476e71c8f 100644 --- a/include/arch/beos/dso.h +++ b/include/arch/beos/dso.h @@ -66,9 +66,9 @@ #if APR_HAS_DSO -struct ap_dso_handle_t { +struct apr_dso_handle_t { image_id handle; /* Handle to the DSO loaded */ - ap_pool_t *cont; + apr_pool_t *cont; }; #endif diff --git a/include/arch/beos/locks.h b/include/arch/beos/locks.h index fefc0d30a..685f8a89b 100644 --- a/include/arch/beos/locks.h +++ b/include/arch/beos/locks.h @@ -61,10 +61,10 @@ #include "apr_general.h" #include "apr_lib.h" -struct ap_lock_t { - ap_pool_t *cntxt; - ap_locktype_e type; - ap_lockscope_e scope; +struct apr_lock_t { + apr_pool_t *cntxt; + apr_locktype_e type; + apr_lockscope_e scope; int curr_locked; char *fname; /* Inter proc */ @@ -75,17 +75,17 @@ struct ap_lock_t { int32 ben_intraproc; }; -ap_status_t create_intra_lock(struct ap_lock_t *new); -ap_status_t lock_intra(struct ap_lock_t *lock); -ap_status_t unlock_intra(struct ap_lock_t *lock); -ap_status_t destroy_intra_lock(struct ap_lock_t *lock); +apr_status_t create_intra_lock(struct apr_lock_t *new); +apr_status_t lock_intra(struct apr_lock_t *lock); +apr_status_t unlock_intra(struct apr_lock_t *lock); +apr_status_t destroy_intra_lock(struct apr_lock_t *lock); -ap_status_t create_inter_lock(struct ap_lock_t *new); -ap_status_t lock_inter(struct ap_lock_t *lock); -ap_status_t unlock_inter(struct ap_lock_t *lock); -ap_status_t destroy_inter_lock(struct ap_lock_t *lock); +apr_status_t create_inter_lock(struct apr_lock_t *new); +apr_status_t lock_inter(struct apr_lock_t *lock); +apr_status_t unlock_inter(struct apr_lock_t *lock); +apr_status_t destroy_inter_lock(struct apr_lock_t *lock); -ap_status_t child_init_lock(struct ap_lock_t **lock, ap_pool_t *cont, +apr_status_t child_init_lock(struct apr_lock_t **lock, apr_pool_t *cont, const char *fname); diff --git a/include/arch/beos/networkio.h b/include/arch/beos/networkio.h index 3c2bcc535..4a9ef6c14 100644 --- a/include/arch/beos/networkio.h +++ b/include/arch/beos/networkio.h @@ -91,26 +91,26 @@ #define POLLHUP 16 #define POLLNVAL 32 -struct ap_socket_t { - ap_pool_t *cntxt; +struct apr_socket_t { + apr_pool_t *cntxt; int socketdes; struct sockaddr_in *local_addr; struct sockaddr_in *remote_addr; int addr_len; - ap_interval_time_t timeout; + apr_interval_time_t timeout; int connected; }; -struct ap_pollfd_t { - ap_pool_t *cntxt; - struct ap_socket_t *sock; +struct apr_pollfd_t { + apr_pool_t *cntxt; + struct apr_socket_t *sock; fd_set *read; fd_set *write; fd_set *except; int highsock; }; -ap_int16_t get_event(ap_int16_t); +apr_int16_t get_event(apr_int16_t); int inet_aton(const char *cp, struct in_addr *addr); #include <ByteOrder.h> /* for the ntohs definition */ diff --git a/include/arch/beos/threadproc.h b/include/arch/beos/threadproc.h index 4cb9c31e0..58c4fb67b 100644 --- a/include/arch/beos/threadproc.h +++ b/include/arch/beos/threadproc.h @@ -78,20 +78,20 @@ #define BEOS_MAX_DATAKEYS 128 -struct ap_thread_t { - ap_pool_t *cntxt; +struct apr_thread_t { + apr_pool_t *cntxt; thread_id td; }; -struct ap_threadattr_t { - ap_pool_t *cntxt; +struct apr_threadattr_t { + apr_pool_t *cntxt; int32 attr; int detached; int joinable; }; -struct ap_threadkey_t { - ap_pool_t *cntxt; +struct apr_threadkey_t { + apr_pool_t *cntxt; int32 key; }; @@ -109,17 +109,17 @@ struct beos_key { void (* destructor) (void *); }; -struct ap_procattr_t { - ap_pool_t *cntxt; - ap_file_t *parent_in; - ap_file_t *child_in; - ap_file_t *parent_out; - ap_file_t *child_out; - ap_file_t *parent_err; - ap_file_t *child_err; +struct apr_procattr_t { + apr_pool_t *cntxt; + apr_file_t *parent_in; + apr_file_t *child_in; + apr_file_t *parent_out; + apr_file_t *child_out; + apr_file_t *parent_err; + apr_file_t *child_err; char *currdir; - ap_int32_t cmdtype; - ap_int32_t detached; + apr_int32_t cmdtype; + apr_int32_t detached; }; #endif /* ! THREAD_PROC_H */ diff --git a/include/arch/os2/dso.h b/include/arch/os2/dso.h index b37e1a54c..1597c81d1 100644 --- a/include/arch/os2/dso.h +++ b/include/arch/os2/dso.h @@ -66,10 +66,10 @@ #if APR_HAS_DSO -struct ap_dso_handle_t { - ap_pool_t *cont; /* Context for returning error strings */ +struct apr_dso_handle_t { + apr_pool_t *cont; /* Context for returning error strings */ HMODULE handle; /* Handle to the DSO loaded */ - ap_status_t load_error; + apr_status_t load_error; char *failed_module; }; diff --git a/include/arch/os2/fileio.h b/include/arch/os2/fileio.h index 738e17f2e..6aa1be1c5 100644 --- a/include/arch/os2/fileio.h +++ b/include/arch/os2/fileio.h @@ -67,14 +67,14 @@ #define APR_FILE_BUFSIZE 4096 -struct ap_file_t { - ap_pool_t *cntxt; +struct apr_file_t { + apr_pool_t *cntxt; HFILE filedes; char * fname; int isopen; int buffered; int eof_hit; - ap_int32_t flags; + apr_int32_t flags; int timeout; int pipe; HEV pipeSem; @@ -85,19 +85,19 @@ struct ap_file_t { unsigned long dataRead; // amount of valid data read into buffer int direction; // buffer being used for 0 = read, 1 = write unsigned long filePtr; // position in file of handle - ap_lock_t *mutex; // mutex semaphore, must be owned to access the above fields + apr_lock_t *mutex; // mutex semaphore, must be owned to access the above fields }; -struct ap_dir_t { - ap_pool_t *cntxt; +struct apr_dir_t { + apr_pool_t *cntxt; char *dirname; ULONG handle; FILEFINDBUF3 entry; int validentry; }; -ap_status_t apr_file_cleanup(void *); -ap_status_t ap_os2_time_to_ap_time(ap_time_t *result, FDATE os2date, FTIME os2time); +apr_status_t apr_file_cleanup(void *); +apr_status_t ap_os2_time_to_ap_time(apr_time_t *result, FDATE os2date, FTIME os2time); #endif /* ! FILE_IO_H */ diff --git a/include/arch/os2/locks.h b/include/arch/os2/locks.h index d416b6b08..50ffdc652 100644 --- a/include/arch/os2/locks.h +++ b/include/arch/os2/locks.h @@ -60,10 +60,10 @@ #define INCL_DOS #include <os2.h> -struct ap_lock_t { - ap_pool_t *cntxt; - ap_locktype_e type; - ap_lockscope_e scope; +struct apr_lock_t { + apr_pool_t *cntxt; + apr_locktype_e type; + apr_lockscope_e scope; char *fname; HMTX hMutex; TID owner; diff --git a/include/arch/os2/networkio.h b/include/arch/os2/networkio.h index 63424de6a..a87823ae9 100644 --- a/include/arch/os2/networkio.h +++ b/include/arch/os2/networkio.h @@ -59,18 +59,18 @@ #include "apr_general.h" #include "os2calls.h" -struct ap_socket_t { - ap_pool_t *cntxt; +struct apr_socket_t { + apr_pool_t *cntxt; int socketdes; struct sockaddr_in *local_addr; struct sockaddr_in *remote_addr; int addr_len; - ap_interval_time_t timeout; + apr_interval_time_t timeout; int nonblock; }; -struct ap_pollfd_t { - ap_pool_t *cntxt; +struct apr_pollfd_t { + apr_pool_t *cntxt; int *socket_list; int *r_socket_list; int num_read; diff --git a/include/arch/os2/threadproc.h b/include/arch/os2/threadproc.h index d6971dbb3..c14c54aa0 100644 --- a/include/arch/os2/threadproc.h +++ b/include/arch/os2/threadproc.h @@ -63,36 +63,36 @@ #define SHELL_PATH "cmd.exe" #define APR_THREAD_STACKSIZE 65536 -struct ap_threadattr_t { - ap_pool_t *cntxt; +struct apr_threadattr_t { + apr_pool_t *cntxt; unsigned long attr; }; -struct ap_thread_t { - ap_pool_t *cntxt; - struct ap_threadattr_t *attr; +struct apr_thread_t { + apr_pool_t *cntxt; + struct apr_threadattr_t *attr; unsigned long tid; - ap_thread_start_t func; + apr_thread_start_t func; void *data; void *rv; }; -struct ap_threadkey_t { - ap_pool_t *cntxt; +struct apr_threadkey_t { + apr_pool_t *cntxt; unsigned long *key; }; -struct ap_procattr_t { - ap_pool_t *cntxt; - ap_file_t *parent_in; - ap_file_t *child_in; - ap_file_t *parent_out; - ap_file_t *child_out; - ap_file_t *parent_err; - ap_file_t *child_err; +struct apr_procattr_t { + apr_pool_t *cntxt; + apr_file_t *parent_in; + apr_file_t *child_in; + apr_file_t *parent_out; + apr_file_t *child_out; + apr_file_t *parent_err; + apr_file_t *child_err; char *currdir; - ap_int32_t cmdtype; - ap_int32_t detached; + apr_int32_t cmdtype; + apr_int32_t detached; }; typedef void (*os2_thread_start_t)(void *); diff --git a/include/arch/unix/dso.h b/include/arch/unix/dso.h index ef8aa572a..fc9b8325e 100644 --- a/include/arch/unix/dso.h +++ b/include/arch/unix/dso.h @@ -85,8 +85,8 @@ #define DLSYM_NEEDS_UNDERSCORE #endif -struct ap_dso_handle_t { - ap_pool_t *cont; +struct apr_dso_handle_t { + apr_pool_t *cont; void *handle; const char *errormsg; }; diff --git a/include/arch/unix/fileio.h b/include/arch/unix/fileio.h index c91bb453d..2f202d90e 100644 --- a/include/arch/unix/fileio.h +++ b/include/arch/unix/fileio.h @@ -112,14 +112,14 @@ #define APR_FILE_BUFSIZE 4096 -struct ap_file_t { - ap_pool_t *cntxt; +struct apr_file_t { + apr_pool_t *cntxt; int filedes; char * fname; int oflags; int eof_hit; int pipe; - ap_interval_time_t timeout; + apr_interval_time_t timeout; int buffered; enum {BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking; int ungetchar; /* Last char provided by an unget op. (-1 = no char)*/ @@ -131,21 +131,21 @@ struct ap_file_t { int direction; /* buffer being used for 0 = read, 1 = write */ unsigned long filePtr; /* position in file of handle */ #if APR_HAS_THREADS - struct ap_lock_t *thlock; + struct apr_lock_t *thlock; #endif }; -struct ap_dir_t { - ap_pool_t *cntxt; +struct apr_dir_t { + apr_pool_t *cntxt; char *dirname; DIR *dirstruct; struct dirent *entry; }; -ap_status_t ap_unix_file_cleanup(void *); +apr_status_t apr_unix_file_cleanup(void *); -mode_t ap_unix_perms2mode(ap_fileperms_t perms); -ap_fileperms_t ap_unix_mode2perms(mode_t mode); +mode_t apr_unix_perms2mode(apr_fileperms_t perms); +apr_fileperms_t apr_unix_mode2perms(mode_t mode); #endif /* ! FILE_IO_H */ diff --git a/include/arch/unix/locks.h b/include/arch/unix/locks.h index d6ecae5db..321cdd18a 100644 --- a/include/arch/unix/locks.h +++ b/include/arch/unix/locks.h @@ -112,10 +112,10 @@ union semun { }; #endif -struct ap_lock_t { - ap_pool_t *cntxt; - ap_locktype_e type; - ap_lockscope_e scope; +struct apr_lock_t { + apr_pool_t *cntxt; + apr_locktype_e type; + apr_lockscope_e scope; int curr_locked; char *fname; #if APR_USE_SYSVSEM_SERIALIZE @@ -142,19 +142,19 @@ struct ap_lock_t { }; #if APR_HAS_THREADS -ap_status_t ap_unix_create_intra_lock(struct ap_lock_t *new); -ap_status_t ap_unix_lock_intra(struct ap_lock_t *lock); -ap_status_t ap_unix_unlock_intra(struct ap_lock_t *lock); -ap_status_t ap_unix_destroy_intra_lock(struct ap_lock_t *lock); +apr_status_t apr_unix_create_intra_lock(struct apr_lock_t *new); +apr_status_t apr_unix_lock_intra(struct apr_lock_t *lock); +apr_status_t apr_unix_unlock_intra(struct apr_lock_t *lock); +apr_status_t apr_unix_destroy_intra_lock(struct apr_lock_t *lock); #endif -void ap_unix_setup_lock(void); -ap_status_t ap_unix_create_inter_lock(struct ap_lock_t *new); -ap_status_t ap_unix_lock_inter(struct ap_lock_t *lock); -ap_status_t ap_unix_unlock_inter(struct ap_lock_t *lock); -ap_status_t ap_unix_destroy_inter_lock(struct ap_lock_t *lock); +void apr_unix_setup_lock(void); +apr_status_t apr_unix_create_inter_lock(struct apr_lock_t *new); +apr_status_t apr_unix_lock_inter(struct apr_lock_t *lock); +apr_status_t apr_unix_unlock_inter(struct apr_lock_t *lock); +apr_status_t apr_unix_destroy_inter_lock(struct apr_lock_t *lock); -ap_status_t ap_unix_child_init_lock(struct ap_lock_t **lock, ap_pool_t *cont, +apr_status_t apr_unix_child_init_lock(struct apr_lock_t **lock, apr_pool_t *cont, const char *fname); #endif /* LOCKS_H */ diff --git a/include/arch/unix/misc.h b/include/arch/unix/misc.h index 7a3648502..f02c112dc 100644 --- a/include/arch/unix/misc.h +++ b/include/arch/unix/misc.h @@ -90,8 +90,8 @@ typedef struct datastruct { struct datastruct *prev; } datastruct; -struct ap_other_child_rec_t { - struct ap_other_child_rec_t *next; +struct apr_other_child_rec_t { + struct apr_other_child_rec_t *next; int id; /* This is either a pid or tid depending on the platform */ void (*maintenance) (int, void *, int); void *data; @@ -170,7 +170,7 @@ AP_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, ( (hFile)); #define CancelIo ap_winapi_CancelIo -ap_status_t ap_get_oslevel(struct ap_pool_t *, ap_oslevel_e *); +apr_status_t ap_get_oslevel(struct apr_pool_t *, ap_oslevel_e *); #endif /* WIN32 */ #endif /* ! MISC_H */ diff --git a/include/arch/unix/mmap.c b/include/arch/unix/mmap.c index d708b977e..199b6fc74 100644 --- a/include/arch/unix/mmap.c +++ b/include/arch/unix/mmap.c @@ -79,9 +79,9 @@ #if APR_HAS_MMAP || defined(BEOS) -static ap_status_t mmap_cleanup(void *themmap) +static apr_status_t mmap_cleanup(void *themmap) { - ap_mmap_t *mm = themmap; + apr_mmap_t *mm = themmap; int rv; #ifdef BEOS rv = delete_area(mm->area); @@ -101,8 +101,8 @@ static ap_status_t mmap_cleanup(void *themmap) return errno; } -ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset, - ap_size_t size, ap_pool_t *cont) +apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, apr_off_t offset, + apr_size_t size, apr_pool_t *cont) { #ifdef BEOS void *mm; @@ -115,11 +115,11 @@ ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset, if (file == NULL || file->filedes == -1 || file->buffered) return APR_EBADF; - (*new) = (ap_mmap_t *)ap_pcalloc(cont, sizeof(ap_mmap_t)); + (*new) = (apr_mmap_t *)apr_pcalloc(cont, sizeof(apr_mmap_t)); #ifdef BEOS /* XXX: mmap shouldn't really change the seek offset */ - ap_seek(file, APR_SET, &offset); + apr_seek(file, APR_SET, &offset); pages = ((size -1) / B_PAGE_SIZE) + 1; aid = create_area(areaname, &mm , B_ANY_ADDRESS, pages * B_PAGE_SIZE, @@ -148,20 +148,20 @@ ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset, (*new)->cntxt = cont; /* register the cleanup... */ - ap_register_cleanup((*new)->cntxt, (void*)(*new), mmap_cleanup, - ap_null_cleanup); + apr_register_cleanup((*new)->cntxt, (void*)(*new), mmap_cleanup, + apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_mmap_delete(ap_mmap_t *mmap) +apr_status_t apr_mmap_delete(apr_mmap_t *mmap) { - ap_status_t rv; + apr_status_t rv; if (mmap->mm == (caddr_t) -1) return APR_ENOENT; if ((rv = mmap_cleanup(mmap)) == APR_SUCCESS) { - ap_kill_cleanup(mmap->cntxt, mmap, mmap_cleanup); + apr_kill_cleanup(mmap->cntxt, mmap, mmap_cleanup); return APR_SUCCESS; } return rv; diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h index af28dc7c7..90868b06d 100644 --- a/include/arch/unix/networkio.h +++ b/include/arch/unix/networkio.h @@ -116,13 +116,13 @@ #define POLLNVAL 32 #endif -struct ap_socket_t { - ap_pool_t *cntxt; +struct apr_socket_t { + apr_pool_t *cntxt; int socketdes; struct sockaddr_in *local_addr; struct sockaddr_in *remote_addr; socklen_t addr_len; - ap_interval_time_t timeout; + apr_interval_time_t timeout; #ifndef HAVE_POLL int connected; #endif @@ -130,8 +130,8 @@ struct ap_socket_t { int local_interface_unknown; }; -struct ap_pollfd_t { - ap_pool_t *cntxt; +struct apr_pollfd_t { + apr_pool_t *cntxt; #ifdef HAVE_POLL struct pollfd *pollset; int num; @@ -142,8 +142,8 @@ struct ap_pollfd_t { fd_set *except; int highsock; #endif - ap_int16_t *events; - ap_int16_t *revents; + apr_int16_t *events; + apr_int16_t *revents; }; diff --git a/include/arch/unix/threadproc.h b/include/arch/unix/threadproc.h index e6d9e36aa..d5f0a679f 100644 --- a/include/arch/unix/threadproc.h +++ b/include/arch/unix/threadproc.h @@ -86,33 +86,33 @@ #define SHELL_PATH "/bin/sh" #if APR_HAS_THREADS -struct ap_thread_t { - ap_pool_t *cntxt; +struct apr_thread_t { + apr_pool_t *cntxt; pthread_t *td; }; -struct ap_threadattr_t { - ap_pool_t *cntxt; +struct apr_threadattr_t { + apr_pool_t *cntxt; pthread_attr_t *attr; }; -struct ap_threadkey_t { - ap_pool_t *cntxt; +struct apr_threadkey_t { + apr_pool_t *cntxt; pthread_key_t key; }; #endif -struct ap_procattr_t { - ap_pool_t *cntxt; - ap_file_t *parent_in; - ap_file_t *child_in; - ap_file_t *parent_out; - ap_file_t *child_out; - ap_file_t *parent_err; - ap_file_t *child_err; +struct apr_procattr_t { + apr_pool_t *cntxt; + apr_file_t *parent_in; + apr_file_t *child_in; + apr_file_t *parent_out; + apr_file_t *child_out; + apr_file_t *parent_err; + apr_file_t *child_err; char *currdir; - ap_int32_t cmdtype; - ap_int32_t detached; + apr_int32_t cmdtype; + apr_int32_t detached; #ifdef RLIMIT_CPU struct rlimit *limit_cpu; #endif diff --git a/include/arch/win32/atime.h b/include/arch/win32/atime.h index cf5ab4873..d4a257315 100644 --- a/include/arch/win32/atime.h +++ b/include/arch/win32/atime.h @@ -60,13 +60,13 @@ #include <time.h> struct atime_t { - ap_pool_t *cntxt; - ap_time_t currtime; + apr_pool_t *cntxt; + apr_time_t currtime; SYSTEMTIME *explodedtime; }; -void FileTimeToAprTime(ap_time_t *atime, FILETIME *ft); -void AprTimeToFileTime(LPFILETIME pft, ap_time_t t); +void FileTimeToAprTime(apr_time_t *atime, FILETIME *ft); +void AprTimeToFileTime(LPFILETIME pft, apr_time_t t); #endif /* ! ATIME_H */ diff --git a/include/arch/win32/dso.h b/include/arch/win32/dso.h index 73ab8b1ed..32bf6b7be 100644 --- a/include/arch/win32/dso.h +++ b/include/arch/win32/dso.h @@ -63,10 +63,10 @@ #if APR_HAS_DSO -struct ap_dso_handle_t { - ap_pool_t *cont; +struct apr_dso_handle_t { + apr_pool_t *cont; void *handle; - ap_status_t load_error; + apr_status_t load_error; }; #endif diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h index 232c4d057..bfdda7421 100644 --- a/include/arch/win32/fileio.h +++ b/include/arch/win32/fileio.h @@ -87,7 +87,7 @@ #define APR_FILE_BUFSIZE 4096 -/* quick run-down of fields in windows' ap_file_t structure that may have +/* quick run-down of fields in windows' apr_file_t structure that may have * obvious uses. * fname -- the filename as passed to the open call. * dwFileAttricutes -- Attributes used to open the file. @@ -100,12 +100,12 @@ * correctly when writing to a file with this flag set TRUE. */ -struct ap_file_t { - ap_pool_t *cntxt; +struct apr_file_t { + apr_pool_t *cntxt; HANDLE filehand; BOOLEAN pipe; // Is this a pipe of a file? OVERLAPPED *pOverlapped; - ap_interval_time_t timeout; + apr_interval_time_t timeout; /* File specific info */ char *fname; @@ -117,38 +117,38 @@ struct ap_file_t { int ungetchar; // Last char provided by an unget op. (-1 = no char) int append; off_t size; - ap_time_t atime; - ap_time_t mtime; - ap_time_t ctime; + apr_time_t atime; + apr_time_t mtime; + apr_time_t ctime; /* Stuff for buffered mode */ char *buffer; - ap_ssize_t bufpos; // Read/Write position in buffer - ap_ssize_t dataRead; // amount of valid data read into buffer + apr_ssize_t bufpos; // Read/Write position in buffer + apr_ssize_t dataRead; // amount of valid data read into buffer int direction; // buffer being used for 0 = read, 1 = write - ap_ssize_t filePtr; // position in file of handle - ap_lock_t *mutex; // mutex semaphore, must be owned to access the above fields + apr_ssize_t filePtr; // position in file of handle + apr_lock_t *mutex; // mutex semaphore, must be owned to access the above fields /* Pipe specific info */ }; -struct ap_dir_t { - ap_pool_t *cntxt; +struct apr_dir_t { + apr_pool_t *cntxt; char *dirname; HANDLE dirhand; WIN32_FIND_DATA *entry; }; -ap_status_t file_cleanup(void *); -/*mode_t get_fileperms(ap_fileperms_t); +apr_status_t file_cleanup(void *); +/*mode_t get_fileperms(apr_fileperms_t); */ -APR_EXPORT(char *) ap_os_systemcase_filename(struct ap_pool_t *pCont, +APR_EXPORT(char *) ap_os_systemcase_filename(struct apr_pool_t *pCont, const char *szFile); -char * canonical_filename(struct ap_pool_t *pCont, const char *szFile); +char * canonical_filename(struct apr_pool_t *pCont, const char *szFile); -ap_status_t ap_create_nt_pipe(ap_file_t **in, ap_file_t **out, +apr_status_t ap_create_nt_pipe(apr_file_t **in, apr_file_t **out, BOOLEAN bAsyncRead, BOOLEAN bAsyncWrite, - ap_pool_t *p); + apr_pool_t *p); #endif /* ! FILE_IO_H */ diff --git a/include/arch/win32/locks.h b/include/arch/win32/locks.h index 602c2eb67..a7515f238 100644 --- a/include/arch/win32/locks.h +++ b/include/arch/win32/locks.h @@ -57,10 +57,10 @@ #include "apr_lock.h" -struct ap_lock_t { - ap_pool_t *cntxt; - ap_locktype_e type; - ap_lockscope_e scope; +struct apr_lock_t { + apr_pool_t *cntxt; + apr_locktype_e type; + apr_lockscope_e scope; HANDLE mutex; CRITICAL_SECTION section; char *fname; diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h index 7a3648502..f02c112dc 100644 --- a/include/arch/win32/misc.h +++ b/include/arch/win32/misc.h @@ -90,8 +90,8 @@ typedef struct datastruct { struct datastruct *prev; } datastruct; -struct ap_other_child_rec_t { - struct ap_other_child_rec_t *next; +struct apr_other_child_rec_t { + struct apr_other_child_rec_t *next; int id; /* This is either a pid or tid depending on the platform */ void (*maintenance) (int, void *, int); void *data; @@ -170,7 +170,7 @@ AP_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, ( (hFile)); #define CancelIo ap_winapi_CancelIo -ap_status_t ap_get_oslevel(struct ap_pool_t *, ap_oslevel_e *); +apr_status_t ap_get_oslevel(struct apr_pool_t *, ap_oslevel_e *); #endif /* WIN32 */ #endif /* ! MISC_H */ diff --git a/include/arch/win32/networkio.h b/include/arch/win32/networkio.h index 296127288..3d5897a62 100644 --- a/include/arch/win32/networkio.h +++ b/include/arch/win32/networkio.h @@ -58,20 +58,20 @@ #include "apr_network_io.h" #include "apr_general.h" -struct ap_socket_t { - ap_pool_t *cntxt; +struct apr_socket_t { + apr_pool_t *cntxt; SOCKET sock; struct sockaddr_in *local_addr; struct sockaddr_in *remote_addr; size_t addr_len; - ap_interval_time_t timeout; - ap_int32_t disconnected; + apr_interval_time_t timeout; + apr_int32_t disconnected; int local_port_unknown; int local_interface_unknown; }; -struct ap_pollfd_t { - ap_pool_t *cntxt; +struct apr_pollfd_t { + apr_pool_t *cntxt; fd_set *read; int numread; fd_set *write; @@ -80,7 +80,7 @@ struct ap_pollfd_t { int numexcept; }; -ap_status_t status_from_res_error(int); +apr_status_t status_from_res_error(int); #endif /* ! NETWORK_IO_H */ diff --git a/include/arch/win32/threadproc.h b/include/arch/win32/threadproc.h index 936747783..24a140bb1 100644 --- a/include/arch/win32/threadproc.h +++ b/include/arch/win32/threadproc.h @@ -61,35 +61,35 @@ #define SHELL_PATH "cmd.exe" -struct ap_thread_t { - ap_pool_t *cntxt; +struct apr_thread_t { + apr_pool_t *cntxt; HANDLE td; - ap_int32_t cancel; - ap_int32_t cancel_how; + apr_int32_t cancel; + apr_int32_t cancel_how; }; -struct ap_threadattr_t { - ap_pool_t *cntxt; - ap_int32_t detach; +struct apr_threadattr_t { + apr_pool_t *cntxt; + apr_int32_t detach; }; -struct ap_threadkey_t { - ap_pool_t *cntxt; +struct apr_threadkey_t { + apr_pool_t *cntxt; DWORD key; }; -struct ap_procattr_t { - ap_pool_t *cntxt; +struct apr_procattr_t { + apr_pool_t *cntxt; STARTUPINFO si; - ap_file_t *parent_in; - ap_file_t *child_in; - ap_file_t *parent_out; - ap_file_t *child_out; - ap_file_t *parent_err; - ap_file_t *child_err; + apr_file_t *parent_in; + apr_file_t *child_in; + apr_file_t *parent_out; + apr_file_t *child_out; + apr_file_t *parent_err; + apr_file_t *child_err; char *currdir; - ap_int32_t cmdtype; - ap_int32_t detached; + apr_int32_t cmdtype; + apr_int32_t detached; }; #endif /* ! THREAD_PROC_H */ diff --git a/lib/apr_pools.c b/lib/apr_pools.c index 1bd061a49..ad6f4754c 100644 --- a/lib/apr_pools.c +++ b/lib/apr_pools.c @@ -102,7 +102,7 @@ /* Details of the debugging options can now be found in the developer * section of the documentaion. */ -/* magic numbers --- min free bytes to consider a free ap_pool_t block useable, +/* magic numbers --- min free bytes to consider a free apr_pool_t block useable, * and the min amount to allocate if we have to go to malloc() */ #ifndef BLOCK_MINFREE @@ -166,7 +166,7 @@ union block_hdr { char *first_avail; #ifdef POOL_DEBUG union block_hdr *global_next; - ap_pool_t *owning_pool; + apr_pool_t *owning_pool; #endif /* POOL_DEBUG */ } h; }; @@ -188,15 +188,15 @@ union block_hdr { static union block_hdr *block_freelist = NULL; #if APR_HAS_THREADS -static ap_lock_t *alloc_mutex; -static ap_lock_t *spawn_mutex; +static apr_lock_t *alloc_mutex; +static apr_lock_t *spawn_mutex; #endif #ifdef POOL_DEBUG static char *known_stack_point; static int stack_direction; static union block_hdr *global_block_list; -#define FREE_POOL ((ap_pool_t *)(-1)) +#define FREE_POOL ((apr_pool_t *)(-1)) #endif /* POOL_DEBUG */ #ifdef ALLOC_STATS @@ -322,7 +322,7 @@ static void free_blocks(union block_hdr *blok) } #if APR_HAS_THREADS - ap_lock(alloc_mutex); + apr_lock(alloc_mutex); #endif old_free_list = block_freelist; block_freelist = blok; @@ -372,7 +372,7 @@ static void free_blocks(union block_hdr *blok) #endif /* ALLOC_STATS */ #if APR_HAS_THREADS - ap_unlock(alloc_mutex); + apr_unlock(alloc_mutex); #endif /* APR_HAS_THREADS */ #endif /* ALLOC_USE_MALLOC */ } @@ -417,9 +417,9 @@ static union block_hdr *new_block(int min_size, int (*apr_abort)(int retcode)) /* Accounting */ -static ap_size_t bytes_in_block_list(union block_hdr *blok) +static apr_size_t bytes_in_block_list(union block_hdr *blok) { - ap_size_t size = 0; + apr_size_t size = 0; while (blok) { size += blok->h.endp - (char *) (blok + 1); @@ -444,7 +444,7 @@ struct cleanup; static void run_cleanups(struct cleanup *c); static void free_proc_chain(struct process_chain *p); -static ap_pool_t *permanent_pool; +static apr_pool_t *permanent_pool; /* Each pool structure is allocated in the start of its own first block, * so we need to know how many bytes that is (once properly aligned...). @@ -453,27 +453,27 @@ static ap_pool_t *permanent_pool; * gets taken off the parent's sub-pool list... */ -#define POOL_HDR_CLICKS (1 + ((sizeof(struct ap_pool_t) - 1) / CLICK_SZ)) +#define POOL_HDR_CLICKS (1 + ((sizeof(struct apr_pool_t) - 1) / CLICK_SZ)) #define POOL_HDR_BYTES (POOL_HDR_CLICKS * CLICK_SZ) -APR_EXPORT(ap_pool_t *) ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retcode)) +APR_EXPORT(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int retcode)) { union block_hdr *blok; - ap_pool_t *new_pool; + apr_pool_t *new_pool; #if APR_HAS_THREADS - ap_lock(alloc_mutex); + apr_lock(alloc_mutex); #endif blok = new_block(POOL_HDR_BYTES, apr_abort); - new_pool = (ap_pool_t *) blok->h.first_avail; + new_pool = (apr_pool_t *) blok->h.first_avail; blok->h.first_avail += POOL_HDR_BYTES; #ifdef POOL_DEBUG blok->h.owning_pool = new_pool; #endif - memset((char *) new_pool, '\0', sizeof(struct ap_pool_t)); + memset((char *) new_pool, '\0', sizeof(struct apr_pool_t)); new_pool->free_first_avail = blok->h.first_avail; new_pool->first = new_pool->last = blok; @@ -490,7 +490,7 @@ APR_EXPORT(ap_pool_t *) ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retc } #if APR_HAS_THREADS - ap_unlock(alloc_mutex); + apr_unlock(alloc_mutex); #endif return new_pool; @@ -532,19 +532,19 @@ static void dump_stats(void) struct cleanup { const void *data; - ap_status_t (*plain_cleanup) (void *); - ap_status_t (*child_cleanup) (void *); + apr_status_t (*plain_cleanup) (void *); + apr_status_t (*child_cleanup) (void *); struct cleanup *next; }; -APR_EXPORT(void) ap_register_cleanup(ap_pool_t *p, const void *data, - ap_status_t (*plain_cleanup) (void *), - ap_status_t (*child_cleanup) (void *)) +APR_EXPORT(void) apr_register_cleanup(apr_pool_t *p, const void *data, + apr_status_t (*plain_cleanup) (void *), + apr_status_t (*child_cleanup) (void *)) { struct cleanup *c; if (p != NULL) { - c = (struct cleanup *) ap_palloc(p, sizeof(struct cleanup)); + c = (struct cleanup *) apr_palloc(p, sizeof(struct cleanup)); c->data = data; c->plain_cleanup = plain_cleanup; c->child_cleanup = child_cleanup; @@ -553,8 +553,8 @@ APR_EXPORT(void) ap_register_cleanup(ap_pool_t *p, const void *data, } } -APR_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, const void *data, - ap_status_t (*cleanup) (void *)) +APR_EXPORT(void) apr_kill_cleanup(apr_pool_t *p, const void *data, + apr_status_t (*cleanup) (void *)) { struct cleanup *c; struct cleanup **lastp; @@ -574,10 +574,10 @@ APR_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, const void *data, } } -APR_EXPORT(ap_status_t) ap_run_cleanup(ap_pool_t *p, void *data, - ap_status_t (*cleanup) (void *)) +APR_EXPORT(apr_status_t) apr_run_cleanup(apr_pool_t *p, void *data, + apr_status_t (*cleanup) (void *)) { - ap_kill_cleanup(p, data, cleanup); + apr_kill_cleanup(p, data, cleanup); return (*cleanup) (data); } @@ -597,7 +597,7 @@ static void run_child_cleanups(struct cleanup *c) } } -static void cleanup_pool_for_exec(ap_pool_t *p) +static void cleanup_pool_for_exec(apr_pool_t *p) { run_child_cleanups(p->cleanups); p->cleanups = NULL; @@ -607,7 +607,7 @@ static void cleanup_pool_for_exec(ap_pool_t *p) } } -APR_EXPORT(void) ap_cleanup_for_exec(void) +APR_EXPORT(void) apr_cleanup_for_exec(void) { #if !defined(WIN32) && !defined(OS2) /* @@ -623,16 +623,16 @@ APR_EXPORT(void) ap_cleanup_for_exec(void) #endif /* ndef WIN32 */ } -APR_EXPORT_NONSTD(ap_status_t) ap_null_cleanup(void *data) +APR_EXPORT_NONSTD(apr_status_t) apr_null_cleanup(void *data) { /* do nothing cleanup routine */ return APR_SUCCESS; } -ap_status_t ap_init_alloc(void) +apr_status_t apr_init_alloc(void) { #if APR_HAS_THREADS - ap_status_t status; + apr_status_t status; #endif #ifdef POOL_DEBUG char s; @@ -641,16 +641,16 @@ ap_status_t ap_init_alloc(void) stack_var_init(&s); #endif #if APR_HAS_THREADS - status = ap_create_lock(&alloc_mutex, APR_MUTEX, APR_INTRAPROCESS, + status = apr_create_lock(&alloc_mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, NULL); if (status != APR_SUCCESS) { - ap_destroy_lock(alloc_mutex); + apr_destroy_lock(alloc_mutex); return status; } - status = ap_create_lock(&spawn_mutex, APR_MUTEX, APR_INTRAPROCESS, + status = apr_create_lock(&spawn_mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, NULL); if (status != APR_SUCCESS) { - ap_destroy_lock(spawn_mutex); + apr_destroy_lock(spawn_mutex); return status; } #endif @@ -662,24 +662,24 @@ ap_status_t ap_init_alloc(void) return APR_SUCCESS; } -void ap_term_alloc(void) +void apr_term_alloc(void) { #if APR_HAS_THREADS - ap_destroy_lock(alloc_mutex); - ap_destroy_lock(spawn_mutex); + apr_destroy_lock(alloc_mutex); + apr_destroy_lock(spawn_mutex); #endif } -/* We only want to lock the mutex if we are being called from ap_clear_pool. +/* We only want to lock the mutex if we are being called from apr_clear_pool. * This is because if we also call this function from ap_destroy_real_pool, * which also locks the same mutex, and recursive locks aren't portable. * This way, we are garaunteed that we only lock this mutex once when calling * either one of these functions. */ -APR_EXPORT(void) ap_clear_pool(ap_pool_t *a) +APR_EXPORT(void) apr_clear_pool(apr_pool_t *a) { while (a->sub_pools) { - ap_destroy_pool(a->sub_pools); + apr_destroy_pool(a->sub_pools); } /* * Don't hold the mutex during cleanups. @@ -711,11 +711,11 @@ APR_EXPORT(void) ap_clear_pool(ap_pool_t *a) #endif } -APR_EXPORT(void) ap_destroy_pool(ap_pool_t *a) +APR_EXPORT(void) apr_destroy_pool(apr_pool_t *a) { - ap_clear_pool(a); + apr_clear_pool(a); #if APR_HAS_THREADS - ap_lock(alloc_mutex); + apr_lock(alloc_mutex); #endif if (a->parent) { @@ -730,16 +730,16 @@ APR_EXPORT(void) ap_destroy_pool(ap_pool_t *a) } } #if APR_HAS_THREADS - ap_unlock(alloc_mutex); + apr_unlock(alloc_mutex); #endif free_blocks(a->first); } -APR_EXPORT(ap_size_t) ap_bytes_in_pool(ap_pool_t *p) +APR_EXPORT(apr_size_t) apr_bytes_in_pool(apr_pool_t *p) { return bytes_in_block_list(p->first); } -APR_EXPORT(ap_size_t) ap_bytes_in_free_blocks(void) +APR_EXPORT(apr_size_t) apr_bytes_in_free_blocks(void) { return bytes_in_block_list(block_freelist); } @@ -762,7 +762,7 @@ extern char _end; /* Find the pool that ts belongs to, return NULL if it doesn't * belong to any pool. */ -APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts) +APR_EXPORT(apr_pool_t *) ap_find_pool(const void *ts) { const char *s = ts; union block_hdr **pb; @@ -808,7 +808,7 @@ APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts) /* return TRUE iff a is an ancestor of b * NULL is considered an ancestor of all pools */ -APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) +APR_EXPORT(int) ap_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) { if (a == NULL) { return 1; @@ -830,7 +830,7 @@ APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) * instead. This is a guarantee by the caller that sub will not * be destroyed before p is. */ -APR_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub) +APR_EXPORT(void) ap_pool_join(apr_pool_t *p, apr_pool_t *sub) { union block_hdr *b; @@ -857,10 +857,10 @@ APR_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub) * Allocating stuff... */ -void * ap_palloc(ap_pool_t *a, ap_size_t reqsize) +void * apr_palloc(apr_pool_t *a, apr_size_t reqsize) { #ifdef ALLOC_USE_MALLOC - ap_size_t size = reqsize + CLICK_SZ; + apr_size_t size = reqsize + CLICK_SZ; void *ptr; if (a == NULL) { @@ -884,8 +884,8 @@ void * ap_palloc(ap_pool_t *a, ap_size_t reqsize) * Round up requested size to an even number of alignment units * (core clicks) */ - ap_size_t nclicks; - ap_size_t size; + apr_size_t nclicks; + apr_size_t size; /* First, see if we have space in the block most recently * allocated to this pool @@ -919,7 +919,7 @@ void * ap_palloc(ap_pool_t *a, ap_size_t reqsize) if (new_first_avail <= blok->h.endp) { debug_verify_filled(first_avail, blok->h.endp, - "[ap_palloc] Ouch! Someone trounced past the end " + "[apr_palloc] Ouch! Someone trounced past the end " "of their allocation!\n"); blok->h.first_avail = new_first_avail; return (void *) first_avail; @@ -928,7 +928,7 @@ void * ap_palloc(ap_pool_t *a, ap_size_t reqsize) /* Nope --- get a new one that's guaranteed to be big enough */ #if APR_HAS_THREADS - ap_lock(alloc_mutex); + apr_lock(alloc_mutex); #endif blok = new_block(size, a->apr_abort); @@ -939,7 +939,7 @@ void * ap_palloc(ap_pool_t *a, ap_size_t reqsize) #endif #if APR_HAS_THREADS - ap_unlock(alloc_mutex); + apr_unlock(alloc_mutex); #endif first_avail = blok->h.first_avail; @@ -949,29 +949,29 @@ void * ap_palloc(ap_pool_t *a, ap_size_t reqsize) #endif } -APR_EXPORT(void *) ap_pcalloc(ap_pool_t *a, ap_size_t size) +APR_EXPORT(void *) apr_pcalloc(apr_pool_t *a, apr_size_t size) { - void *res = ap_palloc(a, size); + void *res = apr_palloc(a, size); memset(res, '\0', size); return res; } /* - * ap_psprintf is implemented by writing directly into the current + * apr_psprintf is implemented by writing directly into the current * block of the pool, starting right at first_avail. If there's * insufficient room, then a new block is allocated and the earlier * output is copied over. The new block isn't linked into the pool * until all the output is done. * * Note that this is completely safe because nothing else can - * allocate in this ap_pool_t while ap_psprintf is running. alarms are + * allocate in this apr_pool_t while apr_psprintf is running. alarms are * blocked, and the only thing outside of alloc.c that's invoked - * is ap_vformatter -- which was purposefully written to be + * is apr_vformatter -- which was purposefully written to be * self-contained with no callouts. */ struct psprintf_data { - ap_vformatter_buff_t vbuff; + apr_vformatter_buff_t vbuff; #ifdef ALLOC_USE_MALLOC char *base; #else @@ -980,11 +980,11 @@ struct psprintf_data { #endif }; -static int psprintf_flush(ap_vformatter_buff_t *vbuff) +static int psprintf_flush(apr_vformatter_buff_t *vbuff) { struct psprintf_data *ps = (struct psprintf_data *)vbuff; #ifdef ALLOC_USE_MALLOC - ap_size_t size; + apr_size_t size; char *ptr; size = (char *)ps->vbuff.curpos - ps->base; @@ -1000,7 +1000,7 @@ static int psprintf_flush(ap_vformatter_buff_t *vbuff) #else union block_hdr *blok; union block_hdr *nblok; - ap_size_t cur_len; + apr_size_t cur_len; char *strp; blok = ps->blok; @@ -1009,11 +1009,11 @@ static int psprintf_flush(ap_vformatter_buff_t *vbuff) /* must try another blok */ #if APR_HAS_THREADS - ap_lock(alloc_mutex); + apr_lock(alloc_mutex); #endif nblok = new_block(2 * cur_len, NULL); #if APR_HAS_THREADS - ap_unlock(alloc_mutex); + apr_unlock(alloc_mutex); #endif memcpy(nblok->h.first_avail, blok->h.first_avail, cur_len); ps->vbuff.curpos = nblok->h.first_avail + cur_len; @@ -1024,12 +1024,12 @@ static int psprintf_flush(ap_vformatter_buff_t *vbuff) if (ps->got_a_new_block) { debug_fill(blok->h.first_avail, blok->h.endp - blok->h.first_avail); #if APR_HAS_THREADS - ap_lock(alloc_mutex); + apr_lock(alloc_mutex); #endif blok->h.next = block_freelist; block_freelist = blok; #if APR_HAS_THREADS - ap_unlock(alloc_mutex); + apr_unlock(alloc_mutex); #endif } ps->blok = nblok; @@ -1042,7 +1042,7 @@ static int psprintf_flush(ap_vformatter_buff_t *vbuff) #endif } -APR_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) +APR_EXPORT(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap) { #ifdef ALLOC_USE_MALLOC struct psprintf_data ps; @@ -1056,7 +1056,7 @@ APR_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) /* need room at beginning for allocation_list */ ps.vbuff.curpos = ps.base + CLICK_SZ; ps.vbuff.endpos = ps.base + 511; - ap_vformatter(psprintf_flush, &ps.vbuff, fmt, ap); + apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap); *ps.vbuff.curpos++ = '\0'; ptr = ps.base; /* shrink */ @@ -1071,14 +1071,14 @@ APR_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) #else struct psprintf_data ps; char *strp; - ap_size_t size; + apr_size_t size; ps.blok = p->last; ps.vbuff.curpos = ps.blok->h.first_avail; ps.vbuff.endpos = ps.blok->h.endp - 1; /* save one for NUL */ ps.got_a_new_block = 0; - ap_vformatter(psprintf_flush, &ps.vbuff, fmt, ap); + apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap); strp = ps.vbuff.curpos; *strp++ = '\0'; @@ -1101,13 +1101,13 @@ APR_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) #endif } -APR_EXPORT_NONSTD(char *) ap_psprintf(ap_pool_t *p, const char *fmt, ...) +APR_EXPORT_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) { va_list ap; char *res; va_start(ap, fmt); - res = ap_pvsprintf(p, fmt, ap); + res = apr_pvsprintf(p, fmt, ap); va_end(ap); return res; } @@ -1124,11 +1124,11 @@ APR_EXPORT_NONSTD(char *) ap_psprintf(ap_pool_t *p, const char *fmt, ...) * generic interface, but for now, it's a special case */ -APR_EXPORT(void) ap_note_subprocess(ap_pool_t *a, ap_proc_t *pid, +APR_EXPORT(void) apr_note_subprocess(apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how) { struct process_chain *new = - (struct process_chain *) ap_palloc(a, sizeof(struct process_chain)); + (struct process_chain *) apr_palloc(a, sizeof(struct process_chain)); new->pid = pid; new->kill_how = how; @@ -1159,7 +1159,7 @@ static void free_proc_chain(struct process_chain *procs) #ifndef NEED_WAITPID /* Pick up all defunct processes */ for (p = procs; p; p = p->next) { - if (ap_wait_proc(p->pid, APR_NOWAIT) == APR_CHILD_DONE) { + if (apr_wait_proc(p->pid, APR_NOWAIT) == APR_CHILD_DONE) { p->kill_how = kill_never; } } @@ -1170,20 +1170,20 @@ static void free_proc_chain(struct process_chain *procs) || (p->kill_how == kill_only_once)) { /* * Subprocess may be dead already. Only need the timeout if not. - * Note: ap_kill on Windows is TerminateProcess(), which is + * Note: apr_kill on Windows is TerminateProcess(), which is * similar to a SIGKILL, so always give the process a timeout * under Windows before killing it. */ #ifdef WIN32 need_timeout = 1; #else - if (ap_kill(p->pid, APR_SIGTERM) == APR_SUCCESS) { + if (apr_kill(p->pid, APR_SIGTERM) == APR_SUCCESS) { need_timeout = 1; } #endif } else if (p->kill_how == kill_always) { - ap_kill(p->pid, APR_SIGKILL); + apr_kill(p->pid, APR_SIGKILL); } } @@ -1198,7 +1198,7 @@ static void free_proc_chain(struct process_chain *procs) */ for (p = procs; p; p = p->next) { if (p->kill_how == kill_after_timeout) { - ap_kill(p->pid, APR_SIGKILL); + apr_kill(p->pid, APR_SIGKILL); } } #ifdef WIN32 @@ -1215,7 +1215,7 @@ static void free_proc_chain(struct process_chain *procs) /* Now wait for all the signaled processes to die */ for (p = procs; p; p = p->next) { if (p->kill_how != kill_never) { - (void) ap_wait_proc(p->pid, APR_WAIT); + (void) apr_wait_proc(p->pid, APR_WAIT); } } } diff --git a/lib/apr_signal.c b/lib/apr_signal.c index 2285664cb..df13f7ace 100644 --- a/lib/apr_signal.c +++ b/lib/apr_signal.c @@ -64,7 +64,7 @@ * from W. Richard Stevens' "Advanced Programming in the UNIX Environment" * (the version that does not automatically restart system calls). */ -Sigfunc *ap_signal(int signo, Sigfunc * func) +Sigfunc *apr_signal(int signo, Sigfunc * func) { struct sigaction act, oact; diff --git a/locks/beos/crossproc.c b/locks/beos/crossproc.c index 8a27e0d6e..ee541cfcb 100644 --- a/locks/beos/crossproc.c +++ b/locks/beos/crossproc.c @@ -54,9 +54,9 @@ #include "locks.h" -ap_status_t lock_inter_cleanup(void * data) +apr_status_t lock_inter_cleanup(void * data) { - ap_lock_t *lock = (ap_lock_t*)data; + apr_lock_t *lock = (apr_lock_t*)data; if (lock->curr_locked == 1) { if (atomic_add(&lock->ben_interproc , -1) > 1){ release_sem (lock->sem_interproc); @@ -66,12 +66,12 @@ ap_status_t lock_inter_cleanup(void * data) return APR_SUCCESS; } -ap_status_t create_inter_lock(ap_lock_t *new) +apr_status_t create_inter_lock(apr_lock_t *new) { int32 stat; - new->sem_interproc = (sem_id)ap_palloc(new->cntxt, sizeof(sem_id)); - new->ben_interproc = (int32)ap_palloc(new->cntxt, sizeof(int32)); + new->sem_interproc = (sem_id)apr_palloc(new->cntxt, sizeof(sem_id)); + new->ben_interproc = (int32)apr_palloc(new->cntxt, sizeof(int32)); if ((stat = create_sem(0, "ap_interproc")) < B_NO_ERROR) { lock_inter_cleanup(new); @@ -80,12 +80,12 @@ ap_status_t create_inter_lock(ap_lock_t *new) new->ben_interproc = 0; new->curr_locked = 0; new->sem_interproc = stat; - ap_register_cleanup(new->cntxt, (void *)new, lock_inter_cleanup, - ap_null_cleanup); + apr_register_cleanup(new->cntxt, (void *)new, lock_inter_cleanup, + apr_null_cleanup); return APR_SUCCESS; } -ap_status_t lock_inter(ap_lock_t *lock) +apr_status_t lock_inter(apr_lock_t *lock) { int32 stat; @@ -99,7 +99,7 @@ ap_status_t lock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t unlock_inter(ap_lock_t *lock) +apr_status_t unlock_inter(apr_lock_t *lock) { int32 stat; @@ -113,17 +113,17 @@ ap_status_t unlock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t destroy_inter_lock(ap_lock_t *lock) +apr_status_t destroy_inter_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if ((stat = lock_inter_cleanup(lock)) == APR_SUCCESS) { - ap_kill_cleanup(lock->cntxt, lock, lock_inter_cleanup); + apr_kill_cleanup(lock->cntxt, lock, lock_inter_cleanup); return APR_SUCCESS; } return stat; } -ap_status_t child_init_lock(ap_lock_t **lock, ap_pool_t *cont, const char *fname) +apr_status_t child_init_lock(apr_lock_t **lock, apr_pool_t *cont, const char *fname) { return APR_SUCCESS; } diff --git a/locks/beos/intraproc.c b/locks/beos/intraproc.c index 89bfc17bc..93032f561 100644 --- a/locks/beos/intraproc.c +++ b/locks/beos/intraproc.c @@ -54,9 +54,9 @@ #include "locks.h" -ap_status_t lock_intra_cleanup(void *data) +apr_status_t lock_intra_cleanup(void *data) { - ap_lock_t *lock = (ap_lock_t *)data; + apr_lock_t *lock = (apr_lock_t *)data; if (lock->curr_locked == 1) { if (atomic_add(&lock->ben_intraproc , -1) > 1){ release_sem (lock->sem_intraproc); @@ -68,11 +68,11 @@ ap_status_t lock_intra_cleanup(void *data) return APR_SUCCESS; } -ap_status_t create_intra_lock(ap_lock_t *new) +apr_status_t create_intra_lock(apr_lock_t *new) { int32 stat; - new->sem_intraproc = (sem_id)ap_palloc(new->cntxt, sizeof(sem_id)); - new->ben_intraproc = (int32)ap_palloc(new->cntxt, sizeof(int32)); + new->sem_intraproc = (sem_id)apr_palloc(new->cntxt, sizeof(sem_id)); + new->ben_intraproc = (int32)apr_palloc(new->cntxt, sizeof(int32)); if ((stat = create_sem(0, "ap_intraproc")) < B_NO_ERROR){ @@ -82,12 +82,12 @@ ap_status_t create_intra_lock(ap_lock_t *new) new->ben_intraproc = 0; new->sem_intraproc = stat; new->curr_locked = 0; - ap_register_cleanup(new->cntxt, (void *)new, lock_intra_cleanup, - ap_null_cleanup); + apr_register_cleanup(new->cntxt, (void *)new, lock_intra_cleanup, + apr_null_cleanup); return APR_SUCCESS; } -ap_status_t lock_intra(ap_lock_t *lock) +apr_status_t lock_intra(apr_lock_t *lock) { int32 stat; @@ -101,7 +101,7 @@ ap_status_t lock_intra(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t unlock_intra(ap_lock_t *lock) +apr_status_t unlock_intra(apr_lock_t *lock) { int32 stat; @@ -115,11 +115,11 @@ ap_status_t unlock_intra(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t destroy_intra_lock(ap_lock_t *lock) +apr_status_t destroy_intra_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if ((stat = lock_intra_cleanup(lock)) == APR_SUCCESS) { - ap_kill_cleanup(lock->cntxt, lock, lock_intra_cleanup); + apr_kill_cleanup(lock->cntxt, lock, lock_intra_cleanup); return APR_SUCCESS; } return stat; diff --git a/locks/beos/locks.c b/locks/beos/locks.c index 18c9ebea9..37dbd236e 100644 --- a/locks/beos/locks.c +++ b/locks/beos/locks.c @@ -54,14 +54,14 @@ #include "locks.h" -ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, - ap_lockscope_e scope, const char *fname, - ap_pool_t *cont) +apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, + apr_lockscope_e scope, const char *fname, + apr_pool_t *cont) { - ap_lock_t *new; - ap_status_t stat; + apr_lock_t *new; + apr_status_t stat; - new = (ap_lock_t *)ap_palloc(cont, sizeof(ap_lock_t)); + new = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t)); if (new == NULL){ return APR_ENOMEM; } @@ -69,7 +69,7 @@ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, new->cntxt = cont; new->type = type; new->scope = scope; - new->fname = ap_pstrdup(cont, fname); + new->fname = apr_pstrdup(cont, fname); if (scope != APR_CROSS_PROCESS) { if ((stat = create_intra_lock(new)) != APR_SUCCESS) { @@ -85,9 +85,9 @@ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, return APR_SUCCESS; } -ap_status_t ap_lock(ap_lock_t *lock) +apr_status_t apr_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if (lock->scope != APR_CROSS_PROCESS) { if ((stat = lock_intra(lock)) != APR_SUCCESS) { @@ -102,9 +102,9 @@ ap_status_t ap_lock(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_unlock(ap_lock_t *lock) +apr_status_t apr_unlock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if (lock->scope != APR_CROSS_PROCESS) { if ((stat = unlock_intra(lock)) != APR_SUCCESS) { return stat; @@ -118,9 +118,9 @@ ap_status_t ap_unlock(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_destroy_lock(ap_lock_t *lock) +apr_status_t apr_destroy_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if (lock->scope != APR_CROSS_PROCESS) { if ((stat = destroy_intra_lock(lock)) != APR_SUCCESS) { return stat; @@ -134,10 +134,10 @@ ap_status_t ap_destroy_lock(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, - ap_pool_t *cont) +apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, + apr_pool_t *cont) { - ap_status_t stat; + apr_status_t stat; if ((*lock)->scope != APR_CROSS_PROCESS) { if ((stat = child_init_lock(lock, cont, fname)) != APR_SUCCESS) { return stat; @@ -146,14 +146,14 @@ ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, return APR_SUCCESS; } -ap_status_t ap_get_lockdata(ap_lock_t *lock, const char *key, void *data) +apr_status_t apr_get_lockdata(apr_lock_t *lock, const char *key, void *data) { - return ap_get_userdata(data, key, lock->cntxt); + return apr_get_userdata(data, key, lock->cntxt); } -ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, const char *key, - ap_status_t (*cleanup) (void *)) +apr_status_t apr_set_lockdata(apr_lock_t *lock, void *data, const char *key, + apr_status_t (*cleanup) (void *)) { - return ap_set_userdata(data, key, cleanup, lock->cntxt); + return apr_set_userdata(data, key, cleanup, lock->cntxt); } diff --git a/locks/beos/locks.h b/locks/beos/locks.h index fefc0d30a..685f8a89b 100644 --- a/locks/beos/locks.h +++ b/locks/beos/locks.h @@ -61,10 +61,10 @@ #include "apr_general.h" #include "apr_lib.h" -struct ap_lock_t { - ap_pool_t *cntxt; - ap_locktype_e type; - ap_lockscope_e scope; +struct apr_lock_t { + apr_pool_t *cntxt; + apr_locktype_e type; + apr_lockscope_e scope; int curr_locked; char *fname; /* Inter proc */ @@ -75,17 +75,17 @@ struct ap_lock_t { int32 ben_intraproc; }; -ap_status_t create_intra_lock(struct ap_lock_t *new); -ap_status_t lock_intra(struct ap_lock_t *lock); -ap_status_t unlock_intra(struct ap_lock_t *lock); -ap_status_t destroy_intra_lock(struct ap_lock_t *lock); +apr_status_t create_intra_lock(struct apr_lock_t *new); +apr_status_t lock_intra(struct apr_lock_t *lock); +apr_status_t unlock_intra(struct apr_lock_t *lock); +apr_status_t destroy_intra_lock(struct apr_lock_t *lock); -ap_status_t create_inter_lock(struct ap_lock_t *new); -ap_status_t lock_inter(struct ap_lock_t *lock); -ap_status_t unlock_inter(struct ap_lock_t *lock); -ap_status_t destroy_inter_lock(struct ap_lock_t *lock); +apr_status_t create_inter_lock(struct apr_lock_t *new); +apr_status_t lock_inter(struct apr_lock_t *lock); +apr_status_t unlock_inter(struct apr_lock_t *lock); +apr_status_t destroy_inter_lock(struct apr_lock_t *lock); -ap_status_t child_init_lock(struct ap_lock_t **lock, ap_pool_t *cont, +apr_status_t child_init_lock(struct apr_lock_t **lock, apr_pool_t *cont, const char *fname); diff --git a/locks/os2/locks.c b/locks/os2/locks.c index dc288b6c9..60184795a 100644 --- a/locks/os2/locks.c +++ b/locks/os2/locks.c @@ -69,54 +69,54 @@ void setup_lock() -static ap_status_t lock_cleanup(void *thelock) +static apr_status_t lock_cleanup(void *thelock) { - ap_lock_t *lock = thelock; - return ap_destroy_lock(lock); + apr_lock_t *lock = thelock; + return apr_destroy_lock(lock); } -ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, ap_lockscope_e scope, - const char *fname, ap_pool_t *cont) +apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, + const char *fname, apr_pool_t *cont) { - ap_lock_t *new; + apr_lock_t *new; ULONG rc; char *semname; PIB *ppib; - new = (ap_lock_t *)ap_palloc(cont, sizeof(ap_lock_t)); + new = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t)); new->cntxt = cont; new->type = type; new->scope = scope; new->owner = 0; new->lock_count = 0; - new->fname = ap_pstrdup(cont, fname); + new->fname = apr_pstrdup(cont, fname); DosGetInfoBlocks(&(new->tib), &ppib); if (fname == NULL) semname = NULL; else - semname = ap_pstrcat(cont, "/SEM32/", fname, NULL); + semname = apr_pstrcat(cont, "/SEM32/", fname, NULL); rc = DosCreateMutexSem(semname, &(new->hMutex), scope == APR_CROSS_PROCESS ? DC_SEM_SHARED : 0, FALSE); *lock = new; if (!rc) - ap_register_cleanup(cont, new, lock_cleanup, ap_null_cleanup); + apr_register_cleanup(cont, new, lock_cleanup, apr_null_cleanup); return APR_OS2_STATUS(rc); } -ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, - ap_pool_t *cont) +apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, + apr_pool_t *cont) { int rc; PIB *ppib; - *lock = (ap_lock_t *)ap_palloc(cont, sizeof(ap_lock_t)); + *lock = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t)); if (lock == NULL) return APR_ENOMEM; @@ -127,14 +127,14 @@ ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, rc = DosOpenMutexSem( (char *)fname, &(*lock)->hMutex ); if (!rc) - ap_register_cleanup(cont, *lock, lock_cleanup, ap_null_cleanup); + apr_register_cleanup(cont, *lock, lock_cleanup, apr_null_cleanup); return APR_OS2_STATUS(rc); } -ap_status_t ap_lock(ap_lock_t *lock) +apr_status_t apr_lock(apr_lock_t *lock) { ULONG rc; @@ -150,7 +150,7 @@ ap_status_t ap_lock(ap_lock_t *lock) -ap_status_t ap_unlock(ap_lock_t *lock) +apr_status_t apr_unlock(apr_lock_t *lock) { ULONG rc; @@ -165,14 +165,14 @@ ap_status_t ap_unlock(ap_lock_t *lock) -ap_status_t ap_destroy_lock(ap_lock_t *lock) +apr_status_t apr_destroy_lock(apr_lock_t *lock) { ULONG rc; - ap_status_t stat = APR_SUCCESS; + apr_status_t stat = APR_SUCCESS; if (lock->owner == CurrentTid) { while (lock->lock_count > 0 && stat == APR_SUCCESS) - stat = ap_unlock(lock); + stat = apr_unlock(lock); } if (stat != APR_SUCCESS) diff --git a/locks/os2/locks.h b/locks/os2/locks.h index d416b6b08..50ffdc652 100644 --- a/locks/os2/locks.h +++ b/locks/os2/locks.h @@ -60,10 +60,10 @@ #define INCL_DOS #include <os2.h> -struct ap_lock_t { - ap_pool_t *cntxt; - ap_locktype_e type; - ap_lockscope_e scope; +struct apr_lock_t { + apr_pool_t *cntxt; + apr_locktype_e type; + apr_lockscope_e scope; char *fname; HMTX hMutex; TID owner; diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index 556e8443f..f140183e1 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -61,7 +61,7 @@ static struct sembuf op_on; static struct sembuf op_off; -void ap_unix_setup_lock(void) +void apr_unix_setup_lock(void) { op_on.sem_num = 0; op_on.sem_op = -1; @@ -71,9 +71,9 @@ void ap_unix_setup_lock(void) op_off.sem_flg = SEM_UNDO; } -static ap_status_t lock_cleanup(void *lock_) +static apr_status_t lock_cleanup(void *lock_) { - ap_lock_t *lock=lock_; + apr_lock_t *lock=lock_; union semun ick; if (lock->interproc != -1) { @@ -83,7 +83,7 @@ static ap_status_t lock_cleanup(void *lock_) return APR_SUCCESS; } -ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) +apr_status_t apr_unix_create_inter_lock(apr_lock_t *new) { union semun ick; @@ -99,11 +99,11 @@ ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) return errno; } new->curr_locked = 0; - ap_register_cleanup(new->cntxt, (void *)new, lock_cleanup, ap_null_cleanup); + apr_register_cleanup(new->cntxt, (void *)new, lock_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_unix_lock_inter(ap_lock_t *lock) +apr_status_t apr_unix_lock_inter(apr_lock_t *lock) { int rc; @@ -117,7 +117,7 @@ ap_status_t ap_unix_lock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) +apr_status_t apr_unix_unlock_inter(apr_lock_t *lock) { int rc; @@ -131,32 +131,32 @@ ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_unix_destroy_inter_lock(ap_lock_t *lock) +apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if ((stat = lock_cleanup(lock)) == APR_SUCCESS) { - ap_kill_cleanup(lock->cntxt, lock, lock_cleanup); + apr_kill_cleanup(lock->cntxt, lock, lock_cleanup); return APR_SUCCESS; } return stat; } -ap_status_t ap_unix_child_init_lock(ap_lock_t **lock, ap_pool_t *cont, const char *fname) +apr_status_t apr_unix_child_init_lock(apr_lock_t **lock, apr_pool_t *cont, const char *fname) { return APR_SUCCESS; } #elif (APR_USE_PROC_PTHREAD_SERIALIZE) -void ap_unix_setup_lock(void) +void apr_unix_setup_lock(void) { } -static ap_status_t lock_cleanup(void *lock_) +static apr_status_t lock_cleanup(void *lock_) { - ap_lock_t *lock=lock_; - ap_status_t stat; + apr_lock_t *lock=lock_; + apr_status_t stat; if (lock->curr_locked == 1) { if ((stat = pthread_mutex_unlock(lock->interproc))) { @@ -172,9 +172,9 @@ static ap_status_t lock_cleanup(void *lock_) return APR_SUCCESS; } -ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) +apr_status_t apr_unix_create_inter_lock(apr_lock_t *new) { - ap_status_t stat; + apr_status_t stat; int fd; pthread_mutexattr_t mattr; @@ -222,13 +222,13 @@ ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) } new->curr_locked = 0; - ap_register_cleanup(new->cntxt, (void *)new, lock_cleanup, ap_null_cleanup); + apr_register_cleanup(new->cntxt, (void *)new, lock_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_unix_lock_inter(ap_lock_t *lock) +apr_status_t apr_unix_lock_inter(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if ((stat = pthread_mutex_lock(lock->interproc))) { #ifdef PTHREAD_SETS_ERRNO @@ -240,9 +240,9 @@ ap_status_t ap_unix_lock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) +apr_status_t apr_unix_unlock_inter(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if ((stat = pthread_mutex_unlock(lock->interproc))) { #ifdef PTHREAD_SETS_ERRNO @@ -254,17 +254,17 @@ ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_unix_destroy_inter_lock(ap_lock_t *lock) +apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if ((stat = lock_cleanup(lock)) == APR_SUCCESS) { - ap_kill_cleanup(lock->cntxt, lock, lock_cleanup); + apr_kill_cleanup(lock->cntxt, lock, lock_cleanup); return APR_SUCCESS; } return stat; } -ap_status_t ap_unix_child_init_lock(ap_lock_t **lock, ap_pool_t *cont, const char *fname) +apr_status_t apr_unix_child_init_lock(apr_lock_t **lock, apr_pool_t *cont, const char *fname) { return APR_SUCCESS; } @@ -274,7 +274,7 @@ ap_status_t ap_unix_child_init_lock(ap_lock_t **lock, ap_pool_t *cont, const cha static struct flock lock_it; static struct flock unlock_it; -void ap_unix_setup_lock(void) +void apr_unix_setup_lock(void) { lock_it.l_whence = SEEK_SET; /* from current point */ lock_it.l_start = 0; /* -"- */ @@ -288,23 +288,23 @@ void ap_unix_setup_lock(void) unlock_it.l_pid = 0; /* pid not actually interesting */ } -static ap_status_t lock_cleanup(void *lock_) +static apr_status_t lock_cleanup(void *lock_) { - ap_lock_t *lock=lock_; + apr_lock_t *lock=lock_; if (lock->curr_locked == 1) { - return ap_unix_unlock_inter(lock); + return apr_unix_unlock_inter(lock); } return APR_SUCCESS; } -ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) +apr_status_t apr_unix_create_inter_lock(apr_lock_t *new) { if (new->fname) { new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0644); } else { - new->fname = ap_pstrdup(new->cntxt, "/tmp/aprXXXXXX"); + new->fname = apr_pstrdup(new->cntxt, "/tmp/aprXXXXXX"); new->interproc = mkstemp(new->fname); } @@ -315,11 +315,11 @@ ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) new->curr_locked=0; unlink(new->fname); - ap_register_cleanup(new->cntxt, new, lock_cleanup, ap_null_cleanup); + apr_register_cleanup(new->cntxt, new, lock_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_unix_lock_inter(ap_lock_t *lock) +apr_status_t apr_unix_lock_inter(apr_lock_t *lock) { int rc; @@ -333,7 +333,7 @@ ap_status_t ap_unix_lock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) +apr_status_t apr_unix_unlock_inter(apr_lock_t *lock) { int rc; @@ -347,17 +347,17 @@ ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_unix_destroy_inter_lock(ap_lock_t *lock) +apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if ((stat = lock_cleanup(lock)) == APR_SUCCESS) { - ap_kill_cleanup(lock->cntxt, lock, lock_cleanup); + apr_kill_cleanup(lock->cntxt, lock, lock_cleanup); return APR_SUCCESS; } return stat; } -ap_status_t ap_unix_child_init_lock(ap_lock_t **lock, ap_pool_t *cont, +apr_status_t apr_unix_child_init_lock(apr_lock_t **lock, apr_pool_t *cont, const char *fname) { return APR_SUCCESS; @@ -365,28 +365,28 @@ ap_status_t ap_unix_child_init_lock(ap_lock_t **lock, ap_pool_t *cont, #elif (APR_USE_FLOCK_SERIALIZE) -void ap_unix_setup_lock(void) +void apr_unix_setup_lock(void) { } -static ap_status_t lock_cleanup(void *lock_) +static apr_status_t lock_cleanup(void *lock_) { - ap_lock_t *lock=lock_; + apr_lock_t *lock=lock_; if (lock->curr_locked == 1) { - return ap_unix_unlock_inter(lock); + return apr_unix_unlock_inter(lock); } unlink(lock->fname); return APR_SUCCESS; } -ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) +apr_status_t apr_unix_create_inter_lock(apr_lock_t *new) { if (new->fname) { new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0600); } else { - new->fname = ap_pstrdup(new->cntxt, "/tmp/aprXXXXXX"); + new->fname = apr_pstrdup(new->cntxt, "/tmp/aprXXXXXX"); new->interproc = mkstemp(new->fname); } @@ -395,11 +395,11 @@ ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) return errno; } new->curr_locked = 0; - ap_register_cleanup(new->cntxt, (void *)new, lock_cleanup, ap_null_cleanup); + apr_register_cleanup(new->cntxt, (void *)new, lock_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_unix_lock_inter(ap_lock_t *lock) +apr_status_t apr_unix_lock_inter(apr_lock_t *lock) { int rc; @@ -413,7 +413,7 @@ ap_status_t ap_unix_lock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) +apr_status_t apr_unix_unlock_inter(apr_lock_t *lock) { int rc; @@ -427,27 +427,27 @@ ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_unix_destroy_inter_lock(ap_lock_t *lock) +apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if ((stat = lock_cleanup(lock)) == APR_SUCCESS) { - ap_kill_cleanup(lock->cntxt, lock, lock_cleanup); + apr_kill_cleanup(lock->cntxt, lock, lock_cleanup); return APR_SUCCESS; } return stat; } -ap_status_t ap_unix_child_init_lock(ap_lock_t **lock, ap_pool_t *cont, +apr_status_t apr_unix_child_init_lock(apr_lock_t **lock, apr_pool_t *cont, const char *fname) { - ap_lock_t *new; + apr_lock_t *new; - new = (ap_lock_t *)ap_palloc(cont, sizeof(ap_lock_t)); + new = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t)); - new->fname = ap_pstrdup(cont, fname); + new->fname = apr_pstrdup(cont, fname); new->interproc = open(new->fname, O_WRONLY, 0600); if (new->interproc == -1) { - ap_unix_destroy_inter_lock(new); + apr_unix_destroy_inter_lock(new); return errno; } *lock = new; diff --git a/locks/unix/intraproc.c b/locks/unix/intraproc.c index e598e56e3..3b5b9a97e 100644 --- a/locks/unix/intraproc.c +++ b/locks/unix/intraproc.c @@ -58,10 +58,10 @@ #if (APR_USE_PTHREAD_SERIALIZE) -static ap_status_t lock_intra_cleanup(void *data) +static apr_status_t lock_intra_cleanup(void *data) { - ap_lock_t *lock = (ap_lock_t *) data; - ap_status_t stat; + apr_lock_t *lock = (apr_lock_t *) data; + apr_status_t stat; stat = pthread_mutex_unlock(lock->intraproc); #ifdef PTHREAD_SETS_ERRNO @@ -72,12 +72,12 @@ static ap_status_t lock_intra_cleanup(void *data) return stat; } -ap_status_t ap_unix_create_intra_lock(ap_lock_t *new) +apr_status_t apr_unix_create_intra_lock(apr_lock_t *new) { - ap_status_t stat; + apr_status_t stat; pthread_mutexattr_t mattr; - new->intraproc = (pthread_mutex_t *)ap_palloc(new->cntxt, + new->intraproc = (pthread_mutex_t *)apr_palloc(new->cntxt, sizeof(pthread_mutex_t)); if (new->intraproc == NULL ) { return errno; @@ -107,14 +107,14 @@ ap_status_t ap_unix_create_intra_lock(ap_lock_t *new) } new->curr_locked = 0; - ap_register_cleanup(new->cntxt, (void *)new, lock_intra_cleanup, - ap_null_cleanup); + apr_register_cleanup(new->cntxt, (void *)new, lock_intra_cleanup, + apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_unix_lock_intra(ap_lock_t *lock) +apr_status_t apr_unix_lock_intra(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; stat = pthread_mutex_lock(lock->intraproc); #ifdef PTHREAD_SETS_ERRNO @@ -125,9 +125,9 @@ ap_status_t ap_unix_lock_intra(ap_lock_t *lock) return stat; } -ap_status_t ap_unix_unlock_intra(ap_lock_t *lock) +apr_status_t apr_unix_unlock_intra(apr_lock_t *lock) { - ap_status_t status; + apr_status_t status; status = pthread_mutex_unlock(lock->intraproc); #ifdef PTHREAD_SETS_ERRNO @@ -138,11 +138,11 @@ ap_status_t ap_unix_unlock_intra(ap_lock_t *lock) return status; } -ap_status_t ap_unix_destroy_intra_lock(ap_lock_t *lock) +apr_status_t apr_unix_destroy_intra_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if ((stat = lock_intra_cleanup(lock)) == APR_SUCCESS) { - ap_kill_cleanup(lock->cntxt, lock, lock_intra_cleanup); + apr_kill_cleanup(lock->cntxt, lock, lock_intra_cleanup); return APR_SUCCESS; } return stat; diff --git a/locks/unix/locks.c b/locks/unix/locks.c index 3e25cc67e..44feb31fa 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -56,14 +56,14 @@ #include "apr_strings.h" #include "apr_portable.h" -ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, - ap_lockscope_e scope, const char *fname, - ap_pool_t *cont) +apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, + apr_lockscope_e scope, const char *fname, + apr_pool_t *cont) { - ap_lock_t *new; - ap_status_t stat; + apr_lock_t *new; + apr_status_t stat; - new = (ap_lock_t *)ap_pcalloc(cont, sizeof(ap_lock_t)); + new = (apr_lock_t *)apr_pcalloc(cont, sizeof(apr_lock_t)); new->cntxt = cont; new->type = type; @@ -72,14 +72,14 @@ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, /* file-based serialization primitives */ if (scope != APR_INTRAPROCESS) { if (fname != NULL) { - new->fname = ap_pstrdup(cont, fname); + new->fname = apr_pstrdup(cont, fname); } } #endif if (scope != APR_CROSS_PROCESS) { #if APR_HAS_THREADS - if ((stat = ap_unix_create_intra_lock(new)) != APR_SUCCESS) { + if ((stat = apr_unix_create_intra_lock(new)) != APR_SUCCESS) { return stat; } #else @@ -87,7 +87,7 @@ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, #endif } if (scope != APR_INTRAPROCESS) { - if ((stat = ap_unix_create_inter_lock(new)) != APR_SUCCESS) { + if ((stat = apr_unix_create_inter_lock(new)) != APR_SUCCESS) { return stat; } } @@ -95,12 +95,12 @@ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, return APR_SUCCESS; } -ap_status_t ap_lock(ap_lock_t *lock) +apr_status_t apr_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if (lock->scope != APR_CROSS_PROCESS) { #if APR_HAS_THREADS - if ((stat = ap_unix_lock_intra(lock)) != APR_SUCCESS) { + if ((stat = apr_unix_lock_intra(lock)) != APR_SUCCESS) { return stat; } #else @@ -108,20 +108,20 @@ ap_status_t ap_lock(ap_lock_t *lock) #endif } if (lock->scope != APR_INTRAPROCESS) { - if ((stat = ap_unix_lock_inter(lock)) != APR_SUCCESS) { + if ((stat = apr_unix_lock_inter(lock)) != APR_SUCCESS) { return stat; } } return APR_SUCCESS; } -ap_status_t ap_unlock(ap_lock_t *lock) +apr_status_t apr_unlock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if (lock->scope != APR_CROSS_PROCESS) { #if APR_HAS_THREADS - if ((stat = ap_unix_unlock_intra(lock)) != APR_SUCCESS) { + if ((stat = apr_unix_unlock_intra(lock)) != APR_SUCCESS) { return stat; } #else @@ -129,19 +129,19 @@ ap_status_t ap_unlock(ap_lock_t *lock) #endif } if (lock->scope != APR_INTRAPROCESS) { - if ((stat = ap_unix_unlock_inter(lock)) != APR_SUCCESS) { + if ((stat = apr_unix_unlock_inter(lock)) != APR_SUCCESS) { return stat; } } return APR_SUCCESS; } -ap_status_t ap_destroy_lock(ap_lock_t *lock) +apr_status_t apr_destroy_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if (lock->scope != APR_CROSS_PROCESS) { #if APR_HAS_THREADS - if ((stat = ap_unix_destroy_intra_lock(lock)) != APR_SUCCESS) { + if ((stat = apr_unix_destroy_intra_lock(lock)) != APR_SUCCESS) { return stat; } #else @@ -149,37 +149,37 @@ ap_status_t ap_destroy_lock(ap_lock_t *lock) #endif } if (lock->scope != APR_INTRAPROCESS) { - if ((stat = ap_unix_destroy_inter_lock(lock)) != APR_SUCCESS) { + if ((stat = apr_unix_destroy_inter_lock(lock)) != APR_SUCCESS) { return stat; } } return APR_SUCCESS; } -ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, - ap_pool_t *cont) +apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, + apr_pool_t *cont) { - ap_status_t stat; + apr_status_t stat; if ((*lock)->scope != APR_INTRAPROCESS) { - if ((stat = ap_unix_child_init_lock(lock, cont, fname)) != APR_SUCCESS) { + if ((stat = apr_unix_child_init_lock(lock, cont, fname)) != APR_SUCCESS) { return stat; } } return APR_SUCCESS; } -ap_status_t ap_get_lockdata(ap_lock_t *lock, const char *key, void *data) +apr_status_t apr_get_lockdata(apr_lock_t *lock, const char *key, void *data) { - return ap_get_userdata(data, key, lock->cntxt); + return apr_get_userdata(data, key, lock->cntxt); } -ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, const char *key, - ap_status_t (*cleanup) (void *)) +apr_status_t apr_set_lockdata(apr_lock_t *lock, void *data, const char *key, + apr_status_t (*cleanup) (void *)) { - return ap_set_userdata(data, key, cleanup, lock->cntxt); + return apr_set_userdata(data, key, cleanup, lock->cntxt); } -ap_status_t ap_get_os_lock(ap_os_lock_t *oslock, ap_lock_t *lock) +apr_status_t apr_get_os_lock(apr_os_lock_t *oslock, apr_lock_t *lock) { oslock->crossproc = lock->interproc; #if APR_HAS_THREADS @@ -191,14 +191,14 @@ ap_status_t ap_get_os_lock(ap_os_lock_t *oslock, ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_put_os_lock(ap_lock_t **lock, ap_os_lock_t *thelock, - ap_pool_t *cont) +apr_status_t apr_put_os_lock(apr_lock_t **lock, apr_os_lock_t *thelock, + apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; } if ((*lock) == NULL) { - (*lock) = (ap_lock_t *)ap_pcalloc(cont, sizeof(ap_lock_t)); + (*lock) = (apr_lock_t *)apr_pcalloc(cont, sizeof(apr_lock_t)); (*lock)->cntxt = cont; } (*lock)->interproc = thelock->crossproc; diff --git a/locks/unix/locks.h b/locks/unix/locks.h index d6ecae5db..321cdd18a 100644 --- a/locks/unix/locks.h +++ b/locks/unix/locks.h @@ -112,10 +112,10 @@ union semun { }; #endif -struct ap_lock_t { - ap_pool_t *cntxt; - ap_locktype_e type; - ap_lockscope_e scope; +struct apr_lock_t { + apr_pool_t *cntxt; + apr_locktype_e type; + apr_lockscope_e scope; int curr_locked; char *fname; #if APR_USE_SYSVSEM_SERIALIZE @@ -142,19 +142,19 @@ struct ap_lock_t { }; #if APR_HAS_THREADS -ap_status_t ap_unix_create_intra_lock(struct ap_lock_t *new); -ap_status_t ap_unix_lock_intra(struct ap_lock_t *lock); -ap_status_t ap_unix_unlock_intra(struct ap_lock_t *lock); -ap_status_t ap_unix_destroy_intra_lock(struct ap_lock_t *lock); +apr_status_t apr_unix_create_intra_lock(struct apr_lock_t *new); +apr_status_t apr_unix_lock_intra(struct apr_lock_t *lock); +apr_status_t apr_unix_unlock_intra(struct apr_lock_t *lock); +apr_status_t apr_unix_destroy_intra_lock(struct apr_lock_t *lock); #endif -void ap_unix_setup_lock(void); -ap_status_t ap_unix_create_inter_lock(struct ap_lock_t *new); -ap_status_t ap_unix_lock_inter(struct ap_lock_t *lock); -ap_status_t ap_unix_unlock_inter(struct ap_lock_t *lock); -ap_status_t ap_unix_destroy_inter_lock(struct ap_lock_t *lock); +void apr_unix_setup_lock(void); +apr_status_t apr_unix_create_inter_lock(struct apr_lock_t *new); +apr_status_t apr_unix_lock_inter(struct apr_lock_t *lock); +apr_status_t apr_unix_unlock_inter(struct apr_lock_t *lock); +apr_status_t apr_unix_destroy_inter_lock(struct apr_lock_t *lock); -ap_status_t ap_unix_child_init_lock(struct ap_lock_t **lock, ap_pool_t *cont, +apr_status_t apr_unix_child_init_lock(struct apr_lock_t **lock, apr_pool_t *cont, const char *fname); #endif /* LOCKS_H */ diff --git a/locks/win32/locks.c b/locks/win32/locks.c index 22f53b7b5..f499be5cf 100644 --- a/locks/win32/locks.c +++ b/locks/win32/locks.c @@ -57,20 +57,20 @@ #include "locks.h" #include "apr_portable.h" -ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, - ap_lockscope_e scope, const char *fname, - ap_pool_t *cont) +apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, + apr_lockscope_e scope, const char *fname, + apr_pool_t *cont) { - ap_lock_t *newlock; + apr_lock_t *newlock; SECURITY_ATTRIBUTES sec; - newlock = (ap_lock_t *)ap_palloc(cont, sizeof(ap_lock_t)); + newlock = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t)); newlock->cntxt = cont; /* ToDo: How to handle the case when no context is available? * How to cleanup the storage properly? */ - newlock->fname = ap_pstrdup(cont, fname); + newlock->fname = apr_pstrdup(cont, fname); newlock->type = type; newlock->scope = scope; sec.nLength = sizeof(SECURITY_ATTRIBUTES); @@ -92,18 +92,18 @@ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, return APR_SUCCESS; } -ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, - ap_pool_t *cont) +apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, + apr_pool_t *cont) { /* This routine should not be called (and OpenMutex will fail if called) * on a INTRAPROCESS lock */ - (*lock) = (ap_lock_t *)ap_palloc(cont, sizeof(ap_lock_t)); + (*lock) = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t)); if ((*lock) == NULL) { return APR_ENOMEM; } - (*lock)->fname = ap_pstrdup(cont, fname); + (*lock)->fname = apr_pstrdup(cont, fname); (*lock)->mutex = OpenMutex(MUTEX_ALL_ACCESS, TRUE, fname); if ((*lock)->mutex == NULL) { @@ -112,7 +112,7 @@ ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, return APR_SUCCESS; } -ap_status_t ap_lock(ap_lock_t *lock) +apr_status_t apr_lock(apr_lock_t *lock) { DWORD rv; if (lock->scope == APR_INTRAPROCESS) { @@ -128,7 +128,7 @@ ap_status_t ap_lock(ap_lock_t *lock) return GetLastError(); } -ap_status_t ap_unlock(ap_lock_t *lock) +apr_status_t apr_unlock(apr_lock_t *lock) { if (lock->scope == APR_INTRAPROCESS) { LeaveCriticalSection(&lock->section); @@ -141,7 +141,7 @@ ap_status_t ap_unlock(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_destroy_lock(ap_lock_t *lock) +apr_status_t apr_destroy_lock(apr_lock_t *lock) { if (lock->scope == APR_INTRAPROCESS) { DeleteCriticalSection(&lock->section); @@ -154,31 +154,31 @@ ap_status_t ap_destroy_lock(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_get_lockdata(ap_lock_t *lock, const char *key, void *data) +apr_status_t apr_get_lockdata(apr_lock_t *lock, const char *key, void *data) { - return ap_get_userdata(data, key, lock->cntxt); + return apr_get_userdata(data, key, lock->cntxt); } -ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, const char *key, - ap_status_t (*cleanup) (void *)) +apr_status_t apr_set_lockdata(apr_lock_t *lock, void *data, const char *key, + apr_status_t (*cleanup) (void *)) { - return ap_set_userdata(data, key, cleanup, lock->cntxt); + return apr_set_userdata(data, key, cleanup, lock->cntxt); } -ap_status_t ap_get_os_lock(ap_os_lock_t *thelock, ap_lock_t *lock) +apr_status_t apr_get_os_lock(apr_os_lock_t *thelock, apr_lock_t *lock) { *thelock = lock->mutex; return APR_SUCCESS; } -ap_status_t ap_put_os_lock(ap_lock_t **lock, ap_os_lock_t *thelock, - ap_pool_t *cont) +apr_status_t apr_put_os_lock(apr_lock_t **lock, apr_os_lock_t *thelock, + apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; } if ((*lock) == NULL) { - (*lock) = (ap_lock_t *)ap_palloc(cont, sizeof(ap_lock_t)); + (*lock) = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t)); (*lock)->cntxt = cont; } (*lock)->mutex = *thelock; diff --git a/locks/win32/locks.h b/locks/win32/locks.h index 602c2eb67..a7515f238 100644 --- a/locks/win32/locks.h +++ b/locks/win32/locks.h @@ -57,10 +57,10 @@ #include "apr_lock.h" -struct ap_lock_t { - ap_pool_t *cntxt; - ap_locktype_e type; - ap_lockscope_e scope; +struct apr_lock_t { + apr_pool_t *cntxt; + apr_locktype_e type; + apr_lockscope_e scope; HANDLE mutex; CRITICAL_SECTION section; char *fname; diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 1bd061a49..ad6f4754c 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -102,7 +102,7 @@ /* Details of the debugging options can now be found in the developer * section of the documentaion. */ -/* magic numbers --- min free bytes to consider a free ap_pool_t block useable, +/* magic numbers --- min free bytes to consider a free apr_pool_t block useable, * and the min amount to allocate if we have to go to malloc() */ #ifndef BLOCK_MINFREE @@ -166,7 +166,7 @@ union block_hdr { char *first_avail; #ifdef POOL_DEBUG union block_hdr *global_next; - ap_pool_t *owning_pool; + apr_pool_t *owning_pool; #endif /* POOL_DEBUG */ } h; }; @@ -188,15 +188,15 @@ union block_hdr { static union block_hdr *block_freelist = NULL; #if APR_HAS_THREADS -static ap_lock_t *alloc_mutex; -static ap_lock_t *spawn_mutex; +static apr_lock_t *alloc_mutex; +static apr_lock_t *spawn_mutex; #endif #ifdef POOL_DEBUG static char *known_stack_point; static int stack_direction; static union block_hdr *global_block_list; -#define FREE_POOL ((ap_pool_t *)(-1)) +#define FREE_POOL ((apr_pool_t *)(-1)) #endif /* POOL_DEBUG */ #ifdef ALLOC_STATS @@ -322,7 +322,7 @@ static void free_blocks(union block_hdr *blok) } #if APR_HAS_THREADS - ap_lock(alloc_mutex); + apr_lock(alloc_mutex); #endif old_free_list = block_freelist; block_freelist = blok; @@ -372,7 +372,7 @@ static void free_blocks(union block_hdr *blok) #endif /* ALLOC_STATS */ #if APR_HAS_THREADS - ap_unlock(alloc_mutex); + apr_unlock(alloc_mutex); #endif /* APR_HAS_THREADS */ #endif /* ALLOC_USE_MALLOC */ } @@ -417,9 +417,9 @@ static union block_hdr *new_block(int min_size, int (*apr_abort)(int retcode)) /* Accounting */ -static ap_size_t bytes_in_block_list(union block_hdr *blok) +static apr_size_t bytes_in_block_list(union block_hdr *blok) { - ap_size_t size = 0; + apr_size_t size = 0; while (blok) { size += blok->h.endp - (char *) (blok + 1); @@ -444,7 +444,7 @@ struct cleanup; static void run_cleanups(struct cleanup *c); static void free_proc_chain(struct process_chain *p); -static ap_pool_t *permanent_pool; +static apr_pool_t *permanent_pool; /* Each pool structure is allocated in the start of its own first block, * so we need to know how many bytes that is (once properly aligned...). @@ -453,27 +453,27 @@ static ap_pool_t *permanent_pool; * gets taken off the parent's sub-pool list... */ -#define POOL_HDR_CLICKS (1 + ((sizeof(struct ap_pool_t) - 1) / CLICK_SZ)) +#define POOL_HDR_CLICKS (1 + ((sizeof(struct apr_pool_t) - 1) / CLICK_SZ)) #define POOL_HDR_BYTES (POOL_HDR_CLICKS * CLICK_SZ) -APR_EXPORT(ap_pool_t *) ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retcode)) +APR_EXPORT(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int retcode)) { union block_hdr *blok; - ap_pool_t *new_pool; + apr_pool_t *new_pool; #if APR_HAS_THREADS - ap_lock(alloc_mutex); + apr_lock(alloc_mutex); #endif blok = new_block(POOL_HDR_BYTES, apr_abort); - new_pool = (ap_pool_t *) blok->h.first_avail; + new_pool = (apr_pool_t *) blok->h.first_avail; blok->h.first_avail += POOL_HDR_BYTES; #ifdef POOL_DEBUG blok->h.owning_pool = new_pool; #endif - memset((char *) new_pool, '\0', sizeof(struct ap_pool_t)); + memset((char *) new_pool, '\0', sizeof(struct apr_pool_t)); new_pool->free_first_avail = blok->h.first_avail; new_pool->first = new_pool->last = blok; @@ -490,7 +490,7 @@ APR_EXPORT(ap_pool_t *) ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retc } #if APR_HAS_THREADS - ap_unlock(alloc_mutex); + apr_unlock(alloc_mutex); #endif return new_pool; @@ -532,19 +532,19 @@ static void dump_stats(void) struct cleanup { const void *data; - ap_status_t (*plain_cleanup) (void *); - ap_status_t (*child_cleanup) (void *); + apr_status_t (*plain_cleanup) (void *); + apr_status_t (*child_cleanup) (void *); struct cleanup *next; }; -APR_EXPORT(void) ap_register_cleanup(ap_pool_t *p, const void *data, - ap_status_t (*plain_cleanup) (void *), - ap_status_t (*child_cleanup) (void *)) +APR_EXPORT(void) apr_register_cleanup(apr_pool_t *p, const void *data, + apr_status_t (*plain_cleanup) (void *), + apr_status_t (*child_cleanup) (void *)) { struct cleanup *c; if (p != NULL) { - c = (struct cleanup *) ap_palloc(p, sizeof(struct cleanup)); + c = (struct cleanup *) apr_palloc(p, sizeof(struct cleanup)); c->data = data; c->plain_cleanup = plain_cleanup; c->child_cleanup = child_cleanup; @@ -553,8 +553,8 @@ APR_EXPORT(void) ap_register_cleanup(ap_pool_t *p, const void *data, } } -APR_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, const void *data, - ap_status_t (*cleanup) (void *)) +APR_EXPORT(void) apr_kill_cleanup(apr_pool_t *p, const void *data, + apr_status_t (*cleanup) (void *)) { struct cleanup *c; struct cleanup **lastp; @@ -574,10 +574,10 @@ APR_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, const void *data, } } -APR_EXPORT(ap_status_t) ap_run_cleanup(ap_pool_t *p, void *data, - ap_status_t (*cleanup) (void *)) +APR_EXPORT(apr_status_t) apr_run_cleanup(apr_pool_t *p, void *data, + apr_status_t (*cleanup) (void *)) { - ap_kill_cleanup(p, data, cleanup); + apr_kill_cleanup(p, data, cleanup); return (*cleanup) (data); } @@ -597,7 +597,7 @@ static void run_child_cleanups(struct cleanup *c) } } -static void cleanup_pool_for_exec(ap_pool_t *p) +static void cleanup_pool_for_exec(apr_pool_t *p) { run_child_cleanups(p->cleanups); p->cleanups = NULL; @@ -607,7 +607,7 @@ static void cleanup_pool_for_exec(ap_pool_t *p) } } -APR_EXPORT(void) ap_cleanup_for_exec(void) +APR_EXPORT(void) apr_cleanup_for_exec(void) { #if !defined(WIN32) && !defined(OS2) /* @@ -623,16 +623,16 @@ APR_EXPORT(void) ap_cleanup_for_exec(void) #endif /* ndef WIN32 */ } -APR_EXPORT_NONSTD(ap_status_t) ap_null_cleanup(void *data) +APR_EXPORT_NONSTD(apr_status_t) apr_null_cleanup(void *data) { /* do nothing cleanup routine */ return APR_SUCCESS; } -ap_status_t ap_init_alloc(void) +apr_status_t apr_init_alloc(void) { #if APR_HAS_THREADS - ap_status_t status; + apr_status_t status; #endif #ifdef POOL_DEBUG char s; @@ -641,16 +641,16 @@ ap_status_t ap_init_alloc(void) stack_var_init(&s); #endif #if APR_HAS_THREADS - status = ap_create_lock(&alloc_mutex, APR_MUTEX, APR_INTRAPROCESS, + status = apr_create_lock(&alloc_mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, NULL); if (status != APR_SUCCESS) { - ap_destroy_lock(alloc_mutex); + apr_destroy_lock(alloc_mutex); return status; } - status = ap_create_lock(&spawn_mutex, APR_MUTEX, APR_INTRAPROCESS, + status = apr_create_lock(&spawn_mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, NULL); if (status != APR_SUCCESS) { - ap_destroy_lock(spawn_mutex); + apr_destroy_lock(spawn_mutex); return status; } #endif @@ -662,24 +662,24 @@ ap_status_t ap_init_alloc(void) return APR_SUCCESS; } -void ap_term_alloc(void) +void apr_term_alloc(void) { #if APR_HAS_THREADS - ap_destroy_lock(alloc_mutex); - ap_destroy_lock(spawn_mutex); + apr_destroy_lock(alloc_mutex); + apr_destroy_lock(spawn_mutex); #endif } -/* We only want to lock the mutex if we are being called from ap_clear_pool. +/* We only want to lock the mutex if we are being called from apr_clear_pool. * This is because if we also call this function from ap_destroy_real_pool, * which also locks the same mutex, and recursive locks aren't portable. * This way, we are garaunteed that we only lock this mutex once when calling * either one of these functions. */ -APR_EXPORT(void) ap_clear_pool(ap_pool_t *a) +APR_EXPORT(void) apr_clear_pool(apr_pool_t *a) { while (a->sub_pools) { - ap_destroy_pool(a->sub_pools); + apr_destroy_pool(a->sub_pools); } /* * Don't hold the mutex during cleanups. @@ -711,11 +711,11 @@ APR_EXPORT(void) ap_clear_pool(ap_pool_t *a) #endif } -APR_EXPORT(void) ap_destroy_pool(ap_pool_t *a) +APR_EXPORT(void) apr_destroy_pool(apr_pool_t *a) { - ap_clear_pool(a); + apr_clear_pool(a); #if APR_HAS_THREADS - ap_lock(alloc_mutex); + apr_lock(alloc_mutex); #endif if (a->parent) { @@ -730,16 +730,16 @@ APR_EXPORT(void) ap_destroy_pool(ap_pool_t *a) } } #if APR_HAS_THREADS - ap_unlock(alloc_mutex); + apr_unlock(alloc_mutex); #endif free_blocks(a->first); } -APR_EXPORT(ap_size_t) ap_bytes_in_pool(ap_pool_t *p) +APR_EXPORT(apr_size_t) apr_bytes_in_pool(apr_pool_t *p) { return bytes_in_block_list(p->first); } -APR_EXPORT(ap_size_t) ap_bytes_in_free_blocks(void) +APR_EXPORT(apr_size_t) apr_bytes_in_free_blocks(void) { return bytes_in_block_list(block_freelist); } @@ -762,7 +762,7 @@ extern char _end; /* Find the pool that ts belongs to, return NULL if it doesn't * belong to any pool. */ -APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts) +APR_EXPORT(apr_pool_t *) ap_find_pool(const void *ts) { const char *s = ts; union block_hdr **pb; @@ -808,7 +808,7 @@ APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts) /* return TRUE iff a is an ancestor of b * NULL is considered an ancestor of all pools */ -APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) +APR_EXPORT(int) ap_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) { if (a == NULL) { return 1; @@ -830,7 +830,7 @@ APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) * instead. This is a guarantee by the caller that sub will not * be destroyed before p is. */ -APR_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub) +APR_EXPORT(void) ap_pool_join(apr_pool_t *p, apr_pool_t *sub) { union block_hdr *b; @@ -857,10 +857,10 @@ APR_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub) * Allocating stuff... */ -void * ap_palloc(ap_pool_t *a, ap_size_t reqsize) +void * apr_palloc(apr_pool_t *a, apr_size_t reqsize) { #ifdef ALLOC_USE_MALLOC - ap_size_t size = reqsize + CLICK_SZ; + apr_size_t size = reqsize + CLICK_SZ; void *ptr; if (a == NULL) { @@ -884,8 +884,8 @@ void * ap_palloc(ap_pool_t *a, ap_size_t reqsize) * Round up requested size to an even number of alignment units * (core clicks) */ - ap_size_t nclicks; - ap_size_t size; + apr_size_t nclicks; + apr_size_t size; /* First, see if we have space in the block most recently * allocated to this pool @@ -919,7 +919,7 @@ void * ap_palloc(ap_pool_t *a, ap_size_t reqsize) if (new_first_avail <= blok->h.endp) { debug_verify_filled(first_avail, blok->h.endp, - "[ap_palloc] Ouch! Someone trounced past the end " + "[apr_palloc] Ouch! Someone trounced past the end " "of their allocation!\n"); blok->h.first_avail = new_first_avail; return (void *) first_avail; @@ -928,7 +928,7 @@ void * ap_palloc(ap_pool_t *a, ap_size_t reqsize) /* Nope --- get a new one that's guaranteed to be big enough */ #if APR_HAS_THREADS - ap_lock(alloc_mutex); + apr_lock(alloc_mutex); #endif blok = new_block(size, a->apr_abort); @@ -939,7 +939,7 @@ void * ap_palloc(ap_pool_t *a, ap_size_t reqsize) #endif #if APR_HAS_THREADS - ap_unlock(alloc_mutex); + apr_unlock(alloc_mutex); #endif first_avail = blok->h.first_avail; @@ -949,29 +949,29 @@ void * ap_palloc(ap_pool_t *a, ap_size_t reqsize) #endif } -APR_EXPORT(void *) ap_pcalloc(ap_pool_t *a, ap_size_t size) +APR_EXPORT(void *) apr_pcalloc(apr_pool_t *a, apr_size_t size) { - void *res = ap_palloc(a, size); + void *res = apr_palloc(a, size); memset(res, '\0', size); return res; } /* - * ap_psprintf is implemented by writing directly into the current + * apr_psprintf is implemented by writing directly into the current * block of the pool, starting right at first_avail. If there's * insufficient room, then a new block is allocated and the earlier * output is copied over. The new block isn't linked into the pool * until all the output is done. * * Note that this is completely safe because nothing else can - * allocate in this ap_pool_t while ap_psprintf is running. alarms are + * allocate in this apr_pool_t while apr_psprintf is running. alarms are * blocked, and the only thing outside of alloc.c that's invoked - * is ap_vformatter -- which was purposefully written to be + * is apr_vformatter -- which was purposefully written to be * self-contained with no callouts. */ struct psprintf_data { - ap_vformatter_buff_t vbuff; + apr_vformatter_buff_t vbuff; #ifdef ALLOC_USE_MALLOC char *base; #else @@ -980,11 +980,11 @@ struct psprintf_data { #endif }; -static int psprintf_flush(ap_vformatter_buff_t *vbuff) +static int psprintf_flush(apr_vformatter_buff_t *vbuff) { struct psprintf_data *ps = (struct psprintf_data *)vbuff; #ifdef ALLOC_USE_MALLOC - ap_size_t size; + apr_size_t size; char *ptr; size = (char *)ps->vbuff.curpos - ps->base; @@ -1000,7 +1000,7 @@ static int psprintf_flush(ap_vformatter_buff_t *vbuff) #else union block_hdr *blok; union block_hdr *nblok; - ap_size_t cur_len; + apr_size_t cur_len; char *strp; blok = ps->blok; @@ -1009,11 +1009,11 @@ static int psprintf_flush(ap_vformatter_buff_t *vbuff) /* must try another blok */ #if APR_HAS_THREADS - ap_lock(alloc_mutex); + apr_lock(alloc_mutex); #endif nblok = new_block(2 * cur_len, NULL); #if APR_HAS_THREADS - ap_unlock(alloc_mutex); + apr_unlock(alloc_mutex); #endif memcpy(nblok->h.first_avail, blok->h.first_avail, cur_len); ps->vbuff.curpos = nblok->h.first_avail + cur_len; @@ -1024,12 +1024,12 @@ static int psprintf_flush(ap_vformatter_buff_t *vbuff) if (ps->got_a_new_block) { debug_fill(blok->h.first_avail, blok->h.endp - blok->h.first_avail); #if APR_HAS_THREADS - ap_lock(alloc_mutex); + apr_lock(alloc_mutex); #endif blok->h.next = block_freelist; block_freelist = blok; #if APR_HAS_THREADS - ap_unlock(alloc_mutex); + apr_unlock(alloc_mutex); #endif } ps->blok = nblok; @@ -1042,7 +1042,7 @@ static int psprintf_flush(ap_vformatter_buff_t *vbuff) #endif } -APR_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) +APR_EXPORT(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap) { #ifdef ALLOC_USE_MALLOC struct psprintf_data ps; @@ -1056,7 +1056,7 @@ APR_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) /* need room at beginning for allocation_list */ ps.vbuff.curpos = ps.base + CLICK_SZ; ps.vbuff.endpos = ps.base + 511; - ap_vformatter(psprintf_flush, &ps.vbuff, fmt, ap); + apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap); *ps.vbuff.curpos++ = '\0'; ptr = ps.base; /* shrink */ @@ -1071,14 +1071,14 @@ APR_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) #else struct psprintf_data ps; char *strp; - ap_size_t size; + apr_size_t size; ps.blok = p->last; ps.vbuff.curpos = ps.blok->h.first_avail; ps.vbuff.endpos = ps.blok->h.endp - 1; /* save one for NUL */ ps.got_a_new_block = 0; - ap_vformatter(psprintf_flush, &ps.vbuff, fmt, ap); + apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap); strp = ps.vbuff.curpos; *strp++ = '\0'; @@ -1101,13 +1101,13 @@ APR_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) #endif } -APR_EXPORT_NONSTD(char *) ap_psprintf(ap_pool_t *p, const char *fmt, ...) +APR_EXPORT_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) { va_list ap; char *res; va_start(ap, fmt); - res = ap_pvsprintf(p, fmt, ap); + res = apr_pvsprintf(p, fmt, ap); va_end(ap); return res; } @@ -1124,11 +1124,11 @@ APR_EXPORT_NONSTD(char *) ap_psprintf(ap_pool_t *p, const char *fmt, ...) * generic interface, but for now, it's a special case */ -APR_EXPORT(void) ap_note_subprocess(ap_pool_t *a, ap_proc_t *pid, +APR_EXPORT(void) apr_note_subprocess(apr_pool_t *a, apr_proc_t *pid, enum kill_conditions how) { struct process_chain *new = - (struct process_chain *) ap_palloc(a, sizeof(struct process_chain)); + (struct process_chain *) apr_palloc(a, sizeof(struct process_chain)); new->pid = pid; new->kill_how = how; @@ -1159,7 +1159,7 @@ static void free_proc_chain(struct process_chain *procs) #ifndef NEED_WAITPID /* Pick up all defunct processes */ for (p = procs; p; p = p->next) { - if (ap_wait_proc(p->pid, APR_NOWAIT) == APR_CHILD_DONE) { + if (apr_wait_proc(p->pid, APR_NOWAIT) == APR_CHILD_DONE) { p->kill_how = kill_never; } } @@ -1170,20 +1170,20 @@ static void free_proc_chain(struct process_chain *procs) || (p->kill_how == kill_only_once)) { /* * Subprocess may be dead already. Only need the timeout if not. - * Note: ap_kill on Windows is TerminateProcess(), which is + * Note: apr_kill on Windows is TerminateProcess(), which is * similar to a SIGKILL, so always give the process a timeout * under Windows before killing it. */ #ifdef WIN32 need_timeout = 1; #else - if (ap_kill(p->pid, APR_SIGTERM) == APR_SUCCESS) { + if (apr_kill(p->pid, APR_SIGTERM) == APR_SUCCESS) { need_timeout = 1; } #endif } else if (p->kill_how == kill_always) { - ap_kill(p->pid, APR_SIGKILL); + apr_kill(p->pid, APR_SIGKILL); } } @@ -1198,7 +1198,7 @@ static void free_proc_chain(struct process_chain *procs) */ for (p = procs; p; p = p->next) { if (p->kill_how == kill_after_timeout) { - ap_kill(p->pid, APR_SIGKILL); + apr_kill(p->pid, APR_SIGKILL); } } #ifdef WIN32 @@ -1215,7 +1215,7 @@ static void free_proc_chain(struct process_chain *procs) /* Now wait for all the signaled processes to die */ for (p = procs; p; p = p->next) { if (p->kill_how != kill_never) { - (void) ap_wait_proc(p->pid, APR_WAIT); + (void) apr_wait_proc(p->pid, APR_WAIT); } } } diff --git a/misc/unix/canonerr.c b/misc/unix/canonerr.c index b2aaa6fad..15f83fabb 100644 --- a/misc/unix/canonerr.c +++ b/misc/unix/canonerr.c @@ -56,7 +56,7 @@ #ifndef OS2 -int ap_canonical_error(ap_status_t errcode) +int apr_canonical_error(apr_status_t errcode) { #if defined(EAGAIN) && defined(EWOULDBLOCK) && (EAGAIN != EWOULDBLOCK) && !defined(WIN32) if (errcode == EWOULDBLOCK) { diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index 0aee7c071..697ea0a40 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -65,16 +65,16 @@ #endif /* - * stuffbuffer - like ap_cpystrn() but returns the address of the + * stuffbuffer - like apr_cpystrn() but returns the address of the * dest buffer instead of the address of the terminating '\0' */ -static char *stuffbuffer(char *buf, ap_size_t bufsize, const char *s) +static char *stuffbuffer(char *buf, apr_size_t bufsize, const char *s) { - ap_cpystrn(buf,s,bufsize); + apr_cpystrn(buf,s,bufsize); return buf; } -static char *apr_error_string(ap_status_t statcode) +static char *apr_error_string(apr_status_t statcode) { switch (statcode) { case APR_ENOPOOL: @@ -164,7 +164,7 @@ static char *apr_error_string(ap_status_t statcode) #include <os2.h> #include <ctype.h> -static char *apr_os_strerror(char* buf, ap_size_t bufsize, int err) +static char *apr_os_strerror(char* buf, apr_size_t bufsize, int err) { char result[200]; unsigned char message[HUGE_STRING_LEN]; @@ -174,7 +174,7 @@ static char *apr_os_strerror(char* buf, ap_size_t bufsize, int err) if (err >= 10000 && err < 12000) { /* socket error codes */ return stuffbuffer(buf, bufsize, - strerror(ap_canonical_error(err+APR_OS_START_SYSERR))); + strerror(apr_canonical_error(err+APR_OS_START_SYSERR))); } else if (DosGetMessage(NULL, 0, message, HUGE_STRING_LEN, err, "OSO001.MSG", &len) == 0) { @@ -206,7 +206,7 @@ static char *apr_os_strerror(char* buf, ap_size_t bufsize, int err) #elif defined(WIN32) -static char *apr_os_strerror(char *buf, ap_size_t bufsize, ap_status_t errcode) +static char *apr_os_strerror(char *buf, apr_size_t bufsize, apr_status_t errcode) { DWORD len; DWORD i; @@ -236,7 +236,7 @@ static char *apr_os_strerror(char *buf, ap_size_t bufsize, ap_status_t errcode) else { /* Windows didn't provide us with a message. Even stuff like * WSAECONNREFUSED won't get a message. */ - ap_cpystrn(buf, "Unrecognized error code", bufsize); + apr_cpystrn(buf, "Unrecognized error code", bufsize); } return buf; @@ -246,7 +246,7 @@ static char *apr_os_strerror(char *buf, ap_size_t bufsize, ap_status_t errcode) /* On Unix, apr_os_strerror() handles error codes from the resolver * (h_errno). e*/ -static char *apr_os_strerror(char* buf, ap_size_t bufsize, int err) +static char *apr_os_strerror(char* buf, apr_size_t bufsize, int err) { #ifdef HAVE_HSTRERROR return stuffbuffer(buf, bufsize, hstrerror(err)); @@ -277,7 +277,7 @@ static char *apr_os_strerror(char* buf, ap_size_t bufsize, int err) } #endif -char *ap_strerror(ap_status_t statcode, char *buf, ap_size_t bufsize) +char *apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize) { if (statcode < APR_OS_START_ERROR) { #ifdef WIN32 diff --git a/misc/unix/getopt.c b/misc/unix/getopt.c index 3bd36c73f..bdee3afbd 100644 --- a/misc/unix/getopt.c +++ b/misc/unix/getopt.c @@ -42,9 +42,9 @@ APR_VAR_EXPORT char *ap_optarg = ""; /* argument associated with option */ #define EMSG "" -APR_EXPORT(ap_status_t) ap_getopt(ap_int32_t nargc, char *const *nargv, - const char *ostr, ap_int32_t *rv, - ap_pool_t *cont) +APR_EXPORT(apr_status_t) apr_getopt(apr_int32_t nargc, char *const *nargv, + const char *ostr, apr_int32_t *rv, + apr_pool_t *cont) { char *p; static char *place = EMSG; /* option letter processing */ diff --git a/misc/unix/misc.h b/misc/unix/misc.h index 7a3648502..f02c112dc 100644 --- a/misc/unix/misc.h +++ b/misc/unix/misc.h @@ -90,8 +90,8 @@ typedef struct datastruct { struct datastruct *prev; } datastruct; -struct ap_other_child_rec_t { - struct ap_other_child_rec_t *next; +struct apr_other_child_rec_t { + struct apr_other_child_rec_t *next; int id; /* This is either a pid or tid depending on the platform */ void (*maintenance) (int, void *, int); void *data; @@ -170,7 +170,7 @@ AP_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, ( (hFile)); #define CancelIo ap_winapi_CancelIo -ap_status_t ap_get_oslevel(struct ap_pool_t *, ap_oslevel_e *); +apr_status_t ap_get_oslevel(struct apr_pool_t *, ap_oslevel_e *); #endif /* WIN32 */ #endif /* ! MISC_H */ diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c index 401971649..61312da70 100644 --- a/misc/unix/otherchild.c +++ b/misc/unix/otherchild.c @@ -69,15 +69,15 @@ #include <sys/socket.h> /* for fd_set definition! */ #endif -static ap_other_child_rec_t *other_children = NULL; +static apr_other_child_rec_t *other_children = NULL; -APR_EXPORT(void) ap_register_other_child(ap_proc_t *pid, +APR_EXPORT(void) apr_register_other_child(apr_proc_t *pid, void (*maintenance) (int reason, void *, int status), - void *data, ap_file_t *write_fd, ap_pool_t *p) + void *data, apr_file_t *write_fd, apr_pool_t *p) { - ap_other_child_rec_t *ocr; + apr_other_child_rec_t *ocr; - ocr = ap_palloc(p, sizeof(*ocr)); + ocr = apr_palloc(p, sizeof(*ocr)); ocr->id = pid->pid; ocr->maintenance = maintenance; ocr->data = data; @@ -91,9 +91,9 @@ APR_EXPORT(void) ap_register_other_child(ap_proc_t *pid, other_children = ocr; } -APR_EXPORT(void) ap_unregister_other_child(void *data) +APR_EXPORT(void) apr_unregister_other_child(void *data) { - ap_other_child_rec_t **pocr, *nocr; + apr_other_child_rec_t **pocr, *nocr; for (pocr = &other_children; *pocr; pocr = &(*pocr)->next) { if ((*pocr)->data == data) { @@ -108,11 +108,11 @@ APR_EXPORT(void) ap_unregister_other_child(void *data) /* test to ensure that the write_fds are all still writable, otherwise * invoke the maintenance functions as appropriate */ -void ap_probe_writable_fds(void) +void apr_probe_writable_fds(void) { fd_set writable_fds; int fd_max; - ap_other_child_rec_t *ocr, *nocr; + apr_other_child_rec_t *ocr, *nocr; struct timeval tv; int rc; @@ -156,9 +156,9 @@ void ap_probe_writable_fds(void) } } -APR_EXPORT(ap_status_t) ap_reap_other_child(ap_proc_t *pid, int status) +APR_EXPORT(apr_status_t) apr_reap_other_child(apr_proc_t *pid, int status) { - ap_other_child_rec_t *ocr, *nocr; + apr_other_child_rec_t *ocr, *nocr; for (ocr = other_children; ocr; ocr = nocr) { nocr = ocr->next; @@ -172,9 +172,9 @@ APR_EXPORT(ap_status_t) ap_reap_other_child(ap_proc_t *pid, int status) return APR_CHILD_NOTDONE; } -APR_EXPORT(void) ap_check_other_child(void) +APR_EXPORT(void) apr_check_other_child(void) { - ap_other_child_rec_t *ocr, *nocr; + apr_other_child_rec_t *ocr, *nocr; pid_t waitret; int status; diff --git a/misc/unix/rand.c b/misc/unix/rand.c index aebd1d2f2..2b5b3ffb8 100644 --- a/misc/unix/rand.c +++ b/misc/unix/rand.c @@ -65,7 +65,7 @@ #define XSTR(x) #x #define STR(x) XSTR(x) -ap_status_t ap_generate_random_bytes(unsigned char * buf, int length) +apr_status_t apr_generate_random_bytes(unsigned char * buf, int length) { #ifdef DEV_RANDOM diff --git a/misc/unix/start.c b/misc/unix/start.c index 4543f5970..3f0f03fda 100644 --- a/misc/unix/start.c +++ b/misc/unix/start.c @@ -56,15 +56,15 @@ #include "locks.h" #include "apr_strings.h" -ap_status_t ap_create_pool(ap_pool_t **newcont, ap_pool_t *cont) +apr_status_t apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont) { - ap_pool_t *newpool; + apr_pool_t *newpool; if (cont) { - newpool = ap_make_sub_pool(cont, cont->apr_abort); + newpool = apr_make_sub_pool(cont, cont->apr_abort); } else { - newpool = ap_make_sub_pool(NULL, NULL); + newpool = apr_make_sub_pool(NULL, NULL); } if (newpool == NULL) { @@ -78,13 +78,13 @@ ap_status_t ap_create_pool(ap_pool_t **newcont, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_set_userdata(const void *data, const char *key, - ap_status_t (*cleanup) (void *), - ap_pool_t *cont) +apr_status_t apr_set_userdata(const void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_pool_t *cont) { datastruct *dptr = NULL, *dptr2 = NULL; - /* ### replace with an ap_hash_t */ + /* ### replace with an apr_hash_t */ dptr = cont->prog_data; while (dptr) { @@ -94,9 +94,9 @@ ap_status_t ap_set_userdata(const void *data, const char *key, dptr = dptr->next; } if (dptr == NULL) { - dptr = ap_pcalloc(cont, sizeof(datastruct)); + dptr = apr_pcalloc(cont, sizeof(datastruct)); dptr->next = dptr->prev = NULL; - dptr->key = ap_pstrdup(cont, key); + dptr->key = apr_pstrdup(cont, key); if (dptr2) { dptr2->next = dptr; dptr->prev = dptr2; @@ -106,15 +106,15 @@ ap_status_t ap_set_userdata(const void *data, const char *key, } } dptr->data = data; - ap_register_cleanup(cont, dptr->data, cleanup, cleanup); + apr_register_cleanup(cont, dptr->data, cleanup, cleanup); return APR_SUCCESS; } -ap_status_t ap_get_userdata(void **data, const char *key, ap_pool_t *cont) +apr_status_t apr_get_userdata(void **data, const char *key, apr_pool_t *cont) { datastruct *dptr = NULL; - /* ### replace with an ap_hash_t */ + /* ### replace with an apr_hash_t */ dptr = cont->prog_data; while (dptr) { @@ -135,11 +135,11 @@ ap_status_t ap_get_userdata(void **data, const char *key, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_initialize(void) +apr_status_t apr_initialize(void) { - ap_status_t status; + apr_status_t status; #if !defined(BEOS) && !defined(OS2) && !defined(WIN32) - ap_unix_setup_lock(); + apr_unix_setup_lock(); #elif defined WIN32 int iVersionRequested; WSADATA wsaData; @@ -156,16 +156,16 @@ ap_status_t ap_initialize(void) return APR_EEXIST; } #endif - status = ap_init_alloc(); + status = apr_init_alloc(); return status; } -void ap_terminate(void) +void apr_terminate(void) { - ap_term_alloc(); + apr_term_alloc(); } -ap_status_t ap_set_abort(int (*apr_abort)(int retcode), ap_pool_t *cont) +apr_status_t apr_set_abort(int (*apr_abort)(int retcode), apr_pool_t *cont) { cont->apr_abort = apr_abort; return APR_SUCCESS; diff --git a/misc/win32/misc.c b/misc/win32/misc.c index 79235604f..734c5a018 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -55,7 +55,7 @@ #include "apr_private.h" #include "misc.h" -ap_status_t ap_get_oslevel(ap_pool_t *cont, ap_oslevel_e *level) +apr_status_t ap_get_oslevel(apr_pool_t *cont, ap_oslevel_e *level) { static OSVERSIONINFO oslev; static unsigned int servpack = 0; diff --git a/misc/win32/names.c b/misc/win32/names.c index b5ca744d2..81587cf9c 100644 --- a/misc/win32/names.c +++ b/misc/win32/names.c @@ -82,7 +82,7 @@ static BOOL OnlyDots(char *pString) * is present on the existing path. This routine also * converts alias names to long names. */ -APR_EXPORT(char *) ap_os_systemcase_filename(ap_pool_t *pCont, +APR_EXPORT(char *) ap_os_systemcase_filename(apr_pool_t *pCont, const char *szFile) { char buf[HUGE_STRING_LEN]; @@ -94,10 +94,10 @@ APR_EXPORT(char *) ap_os_systemcase_filename(ap_pool_t *pCont, WIN32_FIND_DATA wfd; if (!szFile || strlen(szFile) == 0 || strlen(szFile) >= sizeof(buf)) - return ap_pstrdup(pCont, ""); + return apr_pstrdup(pCont, ""); buf[0] = '\0'; - pInputName = ap_pstrdup(pCont, szFile); + pInputName = apr_pstrdup(pCont, szFile); /* First convert all slashes to \ so Win32 calls work OK */ for (p = pInputName; *p; p++) { @@ -195,13 +195,13 @@ APR_EXPORT(char *) ap_os_systemcase_filename(ap_pool_t *pCont, *p = '/'; } - return ap_pstrdup(pCont, buf); + return apr_pstrdup(pCont, buf); } /* Perform canonicalization with the exception that the * input case is preserved. */ -char * canonical_filename(ap_pool_t *pCont, const char *szFile) +char * canonical_filename(apr_pool_t *pCont, const char *szFile) { char *pNewStr; char *s; @@ -209,9 +209,9 @@ char * canonical_filename(ap_pool_t *pCont, const char *szFile) char *q; if (szFile == NULL || strlen(szFile) == 0) - return ap_pstrdup(pCont, ""); + return apr_pstrdup(pCont, ""); - pNewStr = ap_pstrdup(pCont, szFile); + pNewStr = apr_pstrdup(pCont, szFile); /* Change all '\' characters to '/' characters. * While doing this, remove any trailing '.'. @@ -309,7 +309,7 @@ char * canonical_filename(ap_pool_t *pCont, const char *szFile) } while (p != NULL); - pNewStr = ap_pstrdup(pCont, buf); + pNewStr = apr_pstrdup(pCont, buf); } } return pNewStr; diff --git a/misc/win32/rand.c b/misc/win32/rand.c index 2c7abd595..2462b9973 100644 --- a/misc/win32/rand.c +++ b/misc/win32/rand.c @@ -56,7 +56,7 @@ #include "apr_general.h" #include <wincrypt.h> -ap_status_t ap_generate_random_bytes(unsigned char * buf, int length) +apr_status_t apr_generate_random_bytes(unsigned char * buf, int length) { HCRYPTPROV hProv; diff --git a/mmap/unix/common.c b/mmap/unix/common.c index 25597c56a..f2a84438f 100644 --- a/mmap/unix/common.c +++ b/mmap/unix/common.c @@ -68,7 +68,7 @@ #if APR_HAS_MMAP || defined(BEOS) -ap_status_t ap_mmap_offset(void **addr, ap_mmap_t *mmap, ap_off_t offset) +apr_status_t apr_mmap_offset(void **addr, apr_mmap_t *mmap, apr_off_t offset) { if (offset < 0 || offset > mmap->size) return APR_EINVAL; diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c index d708b977e..199b6fc74 100644 --- a/mmap/unix/mmap.c +++ b/mmap/unix/mmap.c @@ -79,9 +79,9 @@ #if APR_HAS_MMAP || defined(BEOS) -static ap_status_t mmap_cleanup(void *themmap) +static apr_status_t mmap_cleanup(void *themmap) { - ap_mmap_t *mm = themmap; + apr_mmap_t *mm = themmap; int rv; #ifdef BEOS rv = delete_area(mm->area); @@ -101,8 +101,8 @@ static ap_status_t mmap_cleanup(void *themmap) return errno; } -ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset, - ap_size_t size, ap_pool_t *cont) +apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, apr_off_t offset, + apr_size_t size, apr_pool_t *cont) { #ifdef BEOS void *mm; @@ -115,11 +115,11 @@ ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset, if (file == NULL || file->filedes == -1 || file->buffered) return APR_EBADF; - (*new) = (ap_mmap_t *)ap_pcalloc(cont, sizeof(ap_mmap_t)); + (*new) = (apr_mmap_t *)apr_pcalloc(cont, sizeof(apr_mmap_t)); #ifdef BEOS /* XXX: mmap shouldn't really change the seek offset */ - ap_seek(file, APR_SET, &offset); + apr_seek(file, APR_SET, &offset); pages = ((size -1) / B_PAGE_SIZE) + 1; aid = create_area(areaname, &mm , B_ANY_ADDRESS, pages * B_PAGE_SIZE, @@ -148,20 +148,20 @@ ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset, (*new)->cntxt = cont; /* register the cleanup... */ - ap_register_cleanup((*new)->cntxt, (void*)(*new), mmap_cleanup, - ap_null_cleanup); + apr_register_cleanup((*new)->cntxt, (void*)(*new), mmap_cleanup, + apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_mmap_delete(ap_mmap_t *mmap) +apr_status_t apr_mmap_delete(apr_mmap_t *mmap) { - ap_status_t rv; + apr_status_t rv; if (mmap->mm == (caddr_t) -1) return APR_ENOENT; if ((rv = mmap_cleanup(mmap)) == APR_SUCCESS) { - ap_kill_cleanup(mmap->cntxt, mmap, mmap_cleanup); + apr_kill_cleanup(mmap->cntxt, mmap, mmap_cleanup); return APR_SUCCESS; } return rv; diff --git a/network_io/beos/networkio.h b/network_io/beos/networkio.h index 3c2bcc535..4a9ef6c14 100644 --- a/network_io/beos/networkio.h +++ b/network_io/beos/networkio.h @@ -91,26 +91,26 @@ #define POLLHUP 16 #define POLLNVAL 32 -struct ap_socket_t { - ap_pool_t *cntxt; +struct apr_socket_t { + apr_pool_t *cntxt; int socketdes; struct sockaddr_in *local_addr; struct sockaddr_in *remote_addr; int addr_len; - ap_interval_time_t timeout; + apr_interval_time_t timeout; int connected; }; -struct ap_pollfd_t { - ap_pool_t *cntxt; - struct ap_socket_t *sock; +struct apr_pollfd_t { + apr_pool_t *cntxt; + struct apr_socket_t *sock; fd_set *read; fd_set *write; fd_set *except; int highsock; }; -ap_int16_t get_event(ap_int16_t); +apr_int16_t get_event(apr_int16_t); int inet_aton(const char *cp, struct in_addr *addr); #include <ByteOrder.h> /* for the ntohs definition */ diff --git a/network_io/beos/poll.c b/network_io/beos/poll.c index dffc8d43b..354de61ce 100644 --- a/network_io/beos/poll.c +++ b/network_io/beos/poll.c @@ -67,16 +67,16 @@ /* select for R4.5 of BeOS. So here we use code that uses the write */ /* bits. */ -ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_pool_t *cont) +apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) { - (*new) = (ap_pollfd_t *)ap_palloc(cont, sizeof(ap_pollfd_t) * num); + (*new) = (apr_pollfd_t *)apr_palloc(cont, sizeof(apr_pollfd_t) * num); if ((*new) == NULL) { return APR_ENOMEM; } (*new)->cntxt = cont; - (*new)->read = (fd_set *)ap_palloc(cont, sizeof(fd_set)); - (*new)->write = (fd_set *)ap_palloc(cont, sizeof(fd_set)); - (*new)->except = (fd_set *)ap_palloc(cont, sizeof(fd_set)); + (*new)->read = (fd_set *)apr_palloc(cont, sizeof(fd_set)); + (*new)->write = (fd_set *)apr_palloc(cont, sizeof(fd_set)); + (*new)->except = (fd_set *)apr_palloc(cont, sizeof(fd_set)); FD_ZERO((*new)->read); FD_ZERO((*new)->write); FD_ZERO((*new)->except); @@ -84,8 +84,8 @@ ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, - ap_socket_t *sock, ap_int16_t event) +apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, + apr_socket_t *sock, apr_int16_t event) { if (event & APR_POLLIN) { FD_SET(sock->socketdes, aprset->read); @@ -102,8 +102,8 @@ ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, return APR_SUCCESS; } -ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, - ap_interval_time_t timeout) +apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, + apr_interval_time_t timeout) { int rv; struct timeval tv, *tvptr; @@ -130,9 +130,9 @@ ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, return APR_SUCCESS; } -ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *aprset) +apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) { - ap_int16_t revents = 0; + apr_int16_t revents = 0; char data[256]; int dummy = 256; @@ -175,7 +175,7 @@ ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *ap return APR_SUCCESS; } -ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock) +apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) { FD_CLR(sock->socketdes, aprset->read); FD_CLR(sock->socketdes, aprset->read); @@ -183,7 +183,7 @@ ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock) return APR_SUCCESS; } -ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t event) +apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t event) { if (event & APR_POLLIN) { FD_ZERO(aprset->read); @@ -198,15 +198,15 @@ ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t event) return APR_SUCCESS; } -ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, const char *key, void *data) +apr_status_t apr_get_polldata(apr_pollfd_t *pollfd, const char *key, void *data) { - return ap_get_userdata(data, key, pollfd->cntxt); + return apr_get_userdata(data, key, pollfd->cntxt); } -ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, const char *key, - ap_status_t (*cleanup) (void *)) +apr_status_t apr_set_polldata(apr_pollfd_t *pollfd, void *data, const char *key, + apr_status_t (*cleanup) (void *)) { - return ap_set_userdata(data, key, cleanup, pollfd->cntxt); + return apr_set_userdata(data, key, cleanup, pollfd->cntxt); } #endif /* BEOS_BONE */ diff --git a/network_io/beos/sendrecv.c b/network_io/beos/sendrecv.c index 389bcdbd2..601881286 100644 --- a/network_io/beos/sendrecv.c +++ b/network_io/beos/sendrecv.c @@ -58,7 +58,7 @@ #else #include "networkio.h" -static ap_status_t wait_for_io_or_timeout(ap_socket_t *sock, int for_read) +static apr_status_t wait_for_io_or_timeout(apr_socket_t *sock, int for_read) { struct timeval tv, *tvptr; fd_set fdset; @@ -92,7 +92,7 @@ static ap_status_t wait_for_io_or_timeout(ap_socket_t *sock, int for_read) return APR_SUCCESS; } -ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len) +apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_ssize_t *len) { ssize_t rv; @@ -101,7 +101,7 @@ ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len) } while (rv == -1 && errno == EINTR); if (rv == -1 && errno == EWOULDBLOCK && sock->timeout > 0) { - ap_status_t arv = wait_for_io_or_timeout(sock, 0); + apr_status_t arv = wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -120,16 +120,16 @@ ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len) return APR_SUCCESS; } -ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) +apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_ssize_t *len) { - ap_ssize_t rv; + apr_ssize_t rv; do { rv = recv(sock->socketdes, buf, (*len), 0); } while (rv == -1 && errno == EINTR); if (rv == -1 && errno == EWOULDBLOCK && sock->timeout > 0) { - ap_status_t arv = wait_for_io_or_timeout(sock, 1); + apr_status_t arv = wait_for_io_or_timeout(sock, 1); if (arv != APR_SUCCESS) { *len = 0; return arv; diff --git a/network_io/beos/sockaddr.c b/network_io/beos/sockaddr.c index 57ce8343d..699b95ad8 100644 --- a/network_io/beos/sockaddr.c +++ b/network_io/beos/sockaddr.c @@ -58,7 +58,7 @@ #else #include "networkio.h" -ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port) +apr_status_t apr_set_local_port(apr_socket_t *sock, apr_uint32_t port) { if (!sock) { return APR_EBADF; @@ -67,7 +67,7 @@ ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port) return APR_SUCCESS; } -ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port) +apr_status_t apr_set_remote_port(apr_socket_t *sock, apr_uint32_t port) { if (!sock) { return APR_EBADF; @@ -76,7 +76,7 @@ ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port) return APR_SUCCESS; } -ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock) +apr_status_t apr_get_local_port(apr_uint32_t *port, apr_socket_t *sock) { if (!sock) { return APR_EBADF; @@ -85,7 +85,7 @@ ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock) return APR_SUCCESS; } -ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock) +apr_status_t apr_get_remote_port(apr_uint32_t *port, apr_socket_t *sock) { if (!sock) { return APR_EBADF; @@ -94,7 +94,7 @@ ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock) return APR_SUCCESS; } -ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, const char *addr) +apr_status_t apr_set_local_ipaddr(apr_socket_t *sock, const char *addr) { u_long ipaddr; @@ -117,7 +117,7 @@ ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, const char *addr) return APR_SUCCESS; } -ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr) +apr_status_t apr_set_remote_ipaddr(apr_socket_t *sock, const char *addr) { u_long ipaddr; @@ -140,28 +140,28 @@ ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr) return APR_SUCCESS; } -ap_status_t ap_get_local_ipaddr(char **addr, ap_socket_t *sock) +apr_status_t apr_get_local_ipaddr(char **addr, apr_socket_t *sock) { if (!sock) { return APR_EBADF; } - *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr)); + *addr = apr_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr)); return APR_SUCCESS; } -ap_status_t ap_get_remote_ipaddr(char **addr, ap_socket_t *sock) +apr_status_t apr_get_remote_ipaddr(char **addr, apr_socket_t *sock) { if (!sock) { return APR_EBADF; } - *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sin_addr)); + *addr = apr_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sin_addr)); return APR_SUCCESS; } -ap_status_t ap_get_local_name(struct sockaddr_in **name, ap_socket_t *sock) +apr_status_t apr_get_local_name(struct sockaddr_in **name, apr_socket_t *sock) { if (!sock) { return APR_EBADF; @@ -171,7 +171,7 @@ ap_status_t ap_get_local_name(struct sockaddr_in **name, ap_socket_t *sock) return APR_SUCCESS; } -ap_status_t ap_get_remote_name(struct sockaddr_in **name, ap_socket_t *sock) +apr_status_t apr_get_remote_name(struct sockaddr_in **name, apr_socket_t *sock) { if (!sock) { return APR_EBADF; diff --git a/network_io/beos/sockets.c b/network_io/beos/sockets.c index 671492bfa..446d8a7d2 100644 --- a/network_io/beos/sockets.c +++ b/network_io/beos/sockets.c @@ -58,9 +58,9 @@ #else #include "networkio.h" -ap_status_t socket_cleanup(void *sock) +apr_status_t socket_cleanup(void *sock) { - ap_socket_t *thesocket = sock; + apr_socket_t *thesocket = sock; if (closesocket(thesocket->socketdes) == 0) { thesocket->socketdes = -1; return APR_SUCCESS; @@ -70,18 +70,18 @@ ap_status_t socket_cleanup(void *sock) } } -ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) +apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) { - (*new) = (ap_socket_t *)ap_palloc(cont,sizeof(ap_socket_t)); + (*new) = (apr_socket_t *)apr_palloc(cont,sizeof(apr_socket_t)); if ((*new) == NULL){ return APR_ENOMEM; } (*new)->cntxt = cont; - (*new)->local_addr = (struct sockaddr_in *) ap_palloc((*new)->cntxt, + (*new)->local_addr = (struct sockaddr_in *) apr_palloc((*new)->cntxt, sizeof (struct sockaddr_in)); - (*new)->remote_addr = (struct sockaddr_in *) ap_palloc((*new)->cntxt, + (*new)->remote_addr = (struct sockaddr_in *) apr_palloc((*new)->cntxt, sizeof (struct sockaddr_in)); if ((*new)->local_addr == NULL || (*new)->remote_addr==NULL){ return APR_ENOMEM; @@ -99,23 +99,23 @@ ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) } (*new)->timeout = -1; - ap_register_cleanup((*new)->cntxt, (void *)(*new), - socket_cleanup, ap_null_cleanup); + apr_register_cleanup((*new)->cntxt, (void *)(*new), + socket_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how) +apr_status_t apr_shutdown(apr_socket_t *thesocket, ap_shutdown_how_e how) { return shutdown(thesocket->socketdes, how); } -ap_status_t ap_close_socket(ap_socket_t *thesocket) +apr_status_t apr_close_socket(apr_socket_t *thesocket) { - ap_kill_cleanup(thesocket->cntxt,thesocket,socket_cleanup); + apr_kill_cleanup(thesocket->cntxt,thesocket,socket_cleanup); return socket_cleanup(thesocket); } -ap_status_t ap_bind(ap_socket_t *sock) +apr_status_t apr_bind(apr_socket_t *sock) { if (bind(sock->socketdes, (struct sockaddr *)sock->local_addr, sock->addr_len) == -1) return errno; @@ -123,7 +123,7 @@ ap_status_t ap_bind(ap_socket_t *sock) return APR_SUCCESS; } -ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) +apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) { if (listen(sock->socketdes, backlog) == -1) return errno; @@ -131,16 +131,16 @@ ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) return APR_SUCCESS; } -ap_status_t ap_accept(ap_socket_t **new, ap_socket_t *sock, ap_pool_t *connection_context) +apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *connection_context) { - (*new) = (ap_socket_t *)ap_palloc(connection_context, - sizeof(ap_socket_t)); + (*new) = (apr_socket_t *)apr_palloc(connection_context, + sizeof(apr_socket_t)); (*new)->cntxt = connection_context; - (*new)->local_addr = (struct sockaddr_in *)ap_palloc((*new)->cntxt, + (*new)->local_addr = (struct sockaddr_in *)apr_palloc((*new)->cntxt, sizeof(struct sockaddr_in)); - (*new)->remote_addr = (struct sockaddr_in *)ap_palloc((*new)->cntxt, + (*new)->remote_addr = (struct sockaddr_in *)apr_palloc((*new)->cntxt, sizeof(struct sockaddr_in)); (*new)->addr_len = sizeof(struct sockaddr_in); (*new)->connected = 1; @@ -156,12 +156,12 @@ ap_status_t ap_accept(ap_socket_t **new, ap_socket_t *sock, ap_pool_t *connectio return errno; } - ap_register_cleanup((*new)->cntxt, (void *)new, - socket_cleanup, ap_null_cleanup); + apr_register_cleanup((*new)->cntxt, (void *)new, + socket_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_connect(ap_socket_t *sock, char *hostname) +apr_status_t apr_connect(apr_socket_t *sock, char *hostname) { struct hostent *hp; @@ -190,31 +190,31 @@ ap_status_t ap_connect(ap_socket_t *sock, char *hostname) return APR_SUCCESS; } -ap_status_t ap_get_socketdata(void **data, const char *key, ap_socket_t *sock) +apr_status_t apr_get_socketdata(void **data, const char *key, apr_socket_t *sock) { - return ap_get_userdata(data, key, sock->cntxt); + return apr_get_userdata(data, key, sock->cntxt); } -ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, const char *key, - ap_status_t (*cleanup) (void *)) +apr_status_t apr_set_socketdata(apr_socket_t *sock, void *data, const char *key, + apr_status_t (*cleanup) (void *)) { - return ap_set_userdata(data, key, cleanup, sock->cntxt); + return apr_set_userdata(data, key, cleanup, sock->cntxt); } -ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock) +apr_status_t apr_get_os_sock(apr_os_sock_t *thesock, apr_socket_t *sock) { *thesock = sock->socketdes; return APR_SUCCESS; } -ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_sock_t *thesock, - ap_pool_t *cont) +apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, + apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; } if ((*sock) == NULL) { - (*sock) = (ap_socket_t *)ap_palloc(cont, sizeof(ap_socket_t)); + (*sock) = (apr_socket_t *)apr_palloc(cont, sizeof(apr_socket_t)); (*sock)->cntxt = cont; } (*sock)->socketdes = *thesock; diff --git a/network_io/beos/sockopt.c b/network_io/beos/sockopt.c index 87542f220..c5921dfbc 100644 --- a/network_io/beos/sockopt.c +++ b/network_io/beos/sockopt.c @@ -64,7 +64,7 @@ static int setnonblocking(int on, int sock) &on, sizeof(on)); } -ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) +apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on) { int one; int rv; @@ -110,7 +110,7 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) return APR_SUCCESS; } -ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t *on) +apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) { switch(opt) { case APR_SO_TIMEOUT: @@ -122,7 +122,7 @@ ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t *on) return APR_SUCCESS; } -ap_status_t ap_gethostname(char * buf, int len, ap_pool_t *cont) +apr_status_t apr_gethostname(char * buf, int len, apr_pool_t *cont) { if (gethostname(buf, len) == -1){ return errno; @@ -131,14 +131,14 @@ ap_status_t ap_gethostname(char * buf, int len, ap_pool_t *cont) } } -ap_status_t ap_get_remote_hostname(char **name, ap_socket_t *sock) +apr_status_t apr_get_remote_hostname(char **name, apr_socket_t *sock) { struct hostent *hptr; hptr = gethostbyaddr((char *)&(sock->remote_addr->sin_addr), sizeof(struct in_addr), AF_INET); if (hptr != NULL) { - *name = ap_pstrdup(sock->cntxt, hptr->h_name); + *name = apr_pstrdup(sock->cntxt, hptr->h_name); if (*name) { return APR_SUCCESS; } diff --git a/network_io/os2/networkio.h b/network_io/os2/networkio.h index 63424de6a..a87823ae9 100644 --- a/network_io/os2/networkio.h +++ b/network_io/os2/networkio.h @@ -59,18 +59,18 @@ #include "apr_general.h" #include "os2calls.h" -struct ap_socket_t { - ap_pool_t *cntxt; +struct apr_socket_t { + apr_pool_t *cntxt; int socketdes; struct sockaddr_in *local_addr; struct sockaddr_in *remote_addr; int addr_len; - ap_interval_time_t timeout; + apr_interval_time_t timeout; int nonblock; }; -struct ap_pollfd_t { - ap_pool_t *cntxt; +struct apr_pollfd_t { + apr_pool_t *cntxt; int *socket_list; int *r_socket_list; int num_read; diff --git a/network_io/os2/poll.c b/network_io/os2/poll.c index a36854ff0..f1bd5826a 100644 --- a/network_io/os2/poll.c +++ b/network_io/os2/poll.c @@ -64,21 +64,21 @@ /* OS/2 doesn't have a poll function, implement using OS/2 style select */ -ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_pool_t *cont) +apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) { - *new = (ap_pollfd_t *)ap_palloc(cont, sizeof(ap_pollfd_t)); + *new = (apr_pollfd_t *)apr_palloc(cont, sizeof(apr_pollfd_t)); if (*new == NULL) { return APR_ENOMEM; } - (*new)->socket_list = ap_palloc(cont, sizeof(int) * num); + (*new)->socket_list = apr_palloc(cont, sizeof(int) * num); if ((*new)->socket_list == NULL) { return APR_ENOMEM; } - (*new)->r_socket_list = ap_palloc(cont, sizeof(int) * num); + (*new)->r_socket_list = apr_palloc(cont, sizeof(int) * num); if ((*new)->r_socket_list == NULL) { return APR_ENOMEM; @@ -95,8 +95,8 @@ ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_pool_t *cont) -ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, - ap_socket_t *sock, ap_int16_t events) +apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, + apr_socket_t *sock, apr_int16_t events) { int i; @@ -126,8 +126,8 @@ ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, -ap_status_t ap_poll(ap_pollfd_t *pollfdset, ap_int32_t *nsds, - ap_interval_time_t timeout) +apr_status_t apr_poll(apr_pollfd_t *pollfdset, apr_int32_t *nsds, + apr_interval_time_t timeout) { int i; int rv = 0; @@ -167,7 +167,7 @@ ap_status_t ap_poll(ap_pollfd_t *pollfdset, ap_int32_t *nsds, -ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *aprset) +apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) { int i; @@ -189,8 +189,8 @@ ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *ap -ap_status_t ap_mask_poll_socket(ap_pollfd_t *aprset, - ap_socket_t *sock, ap_int16_t events) +apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, + apr_socket_t *sock, apr_int16_t events) { int start, *count, pos; @@ -227,7 +227,7 @@ ap_status_t ap_mask_poll_socket(ap_pollfd_t *aprset, -ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock) +apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) { - return ap_mask_poll_socket(aprset, sock, APR_POLLIN|APR_POLLOUT|APR_POLLPRI); + return apr_mask_poll_socket(aprset, sock, APR_POLLIN|APR_POLLOUT|APR_POLLPRI); } diff --git a/network_io/os2/sendrecv.c b/network_io/os2/sendrecv.c index a2bf14429..81a281e4d 100644 --- a/network_io/os2/sendrecv.c +++ b/network_io/os2/sendrecv.c @@ -59,7 +59,7 @@ #include "apr_lib.h" #include <sys/time.h> -ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len) +apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_ssize_t *len) { ssize_t rv; int fds, err = 0; @@ -98,7 +98,7 @@ ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len) -ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) +apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_ssize_t *len) { ssize_t rv; int fds, err = 0; @@ -137,9 +137,9 @@ ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) -ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec, ap_int32_t nvec, ap_int32_t *len) +apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, apr_int32_t nvec, apr_int32_t *len) { - ap_status_t rv; + apr_status_t rv; struct iovec *tmpvec; int fds, err = 0; diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index ddd581510..b6e417840 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -66,9 +66,9 @@ #include <netdb.h> #include "os2calls.h" -static ap_status_t socket_cleanup(void *sock) +static apr_status_t socket_cleanup(void *sock) { - ap_socket_t *thesocket = sock; + apr_socket_t *thesocket = sock; if (soclose(thesocket->socketdes) == 0) { thesocket->socketdes = -1; return APR_SUCCESS; @@ -78,17 +78,17 @@ static ap_status_t socket_cleanup(void *sock) } } -ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) +apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) { - (*new) = (ap_socket_t *)ap_palloc(cont, sizeof(ap_socket_t)); + (*new) = (apr_socket_t *)apr_palloc(cont, sizeof(apr_socket_t)); if ((*new) == NULL) { return APR_ENOMEM; } (*new)->cntxt = cont; - (*new)->local_addr = (struct sockaddr_in *)ap_palloc((*new)->cntxt, + (*new)->local_addr = (struct sockaddr_in *)apr_palloc((*new)->cntxt, sizeof(struct sockaddr_in)); - (*new)->remote_addr = (struct sockaddr_in *)ap_palloc((*new)->cntxt, + (*new)->remote_addr = (struct sockaddr_in *)apr_palloc((*new)->cntxt, sizeof(struct sockaddr_in)); if ((*new)->local_addr == NULL || (*new)->remote_addr == NULL) { @@ -107,12 +107,12 @@ ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) } (*new)->timeout = -1; (*new)->nonblock = FALSE; - ap_register_cleanup((*new)->cntxt, (void *)(*new), - socket_cleanup, ap_null_cleanup); + apr_register_cleanup((*new)->cntxt, (void *)(*new), + socket_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how) +apr_status_t apr_shutdown(apr_socket_t *thesocket, ap_shutdown_how_e how) { if (shutdown(thesocket->socketdes, how) == 0) { return APR_SUCCESS; @@ -122,16 +122,16 @@ ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how) } } -ap_status_t ap_close_socket(ap_socket_t *thesocket) +apr_status_t apr_close_socket(apr_socket_t *thesocket) { - ap_kill_cleanup(thesocket->cntxt, thesocket, socket_cleanup); + apr_kill_cleanup(thesocket->cntxt, thesocket, socket_cleanup); return socket_cleanup(thesocket); } -ap_status_t ap_bind(ap_socket_t *sock) +apr_status_t apr_bind(apr_socket_t *sock) { if (bind(sock->socketdes, (struct sockaddr *)sock->local_addr, sock->addr_len) == -1) return APR_OS2_STATUS(sock_errno()); @@ -139,7 +139,7 @@ ap_status_t ap_bind(ap_socket_t *sock) return APR_SUCCESS; } -ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) +apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) { if (listen(sock->socketdes, backlog) == -1) return APR_OS2_STATUS(sock_errno()); @@ -147,13 +147,13 @@ ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) return APR_SUCCESS; } -ap_status_t ap_accept(ap_socket_t **new, ap_socket_t *sock, ap_pool_t *connection_context) +apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *connection_context) { - (*new) = (ap_socket_t *)ap_palloc(connection_context, - sizeof(ap_socket_t)); + (*new) = (apr_socket_t *)apr_palloc(connection_context, + sizeof(apr_socket_t)); (*new)->cntxt = connection_context; - (*new)->remote_addr = (struct sockaddr_in *)ap_palloc((*new)->cntxt, + (*new)->remote_addr = (struct sockaddr_in *)apr_palloc((*new)->cntxt, sizeof(struct sockaddr_in)); (*new)->local_addr = sock->local_addr; (*new)->addr_len = sizeof(struct sockaddr_in); @@ -167,12 +167,12 @@ ap_status_t ap_accept(ap_socket_t **new, ap_socket_t *sock, ap_pool_t *connectio return APR_OS2_STATUS(sock_errno()); } - ap_register_cleanup((*new)->cntxt, (void *)(*new), - socket_cleanup, ap_null_cleanup); + apr_register_cleanup((*new)->cntxt, (void *)(*new), + socket_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_connect(ap_socket_t *sock, char *hostname) +apr_status_t apr_connect(apr_socket_t *sock, char *hostname) { struct hostent *hp; @@ -206,21 +206,21 @@ ap_status_t ap_connect(ap_socket_t *sock, char *hostname) -ap_status_t ap_get_socketdata(void **data, const char *key, - ap_socket_t *socket) +apr_status_t apr_get_socketdata(void **data, const char *key, + apr_socket_t *socket) { - return ap_get_userdata(data, key, socket->cntxt); + return apr_get_userdata(data, key, socket->cntxt); } -ap_status_t ap_set_socketdata(ap_socket_t *socket, void *data, const char *key, - ap_status_t (*cleanup) (void *)) +apr_status_t apr_set_socketdata(apr_socket_t *socket, void *data, const char *key, + apr_status_t (*cleanup) (void *)) { - return ap_set_userdata(data, key, cleanup, socket->cntxt); + return apr_set_userdata(data, key, cleanup, socket->cntxt); } -ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock) +apr_status_t apr_get_os_sock(apr_os_sock_t *thesock, apr_socket_t *sock) { *thesock = sock->socketdes; return APR_SUCCESS; @@ -228,13 +228,13 @@ ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock) -ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_sock_t *thesock, ap_pool_t *cont) +apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; } if ((*sock) == NULL) { - (*sock) = (ap_socket_t *)ap_palloc(cont, sizeof(ap_socket_t)); + (*sock) = (apr_socket_t *)apr_palloc(cont, sizeof(apr_socket_t)); (*sock)->cntxt = cont; } (*sock)->socketdes = *thesock; diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c index 75b4c2a78..a3c917f55 100644 --- a/network_io/os2/sockopt.c +++ b/network_io/os2/sockopt.c @@ -66,7 +66,7 @@ #include <sys/so_ioctl.h> -ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) +apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on) { int one; struct linger li; @@ -118,7 +118,7 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) -ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t *on) +apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) { switch(opt) { case APR_SO_TIMEOUT: @@ -132,7 +132,7 @@ ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t *on) -ap_status_t ap_gethostname(char *buf, ap_int32_t len, ap_pool_t *cont) +apr_status_t apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) { if (gethostname(buf, len) == -1) return APR_OS2_STATUS(sock_errno()); @@ -142,14 +142,14 @@ ap_status_t ap_gethostname(char *buf, ap_int32_t len, ap_pool_t *cont) -ap_status_t ap_get_remote_hostname(char **name, ap_socket_t *sock) +apr_status_t apr_get_remote_hostname(char **name, apr_socket_t *sock) { struct hostent *hptr; hptr = gethostbyaddr((char *)&(sock->remote_addr->sin_addr), sizeof(struct in_addr), AF_INET); if (hptr != NULL) { - *name = ap_pstrdup(sock->cntxt, hptr->h_name); + *name = apr_pstrdup(sock->cntxt, hptr->h_name); if (*name) { return APR_SUCCESS; } diff --git a/network_io/unix/networkio.h b/network_io/unix/networkio.h index af28dc7c7..90868b06d 100644 --- a/network_io/unix/networkio.h +++ b/network_io/unix/networkio.h @@ -116,13 +116,13 @@ #define POLLNVAL 32 #endif -struct ap_socket_t { - ap_pool_t *cntxt; +struct apr_socket_t { + apr_pool_t *cntxt; int socketdes; struct sockaddr_in *local_addr; struct sockaddr_in *remote_addr; socklen_t addr_len; - ap_interval_time_t timeout; + apr_interval_time_t timeout; #ifndef HAVE_POLL int connected; #endif @@ -130,8 +130,8 @@ struct ap_socket_t { int local_interface_unknown; }; -struct ap_pollfd_t { - ap_pool_t *cntxt; +struct apr_pollfd_t { + apr_pool_t *cntxt; #ifdef HAVE_POLL struct pollfd *pollset; int num; @@ -142,8 +142,8 @@ struct ap_pollfd_t { fd_set *except; int highsock; #endif - ap_int16_t *events; - ap_int16_t *revents; + apr_int16_t *events; + apr_int16_t *revents; }; diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c index a946f5b51..76679791b 100644 --- a/network_io/unix/poll.c +++ b/network_io/unix/poll.c @@ -57,13 +57,13 @@ #ifdef HAVE_POLL /* We can just use poll to do our socket polling. */ -ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_pool_t *cont) +apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) { - (*new) = (ap_pollfd_t *)ap_pcalloc(cont, sizeof(ap_pollfd_t)); + (*new) = (apr_pollfd_t *)apr_pcalloc(cont, sizeof(apr_pollfd_t)); if ((*new) == NULL) { return APR_ENOMEM; } - (*new)->pollset = (struct pollfd *)ap_pcalloc(cont, + (*new)->pollset = (struct pollfd *)apr_pcalloc(cont, sizeof(struct pollfd) * num); if ((*new)->pollset == NULL) { @@ -75,9 +75,9 @@ ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_pool_t *cont) return APR_SUCCESS; } -static ap_int16_t get_event(ap_int16_t event) +static apr_int16_t get_event(apr_int16_t event) { - ap_int16_t rv = 0; + apr_int16_t rv = 0; if (event & APR_POLLIN) rv |= POLLIN; @@ -95,9 +95,9 @@ static ap_int16_t get_event(ap_int16_t event) return rv; } -static ap_int16_t get_revent(ap_int16_t event) +static apr_int16_t get_revent(apr_int16_t event) { - ap_int16_t rv = 0; + apr_int16_t rv = 0; if (event & POLLIN) rv |= APR_POLLIN; @@ -115,8 +115,8 @@ static ap_int16_t get_revent(ap_int16_t event) return rv; } -ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, - ap_socket_t *sock, ap_int16_t event) +apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, + apr_socket_t *sock, apr_int16_t event) { int i = 0; @@ -135,8 +135,8 @@ ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, return APR_SUCCESS; } -ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, - ap_interval_time_t timeout) +apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, + apr_interval_time_t timeout) { int rv; @@ -153,7 +153,7 @@ ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, return APR_SUCCESS; } -ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *aprset) +apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) { int i = 0; @@ -167,10 +167,10 @@ ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *ap return APR_SUCCESS; } -ap_status_t ap_mask_poll_socket(ap_pollfd_t *aprset, - ap_socket_t *sock, ap_int16_t events) +apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, + apr_socket_t *sock, apr_int16_t events) { - ap_int16_t newevents; + apr_int16_t newevents; int i = 0; while (i < aprset->curpos && aprset->pollset[i].fd != sock->socketdes) { @@ -187,7 +187,7 @@ ap_status_t ap_mask_poll_socket(ap_pollfd_t *aprset, return APR_SUCCESS; } -ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock) +apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) { int i = 0; while(i < aprset->curpos && aprset->pollset[i].fd != sock->socketdes) { @@ -204,10 +204,10 @@ ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock) return APR_SUCCESS; } -ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t events) +apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t events) { int i = 0; - ap_int16_t newevents; + apr_int16_t newevents; newevents = get_event(events); @@ -222,16 +222,16 @@ ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t events) #else /* Use select to mimic poll */ -ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_pool_t *cont) +apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) { - (*new) = (ap_pollfd_t *)ap_pcalloc(cont, sizeof(ap_pollfd_t) * num); + (*new) = (apr_pollfd_t *)apr_pcalloc(cont, sizeof(apr_pollfd_t) * num); if ((*new) == NULL) { return APR_ENOMEM; } (*new)->cntxt = cont; - (*new)->read = (fd_set *)ap_pcalloc(cont, sizeof(fd_set)); - (*new)->write = (fd_set *)ap_pcalloc(cont, sizeof(fd_set)); - (*new)->except = (fd_set *)ap_pcalloc(cont, sizeof(fd_set)); + (*new)->read = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); + (*new)->write = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); + (*new)->except = (fd_set *)apr_pcalloc(cont, sizeof(fd_set)); FD_ZERO((*new)->read); FD_ZERO((*new)->write); FD_ZERO((*new)->except); @@ -239,8 +239,8 @@ ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, - ap_socket_t *sock, ap_int16_t event) +apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, + apr_socket_t *sock, apr_int16_t event) { if (event & APR_POLLIN) { FD_SET(sock->socketdes, aprset->read); @@ -257,8 +257,8 @@ ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, return APR_SUCCESS; } -ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, - ap_interval_time_t timeout) +apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, + apr_interval_time_t timeout) { int rv; struct timeval tv, *tvptr; @@ -285,9 +285,9 @@ ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, return APR_SUCCESS; } -ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *aprset) +apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) { - ap_int16_t revents = 0; + apr_int16_t revents = 0; char data[1]; int flags = MSG_PEEK; @@ -332,7 +332,7 @@ ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *ap return APR_SUCCESS; } -ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock) +apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) { FD_CLR(sock->socketdes, aprset->read); FD_CLR(sock->socketdes, aprset->read); @@ -340,7 +340,7 @@ ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock) return APR_SUCCESS; } -ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t event) +apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t event) { if (event & APR_POLLIN) { FD_ZERO(aprset->read); @@ -357,25 +357,25 @@ ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t event) #endif -ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, const char *key, void *data) +apr_status_t apr_get_polldata(apr_pollfd_t *pollfd, const char *key, void *data) { - return ap_get_userdata(data, key, pollfd->cntxt); + return apr_get_userdata(data, key, pollfd->cntxt); } -ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, const char *key, - ap_status_t (*cleanup) (void *)) +apr_status_t apr_set_polldata(apr_pollfd_t *pollfd, void *data, const char *key, + apr_status_t (*cleanup) (void *)) { - return ap_set_userdata(data, key, cleanup, pollfd->cntxt); + return apr_set_userdata(data, key, cleanup, pollfd->cntxt); } #if APR_FILES_AS_SOCKETS -/* I'm not sure if this needs to return an ap_status_t or not, but +/* I'm not sure if this needs to return an apr_status_t or not, but * for right now, we'll leave it this way, and change it later if * necessary. */ -ap_status_t ap_socket_from_file(ap_socket_t **newsock, ap_file_t *file) +apr_status_t apr_socket_from_file(apr_socket_t **newsock, apr_file_t *file) { - (*newsock) = ap_pcalloc(file->cntxt, sizeof(**newsock)); + (*newsock) = apr_pcalloc(file->cntxt, sizeof(**newsock)); (*newsock)->socketdes = file->filedes; (*newsock)->cntxt = file->cntxt; return APR_SUCCESS; diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 9ebb612d9..41a3dceb3 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -66,7 +66,7 @@ #endif #if APR_HAS_SENDFILE -/* This file is needed to allow us access to the ap_file_t internals. */ +/* This file is needed to allow us access to the apr_file_t internals. */ #include "../../file_io/unix/fileio.h" /* Glibc2.1.1 fails to define TCP_CORK. This is a bug that will be @@ -78,7 +78,7 @@ #endif /* APR_HAS_SENDFILE */ -static ap_status_t wait_for_io_or_timeout(ap_socket_t *sock, int for_read) +static apr_status_t wait_for_io_or_timeout(apr_socket_t *sock, int for_read) { struct timeval tv, *tvptr; fd_set fdset; @@ -112,7 +112,7 @@ static ap_status_t wait_for_io_or_timeout(ap_socket_t *sock, int for_read) return APR_SUCCESS; } -ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len) +apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_ssize_t *len) { ssize_t rv; @@ -122,7 +122,7 @@ ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len) if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout != 0) { - ap_status_t arv = wait_for_io_or_timeout(sock, 0); + apr_status_t arv = wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -141,7 +141,7 @@ ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len) return APR_SUCCESS; } -ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) +apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_ssize_t *len) { ssize_t rv; @@ -152,7 +152,7 @@ ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout != 0) { - ap_status_t arv = wait_for_io_or_timeout(sock, 1); + apr_status_t arv = wait_for_io_or_timeout(sock, 1); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -172,10 +172,10 @@ ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) } #ifdef HAVE_WRITEV -ap_status_t ap_sendv(ap_socket_t * sock, const struct iovec *vec, - ap_int32_t nvec, ap_ssize_t *len) +apr_status_t apr_sendv(apr_socket_t * sock, const struct iovec *vec, + apr_int32_t nvec, apr_ssize_t *len) { - ap_ssize_t rv; + apr_ssize_t rv; do { rv = writev(sock->socketdes, vec, nvec); @@ -184,7 +184,7 @@ ap_status_t ap_sendv(ap_socket_t * sock, const struct iovec *vec, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout != 0) { - ap_status_t arv = wait_for_io_or_timeout(sock, 0); + apr_status_t arv = wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -211,7 +211,7 @@ ap_status_t ap_sendv(ap_socket_t * sock, const struct iovec *vec, * - Should flags be an int_32 or what? */ -static ap_hdtr_t no_hdtr; /* used below when caller passes NULL for ap_hdtr_t */ +static apr_hdtr_t no_hdtr; /* used below when caller passes NULL for apr_hdtr_t */ #if defined(__linux__) && defined(HAVE_WRITEV) @@ -219,14 +219,14 @@ static ap_hdtr_t no_hdtr; /* used below when caller passes NULL for ap_hdtr_t */ * however, it is mutually exclusive w/TCP_NODELAY */ -static int os_cork(ap_socket_t *sock) +static int os_cork(apr_socket_t *sock) { /* Linux only for now */ int nodelay_off = 0, corkflag = 1, rv, delayflag; socklen_t delaylen = sizeof(delayflag); - /* XXX it would be cheaper to use an ap_socket_t flag here */ + /* XXX it would be cheaper to use an apr_socket_t flag here */ rv = getsockopt(sock->socketdes, SOL_TCP, TCP_NODELAY, (void *) &delayflag, &delaylen); if (rv == 0) { @@ -245,7 +245,7 @@ static int os_cork(ap_socket_t *sock) return rv == 0 ? delayflag : rv; } -static int os_uncork(ap_socket_t *sock, int delayflag) +static int os_uncork(apr_socket_t *sock, int delayflag) { /* Uncork to send queued frames - Linux only for now */ @@ -260,13 +260,13 @@ static int os_uncork(ap_socket_t *sock, int delayflag) return rv; } -ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, - ap_hdtr_t *hdtr, ap_off_t *offset, ap_size_t *len, - ap_int32_t flags) +apr_status_t ap_sendfile(apr_socket_t *sock, apr_file_t *file, + apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, + apr_int32_t flags) { off_t off = *offset; int rv, nbytes = 0, total_hdrbytes, i, delayflag = APR_EINIT, corked = 0; - ap_status_t arv; + apr_status_t arv; if (!hdtr) { hdtr = &no_hdtr; @@ -276,7 +276,7 @@ ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, flags = 0; if (hdtr->numheaders > 0) { - ap_int32_t hdrbytes; + apr_int32_t hdrbytes; /* cork before writing headers */ rv = os_cork(sock); @@ -287,7 +287,7 @@ ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, corked = 1; /* Now write the headers */ - arv = ap_sendv(sock, hdtr->headers, hdtr->numheaders, &hdrbytes); + arv = apr_sendv(sock, hdtr->headers, hdtr->numheaders, &hdrbytes); if (arv != APR_SUCCESS) { *len = 0; return errno; @@ -361,8 +361,8 @@ ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, /* Now write the footers */ if (hdtr->numtrailers > 0) { - ap_int32_t trbytes; - arv = ap_sendv(sock, hdtr->trailers, hdtr->numtrailers, &trbytes); + apr_int32_t trbytes; + arv = apr_sendv(sock, hdtr->trailers, hdtr->numtrailers, &trbytes); nbytes += trbytes; if (arv != APR_SUCCESS) { *len = nbytes; @@ -391,9 +391,9 @@ ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, #elif defined(__FreeBSD__) /* Release 3.1 or greater */ -ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, - ap_hdtr_t * hdtr, ap_off_t * offset, ap_size_t * len, - ap_int32_t flags) +apr_status_t ap_sendfile(apr_socket_t * sock, apr_file_t * file, + apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, + apr_int32_t flags) { off_t nbytes; int rv, i; @@ -453,7 +453,7 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout > 0) { - ap_status_t arv = wait_for_io_or_timeout(sock, 0); + apr_status_t arv = wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -484,9 +484,9 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, #error "there's no way this ap_sendfile implementation works -djg" /* HP-UX Version 10.30 or greater */ -ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, - ap_hdtr_t * hdtr, ap_off_t * offset, ap_size_t * len, - ap_int32_t flags) +apr_status_t ap_sendfile(apr_socket_t * sock, apr_file_t * file, + apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, + apr_int32_t flags) { int i, ptr = 0; size_t nbytes = 0, headerlen = 0, trailerlen = 0; @@ -508,7 +508,7 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, } /* XXX: BUHHH? wow, what a memory leak! */ - headerbuf = ap_palloc(sock->cntxt, headerlen); + headerbuf = apr_palloc(sock->cntxt, headerlen); for (i = 0; i < hdtr->numheaders; i++) { memcpy(headerbuf + ptr, hdtr->headers[i].iov_base, @@ -521,7 +521,7 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, } /* XXX: BUHHH? wow, what a memory leak! */ - trailerbuf = ap_palloc(sock->cntxt, trailerlen); + trailerbuf = apr_palloc(sock->cntxt, trailerlen); for (i = 0; i < hdtr->numtrailers; i++) { memcpy(trailerbuf + ptr, hdtr->trailers[i].iov_base, @@ -548,7 +548,7 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout > 0) { - ap_status_t arv = wait_for_io_or_timeout(sock, 0); + apr_status_t arv = wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { /* jlt: not tested, but this matches other sendfile logic */ @@ -591,13 +591,13 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, * AIX - version 4.3.2 with APAR IX85388, or version 4.3.3 and above * OS/390 - V2R7 and above */ -ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, - ap_hdtr_t * hdtr, ap_off_t * offset, ap_size_t * len, - ap_int32_t flags) +apr_status_t ap_sendfile(apr_socket_t * sock, apr_file_t * file, + apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, + apr_int32_t flags) { int i, ptr, rv = 0; void * hbuf=NULL, * tbuf=NULL; - ap_status_t arv; + apr_status_t arv; struct sf_parms parms; if (!hdtr) { @@ -619,13 +619,13 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, parms.header_length += hdtr->headers[i].iov_len; } #if 0 - /* Keepalives make ap_palloc a bad idea */ + /* Keepalives make apr_palloc a bad idea */ hbuf = malloc(parms.header_length); #else /* but headers are small, so maybe we can hold on to the * memory for the life of the socket... */ - hbuf = ap_palloc(sock->cntxt, parms.header_length); + hbuf = apr_palloc(sock->cntxt, parms.header_length); #endif ptr = 0; for (i = 0; i < hdtr->numheaders; i++) { @@ -648,10 +648,10 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, parms.trailer_length += hdtr->trailers[i].iov_len; } #if 0 - /* Keepalives make ap_palloc a bad idea */ + /* Keepalives make apr_palloc a bad idea */ tbuf = malloc(parms.trailer_length); #else - tbuf = ap_palloc(sock->cntxt, parms.trailer_length); + tbuf = apr_palloc(sock->cntxt, parms.trailer_length); #endif ptr = 0; for (i = 0; i < hdtr->numtrailers; i++) { @@ -717,16 +717,16 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, * each and not an array as is passed into this function. In * addition, there is a limitation on the size of the header/trailer * that can be referenced ( > 4096 seems to cause an ENOMEM) - * Rather than code these special cases in, using ap_sendv for + * Rather than code these special cases in, using apr_sendv for * all cases of the headers and trailers seems to be a good idea. */ -ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, - ap_hdtr_t * hdtr, ap_off_t * offset, ap_size_t * len, - ap_int32_t flags) +apr_status_t ap_sendfile(apr_socket_t * sock, apr_file_t * file, + apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, + apr_int32_t flags) { off_t nbytes = 0; int rv, i; - ap_status_t arv; + apr_status_t arv; struct iovec headerstruct[2] = {(0, 0), (0, 0)}; size_t bytes_to_send = *len; @@ -738,9 +738,9 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, flags = 0; if (hdtr->numheaders > 0) { - ap_ssize_t hdrbytes = 0; + apr_ssize_t hdrbytes = 0; - arv = ap_sendv(sock, hdtr->headers, hdtr->numheaders, &hdrbytes); + arv = apr_sendv(sock, hdtr->headers, hdtr->numheaders, &hdrbytes); if (arv != APR_SUCCESS) { *len = 0; return errno; @@ -753,7 +753,7 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, * socket. */ if (sock->timeout <= 0) { - ap_size_t total_hdrbytes = 0; + apr_size_t total_hdrbytes = 0; for (i = 0; i < hdtr->numheaders; i++) { total_hdrbytes += hdtr->headers[i].iov_len; } @@ -784,7 +784,7 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout > 0) { - ap_status_t arv = wait_for_io_or_timeout(sock, 0); + apr_status_t arv = wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; @@ -806,10 +806,10 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, nbytes += rv; if (hdtr->numtrailers > 0) { - ap_ssize_t trlbytes = 0; + apr_ssize_t trlbytes = 0; /* send the trailers now */ - arv = ap_sendv(sock, hdtr->trailers, hdtr->numtrailers, &trlbytes); + arv = apr_sendv(sock, hdtr->trailers, hdtr->numtrailers, &trlbytes); if (arv != APR_SUCCESS) { *len = 0; return errno; diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 4bfd0b50e..bce1053ff 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -55,7 +55,7 @@ #include "networkio.h" #include "apr_strings.h" -ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port) +apr_status_t apr_set_local_port(apr_socket_t *sock, apr_uint32_t port) { sock->local_addr->sin_port = htons((short)port); return APR_SUCCESS; @@ -63,7 +63,7 @@ ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port) -ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port) +apr_status_t apr_set_remote_port(apr_socket_t *sock, apr_uint32_t port) { sock->remote_addr->sin_port = htons((short)port); return APR_SUCCESS; @@ -71,7 +71,7 @@ ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port) -static ap_status_t get_local_addr(ap_socket_t *sock) +static apr_status_t get_local_addr(apr_socket_t *sock) { socklen_t namelen = sizeof(*sock->local_addr); @@ -87,10 +87,10 @@ static ap_status_t get_local_addr(ap_socket_t *sock) -ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock) +apr_status_t apr_get_local_port(apr_uint32_t *port, apr_socket_t *sock) { if (sock->local_port_unknown) { - ap_status_t rv = get_local_addr(sock); + apr_status_t rv = get_local_addr(sock); if (rv != APR_SUCCESS) { return rv; @@ -103,7 +103,7 @@ ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock) -ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock) +apr_status_t apr_get_remote_port(apr_uint32_t *port, apr_socket_t *sock) { *port = ntohs(sock->remote_addr->sin_port); return APR_SUCCESS; @@ -111,7 +111,7 @@ ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock) -ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, const char *addr) +apr_status_t apr_set_local_ipaddr(apr_socket_t *sock, const char *addr) { u_long ipaddr; @@ -132,7 +132,7 @@ ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, const char *addr) -ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr) +apr_status_t apr_set_remote_ipaddr(apr_socket_t *sock, const char *addr) { u_long ipaddr; @@ -153,35 +153,35 @@ ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr) -ap_status_t ap_get_local_ipaddr(char **addr, ap_socket_t *sock) +apr_status_t apr_get_local_ipaddr(char **addr, apr_socket_t *sock) { if (sock->local_interface_unknown) { - ap_status_t rv = get_local_addr(sock); + apr_status_t rv = get_local_addr(sock); if (rv != APR_SUCCESS) { return rv; } } - *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr)); + *addr = apr_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr)); return APR_SUCCESS; } -ap_status_t ap_get_remote_ipaddr(char **addr, ap_socket_t *sock) +apr_status_t apr_get_remote_ipaddr(char **addr, apr_socket_t *sock) { - *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sin_addr)); + *addr = apr_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sin_addr)); return APR_SUCCESS; } #if APR_HAVE_NETINET_IN_H -ap_status_t ap_get_local_name(struct sockaddr_in **name, ap_socket_t *sock) +apr_status_t apr_get_local_name(struct sockaddr_in **name, apr_socket_t *sock) { if (sock->local_port_unknown || sock->local_interface_unknown) { - ap_status_t rv = get_local_addr(sock); + apr_status_t rv = get_local_addr(sock); if (rv != APR_SUCCESS) { return rv; @@ -194,7 +194,7 @@ ap_status_t ap_get_local_name(struct sockaddr_in **name, ap_socket_t *sock) -ap_status_t ap_get_remote_name(struct sockaddr_in **name, ap_socket_t *sock) +apr_status_t apr_get_remote_name(struct sockaddr_in **name, apr_socket_t *sock) { *name = sock->remote_addr; return APR_SUCCESS; diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index cdf8042c3..377612f3f 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -55,9 +55,9 @@ #include "networkio.h" #include "apr_portable.h" -static ap_status_t socket_cleanup(void *sock) +static apr_status_t socket_cleanup(void *sock) { - ap_socket_t *thesocket = sock; + apr_socket_t *thesocket = sock; if (close(thesocket->socketdes) == 0) { thesocket->socketdes = -1; return APR_SUCCESS; @@ -67,17 +67,17 @@ static ap_status_t socket_cleanup(void *sock) } } -ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) +apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) { - (*new) = (ap_socket_t *)ap_pcalloc(cont, sizeof(ap_socket_t)); + (*new) = (apr_socket_t *)apr_pcalloc(cont, sizeof(apr_socket_t)); if ((*new) == NULL) { return APR_ENOMEM; } (*new)->cntxt = cont; - (*new)->local_addr = (struct sockaddr_in *)ap_pcalloc((*new)->cntxt, + (*new)->local_addr = (struct sockaddr_in *)apr_pcalloc((*new)->cntxt, sizeof(struct sockaddr_in)); - (*new)->remote_addr = (struct sockaddr_in *)ap_pcalloc((*new)->cntxt, + (*new)->remote_addr = (struct sockaddr_in *)apr_pcalloc((*new)->cntxt, sizeof(struct sockaddr_in)); if ((*new)->local_addr == NULL || (*new)->remote_addr == NULL) { @@ -95,23 +95,23 @@ ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) return errno; } (*new)->timeout = -1; - ap_register_cleanup((*new)->cntxt, (void *)(*new), - socket_cleanup, ap_null_cleanup); + apr_register_cleanup((*new)->cntxt, (void *)(*new), + socket_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how) +apr_status_t apr_shutdown(apr_socket_t *thesocket, ap_shutdown_how_e how) { return (shutdown(thesocket->socketdes, how) == -1) ? errno : APR_SUCCESS; } -ap_status_t ap_close_socket(ap_socket_t *thesocket) +apr_status_t apr_close_socket(apr_socket_t *thesocket) { - ap_kill_cleanup(thesocket->cntxt, thesocket, socket_cleanup); + apr_kill_cleanup(thesocket->cntxt, thesocket, socket_cleanup); return socket_cleanup(thesocket); } -ap_status_t ap_bind(ap_socket_t *sock) +apr_status_t apr_bind(apr_socket_t *sock) { if (bind(sock->socketdes, (struct sockaddr *)sock->local_addr, sock->addr_len) == -1) return errno; @@ -123,7 +123,7 @@ ap_status_t ap_bind(ap_socket_t *sock) } } -ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) +apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) { if (listen(sock->socketdes, backlog) == -1) return errno; @@ -131,16 +131,16 @@ ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) return APR_SUCCESS; } -ap_status_t ap_accept(ap_socket_t **new, ap_socket_t *sock, ap_pool_t *connection_context) +apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *connection_context) { - (*new) = (ap_socket_t *)ap_pcalloc(connection_context, - sizeof(ap_socket_t)); + (*new) = (apr_socket_t *)apr_pcalloc(connection_context, + sizeof(apr_socket_t)); (*new)->cntxt = connection_context; - (*new)->local_addr = (struct sockaddr_in *)ap_pcalloc((*new)->cntxt, + (*new)->local_addr = (struct sockaddr_in *)apr_pcalloc((*new)->cntxt, sizeof(struct sockaddr_in)); - (*new)->remote_addr = (struct sockaddr_in *)ap_pcalloc((*new)->cntxt, + (*new)->remote_addr = (struct sockaddr_in *)apr_pcalloc((*new)->cntxt, sizeof(struct sockaddr_in)); (*new)->addr_len = sizeof(struct sockaddr_in); #ifndef HAVE_POLL @@ -173,12 +173,12 @@ ap_status_t ap_accept(ap_socket_t **new, ap_socket_t *sock, ap_pool_t *connectio (*new)->local_interface_unknown = 1; } - ap_register_cleanup((*new)->cntxt, (void *)(*new), - socket_cleanup, ap_null_cleanup); + apr_register_cleanup((*new)->cntxt, (void *)(*new), + socket_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_connect(ap_socket_t *sock, char *hostname) +apr_status_t apr_connect(apr_socket_t *sock, char *hostname) { struct hostent *hp; @@ -231,32 +231,32 @@ ap_status_t ap_connect(ap_socket_t *sock, char *hostname) } } -ap_status_t ap_get_socketdata(void **data, const char *key, ap_socket_t *sock) +apr_status_t apr_get_socketdata(void **data, const char *key, apr_socket_t *sock) { - return ap_get_userdata(data, key, sock->cntxt); + return apr_get_userdata(data, key, sock->cntxt); } -ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, const char *key, - ap_status_t (*cleanup) (void *)) +apr_status_t apr_set_socketdata(apr_socket_t *sock, void *data, const char *key, + apr_status_t (*cleanup) (void *)) { - return ap_set_userdata(data, key, cleanup, sock->cntxt); + return apr_set_userdata(data, key, cleanup, sock->cntxt); } -ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock) +apr_status_t apr_get_os_sock(apr_os_sock_t *thesock, apr_socket_t *sock) { *thesock = sock->socketdes; return APR_SUCCESS; } -ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_sock_t *thesock, - ap_pool_t *cont) +apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, + apr_pool_t *cont) { if ((*sock) == NULL) { - (*sock) = (ap_socket_t *)ap_pcalloc(cont, sizeof(ap_socket_t)); + (*sock) = (apr_socket_t *)apr_pcalloc(cont, sizeof(apr_socket_t)); (*sock)->cntxt = cont; - (*sock)->local_addr = (struct sockaddr_in *)ap_pcalloc((*sock)->cntxt, + (*sock)->local_addr = (struct sockaddr_in *)apr_pcalloc((*sock)->cntxt, sizeof(struct sockaddr_in)); - (*sock)->remote_addr = (struct sockaddr_in *)ap_pcalloc((*sock)->cntxt, + (*sock)->remote_addr = (struct sockaddr_in *)apr_pcalloc((*sock)->cntxt, sizeof(struct sockaddr_in)); if ((*sock)->local_addr == NULL || (*sock)->remote_addr == NULL) { diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index d8044c9ac..8cee5e30a 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -55,7 +55,7 @@ #include "networkio.h" #include "apr_strings.h" -static ap_status_t soblock(int sd) +static apr_status_t soblock(int sd) { /* BeOS uses setsockopt at present for non blocking... */ #ifndef BEOS @@ -83,7 +83,7 @@ static ap_status_t soblock(int sd) return APR_SUCCESS; } -static ap_status_t sononblock(int sd) +static apr_status_t sononblock(int sd) { #ifndef BEOS int fd_flags; @@ -110,11 +110,11 @@ static ap_status_t sononblock(int sd) return APR_SUCCESS; } -ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) +apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on) { int one; struct linger li; - ap_status_t stat; + apr_status_t stat; if (on) one = 1; @@ -173,7 +173,7 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) return APR_SUCCESS; } -ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t *on) +apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) { switch(opt) { case APR_SO_TIMEOUT: @@ -185,7 +185,7 @@ ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t *on) return APR_SUCCESS; } -ap_status_t ap_gethostname(char *buf, ap_int32_t len, ap_pool_t *cont) +apr_status_t apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) { if (gethostname(buf, len) == -1) return errno; @@ -193,14 +193,14 @@ ap_status_t ap_gethostname(char *buf, ap_int32_t len, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_get_remote_hostname(char **name, ap_socket_t *sock) +apr_status_t apr_get_remote_hostname(char **name, apr_socket_t *sock) { struct hostent *hptr; hptr = gethostbyaddr((char *)&(sock->remote_addr->sin_addr), sizeof(struct in_addr), AF_INET); if (hptr != NULL) { - *name = ap_pstrdup(sock->cntxt, hptr->h_name); + *name = apr_pstrdup(sock->cntxt, hptr->h_name); if (*name) { return APR_SUCCESS; } diff --git a/network_io/win32/networkio.h b/network_io/win32/networkio.h index 296127288..3d5897a62 100644 --- a/network_io/win32/networkio.h +++ b/network_io/win32/networkio.h @@ -58,20 +58,20 @@ #include "apr_network_io.h" #include "apr_general.h" -struct ap_socket_t { - ap_pool_t *cntxt; +struct apr_socket_t { + apr_pool_t *cntxt; SOCKET sock; struct sockaddr_in *local_addr; struct sockaddr_in *remote_addr; size_t addr_len; - ap_interval_time_t timeout; - ap_int32_t disconnected; + apr_interval_time_t timeout; + apr_int32_t disconnected; int local_port_unknown; int local_interface_unknown; }; -struct ap_pollfd_t { - ap_pool_t *cntxt; +struct apr_pollfd_t { + apr_pool_t *cntxt; fd_set *read; int numread; fd_set *write; @@ -80,7 +80,7 @@ struct ap_pollfd_t { int numexcept; }; -ap_status_t status_from_res_error(int); +apr_status_t status_from_res_error(int); #endif /* ! NETWORK_IO_H */ diff --git a/network_io/win32/poll.c b/network_io/win32/poll.c index 11e9e35bb..843a4c5b2 100644 --- a/network_io/win32/poll.c +++ b/network_io/win32/poll.c @@ -60,16 +60,16 @@ #include <time.h> -ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_pool_t *cont) +apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont) { - (*new) = (ap_pollfd_t *)ap_palloc(cont, sizeof(ap_pollfd_t) * num); + (*new) = (apr_pollfd_t *)apr_palloc(cont, sizeof(apr_pollfd_t) * num); if ((*new) == NULL) { return APR_ENOMEM; } (*new)->cntxt = cont; - (*new)->read = (fd_set *)ap_palloc(cont, sizeof(fd_set)); - (*new)->write = (fd_set *)ap_palloc(cont, sizeof(fd_set)); - (*new)->except = (fd_set *)ap_palloc(cont, sizeof(fd_set)); + (*new)->read = (fd_set *)apr_palloc(cont, sizeof(fd_set)); + (*new)->write = (fd_set *)apr_palloc(cont, sizeof(fd_set)); + (*new)->except = (fd_set *)apr_palloc(cont, sizeof(fd_set)); FD_ZERO((*new)->read); (*new)->numread = 0; FD_ZERO((*new)->write); @@ -79,8 +79,8 @@ ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, - ap_socket_t *sock, ap_int16_t event) +apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, + apr_socket_t *sock, apr_int16_t event) { if (event & APR_POLLIN) { FD_SET(sock->sock, aprset->read); @@ -97,8 +97,8 @@ ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, return APR_SUCCESS; } -ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, - ap_interval_time_t timeout) +apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, + apr_interval_time_t timeout) { int rv; struct timeval tv, *tvptr; @@ -118,7 +118,7 @@ ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, if (newread == NULL && newwrite == NULL && newexcept == NULL) { Sleep(timeout / 1000); /* convert microseconds into milliseconds */ - return APR_TIMEUP; /* TODO - get everybody in synch with Win32 ap_status_t */ + return APR_TIMEUP; /* TODO - get everybody in synch with Win32 apr_status_t */ } else { if (timeout < 0) { @@ -140,9 +140,9 @@ ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, return APR_SUCCESS; } -ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *aprset) +apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset) { - ap_int16_t revents = 0; + apr_int16_t revents = 0; WSABUF data; int dummy; int flags = MSG_PEEK; @@ -151,7 +151,7 @@ ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *ap * variable here. */ data.len = 256; - data.buf = (char *)ap_palloc(aprset->cntxt, 256); + data.buf = (char *)apr_palloc(aprset->cntxt, 256); if (FD_ISSET(sock->sock, aprset->read)) { revents |= APR_POLLIN; @@ -193,19 +193,19 @@ ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *ap return APR_SUCCESS; } -ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, const char *key, void *data) +apr_status_t apr_get_polldata(apr_pollfd_t *pollfd, const char *key, void *data) { - return ap_get_userdata(data, key, pollfd->cntxt); + return apr_get_userdata(data, key, pollfd->cntxt); } -ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, const char *key, - ap_status_t (*cleanup) (void *)) +apr_status_t apr_set_polldata(apr_pollfd_t *pollfd, void *data, const char *key, + apr_status_t (*cleanup) (void *)) { - return ap_set_userdata(data, key, cleanup, pollfd->cntxt); + return apr_set_userdata(data, key, cleanup, pollfd->cntxt); } -ap_status_t ap_mask_poll_socket(ap_pollfd_t *aprset, - ap_socket_t *sock, ap_int16_t events) +apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, + apr_socket_t *sock, apr_int16_t events) { if (events & APR_POLLIN) { FD_CLR(sock->sock, aprset->read); @@ -222,12 +222,12 @@ ap_status_t ap_mask_poll_socket(ap_pollfd_t *aprset, return APR_SUCCESS; } -ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock) +apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock) { - return ap_mask_poll_socket(aprset, sock, ~0); + return apr_mask_poll_socket(aprset, sock, ~0); } -ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t events) +apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t events) { if (events & APR_POLLIN) { FD_ZERO(aprset->read); diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 5a46b3d1d..f26c724c1 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -60,9 +60,9 @@ #include "fileio.h" #include <time.h> -ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len) +apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_ssize_t *len) { - ap_ssize_t rv; + apr_ssize_t rv; WSABUF wsaData; int lasterror; DWORD dwBytes = 0; @@ -81,9 +81,9 @@ ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len) return APR_SUCCESS; } -ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) +apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_ssize_t *len) { - ap_ssize_t rv; + apr_ssize_t rv; WSABUF wsaData; int lasterror; DWORD dwBytes = 0; @@ -104,10 +104,10 @@ ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) } -ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec, - ap_int32_t nvec, ap_int32_t *nbytes) +apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, + apr_int32_t nvec, apr_int32_t *nbytes) { - ap_ssize_t rv; + apr_ssize_t rv; int i; int lasterror; DWORD dwBytes = 0; @@ -136,8 +136,8 @@ ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec, } #if APR_HAS_SENDFILE /* - * ap_status_t ap_sendfile(ap_socket_t *, ap_file_t *, ap_hdtr_t *, - * ap_off_t *, ap_size_t *, ap_int32_t flags) + * apr_status_t ap_sendfile(apr_socket_t *, apr_file_t *, apr_hdtr_t *, + * apr_off_t *, apr_size_t *, apr_int32_t flags) * Send a file from an open file descriptor to a socket, along with * optional headers and trailers * arg 1) The socket to which we're writing @@ -147,9 +147,9 @@ ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec, * arg 5) Number of bytes to send * arg 6) APR flags that are mapped to OS specific flags */ -ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, - ap_hdtr_t * hdtr, ap_off_t * offset, ap_size_t * len, - ap_int32_t flags) +apr_status_t ap_sendfile(apr_socket_t * sock, apr_file_t * file, + apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len, + apr_int32_t flags) { /* *#define WAIT_FOR_EVENT @@ -162,7 +162,7 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, * socket timeout code will work. I am hoping the socket will be signaled if the * setsockopt timeout expires. Need to verify this... */ - ap_ssize_t rv; + apr_ssize_t rv; OVERLAPPED overlapped; TRANSMIT_FILE_BUFFERS tfb, *ptfb = NULL; int i, ptr = 0; @@ -188,7 +188,7 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, for (i = 0; i < hdtr->numheaders; i++) { ptfb->HeadLength += hdtr->headers[i].iov_len; } - ptfb->Head = ap_palloc(sock->cntxt, ptfb->HeadLength); /* Should this be a malloc? */ + ptfb->Head = apr_palloc(sock->cntxt, ptfb->HeadLength); /* Should this be a malloc? */ for (i = 0; i < hdtr->numheaders; i++) { memcpy((char*)ptfb->Head + ptr, hdtr->headers[i].iov_base, @@ -209,7 +209,7 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file, ptfb->TailLength += hdtr->headers[i].iov_len; } - ptfb->Tail = ap_palloc(sock->cntxt, ptfb->TailLength); /* Should this be a malloc? */ + ptfb->Tail = apr_palloc(sock->cntxt, ptfb->TailLength); /* Should this be a malloc? */ for (i = 0; i < hdtr->numtrailers; i++) { memcpy((char*)ptfb->Tail + ptr, hdtr->trailers[i].iov_base, diff --git a/network_io/win32/sockaddr.c b/network_io/win32/sockaddr.c index d4c724338..a80c8f5ea 100644 --- a/network_io/win32/sockaddr.c +++ b/network_io/win32/sockaddr.c @@ -58,7 +58,7 @@ #include "apr_strings.h" #include <string.h> -static ap_status_t get_local_addr(ap_socket_t *sock) +static apr_status_t get_local_addr(apr_socket_t *sock) { size_t namelen = sizeof(*sock->local_addr); @@ -74,7 +74,7 @@ static ap_status_t get_local_addr(ap_socket_t *sock) -ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port) +apr_status_t apr_set_local_port(apr_socket_t *sock, apr_uint32_t port) { sock->local_addr->sin_port = htons((short)port); return APR_SUCCESS; @@ -82,7 +82,7 @@ ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port) -ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port) +apr_status_t apr_set_remote_port(apr_socket_t *sock, apr_uint32_t port) { sock->remote_addr->sin_port = htons((short)port); return APR_SUCCESS; @@ -90,10 +90,10 @@ ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port) -ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock) +apr_status_t apr_get_local_port(apr_uint32_t *port, apr_socket_t *sock) { if (sock->local_port_unknown) { - ap_status_t rv = get_local_addr(sock); + apr_status_t rv = get_local_addr(sock); if (rv != APR_SUCCESS) { return rv; @@ -106,7 +106,7 @@ ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock) -ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock) +apr_status_t apr_get_remote_port(apr_uint32_t *port, apr_socket_t *sock) { *port = ntohs(sock->remote_addr->sin_port); return APR_SUCCESS; @@ -114,7 +114,7 @@ ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock) -ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, const char *addr) +apr_status_t apr_set_local_ipaddr(apr_socket_t *sock, const char *addr) { u_long ipaddr; @@ -133,7 +133,7 @@ ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, const char *addr) return APR_SUCCESS; } -ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr) +apr_status_t apr_set_remote_ipaddr(apr_socket_t *sock, const char *addr) { u_long ipaddr; @@ -152,33 +152,33 @@ ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr) return APR_SUCCESS; } -ap_status_t ap_get_local_ipaddr(char **addr, ap_socket_t *sock) +apr_status_t apr_get_local_ipaddr(char **addr, apr_socket_t *sock) { if (sock->local_interface_unknown) { - ap_status_t rv = get_local_addr(sock); + apr_status_t rv = get_local_addr(sock); if (rv != APR_SUCCESS) { return rv; } } - *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr)); + *addr = apr_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr)); return APR_SUCCESS; } -ap_status_t ap_get_remote_ipaddr(char **addr, ap_socket_t *sock) +apr_status_t apr_get_remote_ipaddr(char **addr, apr_socket_t *sock) { - *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sin_addr)); + *addr = apr_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sin_addr)); return APR_SUCCESS; } -ap_status_t ap_get_local_name(struct sockaddr_in **name, ap_socket_t *sock) +apr_status_t apr_get_local_name(struct sockaddr_in **name, apr_socket_t *sock) { if (sock->local_port_unknown || sock->local_interface_unknown) { - ap_status_t rv = get_local_addr(sock); + apr_status_t rv = get_local_addr(sock); if (rv != APR_SUCCESS) { return rv; @@ -191,7 +191,7 @@ ap_status_t ap_get_local_name(struct sockaddr_in **name, ap_socket_t *sock) -ap_status_t ap_get_remote_name(struct sockaddr_in **name, ap_socket_t *sock) +apr_status_t apr_get_remote_name(struct sockaddr_in **name, apr_socket_t *sock) { *name = sock->remote_addr; return APR_SUCCESS; diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 3a5cf8445..dc6d5f72d 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -60,9 +60,9 @@ #include <string.h> -static ap_status_t socket_cleanup(void *sock) +static apr_status_t socket_cleanup(void *sock) { - ap_socket_t *thesocket = sock; + apr_socket_t *thesocket = sock; if (thesocket->sock != INVALID_SOCKET) { if (closesocket(thesocket->sock) == SOCKET_ERROR) { @@ -73,17 +73,17 @@ static ap_status_t socket_cleanup(void *sock) return APR_SUCCESS; } -ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) +apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont) { - (*new) = (ap_socket_t *)ap_pcalloc(cont, sizeof(ap_socket_t)); + (*new) = (apr_socket_t *)apr_pcalloc(cont, sizeof(apr_socket_t)); if ((*new) == NULL) { return APR_ENOMEM; } (*new)->cntxt = cont; - (*new)->local_addr = (struct sockaddr_in *)ap_pcalloc((*new)->cntxt, + (*new)->local_addr = (struct sockaddr_in *)apr_pcalloc((*new)->cntxt, sizeof(struct sockaddr_in)); - (*new)->remote_addr = (struct sockaddr_in *)ap_pcalloc((*new)->cntxt, + (*new)->remote_addr = (struct sockaddr_in *)apr_pcalloc((*new)->cntxt, sizeof(struct sockaddr_in)); if (((*new)->local_addr == NULL) || ((*new)->remote_addr == NULL)) { @@ -107,13 +107,13 @@ ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) (*new)->timeout = -1; (*new)->disconnected = 0; - ap_register_cleanup((*new)->cntxt, (void *)(*new), - socket_cleanup, ap_null_cleanup); + apr_register_cleanup((*new)->cntxt, (void *)(*new), + socket_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how) +apr_status_t apr_shutdown(apr_socket_t *thesocket, ap_shutdown_how_e how) { int winhow; @@ -139,13 +139,13 @@ ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how) } } -ap_status_t ap_close_socket(ap_socket_t *thesocket) +apr_status_t apr_close_socket(apr_socket_t *thesocket) { - ap_kill_cleanup(thesocket->cntxt, thesocket, socket_cleanup); + apr_kill_cleanup(thesocket->cntxt, thesocket, socket_cleanup); return socket_cleanup(thesocket); } -ap_status_t ap_bind(ap_socket_t *sock) +apr_status_t apr_bind(apr_socket_t *sock) { if (bind(sock->sock, (struct sockaddr *)sock->local_addr, sock->addr_len) == -1) { return WSAGetLastError(); @@ -158,7 +158,7 @@ ap_status_t ap_bind(ap_socket_t *sock) } } -ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) +apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog) { if (listen(sock->sock, backlog) == SOCKET_ERROR) return WSAGetLastError(); @@ -166,15 +166,15 @@ ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) return APR_SUCCESS; } -ap_status_t ap_accept(ap_socket_t **new, ap_socket_t *sock, ap_pool_t *connection_context) +apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *connection_context) { - (*new) = (ap_socket_t *)ap_pcalloc(connection_context, - sizeof(ap_socket_t)); + (*new) = (apr_socket_t *)apr_pcalloc(connection_context, + sizeof(apr_socket_t)); (*new)->cntxt = connection_context; - (*new)->local_addr = (struct sockaddr_in *)ap_pcalloc((*new)->cntxt, + (*new)->local_addr = (struct sockaddr_in *)apr_pcalloc((*new)->cntxt, sizeof(struct sockaddr_in)); - (*new)->remote_addr = (struct sockaddr_in *)ap_pcalloc((*new)->cntxt, + (*new)->remote_addr = (struct sockaddr_in *)apr_pcalloc((*new)->cntxt, sizeof(struct sockaddr_in)); memcpy((*new)->local_addr, sock->local_addr, sizeof(struct sockaddr_in)); @@ -207,12 +207,12 @@ ap_status_t ap_accept(ap_socket_t **new, ap_socket_t *sock, ap_pool_t *connectio (*new)->local_interface_unknown = 1; } - ap_register_cleanup((*new)->cntxt, (void *)(*new), - socket_cleanup, ap_null_cleanup); + apr_register_cleanup((*new)->cntxt, (void *)(*new), + socket_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_connect(ap_socket_t *sock, char *hostname) +apr_status_t apr_connect(apr_socket_t *sock, char *hostname) { struct hostent *hp; int lasterror; @@ -263,35 +263,35 @@ ap_status_t ap_connect(ap_socket_t *sock, char *hostname) return APR_SUCCESS; } -ap_status_t ap_get_socketdata(void **data, const char *key, ap_socket_t *socket) +apr_status_t apr_get_socketdata(void **data, const char *key, apr_socket_t *socket) { - return ap_get_userdata(data, key, socket->cntxt); + return apr_get_userdata(data, key, socket->cntxt); } -ap_status_t ap_set_socketdata(ap_socket_t *socket, void *data, const char *key, - ap_status_t (*cleanup) (void *)) +apr_status_t apr_set_socketdata(apr_socket_t *socket, void *data, const char *key, + apr_status_t (*cleanup) (void *)) { - return ap_set_userdata(data, key, cleanup, socket->cntxt); + return apr_set_userdata(data, key, cleanup, socket->cntxt); } -ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock) +apr_status_t apr_get_os_sock(apr_os_sock_t *thesock, apr_socket_t *sock) { *thesock = sock->sock; return APR_SUCCESS; } -ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_sock_t *thesock, - ap_pool_t *cont) +apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, + apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; } if ((*sock) == NULL) { - (*sock) = (ap_socket_t *)ap_pcalloc(cont, sizeof(ap_socket_t)); + (*sock) = (apr_socket_t *)apr_pcalloc(cont, sizeof(apr_socket_t)); (*sock)->cntxt = cont; - (*sock)->local_addr = (struct sockaddr_in *)ap_pcalloc((*sock)->cntxt, + (*sock)->local_addr = (struct sockaddr_in *)apr_pcalloc((*sock)->cntxt, sizeof(struct sockaddr_in)); - (*sock)->remote_addr = (struct sockaddr_in *)ap_pcalloc((*sock)->cntxt, + (*sock)->remote_addr = (struct sockaddr_in *)apr_pcalloc((*sock)->cntxt, sizeof(struct sockaddr_in)); if ((*sock)->local_addr == NULL || (*sock)->remote_addr == NULL) { diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c index 2d0845d63..2114ce928 100644 --- a/network_io/win32/sockopt.c +++ b/network_io/win32/sockopt.c @@ -58,7 +58,7 @@ #include "apr_strings.h" #include <string.h> -ap_status_t soblock(SOCKET sd) +apr_status_t soblock(SOCKET sd) { int zero = 0; @@ -68,7 +68,7 @@ ap_status_t soblock(SOCKET sd) return APR_SUCCESS; } -ap_status_t sononblock(SOCKET sd) +apr_status_t sononblock(SOCKET sd) { int one = 1; @@ -78,10 +78,10 @@ ap_status_t sononblock(SOCKET sd) return APR_SUCCESS; } -ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) +apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on) { int one; - ap_status_t stat; + apr_status_t stat; one = on ? 1 : 0; @@ -166,7 +166,7 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) return APR_SUCCESS; } -ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t *on) +apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on) { switch (opt) { case APR_SO_TIMEOUT: @@ -190,7 +190,7 @@ ap_status_t ap_getsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t *on) } -ap_status_t ap_gethostname(char *buf, int len, ap_pool_t *cont) +apr_status_t apr_gethostname(char *buf, int len, apr_pool_t *cont) { if (gethostname(buf, len) == -1) return WSAGetLastError(); @@ -198,7 +198,7 @@ ap_status_t ap_gethostname(char *buf, int len, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_get_remote_hostname(char **name, ap_socket_t *sock) +apr_status_t apr_get_remote_hostname(char **name, apr_socket_t *sock) { struct hostent *hptr; @@ -206,7 +206,7 @@ ap_status_t ap_get_remote_hostname(char **name, ap_socket_t *sock) sizeof(struct in_addr), AF_INET); if (hptr != NULL) { - *name = ap_pstrdup(sock->cntxt, hptr->h_name); + *name = apr_pstrdup(sock->cntxt, hptr->h_name); if (*name) { return APR_SUCCESS; } diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c index 2c1797775..e714aa779 100644 --- a/passwd/apr_getpass.c +++ b/passwd/apr_getpass.c @@ -52,7 +52,7 @@ * <http://www.apache.org/>. */ -/* ap_getpass.c: abstraction to provide for obtaining a password from the +/* apr_getpass.c: abstraction to provide for obtaining a password from the * command line in whatever way the OS supports. In the best case, it's a * wrapper for the system library's getpass() routine; otherwise, we * use one we define ourselves. @@ -204,7 +204,7 @@ static char *getpass(const char *prompt) * but the caller is *not* made aware of it. */ -APR_EXPORT(ap_status_t) ap_getpass(const char *prompt, char *pwbuf, size_t *bufsiz) +APR_EXPORT(apr_status_t) apr_getpass(const char *prompt, char *pwbuf, size_t *bufsiz) { char *pw_got = NULL; int result = 0; @@ -214,7 +214,7 @@ APR_EXPORT(ap_status_t) ap_getpass(const char *prompt, char *pwbuf, size_t *bufs *bufsiz = ERR_OVERFLOW; return APR_ENAMETOOLONG; } - ap_cpystrn(pwbuf, pw_got, *bufsiz); + apr_cpystrn(pwbuf, pw_got, *bufsiz); *bufsiz = result; return APR_SUCCESS; } diff --git a/passwd/apr_md5.c b/passwd/apr_md5.c index 68aebfb8b..edea993d4 100644 --- a/passwd/apr_md5.c +++ b/passwd/apr_md5.c @@ -86,7 +86,7 @@ */ /* - * The ap_MD5Encode() routine uses much code obtained from the FreeBSD 3.0 + * The apr_MD5Encode() routine uses much code obtained from the FreeBSD 3.0 * MD5 crypt() function, which is licenced as follows: * ---------------------------------------------------------------------------- * "THE BEER-WARE LICENSE" (Revision 42): @@ -146,7 +146,7 @@ static unsigned char PADDING[64] = }; #ifdef CHARSET_EBCDIC -static ap_xlate_t *xlate_ebcdic_to_ascii; /* used in ap_MD5Encode() */ +static apr_xlate_t *xlate_ebcdic_to_ascii; /* used in apr_MD5Encode() */ #endif /* F, G, H and I are basic MD5 functions. @@ -186,7 +186,7 @@ static ap_xlate_t *xlate_ebcdic_to_ascii; /* used in ap_MD5Encode() */ /* MD5 initialization. Begins an MD5 operation, writing a new context. */ -APR_EXPORT(ap_status_t) ap_MD5Init(ap_md5_ctx_t *context) +APR_EXPORT(apr_status_t) apr_MD5Init(ap_md5_ctx_t *context) { context->count[0] = context->count[1] = 0; /* Load magic initialization constants. */ @@ -205,9 +205,9 @@ APR_EXPORT(ap_status_t) ap_MD5Init(ap_md5_ctx_t *context) * to be used for translating the content before calculating the * digest. */ -APR_EXPORT(ap_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, ap_xlate_t *xlate) +APR_EXPORT(apr_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, apr_xlate_t *xlate) { - ap_status_t rv; + apr_status_t rv; int is_sb; /* TODO: remove the single-byte-only restriction from this code @@ -228,13 +228,13 @@ APR_EXPORT(ap_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, ap_xlate_t *xlate) operation, processing another message block, and updating the context. */ -APR_EXPORT(ap_status_t) ap_MD5Update(ap_md5_ctx_t *context, +APR_EXPORT(apr_status_t) apr_MD5Update(ap_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen) { unsigned int i, idx, partLen; #if APR_HAS_XLATE - ap_size_t inbytes_left, outbytes_left; + apr_size_t inbytes_left, outbytes_left; #endif /* Compute number of bytes mod 64 */ @@ -309,7 +309,7 @@ APR_EXPORT(ap_status_t) ap_MD5Update(ap_md5_ctx_t *context, /* MD5 finalization. Ends an MD5 message-digest operation, writing the the message digest and zeroizing the context. */ -APR_EXPORT(ap_status_t) ap_MD5Final(unsigned char digest[MD5_DIGESTSIZE], +APR_EXPORT(apr_status_t) apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], ap_md5_ctx_t *context) { unsigned char bits[8]; @@ -319,17 +319,17 @@ APR_EXPORT(ap_status_t) ap_MD5Final(unsigned char digest[MD5_DIGESTSIZE], Encode(bits, context->count, 8); #if APR_HAS_XLATE - /* ap_MD5Update() should not translate for this final round. */ + /* apr_MD5Update() should not translate for this final round. */ context->xlate = NULL; #endif /*APR_HAS_XLATE*/ /* Pad out to 56 mod 64. */ idx = (unsigned int) ((context->count[0] >> 3) & 0x3f); padLen = (idx < 56) ? (56 - idx) : (120 - idx); - ap_MD5Update(context, PADDING, padLen); + apr_MD5Update(context, PADDING, padLen); /* Append length (before padding) */ - ap_MD5Update(context, bits, 8); + apr_MD5Update(context, bits, 8); /* Store state in digest */ Encode(digest, context->state, MD5_DIGESTSIZE); @@ -459,7 +459,7 @@ static void Decode(UINT4 *output, const unsigned char *input, unsigned int len) } #ifdef CHARSET_EBCDIC -APR_EXPORT(ap_status_t) ap_MD5InitEBCDIC(ap_xlate_t *xlate) +APR_EXPORT(apr_status_t) ap_MD5InitEBCDIC(apr_xlate_t *xlate) { xlate_ebcdic_to_ascii = xlate; return APR_SUCCESS; @@ -489,7 +489,7 @@ static void to64(char *s, unsigned long v, int n) } } -APR_EXPORT(ap_status_t) ap_MD5Encode(const char *pw, const char *salt, +APR_EXPORT(apr_status_t) apr_MD5Encode(const char *pw, const char *salt, char *result, size_t nbytes) { /* @@ -534,7 +534,7 @@ APR_EXPORT(ap_status_t) ap_MD5Encode(const char *pw, const char *salt, /* * 'Time to make the doughnuts..' */ - ap_MD5Init(&ctx); + apr_MD5Init(&ctx); #ifdef CHARSET_EBCDIC ap_MD5SetXlate(&ctx, xlate_ebcdic_to_ascii); #endif @@ -542,28 +542,28 @@ APR_EXPORT(ap_status_t) ap_MD5Encode(const char *pw, const char *salt, /* * The password first, since that is what is most unknown */ - ap_MD5Update(&ctx, (unsigned char *)pw, strlen(pw)); + apr_MD5Update(&ctx, (unsigned char *)pw, strlen(pw)); /* * Then our magic string */ - ap_MD5Update(&ctx, (unsigned char *)apr1_id, strlen(apr1_id)); + apr_MD5Update(&ctx, (unsigned char *)apr1_id, strlen(apr1_id)); /* * Then the raw salt */ - ap_MD5Update(&ctx, (unsigned char *)sp, sl); + apr_MD5Update(&ctx, (unsigned char *)sp, sl); /* * Then just as many characters of the MD5(pw, salt, pw) */ - ap_MD5Init(&ctx1); - ap_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); - ap_MD5Update(&ctx1, (unsigned char *)sp, sl); - ap_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); - ap_MD5Final(final, &ctx1); + apr_MD5Init(&ctx1); + apr_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); + apr_MD5Update(&ctx1, (unsigned char *)sp, sl); + apr_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); + apr_MD5Final(final, &ctx1); for (pl = strlen(pw); pl > 0; pl -= MD5_DIGESTSIZE) { - ap_MD5Update(&ctx, final, (pl > MD5_DIGESTSIZE) ? MD5_DIGESTSIZE : pl); + apr_MD5Update(&ctx, final, (pl > MD5_DIGESTSIZE) ? MD5_DIGESTSIZE : pl); } /* @@ -576,10 +576,10 @@ APR_EXPORT(ap_status_t) ap_MD5Encode(const char *pw, const char *salt, */ for (i = strlen(pw); i != 0; i >>= 1) { if (i & 1) { - ap_MD5Update(&ctx, final, 1); + apr_MD5Update(&ctx, final, 1); } else { - ap_MD5Update(&ctx, (unsigned char *)pw, 1); + apr_MD5Update(&ctx, (unsigned char *)pw, 1); } } @@ -591,7 +591,7 @@ APR_EXPORT(ap_status_t) ap_MD5Encode(const char *pw, const char *salt, strncat(passwd, sp, sl); strcat(passwd, "$"); - ap_MD5Final(final, &ctx); + apr_MD5Final(final, &ctx); /* * And now, just to make sure things don't run too fast.. @@ -599,28 +599,28 @@ APR_EXPORT(ap_status_t) ap_MD5Encode(const char *pw, const char *salt, * need 30 seconds to build a 1000 entry dictionary... */ for (i = 0; i < 1000; i++) { - ap_MD5Init(&ctx1); + apr_MD5Init(&ctx1); if (i & 1) { - ap_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); + apr_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); } else { - ap_MD5Update(&ctx1, final, MD5_DIGESTSIZE); + apr_MD5Update(&ctx1, final, MD5_DIGESTSIZE); } if (i % 3) { - ap_MD5Update(&ctx1, (unsigned char *)sp, sl); + apr_MD5Update(&ctx1, (unsigned char *)sp, sl); } if (i % 7) { - ap_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); + apr_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); } if (i & 1) { - ap_MD5Update(&ctx1, final, MD5_DIGESTSIZE); + apr_MD5Update(&ctx1, final, MD5_DIGESTSIZE); } else { - ap_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); + apr_MD5Update(&ctx1, (unsigned char *)pw, strlen(pw)); } - ap_MD5Final(final,&ctx1); + apr_MD5Final(final,&ctx1); } p = passwd + strlen(passwd); @@ -638,18 +638,18 @@ APR_EXPORT(ap_status_t) ap_MD5Encode(const char *pw, const char *salt, */ memset(final, 0, sizeof(final)); - ap_cpystrn(result, passwd, nbytes - 1); + apr_cpystrn(result, passwd, nbytes - 1); return APR_SUCCESS; } /* * Validate a plaintext password against a smashed one. Use either - * crypt() (if available) or ap_MD5Encode(), depending upon the format + * crypt() (if available) or apr_MD5Encode(), depending upon the format * of the smashed input password. Return APR_SUCCESS if they match, or * APR_EMISMATCH if they don't. */ -APR_EXPORT(ap_status_t) ap_validate_password(const char *passwd, const char *hash) +APR_EXPORT(apr_status_t) apr_validate_password(const char *passwd, const char *hash) { char sample[120]; #if !defined(WIN32) && !defined(BEOS) @@ -659,17 +659,17 @@ APR_EXPORT(ap_status_t) ap_validate_password(const char *passwd, const char *has /* * The hash was created using our custom algorithm. */ - ap_MD5Encode(passwd, hash, sample, sizeof(sample)); + apr_MD5Encode(passwd, hash, sample, sizeof(sample)); } else { /* * It's not our algorithm, so feed it to crypt() if possible. */ #if defined(WIN32) || defined(BEOS) - ap_cpystrn(sample, passwd, sizeof(sample) - 1); + apr_cpystrn(sample, passwd, sizeof(sample) - 1); #else crypt_pw = crypt(passwd, hash); - ap_cpystrn(sample, crypt_pw, sizeof(sample) - 1); + apr_cpystrn(sample, crypt_pw, sizeof(sample) - 1); #endif } return (strcmp(sample, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; diff --git a/shmem/os2/shmem.c b/shmem/os2/shmem.c index 87536e546..7c8ade24e 100644 --- a/shmem/os2/shmem.c +++ b/shmem/os2/shmem.c @@ -68,14 +68,14 @@ struct shmem_t { -ap_status_t ap_shm_init(struct shmem_t **m, ap_size_t reqsize, const char *file, ap_pool_t *cont) +apr_status_t apr_shm_init(struct shmem_t **m, apr_size_t reqsize, const char *file, apr_pool_t *cont) { int rc; - struct shmem_t *newm = (struct shmem_t *)ap_palloc(cont, sizeof(struct shmem_t)); + struct shmem_t *newm = (struct shmem_t *)apr_palloc(cont, sizeof(struct shmem_t)); char *name = NULL; if (file) - name = ap_pstrcat(cont, "\\SHAREMEM\\", file, NULL); + name = apr_pstrcat(cont, "\\SHAREMEM\\", file, NULL); rc = DosAllocSharedMem(&(newm->memblock), name, reqsize, PAG_COMMIT|OBJ_GETTABLE|PAG_READ|PAG_WRITE); @@ -90,7 +90,7 @@ ap_status_t ap_shm_init(struct shmem_t **m, ap_size_t reqsize, const char *file, -ap_status_t ap_shm_destroy(struct shmem_t *m) +apr_status_t apr_shm_destroy(struct shmem_t *m) { _uclose(m->heap); _udestroy(m->heap, _FORCE); @@ -100,21 +100,21 @@ ap_status_t ap_shm_destroy(struct shmem_t *m) -void *ap_shm_malloc(struct shmem_t *m, ap_size_t reqsize) +void *apr_shm_malloc(struct shmem_t *m, apr_size_t reqsize) { return _umalloc(m->heap, reqsize); } -void *ap_shm_calloc(struct shmem_t *m, ap_size_t size) +void *apr_shm_calloc(struct shmem_t *m, apr_size_t size) { return _ucalloc(m->heap, size, 1); } -ap_status_t ap_shm_free(struct shmem_t *m, void *entity) +apr_status_t apr_shm_free(struct shmem_t *m, void *entity) { free(entity); return APR_SUCCESS; @@ -122,7 +122,7 @@ ap_status_t ap_shm_free(struct shmem_t *m, void *entity) -ap_status_t ap_get_shm_name(ap_shmem_t *c, ap_shm_name_t **name) +apr_status_t apr_get_shm_name(apr_shmem_t *c, apr_shm_name_t **name) { *name = NULL; return APR_ANONYMOUS; @@ -130,14 +130,14 @@ ap_status_t ap_get_shm_name(ap_shmem_t *c, ap_shm_name_t **name) -ap_status_t ap_set_shm_name(ap_shmem_t *c, ap_shm_name_t *name) +apr_status_t apr_set_shm_name(apr_shmem_t *c, apr_shm_name_t *name) { return APR_ANONYMOUS; } -ap_status_t ap_open_shmem(struct shmem_t *m) +apr_status_t apr_open_shmem(struct shmem_t *m) { int rc; @@ -152,7 +152,7 @@ ap_status_t ap_open_shmem(struct shmem_t *m) -ap_status_t ap_shm_avail(struct shmem_t *c, ap_size_t *size) +apr_status_t apr_shm_avail(struct shmem_t *c, apr_size_t *size) { return APR_ENOTIMPL; diff --git a/shmem/unix/shmem.c b/shmem/unix/shmem.c index 726a171fe..34bb94ff6 100644 --- a/shmem/unix/shmem.c +++ b/shmem/unix/shmem.c @@ -61,7 +61,7 @@ struct shmem_t { MM *mm; }; -ap_status_t ap_shm_init(struct shmem_t **m, ap_size_t reqsize, const char *file, ap_pool_t *cont) +apr_status_t apr_shm_init(struct shmem_t **m, apr_size_t reqsize, const char *file, apr_pool_t *cont) { MM *newmm = mm_create(reqsize, file); if (newmm == NULL) { @@ -72,13 +72,13 @@ ap_status_t ap_shm_init(struct shmem_t **m, ap_size_t reqsize, const char *file, return APR_SUCCESS; } -ap_status_t ap_shm_destroy(struct shmem_t *m) +apr_status_t apr_shm_destroy(struct shmem_t *m) { mm_destroy(m->mm); return APR_SUCCESS; } -void *ap_shm_malloc(struct shmem_t *c, ap_size_t reqsize) +void *apr_shm_malloc(struct shmem_t *c, apr_size_t reqsize) { if (c->mm == NULL) { return NULL; @@ -86,7 +86,7 @@ void *ap_shm_malloc(struct shmem_t *c, ap_size_t reqsize) return mm_malloc(c->mm, reqsize); } -void *ap_shm_calloc(struct shmem_t *shared, ap_size_t size) +void *apr_shm_calloc(struct shmem_t *shared, apr_size_t size) { if (shared == NULL) { return NULL; @@ -94,13 +94,13 @@ void *ap_shm_calloc(struct shmem_t *shared, ap_size_t size) return mm_calloc(shared->mm, 1, size); } -ap_status_t ap_shm_free(struct shmem_t *shared, void *entity) +apr_status_t apr_shm_free(struct shmem_t *shared, void *entity) { mm_free(shared->mm, entity); return APR_SUCCESS; } -ap_status_t ap_get_shm_name(ap_shmem_t *c, ap_shm_name_t **name) +apr_status_t apr_get_shm_name(apr_shmem_t *c, apr_shm_name_t **name) { #if APR_USES_ANONYMOUS_SHM *name = NULL; @@ -115,7 +115,7 @@ ap_status_t ap_get_shm_name(ap_shmem_t *c, ap_shm_name_t **name) #endif } -ap_status_t ap_set_shm_name(ap_shmem_t *c, ap_shm_name_t *name) +apr_status_t apr_set_shm_name(apr_shmem_t *c, apr_shm_name_t *name) { #if APR_USES_ANONYMOUS_SHM return APR_ANONYMOUS; @@ -129,7 +129,7 @@ ap_status_t ap_set_shm_name(ap_shmem_t *c, ap_shm_name_t *name) #endif } -ap_status_t ap_open_shmem(struct shmem_t *c) +apr_status_t apr_open_shmem(struct shmem_t *c) { #if APR_USES_ANONYMOUS_SHM /* When using MM, we don't need to open shared memory segments in child @@ -146,7 +146,7 @@ ap_status_t ap_open_shmem(struct shmem_t *c) #endif } -ap_status_t ap_shm_avail(struct shmem_t *c, ap_size_t *size) +apr_status_t apr_shm_avail(struct shmem_t *c, apr_size_t *size) { *size = mm_available(c); if (*size == 0) { diff --git a/strings/apr_cpystrn.c b/strings/apr_cpystrn.c index 0f6a503b2..7c12cc878 100644 --- a/strings/apr_cpystrn.c +++ b/strings/apr_cpystrn.c @@ -77,10 +77,10 @@ * the destination string, we return a pointer to the * terminating '\0' to allow us to "check" for truncation * - * ap_cpystrn() follows the same call structure as strncpy(). + * apr_cpystrn() follows the same call structure as strncpy(). */ -APR_EXPORT(char *) ap_cpystrn(char *dst, const char *src, size_t dst_size) +APR_EXPORT(char *) apr_cpystrn(char *dst, const char *src, size_t dst_size) { char *d, *end; @@ -120,9 +120,9 @@ APR_EXPORT(char *) ap_cpystrn(char *dst, const char *src, size_t dst_size) * pool and filled in with copies of the tokens * found during parsing of the arg_str. */ -APR_EXPORT(ap_status_t) ap_tokenize_to_argv(const char *arg_str, +APR_EXPORT(apr_status_t) apr_tokenize_to_argv(const char *arg_str, char ***argv_out, - ap_pool_t *token_context) + apr_pool_t *token_context) { const char *cp; const char *tmpCnt; @@ -172,7 +172,7 @@ APR_EXPORT(ap_status_t) ap_tokenize_to_argv(const char *arg_str, SKIP_WHITESPACE(tmpCnt); } - *argv_out = ap_palloc(token_context, numargs*sizeof(char*)); + *argv_out = apr_palloc(token_context, numargs*sizeof(char*)); if (*argv_out == NULL) { return (APR_ENOMEM); } @@ -184,15 +184,15 @@ APR_EXPORT(ap_status_t) ap_tokenize_to_argv(const char *arg_str, tmpCnt = cp; DETERMINE_NEXTSTRING(cp, isquoted); if (*cp == '\0') { - (*argv_out)[numargs] = ap_pstrdup(token_context, tmpCnt); + (*argv_out)[numargs] = apr_pstrdup(token_context, tmpCnt); numargs++; (*argv_out)[numargs] = '\0'; break; } else { cp++; - (*argv_out)[numargs] = ap_palloc(token_context, cp - tmpCnt); - ap_cpystrn((*argv_out)[numargs], tmpCnt, cp - tmpCnt); + (*argv_out)[numargs] = apr_palloc(token_context, cp - tmpCnt); + apr_cpystrn((*argv_out)[numargs], tmpCnt, cp - tmpCnt); numargs++; } @@ -212,7 +212,7 @@ APR_EXPORT(ap_status_t) ap_tokenize_to_argv(const char *arg_str, * Corrected Win32 to accept "a/b\\stuff", "a:stuff" */ -APR_EXPORT(const char *) ap_filename_of_pathname(const char *pathname) +APR_EXPORT(const char *) apr_filename_of_pathname(const char *pathname) { const char path_separator = '/'; const char *s = strrchr(pathname, path_separator); @@ -234,7 +234,7 @@ APR_EXPORT(const char *) ap_filename_of_pathname(const char *pathname) * collapse in place (src == dest) is legal. * returns terminating null ptr to dest string. */ -APR_EXPORT(char *) ap_collapse_spaces(char *dest, const char *src) +APR_EXPORT(char *) apr_collapse_spaces(char *dest, const char *src) { while (*src) { if (!ap_isspace(*src)) diff --git a/strings/apr_fnmatch.c b/strings/apr_fnmatch.c index b8449ef37..f1c86fca3 100644 --- a/strings/apr_fnmatch.c +++ b/strings/apr_fnmatch.c @@ -56,7 +56,7 @@ static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94"; static const char *rangematch(const char *, int, int); -APR_EXPORT(ap_status_t) ap_fnmatch(const char *pattern, const char *string, int flags) +APR_EXPORT(apr_status_t) apr_fnmatch(const char *pattern, const char *string, int flags) { const char *stringstart; char c, test; @@ -110,7 +110,7 @@ APR_EXPORT(ap_status_t) ap_fnmatch(const char *pattern, const char *string, int /* General case, use recursion. */ while ((test = *string) != EOS) { - if (!ap_fnmatch(pattern, string, flags & ~FNM_PERIOD)) { + if (!apr_fnmatch(pattern, string, flags & ~FNM_PERIOD)) { return (APR_SUCCESS); } if (test == '/' && flags & FNM_PATHNAME) { @@ -210,7 +210,7 @@ static const char *rangematch(const char *pattern, int test, int flags) /* This function is an Apache addition */ /* return non-zero if pattern has any glob chars in it */ -APR_EXPORT(int) ap_is_fnmatch(const char *pattern) +APR_EXPORT(int) apr_is_fnmatch(const char *pattern) { int nesting; diff --git a/strings/apr_snprintf.c b/strings/apr_snprintf.c index 4e377f8a3..3427baa69 100644 --- a/strings/apr_snprintf.c +++ b/strings/apr_snprintf.c @@ -51,7 +51,7 @@ * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * - * The ap_vsnprintf/ap_snprintf functions are based on, and used with the + * The apr_vsnprintf/apr_snprintf functions are based on, and used with the * permission of, the SIO stdio-replacement strx_* functions by Panos * Tsirigotis <panos@alumni.cs.colorado.edu> for xinetd. */ @@ -656,8 +656,8 @@ static char *conv_p2_quad(u_widest_int num, register int nbits, /* * Do format conversion placing the output in buffer */ -APR_EXPORT(int) ap_vformatter(int (*flush_func)(ap_vformatter_buff_t *), - ap_vformatter_buff_t *vbuff, const char *fmt, va_list ap) +APR_EXPORT(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), + apr_vformatter_buff_t *vbuff, const char *fmt, va_list ap) { register char *sp; register char *bep; @@ -1149,21 +1149,21 @@ APR_EXPORT(int) ap_vformatter(int (*flush_func)(ap_vformatter_buff_t *), } -static int snprintf_flush(ap_vformatter_buff_t *vbuff) +static int snprintf_flush(apr_vformatter_buff_t *vbuff) { /* if the buffer fills we have to abort immediately, there is no way - * to "flush" an ap_snprintf... there's nowhere to flush it to. + * to "flush" an apr_snprintf... there's nowhere to flush it to. */ return -1; } -APR_EXPORT_NONSTD(int) ap_snprintf(char *buf, size_t len, +APR_EXPORT_NONSTD(int) apr_snprintf(char *buf, size_t len, const char *format, ...) { int cc; va_list ap; - ap_vformatter_buff_t vbuff; + apr_vformatter_buff_t vbuff; if (len == 0) return 0; @@ -1172,18 +1172,18 @@ APR_EXPORT_NONSTD(int) ap_snprintf(char *buf, size_t len, vbuff.curpos = buf; vbuff.endpos = buf + len - 1; va_start(ap, format); - cc = ap_vformatter(snprintf_flush, &vbuff, format, ap); + cc = apr_vformatter(snprintf_flush, &vbuff, format, ap); va_end(ap); *vbuff.curpos = '\0'; return (cc == -1) ? len : cc; } -APR_EXPORT(int) ap_vsnprintf(char *buf, size_t len, const char *format, +APR_EXPORT(int) apr_vsnprintf(char *buf, size_t len, const char *format, va_list ap) { int cc; - ap_vformatter_buff_t vbuff; + apr_vformatter_buff_t vbuff; if (len == 0) return 0; @@ -1191,7 +1191,7 @@ APR_EXPORT(int) ap_vsnprintf(char *buf, size_t len, const char *format, /* save one byte for nul terminator */ vbuff.curpos = buf; vbuff.endpos = buf + len - 1; - cc = ap_vformatter(snprintf_flush, &vbuff, format, ap); + cc = apr_vformatter(snprintf_flush, &vbuff, format, ap); *vbuff.curpos = '\0'; return (cc == -1) ? len : cc; } diff --git a/strings/apr_strings.c b/strings/apr_strings.c index 2d53695f8..f072f260d 100644 --- a/strings/apr_strings.c +++ b/strings/apr_strings.c @@ -57,7 +57,7 @@ #include "apr_private.h" #include "apr_lib.h" -APR_EXPORT(char *) ap_pstrdup(ap_pool_t *a, const char *s) +APR_EXPORT(char *) apr_pstrdup(apr_pool_t *a, const char *s) { char *res; size_t len; @@ -66,31 +66,31 @@ APR_EXPORT(char *) ap_pstrdup(ap_pool_t *a, const char *s) return NULL; } len = strlen(s) + 1; - res = ap_palloc(a, len); + res = apr_palloc(a, len); memcpy(res, s, len); return res; } -APR_EXPORT(char *) ap_pstrndup(ap_pool_t *a, const char *s, ap_size_t n) +APR_EXPORT(char *) apr_pstrndup(apr_pool_t *a, const char *s, apr_size_t n) { char *res; if (s == NULL) { return NULL; } - res = ap_palloc(a, n + 1); + res = apr_palloc(a, n + 1); memcpy(res, s, n); res[n] = '\0'; return res; } -APR_EXPORT_NONSTD(char *) ap_pstrcat(ap_pool_t *a, ...) +APR_EXPORT_NONSTD(char *) apr_pstrcat(apr_pool_t *a, ...) { char *cp, *argp, *res; /* Pass one --- find length of required string */ - ap_size_t len = 0; + apr_size_t len = 0; va_list adummy; va_start(adummy, a); @@ -103,7 +103,7 @@ APR_EXPORT_NONSTD(char *) ap_pstrcat(ap_pool_t *a, ...) /* Allocate the required string */ - res = (char *) ap_palloc(a, len + 1); + res = (char *) apr_palloc(a, len + 1); cp = res; *cp = '\0'; diff --git a/strings/apr_strnatcmp.c b/strings/apr_strnatcmp.c index 8eeaf41cd..f1057fde6 100644 --- a/strings/apr_strnatcmp.c +++ b/strings/apr_strnatcmp.c @@ -140,12 +140,12 @@ static int strnatcmp0(char const *a, char const *b, int fold_case) -int ap_strnatcmp(char const *a, char const *b) { +int apr_strnatcmp(char const *a, char const *b) { return strnatcmp0(a, b, 0); } /* Compare, recognizing numeric string and ignoring case. */ -int ap_strnatcasecmp(char const *a, char const *b) { +int apr_strnatcasecmp(char const *a, char const *b) { return strnatcmp0(a, b, 1); } diff --git a/tables/apr_hash.c b/tables/apr_hash.c index f486a2698..2cff888ba 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -97,8 +97,8 @@ struct ap_hash_entry_t { * The count of hash entries may be greater depending on the chosen * collision rate. */ -struct ap_hash_t { - ap_pool_t *pool; +struct apr_hash_t { + apr_pool_t *pool; ap_hash_entry_t **array; size_t count, max; }; @@ -109,10 +109,10 @@ struct ap_hash_t { * * We keep a pointer to the next hash entry here to allow the current * hash entry to be freed or otherwise mangled between calls to - * ap_hash_next(). + * apr_hash_next(). */ -struct ap_hash_index_t { - ap_hash_t *ht; +struct apr_hash_index_t { + apr_hash_t *ht; ap_hash_entry_t *this, *next; int index; }; @@ -122,15 +122,15 @@ struct ap_hash_index_t { * Hash creation functions. */ -static ap_hash_entry_t **alloc_array(ap_hash_t *ht) +static ap_hash_entry_t **alloc_array(apr_hash_t *ht) { - return ap_pcalloc(ht->pool, sizeof(*ht->array) * (ht->max + 1)); + return apr_pcalloc(ht->pool, sizeof(*ht->array) * (ht->max + 1)); } -APR_EXPORT(ap_hash_t *) ap_make_hash(ap_pool_t *pool) +APR_EXPORT(apr_hash_t *) apr_make_hash(apr_pool_t *pool) { - ap_hash_t *ht; - ht = ap_palloc(pool, sizeof(ap_hash_t)); + apr_hash_t *ht; + ht = apr_palloc(pool, sizeof(apr_hash_t)); ht->pool = pool; ht->count = 0; ht->max = INITIAL_MAX; @@ -143,7 +143,7 @@ APR_EXPORT(ap_hash_t *) ap_make_hash(ap_pool_t *pool) * Hash iteration functions. */ -APR_EXPORT(ap_hash_index_t *) ap_hash_next(ap_hash_index_t *hi) +APR_EXPORT(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi) { hi->this = hi->next; while (!hi->this) { @@ -155,18 +155,18 @@ APR_EXPORT(ap_hash_index_t *) ap_hash_next(ap_hash_index_t *hi) return hi; } -APR_EXPORT(ap_hash_index_t *) ap_hash_first(ap_hash_t *ht) +APR_EXPORT(apr_hash_index_t *) apr_hash_first(apr_hash_t *ht) { - ap_hash_index_t *hi; - hi = ap_palloc(ht->pool, sizeof(*hi)); + apr_hash_index_t *hi; + hi = apr_palloc(ht->pool, sizeof(*hi)); hi->ht = ht; hi->index = 0; hi->this = NULL; hi->next = NULL; - return ap_hash_next(hi); + return apr_hash_next(hi); } -APR_EXPORT(void) ap_hash_this(ap_hash_index_t *hi, +APR_EXPORT(void) apr_hash_this(apr_hash_index_t *hi, const void **key, size_t *klen, void **val) @@ -181,14 +181,14 @@ APR_EXPORT(void) ap_hash_this(ap_hash_index_t *hi, * Resizing a hash table */ -static void resize_array(ap_hash_t *ht) +static void resize_array(apr_hash_t *ht) { - ap_hash_index_t *hi; + apr_hash_index_t *hi; ap_hash_entry_t **new_array; int i; new_array = alloc_array(ht); - for (hi = ap_hash_first(ht); hi; hi = ap_hash_next(hi)) { + for (hi = apr_hash_first(ht); hi; hi = apr_hash_next(hi)) { i = hi->this->hash & ht->max; hi->this->next = new_array[i]; new_array[i] = hi->this; @@ -205,7 +205,7 @@ static void resize_array(ap_hash_t *ht) * that hash entries can be removed. */ -static ap_hash_entry_t **find_entry(ap_hash_t *ht, +static ap_hash_entry_t **find_entry(apr_hash_t *ht, const void *key, size_t klen, const void *val) @@ -266,7 +266,7 @@ static ap_hash_entry_t **find_entry(ap_hash_t *ht, if (he || !val) return hep; /* add a new entry for non-NULL values */ - he = ap_pcalloc(ht->pool, sizeof(*he)); + he = apr_pcalloc(ht->pool, sizeof(*he)); he->hash = hash; he->key = key; he->klen = klen; @@ -280,7 +280,7 @@ static ap_hash_entry_t **find_entry(ap_hash_t *ht, return hep; } -APR_EXPORT(void *) ap_hash_get(ap_hash_t *ht, +APR_EXPORT(void *) apr_hash_get(apr_hash_t *ht, const void *key, size_t klen) { @@ -292,7 +292,7 @@ APR_EXPORT(void *) ap_hash_get(ap_hash_t *ht, return NULL; } -APR_EXPORT(void) ap_hash_set(ap_hash_t *ht, +APR_EXPORT(void) apr_hash_set(apr_hash_t *ht, const void *key, size_t klen, const void *val) diff --git a/tables/apr_tables.c b/tables/apr_tables.c index f8b6b04c8..f7661c49c 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -81,7 +81,7 @@ #endif /***************************************************************** - * This file contains array and ap_table_t functions only. + * This file contains array and apr_table_t functions only. */ /***************************************************************** @@ -89,7 +89,7 @@ * The 'array' functions... */ -static void make_array_core(ap_array_header_t *res, ap_pool_t *c, +static void make_array_core(apr_array_header_t *res, apr_pool_t *c, int nelts, int elt_size) { /* @@ -100,7 +100,7 @@ static void make_array_core(ap_array_header_t *res, ap_pool_t *c, nelts = 1; } - res->elts = ap_pcalloc(c, nelts * elt_size); + res->elts = apr_pcalloc(c, nelts * elt_size); res->cont = c; res->elt_size = elt_size; @@ -108,23 +108,23 @@ static void make_array_core(ap_array_header_t *res, ap_pool_t *c, res->nalloc = nelts; /* ...but this many allocated */ } -APR_EXPORT(ap_array_header_t *) ap_make_array(ap_pool_t *p, +APR_EXPORT(apr_array_header_t *) apr_make_array(apr_pool_t *p, int nelts, int elt_size) { - ap_array_header_t *res; + apr_array_header_t *res; - res = (ap_array_header_t *) ap_palloc(p, sizeof(ap_array_header_t)); + res = (apr_array_header_t *) apr_palloc(p, sizeof(apr_array_header_t)); make_array_core(res, p, nelts, elt_size); return res; } -APR_EXPORT(void *) ap_push_array(ap_array_header_t *arr) +APR_EXPORT(void *) apr_push_array(apr_array_header_t *arr) { if (arr->nelts == arr->nalloc) { int new_size = (arr->nalloc <= 0) ? 1 : arr->nalloc * 2; char *new_data; - new_data = ap_pcalloc(arr->cont, arr->elt_size * new_size); + new_data = apr_pcalloc(arr->cont, arr->elt_size * new_size); memcpy(new_data, arr->elts, arr->nalloc * arr->elt_size); arr->elts = new_data; @@ -135,8 +135,8 @@ APR_EXPORT(void *) ap_push_array(ap_array_header_t *arr) return arr->elts + (arr->elt_size * (arr->nelts - 1)); } -APR_EXPORT(void) ap_array_cat(ap_array_header_t *dst, - const ap_array_header_t *src) +APR_EXPORT(void) apr_array_cat(apr_array_header_t *dst, + const apr_array_header_t *src) { int elt_size = dst->elt_size; @@ -148,7 +148,7 @@ APR_EXPORT(void) ap_array_cat(ap_array_header_t *dst, new_size *= 2; } - new_data = ap_pcalloc(dst->cont, elt_size * new_size); + new_data = apr_pcalloc(dst->cont, elt_size * new_size); memcpy(new_data, dst->elts, dst->nalloc * elt_size); dst->elts = new_data; @@ -160,10 +160,10 @@ APR_EXPORT(void) ap_array_cat(ap_array_header_t *dst, dst->nelts += src->nelts; } -APR_EXPORT(ap_array_header_t *) ap_copy_array(ap_pool_t *p, - const ap_array_header_t *arr) +APR_EXPORT(apr_array_header_t *) apr_copy_array(apr_pool_t *p, + const apr_array_header_t *arr) { - ap_array_header_t *res = ap_make_array(p, arr->nalloc, arr->elt_size); + apr_array_header_t *res = apr_make_array(p, arr->nalloc, arr->elt_size); memcpy(res->elts, arr->elts, arr->elt_size * arr->nelts); res->nelts = arr->nelts; @@ -177,8 +177,8 @@ APR_EXPORT(ap_array_header_t *) ap_copy_array(ap_pool_t *p, * overhead of the full copy only where it is really needed. */ -static APR_INLINE void copy_array_hdr_core(ap_array_header_t *res, - const ap_array_header_t *arr) +static APR_INLINE void copy_array_hdr_core(apr_array_header_t *res, + const apr_array_header_t *arr) { res->elts = arr->elts; res->elt_size = arr->elt_size; @@ -186,13 +186,13 @@ static APR_INLINE void copy_array_hdr_core(ap_array_header_t *res, res->nalloc = arr->nelts; /* Force overflow on push */ } -APR_EXPORT(ap_array_header_t *) - ap_copy_array_hdr(ap_pool_t *p, - const ap_array_header_t *arr) +APR_EXPORT(apr_array_header_t *) + apr_copy_array_hdr(apr_pool_t *p, + const apr_array_header_t *arr) { - ap_array_header_t *res; + apr_array_header_t *res; - res = (ap_array_header_t *) ap_palloc(p, sizeof(ap_array_header_t)); + res = (apr_array_header_t *) apr_palloc(p, sizeof(apr_array_header_t)); res->cont = p; copy_array_hdr_core(res, arr); return res; @@ -200,32 +200,32 @@ APR_EXPORT(ap_array_header_t *) /* The above is used here to avoid consing multiple new array bodies... */ -APR_EXPORT(ap_array_header_t *) - ap_append_arrays(ap_pool_t *p, - const ap_array_header_t *first, - const ap_array_header_t *second) +APR_EXPORT(apr_array_header_t *) + apr_append_arrays(apr_pool_t *p, + const apr_array_header_t *first, + const apr_array_header_t *second) { - ap_array_header_t *res = ap_copy_array_hdr(p, first); + apr_array_header_t *res = apr_copy_array_hdr(p, first); - ap_array_cat(res, second); + apr_array_cat(res, second); return res; } -/* ap_array_pstrcat generates a new string from the ap_pool_t containing +/* apr_array_pstrcat generates a new string from the apr_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(ap_pool_t *p, - const ap_array_header_t *arr, +APR_EXPORT(char *) apr_array_pstrcat(apr_pool_t *p, + const apr_array_header_t *arr, const char sep) { char *cp, *res, **strpp; int i, len; if (arr->nelts <= 0 || arr->elts == NULL) { /* Empty table? */ - return (char *) ap_pcalloc(p, 1); + return (char *) apr_pcalloc(p, 1); } /* Pass one --- find length of required string */ @@ -245,7 +245,7 @@ APR_EXPORT(char *) ap_array_pstrcat(ap_pool_t *p, /* Allocate the required string */ - res = (char *) ap_palloc(p, len + 1); + res = (char *) apr_palloc(p, len + 1); cp = res; /* Pass two --- copy the argument strings into the result space */ @@ -282,32 +282,32 @@ APR_EXPORT(char *) ap_array_pstrcat(ap_pool_t *p, * in alloc.h */ #ifdef MAKE_TABLE_PROFILE -static ap_table_entry_t *table_push(ap_table_t *t) +static apr_table_entry_t *table_push(apr_table_t *t) { if (t->a.nelts == t->a.nalloc) { return NULL; } - return (ap_table_entry_t *) ap_push_array(&t->a); + return (apr_table_entry_t *) apr_push_array(&t->a); } #else /* MAKE_TABLE_PROFILE */ -#define table_push(t) ((ap_table_entry_t *) ap_push_array(&(t)->a)) +#define table_push(t) ((apr_table_entry_t *) apr_push_array(&(t)->a)) #endif /* MAKE_TABLE_PROFILE */ -APR_EXPORT(ap_table_t *) ap_make_table(ap_pool_t *p, int nelts) +APR_EXPORT(apr_table_t *) apr_make_table(apr_pool_t *p, int nelts) { - ap_table_t *t = ap_palloc(p, sizeof(ap_table_t)); + apr_table_t *t = apr_palloc(p, sizeof(apr_table_t)); - make_array_core(&t->a, p, nelts, sizeof(ap_table_entry_t)); + make_array_core(&t->a, p, nelts, sizeof(apr_table_entry_t)); #ifdef MAKE_TABLE_PROFILE t->creator = __builtin_return_address(0); #endif return t; } -APR_EXPORT(ap_table_t *) ap_copy_table(ap_pool_t *p, const ap_table_t *t) +APR_EXPORT(apr_table_t *) apr_copy_table(apr_pool_t *p, const apr_table_t *t) { - ap_table_t *new = ap_palloc(p, sizeof(ap_table_t)); + apr_table_t *new = apr_palloc(p, sizeof(apr_table_t)); #ifdef POOL_DEBUG /* we don't copy keys and values, so it's necessary that t->a.pool @@ -318,20 +318,20 @@ APR_EXPORT(ap_table_t *) ap_copy_table(ap_pool_t *p, const ap_table_t *t) abort(); } #endif - make_array_core(&new->a, p, t->a.nalloc, sizeof(ap_table_entry_t)); - memcpy(new->a.elts, t->a.elts, t->a.nelts * sizeof(ap_table_entry_t)); + make_array_core(&new->a, p, t->a.nalloc, sizeof(apr_table_entry_t)); + memcpy(new->a.elts, t->a.elts, t->a.nelts * sizeof(apr_table_entry_t)); new->a.nelts = t->a.nelts; return new; } -APR_EXPORT(void) ap_clear_table(ap_table_t *t) +APR_EXPORT(void) apr_clear_table(apr_table_t *t) { t->a.nelts = 0; } -APR_EXPORT(const char *) ap_table_get(const ap_table_t *t, const char *key) +APR_EXPORT(const char *) apr_table_get(const apr_table_t *t, const char *key) { - ap_table_entry_t *elts = (ap_table_entry_t *) t->a.elts; + apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; int i; if (key == NULL) { @@ -347,17 +347,17 @@ APR_EXPORT(const char *) ap_table_get(const ap_table_t *t, const char *key) return NULL; } -APR_EXPORT(void) ap_table_set(ap_table_t *t, const char *key, +APR_EXPORT(void) apr_table_set(apr_table_t *t, const char *key, const char *val) { register int i, j, k; - ap_table_entry_t *elts = (ap_table_entry_t *) t->a.elts; + apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; int done = 0; for (i = 0; i < t->a.nelts; ) { if (!strcasecmp(elts[i].key, key)) { if (!done) { - elts[i].val = ap_pstrdup(t->a.cont, val); + elts[i].val = apr_pstrdup(t->a.cont, val); done = 1; ++i; } @@ -375,17 +375,17 @@ APR_EXPORT(void) ap_table_set(ap_table_t *t, const char *key, } if (!done) { - elts = (ap_table_entry_t *) table_push(t); - elts->key = ap_pstrdup(t->a.cont, key); - elts->val = ap_pstrdup(t->a.cont, val); + elts = (apr_table_entry_t *) table_push(t); + elts->key = apr_pstrdup(t->a.cont, key); + elts->val = apr_pstrdup(t->a.cont, val); } } -APR_EXPORT(void) ap_table_setn(ap_table_t *t, const char *key, +APR_EXPORT(void) apr_table_setn(apr_table_t *t, const char *key, const char *val) { register int i, j, k; - ap_table_entry_t *elts = (ap_table_entry_t *) t->a.elts; + apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; int done = 0; #ifdef POOL_DEBUG @@ -422,16 +422,16 @@ APR_EXPORT(void) ap_table_setn(ap_table_t *t, const char *key, } if (!done) { - elts = (ap_table_entry_t *) table_push(t); + elts = (apr_table_entry_t *) table_push(t); elts->key = (char *)key; elts->val = (char *)val; } } -APR_EXPORT(void) ap_table_unset(ap_table_t *t, const char *key) +APR_EXPORT(void) apr_table_unset(apr_table_t *t, const char *key) { register int i, j, k; - ap_table_entry_t *elts = (ap_table_entry_t *) t->a.elts; + apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; for (i = 0; i < t->a.nelts; ) { if (!strcasecmp(elts[i].key, key)) { @@ -453,28 +453,28 @@ APR_EXPORT(void) ap_table_unset(ap_table_t *t, const char *key) } } -APR_EXPORT(void) ap_table_merge(ap_table_t *t, const char *key, +APR_EXPORT(void) apr_table_merge(apr_table_t *t, const char *key, const char *val) { - ap_table_entry_t *elts = (ap_table_entry_t *) t->a.elts; + apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; int i; for (i = 0; i < t->a.nelts; ++i) { if (!strcasecmp(elts[i].key, key)) { - elts[i].val = ap_pstrcat(t->a.cont, elts[i].val, ", ", val, NULL); + elts[i].val = apr_pstrcat(t->a.cont, elts[i].val, ", ", val, NULL); return; } } - elts = (ap_table_entry_t *) table_push(t); - elts->key = ap_pstrdup(t->a.cont, key); - elts->val = ap_pstrdup(t->a.cont, val); + elts = (apr_table_entry_t *) table_push(t); + elts->key = apr_pstrdup(t->a.cont, key); + elts->val = apr_pstrdup(t->a.cont, val); } -APR_EXPORT(void) ap_table_mergen(ap_table_t *t, const char *key, +APR_EXPORT(void) apr_table_mergen(apr_table_t *t, const char *key, const char *val) { - ap_table_entry_t *elts = (ap_table_entry_t *) t->a.elts; + apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; int i; #ifdef POOL_DEBUG @@ -492,30 +492,30 @@ APR_EXPORT(void) ap_table_mergen(ap_table_t *t, const char *key, for (i = 0; i < t->a.nelts; ++i) { if (!strcasecmp(elts[i].key, key)) { - elts[i].val = ap_pstrcat(t->a.cont, elts[i].val, ", ", val, NULL); + elts[i].val = apr_pstrcat(t->a.cont, elts[i].val, ", ", val, NULL); return; } } - elts = (ap_table_entry_t *) table_push(t); + elts = (apr_table_entry_t *) table_push(t); elts->key = (char *)key; elts->val = (char *)val; } -APR_EXPORT(void) ap_table_add(ap_table_t *t, const char *key, +APR_EXPORT(void) apr_table_add(apr_table_t *t, const char *key, const char *val) { - ap_table_entry_t *elts = (ap_table_entry_t *) t->a.elts; + apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; - elts = (ap_table_entry_t *) table_push(t); - elts->key = ap_pstrdup(t->a.cont, key); - elts->val = ap_pstrdup(t->a.cont, val); + elts = (apr_table_entry_t *) table_push(t); + elts->key = apr_pstrdup(t->a.cont, key); + elts->val = apr_pstrdup(t->a.cont, val); } -APR_EXPORT(void) ap_table_addn(ap_table_t *t, const char *key, +APR_EXPORT(void) apr_table_addn(apr_table_t *t, const char *key, const char *val) { - ap_table_entry_t *elts = (ap_table_entry_t *) t->a.elts; + apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; #ifdef POOL_DEBUG { @@ -530,16 +530,16 @@ APR_EXPORT(void) ap_table_addn(ap_table_t *t, const char *key, } #endif - elts = (ap_table_entry_t *) table_push(t); + elts = (apr_table_entry_t *) table_push(t); elts->key = (char *)key; elts->val = (char *)val; } -APR_EXPORT(ap_table_t *) ap_overlay_tables(ap_pool_t *p, - const ap_table_t *overlay, - const ap_table_t *base) +APR_EXPORT(apr_table_t *) apr_overlay_tables(apr_pool_t *p, + const apr_table_t *overlay, + const apr_table_t *base) { - ap_table_t *res; + apr_table_t *res; #ifdef POOL_DEBUG /* we don't copy keys and values, so it's necessary that @@ -558,11 +558,11 @@ APR_EXPORT(ap_table_t *) ap_overlay_tables(ap_pool_t *p, } #endif - res = ap_palloc(p, sizeof(ap_table_t)); + res = apr_palloc(p, sizeof(apr_table_t)); /* behave like append_arrays */ res->a.cont = p; copy_array_hdr_core(&res->a, &overlay->a); - ap_array_cat(&res->a, &base->a); + apr_array_cat(&res->a, &base->a); return res; } @@ -572,7 +572,7 @@ APR_EXPORT(ap_table_t *) ap_overlay_tables(ap_pool_t *p, * For each key value given as a vararg: * run the function pointed to as * int comp(void *r, char *key, char *value); - * on each valid key-value pair in the ap_table_t t that matches the vararg key, + * on each valid key-value pair in the apr_table_t t that matches the vararg key, * or once for every valid key-value pair if the vararg list is empty, * until the function returns false (0) or we finish the table. * @@ -582,47 +582,47 @@ APR_EXPORT(ap_table_t *) ap_overlay_tables(ap_pool_t *p, * only one traversal will be made and will cut short if comp returns 0. * * Note that the table_get and table_merge functions assume that each key in - * the ap_table_t is unique (i.e., no multiple entries with the same key). This + * the apr_table_t is unique (i.e., no multiple entries with the same key). This * function does not make that assumption, since it (unfortunately) isn't * true for some of Apache's tables. * * Note that rec is simply passed-on to the comp function, so that the * caller can pass additional info for the task. * - * ADDENDUM for ap_table_vdo(): + * ADDENDUM for apr_table_vdo(): * * The caching api will allow a user to walk the header values: * - * ap_status_t ap_cache_el_header_walk(ap_cache_el *el, + * apr_status_t ap_cache_el_header_walk(ap_cache_el *el, * int (*comp)(void *, const char *, const char *), void *rec, ...); * * So it can be ..., however from there I use a callback that use a va_list: * - * ap_status_t (*cache_el_header_walk)(ap_cache_el *el, + * apr_status_t (*cache_el_header_walk)(ap_cache_el *el, * int (*comp)(void *, const char *, const char *), void *rec, va_list); * * To pass those ...'s on down to the actual module that will handle walking * their headers, in the file case this is actually just an ap_table - and - * rather than reimplementing ap_table_do (which IMHO would be bad) I just + * rather than reimplementing apr_table_do (which IMHO would be bad) I just * called it with the va_list. For mod_shmem_cache I don't need it since I * can't use ap_table's, but mod_file_cache should (though a good hash would * be better, but that's a different issue :). * * So to make mod_file_cache easier to maintain, it's a good thing */ -APR_EXPORT(void) ap_table_do(int (*comp) (void *, const char *, const char *), - void *rec, const ap_table_t *t, ...) +APR_EXPORT(void) apr_table_do(int (*comp) (void *, const char *, const char *), + void *rec, const apr_table_t *t, ...) { va_list vp; va_start(vp, t); - ap_table_vdo(comp, rec, t, vp); + apr_table_vdo(comp, rec, t, vp); va_end(vp); } -APR_EXPORT(void) ap_table_vdo(int (*comp) (void *, const char *, const char *), - void *rec, const ap_table_t *t, va_list vp) +APR_EXPORT(void) apr_table_vdo(int (*comp) (void *, const char *, const char *), + void *rec, const apr_table_t *t, va_list vp) { char *argp; - ap_table_entry_t *elts = (ap_table_entry_t *) t->a.elts; + apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; int rv, i; argp = va_arg(vp, char *); do { @@ -666,14 +666,14 @@ static int sort_overlap(const void *va, const void *vb) #define ap_OVERLAP_TABLES_ON_STACK (512) #endif -APR_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, +APR_EXPORT(void) apr_overlap_tables(apr_table_t *a, const apr_table_t *b, unsigned flags) { overlap_key cat_keys_buf[ap_OVERLAP_TABLES_ON_STACK]; overlap_key *cat_keys; int nkeys; - ap_table_entry_t *e; - ap_table_entry_t *last_e; + apr_table_entry_t *e; + apr_table_entry_t *last_e; overlap_key *left; overlap_key *right; overlap_key *last; @@ -686,7 +686,7 @@ APR_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, /* XXX: could use scratch free space in a or b's pool instead... * which could save an allocation in b's pool. */ - cat_keys = ap_palloc(b->a.cont, sizeof(overlap_key) * nkeys); + cat_keys = apr_palloc(b->a.cont, sizeof(overlap_key) * nkeys); } nkeys = 0; @@ -694,7 +694,7 @@ APR_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, /* Create a list of the entries from a concatenated with the entries * from b. */ - e = (ap_table_entry_t *)a->a.elts; + e = (apr_table_entry_t *)a->a.elts; last_e = e + a->a.nelts; while (e < last_e) { cat_keys[nkeys].key = e->key; @@ -704,7 +704,7 @@ APR_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, ++e; } - e = (ap_table_entry_t *)b->a.elts; + e = (apr_table_entry_t *)b->a.elts; last_e = e + b->a.nelts; while (e < last_e) { cat_keys[nkeys].key = e->key; @@ -721,7 +721,7 @@ APR_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, */ a->a.nelts = 0; if (a->a.nalloc < nkeys) { - a->a.elts = ap_palloc(a->a.cont, a->a.elt_size * nkeys * 2); + a->a.elts = apr_palloc(a->a.cont, a->a.elt_size * nkeys * 2); a->a.nalloc = nkeys * 2; } @@ -743,7 +743,7 @@ APR_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, right = left + 1; if (right == last || strcasecmp(left->key, right->key)) { - ap_table_addn(a, left->key, left->val); + apr_table_addn(a, left->key, left->val); left = right; } else { @@ -763,7 +763,7 @@ APR_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, } while (right < last && !strcasecmp(left->key, right->key)); /* right points one past the last header to merge */ - value = ap_palloc(a->a.cont, len + 1); + value = apr_palloc(a->a.cont, len + 1); strp = value; for (;;) { memcpy(strp, left->val, left->order); @@ -776,7 +776,7 @@ APR_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, *strp++ = ' '; } *strp = 0; - ap_table_addn(a, (left-1)->key, value); + apr_table_addn(a, (left-1)->key, value); } } } @@ -788,7 +788,7 @@ APR_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, while (right < last && !strcasecmp(left->key, right->key)) { ++right; } - ap_table_addn(a, (right-1)->key, (right-1)->val); + apr_table_addn(a, (right-1)->key, (right-1)->val); left = right; } } diff --git a/test/abc.c b/test/abc.c index eeb215e6a..894228d85 100644 --- a/test/abc.c +++ b/test/abc.c @@ -6,17 +6,17 @@ int main(int argc, char *argv[]) { - ap_file_t *fd = NULL; + apr_file_t *fd = NULL; char ch; int status = 0; - ap_pool_t *context; + apr_pool_t *context; - ap_create_pool(&context, NULL); + apr_create_pool(&context, NULL); - ap_open(&fd, argv[1], APR_READ, -1, context); + apr_open(&fd, argv[1], APR_READ, -1, context); while (!status) { - status = ap_getc(&ch, fd); + status = apr_getc(&ch, fd); if (status == APR_EOF ) fprintf(stdout, "EOF, YEAH!!!!!!!!!\n"); else if (status == APR_SUCCESS) diff --git a/test/client.c b/test/client.c index 438fa03cf..845e643b3 100644 --- a/test/client.c +++ b/test/client.c @@ -62,17 +62,17 @@ int main(int argc, char *argv[]) { - ap_pool_t *context; - ap_socket_t *sock; - ap_ssize_t length; - ap_status_t stat; + apr_pool_t *context; + apr_socket_t *sock; + apr_ssize_t length; + apr_status_t stat; char datasend[STRLEN] = "Send data test"; char datarecv[STRLEN]; char msgbuf[80]; char *local_ipaddr, *remote_ipaddr; char *dest = "127.0.0.1"; - ap_uint32_t local_port, remote_port; - ap_interval_time_t read_timeout = -1; + apr_uint32_t local_port, remote_port; + apr_interval_time_t read_timeout = -1; setbuf(stdout, NULL); if (argc > 1) { @@ -84,22 +84,22 @@ int main(int argc, char *argv[]) } fprintf(stdout, "Initializing........."); - if (ap_initialize() != APR_SUCCESS) { + if (apr_initialize() != APR_SUCCESS) { fprintf(stderr, "Something went wrong\n"); exit(-1); } fprintf(stdout, "OK\n"); - atexit(ap_terminate); + atexit(apr_terminate); fprintf(stdout, "Creating context......."); - if (ap_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_create_pool(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Something went wrong\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tClient: Creating new socket......."); - if (ap_create_tcp_socket(&sock, context) != APR_SUCCESS) { + if (apr_create_tcp_socket(&sock, context) != APR_SUCCESS) { fprintf(stderr, "Couldn't create socket\n"); exit(-1); } @@ -107,8 +107,8 @@ int main(int argc, char *argv[]) if (read_timeout == -1) { fprintf(stdout, "\tClient: Setting socket option NONBLOCK......."); - if (ap_setsocketopt(sock, APR_SO_NONBLOCK, 1) != APR_SUCCESS) { - ap_close_socket(sock); + if (apr_setsocketopt(sock, APR_SO_NONBLOCK, 1) != APR_SUCCESS) { + apr_close_socket(sock); fprintf(stderr, "Couldn't set socket option\n"); exit(-1); } @@ -116,8 +116,8 @@ int main(int argc, char *argv[]) } fprintf(stdout, "\tClient: Setting port for socket......."); - if (ap_set_remote_port(sock, 8021) != APR_SUCCESS) { - ap_close_socket(sock); + if (apr_set_remote_port(sock, 8021) != APR_SUCCESS) { + apr_close_socket(sock); fprintf(stderr, "Couldn't set the port correctly\n"); exit(-1); } @@ -125,27 +125,27 @@ int main(int argc, char *argv[]) fprintf(stdout, "\tClient: Connecting to socket......."); - stat = ap_connect(sock, dest); + stat = apr_connect(sock, dest); if (stat != APR_SUCCESS) { - ap_close_socket(sock); + apr_close_socket(sock); fprintf(stderr, "Could not connect: %s (%d)\n", - ap_strerror(stat, msgbuf, sizeof(msgbuf)), stat); + apr_strerror(stat, msgbuf, sizeof(msgbuf)), stat); fflush(stderr); exit(-1); } fprintf(stdout, "OK\n"); - ap_get_remote_ipaddr(&remote_ipaddr, sock); - ap_get_remote_port(&remote_port, sock); - ap_get_local_ipaddr(&local_ipaddr, sock); - ap_get_local_port(&local_port, sock); + apr_get_remote_ipaddr(&remote_ipaddr, sock); + apr_get_remote_port(&remote_port, sock); + apr_get_local_ipaddr(&local_ipaddr, sock); + apr_get_local_port(&local_port, sock); fprintf(stdout, "\tClient socket: %s:%u -> %s:%u\n", local_ipaddr, local_port, remote_ipaddr, remote_port); fprintf(stdout, "\tClient: Trying to send data over socket......."); length = STRLEN; - if (ap_send(sock, datasend, &length) != APR_SUCCESS) { - ap_close_socket(sock); + if (apr_send(sock, datasend, &length) != APR_SUCCESS) { + apr_close_socket(sock); fprintf(stderr, "Problem sending data\n"); exit(-1); } @@ -153,7 +153,7 @@ int main(int argc, char *argv[]) if (read_timeout != -1) { fprintf(stdout, "\tClient: Setting read timeout......."); - stat = ap_setsocketopt(sock, APR_SO_TIMEOUT, read_timeout); + stat = apr_setsocketopt(sock, APR_SO_TIMEOUT, read_timeout); if (stat) { fprintf(stderr, "Problem setting timeout: %d\n", stat); exit(-1); @@ -164,29 +164,29 @@ int main(int argc, char *argv[]) length = STRLEN; fprintf(stdout, "\tClient: Trying to receive data over socket......."); - if ((stat = ap_recv(sock, datarecv, &length)) != APR_SUCCESS) { - ap_close_socket(sock); + if ((stat = apr_recv(sock, datarecv, &length)) != APR_SUCCESS) { + apr_close_socket(sock); fprintf(stderr, "Problem receiving data: %s (%d)\n", - ap_strerror(stat, msgbuf, sizeof(msgbuf)), stat); + apr_strerror(stat, msgbuf, sizeof(msgbuf)), stat); exit(-1); } if (strcmp(datarecv, "Recv data test")) { - ap_close_socket(sock); + apr_close_socket(sock); fprintf(stderr, "I did not receive the correct data %s\n", datarecv); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tClient: Shutting down socket......."); - if (ap_shutdown(sock, APR_SHUTDOWN_WRITE) != APR_SUCCESS) { - ap_close_socket(sock); + if (apr_shutdown(sock, APR_SHUTDOWN_WRITE) != APR_SUCCESS) { + apr_close_socket(sock); fprintf(stderr, "Could not shutdown socket\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tClient: Closing down socket......."); - if (ap_close_socket(sock) != APR_SUCCESS) { + if (apr_close_socket(sock) != APR_SUCCESS) { fprintf(stderr, "Could not shutdown socket\n"); exit(-1); } diff --git a/test/server.c b/test/server.c index aad0de270..77637db5d 100644 --- a/test/server.c +++ b/test/server.c @@ -61,123 +61,123 @@ int main(int argc, char *argv[]) { - ap_pool_t *context; - ap_socket_t *sock; - ap_socket_t *sock2; - ap_ssize_t length; - ap_int32_t rv; - ap_pollfd_t *sdset; + apr_pool_t *context; + apr_socket_t *sock; + apr_socket_t *sock2; + apr_ssize_t length; + apr_int32_t rv; + apr_pollfd_t *sdset; char datasend[STRLEN]; char datarecv[STRLEN] = "Recv data test"; char *local_ipaddr, *remote_ipaddr; - ap_uint32_t local_port, remote_port; + apr_uint32_t local_port, remote_port; fprintf(stdout, "Initializing........."); - if (ap_initialize() != APR_SUCCESS) { + if (apr_initialize() != APR_SUCCESS) { fprintf(stderr, "Something went wrong\n"); exit(-1); } fprintf(stdout, "OK\n"); - atexit(ap_terminate); + atexit(apr_terminate); fprintf(stdout, "Creating context......."); - if (ap_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_create_pool(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Could not create a context\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Creating new socket......."); - if (ap_create_tcp_socket(&sock, context) != APR_SUCCESS) { + if (apr_create_tcp_socket(&sock, context) != APR_SUCCESS) { fprintf(stderr, "Couldn't create socket\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Setting socket option NONBLOCK......."); - if (ap_setsocketopt(sock, APR_SO_NONBLOCK, 1) != APR_SUCCESS) { - ap_close_socket(sock); + if (apr_setsocketopt(sock, APR_SO_NONBLOCK, 1) != APR_SUCCESS) { + apr_close_socket(sock); fprintf(stderr, "Couldn't set socket option\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Setting socket option REUSEADDR......."); - if (ap_setsocketopt(sock, APR_SO_REUSEADDR, 1) != APR_SUCCESS) { - ap_close_socket(sock); + if (apr_setsocketopt(sock, APR_SO_REUSEADDR, 1) != APR_SUCCESS) { + apr_close_socket(sock); fprintf(stderr, "Couldn't set socket option\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Setting port for socket......."); - if (ap_set_local_port(sock, 8021) != APR_SUCCESS) { - ap_close_socket(sock); + if (apr_set_local_port(sock, 8021) != APR_SUCCESS) { + apr_close_socket(sock); fprintf(stderr, "Couldn't set the port correctly\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Binding socket to port......."); - if (ap_bind(sock) != APR_SUCCESS) { - ap_close_socket(sock); + if (apr_bind(sock) != APR_SUCCESS) { + apr_close_socket(sock); fprintf(stderr, "Could not bind\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Listening to socket......."); - if (ap_listen(sock, 8021) != APR_SUCCESS) { - ap_close_socket(sock); + if (apr_listen(sock, 8021) != APR_SUCCESS) { + apr_close_socket(sock); fprintf(stderr, "Could not listen\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Setting up socket for polling......."); - ap_setup_poll(&sdset, 1, context); - ap_add_poll_socket(sdset, sock, APR_POLLIN); + apr_setup_poll(&sdset, 1, context); + apr_add_poll_socket(sdset, sock, APR_POLLIN); fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Beginning to poll for socket......."); rv = 1; - if (ap_poll(sdset, &rv, -1) != APR_SUCCESS) { - ap_close_socket(sock); + if (apr_poll(sdset, &rv, -1) != APR_SUCCESS) { + apr_close_socket(sock); fprintf(stderr, "Select caused an error\n"); exit(-1); } else if (rv == 0) { - ap_close_socket(sock); + apr_close_socket(sock); fprintf(stderr, "I should not return until rv == 1\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Accepting a connection......."); - if (ap_accept(&sock2, sock, context) != APR_SUCCESS) { - ap_close_socket(sock); + if (apr_accept(&sock2, sock, context) != APR_SUCCESS) { + apr_close_socket(sock); fprintf(stderr, "Could not accept connection.\n"); exit(-1); } fprintf(stdout, "OK\n"); - ap_get_remote_ipaddr(&remote_ipaddr, sock2); - ap_get_remote_port(&remote_port, sock2); - ap_get_local_ipaddr(&local_ipaddr, sock2); - ap_get_local_port(&local_port, sock2); + apr_get_remote_ipaddr(&remote_ipaddr, sock2); + apr_get_remote_port(&remote_port, sock2); + apr_get_local_ipaddr(&local_ipaddr, sock2); + apr_get_local_port(&local_port, sock2); fprintf(stdout, "\tServer socket: %s:%u -> %s:%u\n", local_ipaddr, local_port, remote_ipaddr, remote_port); length = STRLEN; fprintf(stdout, "\tServer: Trying to recv data from socket......."); - if (ap_recv(sock2, datasend, &length) != APR_SUCCESS) { - ap_close_socket(sock); - ap_close_socket(sock2); + if (apr_recv(sock2, datasend, &length) != APR_SUCCESS) { + apr_close_socket(sock); + apr_close_socket(sock2); fprintf(stderr, "Problem recving data\n"); exit(-1); } if (strcmp(datasend, "Send data test")) { - ap_close_socket(sock); - ap_close_socket(sock2); + apr_close_socket(sock); + apr_close_socket(sock2); fprintf(stderr, "I did not receive the correct data %s\n", datarecv); exit(-1); } @@ -185,33 +185,33 @@ int main(int argc, char *argv[]) length = STRLEN; fprintf(stdout, "\tServer: Sending data over socket......."); - if (ap_send(sock2, datarecv, &length) != APR_SUCCESS) { - ap_close_socket(sock); - ap_close_socket(sock2); + if (apr_send(sock2, datarecv, &length) != APR_SUCCESS) { + apr_close_socket(sock); + apr_close_socket(sock2); fprintf(stderr, "Problem sending data\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: Shutting down accepte socket......."); - if (ap_shutdown(sock2, APR_SHUTDOWN_READ) != APR_SUCCESS) { - ap_close_socket(sock); - ap_close_socket(sock2); + if (apr_shutdown(sock2, APR_SHUTDOWN_READ) != APR_SUCCESS) { + apr_close_socket(sock); + apr_close_socket(sock2); fprintf(stderr, "Problem shutting down\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: closing duplicate socket......."); - if (ap_close_socket(sock2) != APR_SUCCESS) { - ap_close_socket(sock); + if (apr_close_socket(sock2) != APR_SUCCESS) { + apr_close_socket(sock); fprintf(stderr, "Problem closing down\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\tServer: closing original socket......."); - if (ap_close_socket(sock) != APR_SUCCESS) { + if (apr_close_socket(sock) != APR_SUCCESS) { fprintf(stderr, "Problem closing down\n"); exit(-1); } diff --git a/test/testargs.c b/test/testargs.c index 52ddf668f..448bf5cb8 100644 --- a/test/testargs.c +++ b/test/testargs.c @@ -65,14 +65,14 @@ int main(int argc, char * const argv[]) { - ap_pool_t *context; - ap_int32_t data; + apr_pool_t *context; + apr_int32_t data; - ap_initialize(); - atexit(ap_terminate); - ap_create_pool(&context, NULL); + apr_initialize(); + atexit(apr_terminate); + apr_create_pool(&context, NULL); - while (ap_getopt(argc, argv, "abc:d::", &data, context) == APR_SUCCESS) { + while (apr_getopt(argc, argv, "abc:d::", &data, context) == APR_SUCCESS) { switch(data) { case 'a': case 'b': diff --git a/test/testcontext.c b/test/testcontext.c index 7d11ae057..55efb11f3 100644 --- a/test/testcontext.c +++ b/test/testcontext.c @@ -63,33 +63,33 @@ #include <unistd.h> #endif -ap_status_t string_cleanup(void *data) +apr_status_t string_cleanup(void *data) { return APR_SUCCESS; } int main() { - ap_pool_t *context; + apr_pool_t *context; char *testdata; char *retdata; - if (ap_initialize() != APR_SUCCESS) { + if (apr_initialize() != APR_SUCCESS) { fprintf(stderr, "Couldn't initialize."); exit(-1); } - atexit(ap_terminate); + atexit(apr_terminate); - if (ap_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_create_pool(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); } - testdata = ap_pstrdup(context, "This is a test\n"); + testdata = apr_pstrdup(context, "This is a test\n"); - ap_set_userdata(testdata, "TEST", string_cleanup, context); + apr_set_userdata(testdata, "TEST", string_cleanup, context); - ap_get_userdata((void **)&retdata, "TEST", context); + apr_get_userdata((void **)&retdata, "TEST", context); if (!strcmp(testdata, retdata)) { fprintf(stdout, "User data is working ok\n"); diff --git a/test/testdso.c b/test/testdso.c index 110a74f1b..a050c8fde 100644 --- a/test/testdso.c +++ b/test/testdso.c @@ -9,11 +9,11 @@ int main (int argc, char ** argv) { - ap_dso_handle_t *h = NULL; - ap_dso_handle_sym_t func1 = NULL; - ap_dso_handle_sym_t func2 = NULL; - ap_status_t status; - ap_pool_t *cont; + apr_dso_handle_t *h = NULL; + apr_dso_handle_sym_t func1 = NULL; + apr_dso_handle_sym_t func2 = NULL; + apr_status_t status; + apr_pool_t *cont; void (*function)(void); void (*function1)(int); int *retval; @@ -23,19 +23,19 @@ int main (int argc, char ** argv) strcat(filename, "/"); strcat(filename, LIB_NAME); - ap_initialize(); - atexit(ap_terminate); + apr_initialize(); + atexit(apr_terminate); - if (ap_create_pool(&cont, NULL) != APR_SUCCESS) { + if (apr_create_pool(&cont, NULL) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); } fprintf(stdout,"Trying to load DSO now....................."); fflush(stdout); - if ((status = ap_dso_load(&h, filename, cont)) != APR_SUCCESS){ + if ((status = apr_dso_load(&h, filename, cont)) != APR_SUCCESS){ char my_error[256]; - ap_strerror(status, my_error, sizeof(my_error)); + apr_strerror(status, my_error, sizeof(my_error)); fprintf(stderr, "%s!\n", my_error); exit (-1); } @@ -43,7 +43,7 @@ int main (int argc, char ** argv) fprintf(stdout,"Trying to get the DSO's attention.........."); fflush(stdout); - if (ap_dso_sym(&func1, h, "print_hello") != APR_SUCCESS) { + if (apr_dso_sym(&func1, h, "print_hello") != APR_SUCCESS) { fprintf(stderr, "Failed!\n"); exit (-1); } @@ -54,7 +54,7 @@ int main (int argc, char ** argv) fprintf(stdout,"Saying farewell 5 times...................."); fflush(stdout); - if (ap_dso_sym(&func2, h, "print_goodbye") != APR_SUCCESS) { + if (apr_dso_sym(&func2, h, "print_goodbye") != APR_SUCCESS) { fprintf(stderr, "Failed!\n"); exit (-1); } @@ -65,7 +65,7 @@ int main (int argc, char ** argv) fprintf(stdout,"Checking how many times I said goodbye.."); fflush(stdout); - if (ap_dso_sym(&func1, h, "goodbyes") != APR_SUCCESS) { + if (apr_dso_sym(&func1, h, "goodbyes") != APR_SUCCESS) { fprintf(stderr, "Failed!\n"); exit (-1); } @@ -79,7 +79,7 @@ int main (int argc, char ** argv) } fprintf(stdout,"Trying to unload DSO now..................."); - if (ap_dso_unload(h) != APR_SUCCESS) { + if (apr_dso_unload(h) != APR_SUCCESS) { fprintf(stderr, "Failed!\n"); exit (-1); } @@ -87,7 +87,7 @@ int main (int argc, char ** argv) fprintf(stdout,"Checking it's been unloaded................"); fflush(stdout); - if (ap_dso_sym(&func1, h, "print_hello") == APR_SUCCESS) { + if (apr_dso_sym(&func1, h, "print_hello") == APR_SUCCESS) { fprintf(stderr, "Failed!\n"); exit (-1); } diff --git a/test/testfile.c b/test/testfile.c index 98afaf40f..347cc53ad 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -64,37 +64,37 @@ #include <unistd.h> #endif -int test_filedel(ap_pool_t *); -int testdirs(ap_pool_t *); -static void test_read(ap_pool_t *); +int test_filedel(apr_pool_t *); +int testdirs(apr_pool_t *); +static void test_read(apr_pool_t *); int main() { - ap_pool_t *context; - ap_pool_t *cont2; - ap_file_t *thefile = NULL; - ap_socket_t *testsock = NULL; - ap_pollfd_t *sdset = NULL; - ap_status_t status = 0; - ap_int32_t flag = APR_READ | APR_WRITE | APR_CREATE; - ap_ssize_t nbytes = 0; - ap_int32_t rv; - ap_off_t zer = 0; + apr_pool_t *context; + apr_pool_t *cont2; + apr_file_t *thefile = NULL; + apr_socket_t *testsock = NULL; + apr_pollfd_t *sdset = NULL; + apr_status_t status = 0; + apr_int32_t flag = APR_READ | APR_WRITE | APR_CREATE; + apr_ssize_t nbytes = 0; + apr_int32_t rv; + apr_off_t zer = 0; char *buf; char *str; char *filename = "test.fil"; char *teststr; - if (ap_initialize() != APR_SUCCESS) { + if (apr_initialize() != APR_SUCCESS) { fprintf(stderr, "Couldn't initialize."); exit(-1); } - atexit(ap_terminate); - if (ap_create_pool(&context, NULL) != APR_SUCCESS) { + atexit(apr_terminate); + if (apr_create_pool(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); } - if (ap_create_pool(&cont2, context) != APR_SUCCESS) { + if (apr_create_pool(&cont2, context) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); } @@ -102,7 +102,7 @@ int main() fprintf(stdout, "Testing file functions.\n"); fprintf(stdout, "\tOpening file......."); - if (ap_open(&thefile, filename, flag, APR_UREAD | APR_UWRITE | APR_GREAD, context) != APR_SUCCESS) { + if (apr_open(&thefile, filename, flag, APR_UREAD | APR_UWRITE | APR_GREAD, context) != APR_SUCCESS) { perror("Didn't open file"); exit(-1); } @@ -115,7 +115,7 @@ int main() fprintf(stderr, "Bad file des\n"); exit(-1); } - ap_get_filename(&str, thefile); + apr_get_filename(&str, thefile); if (strcmp(str, filename) != 0) { fprintf(stderr, "wrong filename\n"); exit(-1); @@ -126,12 +126,12 @@ int main() fprintf(stdout, "\tWriting to file......."); - nbytes = (ap_ssize_t)strlen("this is a test"); - if (ap_write(thefile, "this is a test", &nbytes) != APR_SUCCESS) { + nbytes = (apr_ssize_t)strlen("this is a test"); + if (apr_write(thefile, "this is a test", &nbytes) != APR_SUCCESS) { perror("something's wrong"); exit(-1); } - if (nbytes != (ap_ssize_t)strlen("this is a test")) { + if (nbytes != (apr_ssize_t)strlen("this is a test")) { fprintf(stderr, "didn't write properly.\n"); exit(-1); } @@ -141,7 +141,7 @@ int main() fprintf(stdout, "\tMoving to start of file......."); zer = 0; - if (ap_seek(thefile, SEEK_SET, &zer) != 0) { + if (apr_seek(thefile, SEEK_SET, &zer) != 0) { perror("couldn't seek to beginning of file."); exit(-1); } @@ -152,17 +152,17 @@ int main() #if APR_FILES_AS_SOCKETS fprintf(stdout, "\tThis platform supports files_like_sockets\n"); fprintf(stdout, "\t\tMaking file look like a socket......."); - if (ap_socket_from_file(&testsock, thefile) != APR_SUCCESS) { + if (apr_socket_from_file(&testsock, thefile) != APR_SUCCESS) { perror("Something went wrong"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "\t\tChecking for incoming data......."); - ap_setup_poll(&sdset, 1, context); - ap_add_poll_socket(sdset, testsock, APR_POLLIN); + apr_setup_poll(&sdset, 1, context); + apr_add_poll_socket(sdset, testsock, APR_POLLIN); rv = 1; - if (ap_poll(sdset, &rv, -1) != APR_SUCCESS) { + if (apr_poll(sdset, &rv, -1) != APR_SUCCESS) { fprintf(stderr, "Select caused an error\n"); exit(-1); } @@ -175,13 +175,13 @@ int main() fprintf(stdout, "\tReading from the file......."); - nbytes = (ap_ssize_t)strlen("this is a test"); - buf = (char *)ap_palloc(context, nbytes + 1); - if (ap_read(thefile, buf, &nbytes) != APR_SUCCESS) { + nbytes = (apr_ssize_t)strlen("this is a test"); + buf = (char *)apr_palloc(context, nbytes + 1); + if (apr_read(thefile, buf, &nbytes) != APR_SUCCESS) { perror("something's wrong"); exit(-1); } - if (nbytes != (ap_ssize_t)strlen("this is a test")) { + if (nbytes != (apr_ssize_t)strlen("this is a test")) { fprintf(stderr, "didn't read properly.\n"); exit(-1); } @@ -190,7 +190,7 @@ int main() } fprintf(stdout, "\tAdding user data to the file......."); - status = ap_set_filedata(thefile, "This is a test", "test", ap_null_cleanup); + status = apr_set_filedata(thefile, "This is a test", "test", apr_null_cleanup); if (status != APR_SUCCESS) { fprintf(stderr, "Couldn't add the data\n"); exit(-1); @@ -200,7 +200,7 @@ int main() } fprintf(stdout, "\tGetting user data from the file......."); - status = ap_get_filedata((void **)&teststr, "test", thefile); + status = apr_get_filedata((void **)&teststr, "test", thefile); if (status != APR_SUCCESS || strcmp(teststr, "This is a test")) { fprintf(stderr, "Couldn't get the data\n"); exit(-1); @@ -210,7 +210,7 @@ int main() } fprintf(stdout, "\tClosing File......."); - status = ap_close(thefile); + status = apr_close(thefile); if (status != APR_SUCCESS) { fprintf(stderr, "Couldn't close the file\n"); exit(-1); @@ -220,7 +220,7 @@ int main() } fprintf(stdout, "\tDeleting file......."); - status = ap_remove_file(filename, context); + status = apr_remove_file(filename, context); if (status != APR_SUCCESS) { fprintf(stderr, "Couldn't delete the file\n"); exit(-1); @@ -230,7 +230,7 @@ int main() } fprintf(stdout, "\tMaking sure it's gone......."); - status = ap_open(&thefile, filename, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, context); + status = apr_open(&thefile, filename, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, context); if (status == APR_SUCCESS) { fprintf(stderr, "I could open the file for some reason?\n"); exit(-1); @@ -246,26 +246,26 @@ int main() return 1; } -int test_filedel(ap_pool_t *context) +int test_filedel(apr_pool_t *context) { - ap_file_t *thefile = NULL; - ap_int32_t flag = APR_READ | APR_WRITE | APR_CREATE; - ap_status_t stat; + apr_file_t *thefile = NULL; + apr_int32_t flag = APR_READ | APR_WRITE | APR_CREATE; + apr_status_t stat; - stat = ap_open(&thefile, "testdel", flag, APR_UREAD | APR_UWRITE | APR_GREAD, context); + stat = apr_open(&thefile, "testdel", flag, APR_UREAD | APR_UWRITE | APR_GREAD, context); if (stat != APR_SUCCESS) { return stat; } - if ((stat = ap_close(thefile)) != APR_SUCCESS) { + if ((stat = apr_close(thefile)) != APR_SUCCESS) { return stat; } - if ((stat = ap_remove_file("testdel", context)) != APR_SUCCESS) { + if ((stat = apr_remove_file("testdel", context)) != APR_SUCCESS) { return stat; } - stat = ap_open(&thefile, "testdel", APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, context); + stat = apr_open(&thefile, "testdel", APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, context); if (stat == APR_SUCCESS) { return stat; } @@ -273,18 +273,18 @@ int test_filedel(ap_pool_t *context) return APR_SUCCESS; } -int testdirs(ap_pool_t *context) +int testdirs(apr_pool_t *context) { - ap_dir_t *temp; - ap_file_t *file = NULL; - ap_ssize_t bytes; + apr_dir_t *temp; + apr_file_t *file = NULL; + apr_ssize_t bytes; ap_filetype_e type; char *fname; fprintf(stdout, "Testing Directory functions.\n"); fprintf(stdout, "\tMakeing Directory......."); - if (ap_make_dir("testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE | APR_GREAD | APR_GWRITE | APR_GEXECUTE | APR_WREAD | APR_WWRITE | APR_WEXECUTE, context) != APR_SUCCESS) { + if (apr_make_dir("testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE | APR_GREAD | APR_GWRITE | APR_GEXECUTE | APR_WREAD | APR_WWRITE | APR_WEXECUTE, context) != APR_SUCCESS) { fprintf(stderr, "Could not create directory\n"); return -1; } @@ -292,16 +292,16 @@ int testdirs(ap_pool_t *context) fprintf(stdout, "OK\n"); } - if (ap_open(&file, "testdir/testfile", APR_READ | APR_WRITE | APR_CREATE, APR_UREAD | APR_UWRITE | APR_UEXECUTE, context) != APR_SUCCESS) {; + if (apr_open(&file, "testdir/testfile", APR_READ | APR_WRITE | APR_CREATE, APR_UREAD | APR_UWRITE | APR_UEXECUTE, context) != APR_SUCCESS) {; return -1; } bytes = strlen("Another test!!!"); - ap_write(file, "Another test!!", &bytes); - ap_close(file); + apr_write(file, "Another test!!", &bytes); + apr_close(file); fprintf(stdout, "\tOpening Directory......."); - if (ap_opendir(&temp, "testdir", context) != APR_SUCCESS) { + if (apr_opendir(&temp, "testdir", context) != APR_SUCCESS) { fprintf(stderr, "Could not open directory\n"); return -1; } @@ -310,7 +310,7 @@ int testdirs(ap_pool_t *context) } fprintf(stdout, "\tReading Directory......."); - if ((ap_readdir(temp)) != APR_SUCCESS) { + if ((apr_readdir(temp)) != APR_SUCCESS) { fprintf(stderr, "Could not read directory\n"); return -1; } @@ -324,11 +324,11 @@ int testdirs(ap_pool_t *context) /* Because I want the file I created, I am skipping the "." and ".." * files that are here. */ - if (ap_readdir(temp) != APR_SUCCESS) { + if (apr_readdir(temp) != APR_SUCCESS) { fprintf(stderr, "Error reading directory testdir"); return -1; } - ap_get_dir_filename(&fname, temp); + apr_get_dir_filename(&fname, temp); } while (fname[0] == '.'); if (strcmp(fname, "testfile")) { fprintf(stderr, "Got wrong file name %s\n", fname); @@ -337,7 +337,7 @@ int testdirs(ap_pool_t *context) fprintf(stdout, "OK\n"); fprintf(stdout, "\t\tFile type......."); - ap_dir_entry_ftype(&type, temp); + apr_dir_entry_ftype(&type, temp); if (type != APR_REG) { fprintf(stderr, "Got wrong file type\n"); return -1; @@ -345,19 +345,19 @@ int testdirs(ap_pool_t *context) fprintf(stdout, "OK\n"); fprintf(stdout, "\t\tFile size......."); - ap_dir_entry_size(&bytes, temp); - if (bytes != (ap_ssize_t)strlen("Another test!!!")) { + apr_dir_entry_size(&bytes, temp); + if (bytes != (apr_ssize_t)strlen("Another test!!!")) { fprintf(stderr, "Got wrong file size %d\n", bytes); return -1; } fprintf(stdout, "OK\n"); fprintf(stdout, "\tRewinding directory......."); - ap_rewinddir(temp); + apr_rewinddir(temp); fprintf(stdout, "OK\n"); fprintf(stdout, "\tClosing Directory......."); - if (ap_closedir(temp) != APR_SUCCESS) { + if (apr_closedir(temp) != APR_SUCCESS) { fprintf(stderr, "Could not close directory\n"); return -1; } @@ -366,7 +366,7 @@ int testdirs(ap_pool_t *context) } fprintf(stdout, "\tRemoving file from directory......."); - if (ap_remove_file("testdir/testfile", context) != APR_SUCCESS) { + if (apr_remove_file("testdir/testfile", context) != APR_SUCCESS) { fprintf(stderr, "Could not remove file\n"); return -1; } @@ -375,7 +375,7 @@ int testdirs(ap_pool_t *context) } fprintf(stdout, "\tRemoving Directory......."); - if (ap_remove_dir("testdir", context) != APR_SUCCESS) { + if (apr_remove_dir("testdir", context) != APR_SUCCESS) { fprintf(stderr, "Could not remove directory\n"); return -1; } @@ -389,51 +389,51 @@ int testdirs(ap_pool_t *context) #define TESTREAD_BLKSIZE 1024 #define APR_BUFFERSIZE 4096 /* This should match APR's buffer size. */ -static void create_testread(ap_pool_t *p, const char *fname) +static void create_testread(apr_pool_t *p, const char *fname) { - ap_file_t *f = NULL; - ap_status_t rv; + apr_file_t *f = NULL; + apr_status_t rv; char buf[TESTREAD_BLKSIZE]; - ap_ssize_t nbytes; + apr_ssize_t nbytes; /* Create a test file with known content. */ - rv = ap_open(&f, fname, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE, p); + rv = apr_open(&f, fname, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE, p); if (rv) { - fprintf(stderr, "ap_open()->%d/%s\n", - rv, ap_strerror(rv, buf, sizeof buf)); + fprintf(stderr, "apr_open()->%d/%s\n", + rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } nbytes = 4; - rv = ap_write(f, "abc\n", &nbytes); + rv = apr_write(f, "abc\n", &nbytes); assert(!rv && nbytes == 4); memset(buf, 'a', sizeof buf); nbytes = sizeof buf; - rv = ap_write(f, buf, &nbytes); + rv = apr_write(f, buf, &nbytes); assert(!rv && nbytes == sizeof buf); nbytes = 2; - rv = ap_write(f, "\n\n", &nbytes); + rv = apr_write(f, "\n\n", &nbytes); assert(!rv && nbytes == 2); - rv = ap_close(f); + rv = apr_close(f); assert(!rv); } -static char read_one(ap_file_t *f, int expected) +static char read_one(apr_file_t *f, int expected) { char bytes[3]; - ap_status_t rv; + apr_status_t rv; static int counter = 0; - ap_ssize_t nbytes; + apr_ssize_t nbytes; counter += 1; bytes[0] = bytes[2] = 0x01; if (counter % 2) { - rv = ap_getc(bytes + 1, f); + rv = apr_getc(bytes + 1, f); } else { nbytes = 1; - rv = ap_read(f, bytes + 1, &nbytes); + rv = apr_read(f, bytes + 1, &nbytes); assert(nbytes == 1); } assert(!rv); @@ -444,31 +444,31 @@ static char read_one(ap_file_t *f, int expected) return bytes[1]; } -static void test_read_guts(ap_pool_t *p, const char *fname, ap_int32_t extra_flags) +static void test_read_guts(apr_pool_t *p, const char *fname, apr_int32_t extra_flags) { - ap_file_t *f = NULL; - ap_status_t rv; - ap_ssize_t nbytes; + apr_file_t *f = NULL; + apr_status_t rv; + apr_ssize_t nbytes; char buf[1024]; int i; - rv = ap_open(&f, fname, APR_READ | extra_flags, 0, p); + rv = apr_open(&f, fname, APR_READ | extra_flags, 0, p); assert(!rv); read_one(f, 'a'); read_one(f, 'b'); if (extra_flags & APR_BUFFERED) { fprintf(stdout, - "\n\t\tskipping ap_ungetc() for APR_BUFFERED... " + "\n\t\tskipping apr_ungetc() for APR_BUFFERED... " "doesn't work yet...\n\t\t\t\t "); } else { - rv = ap_ungetc('b', f); + rv = apr_ungetc('b', f); assert(!rv); /* Note: some implementations move the file ptr back; * others just save up to one char; it isn't * portable to unget more than once. */ - /* Don't do this: rv = ap_ungetc('a', f); */ + /* Don't do this: rv = apr_ungetc('a', f); */ read_one(f, 'b'); } read_one(f, 'c'); @@ -478,20 +478,20 @@ static void test_read_guts(ap_pool_t *p, const char *fname, ap_int32_t extra_fla } read_one(f, '\n'); read_one(f, '\n'); - rv = ap_getc(buf, f); + rv = apr_getc(buf, f); assert(rv == APR_EOF); - rv = ap_close(f); + rv = apr_close(f); assert(!rv); f = NULL; - rv = ap_open(&f, fname, APR_READ | extra_flags, 0, p); + rv = apr_open(&f, fname, APR_READ | extra_flags, 0, p); assert(!rv); - rv = ap_fgets(buf, 10, f); + rv = apr_fgets(buf, 10, f); assert(!rv); assert(!strcmp(buf, "abc\n")); /* read first 800 of TESTREAD_BLKSIZE 'a's */ - rv = ap_fgets(buf, 801, f); + rv = apr_fgets(buf, 801, f); assert(!rv); assert(strlen(buf) == 800); for (i = 0; i < 800; i++) { @@ -499,7 +499,7 @@ static void test_read_guts(ap_pool_t *p, const char *fname, ap_int32_t extra_fla } /* read rest of the 'a's and the first newline */ - rv = ap_fgets(buf, sizeof buf, f); + rv = apr_fgets(buf, sizeof buf, f); assert(!rv); assert(strlen(buf) == TESTREAD_BLKSIZE - 800 + 1); for (i = 0; i < TESTREAD_BLKSIZE - 800; i++) { @@ -508,63 +508,63 @@ static void test_read_guts(ap_pool_t *p, const char *fname, ap_int32_t extra_fla assert(buf[TESTREAD_BLKSIZE - 800] == '\n'); /* read the last newline */ - rv = ap_fgets(buf, sizeof buf, f); + rv = apr_fgets(buf, sizeof buf, f); assert(!rv); assert(!strcmp(buf, "\n")); /* get APR_EOF */ - rv = ap_fgets(buf, sizeof buf, f); + rv = apr_fgets(buf, sizeof buf, f); assert(rv == APR_EOF); - /* get APR_EOF with ap_getc + /* get APR_EOF with apr_getc */ - rv = ap_getc(buf, f); + rv = apr_getc(buf, f); assert(rv == APR_EOF); - /* get APR_EOF with ap_read + /* get APR_EOF with apr_read */ nbytes = sizeof buf; - rv = ap_read(f, buf, &nbytes); + rv = apr_read(f, buf, &nbytes); assert(rv == APR_EOF); - rv = ap_close(f); + rv = apr_close(f); assert(!rv); } -static void test_bigread(ap_pool_t *p, const char *fname, ap_int32_t extra_flags) +static void test_bigread(apr_pool_t *p, const char *fname, apr_int32_t extra_flags) { - ap_file_t *f = NULL; - ap_status_t rv; + apr_file_t *f = NULL; + apr_status_t rv; char buf[APR_BUFFERSIZE * 2]; - ap_ssize_t nbytes; + apr_ssize_t nbytes; /* Create a test file with known content. */ - rv = ap_open(&f, fname, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE, p); + rv = apr_open(&f, fname, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE, p); if (rv) { - fprintf(stderr, "ap_open()->%d/%s\n", - rv, ap_strerror(rv, buf, sizeof buf)); + fprintf(stderr, "apr_open()->%d/%s\n", + rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } nbytes = APR_BUFFERSIZE; memset(buf, 0xFE, nbytes); - rv = ap_write(f, buf, &nbytes); + rv = apr_write(f, buf, &nbytes); assert(!rv && nbytes == APR_BUFFERSIZE); - rv = ap_close(f); + rv = apr_close(f); assert(!rv); f = NULL; - rv = ap_open(&f, fname, APR_READ | extra_flags, 0, p); + rv = apr_open(&f, fname, APR_READ | extra_flags, 0, p); assert(!rv); nbytes = sizeof buf; - rv = ap_read(f, buf, &nbytes); + rv = apr_read(f, buf, &nbytes); assert(!rv); assert(nbytes == APR_BUFFERSIZE); - rv = ap_close(f); + rv = apr_close(f); assert(!rv); } -static void test_read(ap_pool_t *p) +static void test_read(apr_pool_t *p) { const char *fname = "testread.dat"; - ap_status_t rv; + apr_status_t rv; fprintf(stdout, "Testing file read functions.\n"); @@ -581,7 +581,7 @@ static void test_read(ap_pool_t *p) fprintf(stdout, "\tMore unbuffered file tests......"); test_bigread(p, fname, 0); fprintf(stdout, "OK\n"); - rv = ap_remove_file(fname, p); + rv = apr_remove_file(fname, p); assert(!rv); fprintf(stdout, "\tAll read tests...........OK\n"); } diff --git a/test/testmd5.c b/test/testmd5.c index 5c6ce6f2b..b05c1c87f 100644 --- a/test/testmd5.c +++ b/test/testmd5.c @@ -81,15 +81,15 @@ struct testcase testcases[] = "\xd1\xa1\xc0\x97\x8a\x60\xbb\xfb\x2a\x25\x46\x9d\xa5\xae\xd0\xb0"} }; -static void try(const void *buf, size_t bufLen, ap_xlate_t *xlate, +static void try(const void *buf, size_t bufLen, apr_xlate_t *xlate, const void *digest) { int i; - ap_status_t rv; + apr_status_t rv; ap_md5_ctx_t context; unsigned char hash[MD5_DIGESTSIZE]; - rv = ap_MD5Init(&context); + rv = apr_MD5Init(&context); assert(!rv); if (xlate) { @@ -101,10 +101,10 @@ static void try(const void *buf, size_t bufLen, ap_xlate_t *xlate, #endif } - rv = ap_MD5Update(&context, buf, bufLen); + rv = apr_MD5Update(&context, buf, bufLen); assert(!rv); - rv = ap_MD5Final(hash, &context); + rv = apr_MD5Final(hash, &context); assert(!rv); for (i = 0; i < MD5_DIGESTSIZE; i++) { @@ -128,9 +128,9 @@ static void try(const void *buf, size_t bufLen, ap_xlate_t *xlate, int main(int argc, char **argv) { - ap_status_t rv; - ap_xlate_t *xlate = NULL; - ap_pool_t *pool; + apr_status_t rv; + apr_xlate_t *xlate = NULL; + apr_pool_t *pool; const char *src = NULL, *dst = NULL; int cur; @@ -148,11 +148,11 @@ int main(int argc, char **argv) exit(1); } - rv = ap_initialize(); + rv = apr_initialize(); assert(!rv); - atexit(ap_terminate); + atexit(apr_terminate); - rv = ap_create_pool(&pool, NULL); + rv = apr_create_pool(&pool, NULL); if (src) { #if APR_HAS_XLATE @@ -161,7 +161,7 @@ int main(int argc, char **argv) char buf[80]; fprintf(stderr, "ap_xlate_open()->%s (%d)\n", - ap_strerror(rv, buf, sizeof(buf)), rv); + apr_strerror(rv, buf, sizeof(buf)), rv); exit(1); } #else diff --git a/test/testmmap.c b/test/testmmap.c index 3f58ec3c6..da13fd86b 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -69,36 +69,36 @@ int main() { - ap_pool_t *context; - ap_mmap_t *themmap = NULL; - ap_file_t *thefile = NULL; - ap_finfo_t finfo; - ap_int32_t flag = APR_READ; + apr_pool_t *context; + apr_mmap_t *themmap = NULL; + apr_file_t *thefile = NULL; + apr_finfo_t finfo; + apr_int32_t flag = APR_READ; char *file1; fprintf (stdout,"APR MMAP Test\n*************\n\n"); fprintf(stdout,"Initializing........................"); - if (ap_initialize() != APR_SUCCESS) { + if (apr_initialize() != APR_SUCCESS) { fprintf(stderr, "Failed.\n"); exit(-1); } fprintf(stdout,"OK\n"); - atexit(ap_terminate); + atexit(apr_terminate); fprintf(stdout,"Creating context...................."); - if (ap_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_create_pool(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Failed.\n"); exit(-1); } fprintf(stdout,"OK\n"); - file1 = (char*) ap_palloc(context, sizeof(char) * PATH_LEN); + file1 = (char*) apr_palloc(context, sizeof(char) * PATH_LEN); getcwd(file1, PATH_LEN); strncat(file1,"/testmmap.c",11); fprintf(stdout, "Opening file........................"); - if (ap_open(&thefile, file1, flag, APR_UREAD | APR_GREAD, context) != APR_SUCCESS) { + if (apr_open(&thefile, file1, flag, APR_UREAD | APR_GREAD, context) != APR_SUCCESS) { perror("Didn't open file"); exit(-1); } @@ -107,7 +107,7 @@ int main() } fprintf(stderr, "Getting file size..................."); - if (ap_getfileinfo(&finfo, thefile) != APR_SUCCESS) { + if (apr_getfileinfo(&finfo, thefile) != APR_SUCCESS) { perror("Didn't get file information!"); exit(-1); } @@ -116,14 +116,14 @@ int main() } fprintf(stdout,"Trying to mmap the file............."); - if (ap_mmap_create(&themmap, thefile, 0, finfo.size, context) != APR_SUCCESS) { + if (apr_mmap_create(&themmap, thefile, 0, finfo.size, context) != APR_SUCCESS) { fprintf(stderr,"Failed!\n"); exit(-1); } fprintf(stdout,"OK\n"); fprintf(stdout,"Trying to delete the mmap file......"); - if (ap_mmap_delete(themmap) != APR_SUCCESS) { + if (apr_mmap_delete(themmap) != APR_SUCCESS) { fprintf(stderr,"Failed!\n"); exit (-1); } diff --git a/test/testoc.c b/test/testoc.c index 3b60b0913..084b85187 100644 --- a/test/testoc.c +++ b/test/testoc.c @@ -85,44 +85,44 @@ void ocmaint(int reason, void *data, int status) int main(int argc, char *argv[]) { - ap_pool_t *context; - ap_proc_t newproc; - ap_procattr_t *procattr = NULL; - ap_file_t *std = NULL; + apr_pool_t *context; + apr_proc_t newproc; + apr_procattr_t *procattr = NULL; + apr_file_t *std = NULL; char *args[3]; if (argc > 1) { while (1); } - if (ap_initialize() != APR_SUCCESS) { + if (apr_initialize() != APR_SUCCESS) { fprintf(stderr, "Couldn't initialize."); exit(-1); } - atexit(ap_terminate); - if (ap_create_pool(&context, NULL) != APR_SUCCESS) { + atexit(apr_terminate); + if (apr_create_pool(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); } - args[0] = ap_pstrdup(context, "occhild"); - args[1] = ap_pstrdup(context, "-X"); + args[0] = apr_pstrdup(context, "occhild"); + args[1] = apr_pstrdup(context, "-X"); args[2] = NULL; fprintf(stdout, "[PARENT] Creating procattr............."); fflush(stdout); - if (ap_createprocattr_init(&procattr, context) != APR_SUCCESS) { + if (apr_createprocattr_init(&procattr, context) != APR_SUCCESS) { fprintf(stderr, "Could not create attr\n"); exit(-1);; } else { - ap_setprocattr_io(procattr, APR_FULL_BLOCK, APR_NO_PIPE, APR_NO_PIPE); + apr_setprocattr_io(procattr, APR_FULL_BLOCK, APR_NO_PIPE, APR_NO_PIPE); } fprintf(stdout, "OK\n"); fprintf(stdout, "[PARENT] Starting other child.........."); fflush(stdout); - if (ap_create_process(&newproc, "./occhild", args, NULL, procattr, context) + if (apr_create_process(&newproc, "./occhild", args, NULL, procattr, context) != APR_SUCCESS) { fprintf(stderr, "error starting other child\n"); exit(-1); @@ -131,12 +131,12 @@ int main(int argc, char *argv[]) std = newproc.in; - ap_register_other_child(&newproc, ocmaint, NULL, std, context); + apr_register_other_child(&newproc, ocmaint, NULL, std, context); fprintf(stdout, "[PARENT] Sending SIGKILL to child......"); fflush(stdout); sleep(1); - if (ap_kill(&newproc, SIGKILL) != APR_SUCCESS) { + if (apr_kill(&newproc, SIGKILL) != APR_SUCCESS) { fprintf(stderr,"couldn't send the signal!\n"); exit(-1); } @@ -144,10 +144,10 @@ int main(int argc, char *argv[]) /* allow time for things to settle... */ sleep(3); - ap_probe_writable_fds(); + apr_probe_writable_fds(); fprintf(stdout, "[PARENT] Checking on children..........\n"); - ap_check_other_child(); + apr_check_other_child(); return 1; } diff --git a/test/testpipe.c b/test/testpipe.c index 91ec156a7..9075c056e 100644 --- a/test/testpipe.c +++ b/test/testpipe.c @@ -64,20 +64,20 @@ int main(void) { - ap_pool_t *context; - ap_file_t *readp = NULL; - ap_file_t *writep = NULL; - ap_size_t nbytes; - ap_status_t rv; + apr_pool_t *context; + apr_file_t *readp = NULL; + apr_file_t *writep = NULL; + apr_size_t nbytes; + apr_status_t rv; char *buf; char msgbuf[120]; - if (ap_initialize() != APR_SUCCESS) { + if (apr_initialize() != APR_SUCCESS) { fprintf(stderr, "Couldn't initialize."); exit(-1); } - atexit(ap_terminate); - if (ap_create_pool(&context, NULL) != APR_SUCCESS) { + atexit(apr_terminate); + if (apr_create_pool(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Couldn't allocate context."); exit(-1); } @@ -85,9 +85,9 @@ int main(void) fprintf(stdout, "Testing pipe functions.\n"); fprintf(stdout, "\tCreating pipes......."); - if ((rv = ap_create_pipe(&readp, &writep, context)) != APR_SUCCESS) { - fprintf(stderr, "ap_create_pipe()->%d/%s\n", - rv, ap_strerror(rv, msgbuf, sizeof msgbuf)); + if ((rv = apr_create_pipe(&readp, &writep, context)) != APR_SUCCESS) { + fprintf(stderr, "apr_create_pipe()->%d/%s\n", + rv, apr_strerror(rv, msgbuf, sizeof msgbuf)); exit(-1); } else { @@ -95,18 +95,18 @@ int main(void) } fprintf(stdout, "\tSetting pipe timeout......."); - if ((rv = ap_set_pipe_timeout(readp, 1 * AP_USEC_PER_SEC)) != APR_SUCCESS) { - fprintf(stderr, "ap_set_pipe_timeout()->%d/%s\n", - rv, ap_strerror(rv, msgbuf, sizeof msgbuf)); + if ((rv = apr_set_pipe_timeout(readp, 1 * AP_USEC_PER_SEC)) != APR_SUCCESS) { + fprintf(stderr, "apr_set_pipe_timeout()->%d/%s\n", + rv, apr_strerror(rv, msgbuf, sizeof msgbuf)); exit(-1); } else { fprintf(stdout, "OK\n"); } fprintf(stdout, "\tReading from the pipe......."); - nbytes = (ap_ssize_t)strlen("this is a test"); - buf = (char *)ap_palloc(context, nbytes + 1); - if (ap_read(readp, buf, &nbytes) == APR_TIMEUP) { + nbytes = (apr_ssize_t)strlen("this is a test"); + buf = (char *)apr_palloc(context, nbytes + 1); + if (apr_read(readp, buf, &nbytes) == APR_TIMEUP) { fprintf(stdout, "OK\n"); } else { diff --git a/test/testproc.c b/test/testproc.c index 72afd2f46..793cb73aa 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -71,47 +71,47 @@ int testdirs(void); int main(int argc, char *argv[]) { - ap_pool_t *context; - ap_proc_t newproc; - ap_procattr_t *attr; - ap_file_t *testfile = NULL; - ap_ssize_t length; + apr_pool_t *context; + apr_proc_t newproc; + apr_procattr_t *attr; + apr_file_t *testfile = NULL; + apr_ssize_t length; char *buf; char *args[3]; char *teststr; - if (ap_initialize() != APR_SUCCESS) { + if (apr_initialize() != APR_SUCCESS) { fprintf(stderr, "Couldn't initialize."); exit(-1); } - atexit(ap_terminate); - ap_create_pool(&context, NULL); + atexit(apr_terminate); + apr_create_pool(&context, NULL); if (argc > 1) { - teststr = ap_palloc(context, 256); + teststr = apr_palloc(context, 256); teststr = fgets(teststr, 256, stdin); fprintf(stdout, "%s", teststr); exit(1); } - teststr = ap_pstrdup(context, "Whooo Hoooo\0"); + teststr = apr_pstrdup(context, "Whooo Hoooo\0"); fprintf(stdout, "Creating directory for later use......."); - if (ap_make_dir("proctest", APR_UREAD | APR_UWRITE | APR_UEXECUTE, context) != APR_SUCCESS) { + if (apr_make_dir("proctest", APR_UREAD | APR_UWRITE | APR_UEXECUTE, context) != APR_SUCCESS) { fprintf(stderr, "Could not create dir\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "Creating procattr......."); - if (ap_createprocattr_init(&attr, context) != APR_SUCCESS) { + if (apr_createprocattr_init(&attr, context) != APR_SUCCESS) { fprintf(stderr, "Could not create attr\n"); exit(-1);; } fprintf(stdout, "OK.\n"); fprintf(stdout, "Setting attr pipes, all three......."); - if (ap_setprocattr_io(attr, APR_FULL_BLOCK, + if (apr_setprocattr_io(attr, APR_FULL_BLOCK, APR_CHILD_BLOCK, APR_NO_PIPE) != APR_SUCCESS) { fprintf(stderr, "Could not set pipes attr\n"); exit(-1); @@ -119,25 +119,25 @@ int main(int argc, char *argv[]) fprintf(stdout, "OK.\n"); fprintf(stdout, "Setting attr dir......."); - if (ap_setprocattr_dir(attr, "proctest") != APR_SUCCESS) { + if (apr_setprocattr_dir(attr, "proctest") != APR_SUCCESS) { fprintf(stderr, "Could not set directory attr\n"); exit(-1); } fprintf(stdout, "OK.\n"); fprintf(stdout, "Setting attr cmd type......."); - if (ap_setprocattr_cmdtype(attr, APR_PROGRAM) != APR_SUCCESS) { + if (apr_setprocattr_cmdtype(attr, APR_PROGRAM) != APR_SUCCESS) { fprintf(stderr, "Could not set cmd type attr\n"); exit(-1); } fprintf(stdout, "OK.\n"); - args[0] = ap_pstrdup(context, "testproc"); - args[1] = ap_pstrdup(context, "-X"); + args[0] = apr_pstrdup(context, "testproc"); + args[1] = apr_pstrdup(context, "-X"); args[2] = NULL; fprintf(stdout, "Creating a new process......."); - if (ap_create_process(&newproc, "../testproc", args, NULL, attr, context) != APR_SUCCESS) { + if (apr_create_process(&newproc, "../testproc", args, NULL, attr, context) != APR_SUCCESS) { fprintf(stderr, "Could not create the new process\n"); exit(-1); } @@ -149,7 +149,7 @@ int main(int argc, char *argv[]) length = 256; fprintf(stdout, "Writing the data to child......."); - if (ap_write(testfile, teststr, &length) == APR_SUCCESS) { + if (apr_write(testfile, teststr, &length) == APR_SUCCESS) { fprintf(stdout,"OK\n"); } else fprintf(stderr, "Write failed.\n"); @@ -160,8 +160,8 @@ int main(int argc, char *argv[]) length = 256; fprintf(stdout, "Checking the data read from pipe to child......."); - buf = ap_pcalloc(context, length); - if (ap_read(testfile, buf, &length) == APR_SUCCESS) { + buf = apr_pcalloc(context, length); + if (apr_read(testfile, buf, &length) == APR_SUCCESS) { if (!strcmp(buf, teststr)) fprintf(stdout,"OK\n"); else fprintf(stderr, "Uh-Oh\n"); @@ -169,14 +169,14 @@ int main(int argc, char *argv[]) else fprintf(stderr, "Read failed.\n"); fprintf(stdout, "Waiting for child to die......."); - if (ap_wait_proc(&newproc, APR_WAIT) != APR_CHILD_DONE) { + if (apr_wait_proc(&newproc, APR_WAIT) != APR_CHILD_DONE) { fprintf(stderr, "Wait for child failed\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "Removing directory......."); - if (ap_remove_dir("proctest", context) != APR_SUCCESS) { + if (apr_remove_dir("proctest", context) != APR_SUCCESS) { fprintf(stderr, "Could not remove directory.\n"); exit(-1); } diff --git a/test/testsf.c b/test/testsf.c index a06012f6f..b0f26e7f5 100644 --- a/test/testsf.c +++ b/test/testsf.c @@ -90,80 +90,80 @@ int main(void) typedef enum {BLK, NONBLK, TIMEOUT} client_socket_mode_t; -static void apr_setup(ap_pool_t **p, ap_socket_t **sock) +static void apr_setup(apr_pool_t **p, apr_socket_t **sock) { char buf[120]; - ap_status_t rv; + apr_status_t rv; - rv = ap_initialize(); + rv = apr_initialize(); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_initialize()->%d/%s\n", + fprintf(stderr, "apr_initialize()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } - atexit(ap_terminate); + atexit(apr_terminate); - rv = ap_create_pool(p, NULL); + rv = apr_create_pool(p, NULL); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_create_pool()->%d/%s\n", + fprintf(stderr, "apr_create_pool()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } *sock = NULL; - rv = ap_create_tcp_socket(sock, *p); + rv = apr_create_tcp_socket(sock, *p); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_create_tcp_socket()->%d/%s\n", + fprintf(stderr, "apr_create_tcp_socket()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } } -static void create_testfile(ap_pool_t *p, const char *fname) +static void create_testfile(apr_pool_t *p, const char *fname) { - ap_file_t *f = NULL; - ap_status_t rv; + apr_file_t *f = NULL; + apr_status_t rv; char buf[120]; int i; - ap_ssize_t nbytes; - ap_finfo_t finfo; + apr_ssize_t nbytes; + apr_finfo_t finfo; printf("Creating a test file...\n"); - rv = ap_open(&f, fname, + rv = apr_open(&f, fname, APR_CREATE | APR_WRITE | APR_TRUNCATE | APR_BUFFERED, APR_UREAD | APR_UWRITE, p); if (rv) { - fprintf(stderr, "ap_open()->%d/%s\n", - rv, ap_strerror(rv, buf, sizeof buf)); + fprintf(stderr, "apr_open()->%d/%s\n", + rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } buf[0] = FILE_DATA_CHAR; for (i = 0; i < FILE_LENGTH; i++) { nbytes = 1; - rv = ap_write(f, buf, &nbytes); + rv = apr_write(f, buf, &nbytes); if (rv) { - fprintf(stderr, "ap_write()->%d/%s\n", - rv, ap_strerror(rv, buf, sizeof buf)); + fprintf(stderr, "apr_write()->%d/%s\n", + rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } } - rv = ap_close(f); + rv = apr_close(f); if (rv) { - fprintf(stderr, "ap_close()->%d/%s\n", - rv, ap_strerror(rv, buf, sizeof buf)); + fprintf(stderr, "apr_close()->%d/%s\n", + rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } - rv = ap_stat(&finfo, fname, p); + rv = apr_stat(&finfo, fname, p); if (rv) { - fprintf(stderr, "ap_close()->%d/%s\n", - rv, ap_strerror(rv, buf, sizeof buf)); + fprintf(stderr, "apr_close()->%d/%s\n", + rv, apr_strerror(rv, buf, sizeof buf)); exit(1); } @@ -180,45 +180,45 @@ static void create_testfile(ap_pool_t *p, const char *fname) static int client(client_socket_mode_t socket_mode) { - ap_status_t rv, tmprv; - ap_socket_t *sock; - ap_pool_t *p; + apr_status_t rv, tmprv; + apr_socket_t *sock; + apr_pool_t *p; char buf[120]; - ap_file_t *f = NULL; - ap_size_t len, expected_len; - ap_off_t current_file_offset; - ap_hdtr_t hdtr; + apr_file_t *f = NULL; + apr_size_t len, expected_len; + apr_off_t current_file_offset; + apr_hdtr_t hdtr; struct iovec headers[3]; struct iovec trailers[3]; - ap_ssize_t bytes_read; - ap_pollfd_t *pfd; - ap_int32_t nsocks; + apr_ssize_t bytes_read; + apr_pollfd_t *pfd; + apr_int32_t nsocks; int i; apr_setup(&p, &sock); create_testfile(p, TESTFILE); - rv = ap_open(&f, TESTFILE, APR_READ, 0, p); + rv = apr_open(&f, TESTFILE, APR_READ, 0, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_open()->%d/%s\n", + fprintf(stderr, "apr_open()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } - rv = ap_set_remote_port(sock, TESTSF_PORT); + rv = apr_set_remote_port(sock, TESTSF_PORT); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_set_remote_port()->%d/%s\n", + fprintf(stderr, "apr_set_remote_port()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } - rv = ap_connect(sock, "127.0.0.1"); + rv = apr_connect(sock, "127.0.0.1"); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_connect()->%d/%s\n", + fprintf(stderr, "apr_connect()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } @@ -228,22 +228,22 @@ static int client(client_socket_mode_t socket_mode) break; case NONBLK: /* set it non-blocking */ - rv = ap_setsocketopt(sock, APR_SO_NONBLOCK, 1); + rv = apr_setsocketopt(sock, APR_SO_NONBLOCK, 1); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_setsocketopt(APR_SO_NONBLOCK)->%d/%s\n", + fprintf(stderr, "apr_setsocketopt(APR_SO_NONBLOCK)->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } break; case TIMEOUT: /* set a timeout */ - rv = ap_setsocketopt(sock, APR_SO_TIMEOUT, + rv = apr_setsocketopt(sock, APR_SO_TIMEOUT, 100 * AP_USEC_PER_SEC); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_setsocketopt(APR_SO_NONBLOCK)->%d/%s\n", + fprintf(stderr, "apr_setsocketopt(APR_SO_NONBLOCK)->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } break; @@ -287,7 +287,7 @@ static int client(client_socket_mode_t socket_mode) if (rv != APR_SUCCESS) { fprintf(stderr, "ap_sendfile()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } @@ -308,19 +308,19 @@ static int client(client_socket_mode_t socket_mode) } else { /* non-blocking... wooooooo */ - ap_size_t total_bytes_sent; + apr_size_t total_bytes_sent; pfd = NULL; - rv = ap_setup_poll(&pfd, 1, p); + rv = apr_setup_poll(&pfd, 1, p); assert(!rv); - rv = ap_add_poll_socket(pfd, sock, APR_POLLOUT); + rv = apr_add_poll_socket(pfd, sock, APR_POLLOUT); assert(!rv); total_bytes_sent = 0; current_file_offset = 0; len = FILE_LENGTH; do { - ap_size_t tmplen; + apr_size_t tmplen; tmplen = len; /* bytes remaining to send from the file */ printf("Calling ap_sendfile()...\n"); @@ -340,9 +340,9 @@ static int client(client_socket_mode_t socket_mode) rv = ap_sendfile(sock, f, &hdtr, ¤t_file_offset, &tmplen, 0); printf("ap_sendfile()->%d, sent %ld bytes\n", rv, (long)tmplen); if (rv) { - if (ap_canonical_error(rv) == APR_EAGAIN) { + if (apr_canonical_error(rv) == APR_EAGAIN) { nsocks = 1; - tmprv = ap_poll(pfd, &nsocks, -1); + tmprv = apr_poll(pfd, &nsocks, -1); assert(!tmprv); assert(nsocks == 1); /* continue; */ @@ -407,7 +407,7 @@ static int client(client_socket_mode_t socket_mode) } while (total_bytes_sent < expected_len && (rv == APR_SUCCESS || - ap_canonical_error(rv) == APR_EAGAIN)); + apr_canonical_error(rv) == APR_EAGAIN)); if (total_bytes_sent != expected_len) { fprintf(stderr, "client problem: sent %ld of %ld bytes\n", @@ -422,11 +422,11 @@ static int client(client_socket_mode_t socket_mode) } current_file_offset = 0; - rv = ap_seek(f, APR_CUR, ¤t_file_offset); + rv = apr_seek(f, APR_CUR, ¤t_file_offset); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_seek()->%d/%s\n", + fprintf(stderr, "apr_seek()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } @@ -434,20 +434,20 @@ static int client(client_socket_mode_t socket_mode) "at offset %ld.\n", (long int)current_file_offset); - rv = ap_shutdown(sock, APR_SHUTDOWN_WRITE); + rv = apr_shutdown(sock, APR_SHUTDOWN_WRITE); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_shutdown()->%d/%s\n", + fprintf(stderr, "apr_shutdown()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } bytes_read = 1; - rv = ap_recv(sock, buf, &bytes_read); + rv = apr_recv(sock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_recv()->%d/%s\n", + fprintf(stderr, "apr_recv()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != 0) { @@ -459,11 +459,11 @@ static int client(client_socket_mode_t socket_mode) printf("client: ap_sendfile() worked as expected!\n"); - rv = ap_remove_file(TESTFILE, p); + rv = apr_remove_file(TESTFILE, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_remove_file()->%d/%s\n", + fprintf(stderr, "apr_remove_file()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } @@ -472,55 +472,55 @@ static int client(client_socket_mode_t socket_mode) static int server(void) { - ap_status_t rv; - ap_socket_t *sock; - ap_pool_t *p; + apr_status_t rv; + apr_socket_t *sock; + apr_pool_t *p; char buf[120]; int i; - ap_socket_t *newsock = NULL; - ap_ssize_t bytes_read; + apr_socket_t *newsock = NULL; + apr_ssize_t bytes_read; apr_setup(&p, &sock); - rv = ap_set_local_port(sock, TESTSF_PORT); + rv = apr_set_local_port(sock, TESTSF_PORT); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_set_local_port()->%d/%s\n", + fprintf(stderr, "apr_set_local_port()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } - rv = ap_setsocketopt(sock, APR_SO_REUSEADDR, 1); + rv = apr_setsocketopt(sock, APR_SO_REUSEADDR, 1); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_setsocketopt()->%d/%s\n", + fprintf(stderr, "apr_setsocketopt()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } - rv = ap_bind(sock); + rv = apr_bind(sock); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_bind()->%d/%s\n", + fprintf(stderr, "apr_bind()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } - rv = ap_listen(sock, 5); + rv = apr_listen(sock, 5); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_listen()->%d/%s\n", + fprintf(stderr, "apr_listen()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } printf("Waiting for a client to connect...\n"); - rv = ap_accept(&newsock, sock, p); + rv = apr_accept(&newsock, sock, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_accept()->%d/%s\n", + fprintf(stderr, "apr_accept()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } @@ -528,11 +528,11 @@ static int server(void) assert(sizeof buf > strlen(HDR1)); bytes_read = strlen(HDR1); - rv = ap_recv(newsock, buf, &bytes_read); + rv = apr_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_recv()->%d/%s\n", + fprintf(stderr, "apr_recv()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != strlen(HDR1)) { @@ -548,11 +548,11 @@ static int server(void) assert(sizeof buf > strlen(HDR2)); bytes_read = strlen(HDR2); - rv = ap_recv(newsock, buf, &bytes_read); + rv = apr_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_recv()->%d/%s\n", + fprintf(stderr, "apr_recv()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != strlen(HDR2)) { @@ -568,15 +568,15 @@ static int server(void) for (i = 0; i < HDR3_LEN; i++) { bytes_read = 1; - rv = ap_recv(newsock, buf, &bytes_read); + rv = apr_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_recv()->%d/%s\n", + fprintf(stderr, "apr_recv()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != 1) { - fprintf(stderr, "ap_recv()->%ld bytes instead of 1\n", + fprintf(stderr, "apr_recv()->%ld bytes instead of 1\n", (long int)bytes_read); exit(1); } @@ -593,15 +593,15 @@ static int server(void) for (i = 0; i < FILE_LENGTH; i++) { bytes_read = 1; - rv = ap_recv(newsock, buf, &bytes_read); + rv = apr_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_recv()->%d/%s\n", + fprintf(stderr, "apr_recv()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != 1) { - fprintf(stderr, "ap_recv()->%ld bytes instead of 1\n", + fprintf(stderr, "apr_recv()->%ld bytes instead of 1\n", (long int)bytes_read); exit(1); } @@ -618,11 +618,11 @@ static int server(void) assert(sizeof buf > strlen(TRL1)); bytes_read = strlen(TRL1); - rv = ap_recv(newsock, buf, &bytes_read); + rv = apr_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_recv()->%d/%s\n", + fprintf(stderr, "apr_recv()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != strlen(TRL1)) { @@ -638,11 +638,11 @@ static int server(void) assert(sizeof buf > strlen(TRL2)); bytes_read = strlen(TRL2); - rv = ap_recv(newsock, buf, &bytes_read); + rv = apr_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_recv()->%d/%s\n", + fprintf(stderr, "apr_recv()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != strlen(TRL2)) { @@ -658,15 +658,15 @@ static int server(void) for (i = 0; i < TRL3_LEN; i++) { bytes_read = 1; - rv = ap_recv(newsock, buf, &bytes_read); + rv = apr_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_recv()->%d/%s\n", + fprintf(stderr, "apr_recv()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != 1) { - fprintf(stderr, "ap_recv()->%ld bytes instead of 1\n", + fprintf(stderr, "apr_recv()->%ld bytes instead of 1\n", (long int)bytes_read); exit(1); } @@ -682,11 +682,11 @@ static int server(void) } bytes_read = 1; - rv = ap_recv(newsock, buf, &bytes_read); + rv = apr_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "ap_recv()->%d/%s\n", + fprintf(stderr, "apr_recv()->%d/%s\n", rv, - ap_strerror(rv, buf, sizeof buf)); + apr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != 0) { diff --git a/test/testshmem.c b/test/testshmem.c index 8411e33c6..c579b8699 100644 --- a/test/testshmem.c +++ b/test/testshmem.c @@ -70,7 +70,7 @@ typedef struct mbox { char msg[1024]; int msgavail; } mbox; -ap_pool_t *context; +apr_pool_t *context; mbox *boxes; void msgwait(int boxnum) @@ -87,27 +87,27 @@ void msgwait(int boxnum) void msgput(int boxnum, char *msg) { fprintf(stdout, "Sending message to box %d\n", boxnum); - ap_cpystrn(boxes[boxnum].msg, msg, strlen(msg)); + apr_cpystrn(boxes[boxnum].msg, msg, strlen(msg)); boxes[boxnum].msgavail = 1; } int main() { - ap_shmem_t *shm; + apr_shmem_t *shm; pid_t pid; int size; - ap_initialize(); + apr_initialize(); fprintf(stdout, "Initializing the context......."); - if (ap_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_create_pool(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "could not initialize\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "Creating shared memory block......."); - if (ap_shm_init(&shm, 1048576, NULL, context) != APR_SUCCESS) { + if (apr_shm_init(&shm, 1048576, NULL, context) != APR_SUCCESS) { fprintf(stderr, "Error allocating shared memory block\n"); exit(-1); } @@ -115,7 +115,7 @@ int main() fprintf(stdout, "Allocating shared memory......."); size = sizeof(mbox) * 2; - boxes = ap_shm_calloc(shm, size); + boxes = apr_shm_calloc(shm, size); if (boxes == NULL) { fprintf(stderr, "Error creating message boxes.\n"); exit(-1); @@ -126,7 +126,7 @@ int main() pid = fork(); if (pid == 0) { sleep(1); - if (ap_open_shmem(shm) == APR_SUCCESS) { + if (apr_open_shmem(shm) == APR_SUCCESS) { msgwait(1); msgput(0, "Msg received\n"); } else { diff --git a/test/testsock.c b/test/testsock.c index 7cc1a3ce0..0321eb4b2 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -65,26 +65,26 @@ int main(int argc, char *argv[]) { - ap_pool_t *context; + apr_pool_t *context; - ap_procattr_t *attr1 = NULL; - ap_procattr_t *attr2 = NULL; - ap_proc_t proc1; - ap_proc_t proc2; - ap_status_t s1; - ap_status_t s2; + apr_procattr_t *attr1 = NULL; + apr_procattr_t *attr2 = NULL; + apr_proc_t proc1; + apr_proc_t proc2; + apr_status_t s1; + apr_status_t s2; char *args[2]; fprintf(stdout, "Initializing........."); - if (ap_initialize() != APR_SUCCESS) { + if (apr_initialize() != APR_SUCCESS) { fprintf(stderr, "Something went wrong\n"); exit(-1); } fprintf(stdout, "OK\n"); - atexit(ap_terminate); + atexit(apr_terminate); fprintf(stdout, "Creating context......."); - if (ap_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_create_pool(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Could not create context\n"); exit(-1); } @@ -96,38 +96,38 @@ int main(int argc, char *argv[]) fprintf(stdout, "server and client by yourself.\n"); fprintf(stdout, "Creating children to run network tests.......\n"); - s1 = ap_createprocattr_init(&attr1, context); - s2 = ap_createprocattr_init(&attr2, context); + s1 = apr_createprocattr_init(&attr1, context); + s2 = apr_createprocattr_init(&attr2, context); if (s1 != APR_SUCCESS || s2 != APR_SUCCESS) { fprintf(stderr, "Problem creating proc attrs\n"); exit(-1); } - args[0] = ap_pstrdup(context, "server"); + args[0] = apr_pstrdup(context, "server"); args[1] = NULL; - s1 = ap_create_process(&proc1, "./server", args, NULL, attr1, context); + s1 = apr_create_process(&proc1, "./server", args, NULL, attr1, context); - args[0] = ap_pstrdup(context, "client"); - s2 = ap_create_process(&proc2, "./client", args, NULL, attr2, context); + args[0] = apr_pstrdup(context, "client"); + s2 = apr_create_process(&proc2, "./client", args, NULL, attr2, context); if (s1 != APR_SUCCESS || s2 != APR_SUCCESS) { fprintf(stderr, "Problem spawning new process\n"); exit(-1); } - while ((s1 = ap_wait_proc(&proc1, APR_NOWAIT)) != APR_CHILD_DONE || - (s2 = ap_wait_proc(&proc2, APR_NOWAIT)) != APR_CHILD_DONE) { + while ((s1 = apr_wait_proc(&proc1, APR_NOWAIT)) != APR_CHILD_DONE || + (s2 = apr_wait_proc(&proc2, APR_NOWAIT)) != APR_CHILD_DONE) { continue; } if (s1 == APR_SUCCESS) { - ap_kill(&proc2, SIGTERM); - ap_wait_proc(&proc2, APR_WAIT); + apr_kill(&proc2, SIGTERM); + apr_wait_proc(&proc2, APR_WAIT); } else { - ap_kill(&proc1, SIGTERM); - ap_wait_proc(&proc1, APR_WAIT); + apr_kill(&proc1, SIGTERM); + apr_wait_proc(&proc1, APR_WAIT); } fprintf(stdout, "Network test completed.\n"); diff --git a/test/testthread.c b/test/testthread.c index eeba90c1b..79ccfb698 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -69,17 +69,17 @@ void * APR_THREAD_FUNC thread_func3(void *data); void * APR_THREAD_FUNC thread_func4(void *data); -ap_lock_t *thread_lock; -ap_pool_t *context; +apr_lock_t *thread_lock; +apr_pool_t *context; int x = 0; void * APR_THREAD_FUNC thread_func1(void *data) { int i; for (i = 0; i < 10000; i++) { - ap_lock(thread_lock); + apr_lock(thread_lock); x++; - ap_unlock(thread_lock); + apr_unlock(thread_lock); } return NULL; } @@ -88,9 +88,9 @@ void * APR_THREAD_FUNC thread_func2(void *data) { int i; for (i = 0; i < 10000; i++) { - ap_lock(thread_lock); + apr_lock(thread_lock); x++; - ap_unlock(thread_lock); + apr_unlock(thread_lock); } return NULL; } @@ -99,9 +99,9 @@ void * APR_THREAD_FUNC thread_func3(void *data) { int i; for (i = 0; i < 10000; i++) { - ap_lock(thread_lock); + apr_lock(thread_lock); x++; - ap_unlock(thread_lock); + apr_unlock(thread_lock); } return NULL; } @@ -110,35 +110,35 @@ void * APR_THREAD_FUNC thread_func4(void *data) { int i; for (i = 0; i < 10000; i++) { - ap_lock(thread_lock); + apr_lock(thread_lock); x++; - ap_unlock(thread_lock); + apr_unlock(thread_lock); } return NULL; } int main() { - ap_thread_t *t1; - ap_thread_t *t2; - ap_thread_t *t3; - ap_thread_t *t4; - ap_status_t s1; - ap_status_t s2; - ap_status_t s3; - ap_status_t s4; + apr_thread_t *t1; + apr_thread_t *t2; + apr_thread_t *t3; + apr_thread_t *t4; + apr_status_t s1; + apr_status_t s2; + apr_status_t s3; + apr_status_t s4; - ap_initialize(); + apr_initialize(); fprintf(stdout, "Initializing the context......."); - if (ap_create_pool(&context, NULL) != APR_SUCCESS) { + if (apr_create_pool(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "could not initialize\n"); exit(-1); } fprintf(stdout, "OK\n"); fprintf(stdout, "Initializing the lock......."); - s1 = ap_create_lock(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, "lock.file", context); + s1 = apr_create_lock(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, "lock.file", context); if (s1 != APR_SUCCESS) { fprintf(stderr, "Could not create lock\n"); exit(-1); @@ -146,10 +146,10 @@ int main() fprintf(stdout, "OK\n"); fprintf(stdout, "Starting all the threads......."); - s1 = ap_create_thread(&t1, NULL, thread_func1, NULL, context); - s2 = ap_create_thread(&t2, NULL, thread_func2, NULL, context); - s3 = ap_create_thread(&t3, NULL, thread_func3, NULL, context); - s4 = ap_create_thread(&t4, NULL, thread_func4, NULL, context); + s1 = apr_create_thread(&t1, NULL, thread_func1, NULL, context); + s2 = apr_create_thread(&t2, NULL, thread_func2, NULL, context); + s3 = apr_create_thread(&t3, NULL, thread_func3, NULL, context); + s4 = apr_create_thread(&t4, NULL, thread_func4, NULL, context); if (s1 != APR_SUCCESS || s2 != APR_SUCCESS || s3 != APR_SUCCESS || s4 != APR_SUCCESS) { fprintf(stderr, "Error starting thread\n"); @@ -158,10 +158,10 @@ int main() fprintf(stdout, "OK\n"); fprintf(stdout, "Waiting for threads to exit......."); - ap_thread_join(&s1, t1); - ap_thread_join(&s2, t2); - ap_thread_join(&s3, t3); - ap_thread_join(&s4, t4); + apr_thread_join(&s1, t1); + apr_thread_join(&s2, t2); + apr_thread_join(&s3, t3); + apr_thread_join(&s4, t4); fprintf (stdout, "OK\n"); fprintf(stdout, "Checking if locks worked......."); diff --git a/test/testtime.c b/test/testtime.c index 831425960..1a5633fdb 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -63,32 +63,32 @@ int main() { - ap_time_t now; + apr_time_t now; ap_exploded_time_t xt; - ap_time_t imp; + apr_time_t imp; fprintf(stdout, "Testing Time functions.\n"); - fprintf(stdout, "\tap_now......."); - now = ap_now(); + fprintf(stdout, "\tapr_now......."); + now = apr_now(); fprintf(stdout, "OK\n"); - fprintf(stdout, "\tap_explode_localtime......."); - if (ap_explode_localtime(&xt, now) != APR_SUCCESS) { + fprintf(stdout, "\tapr_explode_localtime......."); + if (apr_explode_localtime(&xt, now) != APR_SUCCESS) { fprintf(stderr, "Couldn't explode the time\n"); exit(-1); } fprintf(stdout, "OK\n"); - fprintf(stdout, "\tap_explode_gmt......."); - if (ap_explode_gmt(&xt, now) != APR_SUCCESS) { + fprintf(stdout, "\tapr_explode_gmt......."); + if (apr_explode_gmt(&xt, now) != APR_SUCCESS) { fprintf(stderr, "Couldn't explode the time\n"); exit(-1); } fprintf(stdout, "OK\n"); - fprintf(stdout, "\tap_implode_time........"); - if (ap_implode_time(&imp, &xt) != APR_SUCCESS) { + fprintf(stdout, "\tapr_implode_time........"); + if (apr_implode_time(&imp, &xt) != APR_SUCCESS) { fprintf(stderr, "Couldn't implode the time\n"); exit(-1); } diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index de3b04737..4092455f5 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -60,10 +60,10 @@ struct send_pipe { int err; }; -ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_pool_t *cont) +apr_status_t apr_createprocattr_init(apr_procattr_t **new, apr_pool_t *cont) { - (*new) = (ap_procattr_t *)ap_palloc(cont, - sizeof(ap_procattr_t)); + (*new) = (apr_procattr_t *)apr_palloc(cont, + sizeof(apr_procattr_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -81,12 +81,12 @@ ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, - ap_int32_t out, ap_int32_t err) +apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, + apr_int32_t out, apr_int32_t err) { - ap_status_t status; + apr_status_t status; if (in != 0) { - if ((status = ap_create_pipe(&attr->child_in, &attr->parent_in, + if ((status = apr_create_pipe(&attr->child_in, &attr->parent_in, attr->cntxt)) != APR_SUCCESS) { return status; } @@ -94,18 +94,18 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - ap_set_pipe_timeout(attr->child_in, 0); + apr_set_pipe_timeout(attr->child_in, 0); break; case APR_CHILD_BLOCK: - ap_set_pipe_timeout(attr->parent_in, 0); + apr_set_pipe_timeout(attr->parent_in, 0); break; default: - ap_set_pipe_timeout(attr->child_in, 0); - ap_set_pipe_timeout(attr->parent_in, 0); + apr_set_pipe_timeout(attr->child_in, 0); + apr_set_pipe_timeout(attr->parent_in, 0); } } if (out) { - if ((status = ap_create_pipe(&attr->parent_out, &attr->child_out, + if ((status = apr_create_pipe(&attr->parent_out, &attr->child_out, attr->cntxt)) != APR_SUCCESS) { return status; } @@ -113,18 +113,18 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - ap_set_pipe_timeout(attr->child_out, 0); + apr_set_pipe_timeout(attr->child_out, 0); break; case APR_CHILD_BLOCK: - ap_set_pipe_timeout(attr->parent_out, 0); + apr_set_pipe_timeout(attr->parent_out, 0); break; default: - ap_set_pipe_timeout(attr->child_out, 0); - ap_set_pipe_timeout(attr->parent_out, 0); + apr_set_pipe_timeout(attr->child_out, 0); + apr_set_pipe_timeout(attr->parent_out, 0); } } if (err) { - if ((status = ap_create_pipe(&attr->parent_err, &attr->child_err, + if ((status = apr_create_pipe(&attr->parent_err, &attr->child_err, attr->cntxt)) != APR_SUCCESS) { return status; } @@ -132,20 +132,20 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - ap_set_pipe_timeout(attr->child_err, 0); + apr_set_pipe_timeout(attr->child_err, 0); break; case APR_CHILD_BLOCK: - ap_set_pipe_timeout(attr->parent_err, 0); + apr_set_pipe_timeout(attr->parent_err, 0); break; default: - ap_set_pipe_timeout(attr->child_err, 0); - ap_set_pipe_timeout(attr->parent_err, 0); + apr_set_pipe_timeout(attr->child_err, 0); + apr_set_pipe_timeout(attr->parent_err, 0); } } return APR_SUCCESS; } -ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, +apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, const char *dir) { char * cwd; @@ -154,10 +154,10 @@ ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, getcwd(cwd, PATH_MAX); strncat(cwd,"/\0",2); strcat(cwd,dir); - attr->currdir = (char *)ap_pstrdup(attr->cntxt, cwd); + attr->currdir = (char *)apr_pstrdup(attr->cntxt, cwd); free(cwd); } else { - attr->currdir = (char *)ap_pstrdup(attr->cntxt, dir); + attr->currdir = (char *)apr_pstrdup(attr->cntxt, dir); } if (attr->currdir) { return APR_SUCCESS; @@ -165,20 +165,20 @@ ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, return APR_ENOMEM; } -ap_status_t ap_setprocattr_cmdtype(ap_procattr_t *attr, - ap_cmdtype_e cmd) +apr_status_t apr_setprocattr_cmdtype(apr_procattr_t *attr, + apr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -ap_status_t ap_setprocattr_detach(ap_procattr_t *attr, ap_int32_t detach) +apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t detach) { attr->detached = detach; return APR_SUCCESS; } -ap_status_t ap_fork(ap_proc_t *proc, ap_pool_t *cont) +apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont) { int pid; @@ -200,9 +200,9 @@ ap_status_t ap_fork(ap_proc_t *proc, ap_pool_t *cont) } -ap_status_t ap_create_process(ap_proc_t *new, const char *progname, +apr_status_t apr_create_process(apr_proc_t *new, const char *progname, char *const args[], char **env, - ap_procattr_t *attr, ap_pool_t *cont) + apr_procattr_t *attr, apr_pool_t *cont) { int i=0,nargs=0; char **newargs = NULL; @@ -210,7 +210,7 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, struct send_pipe *sp; char * dir = NULL; - sp = (struct send_pipe *)ap_palloc(cont, sizeof(struct send_pipe)); + sp = (struct send_pipe *)apr_palloc(cont, sizeof(struct send_pipe)); new->in = attr->parent_in; new->err = attr->parent_err; @@ -257,13 +257,13 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, resume_thread(newproc); if (attr->child_in) { - ap_close(attr->child_in); + apr_close(attr->child_in); } if (attr->child_out) { - ap_close(attr->child_out); + apr_close(attr->child_out); } if (attr->child_err) { - ap_close(attr->child_err); + apr_close(attr->child_err); } send_data(newproc, 0, (void*)sp, sizeof(struct send_pipe)); @@ -277,8 +277,8 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, return APR_SUCCESS; } -ap_status_t ap_wait_all_procs(ap_proc_t *proc, ap_wait_t *status, - ap_wait_how_e waithow, ap_pool_t *p) +apr_status_t apr_wait_all_procs(apr_proc_t *proc, ap_wait_t *status, + apr_wait_how_e waithow, apr_pool_t *p) { int waitpid_options = WUNTRACED; @@ -295,8 +295,8 @@ ap_status_t ap_wait_all_procs(ap_proc_t *proc, ap_wait_t *status, return errno; } -ap_status_t ap_wait_proc(ap_proc_t *proc, - ap_wait_how_e wait) +apr_status_t apr_wait_proc(apr_proc_t *proc, + apr_wait_how_e wait) { status_t exitval; thread_info tinfo; @@ -320,47 +320,47 @@ ap_status_t ap_wait_proc(ap_proc_t *proc, return APR_CHILD_NOTDONE; } -ap_status_t ap_setprocattr_childin(ap_procattr_t *attr, ap_file_t *child_in, - ap_file_t *parent_in) +apr_status_t apr_setprocattr_childin(apr_procattr_t *attr, apr_file_t *child_in, + apr_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) - ap_create_pipe(&attr->child_in, &attr->parent_in, attr->cntxt); + apr_create_pipe(&attr->child_in, &attr->parent_in, attr->cntxt); if (child_in != NULL) - ap_dupfile(&attr->child_in, child_in, attr->cntxt); + apr_dupfile(&attr->child_in, child_in, attr->cntxt); if (parent_in != NULL) - ap_dupfile(&attr->parent_in, parent_in, attr->cntxt); + apr_dupfile(&attr->parent_in, parent_in, attr->cntxt); return APR_SUCCESS; } -ap_status_t ap_setprocattr_childout(ap_procattr_t *attr, ap_file_t *child_out, - ap_file_t *parent_out) +apr_status_t apr_setprocattr_childout(apr_procattr_t *attr, apr_file_t *child_out, + apr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) - ap_create_pipe(&attr->child_out, &attr->parent_out, attr->cntxt); + apr_create_pipe(&attr->child_out, &attr->parent_out, attr->cntxt); if (child_out != NULL) - ap_dupfile(&attr->child_out, child_out, attr->cntxt); + apr_dupfile(&attr->child_out, child_out, attr->cntxt); if (parent_out != NULL) - ap_dupfile(&attr->parent_out, parent_out, attr->cntxt); + apr_dupfile(&attr->parent_out, parent_out, attr->cntxt); return APR_SUCCESS; } -ap_status_t ap_setprocattr_childerr(ap_procattr_t *attr, ap_file_t *child_err, - ap_file_t *parent_err) +apr_status_t apr_setprocattr_childerr(apr_procattr_t *attr, apr_file_t *child_err, + apr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) - ap_create_pipe(&attr->child_err, &attr->parent_err, attr->cntxt); + apr_create_pipe(&attr->child_err, &attr->parent_err, attr->cntxt); if (child_err != NULL) - ap_dupfile(&attr->child_err, child_err, attr->cntxt); + apr_dupfile(&attr->child_err, child_err, attr->cntxt); if (parent_err != NULL) - ap_dupfile(&attr->parent_err, parent_err, attr->cntxt); + apr_dupfile(&attr->parent_err, parent_err, attr->cntxt); return APR_SUCCESS; } diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index 0793f1e80..c646b0ae5 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -54,11 +54,11 @@ #include "threadproc.h" -ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_pool_t *cont) +apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) { - (*new) = (ap_threadattr_t *)ap_palloc(cont, - sizeof(ap_threadattr_t)); - (*new)->attr = (int32)ap_palloc(cont, + (*new) = (apr_threadattr_t *)apr_palloc(cont, + sizeof(apr_threadattr_t)); + (*new)->attr = (int32)apr_palloc(cont, sizeof(int32)); if ((*new) == NULL) { @@ -71,7 +71,7 @@ ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on) +apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on) { if (on == 1){ attr->detached = 1; @@ -81,7 +81,7 @@ ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on) return APR_SUCCESS; } -ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr) +apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr) { if (attr->detached == 1){ return APR_DETACH; @@ -89,19 +89,19 @@ ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr) return APR_NOTDETACH; } -ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, - ap_thread_start_t func, void *data, - ap_pool_t *cont) +apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, + apr_thread_start_t func, void *data, + apr_pool_t *cont) { int32 temp; - ap_status_t stat; + apr_status_t stat; - (*new) = (ap_thread_t *)ap_palloc(cont, sizeof(ap_thread_t)); + (*new) = (apr_thread_t *)apr_palloc(cont, sizeof(apr_thread_t)); if ((*new) == NULL) { return APR_ENOMEM; } - (*new)->td = (thread_id) ap_palloc(cont, sizeof(thread_id)); + (*new)->td = (thread_id) apr_palloc(cont, sizeof(thread_id)); if ((*new)->td == (thread_id)NULL) { return APR_ENOMEM; } @@ -114,7 +114,7 @@ ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, else temp = B_NORMAL_PRIORITY; - stat = ap_create_pool(&(*new)->cntxt, cont); + stat = apr_create_pool(&(*new)->cntxt, cont); if (stat != APR_SUCCESS) { return stat; } @@ -129,14 +129,14 @@ ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, } } -ap_status_t ap_thread_exit(ap_thread_t *thd, ap_status_t *retval) +apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) { - ap_destroy_pool(thd->cntxt); + apr_destroy_pool(thd->cntxt); exit_thread ((status_t)retval); return APR_SUCCESS; } -ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd) +apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd) { if (wait_for_thread(thd->td,(void *)&retval) == B_NO_ERROR) { return APR_SUCCESS; @@ -146,7 +146,7 @@ ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd) } } -ap_status_t ap_thread_detach(ap_thread_t *thd) +apr_status_t apr_thread_detach(apr_thread_t *thd) { if (suspend_thread(thd->td) == B_NO_ERROR){ return APR_SUCCESS; diff --git a/threadproc/beos/threadpriv.c b/threadproc/beos/threadpriv.c index a2d7de6f4..0044944f6 100644 --- a/threadproc/beos/threadpriv.c +++ b/threadproc/beos/threadpriv.c @@ -58,10 +58,10 @@ static struct beos_key key_table[BEOS_MAX_DATAKEYS]; static struct beos_private_data *beos_data[BEOS_MAX_DATAKEYS]; static sem_id lock; -ap_status_t ap_create_thread_private(ap_threadkey_t **key, - void (*dest)(void *), ap_pool_t *cont) +apr_status_t apr_create_thread_private(apr_threadkey_t **key, + void (*dest)(void *), apr_pool_t *cont) { - (*key) = (ap_threadkey_t *)ap_palloc(cont, sizeof(ap_threadkey_t)); + (*key) = (apr_threadkey_t *)apr_palloc(cont, sizeof(apr_threadkey_t)); if ((*key) == NULL) { return APR_ENOMEM; } @@ -82,7 +82,7 @@ ap_status_t ap_create_thread_private(ap_threadkey_t **key, return APR_ENOMEM; } -ap_status_t ap_get_thread_private(void **new, ap_threadkey_t *key) +apr_status_t apr_get_thread_private(void **new, apr_threadkey_t *key) { thread_id tid; int i, index=0; @@ -114,7 +114,7 @@ ap_status_t ap_get_thread_private(void **new, ap_threadkey_t *key) return APR_SUCCESS; } -ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key) +apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) { thread_id tid; int i,index = 0, ret; @@ -169,7 +169,7 @@ ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key) return APR_ENOMEM; } -ap_status_t ap_delete_thread_private(ap_threadkey_t *key) +apr_status_t apr_delete_thread_private(apr_threadkey_t *key) { if (key->key < BEOS_MAX_DATAKEYS){ acquire_sem(key_table[key->key].lock); diff --git a/threadproc/beos/threadproc.h b/threadproc/beos/threadproc.h index 4cb9c31e0..58c4fb67b 100644 --- a/threadproc/beos/threadproc.h +++ b/threadproc/beos/threadproc.h @@ -78,20 +78,20 @@ #define BEOS_MAX_DATAKEYS 128 -struct ap_thread_t { - ap_pool_t *cntxt; +struct apr_thread_t { + apr_pool_t *cntxt; thread_id td; }; -struct ap_threadattr_t { - ap_pool_t *cntxt; +struct apr_threadattr_t { + apr_pool_t *cntxt; int32 attr; int detached; int joinable; }; -struct ap_threadkey_t { - ap_pool_t *cntxt; +struct apr_threadkey_t { + apr_pool_t *cntxt; int32 key; }; @@ -109,17 +109,17 @@ struct beos_key { void (* destructor) (void *); }; -struct ap_procattr_t { - ap_pool_t *cntxt; - ap_file_t *parent_in; - ap_file_t *child_in; - ap_file_t *parent_out; - ap_file_t *child_out; - ap_file_t *parent_err; - ap_file_t *child_err; +struct apr_procattr_t { + apr_pool_t *cntxt; + apr_file_t *parent_in; + apr_file_t *child_in; + apr_file_t *parent_out; + apr_file_t *child_out; + apr_file_t *parent_err; + apr_file_t *child_err; char *currdir; - ap_int32_t cmdtype; - ap_int32_t detached; + apr_int32_t cmdtype; + apr_int32_t detached; }; #endif /* ! THREAD_PROC_H */ diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index d98952b36..ea5e73fe3 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -71,10 +71,10 @@ #include <stdlib.h> #include <os2.h> -ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_pool_t *cont) +apr_status_t apr_createprocattr_init(apr_procattr_t **new, apr_pool_t *cont) { - (*new) = (ap_procattr_t *)ap_palloc(cont, - sizeof(ap_procattr_t)); + (*new) = (apr_procattr_t *)apr_palloc(cont, + sizeof(apr_procattr_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -92,12 +92,12 @@ ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, - ap_int32_t out, ap_int32_t err) +apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, + apr_int32_t out, apr_int32_t err) { - ap_status_t stat; + apr_status_t stat; if (in) { - if ((stat = ap_create_pipe(&attr->child_in, &attr->parent_in, + if ((stat = apr_create_pipe(&attr->child_in, &attr->parent_in, attr->cntxt)) != APR_SUCCESS) { return stat; } @@ -105,18 +105,18 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - ap_set_pipe_timeout(attr->child_in, 0); + apr_set_pipe_timeout(attr->child_in, 0); break; case APR_CHILD_BLOCK: - ap_set_pipe_timeout(attr->parent_in, 0); + apr_set_pipe_timeout(attr->parent_in, 0); break; default: - ap_set_pipe_timeout(attr->child_in, 0); - ap_set_pipe_timeout(attr->parent_in, 0); + apr_set_pipe_timeout(attr->child_in, 0); + apr_set_pipe_timeout(attr->parent_in, 0); } } if (out) { - if ((stat = ap_create_pipe(&attr->parent_out, &attr->child_out, + if ((stat = apr_create_pipe(&attr->parent_out, &attr->child_out, attr->cntxt)) != APR_SUCCESS) { return stat; } @@ -124,18 +124,18 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - ap_set_pipe_timeout(attr->child_out, 0); + apr_set_pipe_timeout(attr->child_out, 0); break; case APR_CHILD_BLOCK: - ap_set_pipe_timeout(attr->parent_out, 0); + apr_set_pipe_timeout(attr->parent_out, 0); break; default: - ap_set_pipe_timeout(attr->child_out, 0); - ap_set_pipe_timeout(attr->parent_out, 0); + apr_set_pipe_timeout(attr->child_out, 0); + apr_set_pipe_timeout(attr->parent_out, 0); } } if (err) { - if ((stat = ap_create_pipe(&attr->parent_err, &attr->child_err, + if ((stat = apr_create_pipe(&attr->parent_err, &attr->child_err, attr->cntxt)) != APR_SUCCESS) { return stat; } @@ -143,90 +143,90 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - ap_set_pipe_timeout(attr->child_err, 0); + apr_set_pipe_timeout(attr->child_err, 0); break; case APR_CHILD_BLOCK: - ap_set_pipe_timeout(attr->parent_err, 0); + apr_set_pipe_timeout(attr->parent_err, 0); break; default: - ap_set_pipe_timeout(attr->child_err, 0); - ap_set_pipe_timeout(attr->parent_err, 0); + apr_set_pipe_timeout(attr->child_err, 0); + apr_set_pipe_timeout(attr->parent_err, 0); } } return APR_SUCCESS; } -ap_status_t ap_setprocattr_childin(ap_procattr_t *attr, ap_file_t *child_in, - ap_file_t *parent_in) +apr_status_t apr_setprocattr_childin(apr_procattr_t *attr, apr_file_t *child_in, + apr_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) - ap_create_pipe(&attr->child_in, &attr->parent_in, attr->cntxt); + apr_create_pipe(&attr->child_in, &attr->parent_in, attr->cntxt); if (child_in != NULL) - ap_dupfile(&attr->child_in, child_in, attr->cntxt); + apr_dupfile(&attr->child_in, child_in, attr->cntxt); if (parent_in != NULL) - ap_dupfile(&attr->parent_in, parent_in, attr->cntxt); + apr_dupfile(&attr->parent_in, parent_in, attr->cntxt); return APR_SUCCESS; } -ap_status_t ap_setprocattr_childout(ap_procattr_t *attr, ap_file_t *child_out, - ap_file_t *parent_out) +apr_status_t apr_setprocattr_childout(apr_procattr_t *attr, apr_file_t *child_out, + apr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) - ap_create_pipe(&attr->child_out, &attr->parent_out, attr->cntxt); + apr_create_pipe(&attr->child_out, &attr->parent_out, attr->cntxt); if (child_out != NULL) - ap_dupfile(&attr->child_out, child_out, attr->cntxt); + apr_dupfile(&attr->child_out, child_out, attr->cntxt); if (parent_out != NULL) - ap_dupfile(&attr->parent_out, parent_out, attr->cntxt); + apr_dupfile(&attr->parent_out, parent_out, attr->cntxt); return APR_SUCCESS; } -ap_status_t ap_setprocattr_childerr(ap_procattr_t *attr, ap_file_t *child_err, - ap_file_t *parent_err) +apr_status_t apr_setprocattr_childerr(apr_procattr_t *attr, apr_file_t *child_err, + apr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) - ap_create_pipe(&attr->child_err, &attr->parent_err, attr->cntxt); + apr_create_pipe(&attr->child_err, &attr->parent_err, attr->cntxt); if (child_err != NULL) - ap_dupfile(&attr->child_err, child_err, attr->cntxt); + apr_dupfile(&attr->child_err, child_err, attr->cntxt); if (parent_err != NULL) - ap_dupfile(&attr->parent_err, parent_err, attr->cntxt); + apr_dupfile(&attr->parent_err, parent_err, attr->cntxt); return APR_SUCCESS; } -ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, const char *dir) +apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, const char *dir) { - attr->currdir = ap_pstrdup(attr->cntxt, dir); + attr->currdir = apr_pstrdup(attr->cntxt, dir); if (attr->currdir) { return APR_SUCCESS; } return APR_ENOMEM; } -ap_status_t ap_setprocattr_cmdtype(ap_procattr_t *attr, - ap_cmdtype_e cmd) +apr_status_t apr_setprocattr_cmdtype(apr_procattr_t *attr, + apr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -ap_status_t ap_setprocattr_detach(ap_procattr_t *attr, ap_int32_t detach) +apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t detach) { attr->detached = detach; return APR_SUCCESS; } -ap_status_t ap_fork(ap_proc_t *proc, ap_pool_t *cont) +apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont) { int pid; @@ -252,7 +252,7 @@ ap_status_t ap_fork(ap_proc_t *proc, ap_pool_t *cont) /* quotes in the string are doubled up. * Used to escape quotes in args passed to OS/2's cmd.exe */ -static char *double_quotes(ap_pool_t *cntxt, char *str) +static char *double_quotes(apr_pool_t *cntxt, char *str) { int num_quotes = 0; int len = 0; @@ -262,7 +262,7 @@ static char *double_quotes(ap_pool_t *cntxt, char *str) num_quotes += str[len++] == '\"'; } - quote_doubled_str = ap_palloc(cntxt, len + num_quotes + 1); + quote_doubled_str = apr_palloc(cntxt, len + num_quotes + 1); dest = quote_doubled_str; while (*str) { @@ -277,12 +277,12 @@ static char *double_quotes(ap_pool_t *cntxt, char *str) -ap_status_t ap_create_process(ap_proc_t *proc, const char *progname, +apr_status_t apr_create_process(apr_proc_t *proc, const char *progname, char *const args[], char **env, - ap_procattr_t *attr, ap_pool_t *cont) + apr_procattr_t *attr, apr_pool_t *cont) { int i, arg, numargs, cmdlen; - ap_status_t status; + apr_status_t status; char **newargs; char savedir[300]; HFILE save_in, save_out, save_err, dup; @@ -290,7 +290,7 @@ ap_status_t ap_create_process(ap_proc_t *proc, const char *progname, char *extension, *newprogname, *extra_arg = NULL, *cmdline, *cmdline_pos; char interpreter[1024]; char error_object[260]; - ap_file_t *progfile; + apr_file_t *progfile; int env_len, e; char *env_block, *env_block_pos; RESULTCODES rescodes; @@ -325,7 +325,7 @@ ap_status_t ap_create_process(ap_proc_t *proc, const char *progname, DosSetFHState(attr->parent_err->filedes, OPEN_FLAGS_NOINHERIT); } - ap_signal(SIGCHLD, SIG_DFL); /*not sure if this is needed or not */ + apr_signal(SIGCHLD, SIG_DFL); /*not sure if this is needed or not */ if (attr->currdir != NULL) { _getcwd2(savedir, sizeof(savedir)); @@ -347,14 +347,14 @@ ap_status_t ap_create_process(ap_proc_t *proc, const char *progname, strcpy(interpreter, "#!" SHELL_PATH); extra_arg = "/C"; } else if (stricmp(extension, ".exe") != 0) { - status = ap_open(&progfile, progname, APR_READ|APR_BUFFERED, 0, cont); + status = apr_open(&progfile, progname, APR_READ|APR_BUFFERED, 0, cont); - if (status != APR_SUCCESS && ap_canonical_error(status) == APR_ENOENT) { - progname = ap_pstrcat(cont, progname, ".exe", NULL); + if (status != APR_SUCCESS && apr_canonical_error(status) == APR_ENOENT) { + progname = apr_pstrcat(cont, progname, ".exe", NULL); } if (status == APR_SUCCESS) { - status = ap_fgets(interpreter, sizeof(interpreter), progfile); + status = apr_fgets(interpreter, sizeof(interpreter), progfile); if (status == APR_SUCCESS) { if (interpreter[0] == '#' && interpreter[1] == '!') { @@ -375,7 +375,7 @@ ap_status_t ap_create_process(ap_proc_t *proc, const char *progname, } } } - ap_close(progfile); + apr_close(progfile); } i = 0; @@ -384,7 +384,7 @@ ap_status_t ap_create_process(ap_proc_t *proc, const char *progname, i++; } - newargs = (char **)ap_palloc(cont, sizeof (char *) * (i + 4)); + newargs = (char **)apr_palloc(cont, sizeof (char *) * (i + 4)); numargs = 0; if (interpreter[0]) @@ -392,7 +392,7 @@ ap_status_t ap_create_process(ap_proc_t *proc, const char *progname, if (extra_arg) newargs[numargs++] = "/c"; - newargs[numargs++] = newprogname = ap_pstrdup(cont, progname); + newargs[numargs++] = newprogname = apr_pstrdup(cont, progname); arg = 1; while (args && args[arg]) { @@ -410,14 +410,14 @@ ap_status_t ap_create_process(ap_proc_t *proc, const char *progname, for (i=0; i<numargs; i++) cmdlen += strlen(newargs[i]) + 3; - cmdline = ap_pstrndup(cont, newargs[0], cmdlen + 2); + cmdline = apr_pstrndup(cont, newargs[0], cmdlen + 2); cmdline_pos = cmdline + strlen(cmdline); for (i=1; i<numargs; i++) { char *a = newargs[i]; if (strpbrk(a, "&|<>\" ")) - a = ap_pstrcat(cont, "\"", double_quotes(cont, a), "\"", NULL); + a = apr_pstrcat(cont, "\"", double_quotes(cont, a), "\"", NULL); *(cmdline_pos++) = ' '; strcpy(cmdline_pos, a); @@ -437,7 +437,7 @@ ap_status_t ap_create_process(ap_proc_t *proc, const char *progname, for (env_len=1, e=0; env[e]; e++) env_len += strlen(env[e]) + 1; - env_block = ap_palloc(cont, env_len); + env_block = apr_palloc(cont, env_len); env_block_pos = env_block; for (e=0; env[e]; e++) { @@ -460,21 +460,21 @@ ap_status_t ap_create_process(ap_proc_t *proc, const char *progname, } if (attr->child_in) { - ap_close(attr->child_in); + apr_close(attr->child_in); dup = STDIN_FILENO; DosDupHandle(save_in, &dup); DosClose(save_in); } if (attr->child_out) { - ap_close(attr->child_out); + apr_close(attr->child_out); dup = STDOUT_FILENO; DosDupHandle(save_out, &dup); DosClose(save_out); } if (attr->child_err) { - ap_close(attr->child_err); + apr_close(attr->child_err); dup = STDERR_FILENO; DosDupHandle(save_err, &dup); DosClose(save_err); @@ -491,8 +491,8 @@ ap_status_t ap_create_process(ap_proc_t *proc, const char *progname, -ap_status_t ap_wait_all_procs(ap_proc_t *proc, ap_wait_t *status, - ap_wait_how_e waithow, ap_pool_t *p) +apr_status_t apr_wait_all_procs(apr_proc_t *proc, ap_wait_t *status, + apr_wait_how_e waithow, apr_pool_t *p) { RESULTCODES codes; ULONG rc; @@ -519,8 +519,8 @@ ap_status_t ap_wait_all_procs(ap_proc_t *proc, ap_wait_t *status, -ap_status_t ap_wait_proc(ap_proc_t *proc, - ap_wait_how_e wait) +apr_status_t apr_wait_proc(apr_proc_t *proc, + apr_wait_how_e wait) { RESULTCODES codes; ULONG rc; @@ -542,7 +542,7 @@ ap_status_t ap_wait_proc(ap_proc_t *proc, -ap_status_t ap_get_os_proc(ap_os_proc_t *theproc, ap_proc_t *proc) +apr_status_t ap_get_os_proc(apr_os_proc_t *theproc, apr_proc_t *proc) { if (proc == NULL) { return APR_ENOPROC; diff --git a/threadproc/os2/signals.c b/threadproc/os2/signals.c index 6ba71bada..5d7e7aee0 100644 --- a/threadproc/os2/signals.c +++ b/threadproc/os2/signals.c @@ -63,12 +63,12 @@ #define INCL_DOS #include <os2.h> -ap_status_t ap_kill(ap_proc_t *proc, int signal) +apr_status_t apr_kill(apr_proc_t *proc, int signal) { /* SIGTERM's don't work too well in OS/2 (only affects other EMX programs). CGIs may not be, esp. REXX scripts, so use a native call instead */ - ap_status_t rc; + apr_status_t rc; if ( signal == SIGTERM ) { rc = APR_OS2_STATUS(DosSendSignalException(proc->pid, XCPT_SIGNAL_BREAK)); diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index dbfa34825..e44106be0 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -62,9 +62,9 @@ #include <stdlib.h> #include <os2.h> -ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_pool_t *cont) +apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) { - (*new) = (ap_threadattr_t *)ap_palloc(cont, sizeof(ap_threadattr_t)); + (*new) = (apr_threadattr_t *)apr_palloc(cont, sizeof(apr_threadattr_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -77,7 +77,7 @@ ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_pool_t *cont) -ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on) +apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on) { attr->attr |= APR_THREADATTR_DETACHED; return APR_SUCCESS; @@ -85,7 +85,7 @@ ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on) -ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr) +apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr) { return (attr->attr & APR_THREADATTR_DETACHED) ? APR_DETACH : APR_NOTDETACH; } @@ -94,20 +94,20 @@ ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr) static void ap_thread_begin(void *arg) { - ap_thread_t *thread = (ap_thread_t *)arg; + apr_thread_t *thread = (apr_thread_t *)arg; thread->rv = thread->func(thread->data); } -ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, - ap_thread_start_t func, void *data, - ap_pool_t *cont) +apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, + apr_thread_start_t func, void *data, + apr_pool_t *cont) { - ap_status_t stat; - ap_thread_t *thread; + apr_status_t stat; + apr_thread_t *thread; - thread = (ap_thread_t *)ap_palloc(cont, sizeof(ap_thread_t)); + thread = (apr_thread_t *)apr_palloc(cont, sizeof(apr_thread_t)); *new = thread; if (thread == NULL) { @@ -118,14 +118,14 @@ ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, thread->attr = attr; thread->func = func; thread->data = data; - stat = ap_create_pool(&thread->cntxt, cont); + stat = apr_create_pool(&thread->cntxt, cont); if (stat != APR_SUCCESS) { return stat; } if (attr == NULL) { - stat = ap_create_threadattr(&thread->attr, thread->cntxt); + stat = apr_create_threadattr(&thread->attr, thread->cntxt); if (stat != APR_SUCCESS) { return stat; @@ -146,7 +146,7 @@ ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, -ap_status_t ap_thread_exit(ap_thread_t *thd, ap_status_t *retval) +apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) { thd->rv = retval; _endthread(); @@ -155,7 +155,7 @@ ap_status_t ap_thread_exit(ap_thread_t *thd, ap_status_t *retval) -ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd) +apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd) { ULONG rc; TID waittid = thd->tid; @@ -168,13 +168,13 @@ ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd) if (rc == ERROR_INVALID_THREADID) rc = 0; /* Thread had already terminated */ - *retval = (ap_status_t)thd->rv; + *retval = (apr_status_t)thd->rv; return APR_OS2_STATUS(rc); } -ap_status_t ap_thread_detach(ap_thread_t *thd) +apr_status_t apr_thread_detach(apr_thread_t *thd) { thd->attr->attr |= APR_THREADATTR_DETACHED; return APR_SUCCESS; diff --git a/threadproc/os2/threadpriv.c b/threadproc/os2/threadpriv.c index cf436d237..15143e512 100644 --- a/threadproc/os2/threadpriv.c +++ b/threadproc/os2/threadpriv.c @@ -59,10 +59,10 @@ #include "apr_lib.h" #include "fileio.h" -ap_status_t ap_create_thread_private(ap_threadkey_t **key, - void (*dest)(void *), ap_pool_t *cont) +apr_status_t apr_create_thread_private(apr_threadkey_t **key, + void (*dest)(void *), apr_pool_t *cont) { - (*key) = (ap_threadkey_t *)ap_palloc(cont, sizeof(ap_threadkey_t)); + (*key) = (apr_threadkey_t *)apr_palloc(cont, sizeof(apr_threadkey_t)); if ((*key) == NULL) { return APR_ENOMEM; @@ -72,19 +72,19 @@ ap_status_t ap_create_thread_private(ap_threadkey_t **key, return APR_OS2_STATUS(DosAllocThreadLocalMemory(1, &((*key)->key))); } -ap_status_t ap_get_thread_private(void **new, ap_threadkey_t *key) +apr_status_t apr_get_thread_private(void **new, apr_threadkey_t *key) { (*new) = (void *)*(key->key); return APR_SUCCESS; } -ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key) +apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) { *(key->key) = (ULONG)priv; return APR_SUCCESS; } -ap_status_t ap_delete_thread_private(ap_threadkey_t *key) +apr_status_t apr_delete_thread_private(apr_threadkey_t *key) { return APR_OS2_STATUS(DosFreeThreadLocalMemory(key->key)); } diff --git a/threadproc/os2/threadproc.h b/threadproc/os2/threadproc.h index d6971dbb3..c14c54aa0 100644 --- a/threadproc/os2/threadproc.h +++ b/threadproc/os2/threadproc.h @@ -63,36 +63,36 @@ #define SHELL_PATH "cmd.exe" #define APR_THREAD_STACKSIZE 65536 -struct ap_threadattr_t { - ap_pool_t *cntxt; +struct apr_threadattr_t { + apr_pool_t *cntxt; unsigned long attr; }; -struct ap_thread_t { - ap_pool_t *cntxt; - struct ap_threadattr_t *attr; +struct apr_thread_t { + apr_pool_t *cntxt; + struct apr_threadattr_t *attr; unsigned long tid; - ap_thread_start_t func; + apr_thread_start_t func; void *data; void *rv; }; -struct ap_threadkey_t { - ap_pool_t *cntxt; +struct apr_threadkey_t { + apr_pool_t *cntxt; unsigned long *key; }; -struct ap_procattr_t { - ap_pool_t *cntxt; - ap_file_t *parent_in; - ap_file_t *child_in; - ap_file_t *parent_out; - ap_file_t *child_out; - ap_file_t *parent_err; - ap_file_t *child_err; +struct apr_procattr_t { + apr_pool_t *cntxt; + apr_file_t *parent_in; + apr_file_t *child_in; + apr_file_t *parent_out; + apr_file_t *child_out; + apr_file_t *parent_err; + apr_file_t *child_err; char *currdir; - ap_int32_t cmdtype; - ap_int32_t detached; + apr_int32_t cmdtype; + apr_int32_t detached; }; typedef void (*os2_thread_start_t)(void *); diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 07f977b60..25a4b45c6 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -56,9 +56,9 @@ #include "apr_strings.h" #include "apr_portable.h" -ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_pool_t *cont) +apr_status_t apr_createprocattr_init(apr_procattr_t **new, apr_pool_t *cont) { - (*new) = (ap_procattr_t *)ap_pcalloc(cont, sizeof(ap_procattr_t)); + (*new) = (apr_procattr_t *)apr_pcalloc(cont, sizeof(apr_procattr_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -68,12 +68,12 @@ ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, - ap_int32_t out, ap_int32_t err) +apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, + apr_int32_t out, apr_int32_t err) { - ap_status_t status; + apr_status_t status; if (in != 0) { - if ((status = ap_create_pipe(&attr->child_in, &attr->parent_in, + if ((status = apr_create_pipe(&attr->child_in, &attr->parent_in, attr->cntxt)) != APR_SUCCESS) { return status; } @@ -81,18 +81,18 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - ap_set_pipe_timeout(attr->child_in, 0); + apr_set_pipe_timeout(attr->child_in, 0); break; case APR_CHILD_BLOCK: - ap_set_pipe_timeout(attr->parent_in, 0); + apr_set_pipe_timeout(attr->parent_in, 0); break; default: - ap_set_pipe_timeout(attr->child_in, 0); - ap_set_pipe_timeout(attr->parent_in, 0); + apr_set_pipe_timeout(attr->child_in, 0); + apr_set_pipe_timeout(attr->parent_in, 0); } } if (out) { - if ((status = ap_create_pipe(&attr->parent_out, &attr->child_out, + if ((status = apr_create_pipe(&attr->parent_out, &attr->child_out, attr->cntxt)) != APR_SUCCESS) { return status; } @@ -100,18 +100,18 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - ap_set_pipe_timeout(attr->child_out, 0); + apr_set_pipe_timeout(attr->child_out, 0); break; case APR_CHILD_BLOCK: - ap_set_pipe_timeout(attr->parent_out, 0); + apr_set_pipe_timeout(attr->parent_out, 0); break; default: - ap_set_pipe_timeout(attr->child_out, 0); - ap_set_pipe_timeout(attr->parent_out, 0); + apr_set_pipe_timeout(attr->child_out, 0); + apr_set_pipe_timeout(attr->parent_out, 0); } } if (err) { - if ((status = ap_create_pipe(&attr->parent_err, &attr->child_err, + if ((status = apr_create_pipe(&attr->parent_err, &attr->child_err, attr->cntxt)) != APR_SUCCESS) { return status; } @@ -119,92 +119,92 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - ap_set_pipe_timeout(attr->child_err, 0); + apr_set_pipe_timeout(attr->child_err, 0); break; case APR_CHILD_BLOCK: - ap_set_pipe_timeout(attr->parent_err, 0); + apr_set_pipe_timeout(attr->parent_err, 0); break; default: - ap_set_pipe_timeout(attr->child_err, 0); - ap_set_pipe_timeout(attr->parent_err, 0); + apr_set_pipe_timeout(attr->child_err, 0); + apr_set_pipe_timeout(attr->parent_err, 0); } } return APR_SUCCESS; } -ap_status_t ap_setprocattr_childin(ap_procattr_t *attr, ap_file_t *child_in, - ap_file_t *parent_in) +apr_status_t apr_setprocattr_childin(apr_procattr_t *attr, apr_file_t *child_in, + apr_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) - ap_create_pipe(&attr->child_in, &attr->parent_in, attr->cntxt); + apr_create_pipe(&attr->child_in, &attr->parent_in, attr->cntxt); if (child_in != NULL) - ap_dupfile(&attr->child_in, child_in, attr->cntxt); + apr_dupfile(&attr->child_in, child_in, attr->cntxt); if (parent_in != NULL) - ap_dupfile(&attr->parent_in, parent_in, attr->cntxt); + apr_dupfile(&attr->parent_in, parent_in, attr->cntxt); return APR_SUCCESS; } -ap_status_t ap_setprocattr_childout(ap_procattr_t *attr, ap_file_t *child_out, - ap_file_t *parent_out) +apr_status_t apr_setprocattr_childout(apr_procattr_t *attr, apr_file_t *child_out, + apr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) - ap_create_pipe(&attr->child_out, &attr->parent_out, attr->cntxt); + apr_create_pipe(&attr->child_out, &attr->parent_out, attr->cntxt); if (child_out != NULL) - ap_dupfile(&attr->child_out, child_out, attr->cntxt); + apr_dupfile(&attr->child_out, child_out, attr->cntxt); if (parent_out != NULL) - ap_dupfile(&attr->parent_out, parent_out, attr->cntxt); + apr_dupfile(&attr->parent_out, parent_out, attr->cntxt); return APR_SUCCESS; } -ap_status_t ap_setprocattr_childerr(ap_procattr_t *attr, ap_file_t *child_err, - ap_file_t *parent_err) +apr_status_t apr_setprocattr_childerr(apr_procattr_t *attr, apr_file_t *child_err, + apr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) - ap_create_pipe(&attr->child_err, &attr->parent_err, attr->cntxt); + apr_create_pipe(&attr->child_err, &attr->parent_err, attr->cntxt); if (child_err != NULL) - ap_dupfile(&attr->child_err, child_err, attr->cntxt); + apr_dupfile(&attr->child_err, child_err, attr->cntxt); if (parent_err != NULL) - ap_dupfile(&attr->parent_err, parent_err, attr->cntxt); + apr_dupfile(&attr->parent_err, parent_err, attr->cntxt); return APR_SUCCESS; } -ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, +apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, const char *dir) { - attr->currdir = ap_pstrdup(attr->cntxt, dir); + attr->currdir = apr_pstrdup(attr->cntxt, dir); if (attr->currdir) { return APR_SUCCESS; } return APR_ENOMEM; } -ap_status_t ap_setprocattr_cmdtype(ap_procattr_t *attr, - ap_cmdtype_e cmd) +apr_status_t apr_setprocattr_cmdtype(apr_procattr_t *attr, + apr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -ap_status_t ap_setprocattr_detach(ap_procattr_t *attr, ap_int32_t detach) +apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t detach) { attr->detached = detach; return APR_SUCCESS; } -ap_status_t ap_fork(ap_proc_t *proc, ap_pool_t *cont) +apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont) { int pid; @@ -227,7 +227,7 @@ ap_status_t ap_fork(ap_proc_t *proc, ap_pool_t *cont) #if APR_HAVE_STRUCT_RLIMIT #if defined(RLIMIT_CPU) || defined(RLIMIT_NPROC) || defined(RLIMIT_AS) || defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) -static ap_status_t limit_proc(ap_procattr_t *attr) +static apr_status_t limit_proc(apr_procattr_t *attr) { #ifdef RLIMIT_CPU if (attr->limit_cpu != NULL) { @@ -267,9 +267,9 @@ static ap_status_t limit_proc(ap_procattr_t *attr) #endif #endif -ap_status_t ap_create_process(ap_proc_t *new, const char *progname, +apr_status_t apr_create_process(apr_proc_t *new, const char *progname, char *const args[], char **env, - ap_procattr_t *attr, ap_pool_t *cont) + apr_procattr_t *attr, apr_pool_t *cont) { int i; typedef const char *my_stupid_string; @@ -285,22 +285,22 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, int status; /* child process */ if (attr->child_in) { - ap_close(attr->parent_in); + apr_close(attr->parent_in); dup2(attr->child_in->filedes, STDIN_FILENO); - ap_close(attr->child_in); + apr_close(attr->child_in); } if (attr->child_out) { - ap_close(attr->parent_out); + apr_close(attr->parent_out); dup2(attr->child_out->filedes, STDOUT_FILENO); - ap_close(attr->child_out); + apr_close(attr->child_out); } if (attr->child_err) { - ap_close(attr->parent_err); + apr_close(attr->parent_err); dup2(attr->child_err->filedes, STDERR_FILENO); - ap_close(attr->child_err); + apr_close(attr->child_err); } - ap_signal(SIGCHLD, SIG_DFL); /*not sure if this is needed or not */ + apr_signal(SIGCHLD, SIG_DFL); /*not sure if this is needed or not */ if (attr->currdir != NULL) { if (chdir(attr->currdir) == -1) { @@ -308,7 +308,7 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, } } - ap_cleanup_for_exec(); + apr_cleanup_for_exec(); #if defined(RLIMIT_CPU) || defined(RLIMIT_NPROC) || defined(RLIMIT_AS) || defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) if ((status = limit_proc(attr)) != APR_SUCCESS) { @@ -322,7 +322,7 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, i++; } newargs = - (my_stupid_string *) ap_palloc(cont, sizeof (char *) * (i + 3)); + (my_stupid_string *) apr_palloc(cont, sizeof (char *) * (i + 3)); newargs[0] = SHELL_PATH; newargs[1] = "-c"; i = 0; @@ -332,13 +332,13 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, } newargs[i + 3] = NULL; if (attr->detached) { - ap_detach(); + apr_detach(); } execve(SHELL_PATH, (char **) newargs, env); } else { if (attr->detached) { - ap_detach(); + apr_detach(); } execve(progname, args, env); } @@ -347,19 +347,19 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, } /* Parent process */ if (attr->child_in) { - ap_close(attr->child_in); + apr_close(attr->child_in); } if (attr->child_out) { - ap_close(attr->child_out); + apr_close(attr->child_out); } if (attr->child_err) { - ap_close(attr->child_err); + apr_close(attr->child_err); } return APR_SUCCESS; } -ap_status_t ap_wait_all_procs(ap_proc_t *proc, ap_wait_t *status, - ap_wait_how_e waithow, ap_pool_t *p) +apr_status_t apr_wait_all_procs(apr_proc_t *proc, ap_wait_t *status, + apr_wait_how_e waithow, apr_pool_t *p) { int waitpid_options = WUNTRACED; @@ -376,8 +376,8 @@ ap_status_t ap_wait_all_procs(ap_proc_t *proc, ap_wait_t *status, return errno; } -ap_status_t ap_wait_proc(ap_proc_t *proc, - ap_wait_how_e waithow) +apr_status_t apr_wait_proc(apr_proc_t *proc, + apr_wait_how_e waithow) { pid_t status; if (!proc) @@ -400,7 +400,7 @@ ap_status_t ap_wait_proc(ap_proc_t *proc, return errno; } -ap_status_t ap_setprocattr_limit(ap_procattr_t *attr, ap_int32_t what, +apr_status_t apr_setprocattr_limit(apr_procattr_t *attr, apr_int32_t what, struct rlimit *limit) { switch(what) { diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index d92805882..c2f0fc6ec 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -54,7 +54,7 @@ #include "threadproc.h" -ap_status_t ap_detach(void) +apr_status_t apr_detach(void) { int x; pid_t pgrp; diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 39292c14f..61184423f 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -63,7 +63,7 @@ #include <signal.h> #endif -ap_status_t ap_kill(ap_proc_t *proc, int sig) +apr_status_t apr_kill(apr_proc_t *proc, int sig) { if (kill(proc->pid, sig) == -1) { return errno; @@ -77,7 +77,7 @@ ap_status_t ap_kill(ap_proc_t *proc, int sig) * from W. Richard Stevens' "Advanced Programming in the UNIX Environment" * (the version that does not automatically restart system calls). */ -Sigfunc *ap_signal(int signo, Sigfunc * func) +Sigfunc *apr_signal(int signo, Sigfunc * func) { struct sigaction act, oact; diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 469722d25..482ef124d 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -59,12 +59,12 @@ #if APR_HAS_THREADS #if APR_HAVE_PTHREAD_H -ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_pool_t *cont) +apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) { - ap_status_t stat; + apr_status_t stat; - (*new) = (ap_threadattr_t *)ap_pcalloc(cont, sizeof(ap_threadattr_t)); - (*new)->attr = (pthread_attr_t *)ap_pcalloc(cont, sizeof(pthread_attr_t)); + (*new) = (apr_threadattr_t *)apr_pcalloc(cont, sizeof(apr_threadattr_t)); + (*new)->attr = (pthread_attr_t *)apr_pcalloc(cont, sizeof(pthread_attr_t)); if ((*new) == NULL || (*new)->attr == NULL) { return APR_ENOMEM; @@ -82,9 +82,9 @@ ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_pool_t *cont) return stat; } -ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on) +apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on) { - ap_status_t stat; + apr_status_t stat; #ifdef PTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR int arg = on; @@ -102,7 +102,7 @@ ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on) } } -ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr) +apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr) { int state; @@ -116,20 +116,20 @@ ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr) return APR_NOTDETACH; } -ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, - ap_thread_start_t func, void *data, - ap_pool_t *cont) +apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, + apr_thread_start_t func, void *data, + apr_pool_t *cont) { - ap_status_t stat; + apr_status_t stat; pthread_attr_t *temp; - (*new) = (ap_thread_t *)ap_pcalloc(cont, sizeof(ap_thread_t)); + (*new) = (apr_thread_t *)apr_pcalloc(cont, sizeof(apr_thread_t)); if ((*new) == NULL) { return APR_ENOMEM; } - (*new)->td = (pthread_t *)ap_pcalloc(cont, sizeof(pthread_t)); + (*new)->td = (pthread_t *)apr_pcalloc(cont, sizeof(pthread_t)); if ((*new)->td == NULL) { return APR_ENOMEM; @@ -142,7 +142,7 @@ ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, else temp = NULL; - stat = ap_create_pool(&(*new)->cntxt, cont); + stat = apr_create_pool(&(*new)->cntxt, cont); if (stat != APR_SUCCESS) { return stat; } @@ -158,16 +158,16 @@ ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, } } -ap_status_t ap_thread_exit(ap_thread_t *thd, ap_status_t *retval) +apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) { - ap_destroy_pool(thd->cntxt); + apr_destroy_pool(thd->cntxt); pthread_exit(retval); return APR_SUCCESS; } -ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd) +apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd) { - ap_status_t stat; + apr_status_t stat; if ((stat = pthread_join(*thd->td,(void *)&retval)) == 0) { return APR_SUCCESS; @@ -180,9 +180,9 @@ ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd) } } -ap_status_t ap_thread_detach(ap_thread_t *thd) +apr_status_t apr_thread_detach(apr_thread_t *thd) { - ap_status_t stat; + apr_status_t stat; #ifdef PTHREAD_DETACH_ARG1_ADDR if ((stat = pthread_detach(thd->td)) == 0) { @@ -199,32 +199,32 @@ ap_status_t ap_thread_detach(ap_thread_t *thd) } } -ap_status_t ap_get_threaddata(void **data, const char *key, ap_thread_t *thread) +apr_status_t apr_get_threaddata(void **data, const char *key, apr_thread_t *thread) { - return ap_get_userdata(data, key, thread->cntxt); + return apr_get_userdata(data, key, thread->cntxt); } -ap_status_t ap_set_threaddata(void *data, const char *key, - ap_status_t (*cleanup) (void *), - ap_thread_t *thread) +apr_status_t apr_set_threaddata(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_thread_t *thread) { - return ap_set_userdata(data, key, cleanup, thread->cntxt); + return apr_set_userdata(data, key, cleanup, thread->cntxt); } -ap_status_t ap_get_os_thread(ap_os_thread_t **thethd, ap_thread_t *thd) +apr_status_t apr_get_os_thread(apr_os_thread_t **thethd, apr_thread_t *thd) { *thethd = thd->td; return APR_SUCCESS; } -ap_status_t ap_put_os_thread(ap_thread_t **thd, ap_os_thread_t *thethd, - ap_pool_t *cont) +apr_status_t apr_put_os_thread(apr_thread_t **thd, apr_os_thread_t *thethd, + apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; } if ((*thd) == NULL) { - (*thd) = (ap_thread_t *)ap_pcalloc(cont, sizeof(ap_thread_t)); + (*thd) = (apr_thread_t *)apr_pcalloc(cont, sizeof(apr_thread_t)); (*thd)->cntxt = cont; } (*thd)->td = thethd; diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index e872dc979..6c02dd130 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -59,11 +59,11 @@ #if APR_HAS_THREADS #if APR_HAVE_PTHREAD_H -ap_status_t ap_create_thread_private(ap_threadkey_t **key, - void (*dest)(void *), ap_pool_t *cont) +apr_status_t apr_create_thread_private(apr_threadkey_t **key, + void (*dest)(void *), apr_pool_t *cont) { - ap_status_t stat; - (*key) = (ap_threadkey_t *)ap_pcalloc(cont, sizeof(ap_threadkey_t)); + apr_status_t stat; + (*key) = (apr_threadkey_t *)apr_pcalloc(cont, sizeof(apr_threadkey_t)); if ((*key) == NULL) { return APR_ENOMEM; @@ -77,7 +77,7 @@ ap_status_t ap_create_thread_private(ap_threadkey_t **key, return stat; } -ap_status_t ap_get_thread_private(void **new, ap_threadkey_t *key) +apr_status_t apr_get_thread_private(void **new, apr_threadkey_t *key) { #ifdef PTHREAD_GETSPECIFIC_TAKES_TWO_ARGS if (pthread_getspecific(key->key,new)) @@ -88,9 +88,9 @@ ap_status_t ap_get_thread_private(void **new, ap_threadkey_t *key) return APR_SUCCESS; } -ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key) +apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) { - ap_status_t stat; + apr_status_t stat; if ((stat = pthread_setspecific(key->key, priv)) == 0) { return APR_SUCCESS; } @@ -99,42 +99,42 @@ ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key) } } -ap_status_t ap_delete_thread_private(ap_threadkey_t *key) +apr_status_t apr_delete_thread_private(apr_threadkey_t *key) { - ap_status_t stat; + apr_status_t stat; if ((stat = pthread_key_delete(key->key)) == 0) { return APR_SUCCESS; } return stat; } -ap_status_t ap_get_threadkeydata(void **data, const char *key, - ap_threadkey_t *threadkey) +apr_status_t apr_get_threadkeydata(void **data, const char *key, + apr_threadkey_t *threadkey) { - return ap_get_userdata(data, key, threadkey->cntxt); + return apr_get_userdata(data, key, threadkey->cntxt); } -ap_status_t ap_set_threadkeydata(void *data, const char *key, - ap_status_t (*cleanup) (void *), - ap_threadkey_t *threadkey) +apr_status_t apr_set_threadkeydata(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_threadkey_t *threadkey) { - return ap_set_userdata(data, key, cleanup, threadkey->cntxt); + return apr_set_userdata(data, key, cleanup, threadkey->cntxt); } -ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *thekey, ap_threadkey_t *key) +apr_status_t apr_get_os_threadkey(apr_os_threadkey_t *thekey, apr_threadkey_t *key) { *thekey = key->key; return APR_SUCCESS; } -ap_status_t ap_put_os_threadkey(ap_threadkey_t **key, - ap_os_threadkey_t *thekey, ap_pool_t *cont) +apr_status_t apr_put_os_threadkey(apr_threadkey_t **key, + apr_os_threadkey_t *thekey, apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; } if ((*key) == NULL) { - (*key) = (ap_threadkey_t *)ap_pcalloc(cont, sizeof(ap_threadkey_t)); + (*key) = (apr_threadkey_t *)apr_pcalloc(cont, sizeof(apr_threadkey_t)); (*key)->cntxt = cont; } (*key)->key = *thekey; diff --git a/threadproc/unix/threadproc.h b/threadproc/unix/threadproc.h index e6d9e36aa..d5f0a679f 100644 --- a/threadproc/unix/threadproc.h +++ b/threadproc/unix/threadproc.h @@ -86,33 +86,33 @@ #define SHELL_PATH "/bin/sh" #if APR_HAS_THREADS -struct ap_thread_t { - ap_pool_t *cntxt; +struct apr_thread_t { + apr_pool_t *cntxt; pthread_t *td; }; -struct ap_threadattr_t { - ap_pool_t *cntxt; +struct apr_threadattr_t { + apr_pool_t *cntxt; pthread_attr_t *attr; }; -struct ap_threadkey_t { - ap_pool_t *cntxt; +struct apr_threadkey_t { + apr_pool_t *cntxt; pthread_key_t key; }; #endif -struct ap_procattr_t { - ap_pool_t *cntxt; - ap_file_t *parent_in; - ap_file_t *child_in; - ap_file_t *parent_out; - ap_file_t *child_out; - ap_file_t *parent_err; - ap_file_t *child_err; +struct apr_procattr_t { + apr_pool_t *cntxt; + apr_file_t *parent_in; + apr_file_t *child_in; + apr_file_t *parent_out; + apr_file_t *child_out; + apr_file_t *parent_err; + apr_file_t *child_err; char *currdir; - ap_int32_t cmdtype; - ap_int32_t detached; + apr_int32_t cmdtype; + apr_int32_t detached; #ifdef RLIMIT_CPU struct rlimit *limit_cpu; #endif diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 14819bfd7..1741b87d7 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -65,9 +65,9 @@ #include <string.h> #include <process.h> -ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_pool_t *cont) +apr_status_t apr_createprocattr_init(apr_procattr_t **new, apr_pool_t *cont) { - (*new) = (ap_procattr_t *)ap_palloc(cont, sizeof(ap_procattr_t)); + (*new) = (apr_procattr_t *)apr_palloc(cont, sizeof(apr_procattr_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -88,10 +88,10 @@ ap_status_t ap_createprocattr_init(ap_procattr_t **new, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, - ap_int32_t out, ap_int32_t err) +apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, + apr_int32_t out, apr_int32_t err) { - ap_status_t stat; + apr_status_t stat; BOOLEAN bAsyncRead, bAsyncWrite; if (in) { switch (in) { @@ -165,39 +165,39 @@ ap_status_t ap_setprocattr_io(ap_procattr_t *attr, ap_int32_t in, return APR_SUCCESS; } #if 0 -ap_status_t ap_setprocattr_childin(ap_procattr_t *attr, ap_file_t *child_in, - ap_file_t *parent_in) +apr_status_t apr_setprocattr_childin(apr_procattr_t *attr, apr_file_t *child_in, + apr_file_t *parent_in) { } -ap_status_t ap_setprocattr_childout(ap_procattr_t *attr, ap_file_t *child_out, - ap_file_t *parent_out) +apr_status_t apr_setprocattr_childout(apr_procattr_t *attr, apr_file_t *child_out, + apr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) - ap_create_pipe(&attr->child_out, &attr->parent_out, attr->cntxt); + apr_create_pipe(&attr->child_out, &attr->parent_out, attr->cntxt); if (child_out != NULL) - ap_dupfile(&attr->child_out, child_out, attr->cntxt); + apr_dupfile(&attr->child_out, child_out, attr->cntxt); if (parent_out != NULL) - ap_dupfile(&attr->parent_out, parent_out, attr->cntxt); + apr_dupfile(&attr->parent_out, parent_out, attr->cntxt); return APR_SUCCESS; } -ap_status_t ap_setprocattr_childerr(ap_procattr_t *attr, ap_file_t *child_err, - ap_file_t *parent_err) +apr_status_t apr_setprocattr_childerr(apr_procattr_t *attr, apr_file_t *child_err, + apr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) - ap_create_pipe(&attr->child_err, &attr->parent_err, attr->cntxt); + apr_create_pipe(&attr->child_err, &attr->parent_err, attr->cntxt); if (child_err != NULL) - ap_dupfile(&attr->child_err, child_err, attr->cntxt); + apr_dupfile(&attr->child_err, child_err, attr->cntxt); if (parent_err != NULL) - ap_dupfile(&attr->parent_err, parent_err, attr->cntxt); + apr_dupfile(&attr->parent_err, parent_err, attr->cntxt); return APR_SUCCESS; } #endif -ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, +apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, const char *dir) { char path[MAX_PATH]; @@ -209,10 +209,10 @@ ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, if (length == 0 || length + strlen(dir) + 1 >= MAX_PATH) return APR_ENOMEM; - attr->currdir = ap_pstrcat(attr->cntxt, path, "\\", dir, NULL); + attr->currdir = apr_pstrcat(attr->cntxt, path, "\\", dir, NULL); } else { - attr->currdir = ap_pstrdup(attr->cntxt, dir); + attr->currdir = apr_pstrdup(attr->cntxt, dir); } if (attr->currdir) { @@ -221,22 +221,22 @@ ap_status_t ap_setprocattr_dir(ap_procattr_t *attr, return APR_ENOMEM; } -ap_status_t ap_setprocattr_cmdtype(ap_procattr_t *attr, - ap_cmdtype_e cmd) +apr_status_t apr_setprocattr_cmdtype(apr_procattr_t *attr, + apr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -ap_status_t ap_setprocattr_detach(ap_procattr_t *attr, ap_int32_t det) +apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t det) { attr->detached = det; return APR_SUCCESS; } -ap_status_t ap_create_process(ap_proc_t *new, const char *progname, +apr_status_t apr_create_process(apr_proc_t *new, const char *progname, char *const args[], char **env, - ap_procattr_t *attr, ap_pool_t *cont) + apr_procattr_t *attr, apr_pool_t *cont) { int i, iEnvBlockLen; char *cmdline; @@ -245,7 +245,7 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, char ppid[20]; char *envstr; char *pEnvBlock, *pNext; - ap_status_t rv; + apr_status_t rv; PROCESS_INFORMATION pi; new->in = attr->parent_in; @@ -282,18 +282,18 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, } if (*ptr == '\\' || *++ptr == ':') { - cmdline = ap_pstrdup(cont, progname); + cmdline = apr_pstrdup(cont, progname); } else if (attr->currdir == NULL) { - cmdline = ap_pstrdup(cont, progname); + cmdline = apr_pstrdup(cont, progname); } else { char lastchar = attr->currdir[strlen(attr->currdir)-1]; if ( lastchar == '\\' || lastchar == '/') { - cmdline = ap_pstrcat(cont, attr->currdir, progname, NULL); + cmdline = apr_pstrcat(cont, attr->currdir, progname, NULL); } else { - cmdline = ap_pstrcat(cont, attr->currdir, "\\", progname, NULL); + cmdline = apr_pstrcat(cont, attr->currdir, "\\", progname, NULL); } } } @@ -301,13 +301,13 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, char * shell_cmd = getenv("COMSPEC"); if (!shell_cmd) shell_cmd = SHELL_PATH; - shell_cmd = ap_pstrdup(cont, shell_cmd); - cmdline = ap_pstrcat(cont, shell_cmd, " /C ", progname, NULL); + shell_cmd = apr_pstrdup(cont, shell_cmd); + cmdline = apr_pstrcat(cont, shell_cmd, " /C ", progname, NULL); } i = 1; while (args && args[i]) { - cmdline = ap_pstrcat(cont, cmdline, " ", args[i], NULL); + cmdline = apr_pstrcat(cont, cmdline, " ", args[i], NULL); i++; } /* @@ -335,16 +335,16 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, 0, FALSE, DUPLICATE_SAME_ACCESS))) { rv = GetLastError(); if (attr->child_in) { - ap_close(attr->child_in); - ap_close(attr->parent_in); + apr_close(attr->child_in); + apr_close(attr->parent_in); } if (attr->child_out) { - ap_close(attr->child_out); - ap_close(attr->parent_out); + apr_close(attr->child_out); + apr_close(attr->parent_out); } if (attr->child_err) { - ap_close(attr->child_err); - ap_close(attr->parent_err); + apr_close(attr->child_err); + apr_close(attr->parent_err); } return rv; } @@ -365,7 +365,7 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, _itoa(_getpid(), ppid, 10); if (env) { - envstr = ap_pstrcat(cont, "parentpid=", ppid, NULL); + envstr = apr_pstrcat(cont, "parentpid=", ppid, NULL); /* * Win32's CreateProcess call requires that the environment * be passed in an environment block, a null terminated block of @@ -378,7 +378,7 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, i++; } - pEnvBlock = (char *)ap_pcalloc(cont, iEnvBlockLen + strlen(envstr)); + pEnvBlock = (char *)apr_pcalloc(cont, iEnvBlockLen + strlen(envstr)); i = 0; pNext = pEnvBlock; @@ -401,7 +401,7 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, &attr->si, &pi)) { // TODO: THIS IS BADNESS - // The completion of the ap_proc_t type leaves us ill equiped to track both + // The completion of the apr_proc_t type leaves us ill equiped to track both // the pid (Process ID) and handle to the process, which are entirely // different things and each useful in their own rights. // @@ -410,13 +410,13 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, new->pid = (pid_t) pi.hProcess; if (attr->child_in) { - ap_close(attr->child_in); + apr_close(attr->child_in); } if (attr->child_out) { - ap_close(attr->child_out); + apr_close(attr->child_out); } if (attr->child_err) { - ap_close(attr->child_err); + apr_close(attr->child_err); } CloseHandle(pi.hThread); @@ -426,7 +426,7 @@ ap_status_t ap_create_process(ap_proc_t *new, const char *progname, return GetLastError(); } -ap_status_t ap_wait_proc(ap_proc_t *proc, ap_wait_how_e wait) +apr_status_t apr_wait_proc(apr_proc_t *proc, apr_wait_how_e wait) { DWORD stat; if (!proc) diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c index 0de2653f1..a75cd5309 100644 --- a/threadproc/win32/signals.c +++ b/threadproc/win32/signals.c @@ -64,7 +64,7 @@ #endif /* Windows only really support killing process, but that will do for now. */ -ap_status_t ap_kill(ap_proc_t *proc, int signal) +apr_status_t apr_kill(apr_proc_t *proc, int signal) { if (TerminateProcess(proc->pid, signal) == 0) { return GetLastError(); diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index beed161c4..1d10d27d2 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -61,10 +61,10 @@ #include <process.h> -ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_pool_t *cont) +apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont) { - (*new) = (ap_threadattr_t *)ap_palloc(cont, - sizeof(ap_threadattr_t)); + (*new) = (apr_threadattr_t *)apr_palloc(cont, + sizeof(apr_threadattr_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -74,28 +74,28 @@ ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_pool_t *cont) return APR_SUCCESS; } -ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on) +apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on) { attr->detach = on; return APR_SUCCESS; } -ap_status_t ap_getthreadattr_detach(ap_threadattr_t *attr) +apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr) { if (attr->detach == 1) return APR_DETACH; return APR_NOTDETACH; } -ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, - ap_thread_start_t func, void *data, - ap_pool_t *cont) +apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr, + apr_thread_start_t func, void *data, + apr_pool_t *cont) { - ap_status_t stat; + apr_status_t stat; unsigned temp; int lasterror; - (*new) = (ap_thread_t *)ap_palloc(cont, sizeof(ap_thread_t)); + (*new) = (apr_thread_t *)apr_palloc(cont, sizeof(apr_thread_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -103,7 +103,7 @@ ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, (*new)->cntxt = cont; - stat = ap_create_pool(&(*new)->cntxt, cont); + stat = apr_create_pool(&(*new)->cntxt, cont); if (stat != APR_SUCCESS) { return stat; } @@ -124,16 +124,16 @@ ap_status_t ap_create_thread(ap_thread_t **new, ap_threadattr_t *attr, return APR_SUCCESS; } -ap_status_t ap_thread_exit(ap_thread_t *thd, ap_status_t *retval) +apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) { - ap_destroy_pool(thd->cntxt); + apr_destroy_pool(thd->cntxt); _endthreadex(*retval); return APR_SUCCESS; } -ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd) +apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd) { - ap_status_t stat; + apr_status_t stat; if ((stat = WaitForSingleObject(thd->td, INFINITE)) == WAIT_OBJECT_0) { if (GetExitCodeThread(thd->td, retval) == 0) { @@ -146,7 +146,7 @@ ap_status_t ap_thread_join(ap_status_t *retval, ap_thread_t *thd) } } -ap_status_t ap_thread_detach(ap_thread_t *thd) +apr_status_t apr_thread_detach(apr_thread_t *thd) { if (CloseHandle(thd->td)) { return APR_SUCCESS; @@ -156,19 +156,19 @@ ap_status_t ap_thread_detach(ap_thread_t *thd) } } -ap_status_t ap_get_threaddata(void **data, const char *key, ap_thread_t *thread) +apr_status_t apr_get_threaddata(void **data, const char *key, apr_thread_t *thread) { - return ap_get_userdata(data, key, thread->cntxt); + return apr_get_userdata(data, key, thread->cntxt); } -ap_status_t ap_set_threaddata(void *data, const char *key, - ap_status_t (*cleanup) (void *), - ap_thread_t *thread) +apr_status_t apr_set_threaddata(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_thread_t *thread) { - return ap_set_userdata(data, key, cleanup, thread->cntxt); + return apr_set_userdata(data, key, cleanup, thread->cntxt); } -ap_status_t ap_get_os_thread(ap_os_thread_t **thethd, ap_thread_t *thd) +apr_status_t apr_get_os_thread(apr_os_thread_t **thethd, apr_thread_t *thd) { if (thd == NULL) { return APR_ENOTHREAD; @@ -177,14 +177,14 @@ ap_status_t ap_get_os_thread(ap_os_thread_t **thethd, ap_thread_t *thd) return APR_SUCCESS; } -ap_status_t ap_put_os_thread(ap_thread_t **thd, ap_os_thread_t *thethd, - ap_pool_t *cont) +apr_status_t apr_put_os_thread(apr_thread_t **thd, apr_os_thread_t *thethd, + apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; } if ((*thd) == NULL) { - (*thd) = (ap_thread_t *)ap_palloc(cont, sizeof(ap_thread_t)); + (*thd) = (apr_thread_t *)apr_palloc(cont, sizeof(apr_thread_t)); (*thd)->cntxt = cont; } (*thd)->td = thethd; diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c index 275326cf5..f7fca12f0 100644 --- a/threadproc/win32/threadpriv.c +++ b/threadproc/win32/threadpriv.c @@ -59,8 +59,8 @@ #include "apr_errno.h" #include "apr_portable.h" -ap_status_t ap_create_thread_private(ap_threadkey_t **key, - void (*dest)(void *), ap_pool_t *cont) +apr_status_t apr_create_thread_private(apr_threadkey_t **key, + void (*dest)(void *), apr_pool_t *cont) { if (((*key)->key = TlsAlloc()) != 0xFFFFFFFF) { return APR_SUCCESS; @@ -68,7 +68,7 @@ ap_status_t ap_create_thread_private(ap_threadkey_t **key, return GetLastError(); } -ap_status_t ap_get_thread_private(void **new, ap_threadkey_t *key) +apr_status_t apr_get_thread_private(void **new, apr_threadkey_t *key) { if ((*new) = TlsGetValue(key->key)) { return APR_SUCCESS; @@ -76,7 +76,7 @@ ap_status_t ap_get_thread_private(void **new, ap_threadkey_t *key) return GetLastError(); } -ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key) +apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key) { if (TlsSetValue(key->key, priv)) { return APR_SUCCESS; @@ -84,7 +84,7 @@ ap_status_t ap_set_thread_private(void *priv, ap_threadkey_t *key) return GetLastError(); } -ap_status_t ap_delete_thread_private(ap_threadkey_t *key) +apr_status_t apr_delete_thread_private(apr_threadkey_t *key) { if (TlsFree(key->key)) { return APR_SUCCESS; @@ -92,33 +92,33 @@ ap_status_t ap_delete_thread_private(ap_threadkey_t *key) return GetLastError(); } -ap_status_t ap_get_threadkeydata(void **data, const char *key, - ap_threadkey_t *threadkey) +apr_status_t apr_get_threadkeydata(void **data, const char *key, + apr_threadkey_t *threadkey) { - return ap_get_userdata(data, key, threadkey->cntxt); + return apr_get_userdata(data, key, threadkey->cntxt); } -ap_status_t ap_set_threadkeydata(void *data, const char *key, - ap_status_t (*cleanup) (void *), - ap_threadkey_t *threadkey) +apr_status_t apr_set_threadkeydata(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_threadkey_t *threadkey) { - return ap_set_userdata(data, key, cleanup, threadkey->cntxt); + return apr_set_userdata(data, key, cleanup, threadkey->cntxt); } -ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *thekey, ap_threadkey_t *key) +apr_status_t apr_get_os_threadkey(apr_os_threadkey_t *thekey, apr_threadkey_t *key) { *thekey = key->key; return APR_SUCCESS; } -ap_status_t ap_put_os_threadkey(ap_threadkey_t **key, - ap_os_threadkey_t *thekey, ap_pool_t *cont) +apr_status_t apr_put_os_threadkey(apr_threadkey_t **key, + apr_os_threadkey_t *thekey, apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; } if ((*key) == NULL) { - (*key) = (ap_threadkey_t *)ap_palloc(cont, sizeof(ap_threadkey_t)); + (*key) = (apr_threadkey_t *)apr_palloc(cont, sizeof(apr_threadkey_t)); (*key)->cntxt = cont; } (*key)->key = *thekey; diff --git a/threadproc/win32/threadproc.h b/threadproc/win32/threadproc.h index 936747783..24a140bb1 100644 --- a/threadproc/win32/threadproc.h +++ b/threadproc/win32/threadproc.h @@ -61,35 +61,35 @@ #define SHELL_PATH "cmd.exe" -struct ap_thread_t { - ap_pool_t *cntxt; +struct apr_thread_t { + apr_pool_t *cntxt; HANDLE td; - ap_int32_t cancel; - ap_int32_t cancel_how; + apr_int32_t cancel; + apr_int32_t cancel_how; }; -struct ap_threadattr_t { - ap_pool_t *cntxt; - ap_int32_t detach; +struct apr_threadattr_t { + apr_pool_t *cntxt; + apr_int32_t detach; }; -struct ap_threadkey_t { - ap_pool_t *cntxt; +struct apr_threadkey_t { + apr_pool_t *cntxt; DWORD key; }; -struct ap_procattr_t { - ap_pool_t *cntxt; +struct apr_procattr_t { + apr_pool_t *cntxt; STARTUPINFO si; - ap_file_t *parent_in; - ap_file_t *child_in; - ap_file_t *parent_out; - ap_file_t *child_out; - ap_file_t *parent_err; - ap_file_t *child_err; + apr_file_t *parent_in; + apr_file_t *child_in; + apr_file_t *parent_out; + apr_file_t *child_out; + apr_file_t *parent_err; + apr_file_t *child_err; char *currdir; - ap_int32_t cmdtype; - ap_int32_t detached; + apr_int32_t cmdtype; + apr_int32_t detached; }; #endif /* ! THREAD_PROC_H */ diff --git a/time/unix/time.c b/time/unix/time.c index d3a701ab5..60a29c189 100644 --- a/time/unix/time.c +++ b/time/unix/time.c @@ -76,14 +76,14 @@ /* End System Headers */ -ap_status_t ap_ansi_time_to_ap_time(ap_time_t *result, time_t input) +apr_status_t apr_ansi_time_to_ap_time(apr_time_t *result, time_t input) { - *result = (ap_time_t)input * AP_USEC_PER_SEC; + *result = (apr_time_t)input * AP_USEC_PER_SEC; return APR_SUCCESS; } -ap_time_t ap_now(void) +apr_time_t apr_now(void) { struct timeval tv; gettimeofday(&tv, NULL); @@ -105,7 +105,7 @@ static void tm_to_exp(ap_exploded_time_t *xt, struct tm *tm) } -ap_status_t ap_explode_gmt(ap_exploded_time_t *result, ap_time_t input) +apr_status_t apr_explode_gmt(ap_exploded_time_t *result, apr_time_t input) { time_t t = input / AP_USEC_PER_SEC; #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) @@ -124,7 +124,7 @@ ap_status_t ap_explode_gmt(ap_exploded_time_t *result, ap_time_t input) return APR_SUCCESS; } -ap_status_t ap_explode_localtime(ap_exploded_time_t *result, ap_time_t input) +apr_status_t apr_explode_localtime(ap_exploded_time_t *result, apr_time_t input) { #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) time_t t = input / AP_USEC_PER_SEC; @@ -181,7 +181,7 @@ ap_status_t ap_explode_localtime(ap_exploded_time_t *result, ap_time_t input) } -ap_status_t ap_implode_time(ap_time_t *t, ap_exploded_time_t *xt) +apr_status_t apr_implode_time(apr_time_t *t, ap_exploded_time_t *xt) { int year; time_t days; @@ -215,14 +215,14 @@ ap_status_t ap_implode_time(ap_time_t *t, ap_exploded_time_t *xt) return APR_SUCCESS; } -ap_status_t ap_get_os_imp_time(ap_os_imp_time_t **ostime, ap_time_t *aprtime) +apr_status_t apr_get_os_imp_time(apr_os_imp_time_t **ostime, apr_time_t *aprtime) { (*ostime)->tv_usec = *aprtime % AP_USEC_PER_SEC; (*ostime)->tv_sec = *aprtime / AP_USEC_PER_SEC; return APR_SUCCESS; } -ap_status_t ap_get_os_exp_time(ap_os_exp_time_t **ostime, ap_exploded_time_t *aprtime) +apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime, ap_exploded_time_t *aprtime) { (*ostime)->tm_sec = aprtime->tm_sec; (*ostime)->tm_min = aprtime->tm_min; @@ -236,15 +236,15 @@ ap_status_t ap_get_os_exp_time(ap_os_exp_time_t **ostime, ap_exploded_time_t *ap return APR_SUCCESS; } -ap_status_t ap_put_os_imp_time(ap_time_t *aprtime, ap_os_imp_time_t **ostime, - ap_pool_t *cont) +apr_status_t apr_put_os_imp_time(apr_time_t *aprtime, apr_os_imp_time_t **ostime, + apr_pool_t *cont) { *aprtime = (*ostime)->tv_sec * AP_USEC_PER_SEC + (*ostime)->tv_usec; return APR_SUCCESS; } -ap_status_t ap_put_os_exp_time(ap_exploded_time_t *aprtime, - ap_os_exp_time_t **ostime, ap_pool_t *cont) +apr_status_t apr_put_os_exp_time(ap_exploded_time_t *aprtime, + apr_os_exp_time_t **ostime, apr_pool_t *cont) { aprtime->tm_sec = (*ostime)->tm_sec; aprtime->tm_min = (*ostime)->tm_min; @@ -258,7 +258,7 @@ ap_status_t ap_put_os_exp_time(ap_exploded_time_t *aprtime, return APR_SUCCESS; } -void ap_sleep(ap_interval_time_t t) +void apr_sleep(apr_interval_time_t t) { #ifdef OS2 DosSleep(t/1000); @@ -271,7 +271,7 @@ void ap_sleep(ap_interval_time_t t) } #ifdef OS2 -ap_status_t ap_os2_time_to_ap_time(ap_time_t *result, FDATE os2date, FTIME os2time) +apr_status_t ap_os2_time_to_ap_time(apr_time_t *result, FDATE os2date, FTIME os2time) { struct tm tmpdate; diff --git a/time/unix/timestr.c b/time/unix/timestr.c index e64766c66..22b342dcf 100644 --- a/time/unix/timestr.c +++ b/time/unix/timestr.c @@ -77,13 +77,13 @@ APR_VAR_EXPORT const char ap_day_snames[7][4] = "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; -ap_status_t ap_rfc822_date(char *date_str, ap_time_t t) +apr_status_t apr_rfc822_date(char *date_str, apr_time_t t) { ap_exploded_time_t xt; const char *s; int real_year; - ap_explode_gmt(&xt, t); + apr_explode_gmt(&xt, t); /* example: "Sat, 08 Jan 2000 18:31:41 GMT" */ /* 12345678901234567890123456789 */ @@ -125,7 +125,7 @@ ap_status_t ap_rfc822_date(char *date_str, ap_time_t t) return APR_SUCCESS; } -ap_status_t ap_ctime(char *date_str, ap_time_t t) +apr_status_t apr_ctime(char *date_str, apr_time_t t) { ap_exploded_time_t xt; const char *s; @@ -134,7 +134,7 @@ ap_status_t ap_ctime(char *date_str, ap_time_t t) /* example: "Wed Jun 30 21:49:08 1993" */ /* 123456789012345678901234 */ - ap_explode_localtime(&xt, t); + apr_explode_localtime(&xt, t); s = &ap_day_snames[xt.tm_wday][0]; *date_str++ = *s++; *date_str++ = *s++; @@ -167,7 +167,7 @@ ap_status_t ap_ctime(char *date_str, ap_time_t t) return APR_SUCCESS; } -ap_status_t ap_strftime(char *s, ap_size_t *retsize, ap_size_t max, +apr_status_t apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, const char *format, ap_exploded_time_t *xt) { struct tm tm; diff --git a/time/win32/access.c b/time/win32/access.c index 88fbdbe35..e38d7d575 100644 --- a/time/win32/access.c +++ b/time/win32/access.c @@ -57,7 +57,7 @@ #include "apr_general.h" #include "apr_lib.h" -ap_status_t ap_get_curtime(struct atime_t *time, ap_time_t *rv) +apr_status_t ap_get_curtime(struct atime_t *time, apr_time_t *rv) { if (time) { (*rv) = time->currtime; @@ -66,7 +66,7 @@ ap_status_t ap_get_curtime(struct atime_t *time, ap_time_t *rv) return APR_ENOTIME; } -ap_status_t ap_get_sec(struct atime_t *time, ap_int32_t *rv) +apr_status_t ap_get_sec(struct atime_t *time, apr_int32_t *rv) { if (time) { (*rv) = time->explodedtime->wSecond; @@ -75,7 +75,7 @@ ap_status_t ap_get_sec(struct atime_t *time, ap_int32_t *rv) return APR_ENOTIME; } -ap_status_t ap_get_min(struct atime_t *time, ap_int32_t *rv) +apr_status_t ap_get_min(struct atime_t *time, apr_int32_t *rv) { if (time) { (*rv) = time->explodedtime->wMinute; @@ -84,7 +84,7 @@ ap_status_t ap_get_min(struct atime_t *time, ap_int32_t *rv) return APR_ENOTIME; } -ap_status_t ap_get_hour(struct atime_t *time, ap_int32_t *rv) +apr_status_t ap_get_hour(struct atime_t *time, apr_int32_t *rv) { if (time) { (*rv) = time->explodedtime->wHour; @@ -93,7 +93,7 @@ ap_status_t ap_get_hour(struct atime_t *time, ap_int32_t *rv) return APR_ENOTIME; } -ap_status_t ap_get_mday(struct atime_t *time, ap_int32_t *rv) +apr_status_t ap_get_mday(struct atime_t *time, apr_int32_t *rv) { if (time) { (*rv) = time->explodedtime->wDay; @@ -102,7 +102,7 @@ ap_status_t ap_get_mday(struct atime_t *time, ap_int32_t *rv) return APR_ENOTIME; } -ap_status_t ap_get_mon(struct atime_t *time, ap_int32_t *rv) +apr_status_t ap_get_mon(struct atime_t *time, apr_int32_t *rv) { if (time) { (*rv) = time->explodedtime->wMonth; @@ -111,7 +111,7 @@ ap_status_t ap_get_mon(struct atime_t *time, ap_int32_t *rv) return APR_ENOTIME; } -ap_status_t ap_get_year(struct atime_t *time, ap_int32_t *rv) +apr_status_t ap_get_year(struct atime_t *time, apr_int32_t *rv) { if (time) { (*rv) = time->explodedtime->wYear; @@ -120,7 +120,7 @@ ap_status_t ap_get_year(struct atime_t *time, ap_int32_t *rv) return APR_ENOTIME; } -ap_status_t ap_get_wday(struct atime_t *time, ap_int32_t *rv) +apr_status_t ap_get_wday(struct atime_t *time, apr_int32_t *rv) { if (time) { (*rv) = time->explodedtime->wDayOfWeek; @@ -129,13 +129,13 @@ ap_status_t ap_get_wday(struct atime_t *time, ap_int32_t *rv) return APR_ENOTIME; } -ap_status_t ap_set_sec(struct atime_t *time, ap_int32_t value) +apr_status_t ap_set_sec(struct atime_t *time, apr_int32_t value) { if (!time) { return APR_ENOTIME; } if (time->explodedtime == NULL) { - time->explodedtime = (SYSTEMTIME *)ap_pcalloc(time->cntxt, + time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt, sizeof(SYSTEMTIME)); } if (time->explodedtime == NULL) { @@ -145,13 +145,13 @@ ap_status_t ap_set_sec(struct atime_t *time, ap_int32_t value) return APR_SUCCESS; } -ap_status_t ap_set_min(struct atime_t *time, ap_int32_t value) +apr_status_t ap_set_min(struct atime_t *time, apr_int32_t value) { if (!time) { return APR_ENOTIME; } if (time->explodedtime == NULL) { - time->explodedtime = (SYSTEMTIME *)ap_pcalloc(time->cntxt, + time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt, sizeof(SYSTEMTIME)); } if (time->explodedtime == NULL) { @@ -161,13 +161,13 @@ ap_status_t ap_set_min(struct atime_t *time, ap_int32_t value) return APR_SUCCESS; } -ap_status_t ap_set_hour(struct atime_t *time, ap_int32_t value) +apr_status_t ap_set_hour(struct atime_t *time, apr_int32_t value) { if (!time) { return APR_ENOTIME; } if (time->explodedtime == NULL) { - time->explodedtime = (SYSTEMTIME *)ap_pcalloc(time->cntxt, + time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt, sizeof(SYSTEMTIME)); } if (time->explodedtime == NULL) { @@ -177,13 +177,13 @@ ap_status_t ap_set_hour(struct atime_t *time, ap_int32_t value) return APR_SUCCESS; } -ap_status_t ap_set_mday(struct atime_t *time, ap_int32_t value) +apr_status_t ap_set_mday(struct atime_t *time, apr_int32_t value) { if (!time) { return APR_ENOTIME; } if (time->explodedtime == NULL) { - time->explodedtime = (SYSTEMTIME *)ap_pcalloc(time->cntxt, + time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt, sizeof(SYSTEMTIME)); } if (time->explodedtime == NULL) { @@ -193,13 +193,13 @@ ap_status_t ap_set_mday(struct atime_t *time, ap_int32_t value) return APR_SUCCESS; } -ap_status_t ap_set_mon(struct atime_t *time, ap_int32_t value) +apr_status_t ap_set_mon(struct atime_t *time, apr_int32_t value) { if (!time) { return APR_ENOTIME; } if (time->explodedtime == NULL) { - time->explodedtime = (SYSTEMTIME *)ap_pcalloc(time->cntxt, + time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt, sizeof(SYSTEMTIME)); } if (time->explodedtime == NULL) { @@ -209,13 +209,13 @@ ap_status_t ap_set_mon(struct atime_t *time, ap_int32_t value) return APR_SUCCESS; } -ap_status_t ap_set_year(struct atime_t *time, ap_int32_t value) +apr_status_t ap_set_year(struct atime_t *time, apr_int32_t value) { if (!time) { return APR_ENOTIME; } if (time->explodedtime == NULL) { - time->explodedtime = (SYSTEMTIME *)ap_pcalloc(time->cntxt, + time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt, sizeof(SYSTEMTIME)); } if (time->explodedtime == NULL) { @@ -225,13 +225,13 @@ ap_status_t ap_set_year(struct atime_t *time, ap_int32_t value) return APR_SUCCESS; } -ap_status_t ap_set_wday(struct atime_t *time, ap_int32_t value) +apr_status_t ap_set_wday(struct atime_t *time, apr_int32_t value) { if (!time) { return APR_ENOTIME; } if (time->explodedtime == NULL) { - time->explodedtime = (SYSTEMTIME *)ap_pcalloc(time->cntxt, + time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt, sizeof(SYSTEMTIME)); } if (time->explodedtime == NULL) { diff --git a/time/win32/atime.h b/time/win32/atime.h index cf5ab4873..d4a257315 100644 --- a/time/win32/atime.h +++ b/time/win32/atime.h @@ -60,13 +60,13 @@ #include <time.h> struct atime_t { - ap_pool_t *cntxt; - ap_time_t currtime; + apr_pool_t *cntxt; + apr_time_t currtime; SYSTEMTIME *explodedtime; }; -void FileTimeToAprTime(ap_time_t *atime, FILETIME *ft); -void AprTimeToFileTime(LPFILETIME pft, ap_time_t t); +void FileTimeToAprTime(apr_time_t *atime, FILETIME *ft); +void AprTimeToFileTime(LPFILETIME pft, apr_time_t t); #endif /* ! ATIME_H */ diff --git a/time/win32/time.c b/time/win32/time.c index ebe3addc0..899a57a55 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -67,7 +67,7 @@ */ #define AP_DELTA_EPOCH_IN_USEC 11644473600000000; -void FileTimeToAprTime(ap_time_t *result, FILETIME *input) +void FileTimeToAprTime(apr_time_t *result, FILETIME *input) { /* Convert FILETIME one 64 bit number so we can work with it. */ *result = input->dwHighDateTime; @@ -77,7 +77,7 @@ void FileTimeToAprTime(ap_time_t *result, FILETIME *input) *result -= AP_DELTA_EPOCH_IN_USEC; /* Convert from Windows epoch to Unix epoch */ return; } -void AprTimeToFileTime(LPFILETIME pft, ap_time_t t) +void AprTimeToFileTime(LPFILETIME pft, apr_time_t t) { LONGLONG ll; t += AP_DELTA_EPOCH_IN_USEC; @@ -123,14 +123,14 @@ void SystemTimeToAprExpTime(ap_exploded_time_t *xt, SYSTEMTIME *tm) return; } -ap_status_t ap_ansi_time_to_ap_time(ap_time_t *result, time_t input) +apr_status_t apr_ansi_time_to_ap_time(apr_time_t *result, time_t input) { - *result = (ap_time_t) input * AP_USEC_PER_SEC; + *result = (apr_time_t) input * AP_USEC_PER_SEC; return APR_SUCCESS; } /* Return micro-seconds since the Unix epoch (jan. 1, 1970) UTC */ -ap_time_t ap_now(void) +apr_time_t apr_now(void) { LONGLONG aprtime = 0; FILETIME time; @@ -139,7 +139,7 @@ ap_time_t ap_now(void) return aprtime; } -ap_status_t ap_explode_gmt(ap_exploded_time_t *result, ap_time_t input) +apr_status_t apr_explode_gmt(ap_exploded_time_t *result, apr_time_t input) { FILETIME ft; SYSTEMTIME st; @@ -149,7 +149,7 @@ ap_status_t ap_explode_gmt(ap_exploded_time_t *result, ap_time_t input) return APR_SUCCESS; } -ap_status_t ap_explode_localtime(ap_exploded_time_t *result, ap_time_t input) +apr_status_t apr_explode_localtime(ap_exploded_time_t *result, apr_time_t input) { SYSTEMTIME st; FILETIME ft, localft; @@ -161,7 +161,7 @@ ap_status_t ap_explode_localtime(ap_exploded_time_t *result, ap_time_t input) return APR_SUCCESS; } -ap_status_t ap_implode_time(ap_time_t *t, ap_exploded_time_t *xt) +apr_status_t apr_implode_time(apr_time_t *t, ap_exploded_time_t *xt) { int year; time_t days; @@ -195,14 +195,14 @@ ap_status_t ap_implode_time(ap_time_t *t, ap_exploded_time_t *xt) return APR_SUCCESS; } -ap_status_t ap_get_os_imp_time(ap_os_imp_time_t **ostime, ap_time_t *aprtime) +apr_status_t apr_get_os_imp_time(apr_os_imp_time_t **ostime, apr_time_t *aprtime) { - /* TODO: Consider not passing in pointer to ap_time_t (e.g., call by value) */ + /* TODO: Consider not passing in pointer to apr_time_t (e.g., call by value) */ AprTimeToFileTime(*ostime, *aprtime); return APR_SUCCESS; } -ap_status_t ap_get_os_exp_time(ap_os_exp_time_t **ostime, ap_exploded_time_t *aprexptime) +apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime, ap_exploded_time_t *aprexptime) { (*ostime)->wYear = aprexptime->tm_year + 1900; (*ostime)->wMonth = aprexptime->tm_mon + 1; @@ -215,15 +215,15 @@ ap_status_t ap_get_os_exp_time(ap_os_exp_time_t **ostime, ap_exploded_time_t *ap return APR_SUCCESS; } -ap_status_t ap_put_os_imp_time(ap_time_t *aprtime, ap_os_imp_time_t **ostime, - ap_pool_t *cont) +apr_status_t apr_put_os_imp_time(apr_time_t *aprtime, apr_os_imp_time_t **ostime, + apr_pool_t *cont) { FileTimeToAprTime(aprtime, *ostime); return APR_SUCCESS; } -ap_status_t ap_put_os_exp_time(ap_exploded_time_t *aprtime, - ap_os_exp_time_t **ostime, ap_pool_t *cont) +apr_status_t apr_put_os_exp_time(ap_exploded_time_t *aprtime, + apr_os_exp_time_t **ostime, apr_pool_t *cont) { SystemTimeToAprExpTime(aprtime, *ostime); return APR_SUCCESS; diff --git a/time/win32/timestr.c b/time/win32/timestr.c index 1c118b07e..df8254c55 100644 --- a/time/win32/timestr.c +++ b/time/win32/timestr.c @@ -64,13 +64,13 @@ APR_VAR_EXPORT const char ap_day_snames[7][4] = "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; -ap_status_t ap_rfc822_date(char *date_str, ap_time_t t) +apr_status_t apr_rfc822_date(char *date_str, apr_time_t t) { ap_exploded_time_t xt; const char *s; int real_year; - ap_explode_gmt(&xt, t); + apr_explode_gmt(&xt, t); /* example: "Sat, 08 Jan 2000 18:31:41 GMT" */ /* 12345678901234567890123456789 */ @@ -112,7 +112,7 @@ ap_status_t ap_rfc822_date(char *date_str, ap_time_t t) return APR_SUCCESS; } -ap_status_t ap_ctime(char *date_str, ap_time_t t) +apr_status_t apr_ctime(char *date_str, apr_time_t t) { ap_exploded_time_t xt; const char *s; @@ -121,7 +121,7 @@ ap_status_t ap_ctime(char *date_str, ap_time_t t) /* example: "Wed Jun 30 21:49:08 1993" */ /* 123456789012345678901234 */ - ap_explode_localtime(&xt, t); + apr_explode_localtime(&xt, t); s = &ap_day_snames[xt.tm_wday][0]; *date_str++ = *s++; *date_str++ = *s++; @@ -154,7 +154,7 @@ ap_status_t ap_ctime(char *date_str, ap_time_t t) return APR_SUCCESS; } -ap_status_t ap_strftime(char *s, ap_size_t *retsize, ap_size_t max, +apr_status_t apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, const char *format, ap_exploded_time_t *xt) { struct tm tm; |