prefix libapr functions and types with apr_
git-svn-id: https://svn.apache.org/repos/asf/apr/apr-util/trunk@57822 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/crypto/ap_sha1.c b/crypto/ap_sha1.c
index f258f8f..b7e2625 100644
--- a/crypto/ap_sha1.c
+++ b/crypto/ap_sha1.c
@@ -120,11 +120,11 @@
#define SHA_BLOCKSIZE 64
#ifdef CHARSET_EBCDIC
-static ap_xlate_t *ebcdic2ascii_xlate;
+static apr_xlate_t *ebcdic2ascii_xlate;
-API_EXPORT(ap_status_t) ap_SHA1InitEBCDIC(ap_xlate_t *x)
+API_EXPORT(apr_status_t) ap_SHA1InitEBCDIC(apr_xlate_t *x)
{
- ap_status_t rv;
+ apr_status_t rv;
int onoff;
/* Only single-byte conversion is supported.
@@ -147,7 +147,7 @@
static void sha_transform(AP_SHA1_CTX *sha_info)
{
int i;
- ap_uint32_t temp, A, B, C, D, E, W[80];
+ apr_uint32_t temp, A, B, C, D, E, W[80];
for (i = 0; i < 16; ++i) {
W[i] = sha_info->data[i];
@@ -219,13 +219,13 @@
/* change endianness of data */
/* count is the number of bytes to do an endian flip */
-static void maybe_byte_reverse(ap_uint32_t *buffer, int count)
+static void maybe_byte_reverse(apr_uint32_t *buffer, int count)
{
int i;
AP_BYTE ct[4], *cp;
if (isLittleEndian()) { /* do the swap only if it is little endian */
- count /= sizeof(ap_uint32_t);
+ count /= sizeof(apr_uint32_t);
cp = (AP_BYTE *) buffer;
for (i = 0; i < count; ++i) {
ct[0] = cp[0];
@@ -236,7 +236,7 @@
cp[1] = ct[2];
cp[2] = ct[1];
cp[3] = ct[0];
- cp += sizeof(ap_uint32_t);
+ cp += sizeof(apr_uint32_t);
}
}
}
@@ -263,11 +263,11 @@
{
unsigned int i;
- if ((sha_info->count_lo + ((ap_uint32_t) count << 3)) < sha_info->count_lo) {
+ if ((sha_info->count_lo + ((apr_uint32_t) count << 3)) < sha_info->count_lo) {
++sha_info->count_hi;
}
- sha_info->count_lo += (ap_uint32_t) count << 3;
- sha_info->count_hi += (ap_uint32_t) count >> 29;
+ sha_info->count_lo += (apr_uint32_t) count << 3;
+ sha_info->count_hi += (apr_uint32_t) count >> 29;
if (sha_info->local) {
i = SHA_BLOCKSIZE - sha_info->local;
if (i > count) {
@@ -302,13 +302,13 @@
#ifdef CHARSET_EBCDIC
int i;
const AP_BYTE *buffer = (const AP_BYTE *) buf;
- ap_size_t inbytes_left, outbytes_left;
+ apr_size_t inbytes_left, outbytes_left;
- if ((sha_info->count_lo + ((ap_uint32_t) count << 3)) < sha_info->count_lo) {
+ if ((sha_info->count_lo + ((apr_uint32_t) count << 3)) < sha_info->count_lo) {
++sha_info->count_hi;
}
- sha_info->count_lo += (ap_uint32_t) count << 3;
- sha_info->count_hi += (ap_uint32_t) count >> 29;
+ sha_info->count_lo += (apr_uint32_t) count << 3;
+ sha_info->count_hi += (apr_uint32_t) count >> 29;
/* Is there a remainder of the previous Update operation? */
if (sha_info->local) {
i = SHA_BLOCKSIZE - sha_info->local;
@@ -354,7 +354,7 @@
AP_SHA1_CTX *sha_info)
{
int count, i, j;
- ap_uint32_t lo_bit_count, hi_bit_count, k;
+ apr_uint32_t lo_bit_count, hi_bit_count, k;
lo_bit_count = sha_info->count_lo;
hi_bit_count = sha_info->count_hi;
@@ -400,7 +400,7 @@
ap_SHA1Final(digest, &context);
/* private marker. */
- ap_cpystrn(out, AP_SHA1PW_ID, AP_SHA1PW_IDLEN + 1);
+ apr_cpystrn(out, AP_SHA1PW_ID, AP_SHA1PW_IDLEN + 1);
/* SHA1 hash is always 20 chars */
l = ap_base64encode_binary(out + AP_SHA1PW_IDLEN, digest, sizeof(digest));
diff --git a/crypto/apr_sha1.c b/crypto/apr_sha1.c
index f258f8f..b7e2625 100644
--- a/crypto/apr_sha1.c
+++ b/crypto/apr_sha1.c
@@ -120,11 +120,11 @@
#define SHA_BLOCKSIZE 64
#ifdef CHARSET_EBCDIC
-static ap_xlate_t *ebcdic2ascii_xlate;
+static apr_xlate_t *ebcdic2ascii_xlate;
-API_EXPORT(ap_status_t) ap_SHA1InitEBCDIC(ap_xlate_t *x)
+API_EXPORT(apr_status_t) ap_SHA1InitEBCDIC(apr_xlate_t *x)
{
- ap_status_t rv;
+ apr_status_t rv;
int onoff;
/* Only single-byte conversion is supported.
@@ -147,7 +147,7 @@
static void sha_transform(AP_SHA1_CTX *sha_info)
{
int i;
- ap_uint32_t temp, A, B, C, D, E, W[80];
+ apr_uint32_t temp, A, B, C, D, E, W[80];
for (i = 0; i < 16; ++i) {
W[i] = sha_info->data[i];
@@ -219,13 +219,13 @@
/* change endianness of data */
/* count is the number of bytes to do an endian flip */
-static void maybe_byte_reverse(ap_uint32_t *buffer, int count)
+static void maybe_byte_reverse(apr_uint32_t *buffer, int count)
{
int i;
AP_BYTE ct[4], *cp;
if (isLittleEndian()) { /* do the swap only if it is little endian */
- count /= sizeof(ap_uint32_t);
+ count /= sizeof(apr_uint32_t);
cp = (AP_BYTE *) buffer;
for (i = 0; i < count; ++i) {
ct[0] = cp[0];
@@ -236,7 +236,7 @@
cp[1] = ct[2];
cp[2] = ct[1];
cp[3] = ct[0];
- cp += sizeof(ap_uint32_t);
+ cp += sizeof(apr_uint32_t);
}
}
}
@@ -263,11 +263,11 @@
{
unsigned int i;
- if ((sha_info->count_lo + ((ap_uint32_t) count << 3)) < sha_info->count_lo) {
+ if ((sha_info->count_lo + ((apr_uint32_t) count << 3)) < sha_info->count_lo) {
++sha_info->count_hi;
}
- sha_info->count_lo += (ap_uint32_t) count << 3;
- sha_info->count_hi += (ap_uint32_t) count >> 29;
+ sha_info->count_lo += (apr_uint32_t) count << 3;
+ sha_info->count_hi += (apr_uint32_t) count >> 29;
if (sha_info->local) {
i = SHA_BLOCKSIZE - sha_info->local;
if (i > count) {
@@ -302,13 +302,13 @@
#ifdef CHARSET_EBCDIC
int i;
const AP_BYTE *buffer = (const AP_BYTE *) buf;
- ap_size_t inbytes_left, outbytes_left;
+ apr_size_t inbytes_left, outbytes_left;
- if ((sha_info->count_lo + ((ap_uint32_t) count << 3)) < sha_info->count_lo) {
+ if ((sha_info->count_lo + ((apr_uint32_t) count << 3)) < sha_info->count_lo) {
++sha_info->count_hi;
}
- sha_info->count_lo += (ap_uint32_t) count << 3;
- sha_info->count_hi += (ap_uint32_t) count >> 29;
+ sha_info->count_lo += (apr_uint32_t) count << 3;
+ sha_info->count_hi += (apr_uint32_t) count >> 29;
/* Is there a remainder of the previous Update operation? */
if (sha_info->local) {
i = SHA_BLOCKSIZE - sha_info->local;
@@ -354,7 +354,7 @@
AP_SHA1_CTX *sha_info)
{
int count, i, j;
- ap_uint32_t lo_bit_count, hi_bit_count, k;
+ apr_uint32_t lo_bit_count, hi_bit_count, k;
lo_bit_count = sha_info->count_lo;
hi_bit_count = sha_info->count_hi;
@@ -400,7 +400,7 @@
ap_SHA1Final(digest, &context);
/* private marker. */
- ap_cpystrn(out, AP_SHA1PW_ID, AP_SHA1PW_IDLEN + 1);
+ apr_cpystrn(out, AP_SHA1PW_ID, AP_SHA1PW_IDLEN + 1);
/* SHA1 hash is always 20 chars */
l = ap_base64encode_binary(out + AP_SHA1PW_IDLEN, digest, sizeof(digest));
diff --git a/encoding/ap_base64.c b/encoding/ap_base64.c
index 8bff85b..af1e930 100644
--- a/encoding/ap_base64.c
+++ b/encoding/ap_base64.c
@@ -58,7 +58,7 @@
/* base64 encoder/decoder. Originally part of main/util.c
* but moved here so that support/ab and ap_sha1.c could
- * use it. This meant removing the ap_palloc()s and adding
+ * use it. This meant removing the apr_palloc()s and adding
* ugly 'len' functions, which is quite a nasty cost.
*/
@@ -111,15 +111,15 @@
};
#ifdef CHARSET_EBCDIC
-static ap_xlate_t *xlate_to_ebcdic;
+static apr_xlate_t *xlate_to_ebcdic;
static unsigned char os_toascii[256];
-API_EXPORT(ap_status_t) ap_base64init_ebcdic(ap_xlate_t *to_ascii,
- ap_xlate_t *to_ebcdic)
+API_EXPORT(apr_status_t) ap_base64init_ebcdic(apr_xlate_t *to_ascii,
+ apr_xlate_t *to_ebcdic)
{
int i;
- ap_size_t inbytes_left, outbytes_left;
- ap_status_t rv;
+ apr_size_t inbytes_left, outbytes_left;
+ apr_status_t rv;
int onoff;
/* Only single-byte conversion is supported.
@@ -168,7 +168,7 @@
API_EXPORT(int) ap_base64decode(char *bufplain, const char *bufcoded)
{
#ifdef CHARSET_EBCDIC
- ap_size_t inbytes_left, outbytes_left;
+ apr_size_t inbytes_left, outbytes_left;
#endif /* CHARSET_EBCDIC */
int len;
diff --git a/encoding/apr_base64.c b/encoding/apr_base64.c
index 8bff85b..af1e930 100644
--- a/encoding/apr_base64.c
+++ b/encoding/apr_base64.c
@@ -58,7 +58,7 @@
/* base64 encoder/decoder. Originally part of main/util.c
* but moved here so that support/ab and ap_sha1.c could
- * use it. This meant removing the ap_palloc()s and adding
+ * use it. This meant removing the apr_palloc()s and adding
* ugly 'len' functions, which is quite a nasty cost.
*/
@@ -111,15 +111,15 @@
};
#ifdef CHARSET_EBCDIC
-static ap_xlate_t *xlate_to_ebcdic;
+static apr_xlate_t *xlate_to_ebcdic;
static unsigned char os_toascii[256];
-API_EXPORT(ap_status_t) ap_base64init_ebcdic(ap_xlate_t *to_ascii,
- ap_xlate_t *to_ebcdic)
+API_EXPORT(apr_status_t) ap_base64init_ebcdic(apr_xlate_t *to_ascii,
+ apr_xlate_t *to_ebcdic)
{
int i;
- ap_size_t inbytes_left, outbytes_left;
- ap_status_t rv;
+ apr_size_t inbytes_left, outbytes_left;
+ apr_status_t rv;
int onoff;
/* Only single-byte conversion is supported.
@@ -168,7 +168,7 @@
API_EXPORT(int) ap_base64decode(char *bufplain, const char *bufcoded)
{
#ifdef CHARSET_EBCDIC
- ap_size_t inbytes_left, outbytes_left;
+ apr_size_t inbytes_left, outbytes_left;
#endif /* CHARSET_EBCDIC */
int len;
diff --git a/hooks/ap_hooks.c b/hooks/ap_hooks.c
index cd07e82..09d280d 100644
--- a/hooks/ap_hooks.c
+++ b/hooks/ap_hooks.c
@@ -3,10 +3,10 @@
#include <assert.h>
#if 0
-#define ap_palloc(pool,size) malloc(size)
+#define apr_palloc(pool,size) malloc(size)
#endif
-API_VAR_EXPORT ap_pool_t *ap_global_hook_pool = NULL;
+API_VAR_EXPORT apr_pool_t *ap_global_hook_pool = NULL;
API_VAR_EXPORT int ap_debug_module_hooks = FALSE;
API_VAR_EXPORT const char *ap_debug_module_name = NULL;
@@ -36,15 +36,15 @@
return a->nOrder-b->nOrder;
}
-static TSort *prepare(ap_pool_t *p,TSortData *pItems,int nItems)
+static TSort *prepare(apr_pool_t *p,TSortData *pItems,int nItems)
{
- TSort *pData=ap_palloc(p,nItems*sizeof *pData);
+ TSort *pData=apr_palloc(p,nItems*sizeof *pData);
int n;
qsort(pItems,nItems,sizeof *pItems,crude_order);
for(n=0 ; n < nItems ; ++n) {
pData[n].nPredecessors=0;
- pData[n].ppPredecessors=ap_pcalloc(p,nItems*sizeof *pData[n].ppPredecessors);
+ pData[n].ppPredecessors=apr_pcalloc(p,nItems*sizeof *pData[n].ppPredecessors);
pData[n].pNext=NULL;
pData[n].pData=&pItems[n];
}
@@ -115,23 +115,23 @@
return pHead;
}
-static ap_array_header_t *sort_hook(ap_array_header_t *pHooks,const char *szName)
+static apr_array_header_t *sort_hook(apr_array_header_t *pHooks,const char *szName)
{
- ap_pool_t *p;
+ apr_pool_t *p;
TSort *pSort;
- ap_array_header_t *pNew;
+ apr_array_header_t *pNew;
int n;
- ap_create_pool(&p, ap_global_hook_pool);
+ apr_create_pool(&p, ap_global_hook_pool);
pSort=prepare(p,(TSortData *)pHooks->elts,pHooks->nelts);
pSort=tsort(pSort,pHooks->nelts);
- pNew=ap_make_array(ap_global_hook_pool,pHooks->nelts,sizeof(TSortData));
+ pNew=apr_make_array(ap_global_hook_pool,pHooks->nelts,sizeof(TSortData));
if(ap_debug_module_hooks)
printf("Sorting %s:",szName);
for(n=0 ; pSort ; pSort=pSort->pNext,++n) {
TSortData *pHook;
assert(n < pHooks->nelts);
- pHook=ap_push_array(pNew);
+ pHook=apr_push_array(pNew);
memcpy(pHook,pSort->pData,sizeof *pHook);
if(ap_debug_module_hooks)
printf(" %s",pHook->szName);
@@ -141,21 +141,21 @@
return pNew;
}
-static ap_array_header_t *s_aHooksToSort;
+static apr_array_header_t *s_aHooksToSort;
typedef struct
{
const char *szHookName;
- ap_array_header_t **paHooks;
+ apr_array_header_t **paHooks;
} HookSortEntry;
API_EXPORT(void) ap_hook_sort_register(const char *szHookName,
- ap_array_header_t **paHooks)
+ apr_array_header_t **paHooks)
{
HookSortEntry *pEntry;
if(!s_aHooksToSort)
- s_aHooksToSort=ap_make_array(ap_global_hook_pool,1,sizeof(HookSortEntry));
- pEntry=ap_push_array(s_aHooksToSort);
+ s_aHooksToSort=apr_make_array(ap_global_hook_pool,1,sizeof(HookSortEntry));
+ pEntry=apr_push_array(s_aHooksToSort);
pEntry->szHookName=szHookName;
pEntry->paHooks=paHooks;
}
diff --git a/hooks/apr_hooks.c b/hooks/apr_hooks.c
index cd07e82..09d280d 100644
--- a/hooks/apr_hooks.c
+++ b/hooks/apr_hooks.c
@@ -3,10 +3,10 @@
#include <assert.h>
#if 0
-#define ap_palloc(pool,size) malloc(size)
+#define apr_palloc(pool,size) malloc(size)
#endif
-API_VAR_EXPORT ap_pool_t *ap_global_hook_pool = NULL;
+API_VAR_EXPORT apr_pool_t *ap_global_hook_pool = NULL;
API_VAR_EXPORT int ap_debug_module_hooks = FALSE;
API_VAR_EXPORT const char *ap_debug_module_name = NULL;
@@ -36,15 +36,15 @@
return a->nOrder-b->nOrder;
}
-static TSort *prepare(ap_pool_t *p,TSortData *pItems,int nItems)
+static TSort *prepare(apr_pool_t *p,TSortData *pItems,int nItems)
{
- TSort *pData=ap_palloc(p,nItems*sizeof *pData);
+ TSort *pData=apr_palloc(p,nItems*sizeof *pData);
int n;
qsort(pItems,nItems,sizeof *pItems,crude_order);
for(n=0 ; n < nItems ; ++n) {
pData[n].nPredecessors=0;
- pData[n].ppPredecessors=ap_pcalloc(p,nItems*sizeof *pData[n].ppPredecessors);
+ pData[n].ppPredecessors=apr_pcalloc(p,nItems*sizeof *pData[n].ppPredecessors);
pData[n].pNext=NULL;
pData[n].pData=&pItems[n];
}
@@ -115,23 +115,23 @@
return pHead;
}
-static ap_array_header_t *sort_hook(ap_array_header_t *pHooks,const char *szName)
+static apr_array_header_t *sort_hook(apr_array_header_t *pHooks,const char *szName)
{
- ap_pool_t *p;
+ apr_pool_t *p;
TSort *pSort;
- ap_array_header_t *pNew;
+ apr_array_header_t *pNew;
int n;
- ap_create_pool(&p, ap_global_hook_pool);
+ apr_create_pool(&p, ap_global_hook_pool);
pSort=prepare(p,(TSortData *)pHooks->elts,pHooks->nelts);
pSort=tsort(pSort,pHooks->nelts);
- pNew=ap_make_array(ap_global_hook_pool,pHooks->nelts,sizeof(TSortData));
+ pNew=apr_make_array(ap_global_hook_pool,pHooks->nelts,sizeof(TSortData));
if(ap_debug_module_hooks)
printf("Sorting %s:",szName);
for(n=0 ; pSort ; pSort=pSort->pNext,++n) {
TSortData *pHook;
assert(n < pHooks->nelts);
- pHook=ap_push_array(pNew);
+ pHook=apr_push_array(pNew);
memcpy(pHook,pSort->pData,sizeof *pHook);
if(ap_debug_module_hooks)
printf(" %s",pHook->szName);
@@ -141,21 +141,21 @@
return pNew;
}
-static ap_array_header_t *s_aHooksToSort;
+static apr_array_header_t *s_aHooksToSort;
typedef struct
{
const char *szHookName;
- ap_array_header_t **paHooks;
+ apr_array_header_t **paHooks;
} HookSortEntry;
API_EXPORT(void) ap_hook_sort_register(const char *szHookName,
- ap_array_header_t **paHooks)
+ apr_array_header_t **paHooks)
{
HookSortEntry *pEntry;
if(!s_aHooksToSort)
- s_aHooksToSort=ap_make_array(ap_global_hook_pool,1,sizeof(HookSortEntry));
- pEntry=ap_push_array(s_aHooksToSort);
+ s_aHooksToSort=apr_make_array(ap_global_hook_pool,1,sizeof(HookSortEntry));
+ pEntry=apr_push_array(s_aHooksToSort);
pEntry->szHookName=szHookName;
pEntry->paHooks=paHooks;
}
diff --git a/include/ap_base64.h b/include/ap_base64.h
index 7c13419..90a8e88 100644
--- a/include/ap_base64.h
+++ b/include/ap_base64.h
@@ -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.
*/
diff --git a/include/ap_hooks.h b/include/ap_hooks.h
index 75d39c1..07f28cb 100644
--- a/include/ap_hooks.h
+++ b/include/ap_hooks.h
@@ -57,7 +57,7 @@
#include "ap_config.h"
-/* For ap_array_header_t */
+/* For apr_array_header_t */
#include "apr_lib.h"
/**
@@ -82,7 +82,7 @@
static struct { members } _hooks;
#define AP_HOOK_LINK(name) \
- ap_array_header_t *link_##name;
+ apr_array_header_t *link_##name;
#define AP_IMPLEMENT_HOOK_BASE(name) \
API_EXPORT(void) ap_hook_##name(HOOK_##name *pf,const char * const *aszPre, \
@@ -91,10 +91,10 @@
LINK_##name *pHook; \
if(!_hooks.link_##name) \
{ \
- _hooks.link_##name=ap_make_array(ap_global_hook_pool,1,sizeof(LINK_##name)); \
+ _hooks.link_##name=apr_make_array(ap_global_hook_pool,1,sizeof(LINK_##name)); \
ap_hook_sort_register(#name,&_hooks.link_##name); \
} \
- pHook=ap_push_array(_hooks.link_##name); \
+ pHook=apr_push_array(_hooks.link_##name); \
pHook->pFunc=pf; \
pHook->aszPredecessors=aszPre; \
pHook->aszSuccessors=aszSucc; \
@@ -180,20 +180,20 @@
/**
* The global pool used to allocate any memory needed by the hooks.
- * @defvar ap_pool_t *ap_global_hook_pool
+ * @defvar apr_pool_t *ap_global_hook_pool
*/
-extern API_VAR_EXPORT ap_pool_t *ap_global_hook_pool;
+extern API_VAR_EXPORT apr_pool_t *ap_global_hook_pool;
/**
* A global variable to determine if debugging information about the
* hooks functions should be printed
- * @defvar ap_pool_t *ap_debug_module_hooks
+ * @defvar apr_pool_t *ap_debug_module_hooks
*/
extern API_VAR_EXPORT int ap_debug_module_hooks;
/**
* The name of the module that is currently registering a function
- * @defvar ap_pool_t *ap_debug_module_name
+ * @defvar apr_pool_t *ap_debug_module_name
*/
extern API_VAR_EXPORT const char *ap_debug_module_name;
@@ -204,7 +204,7 @@
* @deffunc void ap_hook_sort_register(const char *szHookName, ap_arry_header_t **aHooks)
*/
API_EXPORT(void) ap_hook_sort_register(const char *szHookName,
- ap_array_header_t **aHooks);
+ apr_array_header_t **aHooks);
/**
* Sort all of the registerd functions for a given hook
* @deffunc void ap_sort_hooks(void)
diff --git a/include/ap_sha1.h b/include/ap_sha1.h
index ca77043..832a13c 100644
--- a/include/ap_sha1.h
+++ b/include/ap_sha1.h
@@ -90,11 +90,11 @@
/**
* message digest
*/
- ap_uint32_t digest[5];
+ apr_uint32_t digest[5];
/** 64-bit bit counts */
- ap_uint32_t count_lo, count_hi;
+ apr_uint32_t count_lo, count_hi;
/** SHA data buffer */
- ap_uint32_t data[16];
+ apr_uint32_t data[16];
/** unprocessed amount in data */
int local;
};
diff --git a/include/apr_base64.h b/include/apr_base64.h
index 7c13419..90a8e88 100644
--- a/include/apr_base64.h
+++ b/include/apr_base64.h
@@ -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.
*/
diff --git a/include/apr_hooks.h b/include/apr_hooks.h
index 75d39c1..07f28cb 100644
--- a/include/apr_hooks.h
+++ b/include/apr_hooks.h
@@ -57,7 +57,7 @@
#include "ap_config.h"
-/* For ap_array_header_t */
+/* For apr_array_header_t */
#include "apr_lib.h"
/**
@@ -82,7 +82,7 @@
static struct { members } _hooks;
#define AP_HOOK_LINK(name) \
- ap_array_header_t *link_##name;
+ apr_array_header_t *link_##name;
#define AP_IMPLEMENT_HOOK_BASE(name) \
API_EXPORT(void) ap_hook_##name(HOOK_##name *pf,const char * const *aszPre, \
@@ -91,10 +91,10 @@
LINK_##name *pHook; \
if(!_hooks.link_##name) \
{ \
- _hooks.link_##name=ap_make_array(ap_global_hook_pool,1,sizeof(LINK_##name)); \
+ _hooks.link_##name=apr_make_array(ap_global_hook_pool,1,sizeof(LINK_##name)); \
ap_hook_sort_register(#name,&_hooks.link_##name); \
} \
- pHook=ap_push_array(_hooks.link_##name); \
+ pHook=apr_push_array(_hooks.link_##name); \
pHook->pFunc=pf; \
pHook->aszPredecessors=aszPre; \
pHook->aszSuccessors=aszSucc; \
@@ -180,20 +180,20 @@
/**
* The global pool used to allocate any memory needed by the hooks.
- * @defvar ap_pool_t *ap_global_hook_pool
+ * @defvar apr_pool_t *ap_global_hook_pool
*/
-extern API_VAR_EXPORT ap_pool_t *ap_global_hook_pool;
+extern API_VAR_EXPORT apr_pool_t *ap_global_hook_pool;
/**
* A global variable to determine if debugging information about the
* hooks functions should be printed
- * @defvar ap_pool_t *ap_debug_module_hooks
+ * @defvar apr_pool_t *ap_debug_module_hooks
*/
extern API_VAR_EXPORT int ap_debug_module_hooks;
/**
* The name of the module that is currently registering a function
- * @defvar ap_pool_t *ap_debug_module_name
+ * @defvar apr_pool_t *ap_debug_module_name
*/
extern API_VAR_EXPORT const char *ap_debug_module_name;
@@ -204,7 +204,7 @@
* @deffunc void ap_hook_sort_register(const char *szHookName, ap_arry_header_t **aHooks)
*/
API_EXPORT(void) ap_hook_sort_register(const char *szHookName,
- ap_array_header_t **aHooks);
+ apr_array_header_t **aHooks);
/**
* Sort all of the registerd functions for a given hook
* @deffunc void ap_sort_hooks(void)
diff --git a/include/apr_sha1.h b/include/apr_sha1.h
index ca77043..832a13c 100644
--- a/include/apr_sha1.h
+++ b/include/apr_sha1.h
@@ -90,11 +90,11 @@
/**
* message digest
*/
- ap_uint32_t digest[5];
+ apr_uint32_t digest[5];
/** 64-bit bit counts */
- ap_uint32_t count_lo, count_hi;
+ apr_uint32_t count_lo, count_hi;
/** SHA data buffer */
- ap_uint32_t data[16];
+ apr_uint32_t data[16];
/** unprocessed amount in data */
int local;
};
diff --git a/include/apr_xml.h b/include/apr_xml.h
index f7e45d4..7d30236 100644
--- a/include/apr_xml.h
+++ b/include/apr_xml.h
@@ -80,7 +80,7 @@
ap_text *last;
} ap_text_header;
-API_EXPORT(void) ap_text_append(ap_pool_t *p, ap_text_header *hdr,
+API_EXPORT(void) ap_text_append(apr_pool_t *p, ap_text_header *hdr,
const char *text);
@@ -186,15 +186,15 @@
typedef struct ap_xml_doc
{
ap_xml_elem *root; /* root element */
- ap_array_header_t *namespaces; /* array of namespaces used */
+ apr_array_header_t *namespaces; /* array of namespaces used */
} ap_xml_doc;
API_EXPORT(int) ap_xml_parse_input(request_rec *r, ap_xml_doc **pdoc);
/* Converts an XML element tree to flat text */
-API_EXPORT(void) ap_xml_to_text(ap_pool_t *p, const ap_xml_elem *elem,
- int style, ap_array_header_t *namespaces,
+API_EXPORT(void) ap_xml_to_text(apr_pool_t *p, const ap_xml_elem *elem,
+ int style, apr_array_header_t *namespaces,
int *ns_map, const char **pbuf, size_t *psize);
/* style argument values: */
@@ -203,17 +203,17 @@
#define AP_XML_X2T_LANG_INNER 2 /* xml:lang + inner contents */
#define AP_XML_X2T_FULL_NS_LANG 3 /* FULL + ns defns + xml:lang */
-API_EXPORT(const char *) ap_xml_empty_elem(ap_pool_t *p,
+API_EXPORT(const char *) ap_xml_empty_elem(apr_pool_t *p,
const ap_xml_elem *elem);
-API_EXPORT(const char *) ap_xml_quote_string(ap_pool_t *p, const char *s,
+API_EXPORT(const char *) ap_xml_quote_string(apr_pool_t *p, const char *s,
int quotes);
-API_EXPORT(void) ap_xml_quote_elem(ap_pool_t *p, ap_xml_elem *elem);
+API_EXPORT(void) ap_xml_quote_elem(apr_pool_t *p, ap_xml_elem *elem);
/* manage an array of unique URIs: ap_xml_insert_uri() and AP_XML_URI_ITEM() */
/* return the URI's (existing) index, or insert it and return a new index */
-API_EXPORT(int) ap_xml_insert_uri(ap_array_header_t *uri_array,
+API_EXPORT(int) ap_xml_insert_uri(apr_array_header_t *uri_array,
const char *uri);
#define AP_XML_GET_URI_ITEM(ary, i) (((const char * const *)(ary)->elts)[i])
diff --git a/src/crypto/ap_sha1.c b/src/crypto/ap_sha1.c
index f258f8f..b7e2625 100644
--- a/src/crypto/ap_sha1.c
+++ b/src/crypto/ap_sha1.c
@@ -120,11 +120,11 @@
#define SHA_BLOCKSIZE 64
#ifdef CHARSET_EBCDIC
-static ap_xlate_t *ebcdic2ascii_xlate;
+static apr_xlate_t *ebcdic2ascii_xlate;
-API_EXPORT(ap_status_t) ap_SHA1InitEBCDIC(ap_xlate_t *x)
+API_EXPORT(apr_status_t) ap_SHA1InitEBCDIC(apr_xlate_t *x)
{
- ap_status_t rv;
+ apr_status_t rv;
int onoff;
/* Only single-byte conversion is supported.
@@ -147,7 +147,7 @@
static void sha_transform(AP_SHA1_CTX *sha_info)
{
int i;
- ap_uint32_t temp, A, B, C, D, E, W[80];
+ apr_uint32_t temp, A, B, C, D, E, W[80];
for (i = 0; i < 16; ++i) {
W[i] = sha_info->data[i];
@@ -219,13 +219,13 @@
/* change endianness of data */
/* count is the number of bytes to do an endian flip */
-static void maybe_byte_reverse(ap_uint32_t *buffer, int count)
+static void maybe_byte_reverse(apr_uint32_t *buffer, int count)
{
int i;
AP_BYTE ct[4], *cp;
if (isLittleEndian()) { /* do the swap only if it is little endian */
- count /= sizeof(ap_uint32_t);
+ count /= sizeof(apr_uint32_t);
cp = (AP_BYTE *) buffer;
for (i = 0; i < count; ++i) {
ct[0] = cp[0];
@@ -236,7 +236,7 @@
cp[1] = ct[2];
cp[2] = ct[1];
cp[3] = ct[0];
- cp += sizeof(ap_uint32_t);
+ cp += sizeof(apr_uint32_t);
}
}
}
@@ -263,11 +263,11 @@
{
unsigned int i;
- if ((sha_info->count_lo + ((ap_uint32_t) count << 3)) < sha_info->count_lo) {
+ if ((sha_info->count_lo + ((apr_uint32_t) count << 3)) < sha_info->count_lo) {
++sha_info->count_hi;
}
- sha_info->count_lo += (ap_uint32_t) count << 3;
- sha_info->count_hi += (ap_uint32_t) count >> 29;
+ sha_info->count_lo += (apr_uint32_t) count << 3;
+ sha_info->count_hi += (apr_uint32_t) count >> 29;
if (sha_info->local) {
i = SHA_BLOCKSIZE - sha_info->local;
if (i > count) {
@@ -302,13 +302,13 @@
#ifdef CHARSET_EBCDIC
int i;
const AP_BYTE *buffer = (const AP_BYTE *) buf;
- ap_size_t inbytes_left, outbytes_left;
+ apr_size_t inbytes_left, outbytes_left;
- if ((sha_info->count_lo + ((ap_uint32_t) count << 3)) < sha_info->count_lo) {
+ if ((sha_info->count_lo + ((apr_uint32_t) count << 3)) < sha_info->count_lo) {
++sha_info->count_hi;
}
- sha_info->count_lo += (ap_uint32_t) count << 3;
- sha_info->count_hi += (ap_uint32_t) count >> 29;
+ sha_info->count_lo += (apr_uint32_t) count << 3;
+ sha_info->count_hi += (apr_uint32_t) count >> 29;
/* Is there a remainder of the previous Update operation? */
if (sha_info->local) {
i = SHA_BLOCKSIZE - sha_info->local;
@@ -354,7 +354,7 @@
AP_SHA1_CTX *sha_info)
{
int count, i, j;
- ap_uint32_t lo_bit_count, hi_bit_count, k;
+ apr_uint32_t lo_bit_count, hi_bit_count, k;
lo_bit_count = sha_info->count_lo;
hi_bit_count = sha_info->count_hi;
@@ -400,7 +400,7 @@
ap_SHA1Final(digest, &context);
/* private marker. */
- ap_cpystrn(out, AP_SHA1PW_ID, AP_SHA1PW_IDLEN + 1);
+ apr_cpystrn(out, AP_SHA1PW_ID, AP_SHA1PW_IDLEN + 1);
/* SHA1 hash is always 20 chars */
l = ap_base64encode_binary(out + AP_SHA1PW_IDLEN, digest, sizeof(digest));
diff --git a/src/encoding/ap_base64.c b/src/encoding/ap_base64.c
index 8bff85b..af1e930 100644
--- a/src/encoding/ap_base64.c
+++ b/src/encoding/ap_base64.c
@@ -58,7 +58,7 @@
/* base64 encoder/decoder. Originally part of main/util.c
* but moved here so that support/ab and ap_sha1.c could
- * use it. This meant removing the ap_palloc()s and adding
+ * use it. This meant removing the apr_palloc()s and adding
* ugly 'len' functions, which is quite a nasty cost.
*/
@@ -111,15 +111,15 @@
};
#ifdef CHARSET_EBCDIC
-static ap_xlate_t *xlate_to_ebcdic;
+static apr_xlate_t *xlate_to_ebcdic;
static unsigned char os_toascii[256];
-API_EXPORT(ap_status_t) ap_base64init_ebcdic(ap_xlate_t *to_ascii,
- ap_xlate_t *to_ebcdic)
+API_EXPORT(apr_status_t) ap_base64init_ebcdic(apr_xlate_t *to_ascii,
+ apr_xlate_t *to_ebcdic)
{
int i;
- ap_size_t inbytes_left, outbytes_left;
- ap_status_t rv;
+ apr_size_t inbytes_left, outbytes_left;
+ apr_status_t rv;
int onoff;
/* Only single-byte conversion is supported.
@@ -168,7 +168,7 @@
API_EXPORT(int) ap_base64decode(char *bufplain, const char *bufcoded)
{
#ifdef CHARSET_EBCDIC
- ap_size_t inbytes_left, outbytes_left;
+ apr_size_t inbytes_left, outbytes_left;
#endif /* CHARSET_EBCDIC */
int len;
diff --git a/src/hooks/ap_hooks.c b/src/hooks/ap_hooks.c
index cd07e82..09d280d 100644
--- a/src/hooks/ap_hooks.c
+++ b/src/hooks/ap_hooks.c
@@ -3,10 +3,10 @@
#include <assert.h>
#if 0
-#define ap_palloc(pool,size) malloc(size)
+#define apr_palloc(pool,size) malloc(size)
#endif
-API_VAR_EXPORT ap_pool_t *ap_global_hook_pool = NULL;
+API_VAR_EXPORT apr_pool_t *ap_global_hook_pool = NULL;
API_VAR_EXPORT int ap_debug_module_hooks = FALSE;
API_VAR_EXPORT const char *ap_debug_module_name = NULL;
@@ -36,15 +36,15 @@
return a->nOrder-b->nOrder;
}
-static TSort *prepare(ap_pool_t *p,TSortData *pItems,int nItems)
+static TSort *prepare(apr_pool_t *p,TSortData *pItems,int nItems)
{
- TSort *pData=ap_palloc(p,nItems*sizeof *pData);
+ TSort *pData=apr_palloc(p,nItems*sizeof *pData);
int n;
qsort(pItems,nItems,sizeof *pItems,crude_order);
for(n=0 ; n < nItems ; ++n) {
pData[n].nPredecessors=0;
- pData[n].ppPredecessors=ap_pcalloc(p,nItems*sizeof *pData[n].ppPredecessors);
+ pData[n].ppPredecessors=apr_pcalloc(p,nItems*sizeof *pData[n].ppPredecessors);
pData[n].pNext=NULL;
pData[n].pData=&pItems[n];
}
@@ -115,23 +115,23 @@
return pHead;
}
-static ap_array_header_t *sort_hook(ap_array_header_t *pHooks,const char *szName)
+static apr_array_header_t *sort_hook(apr_array_header_t *pHooks,const char *szName)
{
- ap_pool_t *p;
+ apr_pool_t *p;
TSort *pSort;
- ap_array_header_t *pNew;
+ apr_array_header_t *pNew;
int n;
- ap_create_pool(&p, ap_global_hook_pool);
+ apr_create_pool(&p, ap_global_hook_pool);
pSort=prepare(p,(TSortData *)pHooks->elts,pHooks->nelts);
pSort=tsort(pSort,pHooks->nelts);
- pNew=ap_make_array(ap_global_hook_pool,pHooks->nelts,sizeof(TSortData));
+ pNew=apr_make_array(ap_global_hook_pool,pHooks->nelts,sizeof(TSortData));
if(ap_debug_module_hooks)
printf("Sorting %s:",szName);
for(n=0 ; pSort ; pSort=pSort->pNext,++n) {
TSortData *pHook;
assert(n < pHooks->nelts);
- pHook=ap_push_array(pNew);
+ pHook=apr_push_array(pNew);
memcpy(pHook,pSort->pData,sizeof *pHook);
if(ap_debug_module_hooks)
printf(" %s",pHook->szName);
@@ -141,21 +141,21 @@
return pNew;
}
-static ap_array_header_t *s_aHooksToSort;
+static apr_array_header_t *s_aHooksToSort;
typedef struct
{
const char *szHookName;
- ap_array_header_t **paHooks;
+ apr_array_header_t **paHooks;
} HookSortEntry;
API_EXPORT(void) ap_hook_sort_register(const char *szHookName,
- ap_array_header_t **paHooks)
+ apr_array_header_t **paHooks)
{
HookSortEntry *pEntry;
if(!s_aHooksToSort)
- s_aHooksToSort=ap_make_array(ap_global_hook_pool,1,sizeof(HookSortEntry));
- pEntry=ap_push_array(s_aHooksToSort);
+ s_aHooksToSort=apr_make_array(ap_global_hook_pool,1,sizeof(HookSortEntry));
+ pEntry=apr_push_array(s_aHooksToSort);
pEntry->szHookName=szHookName;
pEntry->paHooks=paHooks;
}
diff --git a/xml/apr_xml.c b/xml/apr_xml.c
index d0f25a7..56b05bb 100644
--- a/xml/apr_xml.c
+++ b/xml/apr_xml.c
@@ -86,7 +86,7 @@
/* content for parsing */
typedef struct ap_xml_ctx {
ap_xml_doc *doc; /* the doc we're parsing */
- ap_pool_t *p; /* the pool we allocate from */
+ apr_pool_t *p; /* the pool we allocate from */
ap_xml_elem *cur_elem; /* current element */
int error; /* an error has occurred */
@@ -162,16 +162,16 @@
if (ctx->error)
return;
- elem = ap_pcalloc(ctx->p, sizeof(*elem));
+ elem = apr_pcalloc(ctx->p, sizeof(*elem));
/* prep the element */
- elem->name = elem_name = ap_pstrdup(ctx->p, name);
+ elem->name = elem_name = apr_pstrdup(ctx->p, name);
/* fill in the attributes (note: ends up in reverse order) */
while (*attrs) {
- attr = ap_palloc(ctx->p, sizeof(*attr));
- attr->name = ap_pstrdup(ctx->p, *attrs++);
- attr->value = ap_pstrdup(ctx->p, *attrs++);
+ attr = apr_palloc(ctx->p, sizeof(*attr));
+ attr->name = apr_pstrdup(ctx->p, *attrs++);
+ attr->value = apr_pstrdup(ctx->p, *attrs++);
attr->next = elem->attr;
elem->attr = attr;
}
@@ -221,7 +221,7 @@
quoted = ap_xml_quote_string(ctx->p, attr->value, 1);
/* build and insert the new scope */
- ns_scope = ap_pcalloc(ctx->p, sizeof(*ns_scope));
+ ns_scope = apr_pcalloc(ctx->p, sizeof(*ns_scope));
ns_scope->prefix = prefix;
ns_scope->ns = ap_xml_insert_uri(ctx->doc->namespaces, quoted);
ns_scope->emptyURI = *quoted == '\0';
@@ -344,7 +344,7 @@
return;
elem = ctx->cur_elem;
- s = ap_pstrndup(ctx->p, data, len);
+ s = apr_pstrndup(ctx->p, data, len);
if (elem->last_child == NULL) {
/* no children yet. this cdata follows the start tag */
@@ -374,9 +374,9 @@
}
ctx.p = r->pool;
- ctx.doc = ap_pcalloc(ctx.p, sizeof(*ctx.doc));
+ ctx.doc = apr_pcalloc(ctx.p, sizeof(*ctx.doc));
- ctx.doc->namespaces = ap_make_array(ctx.p, 5, sizeof(const char *));
+ ctx.doc->namespaces = apr_make_array(ctx.p, 5, sizeof(const char *));
ap_xml_insert_uri(ctx.doc->namespaces, "DAV:");
/* ### we should get the encoding from Content-Encoding */
@@ -400,7 +400,7 @@
size_t limit_xml_body = ap_get_limit_xml_body(r);
/* allocate our working buffer */
- buffer = ap_palloc(r->pool, AP_XML_READ_BLOCKSIZE);
+ buffer = apr_palloc(r->pool, AP_XML_READ_BLOCKSIZE);
/* read the body, stuffing it into the parser */
while ((len = ap_get_client_block(r, buffer, AP_XML_READ_BLOCKSIZE)) > 0) {
@@ -474,10 +474,10 @@
return HTTP_BAD_REQUEST;
}
-API_EXPORT(void) ap_text_append(ap_pool_t * p, ap_text_header *hdr,
+API_EXPORT(void) ap_text_append(apr_pool_t * p, ap_text_header *hdr,
const char *text)
{
- ap_text *t = ap_palloc(p, sizeof(*t));
+ ap_text *t = apr_palloc(p, sizeof(*t));
t->text = text;
t->next = NULL;
@@ -508,7 +508,7 @@
** quotes is typically set to true for XML strings that will occur within
** double quotes -- attribute values.
*/
-API_EXPORT(const char *) ap_xml_quote_string(ap_pool_t *p, const char *s,
+API_EXPORT(const char *) ap_xml_quote_string(apr_pool_t *p, const char *s,
int quotes)
{
const char *scan;
@@ -531,7 +531,7 @@
if (extra == 0)
return s;
- qstr = ap_palloc(p, len + extra + 1);
+ qstr = apr_palloc(p, len + extra + 1);
for (scan = s, qscan = qstr; (c = *scan) != '\0'; ++scan) {
if (c == '<') {
*qscan++ = '&';
@@ -585,7 +585,7 @@
}
static size_t elem_size(const ap_xml_elem *elem, int style,
- ap_array_header_t *namespaces, int *ns_map)
+ apr_array_header_t *namespaces, int *ns_map)
{
size_t size;
@@ -693,7 +693,7 @@
}
static char *write_elem(char *s, const ap_xml_elem *elem, int style,
- ap_array_header_t *namespaces, int *ns_map)
+ apr_array_header_t *namespaces, int *ns_map)
{
const ap_xml_elem *child;
size_t len;
@@ -781,7 +781,7 @@
return s;
}
-API_EXPORT(void) ap_xml_quote_elem(ap_pool_t *p, ap_xml_elem *elem)
+API_EXPORT(void) ap_xml_quote_elem(apr_pool_t *p, ap_xml_elem *elem)
{
ap_text *scan_txt;
ap_xml_attr *scan_attr;
@@ -815,13 +815,13 @@
}
/* convert an element to a text string */
-API_EXPORT(void) ap_xml_to_text(ap_pool_t * p, const ap_xml_elem *elem,
- int style, ap_array_header_t *namespaces,
+API_EXPORT(void) ap_xml_to_text(apr_pool_t * p, const ap_xml_elem *elem,
+ int style, apr_array_header_t *namespaces,
int *ns_map, const char **pbuf, size_t *psize)
{
/* get the exact size, plus a null terminator */
size_t size = elem_size(elem, style, namespaces, ns_map) + 1;
- char *s = ap_palloc(p, size);
+ char *s = apr_palloc(p, size);
(void) write_elem(s, elem, style, namespaces, ns_map);
s[size - 1] = '\0';
@@ -831,7 +831,7 @@
*psize = size;
}
-API_EXPORT(const char *) ap_xml_empty_elem(ap_pool_t * p,
+API_EXPORT(const char *) ap_xml_empty_elem(apr_pool_t * p,
const ap_xml_elem *elem)
{
if (elem->ns == AP_XML_NS_NONE) {
@@ -839,14 +839,14 @@
* The prefix (xml...) is already within the prop name, or
* the element simply has no prefix.
*/
- return ap_psprintf(p, "<%s/>" DEBUG_CR, elem->name);
+ return apr_psprintf(p, "<%s/>" DEBUG_CR, elem->name);
}
- return ap_psprintf(p, "<ns%d:%s/>" DEBUG_CR, elem->ns, elem->name);
+ return apr_psprintf(p, "<ns%d:%s/>" DEBUG_CR, elem->ns, elem->name);
}
/* return the URI's (existing) index, or insert it and return a new index */
-API_EXPORT(int) ap_xml_insert_uri(ap_array_header_t *uri_array,
+API_EXPORT(int) ap_xml_insert_uri(apr_array_header_t *uri_array,
const char *uri)
{
int i;
@@ -857,7 +857,7 @@
return i;
}
- pelt = ap_push_array(uri_array);
+ pelt = apr_push_array(uri_array);
*pelt = uri; /* assume uri is const or in a pool */
return uri_array->nelts - 1;
}