diff --git a/libs/apr/Makefile.in b/libs/apr/Makefile.in index ee7969f9fc..2c347b7322 100644 --- a/libs/apr/Makefile.in +++ b/libs/apr/Makefile.in @@ -45,7 +45,7 @@ TARGETS = $(TARGET_LIB) export_vars.c apr.exp CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs \ build/apr_rules.out DISTCLEAN_TARGETS = config.cache config.log config.status \ - include/apr.h include/arch/unix/apr_private.h \ + include/fspr.h include/arch/unix/apr_private.h \ libtool $(APR_CONFIG) build/apr_rules.mk apr.pc \ build/pkg/pkginfo EXTRACLEAN_TARGETS = configure aclocal.m4 include/arch/unix/apr_private.h.in \ @@ -81,7 +81,7 @@ $(top_srcdir)/configure: $(top_srcdir)/configure.ac install: $(TARGET_LIB) apr-config.out build/apr_rules.out $(APR_MKDIR) $(DESTDIR)$(libdir) $(DESTDIR)$(bindir) $(DESTDIR)$(installbuilddir) \ $(DESTDIR)$(libdir)/pkgconfig $(DESTDIR)$(includedir) - $(INSTALL_DATA) $(top_blddir)/include/apr.h $(DESTDIR)$(includedir) + $(INSTALL_DATA) $(top_blddir)/include/fspr.h $(DESTDIR)$(includedir) for f in $(top_srcdir)/include/apr_*.h; do \ $(INSTALL_DATA) $${f} $(DESTDIR)$(includedir); \ done diff --git a/libs/apr/apr.dsp b/libs/apr/apr.dsp index d1c1b29cfd..7c3d0160da 100644 --- a/libs/apr/apr.dsp +++ b/libs/apr/apr.dsp @@ -41,7 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir "LibR" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr_src" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibR\fspr_src" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -65,7 +65,7 @@ LIB32=link.exe -lib # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr_src" /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\fspr_src" /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe @@ -89,7 +89,7 @@ LIB32=link.exe -lib # PROP Default_Filter "" # Begin Source File -SOURCE=.\atomic\win32\apr_atomic.c +SOURCE=.\atomic\win32\fspr_atomic.c # End Source File # End Group # Begin Group "dso" @@ -193,7 +193,7 @@ SOURCE=.\locks\win32\thread_rwlock.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\memory\unix\apr_pools.c +SOURCE=.\memory\unix\fspr_pools.c # End Source File # End Group # Begin Group "misc" @@ -201,7 +201,7 @@ SOURCE=.\memory\unix\apr_pools.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\misc\win32\apr_app.c +SOURCE=.\misc\win32\fspr_app.c # PROP Exclude_From_Build 1 # End Source File # Begin Source File @@ -302,7 +302,7 @@ SOURCE=.\network_io\win32\sockopt.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\passwd\apr_getpass.c +SOURCE=.\passwd\fspr_getpass.c # End Source File # End Group # Begin Group "random" @@ -310,7 +310,7 @@ SOURCE=.\passwd\apr_getpass.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\random\unix\apr_random.c +SOURCE=.\random\unix\fspr_random.c # End Source File # Begin Source File @@ -334,27 +334,27 @@ SOURCE=.\shmem\win32\shm.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\strings\apr_cpystrn.c +SOURCE=.\strings\fspr_cpystrn.c # End Source File # Begin Source File -SOURCE=.\strings\apr_fnmatch.c +SOURCE=.\strings\fspr_fnmatch.c # End Source File # Begin Source File -SOURCE=.\strings\apr_snprintf.c +SOURCE=.\strings\fspr_snprintf.c # End Source File # Begin Source File -SOURCE=.\strings\apr_strings.c +SOURCE=.\strings\fspr_strings.c # End Source File # Begin Source File -SOURCE=.\strings\apr_strnatcmp.c +SOURCE=.\strings\fspr_strnatcmp.c # End Source File # Begin Source File -SOURCE=.\strings\apr_strtok.c +SOURCE=.\strings\fspr_strtok.c # End Source File # End Group # Begin Group "tables" @@ -362,11 +362,11 @@ SOURCE=.\strings\apr_strtok.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\tables\apr_hash.c +SOURCE=.\tables\fspr_hash.c # End Source File # Begin Source File -SOURCE=.\tables\apr_tables.c +SOURCE=.\tables\fspr_tables.c # End Source File # End Group # Begin Group "threadproc" @@ -423,51 +423,51 @@ SOURCE=.\user\win32\userinfo.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\include\arch\win32\apr_arch_atime.h +SOURCE=.\include\arch\win32\fspr_arch_atime.h # End Source File # Begin Source File -SOURCE=.\include\arch\win32\apr_arch_dso.h +SOURCE=.\include\arch\win32\fspr_arch_dso.h # End Source File # Begin Source File -SOURCE=.\include\arch\win32\apr_arch_file_io.h +SOURCE=.\include\arch\win32\fspr_arch_file_io.h # End Source File # Begin Source File -SOURCE=.\include\arch\win32\apr_arch_inherit.h +SOURCE=.\include\arch\win32\fspr_arch_inherit.h # End Source File # Begin Source File -SOURCE=.\include\arch\win32\apr_arch_misc.h +SOURCE=.\include\arch\win32\fspr_arch_misc.h # End Source File # Begin Source File -SOURCE=.\include\arch\win32\apr_arch_networkio.h +SOURCE=.\include\arch\win32\fspr_arch_networkio.h # End Source File # Begin Source File -SOURCE=.\include\arch\win32\apr_arch_thread_mutex.h +SOURCE=.\include\arch\win32\fspr_arch_thread_mutex.h # End Source File # Begin Source File -SOURCE=.\include\arch\win32\apr_arch_thread_rwlock.h +SOURCE=.\include\arch\win32\fspr_arch_thread_rwlock.h # End Source File # Begin Source File -SOURCE=.\include\arch\win32\apr_arch_threadproc.h +SOURCE=.\include\arch\win32\fspr_arch_threadproc.h # End Source File # Begin Source File -SOURCE=.\include\arch\win32\apr_arch_utf8.h +SOURCE=.\include\arch\win32\fspr_arch_utf8.h # End Source File # Begin Source File -SOURCE=.\include\arch\win32\apr_private.h +SOURCE=.\include\arch\win32\fspr_private.h # End Source File # Begin Source File -SOURCE=.\include\arch\apr_private_common.h +SOURCE=.\include\arch\fspr_private_common.h # End Source File # End Group # Begin Group "Public Header Files" @@ -475,35 +475,35 @@ SOURCE=.\include\arch\apr_private_common.h # PROP Default_Filter "" # Begin Source File -SOURCE=.\include\apr.h.in +SOURCE=.\include\fspr.h.in # PROP Exclude_From_Build 1 # End Source File # Begin Source File -SOURCE=.\include\apr.hnw +SOURCE=.\include\fspr.hnw # PROP Exclude_From_Build 1 # End Source File # Begin Source File -SOURCE=.\include\apr.hw +SOURCE=.\include\fspr.hw !IF "$(CFG)" == "apr - Win32 Release" # Begin Custom Build - Creating apr.h from apr.hw -InputPath=.\include\apr.hw +InputPath=.\include\fspr.hw -".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr.hw > .\include\apr.h +".\include\fspr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\fspr.hw > .\include\fspr.h # End Custom Build !ELSEIF "$(CFG)" == "apr - Win32 Debug" # Begin Custom Build - Creating apr.h from apr.hw -InputPath=.\include\apr.hw +InputPath=.\include\fspr.hw -".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr.hw > .\include\apr.h +".\include\fspr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\fspr.hw > .\include\fspr.h # End Custom Build @@ -512,139 +512,139 @@ InputPath=.\include\apr.hw # End Source File # Begin Source File -SOURCE=.\include\apr_allocator.h +SOURCE=.\include\fspr_allocator.h # End Source File # Begin Source File -SOURCE=.\include\apr_atomic.h +SOURCE=.\include\fspr_atomic.h # End Source File # Begin Source File -SOURCE=.\include\apr_dso.h +SOURCE=.\include\fspr_dso.h # End Source File # Begin Source File -SOURCE=.\include\apr_env.h +SOURCE=.\include\fspr_env.h # End Source File # Begin Source File -SOURCE=.\include\apr_errno.h +SOURCE=.\include\fspr_errno.h # End Source File # Begin Source File -SOURCE=.\include\apr_file_info.h +SOURCE=.\include\fspr_file_info.h # End Source File # Begin Source File -SOURCE=.\include\apr_file_io.h +SOURCE=.\include\fspr_file_io.h # End Source File # Begin Source File -SOURCE=.\include\apr_fnmatch.h +SOURCE=.\include\fspr_fnmatch.h # End Source File # Begin Source File -SOURCE=.\include\apr_general.h +SOURCE=.\include\fspr_general.h # End Source File # Begin Source File -SOURCE=.\include\apr_getopt.h +SOURCE=.\include\fspr_getopt.h # End Source File # Begin Source File -SOURCE=.\include\apr_global_mutex.h +SOURCE=.\include\fspr_global_mutex.h # End Source File # Begin Source File -SOURCE=.\include\apr_hash.h +SOURCE=.\include\fspr_hash.h # End Source File # Begin Source File -SOURCE=.\include\apr_inherit.h +SOURCE=.\include\fspr_inherit.h # End Source File # Begin Source File -SOURCE=.\include\apr_lib.h +SOURCE=.\include\fspr_lib.h # End Source File # Begin Source File -SOURCE=.\include\apr_mmap.h +SOURCE=.\include\fspr_mmap.h # End Source File # Begin Source File -SOURCE=.\include\apr_network_io.h +SOURCE=.\include\fspr_network_io.h # End Source File # Begin Source File -SOURCE=.\include\apr_poll.h +SOURCE=.\include\fspr_poll.h # End Source File # Begin Source File -SOURCE=.\include\apr_pools.h +SOURCE=.\include\fspr_pools.h # End Source File # Begin Source File -SOURCE=.\include\apr_portable.h +SOURCE=.\include\fspr_portable.h # End Source File # Begin Source File -SOURCE=.\include\apr_proc_mutex.h +SOURCE=.\include\fspr_proc_mutex.h # End Source File # Begin Source File -SOURCE=.\include\apr_ring.h +SOURCE=.\include\fspr_ring.h # End Source File # Begin Source File -SOURCE=.\include\apr_shm.h +SOURCE=.\include\fspr_shm.h # End Source File # Begin Source File -SOURCE=.\include\apr_signal.h +SOURCE=.\include\fspr_signal.h # End Source File # Begin Source File -SOURCE=.\include\apr_strings.h +SOURCE=.\include\fspr_strings.h # End Source File # Begin Source File -SOURCE=.\include\apr_support.h +SOURCE=.\include\fspr_support.h # End Source File # Begin Source File -SOURCE=.\include\apr_tables.h +SOURCE=.\include\fspr_tables.h # End Source File # Begin Source File -SOURCE=.\include\apr_thread_cond.h +SOURCE=.\include\fspr_thread_cond.h # End Source File # Begin Source File -SOURCE=.\include\apr_thread_mutex.h +SOURCE=.\include\fspr_thread_mutex.h # End Source File # Begin Source File -SOURCE=.\include\apr_thread_proc.h +SOURCE=.\include\fspr_thread_proc.h # End Source File # Begin Source File -SOURCE=.\include\apr_thread_rwlock.h +SOURCE=.\include\fspr_thread_rwlock.h # End Source File # Begin Source File -SOURCE=.\include\apr_time.h +SOURCE=.\include\fspr_time.h # End Source File # Begin Source File -SOURCE=.\include\apr_user.h +SOURCE=.\include\fspr_user.h # End Source File # Begin Source File -SOURCE=.\include\apr_version.h +SOURCE=.\include\fspr_version.h # End Source File # Begin Source File -SOURCE=.\include\apr_want.h +SOURCE=.\include\fspr_want.h # End Source File # End Group # End Target diff --git a/libs/apr/apr.dsw b/libs/apr/apr.dsw index dc0871bbc8..73db5d052e 100644 --- a/libs/apr/apr.dsw +++ b/libs/apr/apr.dsw @@ -15,7 +15,7 @@ Package=<4> ############################################################################### -Project: "apr_app"=".\build\apr_app.dsp" - Package Owner=<4> +Project: "fspr_app"=".\build\fspr_app.dsp" - Package Owner=<4> Package=<5> {{{ @@ -42,7 +42,7 @@ Package=<4> ############################################################################### -Project: "libapr_app"=".\build\libapr_app.dsp" - Package Owner=<4> +Project: "libfspr_app"=".\build\libfspr_app.dsp" - Package Owner=<4> Package=<5> {{{ diff --git a/libs/apr/atomic/netware/apr_atomic.c b/libs/apr/atomic/netware/fspr_atomic.c similarity index 61% rename from libs/apr/atomic/netware/apr_atomic.c rename to libs/apr/atomic/netware/fspr_atomic.c index 94a3549775..e54704064c 100644 --- a/libs/apr/atomic/netware/apr_atomic.c +++ b/libs/apr/atomic/netware/fspr_atomic.c @@ -14,57 +14,57 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_atomic.h" +#include "fspr.h" +#include "fspr_atomic.h" #include -APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_atomic_init(fspr_pool_t *pool) { return APR_SUCCESS; } -APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) +APR_DECLARE(fspr_uint32_t) fspr_atomic_add32(volatile fspr_uint32_t *mem, fspr_uint32_t val) { return atomic_xchgadd((unsigned long *)mem,(unsigned long)val); } -APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) +APR_DECLARE(void) fspr_atomic_sub32(volatile fspr_uint32_t *mem, fspr_uint32_t val) { atomic_sub((unsigned long *)mem,(unsigned long)val); } -APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) +APR_DECLARE(fspr_uint32_t) fspr_atomic_inc32(volatile fspr_uint32_t *mem) { return atomic_xchgadd((unsigned long *)mem, 1); } -APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) +APR_DECLARE(void) fspr_atomic_set32(volatile fspr_uint32_t *mem, fspr_uint32_t val) { *mem = val; } -APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem) +APR_DECLARE(fspr_uint32_t) fspr_atomic_read32(volatile fspr_uint32_t *mem) { return *mem; } -APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with,apr_uint32_t cmp) +APR_DECLARE(fspr_uint32_t) fspr_atomic_cas32(volatile fspr_uint32_t *mem, fspr_uint32_t with,fspr_uint32_t cmp) { return atomic_cmpxchg((unsigned long *)mem,(unsigned long)cmp,(unsigned long)with); } -APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) +APR_DECLARE(fspr_uint32_t) fspr_atomic_xchg32(volatile fspr_uint32_t *mem, fspr_uint32_t val) { return atomic_xchg((unsigned long *)mem,(unsigned long)val); } -APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) +APR_DECLARE(int) fspr_atomic_dec32(volatile fspr_uint32_t *mem) { return (atomic_xchgadd((unsigned long *)mem, 0xFFFFFFFF) - 1); } -APR_DECLARE(void *) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +APR_DECLARE(void *) fspr_atomic_casptr(volatile void **mem, void *with, const void *cmp) { return (void*)atomic_cmpxchg((unsigned long *)mem,(unsigned long)cmp,(unsigned long)with); } diff --git a/libs/apr/atomic/os390/atomic.c b/libs/apr/atomic/os390/atomic.c index 35ddf1c226..b85b5bfa64 100644 --- a/libs/apr/atomic/os390/atomic.c +++ b/libs/apr/atomic/os390/atomic.c @@ -15,19 +15,19 @@ */ -#include "apr.h" -#include "apr_atomic.h" +#include "fspr.h" +#include "fspr_atomic.h" #include -apr_status_t apr_atomic_init(apr_pool_t *p) +fspr_status_t fspr_atomic_init(fspr_pool_t *p) { return APR_SUCCESS; } -apr_uint32_t apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) +fspr_uint32_t fspr_atomic_add32(volatile fspr_uint32_t *mem, fspr_uint32_t val) { - apr_uint32_t old, new_val; + fspr_uint32_t old, new_val; old = *mem; /* old is automatically updated on cs failure */ do { @@ -36,9 +36,9 @@ apr_uint32_t apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) return old; } -void apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) +void fspr_atomic_sub32(volatile fspr_uint32_t *mem, fspr_uint32_t val) { - apr_uint32_t old, new_val; + fspr_uint32_t old, new_val; old = *mem; /* old is automatically updated on cs failure */ do { @@ -46,14 +46,14 @@ void apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) } while (__cs(&old, (cs_t *)mem, new_val)); } -apr_uint32_t apr_atomic_inc32(volatile apr_uint32_t *mem) +fspr_uint32_t fspr_atomic_inc32(volatile fspr_uint32_t *mem) { - return apr_atomic_add32(mem, 1); + return fspr_atomic_add32(mem, 1); } -int apr_atomic_dec32(volatile apr_uint32_t *mem) +int fspr_atomic_dec32(volatile fspr_uint32_t *mem) { - apr_uint32_t old, new_val; + fspr_uint32_t old, new_val; old = *mem; /* old is automatically updated on cs failure */ do { @@ -63,28 +63,28 @@ int apr_atomic_dec32(volatile apr_uint32_t *mem) return new_val != 0; } -apr_uint32_t apr_atomic_read32(volatile apr_uint32_t *mem) +fspr_uint32_t fspr_atomic_read32(volatile fspr_uint32_t *mem) { return *mem; } -void apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) +void fspr_atomic_set32(volatile fspr_uint32_t *mem, fspr_uint32_t val) { *mem = val; } -apr_uint32_t apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t swap, - apr_uint32_t cmp) +fspr_uint32_t fspr_atomic_cas32(volatile fspr_uint32_t *mem, fspr_uint32_t swap, + fspr_uint32_t cmp) { - apr_uint32_t old = cmp; + fspr_uint32_t old = cmp; __cs(&old, (cs_t *)mem, swap); return old; /* old is automatically updated from mem on cs failure */ } -apr_uint32_t apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) +fspr_uint32_t fspr_atomic_xchg32(volatile fspr_uint32_t *mem, fspr_uint32_t val) { - apr_uint32_t old, new_val; + fspr_uint32_t old, new_val; old = *mem; /* old is automatically updated on cs failure */ do { diff --git a/libs/apr/atomic/unix/apr_atomic.c b/libs/apr/atomic/unix/fspr_atomic.c similarity index 65% rename from libs/apr/atomic/unix/apr_atomic.c rename to libs/apr/atomic/unix/fspr_atomic.c index 3110d96d7c..6a366a1a73 100644 --- a/libs/apr/atomic/unix/apr_atomic.c +++ b/libs/apr/atomic/unix/fspr_atomic.c @@ -14,11 +14,11 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_atomic.h" -#include "apr_thread_mutex.h" +#include "fspr.h" +#include "fspr_atomic.h" +#include "fspr_thread_mutex.h" -#include "apr_private.h" +#include "fspr_private.h" #include @@ -31,11 +31,11 @@ #if (defined(__i386__) || defined(__x86_64__)) \ && defined(__GNUC__) && !defined(USE_GENERIC_ATOMICS) -APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, - apr_uint32_t with, - apr_uint32_t cmp) +APR_DECLARE(fspr_uint32_t) fspr_atomic_cas32(volatile fspr_uint32_t *mem, + fspr_uint32_t with, + fspr_uint32_t cmp) { - apr_uint32_t prev; + fspr_uint32_t prev; asm volatile ("lock; cmpxchgl %1, %2" : "=a" (prev) @@ -45,8 +45,8 @@ APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, } #define APR_OVERRIDE_ATOMIC_CAS32 -static apr_uint32_t inline intel_atomic_add32(volatile apr_uint32_t *mem, - apr_uint32_t val) +static fspr_uint32_t inline intel_atomic_add32(volatile fspr_uint32_t *mem, + fspr_uint32_t val) { asm volatile ("lock; xaddl %0,%1" : "=r"(val), "=m"(*mem) /* outputs */ @@ -55,14 +55,14 @@ static apr_uint32_t inline intel_atomic_add32(volatile apr_uint32_t *mem, return val; } -APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, - apr_uint32_t val) +APR_DECLARE(fspr_uint32_t) fspr_atomic_add32(volatile fspr_uint32_t *mem, + fspr_uint32_t val) { return intel_atomic_add32(mem, val); } #define APR_OVERRIDE_ATOMIC_ADD32 -APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) +APR_DECLARE(void) fspr_atomic_sub32(volatile fspr_uint32_t *mem, fspr_uint32_t val) { asm volatile ("lock; subl %1, %0" : @@ -71,7 +71,7 @@ APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) } #define APR_OVERRIDE_ATOMIC_SUB32 -APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) +APR_DECLARE(int) fspr_atomic_dec32(volatile fspr_uint32_t *mem) { unsigned char prev; @@ -84,21 +84,21 @@ APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) } #define APR_OVERRIDE_ATOMIC_DEC32 -APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) +APR_DECLARE(fspr_uint32_t) fspr_atomic_inc32(volatile fspr_uint32_t *mem) { return intel_atomic_add32(mem, 1); } #define APR_OVERRIDE_ATOMIC_INC32 -APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) +APR_DECLARE(void) fspr_atomic_set32(volatile fspr_uint32_t *mem, fspr_uint32_t val) { *mem = val; } #define APR_OVERRIDE_ATOMIC_SET32 -APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) +APR_DECLARE(fspr_uint32_t) fspr_atomic_xchg32(volatile fspr_uint32_t *mem, fspr_uint32_t val) { - apr_uint32_t prev = val; + fspr_uint32_t prev = val; asm volatile ("lock; xchgl %0, %1" : "=r" (prev) @@ -108,18 +108,18 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint } #define APR_OVERRIDE_ATOMIC_XCHG32 -/*#define apr_atomic_init(pool) APR_SUCCESS*/ +/*#define fspr_atomic_init(pool) APR_SUCCESS*/ #endif /* (__linux__ || __EMX__ || __FreeBSD__) && __i386__ */ #if (defined(__PPC__) || defined(__ppc__)) && defined(__GNUC__) \ && !defined(USE_GENERIC_ATOMICS) -APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, - apr_uint32_t swap, - apr_uint32_t cmp) +APR_DECLARE(fspr_uint32_t) fspr_atomic_cas32(volatile fspr_uint32_t *mem, + fspr_uint32_t swap, + fspr_uint32_t cmp) { - apr_uint32_t prev; + fspr_uint32_t prev; asm volatile ("0:\n\t" /* retry local label */ "lwarx %0,0,%1\n\t" /* load prev and reserve */ @@ -138,10 +138,10 @@ APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, } #define APR_OVERRIDE_ATOMIC_CAS32 -APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, - apr_uint32_t delta) +APR_DECLARE(fspr_uint32_t) fspr_atomic_add32(volatile fspr_uint32_t *mem, + fspr_uint32_t delta) { - apr_uint32_t prev, temp; + fspr_uint32_t prev, temp; asm volatile ("0:\n\t" /* retry local label */ "lwarx %0,0,%2\n\t" /* load prev and reserve */ @@ -168,18 +168,18 @@ APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, #define NUM_ATOMIC_HASH 7 /* shift by 2 to get rid of alignment issues */ #define ATOMIC_HASH(x) (unsigned int)(((unsigned long)(x)>>2)%(unsigned int)NUM_ATOMIC_HASH) -static apr_thread_mutex_t **hash_mutex; +static fspr_thread_mutex_t **hash_mutex; #endif /* APR_HAS_THREADS */ -apr_status_t apr_atomic_init(apr_pool_t *p) +fspr_status_t fspr_atomic_init(fspr_pool_t *p) { #if APR_HAS_THREADS int i; - apr_status_t rv; - hash_mutex = apr_palloc(p, sizeof(apr_thread_mutex_t*) * NUM_ATOMIC_HASH); + fspr_status_t rv; + hash_mutex = fspr_palloc(p, sizeof(fspr_thread_mutex_t*) * NUM_ATOMIC_HASH); for (i = 0; i < NUM_ATOMIC_HASH; i++) { - rv = apr_thread_mutex_create(&(hash_mutex[i]), + rv = fspr_thread_mutex_create(&(hash_mutex[i]), APR_THREAD_MUTEX_DEFAULT, p); if (rv != APR_SUCCESS) { return rv; @@ -195,28 +195,28 @@ apr_status_t apr_atomic_init(apr_pool_t *p) #if !defined(APR_OVERRIDE_ATOMIC_ADD32) #if defined(APR_OVERRIDE_ATOMIC_CAS32) -apr_uint32_t apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) +fspr_uint32_t fspr_atomic_add32(volatile fspr_uint32_t *mem, fspr_uint32_t val) { - apr_uint32_t old_value, new_value; + fspr_uint32_t old_value, new_value; do { old_value = *mem; new_value = old_value + val; - } while (apr_atomic_cas32(mem, new_value, old_value) != old_value); + } while (fspr_atomic_cas32(mem, new_value, old_value) != old_value); return old_value; } #else -apr_uint32_t apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) +fspr_uint32_t fspr_atomic_add32(volatile fspr_uint32_t *mem, fspr_uint32_t val) { - apr_uint32_t old_value; + fspr_uint32_t old_value; #if APR_HAS_THREADS - apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; + fspr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - CHECK(apr_thread_mutex_lock(lock)); + CHECK(fspr_thread_mutex_lock(lock)); old_value = *mem; *mem += val; - CHECK(apr_thread_mutex_unlock(lock)); + CHECK(fspr_thread_mutex_unlock(lock)); #else old_value = *mem; *mem += val; @@ -228,24 +228,24 @@ apr_uint32_t apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) #if !defined(APR_OVERRIDE_ATOMIC_SUB32) #if defined(APR_OVERRIDE_ATOMIC_CAS32) -void apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) +void fspr_atomic_sub32(volatile fspr_uint32_t *mem, fspr_uint32_t val) { - apr_uint32_t old_value, new_value; + fspr_uint32_t old_value, new_value; do { old_value = *mem; new_value = old_value - val; - } while (apr_atomic_cas32(mem, new_value, old_value) != old_value); + } while (fspr_atomic_cas32(mem, new_value, old_value) != old_value); } #else -void apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) +void fspr_atomic_sub32(volatile fspr_uint32_t *mem, fspr_uint32_t val) { #if APR_HAS_THREADS - apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; + fspr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - CHECK(apr_thread_mutex_lock(lock)); + CHECK(fspr_thread_mutex_lock(lock)); *mem -= val; - CHECK(apr_thread_mutex_unlock(lock)); + CHECK(fspr_thread_mutex_unlock(lock)); #else *mem -= val; #endif /* APR_HAS_THREADS */ @@ -254,14 +254,14 @@ void apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) #endif /* !defined(APR_OVERRIDE_ATOMIC_SUB32) */ #if !defined(APR_OVERRIDE_ATOMIC_SET32) -void apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) +void fspr_atomic_set32(volatile fspr_uint32_t *mem, fspr_uint32_t val) { #if APR_HAS_THREADS - apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; + fspr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - CHECK(apr_thread_mutex_lock(lock)); + CHECK(fspr_thread_mutex_lock(lock)); *mem = val; - CHECK(apr_thread_mutex_unlock(lock)); + CHECK(fspr_thread_mutex_unlock(lock)); #else *mem = val; #endif /* APR_HAS_THREADS */ @@ -269,35 +269,35 @@ void apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) #endif /* !defined(APR_OVERRIDE_ATOMIC_SET32) */ #if !defined(APR_OVERRIDE_ATOMIC_INC32) -apr_uint32_t apr_atomic_inc32(volatile apr_uint32_t *mem) +fspr_uint32_t fspr_atomic_inc32(volatile fspr_uint32_t *mem) { - return apr_atomic_add32(mem, 1); + return fspr_atomic_add32(mem, 1); } #endif /* !defined(APR_OVERRIDE_ATOMIC_INC32) */ #if !defined(APR_OVERRIDE_ATOMIC_DEC32) #if defined(APR_OVERRIDE_ATOMIC_CAS32) -int apr_atomic_dec32(volatile apr_uint32_t *mem) +int fspr_atomic_dec32(volatile fspr_uint32_t *mem) { - apr_uint32_t old_value, new_value; + fspr_uint32_t old_value, new_value; do { old_value = *mem; new_value = old_value - 1; - } while (apr_atomic_cas32(mem, new_value, old_value) != old_value); + } while (fspr_atomic_cas32(mem, new_value, old_value) != old_value); return old_value != 1; } #else -int apr_atomic_dec32(volatile apr_uint32_t *mem) +int fspr_atomic_dec32(volatile fspr_uint32_t *mem) { #if APR_HAS_THREADS - apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - apr_uint32_t new; + fspr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; + fspr_uint32_t new; - CHECK(apr_thread_mutex_lock(lock)); + CHECK(fspr_thread_mutex_lock(lock)); (*mem)--; new = *mem; - CHECK(apr_thread_mutex_unlock(lock)); + CHECK(fspr_thread_mutex_unlock(lock)); return new; #else (*mem)--; @@ -308,19 +308,19 @@ int apr_atomic_dec32(volatile apr_uint32_t *mem) #endif /* !defined(APR_OVERRIDE_ATOMIC_DEC32) */ #if !defined(APR_OVERRIDE_ATOMIC_CAS32) -apr_uint32_t apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, - apr_uint32_t cmp) +fspr_uint32_t fspr_atomic_cas32(volatile fspr_uint32_t *mem, fspr_uint32_t with, + fspr_uint32_t cmp) { - apr_uint32_t prev; + fspr_uint32_t prev; #if APR_HAS_THREADS - apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; + fspr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - CHECK(apr_thread_mutex_lock(lock)); + CHECK(fspr_thread_mutex_lock(lock)); prev = *mem; if (prev == cmp) { *mem = with; } - CHECK(apr_thread_mutex_unlock(lock)); + CHECK(fspr_thread_mutex_unlock(lock)); #else prev = *mem; if (prev == cmp) { @@ -333,25 +333,25 @@ apr_uint32_t apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, #if !defined(APR_OVERRIDE_ATOMIC_XCHG32) #if defined(APR_OVERRIDE_ATOMIC_CAS32) -apr_uint32_t apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) +fspr_uint32_t fspr_atomic_xchg32(volatile fspr_uint32_t *mem, fspr_uint32_t val) { - apr_uint32_t prev; + fspr_uint32_t prev; do { prev = *mem; - } while (apr_atomic_cas32(mem, val, prev) != prev); + } while (fspr_atomic_cas32(mem, val, prev) != prev); return prev; } #else -apr_uint32_t apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) +fspr_uint32_t fspr_atomic_xchg32(volatile fspr_uint32_t *mem, fspr_uint32_t val) { - apr_uint32_t prev; + fspr_uint32_t prev; #if APR_HAS_THREADS - apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; + fspr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - CHECK(apr_thread_mutex_lock(lock)); + CHECK(fspr_thread_mutex_lock(lock)); prev = *mem; *mem = val; - CHECK(apr_thread_mutex_unlock(lock)); + CHECK(fspr_thread_mutex_unlock(lock)); #else prev = *mem; *mem = val; @@ -362,18 +362,18 @@ apr_uint32_t apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) #endif /* !defined(APR_OVERRIDE_ATOMIC_XCHG32) */ #if !defined(APR_OVERRIDE_ATOMIC_CASPTR) -void *apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +void *fspr_atomic_casptr(volatile void **mem, void *with, const void *cmp) { void *prev; #if APR_HAS_THREADS - apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; + fspr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; - CHECK(apr_thread_mutex_lock(lock)); + CHECK(fspr_thread_mutex_lock(lock)); prev = *(void **)mem; if (prev == cmp) { *mem = with; } - CHECK(apr_thread_mutex_unlock(lock)); + CHECK(fspr_thread_mutex_unlock(lock)); #else prev = *(void **)mem; if (prev == cmp) { @@ -385,7 +385,7 @@ void *apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) #endif /* !defined(APR_OVERRIDE_ATOMIC_CASPTR) */ #if !defined(APR_OVERRIDE_ATOMIC_READ32) -APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem) +APR_DECLARE(fspr_uint32_t) fspr_atomic_read32(volatile fspr_uint32_t *mem) { return *mem; } diff --git a/libs/apr/atomic/win32/apr_atomic.c b/libs/apr/atomic/win32/fspr_atomic.c similarity index 56% rename from libs/apr/atomic/win32/apr_atomic.c rename to libs/apr/atomic/win32/fspr_atomic.c index 18a7bcd0ba..e9cfc0558a 100644 --- a/libs/apr/atomic/win32/apr_atomic.c +++ b/libs/apr/atomic/win32/fspr_atomic.c @@ -14,59 +14,59 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_atomic.h" -#include "apr_thread_mutex.h" +#include "fspr.h" +#include "fspr_atomic.h" +#include "fspr_thread_mutex.h" -APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_atomic_init(fspr_pool_t *p) { return APR_SUCCESS; } /* - * Remapping function pointer type to accept apr_uint32_t's type-safely - * as the arguments for as our apr_atomic_foo32 Functions + * Remapping function pointer type to accept fspr_uint32_t's type-safely + * as the arguments for as our fspr_atomic_foo32 Functions */ #if (_MSC_VER < 1800) -typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_fn) - (apr_uint32_t volatile *); -typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_val_fn) - (apr_uint32_t volatile *, - apr_uint32_t); -typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_val_val_fn) - (apr_uint32_t volatile *, - apr_uint32_t, apr_uint32_t); -typedef WINBASEAPI void * (WINAPI * apr_atomic_win32_ptr_ptr_ptr_fn) +typedef WINBASEAPI fspr_uint32_t (WINAPI * fspr_atomic_win32_ptr_fn) + (fspr_uint32_t volatile *); +typedef WINBASEAPI fspr_uint32_t (WINAPI * fspr_atomic_win32_ptr_val_fn) + (fspr_uint32_t volatile *, + fspr_uint32_t); +typedef WINBASEAPI fspr_uint32_t (WINAPI * fspr_atomic_win32_ptr_val_val_fn) + (fspr_uint32_t volatile *, + fspr_uint32_t, fspr_uint32_t); +typedef WINBASEAPI void * (WINAPI * fspr_atomic_win32_ptr_ptr_ptr_fn) (volatile void **, void *, const void *); #endif -APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) +APR_DECLARE(fspr_uint32_t) fspr_atomic_add32(volatile fspr_uint32_t *mem, fspr_uint32_t val) { #if (defined(_M_IA64) || defined(_M_AMD64)) return InterlockedExchangeAdd(mem, val); #elif (_MSC_VER >= 1800) return InterlockedExchangeAdd(mem, val); #else - return ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, val); + return ((fspr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, val); #endif } /* Of course we want the 2's compliment of the unsigned value, val */ #pragma warning(disable: 4146) -APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) +APR_DECLARE(void) fspr_atomic_sub32(volatile fspr_uint32_t *mem, fspr_uint32_t val) { #if (defined(_M_IA64) || defined(_M_AMD64)) InterlockedExchangeAdd(mem, -val); #elif (_MSC_VER >= 1800) InterlockedExchangeAdd(mem, -val); #else - ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, -val); + ((fspr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, -val); #endif } -APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) +APR_DECLARE(fspr_uint32_t) fspr_atomic_inc32(volatile fspr_uint32_t *mem) { /* we return old value, win32 returns new value :( */ #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) @@ -74,50 +74,50 @@ APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) #elif (_MSC_VER >= 1800) return InterlockedIncrement(mem) - 1; #else - return ((apr_atomic_win32_ptr_fn)InterlockedIncrement)(mem) - 1; + return ((fspr_atomic_win32_ptr_fn)InterlockedIncrement)(mem) - 1; #endif } -APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) +APR_DECLARE(int) fspr_atomic_dec32(volatile fspr_uint32_t *mem) { #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) return InterlockedDecrement(mem); #elif (_MSC_VER >= 1800) return InterlockedDecrement(mem); #else - return ((apr_atomic_win32_ptr_fn)InterlockedDecrement)(mem); + return ((fspr_atomic_win32_ptr_fn)InterlockedDecrement)(mem); #endif } -APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) +APR_DECLARE(void) fspr_atomic_set32(volatile fspr_uint32_t *mem, fspr_uint32_t val) { #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) InterlockedExchange(mem, val); #elif (_MSC_VER >= 1800) InterlockedExchange(mem, val); #else - ((apr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem, val); + ((fspr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem, val); #endif } -APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem) +APR_DECLARE(fspr_uint32_t) fspr_atomic_read32(volatile fspr_uint32_t *mem) { return *mem; } -APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, - apr_uint32_t cmp) +APR_DECLARE(fspr_uint32_t) fspr_atomic_cas32(volatile fspr_uint32_t *mem, fspr_uint32_t with, + fspr_uint32_t cmp) { #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) return InterlockedCompareExchange(mem, with, cmp); #elif (_MSC_VER >= 1800) return InterlockedCompareExchange(mem, with, cmp); #else - return ((apr_atomic_win32_ptr_val_val_fn)InterlockedCompareExchange)(mem, with, cmp); + return ((fspr_atomic_win32_ptr_val_val_fn)InterlockedCompareExchange)(mem, with, cmp); #endif } -APR_DECLARE(void *) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +APR_DECLARE(void *) fspr_atomic_casptr(volatile void **mem, void *with, const void *cmp) { #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) return InterlockedCompareExchangePointer(mem, with, cmp); @@ -125,17 +125,17 @@ APR_DECLARE(void *) apr_atomic_casptr(volatile void **mem, void *with, const voi return InterlockedCompareExchangePointer(mem, with, cmp); #else /* Too many VC6 users have stale win32 API files, stub this */ - return ((apr_atomic_win32_ptr_ptr_ptr_fn)InterlockedCompareExchange)(mem, with, cmp); + return ((fspr_atomic_win32_ptr_ptr_ptr_fn)InterlockedCompareExchange)(mem, with, cmp); #endif } -APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) +APR_DECLARE(fspr_uint32_t) fspr_atomic_xchg32(volatile fspr_uint32_t *mem, fspr_uint32_t val) { #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) return InterlockedExchange(mem, val); #elif (_MSC_VER >= 1800) return InterlockedExchange(mem, val); #else - return ((apr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem, val); + return ((fspr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem, val); #endif } diff --git a/libs/apr/build-outputs.mk b/libs/apr/build-outputs.mk index 2c127688d1..d3e68a8bea 100644 --- a/libs/apr/build-outputs.mk +++ b/libs/apr/build-outputs.mk @@ -1,83 +1,83 @@ # DO NOT EDIT. AUTOMATICALLY GENERATED. -passwd/apr_getpass.lo: passwd/apr_getpass.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_want.h include/apr_strings.h include/apr_thread_mutex.h include/apr_lib.h include/apr_pools.h -strings/apr_cpystrn.lo: strings/apr_cpystrn.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_want.h include/apr_strings.h include/apr_thread_mutex.h include/apr_lib.h include/apr_pools.h -strings/apr_strnatcmp.lo: strings/apr_strnatcmp.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_want.h include/apr_strings.h include/apr_thread_mutex.h include/apr_lib.h include/apr_pools.h -strings/apr_strings.lo: strings/apr_strings.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_want.h include/apr_strings.h include/apr_thread_mutex.h include/apr_lib.h include/apr_pools.h -strings/apr_strtok.lo: strings/apr_strtok.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_want.h include/apr_strings.h include/apr_thread_mutex.h include/apr_pools.h -strings/apr_fnmatch.lo: strings/apr_fnmatch.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_want.h include/apr_file_info.h include/apr_user.h include/apr_fnmatch.h include/apr_strings.h include/apr_thread_mutex.h include/apr_lib.h include/apr_time.h include/apr_pools.h include/apr_tables.h -strings/apr_snprintf.lo: strings/apr_snprintf.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_proc_mutex.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_want.h include/apr_lib.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h -tables/apr_tables.lo: tables/apr_tables.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_want.h include/apr_strings.h include/apr_thread_mutex.h include/apr_lib.h include/apr_pools.h include/apr_tables.h -tables/apr_hash.lo: tables/apr_hash.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_want.h include/apr_thread_mutex.h include/apr_hash.h include/apr_pools.h +passwd/fspr_getpass.lo: passwd/fspr_getpass.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_want.h include/fspr_strings.h include/fspr_thread_mutex.h include/fspr_lib.h include/fspr_pools.h +strings/fspr_cpystrn.lo: strings/fspr_cpystrn.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_want.h include/fspr_strings.h include/fspr_thread_mutex.h include/fspr_lib.h include/fspr_pools.h +strings/fspr_strnatcmp.lo: strings/fspr_strnatcmp.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_want.h include/fspr_strings.h include/fspr_thread_mutex.h include/fspr_lib.h include/fspr_pools.h +strings/fspr_strings.lo: strings/fspr_strings.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_want.h include/fspr_strings.h include/fspr_thread_mutex.h include/fspr_lib.h include/fspr_pools.h +strings/fspr_strtok.lo: strings/fspr_strtok.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_want.h include/fspr_strings.h include/fspr_thread_mutex.h include/fspr_pools.h +strings/fspr_fnmatch.lo: strings/fspr_fnmatch.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_want.h include/fspr_file_info.h include/fspr_user.h include/fspr_fnmatch.h include/fspr_strings.h include/fspr_thread_mutex.h include/fspr_lib.h include/fspr_time.h include/fspr_pools.h include/fspr_tables.h +strings/fspr_snprintf.lo: strings/fspr_snprintf.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_proc_mutex.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_want.h include/fspr_lib.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h +tables/fspr_tables.lo: tables/fspr_tables.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_want.h include/fspr_strings.h include/fspr_thread_mutex.h include/fspr_lib.h include/fspr_pools.h include/fspr_tables.h +tables/fspr_hash.lo: tables/fspr_hash.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_want.h include/fspr_thread_mutex.h include/fspr_hash.h include/fspr_pools.h -OBJECTS_all = passwd/apr_getpass.lo strings/apr_cpystrn.lo strings/apr_strnatcmp.lo strings/apr_strings.lo strings/apr_strtok.lo strings/apr_fnmatch.lo strings/apr_snprintf.lo tables/apr_tables.lo tables/apr_hash.lo +OBJECTS_all = passwd/fspr_getpass.lo strings/fspr_cpystrn.lo strings/fspr_strnatcmp.lo strings/fspr_strings.lo strings/fspr_strtok.lo strings/fspr_fnmatch.lo strings/fspr_snprintf.lo tables/fspr_tables.lo tables/fspr_hash.lo -atomic/unix/apr_atomic.lo: atomic/unix/apr_atomic.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_want.h include/apr_thread_mutex.h include/apr_atomic.h include/apr_pools.h +atomic/unix/fspr_atomic.lo: atomic/unix/fspr_atomic.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_want.h include/fspr_thread_mutex.h include/fspr_atomic.h include/fspr_pools.h -OBJECTS_atomic_unix = atomic/unix/apr_atomic.lo +OBJECTS_atomic_unix = atomic/unix/fspr_atomic.lo -dso/unix/dso.lo: dso/unix/dso.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_proc_mutex.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_want.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h +dso/unix/dso.lo: dso/unix/dso.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_proc_mutex.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_want.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h OBJECTS_dso_unix = dso/unix/dso.lo file_io/unix/flock.lo: file_io/unix/flock.c .make.dirs -file_io/unix/readwrite.lo: file_io/unix/readwrite.c .make.dirs include/apr_support.h include/apr_allocator.h include/apr_network_io.h include/apr_general.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_tables.h include/apr_errno.h include/apr_want.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_time.h include/apr_pools.h -file_io/unix/filepath_util.lo: file_io/unix/filepath_util.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_want.h include/apr_strings.h include/apr_thread_mutex.h include/apr_pools.h include/apr_tables.h +file_io/unix/readwrite.lo: file_io/unix/readwrite.c .make.dirs include/fspr_support.h include/fspr_allocator.h include/fspr_network_io.h include/fspr_general.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_tables.h include/fspr_errno.h include/fspr_want.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_time.h include/fspr_pools.h +file_io/unix/filepath_util.lo: file_io/unix/filepath_util.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_want.h include/fspr_strings.h include/fspr_thread_mutex.h include/fspr_pools.h include/fspr_tables.h file_io/unix/seek.lo: file_io/unix/seek.c .make.dirs -file_io/unix/dir.lo: file_io/unix/dir.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_proc_mutex.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_want.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h -file_io/unix/mktemp.lo: file_io/unix/mktemp.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_proc_mutex.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_want.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h -file_io/unix/filedup.lo: file_io/unix/filedup.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_want.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_proc_mutex.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h -file_io/unix/tempdir.lo: file_io/unix/tempdir.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_env.h include/apr_file_info.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_want.h include/apr_thread_mutex.h include/apr_inherit.h include/apr_time.h include/apr_pools.h include/apr_tables.h -file_io/unix/filepath.lo: file_io/unix/filepath.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_want.h include/apr_file_info.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_inherit.h include/apr_thread_mutex.h include/apr_time.h include/apr_pools.h include/apr_tables.h -file_io/unix/pipe.lo: file_io/unix/pipe.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_proc_mutex.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_want.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h -file_io/unix/open.lo: file_io/unix/open.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_want.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_proc_mutex.h include/apr_hash.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h -file_io/unix/filestat.lo: file_io/unix/filestat.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_want.h include/apr_file_info.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_inherit.h include/apr_thread_mutex.h include/apr_time.h include/apr_pools.h include/apr_tables.h -file_io/unix/copy.lo: file_io/unix/copy.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_inherit.h include/apr_file_info.h include/apr_user.h include/apr_file_io.h include/apr_want.h include/apr_thread_mutex.h include/apr_time.h include/apr_pools.h include/apr_tables.h -file_io/unix/fileacc.lo: file_io/unix/fileacc.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_thread_mutex.h include/apr_errno.h include/apr_want.h include/apr_pools.h include/apr_strings.h -file_io/unix/fullrw.lo: file_io/unix/fullrw.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_inherit.h include/apr_file_info.h include/apr_user.h include/apr_file_io.h include/apr_want.h include/apr_thread_mutex.h include/apr_time.h include/apr_pools.h include/apr_tables.h +file_io/unix/dir.lo: file_io/unix/dir.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_proc_mutex.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_want.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h +file_io/unix/mktemp.lo: file_io/unix/mktemp.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_proc_mutex.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_want.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h +file_io/unix/filedup.lo: file_io/unix/filedup.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_want.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_proc_mutex.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h +file_io/unix/tempdir.lo: file_io/unix/tempdir.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_env.h include/fspr_file_info.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_want.h include/fspr_thread_mutex.h include/fspr_inherit.h include/fspr_time.h include/fspr_pools.h include/fspr_tables.h +file_io/unix/filepath.lo: file_io/unix/filepath.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_want.h include/fspr_file_info.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_inherit.h include/fspr_thread_mutex.h include/fspr_time.h include/fspr_pools.h include/fspr_tables.h +file_io/unix/pipe.lo: file_io/unix/pipe.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_proc_mutex.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_want.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h +file_io/unix/open.lo: file_io/unix/open.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_want.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_proc_mutex.h include/fspr_hash.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h +file_io/unix/filestat.lo: file_io/unix/filestat.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_want.h include/fspr_file_info.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_inherit.h include/fspr_thread_mutex.h include/fspr_time.h include/fspr_pools.h include/fspr_tables.h +file_io/unix/copy.lo: file_io/unix/copy.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_user.h include/fspr_file_io.h include/fspr_want.h include/fspr_thread_mutex.h include/fspr_time.h include/fspr_pools.h include/fspr_tables.h +file_io/unix/fileacc.lo: file_io/unix/fileacc.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_thread_mutex.h include/fspr_errno.h include/fspr_want.h include/fspr_pools.h include/fspr_strings.h +file_io/unix/fullrw.lo: file_io/unix/fullrw.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_user.h include/fspr_file_io.h include/fspr_want.h include/fspr_thread_mutex.h include/fspr_time.h include/fspr_pools.h include/fspr_tables.h OBJECTS_file_io_unix = file_io/unix/flock.lo file_io/unix/readwrite.lo file_io/unix/filepath_util.lo file_io/unix/seek.lo file_io/unix/dir.lo file_io/unix/mktemp.lo file_io/unix/filedup.lo file_io/unix/tempdir.lo file_io/unix/filepath.lo file_io/unix/pipe.lo file_io/unix/open.lo file_io/unix/filestat.lo file_io/unix/copy.lo file_io/unix/fileacc.lo file_io/unix/fullrw.lo locks/unix/thread_rwlock.lo: locks/unix/thread_rwlock.c .make.dirs -locks/unix/thread_mutex.lo: locks/unix/thread_mutex.c .make.dirs include/apr_want.h +locks/unix/thread_mutex.lo: locks/unix/thread_mutex.c .make.dirs include/fspr_want.h locks/unix/thread_cond.lo: locks/unix/thread_cond.c .make.dirs -locks/unix/proc_mutex.lo: locks/unix/proc_mutex.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_thread_mutex.h include/apr_errno.h include/apr_want.h include/apr_pools.h include/apr_strings.h -locks/unix/global_mutex.lo: locks/unix/global_mutex.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_proc_mutex.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_want.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h +locks/unix/proc_mutex.lo: locks/unix/proc_mutex.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_thread_mutex.h include/fspr_errno.h include/fspr_want.h include/fspr_pools.h include/fspr_strings.h +locks/unix/global_mutex.lo: locks/unix/global_mutex.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_proc_mutex.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_want.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h OBJECTS_locks_unix = locks/unix/thread_rwlock.lo locks/unix/thread_mutex.lo locks/unix/thread_cond.lo locks/unix/proc_mutex.lo locks/unix/global_mutex.lo -memory/unix/apr_pools.lo: memory/unix/apr_pools.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_env.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_atomic.h include/apr_tables.h include/apr_errno.h include/apr_want.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_inherit.h include/apr_hash.h include/apr_lib.h include/apr_proc_mutex.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h +memory/unix/fspr_pools.lo: memory/unix/fspr_pools.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_env.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_atomic.h include/fspr_tables.h include/fspr_errno.h include/fspr_want.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_inherit.h include/fspr_hash.h include/fspr_lib.h include/fspr_proc_mutex.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h -OBJECTS_memory_unix = memory/unix/apr_pools.lo +OBJECTS_memory_unix = memory/unix/fspr_pools.lo -misc/unix/charset.lo: misc/unix/charset.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_proc_mutex.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_want.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h -misc/unix/env.lo: misc/unix/env.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_want.h include/apr_env.h include/apr_thread_mutex.h include/apr_pools.h -misc/unix/version.lo: misc/unix/version.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_want.h include/apr_version.h include/apr_thread_mutex.h include/apr_pools.h -misc/unix/rand.lo: misc/unix/rand.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_want.h include/apr_thread_mutex.h include/apr_pools.h -misc/unix/start.lo: misc/unix/start.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_signal.h include/apr_want.h include/apr_thread_mutex.h include/apr_atomic.h include/apr_pools.h -misc/unix/errorcodes.lo: misc/unix/errorcodes.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_want.h include/apr_strings.h include/apr_thread_mutex.h include/apr_lib.h include/apr_dso.h include/apr_pools.h -misc/unix/getopt.lo: misc/unix/getopt.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_want.h include/apr_strings.h include/apr_thread_mutex.h include/apr_lib.h include/apr_pools.h +misc/unix/charset.lo: misc/unix/charset.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_proc_mutex.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_want.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h +misc/unix/env.lo: misc/unix/env.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_want.h include/fspr_env.h include/fspr_thread_mutex.h include/fspr_pools.h +misc/unix/version.lo: misc/unix/version.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_want.h include/fspr_version.h include/fspr_thread_mutex.h include/fspr_pools.h +misc/unix/rand.lo: misc/unix/rand.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_want.h include/fspr_thread_mutex.h include/fspr_pools.h +misc/unix/start.lo: misc/unix/start.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_signal.h include/fspr_want.h include/fspr_thread_mutex.h include/fspr_atomic.h include/fspr_pools.h +misc/unix/errorcodes.lo: misc/unix/errorcodes.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_want.h include/fspr_strings.h include/fspr_thread_mutex.h include/fspr_lib.h include/fspr_dso.h include/fspr_pools.h +misc/unix/getopt.lo: misc/unix/getopt.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_want.h include/fspr_strings.h include/fspr_thread_mutex.h include/fspr_lib.h include/fspr_pools.h misc/unix/otherchild.lo: misc/unix/otherchild.c .make.dirs OBJECTS_misc_unix = misc/unix/charset.lo misc/unix/env.lo misc/unix/version.lo misc/unix/rand.lo misc/unix/start.lo misc/unix/errorcodes.lo misc/unix/getopt.lo misc/unix/otherchild.lo -mmap/unix/mmap.lo: mmap/unix/mmap.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_want.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_proc_mutex.h include/apr_shm.h include/apr_ring.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h include/apr_mmap.h -mmap/unix/common.lo: mmap/unix/common.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_inherit.h include/apr_file_info.h include/apr_user.h include/apr_file_io.h include/apr_want.h include/apr_thread_mutex.h include/apr_ring.h include/apr_tables.h include/apr_time.h include/apr_pools.h include/apr_mmap.h +mmap/unix/mmap.lo: mmap/unix/mmap.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_want.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_proc_mutex.h include/fspr_shm.h include/fspr_ring.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h include/fspr_mmap.h +mmap/unix/common.lo: mmap/unix/common.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_user.h include/fspr_file_io.h include/fspr_want.h include/fspr_thread_mutex.h include/fspr_ring.h include/fspr_tables.h include/fspr_time.h include/fspr_pools.h include/fspr_mmap.h OBJECTS_mmap_unix = mmap/unix/mmap.lo mmap/unix/common.lo -network_io/unix/sockaddr.lo: network_io/unix/sockaddr.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_want.h include/apr_strings.h include/apr_thread_mutex.h include/apr_lib.h include/apr_pools.h -network_io/unix/sockopt.lo: network_io/unix/sockopt.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_thread_mutex.h include/apr_errno.h include/apr_want.h include/apr_pools.h include/apr_strings.h -network_io/unix/sendrecv.lo: network_io/unix/sendrecv.c .make.dirs include/apr_support.h include/apr_allocator.h include/apr_user.h include/apr_network_io.h include/apr_general.h include/apr_inherit.h include/apr_file_info.h include/apr_errno.h include/apr_file_io.h include/apr_want.h include/apr_thread_mutex.h include/apr_time.h include/apr_pools.h include/apr_tables.h -network_io/unix/multicast.lo: network_io/unix/multicast.c .make.dirs include/apr_support.h include/apr_allocator.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_general.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_want.h include/apr_user.h include/apr_file_io.h include/apr_proc_mutex.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h -network_io/unix/sockets.lo: network_io/unix/sockets.c .make.dirs include/apr_support.h include/apr_allocator.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_general.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_want.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_proc_mutex.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h -network_io/unix/inet_ntop.lo: network_io/unix/inet_ntop.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_thread_mutex.h include/apr_errno.h include/apr_want.h include/apr_pools.h include/apr_strings.h +network_io/unix/sockaddr.lo: network_io/unix/sockaddr.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_want.h include/fspr_strings.h include/fspr_thread_mutex.h include/fspr_lib.h include/fspr_pools.h +network_io/unix/sockopt.lo: network_io/unix/sockopt.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_thread_mutex.h include/fspr_errno.h include/fspr_want.h include/fspr_pools.h include/fspr_strings.h +network_io/unix/sendrecv.lo: network_io/unix/sendrecv.c .make.dirs include/fspr_support.h include/fspr_allocator.h include/fspr_user.h include/fspr_network_io.h include/fspr_general.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_errno.h include/fspr_file_io.h include/fspr_want.h include/fspr_thread_mutex.h include/fspr_time.h include/fspr_pools.h include/fspr_tables.h +network_io/unix/multicast.lo: network_io/unix/multicast.c .make.dirs include/fspr_support.h include/fspr_allocator.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_general.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_want.h include/fspr_user.h include/fspr_file_io.h include/fspr_proc_mutex.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h +network_io/unix/sockets.lo: network_io/unix/sockets.c .make.dirs include/fspr_support.h include/fspr_allocator.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_general.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_want.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_proc_mutex.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h +network_io/unix/inet_ntop.lo: network_io/unix/inet_ntop.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_thread_mutex.h include/fspr_errno.h include/fspr_want.h include/fspr_pools.h include/fspr_strings.h network_io/unix/inet_pton.lo: network_io/unix/inet_pton.c .make.dirs OBJECTS_network_io_unix = network_io/unix/sockaddr.lo network_io/unix/sockopt.lo network_io/unix/sendrecv.lo network_io/unix/multicast.lo network_io/unix/sockets.lo network_io/unix/inet_ntop.lo network_io/unix/inet_pton.lo poll/unix/epoll.lo: poll/unix/epoll.c .make.dirs -poll/unix/select.lo: poll/unix/select.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_proc_mutex.h include/apr_user.h include/apr_file_io.h include/apr_want.h include/apr_poll.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h +poll/unix/select.lo: poll/unix/select.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_proc_mutex.h include/fspr_user.h include/fspr_file_io.h include/fspr_want.h include/fspr_poll.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h poll/unix/poll.lo: poll/unix/poll.c .make.dirs poll/unix/port.lo: poll/unix/port.c .make.dirs poll/unix/kqueue.lo: poll/unix/kqueue.c .make.dirs @@ -85,147 +85,147 @@ poll/unix/kqueue.lo: poll/unix/kqueue.c .make.dirs OBJECTS_poll_unix = poll/unix/epoll.lo poll/unix/select.lo poll/unix/poll.lo poll/unix/port.lo poll/unix/kqueue.lo random/unix/sha2.lo: random/unix/sha2.c .make.dirs -random/unix/apr_random.lo: random/unix/apr_random.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_inherit.h include/apr_file_info.h include/apr_user.h include/apr_file_io.h include/apr_want.h include/apr_thread_mutex.h include/apr_random.h include/apr_thread_proc.h include/apr_time.h include/apr_pools.h include/apr_tables.h -random/unix/sha2_glue.lo: random/unix/sha2_glue.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_want.h include/apr_thread_mutex.h include/apr_random.h include/apr_pools.h +random/unix/fspr_random.lo: random/unix/fspr_random.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_user.h include/fspr_file_io.h include/fspr_want.h include/fspr_thread_mutex.h include/fspr_random.h include/fspr_thread_proc.h include/fspr_time.h include/fspr_pools.h include/fspr_tables.h +random/unix/sha2_glue.lo: random/unix/sha2_glue.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_want.h include/fspr_thread_mutex.h include/fspr_random.h include/fspr_pools.h -OBJECTS_random_unix = random/unix/sha2.lo random/unix/apr_random.lo random/unix/sha2_glue.lo +OBJECTS_random_unix = random/unix/sha2.lo random/unix/fspr_random.lo random/unix/sha2_glue.lo -shmem/unix/shm.lo: shmem/unix/shm.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_want.h include/apr_user.h include/apr_strings.h include/apr_thread_mutex.h include/apr_pools.h +shmem/unix/shm.lo: shmem/unix/shm.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_want.h include/fspr_user.h include/fspr_strings.h include/fspr_thread_mutex.h include/fspr_pools.h OBJECTS_shmem_unix = shmem/unix/shm.lo -support/unix/waitio.lo: support/unix/waitio.c .make.dirs include/apr_support.h include/apr_allocator.h include/apr_network_io.h include/apr_general.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_tables.h include/apr_errno.h include/apr_want.h include/apr_user.h include/apr_file_io.h include/apr_poll.h include/apr_time.h include/apr_pools.h +support/unix/waitio.lo: support/unix/waitio.c .make.dirs include/fspr_support.h include/fspr_allocator.h include/fspr_network_io.h include/fspr_general.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_tables.h include/fspr_errno.h include/fspr_want.h include/fspr_user.h include/fspr_file_io.h include/fspr_poll.h include/fspr_time.h include/fspr_pools.h OBJECTS_support_unix = support/unix/waitio.lo threadproc/unix/procsup.lo: threadproc/unix/procsup.c .make.dirs -threadproc/unix/thread.lo: threadproc/unix/thread.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_proc_mutex.h include/apr_user.h include/apr_file_io.h include/apr_want.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h -threadproc/unix/signals.lo: threadproc/unix/signals.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_signal.h include/apr_strings.h include/apr_want.h include/apr_thread_mutex.h include/apr_pools.h -threadproc/unix/proc.lo: threadproc/unix/proc.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_signal.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_proc_mutex.h include/apr_tables.h include/apr_errno.h include/apr_want.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_inherit.h include/apr_random.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h -threadproc/unix/threadpriv.lo: threadproc/unix/threadpriv.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_proc_mutex.h include/apr_user.h include/apr_file_io.h include/apr_want.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h +threadproc/unix/thread.lo: threadproc/unix/thread.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_proc_mutex.h include/fspr_user.h include/fspr_file_io.h include/fspr_want.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h +threadproc/unix/signals.lo: threadproc/unix/signals.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_signal.h include/fspr_strings.h include/fspr_want.h include/fspr_thread_mutex.h include/fspr_pools.h +threadproc/unix/proc.lo: threadproc/unix/proc.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_signal.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_proc_mutex.h include/fspr_tables.h include/fspr_errno.h include/fspr_want.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_inherit.h include/fspr_random.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h +threadproc/unix/threadpriv.lo: threadproc/unix/threadpriv.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_proc_mutex.h include/fspr_user.h include/fspr_file_io.h include/fspr_want.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h OBJECTS_threadproc_unix = threadproc/unix/procsup.lo threadproc/unix/thread.lo threadproc/unix/signals.lo threadproc/unix/proc.lo threadproc/unix/threadpriv.lo -time/unix/time.lo: time/unix/time.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_want.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_proc_mutex.h include/apr_lib.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h -time/unix/timestr.lo: time/unix/timestr.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_want.h include/apr_user.h include/apr_file_io.h include/apr_proc_mutex.h include/apr_lib.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h +time/unix/time.lo: time/unix/time.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_want.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_proc_mutex.h include/fspr_lib.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h +time/unix/timestr.lo: time/unix/timestr.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_want.h include/fspr_user.h include/fspr_file_io.h include/fspr_proc_mutex.h include/fspr_lib.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h OBJECTS_time_unix = time/unix/time.lo time/unix/timestr.lo -user/unix/userinfo.lo: user/unix/userinfo.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_want.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_proc_mutex.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h -user/unix/groupinfo.lo: user/unix/groupinfo.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_proc_mutex.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_want.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h +user/unix/userinfo.lo: user/unix/userinfo.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_want.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_proc_mutex.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h +user/unix/groupinfo.lo: user/unix/groupinfo.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_proc_mutex.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_want.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h OBJECTS_user_unix = user/unix/userinfo.lo user/unix/groupinfo.lo OBJECTS_unix = $(OBJECTS_all) $(OBJECTS_atomic_unix) $(OBJECTS_dso_unix) $(OBJECTS_file_io_unix) $(OBJECTS_locks_unix) $(OBJECTS_memory_unix) $(OBJECTS_misc_unix) $(OBJECTS_mmap_unix) $(OBJECTS_network_io_unix) $(OBJECTS_poll_unix) $(OBJECTS_random_unix) $(OBJECTS_shmem_unix) $(OBJECTS_support_unix) $(OBJECTS_threadproc_unix) $(OBJECTS_time_unix) $(OBJECTS_user_unix) -dso/aix/dso.lo: dso/aix/dso.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_proc_mutex.h include/apr_user.h include/apr_file_io.h include/apr_want.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h +dso/aix/dso.lo: dso/aix/dso.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_proc_mutex.h include/fspr_user.h include/fspr_file_io.h include/fspr_want.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h OBJECTS_dso_aix = dso/aix/dso.lo OBJECTS_aix = $(OBJECTS_all) $(OBJECTS_atomic_unix) $(OBJECTS_dso_aix) $(OBJECTS_file_io_unix) $(OBJECTS_locks_unix) $(OBJECTS_memory_unix) $(OBJECTS_misc_unix) $(OBJECTS_mmap_unix) $(OBJECTS_network_io_unix) $(OBJECTS_poll_unix) $(OBJECTS_random_unix) $(OBJECTS_shmem_unix) $(OBJECTS_support_unix) $(OBJECTS_threadproc_unix) $(OBJECTS_time_unix) $(OBJECTS_user_unix) -dso/beos/dso.lo: dso/beos/dso.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_proc_mutex.h include/apr_user.h include/apr_file_io.h include/apr_want.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h +dso/beos/dso.lo: dso/beos/dso.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_proc_mutex.h include/fspr_user.h include/fspr_file_io.h include/fspr_want.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h OBJECTS_dso_beos = dso/beos/dso.lo -locks/beos/thread_rwlock.lo: locks/beos/thread_rwlock.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_proc_mutex.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_want.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h -locks/beos/thread_mutex.lo: locks/beos/thread_mutex.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_proc_mutex.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_want.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h -locks/beos/thread_cond.lo: locks/beos/thread_cond.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_proc_mutex.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_want.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h -locks/beos/proc_mutex.lo: locks/beos/proc_mutex.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_proc_mutex.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_want.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h +locks/beos/thread_rwlock.lo: locks/beos/thread_rwlock.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_proc_mutex.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_want.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h +locks/beos/thread_mutex.lo: locks/beos/thread_mutex.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_proc_mutex.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_want.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h +locks/beos/thread_cond.lo: locks/beos/thread_cond.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_proc_mutex.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_want.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h +locks/beos/proc_mutex.lo: locks/beos/proc_mutex.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_proc_mutex.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_want.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h OBJECTS_locks_beos = locks/beos/thread_rwlock.lo locks/beos/thread_mutex.lo locks/beos/thread_cond.lo locks/beos/proc_mutex.lo network_io/beos/socketcommon.lo: network_io/beos/socketcommon.c .make.dirs -network_io/beos/sendrecv.lo: network_io/beos/sendrecv.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_thread_mutex.h include/apr_errno.h include/apr_want.h include/apr_time.h include/apr_pools.h +network_io/beos/sendrecv.lo: network_io/beos/sendrecv.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_thread_mutex.h include/fspr_errno.h include/fspr_want.h include/fspr_time.h include/fspr_pools.h OBJECTS_network_io_beos = network_io/beos/socketcommon.lo network_io/beos/sendrecv.lo -shmem/beos/shm.lo: shmem/beos/shm.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_want.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_proc_mutex.h include/apr_lib.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h +shmem/beos/shm.lo: shmem/beos/shm.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_want.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_proc_mutex.h include/fspr_lib.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h OBJECTS_shmem_beos = shmem/beos/shm.lo -threadproc/beos/apr_proc_stub.lo: threadproc/beos/apr_proc_stub.c .make.dirs -threadproc/beos/thread.lo: threadproc/beos/thread.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_proc_mutex.h include/apr_user.h include/apr_file_io.h include/apr_want.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h -threadproc/beos/proc.lo: threadproc/beos/proc.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_thread_mutex.h include/apr_errno.h include/apr_want.h include/apr_pools.h include/apr_strings.h +threadproc/beos/fspr_proc_stub.lo: threadproc/beos/fspr_proc_stub.c .make.dirs +threadproc/beos/thread.lo: threadproc/beos/thread.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_proc_mutex.h include/fspr_user.h include/fspr_file_io.h include/fspr_want.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h +threadproc/beos/proc.lo: threadproc/beos/proc.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_thread_mutex.h include/fspr_errno.h include/fspr_want.h include/fspr_pools.h include/fspr_strings.h threadproc/beos/threadpriv.lo: threadproc/beos/threadpriv.c .make.dirs threadproc/beos/threadproc_common.lo: threadproc/beos/threadproc_common.c .make.dirs -OBJECTS_threadproc_beos = threadproc/beos/apr_proc_stub.lo threadproc/beos/thread.lo threadproc/beos/proc.lo threadproc/beos/threadpriv.lo threadproc/beos/threadproc_common.lo +OBJECTS_threadproc_beos = threadproc/beos/fspr_proc_stub.lo threadproc/beos/thread.lo threadproc/beos/proc.lo threadproc/beos/threadpriv.lo threadproc/beos/threadproc_common.lo OBJECTS_beos = $(OBJECTS_all) $(OBJECTS_atomic_unix) $(OBJECTS_dso_beos) $(OBJECTS_file_io_unix) $(OBJECTS_locks_beos) $(OBJECTS_memory_unix) $(OBJECTS_misc_unix) $(OBJECTS_mmap_unix) $(OBJECTS_network_io_beos) $(OBJECTS_poll_unix) $(OBJECTS_random_unix) $(OBJECTS_shmem_beos) $(OBJECTS_support_unix) $(OBJECTS_threadproc_beos) $(OBJECTS_time_unix) $(OBJECTS_user_unix) -dso/os2/dso.lo: dso/os2/dso.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_proc_mutex.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_want.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h +dso/os2/dso.lo: dso/os2/dso.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_proc_mutex.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_want.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h OBJECTS_dso_os2 = dso/os2/dso.lo -file_io/os2/dir_make_recurse.lo: file_io/os2/dir_make_recurse.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_inherit.h include/apr_file_info.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_want.h include/apr_thread_mutex.h include/apr_lib.h include/apr_time.h include/apr_pools.h include/apr_tables.h -file_io/os2/filesys.lo: file_io/os2/filesys.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_want.h include/apr_strings.h include/apr_thread_mutex.h include/apr_lib.h include/apr_pools.h +file_io/os2/dir_make_recurse.lo: file_io/os2/dir_make_recurse.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_want.h include/fspr_thread_mutex.h include/fspr_lib.h include/fspr_time.h include/fspr_pools.h include/fspr_tables.h +file_io/os2/filesys.lo: file_io/os2/filesys.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_want.h include/fspr_strings.h include/fspr_thread_mutex.h include/fspr_lib.h include/fspr_pools.h file_io/os2/flock.lo: file_io/os2/flock.c .make.dirs -file_io/os2/readwrite.lo: file_io/os2/readwrite.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_inherit.h include/apr_file_info.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_want.h include/apr_thread_mutex.h include/apr_lib.h include/apr_time.h include/apr_pools.h include/apr_tables.h +file_io/os2/readwrite.lo: file_io/os2/readwrite.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_want.h include/fspr_thread_mutex.h include/fspr_lib.h include/fspr_time.h include/fspr_pools.h include/fspr_tables.h file_io/os2/filepath_util.lo: file_io/os2/filepath_util.c .make.dirs -file_io/os2/seek.lo: file_io/os2/seek.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_inherit.h include/apr_file_info.h include/apr_user.h include/apr_file_io.h include/apr_want.h include/apr_thread_mutex.h include/apr_lib.h include/apr_time.h include/apr_pools.h include/apr_tables.h -file_io/os2/dir.lo: file_io/os2/dir.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_proc_mutex.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_want.h include/apr_lib.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h +file_io/os2/seek.lo: file_io/os2/seek.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_user.h include/fspr_file_io.h include/fspr_want.h include/fspr_thread_mutex.h include/fspr_lib.h include/fspr_time.h include/fspr_pools.h include/fspr_tables.h +file_io/os2/dir.lo: file_io/os2/dir.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_proc_mutex.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_want.h include/fspr_lib.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h file_io/os2/mktemp.lo: file_io/os2/mktemp.c .make.dirs -file_io/os2/filedup.lo: file_io/os2/filedup.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_inherit.h include/apr_file_info.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_want.h include/apr_thread_mutex.h include/apr_lib.h include/apr_time.h include/apr_pools.h include/apr_tables.h +file_io/os2/filedup.lo: file_io/os2/filedup.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_want.h include/fspr_thread_mutex.h include/fspr_lib.h include/fspr_time.h include/fspr_pools.h include/fspr_tables.h file_io/os2/tempdir.lo: file_io/os2/tempdir.c .make.dirs -file_io/os2/maperrorcode.lo: file_io/os2/maperrorcode.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_inherit.h include/apr_file_info.h include/apr_user.h include/apr_file_io.h include/apr_want.h include/apr_thread_mutex.h include/apr_time.h include/apr_pools.h include/apr_tables.h +file_io/os2/maperrorcode.lo: file_io/os2/maperrorcode.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_user.h include/fspr_file_io.h include/fspr_want.h include/fspr_thread_mutex.h include/fspr_time.h include/fspr_pools.h include/fspr_tables.h file_io/os2/filepath.lo: file_io/os2/filepath.c .make.dirs -file_io/os2/pipe.lo: file_io/os2/pipe.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_want.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_proc_mutex.h include/apr_lib.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h -file_io/os2/open.lo: file_io/os2/open.c .make.dirs include/apr_allocator.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_tables.h include/apr_errno.h include/apr_want.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_shm.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_dso.h include/apr_proc_mutex.h include/apr_lib.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h -file_io/os2/filestat.lo: file_io/os2/filestat.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_errno.h include/apr_inherit.h include/apr_file_info.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_want.h include/apr_thread_mutex.h include/apr_lib.h include/apr_time.h include/apr_pools.h include/apr_tables.h +file_io/os2/pipe.lo: file_io/os2/pipe.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_want.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_proc_mutex.h include/fspr_lib.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h +file_io/os2/open.lo: file_io/os2/open.c .make.dirs include/fspr_allocator.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_tables.h include/fspr_errno.h include/fspr_want.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_shm.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_dso.h include/fspr_proc_mutex.h include/fspr_lib.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h +file_io/os2/filestat.lo: file_io/os2/filestat.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_errno.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_want.h include/fspr_thread_mutex.h include/fspr_lib.h include/fspr_time.h include/fspr_pools.h include/fspr_tables.h file_io/os2/copy.lo: file_io/os2/copy.c .make.dirs file_io/os2/fileacc.lo: file_io/os2/fileacc.c .make.dirs file_io/os2/fullrw.lo: file_io/os2/fullrw.c .make.dirs OBJECTS_file_io_os2 = file_io/os2/dir_make_recurse.lo file_io/os2/filesys.lo file_io/os2/flock.lo file_io/os2/readwrite.lo file_io/os2/filepath_util.lo file_io/os2/seek.lo file_io/os2/dir.lo file_io/os2/mktemp.lo file_io/os2/filedup.lo file_io/os2/tempdir.lo file_io/os2/maperrorcode.lo file_io/os2/filepath.lo file_io/os2/pipe.lo file_io/os2/open.lo file_io/os2/filestat.lo file_io/os2/copy.lo file_io/os2/fileacc.lo file_io/os2/fullrw.lo -locks/os2/thread_rwlock.lo: locks/os2/thread_rwlock.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_want.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_proc_mutex.h include/apr_lib.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h -locks/os2/thread_mutex.lo: locks/os2/thread_mutex.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_want.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_proc_mutex.h include/apr_lib.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h -locks/os2/thread_cond.lo: locks/os2/thread_cond.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_want.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_proc_mutex.h include/apr_lib.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h -locks/os2/proc_mutex.lo: locks/os2/proc_mutex.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_want.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_proc_mutex.h include/apr_lib.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h +locks/os2/thread_rwlock.lo: locks/os2/thread_rwlock.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_want.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_proc_mutex.h include/fspr_lib.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h +locks/os2/thread_mutex.lo: locks/os2/thread_mutex.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_want.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_proc_mutex.h include/fspr_lib.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h +locks/os2/thread_cond.lo: locks/os2/thread_cond.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_want.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_proc_mutex.h include/fspr_lib.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h +locks/os2/proc_mutex.lo: locks/os2/proc_mutex.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_want.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_proc_mutex.h include/fspr_lib.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h OBJECTS_locks_os2 = locks/os2/thread_rwlock.lo locks/os2/thread_mutex.lo locks/os2/thread_cond.lo locks/os2/proc_mutex.lo network_io/os2/sockaddr.lo: network_io/os2/sockaddr.c .make.dirs -network_io/os2/sockopt.lo: network_io/os2/sockopt.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_errno.h include/apr_want.h include/apr_file_info.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_inherit.h include/apr_thread_mutex.h include/apr_lib.h include/apr_time.h include/apr_pools.h include/apr_tables.h -network_io/os2/sendrecv_udp.lo: network_io/os2/sendrecv_udp.c .make.dirs include/apr_support.h include/apr_general.h include/apr_network_io.h include/apr_inherit.h include/apr_file_info.h include/apr_allocator.h include/apr_thread_mutex.h include/apr_tables.h include/apr_errno.h include/apr_want.h include/apr_user.h include/apr_file_io.h include/apr_lib.h include/apr_time.h include/apr_pools.h -network_io/os2/sendrecv.lo: network_io/os2/sendrecv.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_errno.h include/apr_want.h include/apr_file_info.h include/apr_user.h include/apr_file_io.h include/apr_inherit.h include/apr_thread_mutex.h include/apr_lib.h include/apr_time.h include/apr_pools.h include/apr_tables.h -network_io/os2/os2calls.lo: network_io/os2/os2calls.c .make.dirs include/apr_allocator.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_tables.h include/apr_errno.h include/apr_want.h include/apr_user.h include/apr_file_io.h include/apr_shm.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_dso.h include/apr_proc_mutex.h include/apr_lib.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h -network_io/os2/sockets.lo: network_io/os2/sockets.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_want.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_proc_mutex.h include/apr_lib.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h +network_io/os2/sockopt.lo: network_io/os2/sockopt.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_errno.h include/fspr_want.h include/fspr_file_info.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_inherit.h include/fspr_thread_mutex.h include/fspr_lib.h include/fspr_time.h include/fspr_pools.h include/fspr_tables.h +network_io/os2/sendrecv_udp.lo: network_io/os2/sendrecv_udp.c .make.dirs include/fspr_support.h include/fspr_general.h include/fspr_network_io.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_allocator.h include/fspr_thread_mutex.h include/fspr_tables.h include/fspr_errno.h include/fspr_want.h include/fspr_user.h include/fspr_file_io.h include/fspr_lib.h include/fspr_time.h include/fspr_pools.h +network_io/os2/sendrecv.lo: network_io/os2/sendrecv.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_errno.h include/fspr_want.h include/fspr_file_info.h include/fspr_user.h include/fspr_file_io.h include/fspr_inherit.h include/fspr_thread_mutex.h include/fspr_lib.h include/fspr_time.h include/fspr_pools.h include/fspr_tables.h +network_io/os2/os2calls.lo: network_io/os2/os2calls.c .make.dirs include/fspr_allocator.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_tables.h include/fspr_errno.h include/fspr_want.h include/fspr_user.h include/fspr_file_io.h include/fspr_shm.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_dso.h include/fspr_proc_mutex.h include/fspr_lib.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h +network_io/os2/sockets.lo: network_io/os2/sockets.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_want.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_proc_mutex.h include/fspr_lib.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h network_io/os2/inet_ntop.lo: network_io/os2/inet_ntop.c .make.dirs network_io/os2/inet_pton.lo: network_io/os2/inet_pton.c .make.dirs OBJECTS_network_io_os2 = network_io/os2/sockaddr.lo network_io/os2/sockopt.lo network_io/os2/sendrecv_udp.lo network_io/os2/sendrecv.lo network_io/os2/os2calls.lo network_io/os2/sockets.lo network_io/os2/inet_ntop.lo network_io/os2/inet_pton.lo -poll/os2/pollset.lo: poll/os2/pollset.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_errno.h include/apr_inherit.h include/apr_file_info.h include/apr_user.h include/apr_file_io.h include/apr_want.h include/apr_thread_mutex.h include/apr_poll.h include/apr_time.h include/apr_pools.h include/apr_tables.h -poll/os2/poll.lo: poll/os2/poll.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_errno.h include/apr_inherit.h include/apr_file_info.h include/apr_user.h include/apr_file_io.h include/apr_want.h include/apr_thread_mutex.h include/apr_poll.h include/apr_time.h include/apr_pools.h include/apr_tables.h +poll/os2/pollset.lo: poll/os2/pollset.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_errno.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_user.h include/fspr_file_io.h include/fspr_want.h include/fspr_thread_mutex.h include/fspr_poll.h include/fspr_time.h include/fspr_pools.h include/fspr_tables.h +poll/os2/poll.lo: poll/os2/poll.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_errno.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_user.h include/fspr_file_io.h include/fspr_want.h include/fspr_thread_mutex.h include/fspr_poll.h include/fspr_time.h include/fspr_pools.h include/fspr_tables.h OBJECTS_poll_os2 = poll/os2/pollset.lo poll/os2/poll.lo -shmem/os2/shm.lo: shmem/os2/shm.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_want.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_proc_mutex.h include/apr_lib.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h +shmem/os2/shm.lo: shmem/os2/shm.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_want.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_proc_mutex.h include/fspr_lib.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h OBJECTS_shmem_os2 = shmem/os2/shm.lo -threadproc/os2/thread.lo: threadproc/os2/thread.c .make.dirs include/apr_allocator.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_tables.h include/apr_errno.h include/apr_want.h include/apr_user.h include/apr_file_io.h include/apr_shm.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_dso.h include/apr_proc_mutex.h include/apr_lib.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h +threadproc/os2/thread.lo: threadproc/os2/thread.c .make.dirs include/fspr_allocator.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_tables.h include/fspr_errno.h include/fspr_want.h include/fspr_user.h include/fspr_file_io.h include/fspr_shm.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_dso.h include/fspr_proc_mutex.h include/fspr_lib.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h threadproc/os2/signals.lo: threadproc/os2/signals.c .make.dirs -threadproc/os2/proc.lo: threadproc/os2/proc.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_signal.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_proc_mutex.h include/apr_tables.h include/apr_errno.h include/apr_want.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_inherit.h include/apr_lib.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h -threadproc/os2/threadpriv.lo: threadproc/os2/threadpriv.c .make.dirs include/apr_allocator.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_tables.h include/apr_errno.h include/apr_want.h include/apr_user.h include/apr_file_io.h include/apr_shm.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_dso.h include/apr_proc_mutex.h include/apr_lib.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h +threadproc/os2/proc.lo: threadproc/os2/proc.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_signal.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_proc_mutex.h include/fspr_tables.h include/fspr_errno.h include/fspr_want.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_inherit.h include/fspr_lib.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h +threadproc/os2/threadpriv.lo: threadproc/os2/threadpriv.c .make.dirs include/fspr_allocator.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_tables.h include/fspr_errno.h include/fspr_want.h include/fspr_user.h include/fspr_file_io.h include/fspr_shm.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_dso.h include/fspr_proc_mutex.h include/fspr_lib.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h OBJECTS_threadproc_os2 = threadproc/os2/thread.lo threadproc/os2/signals.lo threadproc/os2/proc.lo threadproc/os2/threadpriv.lo OBJECTS_os2 = $(OBJECTS_all) $(OBJECTS_atomic_unix) $(OBJECTS_dso_os2) $(OBJECTS_file_io_os2) $(OBJECTS_locks_os2) $(OBJECTS_memory_unix) $(OBJECTS_misc_unix) $(OBJECTS_mmap_unix) $(OBJECTS_network_io_os2) $(OBJECTS_poll_os2) $(OBJECTS_random_unix) $(OBJECTS_shmem_os2) $(OBJECTS_support_unix) $(OBJECTS_threadproc_os2) $(OBJECTS_time_unix) $(OBJECTS_user_unix) -atomic/os390/atomic.lo: atomic/os390/atomic.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_thread_mutex.h include/apr_errno.h include/apr_want.h include/apr_atomic.h include/apr_pools.h +atomic/os390/atomic.lo: atomic/os390/atomic.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_thread_mutex.h include/fspr_errno.h include/fspr_want.h include/fspr_atomic.h include/fspr_pools.h OBJECTS_atomic_os390 = atomic/os390/atomic.lo -dso/os390/dso.lo: dso/os390/dso.c .make.dirs include/apr_allocator.h include/apr_general.h include/apr_network_io.h include/apr_portable.h include/apr_inherit.h include/apr_file_info.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_dso.h include/apr_tables.h include/apr_errno.h include/apr_want.h include/apr_user.h include/apr_file_io.h include/apr_strings.h include/apr_proc_mutex.h include/apr_shm.h include/apr_global_mutex.h include/apr_time.h include/apr_pools.h +dso/os390/dso.lo: dso/os390/dso.c .make.dirs include/fspr_allocator.h include/fspr_general.h include/fspr_network_io.h include/fspr_portable.h include/fspr_inherit.h include/fspr_file_info.h include/fspr_thread_mutex.h include/fspr_thread_proc.h include/fspr_dso.h include/fspr_tables.h include/fspr_errno.h include/fspr_want.h include/fspr_user.h include/fspr_file_io.h include/fspr_strings.h include/fspr_proc_mutex.h include/fspr_shm.h include/fspr_global_mutex.h include/fspr_time.h include/fspr_pools.h OBJECTS_dso_os390 = dso/os390/dso.lo OBJECTS_os390 = $(OBJECTS_all) $(OBJECTS_atomic_os390) $(OBJECTS_dso_os390) $(OBJECTS_file_io_unix) $(OBJECTS_locks_unix) $(OBJECTS_memory_unix) $(OBJECTS_misc_unix) $(OBJECTS_mmap_unix) $(OBJECTS_network_io_unix) $(OBJECTS_poll_unix) $(OBJECTS_random_unix) $(OBJECTS_shmem_unix) $(OBJECTS_support_unix) $(OBJECTS_threadproc_unix) $(OBJECTS_time_unix) $(OBJECTS_user_unix) -HEADERS = $(top_srcdir)/include/apr_thread_mutex.h $(top_srcdir)/include/apr_env.h $(top_srcdir)/include/apr_poll.h $(top_srcdir)/include/apr_fnmatch.h $(top_srcdir)/include/apr_global_mutex.h $(top_srcdir)/include/apr_pools.h $(top_srcdir)/include/apr_want.h $(top_srcdir)/include/apr_file_io.h $(top_srcdir)/include/apr_version.h $(top_srcdir)/include/apr_mmap.h $(top_srcdir)/include/apr_dso.h $(top_srcdir)/include/apr_thread_proc.h $(top_srcdir)/include/apr_errno.h $(top_srcdir)/include/apr_shm.h $(top_srcdir)/include/apr_network_io.h $(top_srcdir)/include/apr_signal.h $(top_srcdir)/include/apr_user.h $(top_srcdir)/include/apr_support.h $(top_srcdir)/include/apr_atomic.h $(top_srcdir)/include/apr_random.h $(top_srcdir)/include/apr_thread_cond.h $(top_srcdir)/include/apr_thread_rwlock.h $(top_srcdir)/include/apr_getopt.h $(top_srcdir)/include/apr_inherit.h $(top_srcdir)/include/apr_strings.h $(top_srcdir)/include/apr_general.h $(top_srcdir)/include/apr_proc_mutex.h $(top_srcdir)/include/apr_tables.h $(top_srcdir)/include/apr_ring.h $(top_srcdir)/include/apr_file_info.h $(top_srcdir)/include/apr_allocator.h $(top_srcdir)/include/apr_portable.h $(top_srcdir)/include/apr_hash.h $(top_srcdir)/include/apr_time.h $(top_srcdir)/include/apr_lib.h +HEADERS = $(top_srcdir)/include/fspr_thread_mutex.h $(top_srcdir)/include/fspr_env.h $(top_srcdir)/include/fspr_poll.h $(top_srcdir)/include/fspr_fnmatch.h $(top_srcdir)/include/fspr_global_mutex.h $(top_srcdir)/include/fspr_pools.h $(top_srcdir)/include/fspr_want.h $(top_srcdir)/include/fspr_file_io.h $(top_srcdir)/include/fspr_version.h $(top_srcdir)/include/fspr_mmap.h $(top_srcdir)/include/fspr_dso.h $(top_srcdir)/include/fspr_thread_proc.h $(top_srcdir)/include/fspr_errno.h $(top_srcdir)/include/fspr_shm.h $(top_srcdir)/include/fspr_network_io.h $(top_srcdir)/include/fspr_signal.h $(top_srcdir)/include/fspr_user.h $(top_srcdir)/include/fspr_support.h $(top_srcdir)/include/fspr_atomic.h $(top_srcdir)/include/fspr_random.h $(top_srcdir)/include/fspr_thread_cond.h $(top_srcdir)/include/fspr_thread_rwlock.h $(top_srcdir)/include/fspr_getopt.h $(top_srcdir)/include/fspr_inherit.h $(top_srcdir)/include/fspr_strings.h $(top_srcdir)/include/fspr_general.h $(top_srcdir)/include/fspr_proc_mutex.h $(top_srcdir)/include/fspr_tables.h $(top_srcdir)/include/fspr_ring.h $(top_srcdir)/include/fspr_file_info.h $(top_srcdir)/include/fspr_allocator.h $(top_srcdir)/include/fspr_portable.h $(top_srcdir)/include/fspr_hash.h $(top_srcdir)/include/fspr_time.h $(top_srcdir)/include/fspr_lib.h SOURCE_DIRS = random/unix dso/os2 time/unix locks/unix user/unix locks/beos tables support/unix file_io/unix mmap/unix atomic/unix poll/os2 dso/os390 atomic/os390 dso/beos poll/unix passwd network_io/beos threadproc/os2 network_io/os2 threadproc/beos shmem/unix network_io/unix file_io/os2 dso/aix threadproc/unix misc/unix shmem/beos dso/unix locks/os2 shmem/os2 memory/unix strings $(EXTRA_SOURCE_DIRS) diff --git a/libs/apr/build/NWGNUenvironment.inc b/libs/apr/build/NWGNUenvironment.inc index fd54b487c9..53039ba962 100644 --- a/libs/apr/build/NWGNUenvironment.inc +++ b/libs/apr/build/NWGNUenvironment.inc @@ -164,9 +164,9 @@ ifeq "$(RELEASE)" "optimized" CFLAGS += -O4,p endif -# -prefix apr_arch_pre_nw.h #include pre_nw.h for all files +# -prefix fspr_arch_pre_nw.h #include pre_nw.h for all files -CFLAGS += -prefix apr_arch_pre_nw.h +CFLAGS += -prefix fspr_arch_pre_nw.h PATH:=$(PATH);$(METROWERKS)\bin;$(METROWERKS)\Other Metrowerks Tools\Command Line Tools diff --git a/libs/apr/build/NWGNUmakefile b/libs/apr/build/NWGNUmakefile index 6f9b32dd04..a9aac49fcd 100644 --- a/libs/apr/build/NWGNUmakefile +++ b/libs/apr/build/NWGNUmakefile @@ -16,10 +16,10 @@ include $(APR_WORK)\build\NWGNUhead.inc # build this level's files FILES_prebuild_headers = \ - $(APR)/include/apr.h \ + $(APR)/include/fspr.h \ $(APRUTIL)/include/apu.h \ $(APRUTIL)/include/apu_want.h \ - $(APRUTIL)/include/apr_ldap.h \ + $(APRUTIL)/include/fspr_ldap.h \ $(APRUTIL)/include/private/apu_config.h \ $(APRUTIL)/include/private/apu_select_dbm.h \ $(APRUTIL)/xml/expat/lib/expat.h \ @@ -83,9 +83,9 @@ clean :: $(CHK) nw_export.i $(DEL) nw_export.i $(CHK) $(NLM_NAME)_cc.opt $(DEL) $(NLM_NAME)_cc.opt $(CHK) NWGNUversion.inc $(DEL) NWGNUversion.inc - $(CHK) $(subst /,\,$(APR))\include\apr.h $(DEL) $(subst /,\,$(APR))\include\apr.h + $(CHK) $(subst /,\,$(APR))\include\fspr.h $(DEL) $(subst /,\,$(APR))\include\fspr.h $(CHK) $(subst /,\,$(APRUTIL))\include\apu.h $(DEL) $(subst /,\,$(APRUTIL))\include\apu.h - $(CHK) $(subst /,\,$(APRUTIL))\include\apr_ldap.h $(DEL) $(subst /,\,$(APRUTIL))\include\apr_ldap.h + $(CHK) $(subst /,\,$(APRUTIL))\include\fspr_ldap.h $(DEL) $(subst /,\,$(APRUTIL))\include\fspr_ldap.h $(CHK) $(subst /,\,$(APRUTIL))\include\private\apu_config.h $(DEL) $(subst /,\,$(APRUTIL))\include\private\apu_config.h $(CHK) $(subst /,\,$(APRUTIL))\include\private\apu_select_dbm.h $(DEL) $(subst /,\,$(APRUTIL))\include\private\apu_select_dbm.h $(CHK) $(subst /,\,$(APRUTIL))\xml\expat\lib\expat.h $(DEL) $(subst /,\,$(APRUTIL))\xml\expat\lib\expat.h diff --git a/libs/apr/build/NWGNUtail.inc b/libs/apr/build/NWGNUtail.inc index 641c091b24..2c3ccf36f9 100644 --- a/libs/apr/build/NWGNUtail.inc +++ b/libs/apr/build/NWGNUtail.inc @@ -88,9 +88,9 @@ endif # Generic compiler rules # -$(APR_WORK)\build\NWGNUversion.inc : $(APR_WORK)\include\apr_version.h $(APR_WORK)\build\nw_ver.awk +$(APR_WORK)\build\NWGNUversion.inc : $(APR_WORK)\include\fspr_version.h $(APR_WORK)\build\nw_ver.awk @echo Generating $(subst /,\,$@) - awk -f $(APR_WORK)\build\nw_ver.awk $(APR_WORK)\include\apr_version.h > $(APR_WORK)\build\NWGNUversion.inc + awk -f $(APR_WORK)\build\nw_ver.awk $(APR_WORK)\include\fspr_version.h > $(APR_WORK)\build\NWGNUversion.inc -include $(APR_WORK)\build\NWGNUversion.inc diff --git a/libs/apr/build/apr_app.dsp b/libs/apr/build/apr_app.dsp index ac060a503f..55c84e3c48 100644 --- a/libs/apr/build/apr_app.dsp +++ b/libs/apr/build/apr_app.dsp @@ -83,7 +83,7 @@ LIB32=link.exe -lib # Name "apr_app - Win32 Debug" # Begin Source File -SOURCE=..\misc\win32\apr_app.c +SOURCE=..\misc\win32\fspr_app.c # End Source File # End Target # End Project diff --git a/libs/apr/build/apr_common.m4 b/libs/apr/build/apr_common.m4 index e8e9f51f08..13d6be60dd 100644 --- a/libs/apr/build/apr_common.m4 +++ b/libs/apr/build/apr_common.m4 @@ -338,7 +338,7 @@ AC_DEFUN([APR_CHECK_APR_DEFINE],[ apr_old_cppflags=$CPPFLAGS CPPFLAGS="$CPPFLAGS $INCLUDES" AC_EGREP_CPP(YES_IS_DEFINED, [ -#include +#include #if $1 YES_IS_DEFINED #endif @@ -403,7 +403,7 @@ ac_decision='' AC_DEFUN([APR_DECIDE],[dnl -dnl Define the flag (or not) in apr_private.h via autoheader +dnl Define the flag (or not) in fspr_private.h via autoheader AH_TEMPLATE($1, [Define if $2 will be used]) ac_decision='$1' ac_decision_msg='$2' diff --git a/libs/apr/build/find_apr.m4 b/libs/apr/build/find_apr.m4 index 048cb7bfc8..1060965d8d 100644 --- a/libs/apr/build/find_apr.m4 +++ b/libs/apr/build/find_apr.m4 @@ -143,7 +143,7 @@ AC_DEFUN([APR_FIND_APR], [ if test "$apr_found" = "no" && test -d "$1"; then apr_temp_abs_srcdir="`cd $1 && pwd`" apr_found="reconfig" - apr_bundled_major="`sed -n '/#define.*APR_MAJOR_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p' \"$1/include/apr_version.h\"`" + apr_bundled_major="`sed -n '/#define.*APR_MAJOR_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p' \"$1/include/fspr_version.h\"`" case $apr_bundled_major in "") AC_MSG_ERROR([failed to find major version of bundled APR]) diff --git a/libs/apr/build/libapr_app.dsp b/libs/apr/build/libapr_app.dsp index 0cd962e5cd..875dade39f 100644 --- a/libs/apr/build/libapr_app.dsp +++ b/libs/apr/build/libapr_app.dsp @@ -83,7 +83,7 @@ LIB32=link.exe -lib # Name "libapr_app - Win32 Debug" # Begin Source File -SOURCE=..\misc\win32\apr_app.c +SOURCE=..\misc\win32\fspr_app.c # End Source File # Begin Source File diff --git a/libs/apr/build/make_exports.awk b/libs/apr/build/make_exports.awk index 1d12fc65ab..bd417e2a44 100644 --- a/libs/apr/build/make_exports.awk +++ b/libs/apr/build/make_exports.awk @@ -100,21 +100,21 @@ function add_symbol(symbol) { /^[ \t]*APR_POOL_DECLARE_ACCESSOR[^(]*[(][^)]*[)]/ { sub("[ \t]*APR_POOL_DECLARE_ACCESSOR[^(]*[(]", "", $0) sub("[)].*$", "", $0) - add_symbol("apr_" $0 "_pool_get") + add_symbol("fspr_" $0 "_pool_get") next } /^[ \t]*APR_DECLARE_INHERIT_SET[^(]*[(][^)]*[)]/ { sub("[ \t]*APR_DECLARE_INHERIT_SET[^(]*[(]", "", $0) sub("[)].*$", "", $0) - add_symbol("apr_" $0 "_inherit_set") + add_symbol("fspr_" $0 "_inherit_set") next } /^[ \t]*APR_DECLARE_INHERIT_UNSET[^(]*[(][^)]*[)]/ { sub("[ \t]*APR_DECLARE_INHERIT_UNSET[^(]*[(]", "", $0) sub("[)].*$", "", $0) - add_symbol("apr_" $0 "_inherit_unset") + add_symbol("fspr_" $0 "_inherit_unset") next } diff --git a/libs/apr/build/make_nw_export.awk b/libs/apr/build/make_nw_export.awk index 291ecc0b2c..21cc683157 100644 --- a/libs/apr/build/make_nw_export.awk +++ b/libs/apr/build/make_nw_export.awk @@ -6,8 +6,8 @@ BEGIN { } # List of functions that we don't support, yet?? -#/apr_##name##_set_inherit/{next} -#/apr_##name##_unset_inherit/{next} +#/fspr_##name##_set_inherit/{next} +#/fspr_##name##_unset_inherit/{next} function add_symbol (sym_name) { @@ -47,21 +47,21 @@ function add_symbol (sym_name) { /^[ \t]*APR_POOL_DECLARE_ACCESSOR[^(]*[(][^)]*[)]/ { sub("[ \t]*APR_POOL_DECLARE_ACCESSOR[^(]*[(]", "", $0) sub("[)].*$", "", $0) - add_symbol("apr_" $0 "_pool_get") + add_symbol("fspr_" $0 "_pool_get") next } /^[ \t]*APR_DECLARE_INHERIT_SET[^(]*[(][^)]*[)]/ { sub("[ \t]*APR_DECLARE_INHERIT_SET[^(]*[(]", "", $0) sub("[)].*$", "", $0) - add_symbol("apr_" $0 "_inherit_set") + add_symbol("fspr_" $0 "_inherit_set") next } /^[ \t]*APR_DECLARE_INHERIT_UNSET[^(]*[(][^)]*[)]/ { sub("[ \t]*APR_DECLARE_INHERIT_UNSET[^(]*[(]", "", $0) sub("[)].*$", "", $0) - add_symbol("apr_" $0 "_inherit_unset") + add_symbol("fspr_" $0 "_inherit_unset") next } diff --git a/libs/apr/build/nw_export.inc b/libs/apr/build/nw_export.inc index 58495cd075..d9f3208d6a 100644 --- a/libs/apr/build/nw_export.inc +++ b/libs/apr/build/nw_export.inc @@ -1,7 +1,7 @@ /* Must include apr.h first so that we can undefine the standard prototypes macros after it messes with them. */ -#include "apr.h" +#include "fspr.h" #undef APR_DECLARE #undef APR_DECLARE_NONSTD @@ -10,41 +10,41 @@ #undef APR_DECLARE_DATA /* Preprocess all of the standard APR headers. */ -#include "apr_allocator.h" -#include "apr_atomic.h" -#include "apr_dso.h" -#include "apr_env.h" -#include "apr_errno.h" -#include "apr_file_info.h" -#include "apr_file_io.h" -#include "apr_fnmatch.h" -#include "apr_general.h" -#include "apr_getopt.h" -#include "apr_global_mutex.h" -#include "apr_hash.h" -#include "apr_inherit.h" -#include "apr_lib.h" -#include "apr_mmap.h" -#include "apr_network_io.h" -#include "apr_poll.h" -#include "apr_pools.h" -#include "apr_portable.h" -#include "apr_proc_mutex.h" -#include "apr_ring.h" -#include "apr_random.h" -#include "apr_shm.h" -#include "apr_signal.h" -#include "apr_strings.h" -#include "apr_support.h" -#include "apr_tables.h" -#include "apr_thread_cond.h" -#include "apr_thread_mutex.h" -#include "apr_thread_proc.h" -#include "apr_thread_rwlock.h" -#include "apr_time.h" -#include "apr_user.h" -#include "apr_version.h" -#include "apr_want.h" +#include "fspr_allocator.h" +#include "fspr_atomic.h" +#include "fspr_dso.h" +#include "fspr_env.h" +#include "fspr_errno.h" +#include "fspr_file_info.h" +#include "fspr_file_io.h" +#include "fspr_fnmatch.h" +#include "fspr_general.h" +#include "fspr_getopt.h" +#include "fspr_global_mutex.h" +#include "fspr_hash.h" +#include "fspr_inherit.h" +#include "fspr_lib.h" +#include "fspr_mmap.h" +#include "fspr_network_io.h" +#include "fspr_poll.h" +#include "fspr_pools.h" +#include "fspr_portable.h" +#include "fspr_proc_mutex.h" +#include "fspr_ring.h" +#include "fspr_random.h" +#include "fspr_shm.h" +#include "fspr_signal.h" +#include "fspr_strings.h" +#include "fspr_support.h" +#include "fspr_tables.h" +#include "fspr_thread_cond.h" +#include "fspr_thread_mutex.h" +#include "fspr_thread_proc.h" +#include "fspr_thread_rwlock.h" +#include "fspr_time.h" +#include "fspr_user.h" +#include "fspr_version.h" +#include "fspr_want.h" /* Must include apu.h first so that we can undefine @@ -57,29 +57,29 @@ #undef APU_DECLARE_DATA /* Preprocess all of the standard APR headers. */ -#include "apr_anylock.h" -#include "apr_base64.h" -#include "apr_buckets.h" -#include "apr_date.h" -#include "apr_dbd.h" -#include "apr_dbm.h" -#include "apr_hooks.h" -#include "apr_ldap.h" -#include "apr_ldap_url.h" -#include "apr_md4.h" -#include "apr_md5.h" -#include "apr_optional.h" -#include "apr_optional_hooks.h" -#include "apr_queue.h" -#include "apr_reslist.h" -#include "apr_rmm.h" -#include "apr_sdbm.h" -#include "apr_sha1.h" -#include "apr_strmatch.h" -#include "apr_uri.h" -#include "apr_uuid.h" -#include "apr_xlate.h" -#include "apr_xml.h" +#include "fspr_anylock.h" +#include "fspr_base64.h" +#include "fspr_buckets.h" +#include "fspr_date.h" +#include "fspr_dbd.h" +#include "fspr_dbm.h" +#include "fspr_hooks.h" +#include "fspr_ldap.h" +#include "fspr_ldap_url.h" +#include "fspr_md4.h" +#include "fspr_md5.h" +#include "fspr_optional.h" +#include "fspr_optional_hooks.h" +#include "fspr_queue.h" +#include "fspr_reslist.h" +#include "fspr_rmm.h" +#include "fspr_sdbm.h" +#include "fspr_sha1.h" +#include "fspr_strmatch.h" +#include "fspr_uri.h" +#include "fspr_uuid.h" +#include "fspr_xlate.h" +#include "fspr_xml.h" #include "apu_version.h" #include "apu_want.h" diff --git a/libs/apr/build/prebuildNW.bat b/libs/apr/build/prebuildNW.bat index 941d920c9b..7b3f3a7b08 100755 --- a/libs/apr/build/prebuildNW.bat +++ b/libs/apr/build/prebuildNW.bat @@ -24,7 +24,7 @@ goto Done @echo # "apr-util\uri\uri_delims.h" on the build machine. @echo Fixing up the APR headers -copy ..\include\apr.hnw ..\include\apr.h +copy ..\include\fspr.hnw ..\include\fspr.h @echo Fixing up the APR-Util headers copy ..\..\apr-util\include\apu.hnw ..\..\apr-util\include\apu.h diff --git a/libs/apr/configure.ac b/libs/apr/configure.ac index 2b8f551880..b267825e09 100644 --- a/libs/apr/configure.ac +++ b/libs/apr/configure.ac @@ -7,7 +7,7 @@ dnl Use ./buildconf to prepare build files and run autoconf for APR. AC_PREREQ(2.50) AC_INIT(build/apr_common.m4) -AC_CONFIG_HEADER(include/arch/unix/apr_private.h) +AC_CONFIG_HEADER(include/arch/unix/fspr_private.h) AC_CONFIG_AUX_DIR(build) dnl @@ -24,7 +24,7 @@ CFLAGS="$CFLAGS $CONFIGURE_CFLAGS" CXXFLAGS="$CXXFLAGS $CONFIGURE_CXXFLAGS" LDFLAGS="$LDFLAGS $CONFIGURE_LDFLAGS" -dnl Hard-coded inclusion at the tail end of apr_private.h: +dnl Hard-coded inclusion at the tail end of fspr_private.h: AH_BOTTOM([ /* switch this on if we have a BeOS version below BONE */ #if BEOS && !HAVE_BONE_VERSION @@ -36,7 +36,7 @@ AH_BOTTOM([ /* * Include common private declarations. */ -#include "../apr_private_common.h" +#include "../fspr_private_common.h" ]) dnl Save user-defined environment settings for later restoration @@ -95,7 +95,7 @@ APR_MKDIR_P_CHECK($apr_builders/mkdir.sh) # get our version information get_version="$apr_builders/get-version.sh" -version_hdr="$apr_srcdir/include/apr_version.h" +version_hdr="$apr_srcdir/include/fspr_version.h" APR_MAJOR_VERSION="`$get_version major $version_hdr APR`" APR_DOTTED_VERSION="`$get_version all $version_hdr APR`" @@ -1169,7 +1169,7 @@ fi if test "$ac_cv_sizeof_int" = "4"; then int_value=int fi -# Now we need to find what apr_int64_t (sizeof == 8) will be. +# Now we need to find what fspr_int64_t (sizeof == 8) will be. # The first match is our preference. if test "$ac_cv_sizeof_int" = "8"; then int64_literal='#define APR_INT64_C(val) (val)' @@ -1243,12 +1243,12 @@ fi if test "$ac_cv_type_size_t" = "yes"; then size_t_value="size_t" else - size_t_value="apr_int32_t" + size_t_value="fspr_int32_t" fi if test "$ac_cv_type_ssize_t" = "yes"; then ssize_t_value="ssize_t" else - ssize_t_value="apr_int32_t" + ssize_t_value="fspr_int32_t" fi if test "$ac_cv_socklen_t" = "yes"; then socklen_t_value="socklen_t" @@ -1298,17 +1298,17 @@ else aprlfs=0 fi -AC_MSG_CHECKING([which type to use for apr_off_t]) +AC_MSG_CHECKING([which type to use for fspr_off_t]) if test "${ac_cv_sizeof_off_t}${apr_cv_use_lfs64}" = "4yes"; then # LFS is go! off_t_fmt='#define APR_OFF_T_FMT APR_INT64_T_FMT' off_t_value='off64_t' - off_t_strfn='apr_strtoi64' + off_t_strfn='fspr_strtoi64' elif test "${ac_cv_sizeof_off_t}x${ac_cv_sizeof_long}" = "4x4"; then # Special case: off_t may change size with _FILE_OFFSET_BITS # on 32-bit systems with LFS support. To avoid compatibility # issues when other packages do define _FILE_OFFSET_BITS, - # hard-code apr_off_t to long. + # hard-code fspr_off_t to long. off_t_value=long off_t_fmt='#define APR_OFF_T_FMT "ld"' off_t_strfn='strtol' @@ -1324,13 +1324,13 @@ elif test "$ac_cv_type_off_t" = "yes"; then off_t_strfn='strtoi' elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long_long"; then off_t_fmt='#define APR_OFF_T_FMT APR_INT64_T_FMT' - off_t_strfn='apr_strtoi64' + off_t_strfn='fspr_strtoi64' else AC_ERROR([could not determine the size of off_t]) fi else # Fallback on int - off_t_value=apr_int32_t + off_t_value=fspr_int32_t off_t_fmt=d off_t_strfn='strtoi' fi @@ -1440,7 +1440,7 @@ fi if test "$have_int64_strfn" = "1"; then AC_DEFINE_UNQUOTED(APR_INT64_STRFN, [$int64_strfn], - [Define as function which can be used for conversion of strings to apr_int64_t]) + [Define as function which can be used for conversion of strings to fspr_int64_t]) fi AC_SUBST(have_strnicmp) @@ -1451,11 +1451,11 @@ AC_SUBST(have_strdup) AC_SUBST(have_strstr) AC_SUBST(have_memchr) -if test "$off_t_strfn" = "apr_strtoi64" && test "$have_int64_strfn" = "1"; then +if test "$off_t_strfn" = "fspr_strtoi64" && test "$have_int64_strfn" = "1"; then off_t_strfn=$int64_strfn fi AC_DEFINE_UNQUOTED(APR_OFF_T_STRFN, [$off_t_strfn], - [Define as function used for conversion of strings to apr_off_t]) + [Define as function used for conversion of strings to fspr_off_t]) dnl ----------------------------- Checking for DSO support echo "${nl}Checking for DSO..." @@ -1949,7 +1949,7 @@ AC_SUBST(file_as_socket) if test "$ac_cv_func_poll $file_as_socket" = "yes 1"; then AC_DEFINE(WAITIO_USES_POLL, 1, - [Define if apr_wait_for_io_or_timeout() uses poll(2)]) + [Define if fspr_wait_for_io_or_timeout() uses poll(2)]) fi # Check the types only if we have gethostbyname_r @@ -2135,7 +2135,7 @@ AC_SUBST(INCLUDE_RULES) AC_SUBST(INCLUDE_OUTPUTS) AC_CONFIG_FILES([Makefile - include/apr.h + include/fspr.h build/apr_rules.mk build/pkg/pkginfo apr-$APR_MAJOR_VERSION-config:apr-config.in @@ -2163,7 +2163,7 @@ dnl This section is expanded by configure UNQUOTED so variable dnl references must be backslash-escaped as necessary. # Commands run at the beginning of config.status: -APR_SAVE_HEADERS="include/apr.h include/arch/unix/apr_private.h" +APR_SAVE_HEADERS="include/fspr.h include/arch/unix/fspr_private.h" APR_MAJOR_VERSION=$APR_MAJOR_VERSION for apri in \${APR_SAVE_HEADERS}; do diff --git a/libs/apr/docs/APRDesign.html b/libs/apr/docs/APRDesign.html index 7d1caeb8d4..d4f6de2d3b 100644 --- a/libs/apr/docs/APRDesign.html +++ b/libs/apr/docs/APRDesign.html @@ -22,10 +22,10 @@ code to the effort.

APR On Windows and Netware

APR on Windows and Netware is different from APR on all other systems, -because those platforms don't use autoconf. On Unix, apr_private.h (private to +because those platforms don't use autoconf. On Unix, fspr_private.h (private to APR) and apr.h (public, used by applications that use APR) are generated by autoconf from acconfig.h and apr.h.in respectively. On Windows (and Netware), -apr_private.h and apr.h are created from apr_private.hw (apr_private.hwn) +fspr_private.h and apr.h are created from fspr_private.hw (fspr_private.hwn) and apr.hw (apr.hwn) respectively.

@@ -34,7 +34,7 @@ and apr.hw (apr.hwn) respectively.

these additions as well. A general rule of thumb, is that if it is a feature macro, such as APR_HAS_THREADS, Windows and Netware need it. In other words, if the definition is going to be used in a public APR - header file, such as apr_general.h, Windows needs it. + header file, such as fspr_general.h, Windows needs it. The only time it is safe to add a macro or test without also adding the macro to apr*.h[n]w, is if the macro tells APR how to build. For @@ -161,7 +161,7 @@ implemented one way. For example, time is a complete type because there is only one reasonable time implementation.
  • The second exception to the incomplete type rule can be found in -apr_portable.h. This file defines the native types for each platform. +fspr_portable.h. This file defines the native types for each platform. Using these types, it is possible to extract native types for any APR type.

    @@ -171,14 +171,14 @@ in file_io/unix/fileio.h:

         struct ap_file_t {
    -        apr_pool_t *cntxt;
    +        fspr_pool_t *cntxt;
             int filedes;
             FILE *filehand;
             ...
         }
     
    -

    In include/apr_file_io.h:

    +

    In include/fspr_file_io.h:

    typedef struct ap_file_t ap_file_t; @@ -187,7 +187,7 @@ in file_io/unix/fileio.h:

    field in this structure. Windows does not have a filedes field, so obviously, it is important that programs not be able to access these.

    -

    You may notice the apr_pool_t field. Most APR types have this field. This +

    You may notice the fspr_pool_t field. Most APR types have this field. This type is used to allocate memory within APR. Because every APR type has a pool, any APR function can allocate memory if it needs to. This is very important and it is one of the reasons that APR works. If you create a new type, you @@ -281,15 +281,15 @@ the error code indicates an error condition or a status codition.

    If your function has multiple return codes that all indicate success, but with different results, or if your function can only return PASS/FAIL, you -should still return an apr_status_t. In the first case, define one +should still return an fspr_status_t. In the first case, define one APR status code for each return value, an example of this is -apr_proc_wait, which can only return APR_CHILDDONE, +fspr_proc_wait, which can only return APR_CHILDDONE, APR_CHILDNOTDONE, or an error code. In the second case, please return APR_SUCCESS for PASS, and define a new APR status code for failure, an -example of this is apr_compare_users, which can only return +example of this is fspr_compare_users, which can only return APR_SUCCESS, APR_EMISMATCH, or an error code.

    -

    All of these definitions can be found in apr_errno.h for all platforms. When +

    All of these definitions can be found in fspr_errno.h for all platforms. When an error occurs in an APR function, the function must return an error code. If the error occurred in a system call and that system call uses errno to report an error, then the code is returned unchanged. For example:

    @@ -320,7 +320,7 @@ case. We'll get to how this problem is solved in a little while.

    If the error occurs in an APR function but it is not due to a system call, but it is actually an APR error or just a status code from APR, then the -appropriate code should be returned. These codes are defined in apr_errno.h +appropriate code should be returned. These codes are defined in fspr_errno.h and should be self explanatory.

    No APR code should ever return a code between APR_OS_START_USEERR and diff --git a/libs/apr/docs/canonical_filenames.html b/libs/apr/docs/canonical_filenames.html index 10867d3796..f1abad5bd8 100644 --- a/libs/apr/docs/canonical_filenames.html +++ b/libs/apr/docs/canonical_filenames.html @@ -88,7 +88,7 @@ system objects.

    Canonical API

    -Functions to manipulate the apr_canon_file_t (an opaque type) include: +Functions to manipulate the fspr_canon_file_t (an opaque type) include:
    • Create canon_file_t (from char* path and canon_file_t parent path) @@ -99,7 +99,7 @@ Functions to manipulate the apr_canon_file_t (an opaque type) include:

    The path is corrected to the file system case only if is in absolute -form. The apr_canon_file_t should be preserved as long as possible and +form. The fspr_canon_file_t should be preserved as long as possible and used as the parent to create child entries to reduce the number of expensive stat and case canonicalization calls to the OS.

    diff --git a/libs/apr/docs/doxygen.conf b/libs/apr/docs/doxygen.conf index 29c2cbf694..76adb8646a 100644 --- a/libs/apr/docs/doxygen.conf +++ b/libs/apr/docs/doxygen.conf @@ -14,9 +14,9 @@ EXPAND_ONLY_PREDEF=YES PREDEFINED="APR_DECLARE(x)=x" \ "APR_DECLARE_NONSTD(x)=x" \ "APR_DECLARE_DATA" \ - "APR_POOL_DECLARE_ACCESSOR(x)=apr_pool_t* apr_##x##_pool_get (const apr_##x##_t *the##x)" \ - "APR_DECLARE_INHERIT_SET(x)=apr_status_t apr_##x##_inherit_set(apr_##x##_t *the##x)" \ - "APR_DECLARE_INHERIT_UNSET(x)=apr_status_t apr_##x##_inherit_unset(apr_##x##_t *the##x)" \ + "APR_POOL_DECLARE_ACCESSOR(x)=fspr_pool_t* fspr_##x##_pool_get (const fspr_##x##_t *the##x)" \ + "APR_DECLARE_INHERIT_SET(x)=fspr_status_t fspr_##x##_inherit_set(fspr_##x##_t *the##x)" \ + "APR_DECLARE_INHERIT_UNSET(x)=fspr_status_t fspr_##x##_inherit_unset(fspr_##x##_t *the##x)" \ "APR_HAS_THREADS" \ "__attribute__(x)=" \ DOXYGEN= diff --git a/libs/apr/docs/non_apr_programs b/libs/apr/docs/non_apr_programs index 5003a8bd55..4595f0e83a 100644 --- a/libs/apr/docs/non_apr_programs +++ b/libs/apr/docs/non_apr_programs @@ -6,7 +6,7 @@ we don't expect them to migrate to using APR just because APR has been released. So, we have provided a way for non-APR'ized programs to interact very cleanly with APR. -There are a set of functions, all documented in apr_portable.h, which allow +There are a set of functions, all documented in fspr_portable.h, which allow a programmer to either get a native type from an APR type, or to setup an APR type from a native type. @@ -15,11 +15,11 @@ APR for file I/O, but you (in your infinite wisdom) want to use APR to make sure your section is portable. Assume the program provides a type foo_t with a file descriptor in it (fd). -void function_using_apr(foo_t non_apr_struct, ap_pool_t *p) +void function_using_apr(foo_t non_fspr_struct, ap_pool_t *p) { - ap_file_t *apr_file = NULL; + ap_file_t *fspr_file = NULL; - ap_put_os_file(&apr_file, &non_apr_struct->fd, p); + ap_put_os_file(&fspr_file, &non_fspr_struct->fd, p); ... } @@ -28,20 +28,20 @@ There are portable functions for each APR incomplete type. They are all called ap_put_os_foobar(), and they each take the same basic arguments, a pointer to a pointer to the incomplete type (the last pointer in that list should be NULL), a pointer to the native type, and a pool. Each of these can -be found in apr_portable.h. +be found in fspr_portable.h. If you have to do the exact opposite (take an APR type and convert it to a native type, there are functions for that too. For example: -void function_not_using_apr(apr_file_t *apr_file) +void function_not_using_apr(fspr_file_t *fspr_file) { int unix_file_desc; - ap_get_os_file(&unix_file_desc, apr_file); + ap_get_os_file(&unix_file_desc, fspr_file); ... } For each ap_put_os_foobar, there is a corresponding ap_get_os_file. These are -also documented in apr_portable.h. +also documented in fspr_portable.h. diff --git a/libs/apr/docs/pool-design.html b/libs/apr/docs/pool-design.html index 6ce6d81e6a..462afaa9c1 100644 --- a/libs/apr/docs/pool-design.html +++ b/libs/apr/docs/pool-design.html @@ -60,13 +60,13 @@

    -subpool = apr_create_subpool(pool);
    +subpool = fspr_create_subpool(pool);
     for (i = 0; i < n; ++i) {
    -  apr_pool_clear(subpool);
    +  fspr_pool_clear(subpool);
     
       do_operation(..., subpool);
     }
    -apr_pool_destroy(subpool);
    +fspr_pool_destroy(subpool);

    This pattern prevents the 'pool' from growing unbounded and diff --git a/libs/apr/docs/win32_builds.html b/libs/apr/docs/win32_builds.html index ad57d8e138..664769fbaf 100644 --- a/libs/apr/docs/win32_builds.html +++ b/libs/apr/docs/win32_builds.html @@ -43,7 +43,7 @@ link with the /pdbtype:sept flag! At the time your application links to an APR library, the corresponding _src.pdb file should exist in the original path the library was built, or it may be sufficient to keep the _src.pdb file - in the same path as the library file. (E.g. apr.lib and apr_src.pdb should + in the same path as the library file. (E.g. apr.lib and fspr_src.pdb should reside together in your lib directory.) The later option is unconfirmed.

    In order to keep the symbols compiled into the static library, your application diff --git a/libs/apr/dso/aix/dso.c b/libs/apr/dso/aix/dso.c index 25f6262af8..f3449d38da 100644 --- a/libs/apr/dso/aix/dso.c +++ b/libs/apr/dso/aix/dso.c @@ -49,8 +49,8 @@ #include #include #include -#include "apr_arch_dso.h" -#include "apr_portable.h" +#include "fspr_arch_dso.h" +#include "fspr_portable.h" #if APR_HAS_DSO @@ -97,26 +97,26 @@ struct dl_info { * add the basic "wrappers" here. */ -APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **aprdso, - apr_os_dso_handle_t osdso, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_dso_handle_put(fspr_dso_handle_t **aprdso, + fspr_os_dso_handle_t osdso, + fspr_pool_t *pool) { - *aprdso = apr_pcalloc(pool, sizeof **aprdso); + *aprdso = fspr_pcalloc(pool, sizeof **aprdso); (*aprdso)->handle = osdso; (*aprdso)->pool = pool; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *osdso, - apr_dso_handle_t *aprdso) +APR_DECLARE(fspr_status_t) fspr_os_dso_handle_get(fspr_os_dso_handle_t *osdso, + fspr_dso_handle_t *aprdso) { *osdso = aprdso->handle; return APR_SUCCESS; } -static apr_status_t dso_cleanup(void *thedso) +static fspr_status_t dso_cleanup(void *thedso) { - apr_dso_handle_t *dso = thedso; + fspr_dso_handle_t *dso = thedso; if (dso->handle != NULL && dlclose(dso->handle) != 0) return APR_EINIT; @@ -125,12 +125,12 @@ static apr_status_t dso_cleanup(void *thedso) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, - const char *path, apr_pool_t *ctx) +APR_DECLARE(fspr_status_t) fspr_dso_load(fspr_dso_handle_t **res_handle, + const char *path, fspr_pool_t *ctx) { void *os_handle = dlopen((char *)path, RTLD_NOW | RTLD_GLOBAL); - *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); + *res_handle = fspr_pcalloc(ctx, sizeof(*res_handle)); if(os_handle == NULL) { (*res_handle)->errormsg = dlerror(); @@ -141,18 +141,18 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, (*res_handle)->pool = ctx; (*res_handle)->errormsg = NULL; - apr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, apr_pool_cleanup_null); + fspr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, fspr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) +APR_DECLARE(fspr_status_t) fspr_dso_unload(fspr_dso_handle_t *handle) { - return apr_pool_cleanup_run(handle->pool, handle, dso_cleanup); + return fspr_pool_cleanup_run(handle->pool, handle, dso_cleanup); } -APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, - apr_dso_handle_t *handle, +APR_DECLARE(fspr_status_t) fspr_dso_sym(fspr_dso_handle_sym_t *ressym, + fspr_dso_handle_t *handle, const char *symname) { void *retval = dlsym(handle->handle, symname); @@ -166,10 +166,10 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, return APR_SUCCESS; } -APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr_size_t buflen) +APR_DECLARE(const char *) fspr_dso_error(fspr_dso_handle_t *dso, char *buffer, fspr_size_t buflen) { if (dso->errormsg) { - apr_cpystrn(buffer, dso->errormsg, buflen); + fspr_cpystrn(buffer, dso->errormsg, buflen); return dso->errormsg; } return "No Error"; diff --git a/libs/apr/dso/beos/dso.c b/libs/apr/dso/beos/dso.c index 91dd1b4e81..6ca214e865 100644 --- a/libs/apr/dso/beos/dso.c +++ b/libs/apr/dso/beos/dso.c @@ -14,14 +14,14 @@ * limitations under the License. */ -#include "apr_arch_dso.h" -#include "apr_portable.h" +#include "fspr_arch_dso.h" +#include "fspr_portable.h" #if APR_HAS_DSO -static apr_status_t dso_cleanup(void *thedso) +static fspr_status_t dso_cleanup(void *thedso) { - apr_dso_handle_t *dso = thedso; + fspr_dso_handle_t *dso = thedso; if (dso->handle > 0 && unload_add_on(dso->handle) < B_NO_ERROR) return APR_EINIT; @@ -30,12 +30,12 @@ static apr_status_t dso_cleanup(void *thedso) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, - const char *path, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_dso_load(fspr_dso_handle_t **res_handle, + const char *path, fspr_pool_t *pool) { image_id newid = -1; - *res_handle = apr_pcalloc(pool, sizeof(*res_handle)); + *res_handle = fspr_pcalloc(pool, sizeof(*res_handle)); if((newid = load_add_on(path)) < B_NO_ERROR) { (*res_handle)->errormsg = strerror(newid); @@ -45,17 +45,17 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, (*res_handle)->pool = pool; (*res_handle)->handle = newid; - apr_pool_cleanup_register(pool, *res_handle, dso_cleanup, apr_pool_cleanup_null); + fspr_pool_cleanup_register(pool, *res_handle, dso_cleanup, fspr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) +APR_DECLARE(fspr_status_t) fspr_dso_unload(fspr_dso_handle_t *handle) { - return apr_pool_cleanup_run(handle->pool, handle, dso_cleanup); + return fspr_pool_cleanup_run(handle->pool, handle, dso_cleanup); } -APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_handle_t *handle, +APR_DECLARE(fspr_status_t) fspr_dso_sym(fspr_dso_handle_sym_t *ressym, fspr_dso_handle_t *handle, const char *symname) { int err; @@ -72,24 +72,24 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_hand return APR_SUCCESS; } -APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr_size_t buflen) +APR_DECLARE(const char *) fspr_dso_error(fspr_dso_handle_t *dso, char *buffer, fspr_size_t buflen) { strncpy(buffer, strerror(errno), buflen); return buffer; } -APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **aprdso, - apr_os_dso_handle_t osdso, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_dso_handle_put(fspr_dso_handle_t **aprdso, + fspr_os_dso_handle_t osdso, + fspr_pool_t *pool) { - *aprdso = apr_pcalloc(pool, sizeof **aprdso); + *aprdso = fspr_pcalloc(pool, sizeof **aprdso); (*aprdso)->handle = osdso; (*aprdso)->pool = pool; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *osdso, - apr_dso_handle_t *aprdso) +APR_DECLARE(fspr_status_t) fspr_os_dso_handle_get(fspr_os_dso_handle_t *osdso, + fspr_dso_handle_t *aprdso) { *osdso = aprdso->handle; return APR_SUCCESS; diff --git a/libs/apr/dso/netware/dso.c b/libs/apr/dso/netware/dso.c index 4cd2ad611e..effe03eeea 100644 --- a/libs/apr/dso/netware/dso.c +++ b/libs/apr/dso/netware/dso.c @@ -14,33 +14,33 @@ * limitations under the License. */ -#include "apr_arch_dso.h" -#include "apr_strings.h" -#include "apr_portable.h" +#include "fspr_arch_dso.h" +#include "fspr_strings.h" +#include "fspr_portable.h" #include #include -APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **aprdso, - apr_os_dso_handle_t osdso, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_dso_handle_put(fspr_dso_handle_t **aprdso, + fspr_os_dso_handle_t osdso, + fspr_pool_t *pool) { - *aprdso = apr_pcalloc(pool, sizeof **aprdso); + *aprdso = fspr_pcalloc(pool, sizeof **aprdso); (*aprdso)->handle = osdso; (*aprdso)->pool = pool; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *osdso, - apr_dso_handle_t *aprdso) +APR_DECLARE(fspr_status_t) fspr_os_dso_handle_get(fspr_os_dso_handle_t *osdso, + fspr_dso_handle_t *aprdso) { *osdso = aprdso->handle; return APR_SUCCESS; } -static apr_status_t dso_cleanup(void *thedso) +static fspr_status_t dso_cleanup(void *thedso) { - apr_dso_handle_t *dso = thedso; + fspr_dso_handle_t *dso = thedso; sym_list *symbol = NULL; void *NLMHandle = getnlmhandle(); @@ -65,22 +65,22 @@ static apr_status_t dso_cleanup(void *thedso) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, - const char *path, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_dso_load(fspr_dso_handle_t **res_handle, + const char *path, fspr_pool_t *pool) { void *os_handle = NULL; char *fullpath = NULL; - apr_status_t rv; + fspr_status_t rv; - if ((rv = apr_filepath_merge(&fullpath, NULL, path, + if ((rv = fspr_filepath_merge(&fullpath, NULL, path, APR_FILEPATH_NATIVE, pool)) != APR_SUCCESS) { return rv; } os_handle = dlopen(fullpath, RTLD_NOW | RTLD_LOCAL); - *res_handle = apr_pcalloc(pool, sizeof(**res_handle)); + *res_handle = fspr_pcalloc(pool, sizeof(**res_handle)); if(os_handle == NULL) { (*res_handle)->errormsg = dlerror(); @@ -91,20 +91,20 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, (*res_handle)->pool = pool; (*res_handle)->errormsg = NULL; (*res_handle)->symbols = NULL; - (*res_handle)->path = apr_pstrdup(pool, fullpath); + (*res_handle)->path = fspr_pstrdup(pool, fullpath); - apr_pool_cleanup_register(pool, *res_handle, dso_cleanup, apr_pool_cleanup_null); + fspr_pool_cleanup_register(pool, *res_handle, dso_cleanup, fspr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) +APR_DECLARE(fspr_status_t) fspr_dso_unload(fspr_dso_handle_t *handle) { - return apr_pool_cleanup_run(handle->pool, handle, dso_cleanup); + return fspr_pool_cleanup_run(handle->pool, handle, dso_cleanup); } -APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, - apr_dso_handle_t *handle, +APR_DECLARE(fspr_status_t) fspr_dso_sym(fspr_dso_handle_sym_t *ressym, + fspr_dso_handle_t *handle, const char *symname) { sym_list *symbol = NULL; @@ -115,21 +115,21 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, return APR_ESYMNOTFOUND; } - symbol = apr_pcalloc(handle->pool, sizeof(sym_list)); + symbol = fspr_pcalloc(handle->pool, sizeof(sym_list)); symbol->next = handle->symbols; handle->symbols = symbol; - symbol->symbol = apr_pstrdup(handle->pool, symname); + symbol->symbol = fspr_pstrdup(handle->pool, symname); *ressym = retval; return APR_SUCCESS; } -APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buffer, - apr_size_t buflen) +APR_DECLARE(const char *) fspr_dso_error(fspr_dso_handle_t *dso, char *buffer, + fspr_size_t buflen) { if (dso->errormsg) { - apr_cpystrn(buffer, dso->errormsg, buflen); + fspr_cpystrn(buffer, dso->errormsg, buflen); return dso->errormsg; } return "No Error"; diff --git a/libs/apr/dso/os2/dso.c b/libs/apr/dso/os2/dso.c index 1a7f7de838..0cc71842fb 100644 --- a/libs/apr/dso/os2/dso.c +++ b/libs/apr/dso/os2/dso.c @@ -14,17 +14,17 @@ * limitations under the License. */ -#include "apr_arch_dso.h" -#include "apr_strings.h" -#include "apr_portable.h" +#include "fspr_arch_dso.h" +#include "fspr_strings.h" +#include "fspr_portable.h" #include #include #if APR_HAS_DSO -static apr_status_t dso_cleanup(void *thedso) +static fspr_status_t dso_cleanup(void *thedso) { - apr_dso_handle_t *dso = thedso; + fspr_dso_handle_t *dso = thedso; int rc; if (dso->handle == 0) @@ -39,39 +39,39 @@ static apr_status_t dso_cleanup(void *thedso) } -APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) +APR_DECLARE(fspr_status_t) fspr_dso_load(fspr_dso_handle_t **res_handle, const char *path, fspr_pool_t *ctx) { char failed_module[200]; HMODULE handle; int rc; - *res_handle = apr_pcalloc(ctx, sizeof(**res_handle)); + *res_handle = fspr_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_FROM_OS_ERROR(rc); - (*res_handle)->failed_module = apr_pstrdup(ctx, failed_module); + (*res_handle)->failed_module = fspr_pstrdup(ctx, failed_module); return APR_FROM_OS_ERROR(rc); } (*res_handle)->handle = handle; - apr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, apr_pool_cleanup_null); + fspr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, fspr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) +APR_DECLARE(fspr_status_t) fspr_dso_unload(fspr_dso_handle_t *handle) { - return apr_pool_cleanup_run(handle->cont, handle, dso_cleanup); + return fspr_pool_cleanup_run(handle->cont, handle, dso_cleanup); } -APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, - apr_dso_handle_t *handle, +APR_DECLARE(fspr_status_t) fspr_dso_sym(fspr_dso_handle_sym_t *ressym, + fspr_dso_handle_t *handle, const char *symname) { PFN func; @@ -91,10 +91,10 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, -APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr_size_t buflen) +APR_DECLARE(const char *) fspr_dso_error(fspr_dso_handle_t *dso, char *buffer, fspr_size_t buflen) { char message[200]; - apr_strerror(dso->load_error, message, sizeof(message)); + fspr_strerror(dso->load_error, message, sizeof(message)); if (dso->failed_module != NULL) { strcat(message, " ("); @@ -102,17 +102,17 @@ APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr strcat(message, ")"); } - apr_cpystrn(buffer, message, buflen); + fspr_cpystrn(buffer, message, buflen); return buffer; } -APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **aprdso, - apr_os_dso_handle_t osdso, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_dso_handle_put(fspr_dso_handle_t **aprdso, + fspr_os_dso_handle_t osdso, + fspr_pool_t *pool) { - *aprdso = apr_pcalloc(pool, sizeof **aprdso); + *aprdso = fspr_pcalloc(pool, sizeof **aprdso); (*aprdso)->handle = osdso; (*aprdso)->cont = pool; (*aprdso)->load_error = APR_SUCCESS; @@ -122,8 +122,8 @@ APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **aprdso, -APR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *osdso, - apr_dso_handle_t *aprdso) +APR_DECLARE(fspr_status_t) fspr_os_dso_handle_get(fspr_os_dso_handle_t *osdso, + fspr_dso_handle_t *aprdso) { *osdso = aprdso->handle; return APR_SUCCESS; diff --git a/libs/apr/dso/os390/dso.c b/libs/apr/dso/os390/dso.c index 293d0653e7..7c7f9fb832 100644 --- a/libs/apr/dso/os390/dso.c +++ b/libs/apr/dso/os390/dso.c @@ -14,34 +14,34 @@ * limitations under the License. */ -#include "apr_portable.h" -#include "apr_strings.h" -#include "apr_arch_dso.h" +#include "fspr_portable.h" +#include "fspr_strings.h" +#include "fspr_arch_dso.h" #include #include #if APR_HAS_DSO -APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **aprdso, - apr_os_dso_handle_t osdso, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_dso_handle_put(fspr_dso_handle_t **aprdso, + fspr_os_dso_handle_t osdso, + fspr_pool_t *pool) { - *aprdso = apr_pcalloc(pool, sizeof **aprdso); + *aprdso = fspr_pcalloc(pool, sizeof **aprdso); (*aprdso)->handle = osdso; (*aprdso)->pool = pool; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *osdso, - apr_dso_handle_t *aprdso) +APR_DECLARE(fspr_status_t) fspr_os_dso_handle_get(fspr_os_dso_handle_t *osdso, + fspr_dso_handle_t *aprdso) { *osdso = aprdso->handle; return APR_SUCCESS; } -static apr_status_t dso_cleanup(void *thedso) +static fspr_status_t dso_cleanup(void *thedso) { - apr_dso_handle_t *dso = thedso; + fspr_dso_handle_t *dso = thedso; int rc; if (dso->handle == 0) @@ -57,17 +57,17 @@ static apr_status_t dso_cleanup(void *thedso) return errno; } -APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, - const char *path, apr_pool_t *ctx) +APR_DECLARE(fspr_status_t) fspr_dso_load(fspr_dso_handle_t **res_handle, + const char *path, fspr_pool_t *ctx) { dllhandle *handle; int rc; - *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); + *res_handle = fspr_pcalloc(ctx, sizeof(*res_handle)); (*res_handle)->pool = ctx; if ((handle = dllload(path)) != NULL) { (*res_handle)->handle = handle; - apr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, apr_pool_cleanup_null); + fspr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, fspr_pool_cleanup_null); return APR_SUCCESS; } @@ -75,13 +75,13 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, return errno; } -APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) +APR_DECLARE(fspr_status_t) fspr_dso_unload(fspr_dso_handle_t *handle) { - return apr_pool_cleanup_run(handle->pool, handle, dso_cleanup); + return fspr_pool_cleanup_run(handle->pool, handle, dso_cleanup); } -APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, - apr_dso_handle_t *handle, +APR_DECLARE(fspr_status_t) fspr_dso_sym(fspr_dso_handle_sym_t *ressym, + fspr_dso_handle_t *handle, const char *symname) { void *func_ptr; @@ -99,10 +99,10 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, return errno; } -APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *handle, char *buffer, - apr_size_t buflen) +APR_DECLARE(const char *) fspr_dso_error(fspr_dso_handle_t *handle, char *buffer, + fspr_size_t buflen) { - apr_cpystrn(buffer, strerror(handle->failing_errno), buflen); + fspr_cpystrn(buffer, strerror(handle->failing_errno), buflen); return buffer; } diff --git a/libs/apr/dso/unix/dso.c b/libs/apr/dso/unix/dso.c index 15d39d7d19..2e77a19bf5 100644 --- a/libs/apr/dso/unix/dso.c +++ b/libs/apr/dso/unix/dso.c @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "apr_arch_dso.h" -#include "apr_strings.h" -#include "apr_portable.h" +#include "fspr_arch_dso.h" +#include "fspr_strings.h" +#include "fspr_portable.h" #if APR_HAS_DSO @@ -38,26 +38,26 @@ #define DYLD_LIBRARY_HANDLE (void *)-1 #endif -APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **aprdso, - apr_os_dso_handle_t osdso, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_dso_handle_put(fspr_dso_handle_t **aprdso, + fspr_os_dso_handle_t osdso, + fspr_pool_t *pool) { - *aprdso = apr_pcalloc(pool, sizeof **aprdso); + *aprdso = fspr_pcalloc(pool, sizeof **aprdso); (*aprdso)->handle = osdso; (*aprdso)->pool = pool; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *osdso, - apr_dso_handle_t *aprdso) +APR_DECLARE(fspr_status_t) fspr_os_dso_handle_get(fspr_os_dso_handle_t *osdso, + fspr_dso_handle_t *aprdso) { *osdso = aprdso->handle; return APR_SUCCESS; } -static apr_status_t dso_cleanup(void *thedso) +static fspr_status_t dso_cleanup(void *thedso) { - apr_dso_handle_t *dso = thedso; + fspr_dso_handle_t *dso = thedso; if (dso->handle == NULL) return APR_SUCCESS; @@ -77,8 +77,8 @@ static apr_status_t dso_cleanup(void *thedso) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, - const char *path, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_dso_load(fspr_dso_handle_t **res_handle, + const char *path, fspr_pool_t *pool) { #if defined(DSO_USE_SHL) shl_t os_handle = shl_load(path, BIND_IMMEDIATE, 0L); @@ -140,7 +140,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, #endif #endif /* DSO_USE_x */ - *res_handle = apr_pcalloc(pool, sizeof(**res_handle)); + *res_handle = fspr_pcalloc(pool, sizeof(**res_handle)); if(os_handle == NULL) { #if defined(DSO_USE_SHL) @@ -159,18 +159,18 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, (*res_handle)->pool = pool; (*res_handle)->errormsg = NULL; - apr_pool_cleanup_register(pool, *res_handle, dso_cleanup, apr_pool_cleanup_null); + fspr_pool_cleanup_register(pool, *res_handle, dso_cleanup, fspr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) +APR_DECLARE(fspr_status_t) fspr_dso_unload(fspr_dso_handle_t *handle) { - return apr_pool_cleanup_run(handle->pool, handle, dso_cleanup); + return fspr_pool_cleanup_run(handle->pool, handle, dso_cleanup); } -APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, - apr_dso_handle_t *handle, +APR_DECLARE(fspr_status_t) fspr_dso_sym(fspr_dso_handle_sym_t *ressym, + fspr_dso_handle_t *handle, const char *symname) { #if defined(DSO_USE_SHL) @@ -238,11 +238,11 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, #endif /* DSO_USE_x */ } -APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buffer, - apr_size_t buflen) +APR_DECLARE(const char *) fspr_dso_error(fspr_dso_handle_t *dso, char *buffer, + fspr_size_t buflen) { if (dso->errormsg) { - apr_cpystrn(buffer, dso->errormsg, buflen); + fspr_cpystrn(buffer, dso->errormsg, buflen); return dso->errormsg; } return "No Error"; diff --git a/libs/apr/dso/win32/dso.c b/libs/apr/dso/win32/dso.c index d4a689387b..928b88344b 100644 --- a/libs/apr/dso/win32/dso.c +++ b/libs/apr/dso/win32/dso.c @@ -14,48 +14,48 @@ * limitations under the License. */ -#include "apr_arch_dso.h" -#include "apr_strings.h" -#include "apr_private.h" -#include "apr_arch_file_io.h" -#include "apr_arch_utf8.h" +#include "fspr_arch_dso.h" +#include "fspr_strings.h" +#include "fspr_private.h" +#include "fspr_arch_file_io.h" +#include "fspr_arch_utf8.h" #if APR_HAS_DSO -APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **aprdso, - apr_os_dso_handle_t osdso, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_dso_handle_put(fspr_dso_handle_t **aprdso, + fspr_os_dso_handle_t osdso, + fspr_pool_t *pool) { - *aprdso = apr_pcalloc(pool, sizeof **aprdso); + *aprdso = fspr_pcalloc(pool, sizeof **aprdso); (*aprdso)->handle = osdso; (*aprdso)->cont = pool; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *osdso, - apr_dso_handle_t *aprdso) +APR_DECLARE(fspr_status_t) fspr_os_dso_handle_get(fspr_os_dso_handle_t *osdso, + fspr_dso_handle_t *aprdso) { *osdso = aprdso->handle; return APR_SUCCESS; } -static apr_status_t dso_cleanup(void *thedso) +static fspr_status_t dso_cleanup(void *thedso) { - apr_dso_handle_t *dso = thedso; + fspr_dso_handle_t *dso = thedso; if (dso->handle != NULL && !FreeLibrary(dso->handle)) { - return apr_get_os_error(); + return fspr_get_os_error(); } dso->handle = NULL; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, - const char *path, apr_pool_t *ctx) +APR_DECLARE(fspr_status_t) fspr_dso_load(struct fspr_dso_handle_t **res_handle, + const char *path, fspr_pool_t *ctx) { HINSTANCE os_handle; - apr_status_t rv; + fspr_status_t rv; #ifndef _WIN32_WCE UINT em; #endif @@ -63,11 +63,11 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { - apr_wchar_t wpath[APR_PATH_MAX]; + fspr_wchar_t wpath[APR_PATH_MAX]; if ((rv = utf8_to_unicode_path(wpath, sizeof(wpath) - / sizeof(apr_wchar_t), path)) + / sizeof(fspr_wchar_t), path)) != APR_SUCCESS) { - *res_handle = apr_pcalloc(ctx, sizeof(**res_handle)); + *res_handle = fspr_pcalloc(ctx, sizeof(**res_handle)); return ((*res_handle)->load_error = rv); } /* Prevent ugly popups from killing our app */ @@ -78,7 +78,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, if (!os_handle) os_handle = LoadLibraryExW(wpath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); if (!os_handle) - rv = apr_get_os_error(); + rv = fspr_get_os_error(); #ifndef _WIN32_WCE SetErrorMode(em); #endif @@ -94,7 +94,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, * LoadLibrary in the MS PSDK also reveals that it -explicitly- states * that backslashes must be used for the LoadLibrary family of calls. */ - apr_cpystrn(fspec, path, sizeof(fspec)); + fspr_cpystrn(fspec, path, sizeof(fspec)); while ((p = strchr(p, '/')) != NULL) *p = '\\'; @@ -104,14 +104,14 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, if (!os_handle) os_handle = LoadLibraryEx(path, NULL, 0); if (!os_handle) - rv = apr_get_os_error(); + rv = fspr_get_os_error(); else rv = APR_SUCCESS; SetErrorMode(em); } #endif - *res_handle = apr_pcalloc(ctx, sizeof(**res_handle)); + *res_handle = fspr_pcalloc(ctx, sizeof(**res_handle)); (*res_handle)->cont = ctx; if (rv) { @@ -121,27 +121,27 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, (*res_handle)->handle = (void*)os_handle; (*res_handle)->load_error = APR_SUCCESS; - apr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, apr_pool_cleanup_null); + fspr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, fspr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_dso_unload(struct apr_dso_handle_t *handle) +APR_DECLARE(fspr_status_t) fspr_dso_unload(struct fspr_dso_handle_t *handle) { - return apr_pool_cleanup_run(handle->cont, handle, dso_cleanup); + return fspr_pool_cleanup_run(handle->cont, handle, dso_cleanup); } -APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, - struct apr_dso_handle_t *handle, +APR_DECLARE(fspr_status_t) fspr_dso_sym(fspr_dso_handle_sym_t *ressym, + struct fspr_dso_handle_t *handle, const char *symname) { #ifdef _WIN32_WCE - apr_size_t symlen = strlen(symname) + 1; - apr_size_t wsymlen = 256; - apr_wchar_t wsymname[256]; - apr_status_t rv; + fspr_size_t symlen = strlen(symname) + 1; + fspr_size_t wsymlen = 256; + fspr_wchar_t wsymname[256]; + fspr_status_t rv; - rv = apr_conv_utf8_to_ucs2(wsymname, &wsymlen, symname, &symlen); + rv = fspr_conv_utf8_to_ucs2(wsymname, &wsymlen, symname, &symlen); if (rv != APR_SUCCESS) { return rv; } @@ -149,19 +149,19 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, return APR_ENAMETOOLONG; } - *ressym = (apr_dso_handle_sym_t)GetProcAddressW(handle->handle, wsymname); + *ressym = (fspr_dso_handle_sym_t)GetProcAddressW(handle->handle, wsymname); #else - *ressym = (apr_dso_handle_sym_t)GetProcAddress(handle->handle, symname); + *ressym = (fspr_dso_handle_sym_t)GetProcAddress(handle->handle, symname); #endif if (!*ressym) { - return apr_get_os_error(); + return fspr_get_os_error(); } return APR_SUCCESS; } -APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buf, apr_size_t bufsize) +APR_DECLARE(const char *) fspr_dso_error(fspr_dso_handle_t *dso, char *buf, fspr_size_t bufsize) { - return apr_strerror(dso->load_error, buf, bufsize); + return fspr_strerror(dso->load_error, buf, bufsize); } #endif diff --git a/libs/apr/file_io/netware/filestat.c b/libs/apr/file_io/netware/filestat.c index a3f60e57df..5b58ef5b50 100644 --- a/libs/apr/file_io/netware/filestat.c +++ b/libs/apr/file_io/netware/filestat.c @@ -14,15 +14,15 @@ * limitations under the License. */ -#include "apr_arch_file_io.h" +#include "fspr_arch_file_io.h" #include "fsio.h" #include "nks/dirio.h" -#include "apr_file_io.h" -#include "apr_general.h" -#include "apr_strings.h" -#include "apr_errno.h" -#include "apr_hash.h" -#include "apr_thread_rwlock.h" +#include "fspr_file_io.h" +#include "fspr_general.h" +#include "fspr_strings.h" +#include "fspr_errno.h" +#include "fspr_hash.h" +#include "fspr_thread_rwlock.h" #ifdef HAVE_UTIME_H #include @@ -30,9 +30,9 @@ #define APR_HAS_PSA -static apr_filetype_e filetype_from_mode(mode_t mode) +static fspr_filetype_e filetype_from_mode(mode_t mode) { - apr_filetype_e type = APR_NOFILE; + fspr_filetype_e type = APR_NOFILE; if (S_ISREG(mode)) type = APR_REG; @@ -53,12 +53,12 @@ static apr_filetype_e filetype_from_mode(mode_t mode) return type; } -static void fill_out_finfo(apr_finfo_t *finfo, struct stat *info, - apr_int32_t wanted) +static void fill_out_finfo(fspr_finfo_t *finfo, struct stat *info, + fspr_int32_t wanted) { finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_NLINK | APR_FINFO_OWNER | APR_FINFO_PROT; - finfo->protection = apr_unix_mode2perms(info->st_mode); + finfo->protection = fspr_unix_mode2perms(info->st_mode); finfo->filetype = filetype_from_mode(info->st_mode); finfo->user = info->st_uid; finfo->group = info->st_gid; @@ -66,9 +66,9 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct stat *info, finfo->inode = info->st_ino; finfo->device = info->st_dev; finfo->nlink = info->st_nlink; - apr_time_ansi_put(&finfo->atime, info->st_atime.tv_sec); - apr_time_ansi_put(&finfo->mtime, info->st_mtime.tv_sec); - apr_time_ansi_put(&finfo->ctime, info->st_ctime.tv_sec); + fspr_time_ansi_put(&finfo->atime, info->st_atime.tv_sec); + fspr_time_ansi_put(&finfo->mtime, info->st_mtime.tv_sec); + fspr_time_ansi_put(&finfo->ctime, info->st_ctime.tv_sec); /* ### needs to be revisited * if (wanted & APR_FINFO_CSIZE) { * finfo->csize = info->st_blocks * 512; @@ -77,14 +77,14 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct stat *info, */ } -APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, - apr_int32_t wanted, - apr_file_t *thefile) +APR_DECLARE(fspr_status_t) fspr_file_info_get(fspr_finfo_t *finfo, + fspr_int32_t wanted, + fspr_file_t *thefile) { struct stat info; if (thefile->buffered) { - apr_status_t rv = apr_file_flush(thefile); + fspr_status_t rv = fspr_file_flush(thefile); if (rv != APR_SUCCESS) return rv; } @@ -100,30 +100,30 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, } } -APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, - apr_fileperms_t perms) +APR_DECLARE(fspr_status_t) fspr_file_perms_set(const char *fname, + fspr_fileperms_t perms) { - mode_t mode = apr_unix_perms2mode(perms); + mode_t mode = fspr_unix_perms2mode(perms); if (chmod(fname, mode) == -1) return errno; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, - apr_fileattrs_t attributes, - apr_fileattrs_t attr_mask, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_file_attrs_set(const char *fname, + fspr_fileattrs_t attributes, + fspr_fileattrs_t attr_mask, + fspr_pool_t *pool) { - apr_status_t status; - apr_finfo_t finfo; + fspr_status_t status; + fspr_finfo_t finfo; /* Don't do anything if we can't handle the requested attributes */ if (!(attr_mask & (APR_FILE_ATTR_READONLY | APR_FILE_ATTR_EXECUTABLE))) return APR_SUCCESS; - status = apr_stat(&finfo, fname, APR_FINFO_PROT, pool); + status = fspr_stat(&finfo, fname, APR_FINFO_PROT, pool); if (status) return status; @@ -162,21 +162,21 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, } } - return apr_file_perms_set(fname, finfo.protection); + return fspr_file_perms_set(fname, finfo.protection); } #ifndef APR_HAS_PSA -static apr_status_t stat_cache_cleanup(void *data) +static fspr_status_t stat_cache_cleanup(void *data) { - apr_pool_t *p = (apr_pool_t *)getGlobalPool(); - apr_hash_index_t *hi; - apr_hash_t *statCache = (apr_hash_t*)data; + fspr_pool_t *p = (fspr_pool_t *)getGlobalPool(); + fspr_hash_index_t *hi; + fspr_hash_t *statCache = (fspr_hash_t*)data; char *key; - apr_ssize_t keylen; + fspr_ssize_t keylen; NXPathCtx_t pathctx; - for (hi = apr_hash_first(p, statCache); hi; hi = apr_hash_next(hi)) { - apr_hash_this(hi, (const void**)&key, &keylen, (void**)&pathctx); + for (hi = fspr_hash_first(p, statCache); hi; hi = fspr_hash_next(hi)) { + fspr_hash_this(hi, (const void**)&key, &keylen, (void**)&pathctx); if (pathctx) { NXFreePathContext(pathctx); @@ -186,11 +186,11 @@ static apr_status_t stat_cache_cleanup(void *data) return APR_SUCCESS; } -int cstat (NXPathCtx_t ctx, char *path, struct stat *buf, unsigned long requestmap, apr_pool_t *p) +int cstat (NXPathCtx_t ctx, char *path, struct stat *buf, unsigned long requestmap, fspr_pool_t *p) { - apr_pool_t *gPool = (apr_pool_t *)getGlobalPool(); - apr_hash_t *statCache = NULL; - apr_thread_rwlock_t *rwlock = NULL; + fspr_pool_t *gPool = (fspr_pool_t *)getGlobalPool(); + fspr_hash_t *statCache = NULL; + fspr_thread_rwlock_t *rwlock = NULL; NXPathCtx_t pathctx = 0; char *ptr = NULL, *tr; @@ -205,22 +205,22 @@ int cstat (NXPathCtx_t ctx, char *path, struct stat *buf, unsigned long requestm if (!gPool) { char poolname[50]; - if (apr_pool_create(&gPool, NULL) != APR_SUCCESS) { + if (fspr_pool_create(&gPool, NULL) != APR_SUCCESS) { return getstat(ctx, path, buf, requestmap); } setGlobalPool(gPool); - apr_pool_tag(gPool, apr_pstrdup(gPool, "cstat_mem_pool")); + fspr_pool_tag(gPool, fspr_pstrdup(gPool, "cstat_mem_pool")); - statCache = apr_hash_make(gPool); - apr_pool_userdata_set ((void*)statCache, "STAT_CACHE", stat_cache_cleanup, gPool); + statCache = fspr_hash_make(gPool); + fspr_pool_userdata_set ((void*)statCache, "STAT_CACHE", stat_cache_cleanup, gPool); - apr_thread_rwlock_create(&rwlock, gPool); - apr_pool_userdata_set ((void*)rwlock, "STAT_CACHE_LOCK", apr_pool_cleanup_null, gPool); + fspr_thread_rwlock_create(&rwlock, gPool); + fspr_pool_userdata_set ((void*)rwlock, "STAT_CACHE_LOCK", fspr_pool_cleanup_null, gPool); } else { - apr_pool_userdata_get((void**)&statCache, "STAT_CACHE", gPool); - apr_pool_userdata_get((void**)&rwlock, "STAT_CACHE_LOCK", gPool); + fspr_pool_userdata_get((void**)&statCache, "STAT_CACHE", gPool); + fspr_pool_userdata_get((void**)&rwlock, "STAT_CACHE_LOCK", gPool); } if (!gPool || !statCache || !rwlock) { @@ -239,7 +239,7 @@ int cstat (NXPathCtx_t ctx, char *path, struct stat *buf, unsigned long requestm } if (ptr) { - ppath = apr_pstrndup (p, path, len); + ppath = fspr_pstrndup (p, path, len); strlwr(ppath); if (ptr[1] != '\0') { ptr++; @@ -249,19 +249,19 @@ int cstat (NXPathCtx_t ctx, char *path, struct stat *buf, unsigned long requestm slash, we need to make sure we stat the current directory with a dot */ if (((*ptr == '/') || (*ptr == '\\')) && (*(ptr+1) == '\0')) { - pinfo = apr_pstrdup (p, "."); + pinfo = fspr_pstrdup (p, "."); } else { - pinfo = apr_pstrdup (p, ptr); + pinfo = fspr_pstrdup (p, ptr); } } /* If we have a statCache then try to pull the information from the cache. Otherwise just stat the file and return.*/ if (statCache) { - apr_thread_rwlock_rdlock(rwlock); - pathctx = (NXPathCtx_t) apr_hash_get(statCache, ppath, APR_HASH_KEY_STRING); - apr_thread_rwlock_unlock(rwlock); + fspr_thread_rwlock_rdlock(rwlock); + pathctx = (NXPathCtx_t) fspr_hash_get(statCache, ppath, APR_HASH_KEY_STRING); + fspr_thread_rwlock_unlock(rwlock); if (pathctx) { return getstat(pathctx, pinfo, buf, requestmap); } @@ -270,9 +270,9 @@ int cstat (NXPathCtx_t ctx, char *path, struct stat *buf, unsigned long requestm err = NXCreatePathContext(0, ppath, 0, NULL, &pathctx); if (!err) { - apr_thread_rwlock_wrlock(rwlock); - apr_hash_set(statCache, apr_pstrdup(gPool,ppath) , APR_HASH_KEY_STRING, (void*)pathctx); - apr_thread_rwlock_unlock(rwlock); + fspr_thread_rwlock_wrlock(rwlock); + fspr_hash_set(statCache, fspr_pstrdup(gPool,ppath) , APR_HASH_KEY_STRING, (void*)pathctx); + fspr_thread_rwlock_unlock(rwlock); return getstat(pathctx, pinfo, buf, requestmap); } } @@ -282,9 +282,9 @@ int cstat (NXPathCtx_t ctx, char *path, struct stat *buf, unsigned long requestm } #endif -APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, +APR_DECLARE(fspr_status_t) fspr_stat(fspr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *pool) + fspr_int32_t wanted, fspr_pool_t *pool) { struct stat info; int srv; @@ -305,7 +305,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, if (wanted & APR_FINFO_LINK) wanted &= ~APR_FINFO_LINK; if (wanted & APR_FINFO_NAME) { - finfo->name = apr_pstrdup(pool, info.st_name); + finfo->name = fspr_pstrdup(pool, info.st_name); finfo->valid |= APR_FINFO_NAME; } return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS; @@ -345,14 +345,14 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, } } -APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, - apr_time_t mtime, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_file_mtime_set(const char *fname, + fspr_time_t mtime, + fspr_pool_t *pool) { - apr_status_t status; - apr_finfo_t finfo; + fspr_status_t status; + fspr_finfo_t finfo; - status = apr_stat(&finfo, fname, APR_FINFO_ATIME, pool); + status = fspr_stat(&finfo, fname, APR_FINFO_ATIME, pool); if (status) { return status; } @@ -361,10 +361,10 @@ APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, { struct timeval tvp[2]; - tvp[0].tv_sec = apr_time_sec(finfo.atime); - tvp[0].tv_usec = apr_time_usec(finfo.atime); - tvp[1].tv_sec = apr_time_sec(mtime); - tvp[1].tv_usec = apr_time_usec(mtime); + tvp[0].tv_sec = fspr_time_sec(finfo.atime); + tvp[0].tv_usec = fspr_time_usec(finfo.atime); + tvp[1].tv_sec = fspr_time_sec(mtime); + tvp[1].tv_usec = fspr_time_usec(mtime); if (utimes(fname, tvp) == -1) { return errno; diff --git a/libs/apr/file_io/netware/filesys.c b/libs/apr/file_io/netware/filesys.c index 05c44cecd5..f366f4644b 100644 --- a/libs/apr/file_io/netware/filesys.c +++ b/libs/apr/file_io/netware/filesys.c @@ -14,21 +14,21 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_arch_file_io.h" -#include "apr_strings.h" +#include "fspr.h" +#include "fspr_arch_file_io.h" +#include "fspr_strings.h" -apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p) +fspr_status_t filepath_root_case(char **rootpath, char *root, fspr_pool_t *p) { /* See the Windows code to figure out what to do here. It probably checks to make sure that the root exists and case it correctly according to the file system. */ - *rootpath = apr_pstrdup(p, root); + *rootpath = fspr_pstrdup(p, root); return APR_SUCCESS; } -apr_status_t filepath_has_drive(const char *rootpath, int only, apr_pool_t *p) +fspr_status_t filepath_has_drive(const char *rootpath, int only, fspr_pool_t *p) { char *s; @@ -46,7 +46,7 @@ apr_status_t filepath_has_drive(const char *rootpath, int only, apr_pool_t *p) return 0; } -apr_status_t filepath_compare_drive(const char *path1, const char *path2, apr_pool_t *p) +fspr_status_t filepath_compare_drive(const char *path1, const char *path2, fspr_pool_t *p) { char *s1, *s2; @@ -64,8 +64,8 @@ apr_status_t filepath_compare_drive(const char *path1, const char *path2, apr_po return -1; } -APR_DECLARE(apr_status_t) apr_filepath_get(char **rootpath, apr_int32_t flags, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_filepath_get(char **rootpath, fspr_int32_t flags, + fspr_pool_t *p) { char path[APR_PATH_MAX]; char *ptr; @@ -85,7 +85,7 @@ APR_DECLARE(apr_status_t) apr_filepath_get(char **rootpath, apr_int32_t flags, if (*ptr == ':') { ptr = path; } - *rootpath = apr_pstrdup(p, ptr); + *rootpath = fspr_pstrdup(p, ptr); if (!(flags & APR_FILEPATH_NATIVE)) { for (ptr = *rootpath; *ptr; ++ptr) { if (*ptr == '\\') @@ -95,8 +95,8 @@ APR_DECLARE(apr_status_t) apr_filepath_get(char **rootpath, apr_int32_t flags, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_filepath_set(const char *rootpath, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_filepath_set(const char *rootpath, + fspr_pool_t *p) { if (chdir2(rootpath) != 0) return errno; diff --git a/libs/apr/file_io/netware/flock.c b/libs/apr/file_io/netware/flock.c index c083a0ed40..084d4d9bb7 100644 --- a/libs/apr/file_io/netware/flock.c +++ b/libs/apr/file_io/netware/flock.c @@ -15,10 +15,10 @@ */ #include -#include "apr_arch_file_io.h" +#include "fspr_arch_file_io.h" -apr_status_t apr_file_lock(apr_file_t *thefile, int type) +fspr_status_t fspr_file_lock(fspr_file_t *thefile, int type) { int fc; @@ -30,7 +30,7 @@ apr_status_t apr_file_lock(apr_file_t *thefile, int type) return APR_SUCCESS; } -apr_status_t apr_file_unlock(apr_file_t *thefile) +fspr_status_t fspr_file_unlock(fspr_file_t *thefile) { if(NXFileRangeUnlock(thefile->filedes,NX_RANGE_LOCK_CANCEL,0 , 0) == -1) return errno; diff --git a/libs/apr/file_io/netware/mktemp.c b/libs/apr/file_io/netware/mktemp.c index c5ffebd20d..8ffa947404 100644 --- a/libs/apr/file_io/netware/mktemp.c +++ b/libs/apr/file_io/netware/mktemp.c @@ -14,18 +14,18 @@ * limitations under the License. */ -#include "apr_private.h" -#include "apr_file_io.h" /* prototype of apr_mkstemp() */ -#include "apr_strings.h" /* prototype of apr_mkstemp() */ -#include "apr_arch_file_io.h" /* prototype of apr_mkstemp() */ -#include "apr_portable.h" /* for apr_os_file_put() */ +#include "fspr_private.h" +#include "fspr_file_io.h" /* prototype of fspr_mkstemp() */ +#include "fspr_strings.h" /* prototype of fspr_mkstemp() */ +#include "fspr_arch_file_io.h" /* prototype of fspr_mkstemp() */ +#include "fspr_portable.h" /* for fspr_os_file_put() */ #include /* for mkstemp() - Single Unix */ -APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_int32_t flags, apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_file_mktemp(fspr_file_t **fp, char *template, fspr_int32_t flags, fspr_pool_t *p) { int fd; - apr_status_t rv; + fspr_status_t rv; flags = (!flags) ? APR_CREATE | APR_READ | APR_WRITE | APR_DELONCLOSE : flags & ~APR_EXCL; @@ -38,11 +38,11 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i * Otherwise file locking will not allow the file to be shared. */ close(fd); - if ((rv = apr_file_open(fp, template, flags|APR_FILE_NOCLEANUP, + if ((rv = fspr_file_open(fp, template, flags|APR_FILE_NOCLEANUP, APR_UREAD | APR_UWRITE, p)) == APR_SUCCESS) { - apr_pool_cleanup_register((*fp)->pool, (void *)(*fp), - apr_unix_file_cleanup, apr_unix_file_cleanup); + fspr_pool_cleanup_register((*fp)->pool, (void *)(*fp), + fspr_unix_file_cleanup, fspr_unix_file_cleanup); } return rv; diff --git a/libs/apr/file_io/netware/pipe.c b/libs/apr/file_io/netware/pipe.c index 4b6b826887..70ed4b8e12 100644 --- a/libs/apr/file_io/netware/pipe.c +++ b/libs/apr/file_io/netware/pipe.c @@ -18,12 +18,12 @@ #include #include -#include "apr_arch_file_io.h" -#include "apr_strings.h" -#include "apr_portable.h" -#include "apr_arch_inherit.h" +#include "fspr_arch_file_io.h" +#include "fspr_strings.h" +#include "fspr_portable.h" +#include "fspr_arch_inherit.h" -static apr_status_t pipeblock(apr_file_t *thepipe) +static fspr_status_t pipeblock(fspr_file_t *thepipe) { #ifdef USE_FLAGS int err; @@ -46,7 +46,7 @@ static apr_status_t pipeblock(apr_file_t *thepipe) return APR_SUCCESS; } -static apr_status_t pipenonblock(apr_file_t *thepipe) +static fspr_status_t pipenonblock(fspr_file_t *thepipe) { #ifdef USE_FLAGS int err; @@ -70,7 +70,7 @@ static apr_status_t pipenonblock(apr_file_t *thepipe) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout) +APR_DECLARE(fspr_status_t) fspr_file_pipe_timeout_set(fspr_file_t *thepipe, fspr_interval_time_t timeout) { if (thepipe->is_pipe == 1) { thepipe->timeout = timeout; @@ -89,7 +89,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_int return APR_EINVAL; } -APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout) +APR_DECLARE(fspr_status_t) fspr_file_pipe_timeout_get(fspr_file_t *thepipe, fspr_interval_time_t *timeout) { if (thepipe->is_pipe == 1) { *timeout = thepipe->timeout; @@ -98,14 +98,14 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_int return APR_EINVAL; } -APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file, - apr_os_file_t *thefile, +APR_DECLARE(fspr_status_t) fspr_os_pipe_put_ex(fspr_file_t **file, + fspr_os_file_t *thefile, int register_cleanup, - apr_pool_t *pool) + fspr_pool_t *pool) { int *dafile = thefile; - (*file) = apr_pcalloc(pool, sizeof(apr_file_t)); + (*file) = fspr_pcalloc(pool, sizeof(fspr_file_t)); (*file)->pool = pool; (*file)->eof_hit = 0; (*file)->is_pipe = 1; @@ -121,21 +121,21 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file, (*file)->thlock = NULL; #endif if (register_cleanup) { - apr_pool_cleanup_register((*file)->pool, (void *)(*file), - apr_unix_file_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register((*file)->pool, (void *)(*file), + fspr_unix_file_cleanup, + fspr_pool_cleanup_null); } return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, - apr_os_file_t *thefile, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_pipe_put(fspr_file_t **file, + fspr_os_file_t *thefile, + fspr_pool_t *pool) { - return apr_os_pipe_put_ex(file, thefile, 0, pool); + return fspr_os_pipe_put_ex(file, thefile, 0, pool); } -APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_file_pipe_create(fspr_file_t **in, fspr_file_t **out, fspr_pool_t *pool) { int filedes[2]; int err; @@ -144,8 +144,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out return errno; } - (*in) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); - (*out) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); + (*in) = (fspr_file_t *)fspr_pcalloc(pool, sizeof(fspr_file_t)); + (*out) = (fspr_file_t *)fspr_pcalloc(pool, sizeof(fspr_file_t)); (*in)->pool = (*out)->pool = pool; @@ -166,19 +166,19 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*in)->ungetchar = -1; (*in)->thlock = (*out)->thlock = NULL; - (void) apr_pollset_create(&(*in)->pollset, 1, pool, 0); - (void) apr_pollset_create(&(*out)->pollset, 1, pool, 0); + (void) fspr_pollset_create(&(*in)->pollset, 1, pool, 0); + (void) fspr_pollset_create(&(*out)->pollset, 1, pool, 0); - apr_pool_cleanup_register((*in)->pool, (void *)(*in), apr_unix_file_cleanup, - apr_pool_cleanup_null); - apr_pool_cleanup_register((*out)->pool, (void *)(*out), apr_unix_file_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register((*in)->pool, (void *)(*in), fspr_unix_file_cleanup, + fspr_pool_cleanup_null); + fspr_pool_cleanup_register((*out)->pool, (void *)(*out), fspr_unix_file_cleanup, + fspr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, - apr_fileperms_t perm, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_file_namedpipe_create(const char *filename, + fspr_fileperms_t perm, fspr_pool_t *pool) { return APR_ENOTIMPL; } diff --git a/libs/apr/file_io/os2/dir.c b/libs/apr/file_io/os2/dir.c index 3b08355f56..f237d21514 100644 --- a/libs/apr/file_io/os2/dir.c +++ b/libs/apr/file_io/os2/dir.c @@ -14,30 +14,30 @@ * limitations under the License. */ -#include "apr_arch_file_io.h" -#include "apr_file_io.h" -#include "apr_lib.h" -#include "apr_strings.h" -#include "apr_portable.h" +#include "fspr_arch_file_io.h" +#include "fspr_file_io.h" +#include "fspr_lib.h" +#include "fspr_strings.h" +#include "fspr_portable.h" #include -static apr_status_t dir_cleanup(void *thedir) +static fspr_status_t dir_cleanup(void *thedir) { - apr_dir_t *dir = thedir; - return apr_dir_close(dir); + fspr_dir_t *dir = thedir; + return fspr_dir_close(dir); } -APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_dir_open(fspr_dir_t **new, const char *dirname, fspr_pool_t *pool) { - apr_dir_t *thedir = (apr_dir_t *)apr_palloc(pool, sizeof(apr_dir_t)); + fspr_dir_t *thedir = (fspr_dir_t *)fspr_palloc(pool, sizeof(fspr_dir_t)); if (thedir == NULL) return APR_ENOMEM; thedir->pool = pool; - thedir->dirname = apr_pstrdup(pool, dirname); + thedir->dirname = fspr_pstrdup(pool, dirname); if (thedir->dirname == NULL) return APR_ENOMEM; @@ -45,13 +45,13 @@ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, apr thedir->handle = 0; thedir->validentry = FALSE; *new = thedir; - apr_pool_cleanup_register(pool, thedir, dir_cleanup, apr_pool_cleanup_null); + fspr_pool_cleanup_register(pool, thedir, dir_cleanup, fspr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_dir_close(apr_dir_t *thedir) +APR_DECLARE(fspr_status_t) fspr_dir_close(fspr_dir_t *thedir) { int rv = 0; @@ -68,15 +68,15 @@ APR_DECLARE(apr_status_t) apr_dir_close(apr_dir_t *thedir) -APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, - apr_dir_t *thedir) +APR_DECLARE(fspr_status_t) fspr_dir_read(fspr_finfo_t *finfo, fspr_int32_t wanted, + fspr_dir_t *thedir) { int rv; ULONG entries = 1; if (thedir->handle == 0) { thedir->handle = HDIR_CREATE; - rv = DosFindFirst(apr_pstrcat(thedir->pool, thedir->dirname, "/*", NULL), &thedir->handle, + rv = DosFindFirst(fspr_pstrcat(thedir->pool, thedir->dirname, "/*", NULL), &thedir->handle, FILE_ARCHIVED|FILE_DIRECTORY|FILE_SYSTEM|FILE_HIDDEN|FILE_READONLY, &thedir->entry, sizeof(thedir->entry), &entries, FIL_STANDARD); } else { @@ -98,11 +98,11 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, /* Only directories & regular files show up in directory listings */ finfo->filetype = (thedir->entry.attrFile & FILE_DIRECTORY) ? APR_DIR : APR_REG; - apr_os2_time_to_apr_time(&finfo->mtime, thedir->entry.fdateLastWrite, + fspr_os2_time_to_fspr_time(&finfo->mtime, thedir->entry.fdateLastWrite, thedir->entry.ftimeLastWrite); - apr_os2_time_to_apr_time(&finfo->atime, thedir->entry.fdateLastAccess, + fspr_os2_time_to_fspr_time(&finfo->atime, thedir->entry.fdateLastAccess, thedir->entry.ftimeLastAccess); - apr_os2_time_to_apr_time(&finfo->ctime, thedir->entry.fdateCreation, + fspr_os2_time_to_fspr_time(&finfo->ctime, thedir->entry.fdateCreation, thedir->entry.ftimeCreation); finfo->name = thedir->entry.achName; @@ -123,28 +123,28 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, -APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir) +APR_DECLARE(fspr_status_t) fspr_dir_rewind(fspr_dir_t *thedir) { - return apr_dir_close(thedir); + return fspr_dir_close(thedir); } -APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_dir_make(const char *path, fspr_fileperms_t perm, fspr_pool_t *pool) { return APR_FROM_OS_ERROR(DosCreateDir(path, NULL)); } -APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_dir_remove(const char *path, fspr_pool_t *pool) { return APR_FROM_OS_ERROR(DosDeleteDir(path)); } -APR_DECLARE(apr_status_t) apr_os_dir_get(apr_os_dir_t **thedir, apr_dir_t *dir) +APR_DECLARE(fspr_status_t) fspr_os_dir_get(fspr_os_dir_t **thedir, fspr_dir_t *dir) { if (dir == NULL) { return APR_ENODIR; @@ -155,11 +155,11 @@ APR_DECLARE(apr_status_t) apr_os_dir_get(apr_os_dir_t **thedir, apr_dir_t *dir) -APR_DECLARE(apr_status_t) apr_os_dir_put(apr_dir_t **dir, apr_os_dir_t *thedir, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_dir_put(fspr_dir_t **dir, fspr_os_dir_t *thedir, + fspr_pool_t *pool) { if ((*dir) == NULL) { - (*dir) = (apr_dir_t *)apr_pcalloc(pool, sizeof(apr_dir_t)); + (*dir) = (fspr_dir_t *)fspr_pcalloc(pool, sizeof(fspr_dir_t)); (*dir)->pool = pool; } (*dir)->handle = *thedir; diff --git a/libs/apr/file_io/os2/dir_make_recurse.c b/libs/apr/file_io/os2/dir_make_recurse.c index 1f645b7dda..fde99ace7a 100644 --- a/libs/apr/file_io/os2/dir_make_recurse.c +++ b/libs/apr/file_io/os2/dir_make_recurse.c @@ -14,27 +14,27 @@ * limitations under the License. */ -#include "apr_file_io.h" -#include "apr_lib.h" -#include "apr_strings.h" +#include "fspr_file_io.h" +#include "fspr_lib.h" +#include "fspr_strings.h" #include #define IS_SEP(c) (c == '/' || c == '\\') /* Remove trailing separators that don't affect the meaning of PATH. */ -static const char *path_canonicalize(const char *path, apr_pool_t *pool) +static const char *path_canonicalize(const char *path, fspr_pool_t *pool) { /* At some point this could eliminate redundant components. For * now, it just makes sure there is no trailing slash. */ - apr_size_t len = strlen(path); - apr_size_t orig_len = len; + fspr_size_t len = strlen(path); + fspr_size_t orig_len = len; while ((len > 0) && IS_SEP(path[len - 1])) { len--; } if (len != orig_len) { - return apr_pstrndup(pool, path, len); + return fspr_pstrndup(pool, path, len); } else { return path; @@ -44,7 +44,7 @@ static const char *path_canonicalize(const char *path, apr_pool_t *pool) /* Remove one component off the end of PATH. */ -static char *path_remove_last_component(const char *path, apr_pool_t *pool) +static char *path_remove_last_component(const char *path, fspr_pool_t *pool) { const char *newpath = path_canonicalize(path, pool); int i; @@ -55,32 +55,32 @@ static char *path_remove_last_component(const char *path, apr_pool_t *pool) } } - return apr_pstrndup(pool, path, (i < 0) ? 0 : i); + return fspr_pstrndup(pool, path, (i < 0) ? 0 : i); } -apr_status_t apr_dir_make_recursive(const char *path, apr_fileperms_t perm, - apr_pool_t *pool) +fspr_status_t fspr_dir_make_recursive(const char *path, fspr_fileperms_t perm, + fspr_pool_t *pool) { - apr_status_t apr_err = APR_SUCCESS; + fspr_status_t fspr_err = APR_SUCCESS; - apr_err = apr_dir_make(path, perm, pool); /* Try to make PATH right out */ + fspr_err = fspr_dir_make(path, perm, pool); /* Try to make PATH right out */ - if (APR_STATUS_IS_EEXIST(apr_err)) { /* It's OK if PATH exists */ + if (APR_STATUS_IS_EEXIST(fspr_err)) { /* It's OK if PATH exists */ return APR_SUCCESS; } - if (APR_STATUS_IS_ENOENT(apr_err)) { /* Missing an intermediate dir */ + if (APR_STATUS_IS_ENOENT(fspr_err)) { /* Missing an intermediate dir */ char *dir; dir = path_remove_last_component(path, pool); - apr_err = apr_dir_make_recursive(dir, perm, pool); + fspr_err = fspr_dir_make_recursive(dir, perm, pool); - if (!apr_err) { - apr_err = apr_dir_make(path, perm, pool); + if (!fspr_err) { + fspr_err = fspr_dir_make(path, perm, pool); } } - return apr_err; + return fspr_err; } diff --git a/libs/apr/file_io/os2/filedup.c b/libs/apr/file_io/os2/filedup.c index 72b86e2faa..c19ade0e6e 100644 --- a/libs/apr/file_io/os2/filedup.c +++ b/libs/apr/file_io/os2/filedup.c @@ -14,20 +14,20 @@ * limitations under the License. */ -#include "apr_arch_file_io.h" -#include "apr_file_io.h" -#include "apr_lib.h" -#include "apr_strings.h" +#include "fspr_arch_file_io.h" +#include "fspr_file_io.h" +#include "fspr_lib.h" +#include "fspr_strings.h" #include -#include "apr_arch_inherit.h" +#include "fspr_arch_inherit.h" -static apr_status_t file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) +static fspr_status_t file_dup(fspr_file_t **new_file, fspr_file_t *old_file, fspr_pool_t *p) { int rv; - apr_file_t *dup_file; + fspr_file_t *dup_file; if (*new_file == NULL) { - dup_file = (apr_file_t *)apr_palloc(p, sizeof(apr_file_t)); + dup_file = (fspr_file_t *)fspr_palloc(p, sizeof(fspr_file_t)); if (dup_file == NULL) { return APR_ENOMEM; @@ -45,7 +45,7 @@ static apr_status_t file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_po return APR_FROM_OS_ERROR(rv); } - dup_file->fname = apr_pstrdup(dup_file->pool, old_file->fname); + dup_file->fname = fspr_pstrdup(dup_file->pool, old_file->fname); dup_file->buffered = old_file->buffered; dup_file->isopen = old_file->isopen; dup_file->flags = old_file->flags & ~APR_INHERIT; @@ -53,8 +53,8 @@ static apr_status_t file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_po dup_file->pipe = old_file->pipe; if (*new_file == NULL) { - apr_pool_cleanup_register(dup_file->pool, dup_file, apr_file_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register(dup_file->pool, dup_file, fspr_file_cleanup, + fspr_pool_cleanup_null); *new_file = dup_file; } @@ -63,10 +63,10 @@ static apr_status_t file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_po -APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_file_dup(fspr_file_t **new_file, fspr_file_t *old_file, fspr_pool_t *p) { if (*new_file) { - apr_file_close(*new_file); + fspr_file_close(*new_file); (*new_file)->filedes = -1; } @@ -75,23 +75,23 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, apr_file_t *old_fi -APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, apr_file_t *old_file, apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_file_dup2(fspr_file_t *new_file, fspr_file_t *old_file, fspr_pool_t *p) { return file_dup(&new_file, old_file, p); } -APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, - apr_file_t *old_file, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_file_setaside(fspr_file_t **new_file, + fspr_file_t *old_file, + fspr_pool_t *p) { - *new_file = (apr_file_t *)apr_palloc(p, sizeof(apr_file_t)); - memcpy(*new_file, old_file, sizeof(apr_file_t)); + *new_file = (fspr_file_t *)fspr_palloc(p, sizeof(fspr_file_t)); + memcpy(*new_file, old_file, sizeof(fspr_file_t)); (*new_file)->pool = p; if (old_file->buffered) { - (*new_file)->buffer = apr_palloc(p, APR_FILE_BUFSIZE); + (*new_file)->buffer = fspr_palloc(p, APR_FILE_BUFSIZE); if (old_file->direction == 1) { memcpy((*new_file)->buffer, old_file->buffer, old_file->bufpos); @@ -101,25 +101,25 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, } if (old_file->mutex) { - apr_thread_mutex_create(&((*new_file)->mutex), + fspr_thread_mutex_create(&((*new_file)->mutex), APR_THREAD_MUTEX_DEFAULT, p); - apr_thread_mutex_destroy(old_file->mutex); + fspr_thread_mutex_destroy(old_file->mutex); } } if (old_file->fname) { - (*new_file)->fname = apr_pstrdup(p, old_file->fname); + (*new_file)->fname = fspr_pstrdup(p, old_file->fname); } if (!(old_file->flags & APR_FILE_NOCLEANUP)) { - apr_pool_cleanup_register(p, (void *)(*new_file), - apr_file_cleanup, - apr_file_cleanup); + fspr_pool_cleanup_register(p, (void *)(*new_file), + fspr_file_cleanup, + fspr_file_cleanup); } old_file->filedes = -1; - apr_pool_cleanup_kill(old_file->pool, (void *)old_file, - apr_file_cleanup); + fspr_pool_cleanup_kill(old_file->pool, (void *)old_file, + fspr_file_cleanup); return APR_SUCCESS; } diff --git a/libs/apr/file_io/os2/filestat.c b/libs/apr/file_io/os2/filestat.c index f31c7c1b50..dd9b0f8e78 100644 --- a/libs/apr/file_io/os2/filestat.c +++ b/libs/apr/file_io/os2/filestat.c @@ -16,14 +16,14 @@ #define INCL_DOS #define INCL_DOSERRORS -#include "apr_arch_file_io.h" -#include "apr_file_io.h" -#include "apr_lib.h" +#include "fspr_arch_file_io.h" +#include "fspr_file_io.h" +#include "fspr_lib.h" #include -#include "apr_strings.h" +#include "fspr_strings.h" -static void FS3_to_finfo(apr_finfo_t *finfo, FILESTATUS3 *fstatus) +static void FS3_to_finfo(fspr_finfo_t *finfo, FILESTATUS3 *fstatus) { finfo->protection = (fstatus->attrFile & FILE_READONLY) ? 0x555 : 0x777; @@ -39,11 +39,11 @@ static void FS3_to_finfo(apr_finfo_t *finfo, FILESTATUS3 *fstatus) finfo->device = 0; finfo->size = fstatus->cbFile; finfo->csize = fstatus->cbFileAlloc; - apr_os2_time_to_apr_time(&finfo->atime, fstatus->fdateLastAccess, + fspr_os2_time_to_fspr_time(&finfo->atime, fstatus->fdateLastAccess, fstatus->ftimeLastAccess ); - apr_os2_time_to_apr_time(&finfo->mtime, fstatus->fdateLastWrite, + fspr_os2_time_to_fspr_time(&finfo->mtime, fstatus->fdateLastWrite, fstatus->ftimeLastWrite ); - apr_os2_time_to_apr_time(&finfo->ctime, fstatus->fdateCreation, + fspr_os2_time_to_fspr_time(&finfo->ctime, fstatus->fdateCreation, fstatus->ftimeCreation ); finfo->valid = APR_FINFO_TYPE | APR_FINFO_PROT | APR_FINFO_SIZE | APR_FINFO_CSIZE | APR_FINFO_MTIME @@ -52,7 +52,7 @@ static void FS3_to_finfo(apr_finfo_t *finfo, FILESTATUS3 *fstatus) -static apr_status_t handle_type(apr_filetype_e *ftype, HFILE file) +static fspr_status_t handle_type(fspr_filetype_e *ftype, HFILE file) { ULONG filetype, fileattr, rc; @@ -86,15 +86,15 @@ static apr_status_t handle_type(apr_filetype_e *ftype, HFILE file) -APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, - apr_file_t *thefile) +APR_DECLARE(fspr_status_t) fspr_file_info_get(fspr_finfo_t *finfo, fspr_int32_t wanted, + fspr_file_t *thefile) { ULONG rc; FILESTATUS3 fstatus; if (thefile->isopen) { if (thefile->buffered) { - apr_status_t rv = apr_file_flush(thefile); + fspr_status_t rv = fspr_file_flush(thefile); if (rv != APR_SUCCESS) { return rv; @@ -124,14 +124,14 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t want return APR_FROM_OS_ERROR(rc); } -APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, apr_fileperms_t perms) +APR_DECLARE(fspr_status_t) fspr_file_perms_set(const char *fname, fspr_fileperms_t perms) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *cont) +APR_DECLARE(fspr_status_t) fspr_stat(fspr_finfo_t *finfo, const char *fname, + fspr_int32_t wanted, fspr_pool_t *cont) { ULONG rc; FILESTATUS3 fstatus; @@ -153,18 +153,18 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, FILE_DIRECTORY|FILE_HIDDEN|FILE_SYSTEM|FILE_ARCHIVED, &ffb, sizeof(ffb), &count, FIL_STANDARD); if (rc == 0 && count == 1) { - finfo->name = apr_pstrdup(cont, ffb.achName); + finfo->name = fspr_pstrdup(cont, ffb.achName); finfo->valid |= APR_FINFO_NAME; } } } else if (rc == ERROR_INVALID_ACCESS) { - memset(finfo, 0, sizeof(apr_finfo_t)); + memset(finfo, 0, sizeof(fspr_finfo_t)); finfo->valid = APR_FINFO_TYPE | APR_FINFO_PROT; finfo->protection = 0666; finfo->filetype = APR_CHR; if (wanted & APR_FINFO_NAME) { - finfo->name = apr_pstrdup(cont, fname); + finfo->name = fspr_pstrdup(cont, fname); finfo->valid |= APR_FINFO_NAME; } } else { @@ -176,10 +176,10 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, -APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, - apr_fileattrs_t attributes, - apr_fileattrs_t attr_mask, - apr_pool_t *cont) +APR_DECLARE(fspr_status_t) fspr_file_attrs_set(const char *fname, + fspr_fileattrs_t attributes, + fspr_fileattrs_t attr_mask, + fspr_pool_t *cont) { FILESTATUS3 fs3; ULONG rc; @@ -221,9 +221,9 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, /* ### Somebody please write this! */ -APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, - apr_time_t mtime, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_file_mtime_set(const char *fname, + fspr_time_t mtime, + fspr_pool_t *pool) { FILESTATUS3 fs3; ULONG rc; @@ -233,7 +233,7 @@ APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, return APR_FROM_OS_ERROR(rc); } - apr_apr_time_to_os2_time(&fs3.fdateLastWrite, &fs3.ftimeLastWrite, mtime); + fspr_fspr_time_to_os2_time(&fs3.fdateLastWrite, &fs3.ftimeLastWrite, mtime); rc = DosSetPathInfo(fname, FIL_STANDARD, &fs3, sizeof(fs3), 0); return APR_FROM_OS_ERROR(rc); diff --git a/libs/apr/file_io/os2/filesys.c b/libs/apr/file_io/os2/filesys.c index ae43bc0a0f..c2fbb9d219 100644 --- a/libs/apr/file_io/os2/filesys.c +++ b/libs/apr/file_io/os2/filesys.c @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_arch_file_io.h" -#include "apr_strings.h" -#include "apr_lib.h" +#include "fspr.h" +#include "fspr_arch_file_io.h" +#include "fspr_strings.h" +#include "fspr_lib.h" #include /* OS/2 Exceptions: @@ -52,9 +52,9 @@ const char c_is_fnchar[256] = #define IS_SLASH(c) (c == '/' || c == '\\') -apr_status_t filepath_root_test(char *path, apr_pool_t *p) +fspr_status_t filepath_root_test(char *path, fspr_pool_t *p) { - char drive = apr_toupper(path[0]); + char drive = fspr_toupper(path[0]); if (drive >= 'A' && drive <= 'Z' && path[1] == ':' && IS_SLASH(path[2])) return APR_SUCCESS; @@ -63,8 +63,8 @@ apr_status_t filepath_root_test(char *path, apr_pool_t *p) } -apr_status_t filepath_drive_get(char **rootpath, char drive, - apr_int32_t flags, apr_pool_t *p) +fspr_status_t filepath_drive_get(char **rootpath, char drive, + fspr_int32_t flags, fspr_pool_t *p) { char path[APR_PATH_MAX]; char *pos; @@ -75,7 +75,7 @@ apr_status_t filepath_drive_get(char **rootpath, char drive, path[1] = ':'; path[2] = '/'; - rc = DosQueryCurrentDir(apr_toupper(drive) - 'A', path+3, &bufsize); + rc = DosQueryCurrentDir(fspr_toupper(drive) - 'A', path+3, &bufsize); if (rc) { return APR_FROM_OS_ERROR(rc); @@ -88,16 +88,16 @@ apr_status_t filepath_drive_get(char **rootpath, char drive, } } - *rootpath = apr_pstrdup(p, path); + *rootpath = fspr_pstrdup(p, path); return APR_SUCCESS; } -apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p) +fspr_status_t filepath_root_case(char **rootpath, char *root, fspr_pool_t *p) { - if (root[0] && apr_islower(root[0]) && root[1] == ':') { - *rootpath = apr_pstrdup(p, root); - (*rootpath)[0] = apr_toupper((*rootpath)[0]); + if (root[0] && fspr_islower(root[0]) && root[1] == ':') { + *rootpath = fspr_pstrdup(p, root); + (*rootpath)[0] = fspr_toupper((*rootpath)[0]); } else { *rootpath = root; @@ -106,8 +106,8 @@ apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p) } -APR_DECLARE(apr_status_t) apr_filepath_get(char **defpath, apr_int32_t flags, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_filepath_get(char **defpath, fspr_int32_t flags, + fspr_pool_t *p) { char path[APR_PATH_MAX]; ULONG drive; @@ -120,7 +120,7 @@ APR_DECLARE(apr_status_t) apr_filepath_get(char **defpath, apr_int32_t flags, strcpy(path+1, ":\\"); rv = DosQueryCurrentDir(drive, path+3, &pathlen); - *defpath = apr_pstrdup(p, path); + *defpath = fspr_pstrdup(p, path); if (!(flags & APR_FILEPATH_NATIVE)) { for (pos=*defpath; *pos; pos++) { @@ -134,12 +134,12 @@ APR_DECLARE(apr_status_t) apr_filepath_get(char **defpath, apr_int32_t flags, -APR_DECLARE(apr_status_t) apr_filepath_set(const char *path, apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_filepath_set(const char *path, fspr_pool_t *p) { ULONG rv = 0; if (path[1] == ':') - rv = DosSetDefaultDisk(apr_toupper(path[0]) - '@'); + rv = DosSetDefaultDisk(fspr_toupper(path[0]) - '@'); if (rv == 0) rv = DosSetCurrentDir(path); diff --git a/libs/apr/file_io/os2/flock.c b/libs/apr/file_io/os2/flock.c index ec94022081..6499589825 100644 --- a/libs/apr/file_io/os2/flock.c +++ b/libs/apr/file_io/os2/flock.c @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "apr_arch_file_io.h" +#include "fspr_arch_file_io.h" -APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) +APR_DECLARE(fspr_status_t) fspr_file_lock(fspr_file_t *thefile, int type) { FILELOCK lockrange = { 0, 0x7fffffff }; ULONG rc; @@ -27,7 +27,7 @@ APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) return APR_FROM_OS_ERROR(rc); } -APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile) +APR_DECLARE(fspr_status_t) fspr_file_unlock(fspr_file_t *thefile) { FILELOCK unlockrange = { 0, 0x7fffffff }; ULONG rc; diff --git a/libs/apr/file_io/os2/maperrorcode.c b/libs/apr/file_io/os2/maperrorcode.c index 282338bba0..2982eea0a6 100644 --- a/libs/apr/file_io/os2/maperrorcode.c +++ b/libs/apr/file_io/os2/maperrorcode.c @@ -15,11 +15,11 @@ */ #define INCL_DOSERRORS -#include "apr_arch_file_io.h" -#include "apr_file_io.h" +#include "fspr_arch_file_io.h" +#include "fspr_file_io.h" #include #include -#include "apr_errno.h" +#include "fspr_errno.h" static int errormap[][2] = { { NO_ERROR, APR_SUCCESS }, @@ -75,7 +75,7 @@ static int errormap[][2] = { #define MAPSIZE (sizeof(errormap)/sizeof(errormap[0])) -int apr_canonical_error(apr_status_t err) +int fspr_canonical_error(fspr_status_t err) { int rv = -1, index; @@ -89,7 +89,7 @@ int apr_canonical_error(apr_status_t err) if (index -apr_status_t apr_file_cleanup(void *thefile) +fspr_status_t fspr_file_cleanup(void *thefile) { - apr_file_t *file = thefile; - return apr_file_close(file); + fspr_file_t *file = thefile; + return fspr_file_close(file); } -APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_file_open(fspr_file_t **new, const char *fname, fspr_int32_t flag, fspr_fileperms_t perm, fspr_pool_t *pool) { int oflags = 0; int mflags = OPEN_FLAGS_FAIL_ON_ERROR|OPEN_SHARE_DENYNONE; int rv; ULONG action; - apr_file_t *dafile = (apr_file_t *)apr_palloc(pool, sizeof(apr_file_t)); + fspr_file_t *dafile = (fspr_file_t *)fspr_palloc(pool, sizeof(fspr_file_t)); dafile->pool = pool; dafile->isopen = FALSE; @@ -59,8 +59,8 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr dafile->buffered = (flag & APR_BUFFERED) > 0; if (dafile->buffered) { - dafile->buffer = apr_palloc(pool, APR_FILE_BUFSIZE); - rv = apr_thread_mutex_create(&dafile->mutex, 0, pool); + dafile->buffer = fspr_palloc(pool, APR_FILE_BUFSIZE); + rv = fspr_thread_mutex_create(&dafile->mutex, 0, pool); if (rv) return rv; @@ -97,7 +97,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr return APR_FROM_OS_ERROR(rv); dafile->isopen = TRUE; - dafile->fname = apr_pstrdup(pool, fname); + dafile->fname = fspr_pstrdup(pool, fname); dafile->filePtr = 0; dafile->bufpos = 0; dafile->dataRead = 0; @@ -105,7 +105,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr dafile->pipe = FALSE; if (!(flag & APR_FILE_NOCLEANUP)) { - apr_pool_cleanup_register(dafile->pool, dafile, apr_file_cleanup, apr_file_cleanup); + fspr_pool_cleanup_register(dafile->pool, dafile, fspr_file_cleanup, fspr_file_cleanup); } *new = dafile; @@ -114,13 +114,13 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr -APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) +APR_DECLARE(fspr_status_t) fspr_file_close(fspr_file_t *file) { ULONG rc; - apr_status_t status; + fspr_status_t status; if (file && file->isopen) { - apr_file_flush(file); + fspr_file_flush(file); rc = DosClose(file->filedes); if (rc == 0) { @@ -136,14 +136,14 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) } if (file->buffered) - apr_thread_mutex_destroy(file->mutex); + fspr_thread_mutex_destroy(file->mutex); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_file_remove(const char *path, fspr_pool_t *pool) { ULONG rc = DosDelete(path); return APR_FROM_OS_ERROR(rc); @@ -151,8 +151,8 @@ APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *pool) -APR_DECLARE(apr_status_t) apr_file_rename(const char *from_path, const char *to_path, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_file_rename(const char *from_path, const char *to_path, + fspr_pool_t *p) { ULONG rc = DosMove(from_path, to_path); @@ -169,7 +169,7 @@ APR_DECLARE(apr_status_t) apr_file_rename(const char *from_path, const char *to_ -APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, apr_file_t *file) +APR_DECLARE(fspr_status_t) fspr_os_file_get(fspr_os_file_t *thefile, fspr_file_t *file) { *thefile = file->filedes; return APR_SUCCESS; @@ -177,11 +177,11 @@ APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, apr_file_t *fi -APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, apr_int32_t flags, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_file_put(fspr_file_t **file, fspr_os_file_t *thefile, fspr_int32_t flags, fspr_pool_t *pool) { - apr_os_file_t *dafile = thefile; + fspr_os_file_t *dafile = thefile; - (*file) = apr_palloc(pool, sizeof(apr_file_t)); + (*file) = fspr_palloc(pool, sizeof(fspr_file_t)); (*file)->pool = pool; (*file)->filedes = *dafile; (*file)->isopen = TRUE; @@ -191,10 +191,10 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thef (*file)->buffered = (flags & APR_BUFFERED) > 0; if ((*file)->buffered) { - apr_status_t rv; + fspr_status_t rv; - (*file)->buffer = apr_palloc(pool, APR_FILE_BUFSIZE); - rv = apr_thread_mutex_create(&(*file)->mutex, 0, pool); + (*file)->buffer = fspr_palloc(pool, APR_FILE_BUFSIZE); + rv = fspr_thread_mutex_create(&(*file)->mutex, 0, pool); if (rv) return rv; @@ -204,7 +204,7 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thef } -APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr) +APR_DECLARE(fspr_status_t) fspr_file_eof(fspr_file_t *fptr) { if (!fptr->isopen || fptr->eof_hit == 1) { return APR_EOF; @@ -213,33 +213,33 @@ APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr) } -APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_file_open_stderr(fspr_file_t **thefile, fspr_pool_t *pool) { - apr_os_file_t fd = 2; + fspr_os_file_t fd = 2; - return apr_os_file_put(thefile, &fd, 0, pool); + return fspr_os_file_put(thefile, &fd, 0, pool); } -APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_file_open_stdout(fspr_file_t **thefile, fspr_pool_t *pool) { - apr_os_file_t fd = 1; + fspr_os_file_t fd = 1; - return apr_os_file_put(thefile, &fd, 0, pool); + return fspr_os_file_put(thefile, &fd, 0, pool); } -APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_file_open_stdin(fspr_file_t **thefile, fspr_pool_t *pool) { - apr_os_file_t fd = 0; + fspr_os_file_t fd = 0; - return apr_os_file_put(thefile, &fd, 0, pool); + return fspr_os_file_put(thefile, &fd, 0, pool); } APR_POOL_IMPLEMENT_ACCESSOR(file); -APR_IMPLEMENT_INHERIT_SET(file, flags, pool, apr_file_cleanup) +APR_IMPLEMENT_INHERIT_SET(file, flags, pool, fspr_file_cleanup) -APR_IMPLEMENT_INHERIT_UNSET(file, flags, pool, apr_file_cleanup) +APR_IMPLEMENT_INHERIT_UNSET(file, flags, pool, fspr_file_cleanup) diff --git a/libs/apr/file_io/os2/pipe.c b/libs/apr/file_io/os2/pipe.c index ee2b2b004e..007977aafc 100644 --- a/libs/apr/file_io/os2/pipe.c +++ b/libs/apr/file_io/os2/pipe.c @@ -15,16 +15,16 @@ */ #define INCL_DOSERRORS -#include "apr_arch_file_io.h" -#include "apr_file_io.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_strings.h" -#include "apr_portable.h" +#include "fspr_arch_file_io.h" +#include "fspr_file_io.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_strings.h" +#include "fspr_portable.h" #include #include -APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_file_pipe_create(fspr_file_t **in, fspr_file_t **out, fspr_pool_t *pool) { ULONG filedes[2]; ULONG rc, action; @@ -54,7 +54,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out return APR_FROM_OS_ERROR(rc); } - (*in) = (apr_file_t *)apr_palloc(pool, sizeof(apr_file_t)); + (*in) = (fspr_file_t *)fspr_palloc(pool, sizeof(fspr_file_t)); rc = DosCreateEventSem(NULL, &(*in)->pipeSem, DC_SEM_SHARED, FALSE); if (rc) { @@ -78,33 +78,33 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out (*in)->pool = pool; (*in)->filedes = filedes[0]; - (*in)->fname = apr_pstrdup(pool, pipename); + (*in)->fname = fspr_pstrdup(pool, pipename); (*in)->isopen = TRUE; (*in)->buffered = FALSE; (*in)->flags = 0; (*in)->pipe = 1; (*in)->timeout = -1; (*in)->blocking = BLK_ON; - apr_pool_cleanup_register(pool, *in, apr_file_cleanup, apr_pool_cleanup_null); + fspr_pool_cleanup_register(pool, *in, fspr_file_cleanup, fspr_pool_cleanup_null); - (*out) = (apr_file_t *)apr_palloc(pool, sizeof(apr_file_t)); + (*out) = (fspr_file_t *)fspr_palloc(pool, sizeof(fspr_file_t)); (*out)->pool = pool; (*out)->filedes = filedes[1]; - (*out)->fname = apr_pstrdup(pool, pipename); + (*out)->fname = fspr_pstrdup(pool, pipename); (*out)->isopen = TRUE; (*out)->buffered = FALSE; (*out)->flags = 0; (*out)->pipe = 1; (*out)->timeout = -1; (*out)->blocking = BLK_ON; - apr_pool_cleanup_register(pool, *out, apr_file_cleanup, apr_pool_cleanup_null); + fspr_pool_cleanup_register(pool, *out, fspr_file_cleanup, fspr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, apr_fileperms_t perm, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_file_namedpipe_create(const char *filename, fspr_fileperms_t perm, fspr_pool_t *pool) { /* Not yet implemented, interface not suitable */ return APR_ENOTIMPL; @@ -112,7 +112,7 @@ APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, apr_fi -APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout) +APR_DECLARE(fspr_status_t) fspr_file_pipe_timeout_set(fspr_file_t *thepipe, fspr_interval_time_t timeout) { if (thepipe->pipe == 1) { thepipe->timeout = timeout; @@ -135,7 +135,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_int -APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout) +APR_DECLARE(fspr_status_t) fspr_file_pipe_timeout_get(fspr_file_t *thepipe, fspr_interval_time_t *timeout) { if (thepipe->pipe == 1) { *timeout = thepipe->timeout; @@ -146,12 +146,12 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_int -APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file, - apr_os_file_t *thefile, +APR_DECLARE(fspr_status_t) fspr_os_pipe_put_ex(fspr_file_t **file, + fspr_os_file_t *thefile, int register_cleanup, - apr_pool_t *pool) + fspr_pool_t *pool) { - (*file) = apr_pcalloc(pool, sizeof(apr_file_t)); + (*file) = fspr_pcalloc(pool, sizeof(fspr_file_t)); (*file)->pool = pool; (*file)->isopen = TRUE; (*file)->pipe = 1; @@ -160,8 +160,8 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file, (*file)->filedes = *thefile; if (register_cleanup) { - apr_pool_cleanup_register(pool, *file, apr_file_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register(pool, *file, fspr_file_cleanup, + fspr_pool_cleanup_null); } return APR_SUCCESS; @@ -169,9 +169,9 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file, -APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, - apr_os_file_t *thefile, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_pipe_put(fspr_file_t **file, + fspr_os_file_t *thefile, + fspr_pool_t *pool) { - return apr_os_pipe_put_ex(file, thefile, 0, pool); + return fspr_os_pipe_put_ex(file, thefile, 0, pool); } diff --git a/libs/apr/file_io/os2/readwrite.c b/libs/apr/file_io/os2/readwrite.c index f25a4210d6..90d786755e 100644 --- a/libs/apr/file_io/os2/readwrite.c +++ b/libs/apr/file_io/os2/readwrite.c @@ -17,14 +17,14 @@ #define INCL_DOS #define INCL_DOSERRORS -#include "apr_arch_file_io.h" -#include "apr_file_io.h" -#include "apr_lib.h" -#include "apr_strings.h" +#include "fspr_arch_file_io.h" +#include "fspr_file_io.h" +#include "fspr_lib.h" +#include "fspr_strings.h" #include -APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) +APR_DECLARE(fspr_status_t) fspr_file_read(fspr_file_t *thefile, void *buf, fspr_size_t *nbytes) { ULONG rc = 0; ULONG bytesread; @@ -39,13 +39,13 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size ULONG blocksize; ULONG size = *nbytes; - apr_thread_mutex_lock(thefile->mutex); + fspr_thread_mutex_lock(thefile->mutex); if (thefile->direction == 1) { - int rv = apr_file_flush(thefile); + int rv = fspr_file_flush(thefile); if (rv != APR_SUCCESS) { - apr_thread_mutex_unlock(thefile->mutex); + fspr_thread_mutex_unlock(thefile->mutex); return rv; } @@ -79,7 +79,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size } *nbytes = rc == 0 ? pos - (char *)buf : 0; - apr_thread_mutex_unlock(thefile->mutex); + fspr_thread_mutex_unlock(thefile->mutex); if (*nbytes == 0 && rc == 0 && thefile->eof_hit) { return APR_EOF; @@ -122,7 +122,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size -APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) +APR_DECLARE(fspr_status_t) fspr_file_write(fspr_file_t *thefile, const void *buf, fspr_size_t *nbytes) { ULONG rc = 0; ULONG byteswritten; @@ -137,7 +137,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a int blocksize; int size = *nbytes; - apr_thread_mutex_lock(thefile->mutex); + fspr_thread_mutex_lock(thefile->mutex); if ( thefile->direction == 0 ) { // Position file pointer for writing at the offset we are logically reading from @@ -150,7 +150,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a while (rc == 0 && size > 0) { if (thefile->bufpos == APR_FILE_BUFSIZE) // write buffer is full - rc = apr_file_flush(thefile); + rc = fspr_file_flush(thefile); blocksize = size > APR_FILE_BUFSIZE - thefile->bufpos ? APR_FILE_BUFSIZE - thefile->bufpos : size; memcpy(thefile->buffer + thefile->bufpos, pos, blocksize); @@ -159,7 +159,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a size -= blocksize; } - apr_thread_mutex_unlock(thefile->mutex); + fspr_thread_mutex_unlock(thefile->mutex); return APR_FROM_OS_ERROR(rc); } else { if (thefile->flags & APR_APPEND) { @@ -194,7 +194,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a #ifdef HAVE_WRITEV -APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) +APR_DECLARE(fspr_status_t) fspr_file_writev(fspr_file_t *thefile, const struct iovec *vec, fspr_size_t nvec, fspr_size_t *nbytes) { int bytes; if ((bytes = writev(thefile->filedes, vec, nvec)) < 0) { @@ -210,7 +210,7 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iove -APR_DECLARE(apr_status_t) apr_file_putc(char ch, apr_file_t *thefile) +APR_DECLARE(fspr_status_t) fspr_file_putc(char ch, fspr_file_t *thefile) { ULONG rc; ULONG byteswritten; @@ -230,24 +230,24 @@ APR_DECLARE(apr_status_t) apr_file_putc(char ch, apr_file_t *thefile) -APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile) +APR_DECLARE(fspr_status_t) fspr_file_ungetc(char ch, fspr_file_t *thefile) { - apr_off_t offset = -1; - return apr_file_seek(thefile, APR_CUR, &offset); + fspr_off_t offset = -1; + return fspr_file_seek(thefile, APR_CUR, &offset); } -APR_DECLARE(apr_status_t) apr_file_getc(char *ch, apr_file_t *thefile) +APR_DECLARE(fspr_status_t) fspr_file_getc(char *ch, fspr_file_t *thefile) { ULONG rc; - apr_size_t bytesread; + fspr_size_t bytesread; if (!thefile->isopen) { return APR_EBADF; } bytesread = 1; - rc = apr_file_read(thefile, ch, &bytesread); + rc = fspr_file_read(thefile, ch, &bytesread); if (rc) { return rc; @@ -263,16 +263,16 @@ APR_DECLARE(apr_status_t) apr_file_getc(char *ch, apr_file_t *thefile) -APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile) +APR_DECLARE(fspr_status_t) fspr_file_puts(const char *str, fspr_file_t *thefile) { - apr_size_t len; + fspr_size_t len; len = strlen(str); - return apr_file_write(thefile, str, &len); + return fspr_file_write(thefile, str, &len); } -APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile) +APR_DECLARE(fspr_status_t) fspr_file_flush(fspr_file_t *thefile) { if (thefile->buffered) { ULONG written = 0; @@ -296,15 +296,15 @@ APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile) } -APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) +APR_DECLARE(fspr_status_t) fspr_file_gets(char *str, int len, fspr_file_t *thefile) { - apr_size_t readlen; - apr_status_t rv = APR_SUCCESS; + fspr_size_t readlen; + fspr_status_t rv = APR_SUCCESS; int i; for (i = 0; i < len-1; i++) { readlen = 1; - rv = apr_file_read(thefile, str+i, &readlen); + rv = fspr_file_read(thefile, str+i, &readlen); if (rv != APR_SUCCESS) { break; @@ -332,7 +332,7 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) -APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, +APR_DECLARE_NONSTD(int) fspr_file_printf(fspr_file_t *fptr, const char *format, ...) { int cc; @@ -345,8 +345,8 @@ APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, return 0; } va_start(ap, format); - len = apr_vsnprintf(buf, HUGE_STRING_LEN, format, ap); - cc = apr_file_puts(buf, fptr); + len = fspr_vsnprintf(buf, HUGE_STRING_LEN, format, ap); + cc = fspr_file_puts(buf, fptr); va_end(ap); free(buf); return (cc == APR_SUCCESS) ? len : -1; @@ -354,7 +354,7 @@ APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, -apr_status_t apr_file_check_read(apr_file_t *fd) +fspr_status_t fspr_file_check_read(fspr_file_t *fd) { int rc; diff --git a/libs/apr/file_io/os2/seek.c b/libs/apr/file_io/os2/seek.c index 6fdfe8e826..61420de7cc 100644 --- a/libs/apr/file_io/os2/seek.c +++ b/libs/apr/file_io/os2/seek.c @@ -14,20 +14,20 @@ * limitations under the License. */ -#include "apr_arch_file_io.h" -#include "apr_file_io.h" -#include "apr_lib.h" +#include "fspr_arch_file_io.h" +#include "fspr_file_io.h" +#include "fspr_lib.h" #include #include -static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) +static fspr_status_t setptr(fspr_file_t *thefile, unsigned long pos ) { long newbufpos; ULONG rc; if (thefile->direction == 1) { - apr_status_t rv = apr_file_flush(thefile); + fspr_status_t rv = fspr_file_flush(thefile); if (rv != APR_SUCCESS) { return rv; @@ -52,7 +52,7 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos ) -APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) +APR_DECLARE(fspr_status_t) fspr_file_seek(fspr_file_t *thefile, fspr_seek_where_t where, fspr_off_t *offset) { if (!thefile->isopen) { return APR_EBADF; @@ -62,7 +62,7 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh if (thefile->buffered) { int rc = EINVAL; - apr_finfo_t finfo; + fspr_finfo_t finfo; switch (where) { case APR_SET: @@ -74,7 +74,7 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh break; case APR_END: - rc = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); + rc = fspr_file_info_get(&finfo, APR_FINFO_NORM, thefile); if (rc == APR_SUCCESS) rc = setptr(thefile, finfo.size + *offset); break; @@ -103,7 +103,7 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh -APR_DECLARE(apr_status_t) apr_file_trunc(apr_file_t *fp, apr_off_t offset) +APR_DECLARE(fspr_status_t) fspr_file_trunc(fspr_file_t *fp, fspr_off_t offset) { int rc = DosSetFileSize(fp->filedes, offset); diff --git a/libs/apr/file_io/unix/copy.c b/libs/apr/file_io/unix/copy.c index 113a1081bd..df5b1fec7f 100644 --- a/libs/apr/file_io/unix/copy.c +++ b/libs/apr/file_io/unix/copy.c @@ -14,30 +14,30 @@ * limitations under the License. */ -#include "apr_arch_file_io.h" -#include "apr_file_io.h" +#include "fspr_arch_file_io.h" +#include "fspr_file_io.h" -static apr_status_t apr_file_transfer_contents(const char *from_path, +static fspr_status_t fspr_file_transfer_contents(const char *from_path, const char *to_path, - apr_int32_t flags, - apr_fileperms_t to_perms, - apr_pool_t *pool) + fspr_int32_t flags, + fspr_fileperms_t to_perms, + fspr_pool_t *pool) { - apr_file_t *s, *d; - apr_status_t status; - apr_finfo_t finfo; - apr_fileperms_t perms; + fspr_file_t *s, *d; + fspr_status_t status; + fspr_finfo_t finfo; + fspr_fileperms_t perms; /* Open source file. */ - status = apr_file_open(&s, from_path, APR_READ, APR_OS_DEFAULT, pool); + status = fspr_file_open(&s, from_path, APR_READ, APR_OS_DEFAULT, pool); if (status) return status; /* Maybe get its permissions. */ if (to_perms == APR_FILE_SOURCE_PERMS) { - status = apr_file_info_get(&finfo, APR_FINFO_PROT, s); + status = fspr_file_info_get(&finfo, APR_FINFO_PROT, s); if (status != APR_SUCCESS && status != APR_INCOMPLETE) { - apr_file_close(s); /* toss any error */ + fspr_file_close(s); /* toss any error */ return status; } perms = finfo.protection; @@ -46,66 +46,66 @@ static apr_status_t apr_file_transfer_contents(const char *from_path, perms = to_perms; /* Open dest file. */ - status = apr_file_open(&d, to_path, flags, perms, pool); + status = fspr_file_open(&d, to_path, flags, perms, pool); if (status) { - apr_file_close(s); /* toss any error */ + fspr_file_close(s); /* toss any error */ return status; } /* Copy bytes till the cows come home. */ while (1) { char buf[BUFSIZ]; - apr_size_t bytes_this_time = sizeof(buf); - apr_status_t read_err; - apr_status_t write_err; + fspr_size_t bytes_this_time = sizeof(buf); + fspr_status_t read_err; + fspr_status_t write_err; /* Read 'em. */ - read_err = apr_file_read(s, buf, &bytes_this_time); + read_err = fspr_file_read(s, buf, &bytes_this_time); if (read_err && !APR_STATUS_IS_EOF(read_err)) { - apr_file_close(s); /* toss any error */ - apr_file_close(d); /* toss any error */ + fspr_file_close(s); /* toss any error */ + fspr_file_close(d); /* toss any error */ return read_err; } /* Write 'em. */ - write_err = apr_file_write_full(d, buf, bytes_this_time, NULL); + write_err = fspr_file_write_full(d, buf, bytes_this_time, NULL); if (write_err) { - apr_file_close(s); /* toss any error */ - apr_file_close(d); /* toss any error */ + fspr_file_close(s); /* toss any error */ + fspr_file_close(d); /* toss any error */ return write_err; } if (read_err && APR_STATUS_IS_EOF(read_err)) { - status = apr_file_close(s); + status = fspr_file_close(s); if (status) { - apr_file_close(d); /* toss any error */ + fspr_file_close(d); /* toss any error */ return status; } /* return the results of this close: an error, or success */ - return apr_file_close(d); + return fspr_file_close(d); } } /* NOTREACHED */ } -APR_DECLARE(apr_status_t) apr_file_copy(const char *from_path, +APR_DECLARE(fspr_status_t) fspr_file_copy(const char *from_path, const char *to_path, - apr_fileperms_t perms, - apr_pool_t *pool) + fspr_fileperms_t perms, + fspr_pool_t *pool) { - return apr_file_transfer_contents(from_path, to_path, + return fspr_file_transfer_contents(from_path, to_path, (APR_WRITE | APR_CREATE | APR_TRUNCATE), perms, pool); } -APR_DECLARE(apr_status_t) apr_file_append(const char *from_path, +APR_DECLARE(fspr_status_t) fspr_file_append(const char *from_path, const char *to_path, - apr_fileperms_t perms, - apr_pool_t *pool) + fspr_fileperms_t perms, + fspr_pool_t *pool) { - return apr_file_transfer_contents(from_path, to_path, + return fspr_file_transfer_contents(from_path, to_path, (APR_WRITE | APR_CREATE | APR_APPEND), perms, pool); diff --git a/libs/apr/file_io/unix/dir.c b/libs/apr/file_io/unix/dir.c index e05dc993c5..faba53d71d 100644 --- a/libs/apr/file_io/unix/dir.c +++ b/libs/apr/file_io/unix/dir.c @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "apr_arch_file_io.h" -#include "apr_strings.h" -#include "apr_portable.h" +#include "fspr_arch_file_io.h" +#include "fspr_strings.h" +#include "fspr_portable.h" #if APR_HAVE_SYS_SYSLIMITS_H #include #endif @@ -24,9 +24,9 @@ #include #endif -static apr_status_t dir_cleanup(void *thedir) +static fspr_status_t dir_cleanup(void *thedir) { - apr_dir_t *dir = thedir; + fspr_dir_t *dir = thedir; if (closedir(dir->dirstruct) == 0) { return APR_SUCCESS; } @@ -38,24 +38,24 @@ static apr_status_t dir_cleanup(void *thedir) #define PATH_SEPARATOR '/' /* Remove trailing separators that don't affect the meaning of PATH. */ -static const char *path_canonicalize (const char *path, apr_pool_t *pool) +static const char *path_canonicalize (const char *path, fspr_pool_t *pool) { /* At some point this could eliminate redundant components. For * now, it just makes sure there is no trailing slash. */ - apr_size_t len = strlen (path); - apr_size_t orig_len = len; + fspr_size_t len = strlen (path); + fspr_size_t orig_len = len; while ((len > 0) && (path[len - 1] == PATH_SEPARATOR)) len--; if (len != orig_len) - return apr_pstrndup (pool, path, len); + return fspr_pstrndup (pool, path, len); else return path; } /* Remove one component off the end of PATH. */ -static char *path_remove_last_component (const char *path, apr_pool_t *pool) +static char *path_remove_last_component (const char *path, fspr_pool_t *pool) { const char *newpath = path_canonicalize (path, pool); int i; @@ -65,18 +65,18 @@ static char *path_remove_last_component (const char *path, apr_pool_t *pool) break; } - return apr_pstrndup (pool, path, (i < 0) ? 0 : i); + return fspr_pstrndup (pool, path, (i < 0) ? 0 : i); } -apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, - apr_pool_t *pool) +fspr_status_t fspr_dir_open(fspr_dir_t **new, const char *dirname, + fspr_pool_t *pool) { /* 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. */ - apr_size_t dirent_size = + fspr_size_t dirent_size = (sizeof((*new)->entry->d_name) > 1 ? sizeof(struct dirent) : sizeof (struct dirent) + 255); DIR *dir = opendir(dirname); @@ -85,25 +85,25 @@ apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, return errno; } - (*new) = (apr_dir_t *)apr_palloc(pool, sizeof(apr_dir_t)); + (*new) = (fspr_dir_t *)fspr_palloc(pool, sizeof(fspr_dir_t)); (*new)->pool = pool; - (*new)->dirname = apr_pstrdup(pool, dirname); + (*new)->dirname = fspr_pstrdup(pool, dirname); (*new)->dirstruct = dir; - (*new)->entry = apr_pcalloc(pool, dirent_size); + (*new)->entry = fspr_pcalloc(pool, dirent_size); - apr_pool_cleanup_register((*new)->pool, *new, dir_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register((*new)->pool, *new, dir_cleanup, + fspr_pool_cleanup_null); return APR_SUCCESS; } -apr_status_t apr_dir_close(apr_dir_t *thedir) +fspr_status_t fspr_dir_close(fspr_dir_t *thedir) { - return apr_pool_cleanup_run(thedir->pool, thedir, dir_cleanup); + return fspr_pool_cleanup_run(thedir->pool, thedir, dir_cleanup); } #ifdef DIRENT_TYPE -static apr_filetype_e filetype_from_dirent_type(int type) +static fspr_filetype_e filetype_from_dirent_type(int type) { switch (type) { case DT_REG: @@ -130,12 +130,12 @@ static apr_filetype_e filetype_from_dirent_type(int type) } #endif -apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, - apr_dir_t *thedir) +fspr_status_t fspr_dir_read(fspr_finfo_t *finfo, fspr_int32_t wanted, + fspr_dir_t *thedir) { - apr_status_t ret = 0; + fspr_status_t ret = 0; #ifdef DIRENT_TYPE - apr_filetype_e type; + fspr_filetype_e type; #endif #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \ && !defined(READDIR_IS_THREAD_SAFE) @@ -201,12 +201,12 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, { char fspec[APR_PATH_MAX]; int off; - apr_cpystrn(fspec, thedir->dirname, sizeof(fspec)); + fspr_cpystrn(fspec, thedir->dirname, sizeof(fspec)); off = strlen(fspec); if ((fspec[off - 1] != '/') && (off + 1 < sizeof(fspec))) fspec[off++] = '/'; - apr_cpystrn(fspec + off, thedir->entry->d_name, sizeof(fspec) - off); - ret = apr_stat(finfo, fspec, APR_FINFO_LINK | wanted, thedir->pool); + fspr_cpystrn(fspec + off, thedir->entry->d_name, sizeof(fspec) - off); + ret = fspr_stat(finfo, fspec, APR_FINFO_LINK | wanted, thedir->pool); /* We passed a stack name that will disappear */ finfo->fname = NULL; } @@ -234,7 +234,7 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, #endif } - finfo->name = apr_pstrdup(thedir->pool, thedir->entry->d_name); + finfo->name = fspr_pstrdup(thedir->pool, thedir->entry->d_name); finfo->valid |= APR_FINFO_NAME; if (wanted) @@ -243,16 +243,16 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, return APR_SUCCESS; } -apr_status_t apr_dir_rewind(apr_dir_t *thedir) +fspr_status_t fspr_dir_rewind(fspr_dir_t *thedir) { rewinddir(thedir->dirstruct); return APR_SUCCESS; } -apr_status_t apr_dir_make(const char *path, apr_fileperms_t perm, - apr_pool_t *pool) +fspr_status_t fspr_dir_make(const char *path, fspr_fileperms_t perm, + fspr_pool_t *pool) { - mode_t mode = apr_unix_perms2mode(perm); + mode_t mode = fspr_unix_perms2mode(perm); if (mkdir(path, mode) == 0) { return APR_SUCCESS; @@ -262,35 +262,35 @@ apr_status_t apr_dir_make(const char *path, apr_fileperms_t perm, } } -apr_status_t apr_dir_make_recursive(const char *path, apr_fileperms_t perm, - apr_pool_t *pool) +fspr_status_t fspr_dir_make_recursive(const char *path, fspr_fileperms_t perm, + fspr_pool_t *pool) { - apr_status_t apr_err = 0; + fspr_status_t fspr_err = 0; - apr_err = apr_dir_make (path, perm, pool); /* Try to make PATH right out */ + fspr_err = fspr_dir_make (path, perm, pool); /* Try to make PATH right out */ - if (apr_err == EEXIST) /* It's OK if PATH exists */ + if (fspr_err == EEXIST) /* It's OK if PATH exists */ return APR_SUCCESS; - if (apr_err == ENOENT) { /* Missing an intermediate dir */ + if (fspr_err == ENOENT) { /* Missing an intermediate dir */ char *dir; dir = path_remove_last_component(path, pool); /* If there is no path left, give up. */ if (dir[0] == '\0') { - return apr_err; + return fspr_err; } - apr_err = apr_dir_make_recursive(dir, perm, pool); + fspr_err = fspr_dir_make_recursive(dir, perm, pool); - if (!apr_err) - apr_err = apr_dir_make (path, perm, pool); + if (!fspr_err) + fspr_err = fspr_dir_make (path, perm, pool); } - return apr_err; + return fspr_err; } -apr_status_t apr_dir_remove(const char *path, apr_pool_t *pool) +fspr_status_t fspr_dir_remove(const char *path, fspr_pool_t *pool) { if (rmdir(path) == 0) { return APR_SUCCESS; @@ -300,7 +300,7 @@ apr_status_t apr_dir_remove(const char *path, apr_pool_t *pool) } } -apr_status_t apr_os_dir_get(apr_os_dir_t **thedir, apr_dir_t *dir) +fspr_status_t fspr_os_dir_get(fspr_os_dir_t **thedir, fspr_dir_t *dir) { if (dir == NULL) { return APR_ENODIR; @@ -309,11 +309,11 @@ apr_status_t apr_os_dir_get(apr_os_dir_t **thedir, apr_dir_t *dir) return APR_SUCCESS; } -apr_status_t apr_os_dir_put(apr_dir_t **dir, apr_os_dir_t *thedir, - apr_pool_t *pool) +fspr_status_t fspr_os_dir_put(fspr_dir_t **dir, fspr_os_dir_t *thedir, + fspr_pool_t *pool) { if ((*dir) == NULL) { - (*dir) = (apr_dir_t *)apr_pcalloc(pool, sizeof(apr_dir_t)); + (*dir) = (fspr_dir_t *)fspr_pcalloc(pool, sizeof(fspr_dir_t)); (*dir)->pool = pool; } (*dir)->dirstruct = thedir; diff --git a/libs/apr/file_io/unix/fileacc.c b/libs/apr/file_io/unix/fileacc.c index 437f3589f5..b1efa0e822 100644 --- a/libs/apr/file_io/unix/fileacc.c +++ b/libs/apr/file_io/unix/fileacc.c @@ -14,25 +14,25 @@ * limitations under the License. */ -#include "apr_strings.h" -#include "apr_arch_file_io.h" +#include "fspr_strings.h" +#include "fspr_arch_file_io.h" -/* A file to put ALL of the accessor functions for apr_file_t types. */ +/* A file to put ALL of the accessor functions for fspr_file_t types. */ -APR_DECLARE(apr_status_t) apr_file_name_get(const char **fname, - apr_file_t *thefile) +APR_DECLARE(fspr_status_t) fspr_file_name_get(const char **fname, + fspr_file_t *thefile) { *fname = thefile->fname; return APR_SUCCESS; } -APR_DECLARE(apr_int32_t) apr_file_flags_get(apr_file_t *f) +APR_DECLARE(fspr_int32_t) fspr_file_flags_get(fspr_file_t *f) { return f->flags; } #if !defined(OS2) && !defined(WIN32) -mode_t apr_unix_perms2mode(apr_fileperms_t perms) +mode_t fspr_unix_perms2mode(fspr_fileperms_t perms) { mode_t mode = 0; @@ -68,9 +68,9 @@ mode_t apr_unix_perms2mode(apr_fileperms_t perms) return mode; } -apr_fileperms_t apr_unix_mode2perms(mode_t mode) +fspr_fileperms_t fspr_unix_mode2perms(mode_t mode) { - apr_fileperms_t perms = 0; + fspr_fileperms_t perms = 0; if (mode & S_ISUID) perms |= APR_USETID; @@ -105,15 +105,15 @@ apr_fileperms_t apr_unix_mode2perms(mode_t mode) } #endif -APR_DECLARE(apr_status_t) apr_file_data_get(void **data, const char *key, - apr_file_t *file) +APR_DECLARE(fspr_status_t) fspr_file_data_get(void **data, const char *key, + fspr_file_t *file) { - return apr_pool_userdata_get(data, key, file->pool); + return fspr_pool_userdata_get(data, key, file->pool); } -APR_DECLARE(apr_status_t) apr_file_data_set(apr_file_t *file, void *data, +APR_DECLARE(fspr_status_t) fspr_file_data_set(fspr_file_t *file, void *data, const char *key, - apr_status_t (*cleanup)(void *)) + fspr_status_t (*cleanup)(void *)) { - return apr_pool_userdata_set(data, key, cleanup, file->pool); + return fspr_pool_userdata_set(data, key, cleanup, file->pool); } diff --git a/libs/apr/file_io/unix/filedup.c b/libs/apr/file_io/unix/filedup.c index f2b61efe03..007421f91b 100644 --- a/libs/apr/file_io/unix/filedup.c +++ b/libs/apr/file_io/unix/filedup.c @@ -14,14 +14,14 @@ * limitations under the License. */ -#include "apr_arch_file_io.h" -#include "apr_strings.h" -#include "apr_portable.h" -#include "apr_thread_mutex.h" -#include "apr_arch_inherit.h" +#include "fspr_arch_file_io.h" +#include "fspr_strings.h" +#include "fspr_portable.h" +#include "fspr_thread_mutex.h" +#include "fspr_arch_inherit.h" -static apr_status_t file_dup(apr_file_t **new_file, - apr_file_t *old_file, apr_pool_t *p, +static fspr_status_t file_dup(fspr_file_t **new_file, + fspr_file_t *old_file, fspr_pool_t *p, int which_dup) { int rv; @@ -40,12 +40,12 @@ static apr_status_t file_dup(apr_file_t **new_file, return errno; if (which_dup == 1) { - (*new_file) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); + (*new_file) = (fspr_file_t *)fspr_pcalloc(p, sizeof(fspr_file_t)); (*new_file)->pool = p; (*new_file)->filedes = rv; } - (*new_file)->fname = apr_pstrdup(p, old_file->fname); + (*new_file)->fname = fspr_pstrdup(p, old_file->fname); (*new_file)->buffered = old_file->buffered; /* If the existing socket in a dup2 is already buffered, we @@ -54,7 +54,7 @@ static apr_status_t file_dup(apr_file_t **new_file, */ #if APR_HAS_THREADS if ((*new_file)->buffered && !(*new_file)->thlock && old_file->thlock) { - apr_thread_mutex_create(&((*new_file)->thlock), + fspr_thread_mutex_create(&((*new_file)->thlock), APR_THREAD_MUTEX_DEFAULT, p); } #endif @@ -62,7 +62,7 @@ static apr_status_t file_dup(apr_file_t **new_file, * got one. */ if ((*new_file)->buffered && !(*new_file)->buffer) { - (*new_file)->buffer = apr_palloc(p, APR_FILE_BUFSIZE); + (*new_file)->buffer = fspr_palloc(p, APR_FILE_BUFSIZE); } /* this is the way dup() works */ @@ -71,29 +71,29 @@ static apr_status_t file_dup(apr_file_t **new_file, /* make sure unget behavior is consistent */ (*new_file)->ungetchar = old_file->ungetchar; - /* apr_file_dup2() retains the original cleanup, reflecting + /* fspr_file_dup2() retains the original cleanup, reflecting * the existing inherit and nocleanup flags. This means, - * that apr_file_dup2() cannot be called against an apr_file_t - * already closed with apr_file_close, because the expected + * that fspr_file_dup2() cannot be called against an fspr_file_t + * already closed with fspr_file_close, because the expected * cleanup was already killed. */ if (which_dup == 2) { return APR_SUCCESS; } - /* apr_file_dup() retains all old_file flags with the exceptions + /* fspr_file_dup() retains all old_file flags with the exceptions * of APR_INHERIT and APR_FILE_NOCLEANUP. - * The user must call apr_file_inherit_set() on the dupped - * apr_file_t when desired. + * The user must call fspr_file_inherit_set() on the dupped + * fspr_file_t when desired. */ (*new_file)->flags = old_file->flags & ~(APR_INHERIT | APR_FILE_NOCLEANUP); - apr_pool_cleanup_register((*new_file)->pool, (void *)(*new_file), - apr_unix_file_cleanup, - apr_unix_file_cleanup); + fspr_pool_cleanup_register((*new_file)->pool, (void *)(*new_file), + fspr_unix_file_cleanup, + fspr_unix_file_cleanup); #ifndef WAITIO_USES_POLL - /* Start out with no pollset. apr_wait_for_io_or_timeout() will + /* Start out with no pollset. fspr_wait_for_io_or_timeout() will * initialize the pollset if needed. */ (*new_file)->pollset = NULL; @@ -101,27 +101,27 @@ static apr_status_t file_dup(apr_file_t **new_file, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, - apr_file_t *old_file, apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_file_dup(fspr_file_t **new_file, + fspr_file_t *old_file, fspr_pool_t *p) { return file_dup(new_file, old_file, p, 1); } -APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, - apr_file_t *old_file, apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_file_dup2(fspr_file_t *new_file, + fspr_file_t *old_file, fspr_pool_t *p) { return file_dup(&new_file, old_file, p, 2); } -APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, - apr_file_t *old_file, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_file_setaside(fspr_file_t **new_file, + fspr_file_t *old_file, + fspr_pool_t *p) { - *new_file = (apr_file_t *)apr_palloc(p, sizeof(apr_file_t)); - memcpy(*new_file, old_file, sizeof(apr_file_t)); + *new_file = (fspr_file_t *)fspr_palloc(p, sizeof(fspr_file_t)); + memcpy(*new_file, old_file, sizeof(fspr_file_t)); (*new_file)->pool = p; if (old_file->buffered) { - (*new_file)->buffer = apr_palloc(p, APR_FILE_BUFSIZE); + (*new_file)->buffer = fspr_palloc(p, APR_FILE_BUFSIZE); if (old_file->direction == 1) { memcpy((*new_file)->buffer, old_file->buffer, old_file->bufpos); } @@ -130,26 +130,26 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, } #if APR_HAS_THREADS if (old_file->thlock) { - apr_thread_mutex_create(&((*new_file)->thlock), + fspr_thread_mutex_create(&((*new_file)->thlock), APR_THREAD_MUTEX_DEFAULT, p); - apr_thread_mutex_destroy(old_file->thlock); + fspr_thread_mutex_destroy(old_file->thlock); } #endif /* APR_HAS_THREADS */ } if (old_file->fname) { - (*new_file)->fname = apr_pstrdup(p, old_file->fname); + (*new_file)->fname = fspr_pstrdup(p, old_file->fname); } if (!(old_file->flags & APR_FILE_NOCLEANUP)) { - apr_pool_cleanup_register(p, (void *)(*new_file), - apr_unix_file_cleanup, + fspr_pool_cleanup_register(p, (void *)(*new_file), + fspr_unix_file_cleanup, ((*new_file)->flags & APR_INHERIT) - ? apr_pool_cleanup_null - : apr_unix_file_cleanup); + ? fspr_pool_cleanup_null + : fspr_unix_file_cleanup); } old_file->filedes = -1; - apr_pool_cleanup_kill(old_file->pool, (void *)old_file, - apr_unix_file_cleanup); + fspr_pool_cleanup_kill(old_file->pool, (void *)old_file, + fspr_unix_file_cleanup); #ifndef WAITIO_USES_POLL (*new_file)->pollset = NULL; #endif diff --git a/libs/apr/file_io/unix/filepath.c b/libs/apr/file_io/unix/filepath.c index 64f1b2fbd4..1e87b9f267 100644 --- a/libs/apr/file_io/unix/filepath.c +++ b/libs/apr/file_io/unix/filepath.c @@ -14,13 +14,13 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_private.h" -#include "apr_arch_file_io.h" -#include "apr_file_io.h" -#include "apr_strings.h" +#include "fspr.h" +#include "fspr_private.h" +#include "fspr_arch_file_io.h" +#include "fspr_file_io.h" +#include "fspr_strings.h" #define APR_WANT_STRFUNC -#include "apr_want.h" +#include "fspr_want.h" #if APR_HAVE_UNISTD_H #include #endif @@ -34,8 +34,8 @@ /* Any OS that requires/refuses trailing slashes should be dealt with here. */ -APR_DECLARE(apr_status_t) apr_filepath_get(char **defpath, apr_int32_t flags, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_filepath_get(char **defpath, fspr_int32_t flags, + fspr_pool_t *p) { char path[APR_PATH_MAX]; @@ -45,7 +45,7 @@ APR_DECLARE(apr_status_t) apr_filepath_get(char **defpath, apr_int32_t flags, else return errno; } - *defpath = apr_pstrdup(p, path); + *defpath = fspr_pstrdup(p, path); return APR_SUCCESS; } @@ -53,7 +53,7 @@ APR_DECLARE(apr_status_t) apr_filepath_get(char **defpath, apr_int32_t flags, /* Any OS that requires/refuses trailing slashes should be dealt with here */ -APR_DECLARE(apr_status_t) apr_filepath_set(const char *path, apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_filepath_set(const char *path, fspr_pool_t *p) { if (chdir(path) != 0) return errno; @@ -61,13 +61,13 @@ APR_DECLARE(apr_status_t) apr_filepath_set(const char *path, apr_pool_t *p) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, +APR_DECLARE(fspr_status_t) fspr_filepath_root(const char **rootpath, const char **inpath, - apr_int32_t flags, - apr_pool_t *p) + fspr_int32_t flags, + fspr_pool_t *p) { if (**inpath == '/') { - *rootpath = apr_pstrdup(p, "/"); + *rootpath = fspr_pstrdup(p, "/"); do { ++(*inpath); } while (**inpath == '/'); @@ -78,19 +78,19 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, return APR_ERELATIVE; } -APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, +APR_DECLARE(fspr_status_t) fspr_filepath_merge(char **newpath, const char *rootpath, const char *addpath, - apr_int32_t flags, - apr_pool_t *p) + fspr_int32_t flags, + fspr_pool_t *p) { char *path; - apr_size_t rootlen; /* is the length of the src rootpath */ - apr_size_t maxlen; /* maximum total path length */ - apr_size_t keptlen; /* is the length of the retained rootpath */ - apr_size_t pathlen; /* is the length of the result path */ - apr_size_t seglen; /* is the end of the current segment */ - apr_status_t rv; + fspr_size_t rootlen; /* is the length of the src rootpath */ + fspr_size_t maxlen; /* maximum total path length */ + fspr_size_t keptlen; /* is the length of the retained rootpath */ + fspr_size_t pathlen; /* is the length of the result path */ + fspr_size_t seglen; /* is the end of the current segment */ + fspr_status_t rv; /* Treat null as an empty path. */ @@ -134,7 +134,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, * passing the address of a char const* for a char** arg. */ char *getpath = NULL; - rv = apr_filepath_get(&getpath, flags, p); + rv = fspr_filepath_get(&getpath, flags, p); rootpath = getpath; if (rv != APR_SUCCESS) return errno; @@ -144,7 +144,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, /* XXX: Any kernel subject to goofy, uncanonical results * must run the rootpath against the user's given flags. - * Simplest would be a recursive call to apr_filepath_merge + * Simplest would be a recursive call to fspr_filepath_merge * with an empty (not null) rootpath and addpath of the cwd. */ } @@ -156,7 +156,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, if (maxlen > APR_PATH_MAX) { return APR_ENAMETOOLONG; } - path = (char *)apr_palloc(p, maxlen); + path = (char *)fspr_palloc(p, maxlen); if (addpath[0] == '/') { /* Ignore the given root path, strip off leading @@ -292,21 +292,21 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_filepath_list_split(apr_array_header_t **pathelts, +APR_DECLARE(fspr_status_t) fspr_filepath_list_split(fspr_array_header_t **pathelts, const char *liststr, - apr_pool_t *p) + fspr_pool_t *p) { - return apr_filepath_list_split_impl(pathelts, liststr, ':', p); + return fspr_filepath_list_split_impl(pathelts, liststr, ':', p); } -APR_DECLARE(apr_status_t) apr_filepath_list_merge(char **liststr, - apr_array_header_t *pathelts, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_filepath_list_merge(char **liststr, + fspr_array_header_t *pathelts, + fspr_pool_t *p) { - return apr_filepath_list_merge_impl(liststr, pathelts, ':', p); + return fspr_filepath_list_merge_impl(liststr, pathelts, ':', p); } -APR_DECLARE(apr_status_t) apr_filepath_encoding(int *style, apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_filepath_encoding(int *style, fspr_pool_t *p) { *style = APR_FILEPATH_ENCODING_LOCALE; return APR_SUCCESS; diff --git a/libs/apr/file_io/unix/filepath_util.c b/libs/apr/file_io/unix/filepath_util.c index d8ccc56714..d81dc91ce3 100644 --- a/libs/apr/file_io/unix/filepath_util.c +++ b/libs/apr/file_io/unix/filepath_util.c @@ -17,29 +17,29 @@ #define APR_WANT_STRFUNC #define APR_WANT_MEMFUNC -#include "apr_want.h" +#include "fspr_want.h" -#include "apr_errno.h" -#include "apr_pools.h" -#include "apr_strings.h" -#include "apr_tables.h" +#include "fspr_errno.h" +#include "fspr_pools.h" +#include "fspr_strings.h" +#include "fspr_tables.h" -#include "apr_private.h" +#include "fspr_private.h" -apr_status_t apr_filepath_list_split_impl(apr_array_header_t **pathelts, +fspr_status_t fspr_filepath_list_split_impl(fspr_array_header_t **pathelts, const char *liststr, char separator, - apr_pool_t *p) + fspr_pool_t *p) { char *path, *part, *ptr; char separator_string[2] = { '\0', '\0' }; - apr_array_header_t *elts; + fspr_array_header_t *elts; int nelts; separator_string[0] = separator; /* Count the number of path elements. We know there'll be at least one even if path is an empty string. */ - path = apr_pstrdup(p, liststr); + path = fspr_pstrdup(p, liststr); for (nelts = 0, ptr = path; ptr != NULL; ++nelts) { ptr = strchr(ptr, separator); @@ -48,14 +48,14 @@ apr_status_t apr_filepath_list_split_impl(apr_array_header_t **pathelts, } /* Split the path into the array. */ - elts = apr_array_make(p, nelts, sizeof(char*)); - while ((part = apr_strtok(path, separator_string, &ptr)) != NULL) + elts = fspr_array_make(p, nelts, sizeof(char*)); + while ((part = fspr_strtok(path, separator_string, &ptr)) != NULL) { if (*part == '\0') /* Ignore empty path components. */ continue; - *(char**)apr_array_push(elts) = part; - path = NULL; /* For the next call to apr_strtok */ + *(char**)fspr_array_push(elts) = part; + path = NULL; /* For the next call to fspr_strtok */ } *pathelts = elts; @@ -63,12 +63,12 @@ apr_status_t apr_filepath_list_split_impl(apr_array_header_t **pathelts, } -apr_status_t apr_filepath_list_merge_impl(char **liststr, - apr_array_header_t *pathelts, +fspr_status_t fspr_filepath_list_merge_impl(char **liststr, + fspr_array_header_t *pathelts, char separator, - apr_pool_t *p) + fspr_pool_t *p) { - apr_size_t path_size = 0; + fspr_size_t path_size = 0; char *path; int i; @@ -91,13 +91,13 @@ apr_status_t apr_filepath_list_merge_impl(char **liststr, path_size += (i - 1); /* Merge the path components */ - path = *liststr = apr_palloc(p, path_size + 1); + path = *liststr = fspr_palloc(p, path_size + 1); for (i = 0; i < pathelts->nelts; ++i) { /* ### Hmmmm. Calling strlen twice on the same string. Yuck. - But is is better than reallocation in apr_pstrcat? */ + But is is better than reallocation in fspr_pstrcat? */ const char *part = ((char**)pathelts->elts)[i]; - apr_size_t part_size = strlen(part); + fspr_size_t part_size = strlen(part); if (part_size == 0) /* Ignore empty path components. */ continue; diff --git a/libs/apr/file_io/unix/filestat.c b/libs/apr/file_io/unix/filestat.c index a34b22c370..d5e92724d5 100644 --- a/libs/apr/file_io/unix/filestat.c +++ b/libs/apr/file_io/unix/filestat.c @@ -14,19 +14,19 @@ * limitations under the License. */ -#include "apr_arch_file_io.h" -#include "apr_file_io.h" -#include "apr_general.h" -#include "apr_strings.h" -#include "apr_errno.h" +#include "fspr_arch_file_io.h" +#include "fspr_file_io.h" +#include "fspr_general.h" +#include "fspr_strings.h" +#include "fspr_errno.h" #ifdef HAVE_UTIME #include #endif -static apr_filetype_e filetype_from_mode(mode_t mode) +static fspr_filetype_e filetype_from_mode(mode_t mode) { - apr_filetype_e type; + fspr_filetype_e type; switch (mode & S_IFMT) { case S_IFREG: @@ -67,12 +67,12 @@ static apr_filetype_e filetype_from_mode(mode_t mode) return type; } -static void fill_out_finfo(apr_finfo_t *finfo, struct_stat *info, - apr_int32_t wanted) +static void fill_out_finfo(fspr_finfo_t *finfo, struct_stat *info, + fspr_int32_t wanted) { finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_NLINK | APR_FINFO_OWNER | APR_FINFO_PROT; - finfo->protection = apr_unix_mode2perms(info->st_mode); + finfo->protection = fspr_unix_mode2perms(info->st_mode); finfo->filetype = filetype_from_mode(info->st_mode); finfo->user = info->st_uid; finfo->group = info->st_gid; @@ -80,9 +80,9 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct_stat *info, finfo->inode = info->st_ino; finfo->device = info->st_dev; finfo->nlink = info->st_nlink; - apr_time_ansi_put(&finfo->atime, info->st_atime); - apr_time_ansi_put(&finfo->mtime, info->st_mtime); - apr_time_ansi_put(&finfo->ctime, info->st_ctime); + fspr_time_ansi_put(&finfo->atime, info->st_atime); + fspr_time_ansi_put(&finfo->mtime, info->st_mtime); + fspr_time_ansi_put(&finfo->ctime, info->st_ctime); /* ### needs to be revisited * if (wanted & APR_FINFO_CSIZE) { * finfo->csize = info->st_blocks * 512; @@ -91,14 +91,14 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct_stat *info, */ } -APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, - apr_int32_t wanted, - apr_file_t *thefile) +APR_DECLARE(fspr_status_t) fspr_file_info_get(fspr_finfo_t *finfo, + fspr_int32_t wanted, + fspr_file_t *thefile) { struct_stat info; if (thefile->buffered) { - apr_status_t rv = apr_file_flush(thefile); + fspr_status_t rv = fspr_file_flush(thefile); if (rv != APR_SUCCESS) return rv; } @@ -114,30 +114,30 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, } } -APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, - apr_fileperms_t perms) +APR_DECLARE(fspr_status_t) fspr_file_perms_set(const char *fname, + fspr_fileperms_t perms) { - mode_t mode = apr_unix_perms2mode(perms); + mode_t mode = fspr_unix_perms2mode(perms); if (chmod(fname, mode) == -1) return errno; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, - apr_fileattrs_t attributes, - apr_fileattrs_t attr_mask, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_file_attrs_set(const char *fname, + fspr_fileattrs_t attributes, + fspr_fileattrs_t attr_mask, + fspr_pool_t *pool) { - apr_status_t status; - apr_finfo_t finfo = {0}; + fspr_status_t status; + fspr_finfo_t finfo = {0}; /* Don't do anything if we can't handle the requested attributes */ if (!(attr_mask & (APR_FILE_ATTR_READONLY | APR_FILE_ATTR_EXECUTABLE))) return APR_SUCCESS; - status = apr_stat(&finfo, fname, APR_FINFO_PROT, pool); + status = fspr_stat(&finfo, fname, APR_FINFO_PROT, pool); if (status) return status; @@ -176,18 +176,18 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, } } - return apr_file_perms_set(fname, finfo.protection); + return fspr_file_perms_set(fname, finfo.protection); } -APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, - apr_time_t mtime, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_file_mtime_set(const char *fname, + fspr_time_t mtime, + fspr_pool_t *pool) { - apr_status_t status; - apr_finfo_t finfo = {0}; + fspr_status_t status; + fspr_finfo_t finfo = {0}; - status = apr_stat(&finfo, fname, APR_FINFO_ATIME, pool); + status = fspr_stat(&finfo, fname, APR_FINFO_ATIME, pool); if (status) { return status; } @@ -196,10 +196,10 @@ APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, { struct timeval tvp[2]; - tvp[0].tv_sec = apr_time_sec(finfo.atime); - tvp[0].tv_usec = apr_time_usec(finfo.atime); - tvp[1].tv_sec = apr_time_sec(mtime); - tvp[1].tv_usec = apr_time_usec(mtime); + tvp[0].tv_sec = fspr_time_sec(finfo.atime); + tvp[0].tv_usec = fspr_time_usec(finfo.atime); + tvp[1].tv_sec = fspr_time_sec(mtime); + tvp[1].tv_usec = fspr_time_usec(mtime); if (utimes(fname, tvp) == -1) { return errno; @@ -224,9 +224,9 @@ APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, } -APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, +APR_DECLARE(fspr_status_t) fspr_stat(fspr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *pool) + fspr_int32_t wanted, fspr_pool_t *pool) { struct_stat info; int srv; diff --git a/libs/apr/file_io/unix/flock.c b/libs/apr/file_io/unix/flock.c index f400a96701..9081b5faf4 100644 --- a/libs/apr/file_io/unix/flock.c +++ b/libs/apr/file_io/unix/flock.c @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "apr_arch_file_io.h" +#include "fspr_arch_file_io.h" #if APR_HAVE_FCNTL_H #include @@ -23,7 +23,7 @@ #include #endif -APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) +APR_DECLARE(fspr_status_t) fspr_file_lock(fspr_file_t *thefile, int type) { int rc; @@ -82,7 +82,7 @@ APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile) +APR_DECLARE(fspr_status_t) fspr_file_unlock(fspr_file_t *thefile) { int rc; diff --git a/libs/apr/file_io/unix/fullrw.c b/libs/apr/file_io/unix/fullrw.c index 9ad27ec99b..9503e983ad 100644 --- a/libs/apr/file_io/unix/fullrw.c +++ b/libs/apr/file_io/unix/fullrw.c @@ -14,20 +14,20 @@ * limitations under the License. */ -#include "apr_file_io.h" +#include "fspr_file_io.h" -APR_DECLARE(apr_status_t) apr_file_read_full(apr_file_t *thefile, void *buf, - apr_size_t nbytes, - apr_size_t *bytes_read) +APR_DECLARE(fspr_status_t) fspr_file_read_full(fspr_file_t *thefile, void *buf, + fspr_size_t nbytes, + fspr_size_t *bytes_read) { - apr_status_t status; - apr_size_t total_read = 0; + fspr_status_t status; + fspr_size_t total_read = 0; do { - apr_size_t amt = nbytes; + fspr_size_t amt = nbytes; - status = apr_file_read(thefile, buf, &amt); + status = fspr_file_read(thefile, buf, &amt); buf = (char *)buf + amt; nbytes -= amt; total_read += amt; @@ -39,18 +39,18 @@ APR_DECLARE(apr_status_t) apr_file_read_full(apr_file_t *thefile, void *buf, return status; } -APR_DECLARE(apr_status_t) apr_file_write_full(apr_file_t *thefile, +APR_DECLARE(fspr_status_t) fspr_file_write_full(fspr_file_t *thefile, const void *buf, - apr_size_t nbytes, - apr_size_t *bytes_written) + fspr_size_t nbytes, + fspr_size_t *bytes_written) { - apr_status_t status; - apr_size_t total_written = 0; + fspr_status_t status; + fspr_size_t total_written = 0; do { - apr_size_t amt = nbytes; + fspr_size_t amt = nbytes; - status = apr_file_write(thefile, buf, &amt); + status = fspr_file_write(thefile, buf, &amt); buf = (char *)buf + amt; nbytes -= amt; total_written += amt; @@ -62,18 +62,18 @@ APR_DECLARE(apr_status_t) apr_file_write_full(apr_file_t *thefile, return status; } -APR_DECLARE(apr_status_t) apr_file_writev_full(apr_file_t *thefile, +APR_DECLARE(fspr_status_t) fspr_file_writev_full(fspr_file_t *thefile, const struct iovec *vec, - apr_size_t nvec, - apr_size_t *bytes_written) + fspr_size_t nvec, + fspr_size_t *bytes_written) { - apr_status_t rv = APR_SUCCESS; - apr_size_t i; - apr_size_t amt = 0; - apr_size_t total = 0; + fspr_status_t rv = APR_SUCCESS; + fspr_size_t i; + fspr_size_t amt = 0; + fspr_size_t total = 0; for (i = 0; i < nvec && rv == APR_SUCCESS; i++) { - rv = apr_file_write_full(thefile, vec[i].iov_base, + rv = fspr_file_write_full(thefile, vec[i].iov_base, vec[i].iov_len, &amt); total += amt; } diff --git a/libs/apr/file_io/unix/mktemp.c b/libs/apr/file_io/unix/mktemp.c index 73c61dcfce..2ea22e01b9 100644 --- a/libs/apr/file_io/unix/mktemp.c +++ b/libs/apr/file_io/unix/mktemp.c @@ -46,11 +46,11 @@ * SUCH DAMAGE. */ -#include "apr_private.h" -#include "apr_file_io.h" /* prototype of apr_mkstemp() */ -#include "apr_strings.h" /* prototype of apr_mkstemp() */ -#include "apr_arch_file_io.h" /* prototype of apr_mkstemp() */ -#include "apr_portable.h" /* for apr_os_file_put() */ +#include "fspr_private.h" +#include "fspr_file_io.h" /* prototype of fspr_mkstemp() */ +#include "fspr_strings.h" /* prototype of fspr_mkstemp() */ +#include "fspr_arch_file_io.h" /* prototype of fspr_mkstemp() */ +#include "fspr_portable.h" /* for fspr_os_file_put() */ #ifndef HAVE_MKSTEMP @@ -89,18 +89,18 @@ static const unsigned char padchar[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; -static apr_uint32_t randseed=0; +static fspr_uint32_t randseed=0; -static int gettemp(char *path, apr_file_t **doopen, apr_int32_t flags, apr_pool_t *p) +static int gettemp(char *path, fspr_file_t **doopen, fspr_int32_t flags, fspr_pool_t *p) { register char *start, *trv, *suffp; char *pad; - apr_finfo_t sbuf; - apr_status_t rv; - apr_uint32_t randnum; + fspr_finfo_t sbuf; + fspr_status_t rv; + fspr_uint32_t randnum; if (randseed==0) { - randseed = (int)apr_time_now(); + randseed = (int)fspr_time_now(); seedrandom(randseed); } @@ -127,7 +127,7 @@ static int gettemp(char *path, apr_file_t **doopen, apr_int32_t flags, apr_pool_ break; if (*trv == '/') { *trv = '\0'; - rv = apr_stat(&sbuf, path, APR_FINFO_TYPE, p); + rv = fspr_stat(&sbuf, path, APR_FINFO_TYPE, p); *trv = '/'; if (rv != APR_SUCCESS) return rv; @@ -139,7 +139,7 @@ static int gettemp(char *path, apr_file_t **doopen, apr_int32_t flags, apr_pool_ } for (;;) { - if ((rv = apr_file_open(doopen, path, flags, + if ((rv = fspr_file_open(doopen, path, flags, APR_UREAD | APR_UWRITE, p)) == APR_SUCCESS) return APR_SUCCESS; if (!APR_STATUS_IS_EEXIST(rv)) @@ -172,7 +172,7 @@ static int gettemp(char *path, apr_file_t **doopen, apr_int32_t flags, apr_pool_ #endif #endif /* !defined(HAVE_MKSTEMP) */ -APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_int32_t flags, apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_file_mktemp(fspr_file_t **fp, char *template, fspr_int32_t flags, fspr_pool_t *p) { #ifdef HAVE_MKSTEMP int fd; @@ -197,13 +197,13 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i * * We either have to unset the flags, or fix up the fd and other * xthread and inherit bits appropriately. Since gettemp() above - * calls apr_file_open, our flags are respected in that code path. + * calls fspr_file_open, our flags are respected in that code path. */ - apr_os_file_put(fp, &fd, flags, p); - (*fp)->fname = apr_pstrdup(p, template); + fspr_os_file_put(fp, &fd, flags, p); + (*fp)->fname = fspr_pstrdup(p, template); - apr_pool_cleanup_register((*fp)->pool, (void *)(*fp), - apr_unix_file_cleanup, apr_unix_file_cleanup); + fspr_pool_cleanup_register((*fp)->pool, (void *)(*fp), + fspr_unix_file_cleanup, fspr_unix_file_cleanup); #endif return APR_SUCCESS; } diff --git a/libs/apr/file_io/unix/open.c b/libs/apr/file_io/unix/open.c index ef3b9670ef..c2b9cd1c54 100644 --- a/libs/apr/file_io/unix/open.c +++ b/libs/apr/file_io/unix/open.c @@ -14,25 +14,25 @@ * limitations under the License. */ -#include "apr_arch_file_io.h" -#include "apr_strings.h" -#include "apr_portable.h" -#include "apr_thread_mutex.h" -#include "apr_arch_inherit.h" +#include "fspr_arch_file_io.h" +#include "fspr_strings.h" +#include "fspr_portable.h" +#include "fspr_thread_mutex.h" +#include "fspr_arch_inherit.h" #ifdef NETWARE #include "nks/dirio.h" -#include "apr_hash.h" +#include "fspr_hash.h" #include "fsio.h" #endif -apr_status_t apr_unix_file_cleanup(void *thefile) +fspr_status_t fspr_unix_file_cleanup(void *thefile) { - apr_file_t *file = thefile; - apr_status_t flush_rv = APR_SUCCESS, rv = APR_SUCCESS; + fspr_file_t *file = thefile; + fspr_status_t flush_rv = APR_SUCCESS, rv = APR_SUCCESS; if (file->buffered) { - flush_rv = apr_file_flush(file); + flush_rv = fspr_file_flush(file); } if (close(file->filedes) == 0) { file->filedes = -1; @@ -41,7 +41,7 @@ apr_status_t apr_unix_file_cleanup(void *thefile) } #if APR_HAS_THREADS if (file->thlock) { - rv = apr_thread_mutex_destroy(file->thlock); + rv = fspr_thread_mutex_destroy(file->thlock); } #endif } @@ -51,9 +51,9 @@ apr_status_t apr_unix_file_cleanup(void *thefile) } #ifndef WAITIO_USES_POLL if (file->pollset != NULL) { - int pollset_rv = apr_pollset_destroy(file->pollset); + int pollset_rv = fspr_pollset_destroy(file->pollset); /* If the file close failed, return its error value, - * not apr_pollset_destroy()'s. + * not fspr_pollset_destroy()'s. */ if (rv == APR_SUCCESS) { rv = pollset_rv; @@ -63,17 +63,17 @@ apr_status_t apr_unix_file_cleanup(void *thefile) return rv != APR_SUCCESS ? rv : flush_rv; } -APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, +APR_DECLARE(fspr_status_t) fspr_file_open(fspr_file_t **new, const char *fname, - apr_int32_t flag, - apr_fileperms_t perm, - apr_pool_t *pool) + fspr_int32_t flag, + fspr_fileperms_t perm, + fspr_pool_t *pool) { - apr_os_file_t fd; + fspr_os_file_t fd; int oflags = 0; #if APR_HAS_THREADS - apr_thread_mutex_t *thlock; - apr_status_t rv; + fspr_thread_mutex_t *thlock; + fspr_status_t rv; #endif if ((flag & APR_READ) && (flag & APR_WRITE)) { @@ -121,7 +121,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, #if APR_HAS_THREADS if ((flag & APR_BUFFERED) && (flag & APR_XTHREAD)) { - rv = apr_thread_mutex_create(&thlock, + rv = fspr_thread_mutex_create(&thlock, APR_THREAD_MUTEX_DEFAULT, pool); if (rv) { return rv; @@ -133,24 +133,24 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, fd = open(fname, oflags, 0666); } else { - fd = open(fname, oflags, apr_unix_perms2mode(perm)); + fd = open(fname, oflags, fspr_unix_perms2mode(perm)); } if (fd < 0) { return errno; } - (*new) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); + (*new) = (fspr_file_t *)fspr_pcalloc(pool, sizeof(fspr_file_t)); (*new)->pool = pool; (*new)->flags = flag; (*new)->filedes = fd; - (*new)->fname = apr_pstrdup(pool, fname); + (*new)->fname = fspr_pstrdup(pool, fname); (*new)->blocking = BLK_ON; (*new)->buffered = (flag & APR_BUFFERED) > 0; if ((*new)->buffered) { - (*new)->buffer = apr_palloc(pool, APR_FILE_BUFSIZE); + (*new)->buffer = fspr_palloc(pool, APR_FILE_BUFSIZE); #if APR_HAS_THREADS if ((*new)->flags & APR_XTHREAD) { (*new)->thlock = thlock; @@ -170,25 +170,25 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, (*new)->dataRead = 0; (*new)->direction = 0; #ifndef WAITIO_USES_POLL - /* Start out with no pollset. apr_wait_for_io_or_timeout() will + /* Start out with no pollset. fspr_wait_for_io_or_timeout() will * initialize the pollset if needed. */ (*new)->pollset = NULL; #endif if (!(flag & APR_FILE_NOCLEANUP)) { - apr_pool_cleanup_register((*new)->pool, (void *)(*new), - apr_unix_file_cleanup, - apr_unix_file_cleanup); + fspr_pool_cleanup_register((*new)->pool, (void *)(*new), + fspr_unix_file_cleanup, + fspr_unix_file_cleanup); } return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) +APR_DECLARE(fspr_status_t) fspr_file_close(fspr_file_t *file) { - return apr_pool_cleanup_run(file->pool, file, apr_unix_file_cleanup); + return fspr_pool_cleanup_run(file->pool, file, fspr_unix_file_cleanup); } -APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_file_remove(const char *path, fspr_pool_t *pool) { if (unlink(path) == 0) { return APR_SUCCESS; @@ -198,9 +198,9 @@ APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *pool) } } -APR_DECLARE(apr_status_t) apr_file_rename(const char *from_path, +APR_DECLARE(fspr_status_t) fspr_file_rename(const char *from_path, const char *to_path, - apr_pool_t *p) + fspr_pool_t *p) { if (rename(from_path, to_path) != 0) { return errno; @@ -208,20 +208,20 @@ APR_DECLARE(apr_status_t) apr_file_rename(const char *from_path, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, - apr_file_t *file) +APR_DECLARE(fspr_status_t) fspr_os_file_get(fspr_os_file_t *thefile, + fspr_file_t *file) { *thefile = file->filedes; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, - apr_os_file_t *thefile, - apr_int32_t flags, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_file_put(fspr_file_t **file, + fspr_os_file_t *thefile, + fspr_int32_t flags, fspr_pool_t *pool) { int *dafile = thefile; - (*file) = apr_pcalloc(pool, sizeof(apr_file_t)); + (*file) = fspr_pcalloc(pool, sizeof(fspr_file_t)); (*file)->pool = pool; (*file)->eof_hit = 0; (*file)->blocking = BLK_UNKNOWN; /* in case it is a pipe */ @@ -232,18 +232,18 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, (*file)->buffered = (flags & APR_BUFFERED) > 0; #ifndef WAITIO_USES_POLL - /* Start out with no pollset. apr_wait_for_io_or_timeout() will + /* Start out with no pollset. fspr_wait_for_io_or_timeout() will * initialize the pollset if needed. */ (*file)->pollset = NULL; #endif if ((*file)->buffered) { - (*file)->buffer = apr_palloc(pool, APR_FILE_BUFSIZE); + (*file)->buffer = fspr_palloc(pool, APR_FILE_BUFSIZE); #if APR_HAS_THREADS if ((*file)->flags & APR_XTHREAD) { - apr_status_t rv; - rv = apr_thread_mutex_create(&((*file)->thlock), + fspr_status_t rv; + rv = fspr_thread_mutex_create(&((*file)->thlock), APR_THREAD_MUTEX_DEFAULT, pool); if (rv) { return rv; @@ -254,7 +254,7 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr) +APR_DECLARE(fspr_status_t) fspr_file_eof(fspr_file_t *fptr) { if (fptr->eof_hit == 1) { return APR_EOF; @@ -262,32 +262,32 @@ APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_file_open_stderr(fspr_file_t **thefile, + fspr_pool_t *pool) { int fd = STDERR_FILENO; - return apr_os_file_put(thefile, &fd, 0, pool); + return fspr_os_file_put(thefile, &fd, 0, pool); } -APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_file_open_stdout(fspr_file_t **thefile, + fspr_pool_t *pool) { int fd = STDOUT_FILENO; - return apr_os_file_put(thefile, &fd, 0, pool); + return fspr_os_file_put(thefile, &fd, 0, pool); } -APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_file_open_stdin(fspr_file_t **thefile, + fspr_pool_t *pool) { int fd = STDIN_FILENO; - return apr_os_file_put(thefile, &fd, 0, pool); + return fspr_os_file_put(thefile, &fd, 0, pool); } -APR_IMPLEMENT_INHERIT_SET(file, flags, pool, apr_unix_file_cleanup) +APR_IMPLEMENT_INHERIT_SET(file, flags, pool, fspr_unix_file_cleanup) -APR_IMPLEMENT_INHERIT_UNSET(file, flags, pool, apr_unix_file_cleanup) +APR_IMPLEMENT_INHERIT_UNSET(file, flags, pool, fspr_unix_file_cleanup) APR_POOL_IMPLEMENT_ACCESSOR(file) diff --git a/libs/apr/file_io/unix/pipe.c b/libs/apr/file_io/unix/pipe.c index 5411f5d407..66086fbbf0 100644 --- a/libs/apr/file_io/unix/pipe.c +++ b/libs/apr/file_io/unix/pipe.c @@ -14,11 +14,11 @@ * limitations under the License. */ -#include "apr_arch_file_io.h" -#include "apr_strings.h" -#include "apr_portable.h" +#include "fspr_arch_file_io.h" +#include "fspr_strings.h" +#include "fspr_portable.h" -#include "apr_arch_inherit.h" +#include "fspr_arch_inherit.h" /* Figure out how to get pipe block/nonblock on BeOS... * Basically, BONE7 changed things again so that ioctl didn't work, @@ -33,7 +33,7 @@ #endif #endif -static apr_status_t pipeblock(apr_file_t *thepipe) +static fspr_status_t pipeblock(fspr_file_t *thepipe) { #if !BEOS_BLOCKING int fd_flags; @@ -69,7 +69,7 @@ static apr_status_t pipeblock(apr_file_t *thepipe) return APR_SUCCESS; } -static apr_status_t pipenonblock(apr_file_t *thepipe) +static fspr_status_t pipenonblock(fspr_file_t *thepipe) { #if !BEOS_BLOCKING int fd_flags = fcntl(thepipe->filedes, F_GETFL, 0); @@ -105,7 +105,7 @@ static apr_status_t pipenonblock(apr_file_t *thepipe) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout) +APR_DECLARE(fspr_status_t) fspr_file_pipe_timeout_set(fspr_file_t *thepipe, fspr_interval_time_t timeout) { if (thepipe->is_pipe == 1) { thepipe->timeout = timeout; @@ -124,7 +124,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_int return APR_EINVAL; } -APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout) +APR_DECLARE(fspr_status_t) fspr_file_pipe_timeout_get(fspr_file_t *thepipe, fspr_interval_time_t *timeout) { if (thepipe->is_pipe == 1) { *timeout = thepipe->timeout; @@ -133,14 +133,14 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_int return APR_EINVAL; } -APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file, - apr_os_file_t *thefile, +APR_DECLARE(fspr_status_t) fspr_os_pipe_put_ex(fspr_file_t **file, + fspr_os_file_t *thefile, int register_cleanup, - apr_pool_t *pool) + fspr_pool_t *pool) { int *dafile = thefile; - (*file) = apr_pcalloc(pool, sizeof(apr_file_t)); + (*file) = fspr_pcalloc(pool, sizeof(fspr_file_t)); (*file)->pool = pool; (*file)->eof_hit = 0; (*file)->is_pipe = 1; @@ -156,12 +156,12 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file, (*file)->thlock = NULL; #endif if (register_cleanup) { - apr_pool_cleanup_register((*file)->pool, (void *)(*file), - apr_unix_file_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register((*file)->pool, (void *)(*file), + fspr_unix_file_cleanup, + fspr_pool_cleanup_null); } #ifndef WAITIO_USES_POLL - /* Start out with no pollset. apr_wait_for_io_or_timeout() will + /* Start out with no pollset. fspr_wait_for_io_or_timeout() will * initialize the pollset if needed. */ (*file)->pollset = NULL; @@ -169,14 +169,14 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, - apr_os_file_t *thefile, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_pipe_put(fspr_file_t **file, + fspr_os_file_t *thefile, + fspr_pool_t *pool) { - return apr_os_pipe_put_ex(file, thefile, 0, pool); + return fspr_os_pipe_put_ex(file, thefile, 0, pool); } -APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_file_pipe_create(fspr_file_t **in, fspr_file_t **out, fspr_pool_t *pool) { int filedes[2]; @@ -184,7 +184,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out return errno; } - (*in) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); + (*in) = (fspr_file_t *)fspr_pcalloc(pool, sizeof(fspr_file_t)); (*in)->pool = pool; (*in)->filedes = filedes[0]; (*in)->is_pipe = 1; @@ -200,7 +200,7 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out #ifndef WAITIO_USES_POLL (*in)->pollset = NULL; #endif - (*out) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); + (*out) = (fspr_file_t *)fspr_pcalloc(pool, sizeof(fspr_file_t)); (*out)->pool = pool; (*out)->filedes = filedes[1]; (*out)->is_pipe = 1; @@ -215,17 +215,17 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out #ifndef WAITIO_USES_POLL (*out)->pollset = NULL; #endif - apr_pool_cleanup_register((*in)->pool, (void *)(*in), apr_unix_file_cleanup, - apr_pool_cleanup_null); - apr_pool_cleanup_register((*out)->pool, (void *)(*out), apr_unix_file_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register((*in)->pool, (void *)(*in), fspr_unix_file_cleanup, + fspr_pool_cleanup_null); + fspr_pool_cleanup_register((*out)->pool, (void *)(*out), fspr_unix_file_cleanup, + fspr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, - apr_fileperms_t perm, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_file_namedpipe_create(const char *filename, + fspr_fileperms_t perm, fspr_pool_t *pool) { - mode_t mode = apr_unix_perms2mode(perm); + mode_t mode = fspr_unix_perms2mode(perm); if (mkfifo(filename, mode) == -1) { return errno; diff --git a/libs/apr/file_io/unix/readwrite.c b/libs/apr/file_io/unix/readwrite.c index 1721582ba8..2006b6f274 100644 --- a/libs/apr/file_io/unix/readwrite.c +++ b/libs/apr/file_io/unix/readwrite.c @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "apr_arch_file_io.h" -#include "apr_strings.h" -#include "apr_thread_mutex.h" -#include "apr_support.h" +#include "fspr_arch_file_io.h" +#include "fspr_strings.h" +#include "fspr_thread_mutex.h" +#include "fspr_support.h" /* The only case where we don't use wait_for_io_or_timeout is on * pre-BONE BeOS, so this check should be sufficient and simpler */ @@ -25,10 +25,10 @@ #define USE_WAIT_FOR_IO #endif -APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) +APR_DECLARE(fspr_status_t) fspr_file_read(fspr_file_t *thefile, void *buf, fspr_size_t *nbytes) { - apr_ssize_t rv; - apr_size_t bytes_read; + fspr_ssize_t rv; + fspr_size_t bytes_read; if (*nbytes <= 0) { *nbytes = 0; @@ -37,21 +37,21 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size if (thefile->buffered) { char *pos = (char *)buf; - apr_uint64_t blocksize; - apr_uint64_t size = *nbytes; + fspr_uint64_t blocksize; + fspr_uint64_t size = *nbytes; #if APR_HAS_THREADS if (thefile->thlock) { - apr_thread_mutex_lock(thefile->thlock); + fspr_thread_mutex_lock(thefile->thlock); } #endif if (thefile->direction == 1) { - rv = apr_file_flush(thefile); + rv = fspr_file_flush(thefile); if (rv) { #if APR_HAS_THREADS if (thefile->thlock) { - apr_thread_mutex_unlock(thefile->thlock); + fspr_thread_mutex_unlock(thefile->thlock); } #endif return rv; @@ -98,7 +98,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size } #if APR_HAS_THREADS if (thefile->thlock) { - apr_thread_mutex_unlock(thefile->thlock); + fspr_thread_mutex_unlock(thefile->thlock); } #endif return rv; @@ -124,7 +124,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && thefile->timeout != 0) { - apr_status_t arv = apr_wait_for_io_or_timeout(thefile, NULL, 1); + fspr_status_t arv = fspr_wait_for_io_or_timeout(thefile, NULL, 1); if (arv != APR_SUCCESS) { *nbytes = bytes_read; return arv; @@ -149,9 +149,9 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size } } -APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) +APR_DECLARE(fspr_status_t) fspr_file_write(fspr_file_t *thefile, const void *buf, fspr_size_t *nbytes) { - apr_size_t rv; + fspr_size_t rv; if (thefile->buffered) { char *pos = (char *)buf; @@ -160,7 +160,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a #if APR_HAS_THREADS if (thefile->thlock) { - apr_thread_mutex_lock(thefile->thlock); + fspr_thread_mutex_lock(thefile->thlock); } #endif @@ -168,7 +168,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a /* Position file pointer for writing at the offset we are * logically reading from */ - apr_int64_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; + fspr_int64_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; if (offset != thefile->filePtr) lseek(thefile->filedes, offset, SEEK_SET); thefile->bufpos = thefile->dataRead = 0; @@ -178,7 +178,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a rv = 0; while (rv == 0 && size > 0) { if (thefile->bufpos == APR_FILE_BUFSIZE) /* write buffer is full*/ - rv = apr_file_flush(thefile); + rv = fspr_file_flush(thefile); blocksize = size > APR_FILE_BUFSIZE - thefile->bufpos ? APR_FILE_BUFSIZE - thefile->bufpos : size; @@ -190,7 +190,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a #if APR_HAS_THREADS if (thefile->thlock) { - apr_thread_mutex_unlock(thefile->thlock); + fspr_thread_mutex_unlock(thefile->thlock); } #endif return rv; @@ -198,12 +198,12 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a else { do { rv = write(thefile->filedes, buf, *nbytes); - } while (rv == (apr_size_t)-1 && errno == EINTR); + } while (rv == (fspr_size_t)-1 && errno == EINTR); #ifdef USE_WAIT_FOR_IO - if (rv == (apr_size_t)-1 && + if (rv == (fspr_size_t)-1 && (errno == EAGAIN || errno == EWOULDBLOCK) && thefile->timeout != 0) { - apr_status_t arv = apr_wait_for_io_or_timeout(thefile, NULL, 0); + fspr_status_t arv = fspr_wait_for_io_or_timeout(thefile, NULL, 0); if (arv != APR_SUCCESS) { *nbytes = 0; return arv; @@ -212,8 +212,8 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a do { do { rv = write(thefile->filedes, buf, *nbytes); - } while (rv == (apr_size_t)-1 && errno == EINTR); - if (rv == (apr_size_t)-1 && + } while (rv == (fspr_size_t)-1 && errno == EINTR); + if (rv == (fspr_size_t)-1 && (errno == EAGAIN || errno == EWOULDBLOCK)) { *nbytes /= 2; /* yes, we'll loop if kernel lied * and we can't even write 1 byte @@ -226,7 +226,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a } } #endif - if (rv == (apr_size_t)-1) { + if (rv == (fspr_size_t)-1) { (*nbytes) = 0; return errno; } @@ -235,8 +235,8 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a } } -APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iovec *vec, - apr_size_t nvec, apr_size_t *nbytes) +APR_DECLARE(fspr_status_t) fspr_file_writev(fspr_file_t *thefile, const struct iovec *vec, + fspr_size_t nvec, fspr_size_t *nbytes) { #ifdef HAVE_WRITEV int bytes; @@ -261,49 +261,49 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iove * The only reasonable option, that maintains the semantics of a real * writev(), is to only write the first iovec. Callers of file_writev() * must deal with partial writes as they normally would. If you want to - * ensure an entire iovec is written, use apr_file_writev_full(). + * ensure an entire iovec is written, use fspr_file_writev_full(). */ *nbytes = vec[0].iov_len; - return apr_file_write(thefile, vec[0].iov_base, nbytes); + return fspr_file_write(thefile, vec[0].iov_base, nbytes); #endif } -APR_DECLARE(apr_status_t) apr_file_putc(char ch, apr_file_t *thefile) +APR_DECLARE(fspr_status_t) fspr_file_putc(char ch, fspr_file_t *thefile) { - apr_size_t nbytes = 1; + fspr_size_t nbytes = 1; - return apr_file_write(thefile, &ch, &nbytes); + return fspr_file_write(thefile, &ch, &nbytes); } -APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile) +APR_DECLARE(fspr_status_t) fspr_file_ungetc(char ch, fspr_file_t *thefile) { thefile->ungetchar = (unsigned char)ch; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_getc(char *ch, apr_file_t *thefile) +APR_DECLARE(fspr_status_t) fspr_file_getc(char *ch, fspr_file_t *thefile) { - apr_size_t nbytes = 1; + fspr_size_t nbytes = 1; - return apr_file_read(thefile, ch, &nbytes); + return fspr_file_read(thefile, ch, &nbytes); } -APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile) +APR_DECLARE(fspr_status_t) fspr_file_puts(const char *str, fspr_file_t *thefile) { - return apr_file_write_full(thefile, str, strlen(str), NULL); + return fspr_file_write_full(thefile, str, strlen(str), NULL); } -APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile) +APR_DECLARE(fspr_status_t) fspr_file_flush(fspr_file_t *thefile) { if (thefile->buffered) { - apr_int64_t written = 0; + fspr_int64_t written = 0; if (thefile->direction == 1 && thefile->bufpos) { do { written = write(thefile->filedes, thefile->buffer, thefile->bufpos); - } while (written == (apr_int64_t)-1 && errno == EINTR); - if (written == (apr_int64_t)-1) { + } while (written == (fspr_int64_t)-1 && errno == EINTR); + if (written == (fspr_int64_t)-1) { return errno; } thefile->filePtr += written; @@ -316,10 +316,10 @@ APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) +APR_DECLARE(fspr_status_t) fspr_file_gets(char *str, int len, fspr_file_t *thefile) { - apr_status_t rv = APR_SUCCESS; /* get rid of gcc warning */ - apr_size_t nbytes; + fspr_status_t rv = APR_SUCCESS; /* get rid of gcc warning */ + fspr_size_t nbytes; const char *str_start = str; char *final = str + len - 1; @@ -330,22 +330,22 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) } /* If we have an underlying buffer, we can be *much* more efficient - * and skip over the apr_file_read calls. + * and skip over the fspr_file_read calls. */ if (thefile->buffered) { #if APR_HAS_THREADS if (thefile->thlock) { - apr_thread_mutex_lock(thefile->thlock); + fspr_thread_mutex_lock(thefile->thlock); } #endif if (thefile->direction == 1) { - rv = apr_file_flush(thefile); + rv = fspr_file_flush(thefile); if (rv) { #if APR_HAS_THREADS if (thefile->thlock) { - apr_thread_mutex_unlock(thefile->thlock); + fspr_thread_mutex_unlock(thefile->thlock); } #endif return rv; @@ -357,14 +357,14 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) } while (str < final) { /* leave room for trailing '\0' */ - /* Force ungetc leftover to call apr_file_read. */ + /* Force ungetc leftover to call fspr_file_read. */ if (thefile->bufpos < thefile->dataRead && thefile->ungetchar == -1) { *str = thefile->buffer[thefile->bufpos++]; } else { nbytes = 1; - rv = apr_file_read(thefile, str, &nbytes); + rv = fspr_file_read(thefile, str, &nbytes); if (rv != APR_SUCCESS) { break; } @@ -378,14 +378,14 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) #if APR_HAS_THREADS if (thefile->thlock) { - apr_thread_mutex_unlock(thefile->thlock); + fspr_thread_mutex_unlock(thefile->thlock); } #endif } else { while (str < final) { /* leave room for trailing '\0' */ nbytes = 1; - rv = apr_file_read(thefile, str, &nbytes); + rv = fspr_file_read(thefile, str, &nbytes); if (rv != APR_SUCCESS) { break; } @@ -410,17 +410,17 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) return rv; } -struct apr_file_printf_data { - apr_vformatter_buff_t vbuff; - apr_file_t *fptr; +struct fspr_file_printf_data { + fspr_vformatter_buff_t vbuff; + fspr_file_t *fptr; char *buf; }; -static int file_printf_flush(apr_vformatter_buff_t *buff) +static int file_printf_flush(fspr_vformatter_buff_t *buff) { - struct apr_file_printf_data *data = (struct apr_file_printf_data *)buff; + struct fspr_file_printf_data *data = (struct fspr_file_printf_data *)buff; - if (apr_file_write_full(data->fptr, data->buf, + if (fspr_file_write_full(data->fptr, data->buf, data->vbuff.curpos - data->buf, NULL)) { return -1; } @@ -429,10 +429,10 @@ static int file_printf_flush(apr_vformatter_buff_t *buff) return 0; } -APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, +APR_DECLARE_NONSTD(int) fspr_file_printf(fspr_file_t *fptr, const char *format, ...) { - struct apr_file_printf_data data; + struct fspr_file_printf_data data; va_list ap; int count; @@ -445,10 +445,10 @@ APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, data.vbuff.endpos = data.buf + HUGE_STRING_LEN; data.fptr = fptr; va_start(ap, format); - count = apr_vformatter(file_printf_flush, - (apr_vformatter_buff_t *)&data, format, ap); - /* apr_vformatter does not call flush for the last bits */ - if (count >= 0) file_printf_flush((apr_vformatter_buff_t *)&data); + count = fspr_vformatter(file_printf_flush, + (fspr_vformatter_buff_t *)&data, format, ap); + /* fspr_vformatter does not call flush for the last bits */ + if (count >= 0) file_printf_flush((fspr_vformatter_buff_t *)&data); va_end(ap); diff --git a/libs/apr/file_io/unix/seek.c b/libs/apr/file_io/unix/seek.c index d1fe484627..c477d86e93 100644 --- a/libs/apr/file_io/unix/seek.c +++ b/libs/apr/file_io/unix/seek.c @@ -14,15 +14,15 @@ * limitations under the License. */ -#include "apr_arch_file_io.h" +#include "fspr_arch_file_io.h" -static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) +static fspr_status_t setptr(fspr_file_t *thefile, fspr_off_t pos ) { - apr_off_t newbufpos; - apr_status_t rv; + fspr_off_t newbufpos; + fspr_status_t rv; if (thefile->direction == 1) { - rv = apr_file_flush(thefile); + rv = fspr_file_flush(thefile); if (rv) { return rv; } @@ -49,15 +49,15 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) } -APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) +APR_DECLARE(fspr_status_t) fspr_file_seek(fspr_file_t *thefile, fspr_seek_where_t where, fspr_off_t *offset) { - apr_off_t rv; + fspr_off_t rv; thefile->eof_hit = 0; if (thefile->buffered) { int rc = EINVAL; - apr_finfo_t finfo; + fspr_finfo_t finfo; switch (where) { case APR_SET: @@ -69,7 +69,7 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh break; case APR_END: - rc = apr_file_info_get(&finfo, APR_FINFO_SIZE, thefile); + rc = fspr_file_info_get(&finfo, APR_FINFO_SIZE, thefile); if (rc == APR_SUCCESS) rc = setptr(thefile, finfo.size + *offset); break; @@ -91,7 +91,7 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh } } -apr_status_t apr_file_trunc(apr_file_t *fp, apr_off_t offset) +fspr_status_t fspr_file_trunc(fspr_file_t *fp, fspr_off_t offset) { if (ftruncate(fp->filedes, offset) == -1) { return errno; diff --git a/libs/apr/file_io/unix/tempdir.c b/libs/apr/file_io/unix/tempdir.c index 1138e2c900..6a0091d5dc 100644 --- a/libs/apr/file_io/unix/tempdir.c +++ b/libs/apr/file_io/unix/tempdir.c @@ -13,22 +13,22 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "apr_private.h" -#include "apr_file_io.h" -#include "apr_strings.h" -#include "apr_env.h" +#include "fspr_private.h" +#include "fspr_file_io.h" +#include "fspr_strings.h" +#include "fspr_env.h" /* Try to open a temporary file in the temporary dir, write to it, and then close it. */ -static int test_tempdir(const char *temp_dir, apr_pool_t *p) +static int test_tempdir(const char *temp_dir, fspr_pool_t *p) { - apr_file_t *dummy_file; - char *path = apr_pstrcat(p, temp_dir, "/apr-tmp.XXXXXX", NULL); + fspr_file_t *dummy_file; + char *path = fspr_pstrcat(p, temp_dir, "/apr-tmp.XXXXXX", NULL); - if (apr_file_mktemp(&dummy_file, path, 0, p) == APR_SUCCESS) { - if (apr_file_putc('!', dummy_file) == APR_SUCCESS) { - if (apr_file_close(dummy_file) == APR_SUCCESS) { + if (fspr_file_mktemp(&dummy_file, path, 0, p) == APR_SUCCESS) { + if (fspr_file_putc('!', dummy_file) == APR_SUCCESS) { + if (fspr_file_close(dummy_file) == APR_SUCCESS) { return 1; } } @@ -37,10 +37,10 @@ static int test_tempdir(const char *temp_dir, apr_pool_t *p) } -APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_temp_dir_get(const char **temp_dir, + fspr_pool_t *p) { - apr_status_t apr_err; + fspr_status_t fspr_err; const char *try_dirs[] = { "/tmp", "/usr/tmp", "/var/tmp" }; const char *try_envs[] = { "TMP", "TEMP", "TMPDIR" }; const char *dir; @@ -69,9 +69,9 @@ APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir, /* Try the environment first. */ for (i = 0; i < (sizeof(try_envs) / sizeof(const char *)); i++) { char *value; - apr_err = apr_env_get(&value, try_envs[i], p); - if ((apr_err == APR_SUCCESS) && value) { - apr_size_t len = strlen(value); + fspr_err = fspr_env_get(&value, try_envs[i], p); + if ((fspr_err == APR_SUCCESS) && value) { + fspr_size_t len = strlen(value); if (len && (len < APR_PATH_MAX) && test_tempdir(value, p)) { dir = value; goto end; @@ -114,7 +114,7 @@ APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir, #endif /* Finally, try the current working directory. */ - if (APR_SUCCESS == apr_filepath_get(&cwd, APR_FILEPATH_NATIVE, p)) { + if (APR_SUCCESS == fspr_filepath_get(&cwd, APR_FILEPATH_NATIVE, p)) { if (test_tempdir(cwd, p)) { dir = cwd; goto end; @@ -125,6 +125,6 @@ APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir, return APR_EGENERAL; end: - *temp_dir = apr_pstrdup(p, dir); + *temp_dir = fspr_pstrdup(p, dir); return APR_SUCCESS; } diff --git a/libs/apr/file_io/win32/dir.c b/libs/apr/file_io/win32/dir.c index 76fe42bca8..809f9e08fd 100644 --- a/libs/apr/file_io/win32/dir.c +++ b/libs/apr/file_io/win32/dir.c @@ -14,12 +14,12 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_arch_file_io.h" -#include "apr_file_io.h" -#include "apr_strings.h" -#include "apr_portable.h" -#include "apr_arch_atime.h" +#include "fspr.h" +#include "fspr_arch_file_io.h" +#include "fspr_file_io.h" +#include "fspr_strings.h" +#include "fspr_portable.h" +#include "fspr_arch_atime.h" #if APR_HAVE_ERRNO_H #include @@ -35,27 +35,27 @@ #endif -static apr_status_t dir_cleanup(void *thedir) +static fspr_status_t dir_cleanup(void *thedir) { - apr_dir_t *dir = thedir; + fspr_dir_t *dir = thedir; if (dir->dirhand != INVALID_HANDLE_VALUE && !FindClose(dir->dirhand)) { - return apr_get_os_error(); + return fspr_get_os_error(); } dir->dirhand = INVALID_HANDLE_VALUE; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_dir_open(fspr_dir_t **new, const char *dirname, + fspr_pool_t *pool) { - apr_status_t rv; + fspr_status_t rv; - apr_size_t len = strlen(dirname); - (*new) = apr_pcalloc(pool, sizeof(apr_dir_t)); + fspr_size_t len = strlen(dirname); + (*new) = fspr_pcalloc(pool, sizeof(fspr_dir_t)); /* Leave room here to add and pop the '*' wildcard for FindFirstFile * and double-null terminate so we have one character to change. */ - (*new)->dirname = apr_palloc(pool, len + 3); + (*new)->dirname = fspr_palloc(pool, len + 3); memcpy((*new)->dirname, dirname, len); if (len && (*new)->dirname[len - 1] != '/') { (*new)->dirname[len++] = '/'; @@ -68,8 +68,8 @@ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, { /* Create a buffer for the longest file name we will ever see */ - (*new)->w.entry = apr_pcalloc(pool, sizeof(WIN32_FIND_DATAW)); - (*new)->name = apr_pcalloc(pool, APR_FILE_MAX * 3 + 1); + (*new)->w.entry = fspr_pcalloc(pool, sizeof(WIN32_FIND_DATAW)); + (*new)->name = fspr_pcalloc(pool, APR_FILE_MAX * 3 + 1); } #endif #if APR_HAS_ANSI_FS @@ -85,16 +85,16 @@ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, (*new) = NULL; return APR_ENAMETOOLONG; } - (*new)->n.entry = apr_pcalloc(pool, sizeof(WIN32_FIND_DATAW)); + (*new)->n.entry = fspr_pcalloc(pool, sizeof(WIN32_FIND_DATAW)); } #endif (*new)->rootlen = len - 1; (*new)->pool = pool; (*new)->dirhand = INVALID_HANDLE_VALUE; - apr_pool_cleanup_register((*new)->pool, (void *)(*new), dir_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register((*new)->pool, (void *)(*new), dir_cleanup, + fspr_pool_cleanup_null); - rv = apr_dir_read(NULL, 0, *new); + rv = fspr_dir_read(NULL, 0, *new); if (rv != APR_SUCCESS) { dir_cleanup(*new); *new = NULL; @@ -103,33 +103,33 @@ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, return rv; } -APR_DECLARE(apr_status_t) apr_dir_close(apr_dir_t *dir) +APR_DECLARE(fspr_status_t) fspr_dir_close(fspr_dir_t *dir) { - apr_pool_cleanup_kill(dir->pool, dir, dir_cleanup); + fspr_pool_cleanup_kill(dir->pool, dir, dir_cleanup); return dir_cleanup(dir); } -APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, - apr_dir_t *thedir) +APR_DECLARE(fspr_status_t) fspr_dir_read(fspr_finfo_t *finfo, fspr_int32_t wanted, + fspr_dir_t *thedir) { - apr_status_t rv; + fspr_status_t rv; char *fname; /* The while loops below allow us to skip all invalid file names, so that * we aren't reporting any files where their absolute paths are too long. */ #if APR_HAS_UNICODE_FS - apr_wchar_t wdirname[APR_PATH_MAX]; - apr_wchar_t *eos = NULL; + fspr_wchar_t wdirname[APR_PATH_MAX]; + fspr_wchar_t *eos = NULL; IF_WIN_OS_IS_UNICODE { - /* This code path is always be invoked by apr_dir_open or - * apr_dir_rewind, so return without filling out the finfo. + /* This code path is always be invoked by fspr_dir_open or + * fspr_dir_rewind, so return without filling out the finfo. */ if (thedir->dirhand == INVALID_HANDLE_VALUE) { - apr_status_t rv; + fspr_status_t rv; if (rv = utf8_to_unicode_path(wdirname, sizeof(wdirname) - / sizeof(apr_wchar_t), + / sizeof(fspr_wchar_t), thedir->dirname)) { return rv; } @@ -139,27 +139,27 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, thedir->dirhand = FindFirstFileW(wdirname, thedir->w.entry); eos[0] = '\0'; if (thedir->dirhand == INVALID_HANDLE_VALUE) { - return apr_get_os_error(); + return fspr_get_os_error(); } thedir->bof = 1; return APR_SUCCESS; } else if (thedir->bof) { /* Noop - we already called FindFirstFileW from - * either apr_dir_open or apr_dir_rewind ... use + * either fspr_dir_open or fspr_dir_rewind ... use * that first record. */ thedir->bof = 0; } else if (!FindNextFileW(thedir->dirhand, thedir->w.entry)) { - return apr_get_os_error(); + return fspr_get_os_error(); } while (thedir->rootlen && thedir->rootlen + wcslen(thedir->w.entry->cFileName) >= APR_PATH_MAX) { if (!FindNextFileW(thedir->dirhand, thedir->w.entry)) { - return apr_get_os_error(); + return fspr_get_os_error(); } } if (rv = unicode_to_utf8_path(thedir->name, APR_FILE_MAX * 3 + 1, @@ -171,8 +171,8 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, #if APR_HAS_ANSI_FS ELSE_WIN_OS_IS_ANSI { - /* This code path is always be invoked by apr_dir_open or - * apr_dir_rewind, so return without filling out the finfo. + /* This code path is always be invoked by fspr_dir_open or + * fspr_dir_rewind, so return without filling out the finfo. */ if (thedir->dirhand == INVALID_HANDLE_VALUE) { /* '/' terminated, so add the '*' and pop it when we finish */ @@ -183,26 +183,26 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, thedir->n.entry); eop[0] = '\0'; if (thedir->dirhand == INVALID_HANDLE_VALUE) { - return apr_get_os_error(); + return fspr_get_os_error(); } thedir->bof = 1; return APR_SUCCESS; } else if (thedir->bof) { /* Noop - we already called FindFirstFileW from - * either apr_dir_open or apr_dir_rewind ... use + * either fspr_dir_open or fspr_dir_rewind ... use * that first record. */ thedir->bof = 0; } else if (!FindNextFile(thedir->dirhand, thedir->n.entry)) { - return apr_get_os_error(); + return fspr_get_os_error(); } while (thedir->rootlen && thedir->rootlen + strlen(thedir->n.entry->cFileName) >= MAX_PATH) { if (!FindNextFileW(thedir->dirhand, thedir->w.entry)) { - return apr_get_os_error(); + return fspr_get_os_error(); } } fname = thedir->n.entry->cFileName; @@ -244,11 +244,11 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, #else char fspec[APR_PATH_MAX]; #endif - apr_size_t dirlen = strlen(thedir->dirname); + fspr_size_t dirlen = strlen(thedir->dirname); if (dirlen >= sizeof(fspec)) dirlen = sizeof(fspec) - 1; - apr_cpystrn(fspec, thedir->dirname, sizeof(fspec)); - apr_cpystrn(fspec + dirlen, fname, sizeof(fspec) - dirlen); + fspr_cpystrn(fspec, thedir->dirname, sizeof(fspec)); + fspr_cpystrn(fspec + dirlen, fname, sizeof(fspec) - dirlen); return more_finfo(finfo, fspec, wanted, MORE_OF_FSPEC); } #endif @@ -257,66 +257,66 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *dir) +APR_DECLARE(fspr_status_t) fspr_dir_rewind(fspr_dir_t *dir) { - apr_status_t rv; + fspr_status_t rv; /* this will mark the handle as invalid and we'll open it - * again if apr_dir_read() is subsequently called + * again if fspr_dir_read() is subsequently called */ rv = dir_cleanup(dir); if (rv == APR_SUCCESS) - rv = apr_dir_read(NULL, 0, dir); + rv = fspr_dir_read(NULL, 0, dir); return rv; } -APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_dir_make(const char *path, fspr_fileperms_t perm, + fspr_pool_t *pool) { #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { - apr_wchar_t wpath[APR_PATH_MAX]; - apr_status_t rv; + fspr_wchar_t wpath[APR_PATH_MAX]; + fspr_status_t rv; if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) - / sizeof(apr_wchar_t), path)) { + / sizeof(fspr_wchar_t), path)) { return rv; } if (!CreateDirectoryW(wpath, NULL)) { - return apr_get_os_error(); + return fspr_get_os_error(); } } #endif #if APR_HAS_ANSI_FS ELSE_WIN_OS_IS_ANSI if (!CreateDirectory(path, NULL)) { - return apr_get_os_error(); + return fspr_get_os_error(); } #endif return APR_SUCCESS; } -static apr_status_t dir_make_parent(char *path, - apr_fileperms_t perm, - apr_pool_t *pool) +static fspr_status_t dir_make_parent(char *path, + fspr_fileperms_t perm, + fspr_pool_t *pool) { - apr_status_t rv; + fspr_status_t rv; char *ch = strrchr(path, '\\'); if (!ch) { return APR_ENOENT; } *ch = '\0'; - rv = apr_dir_make (path, perm, pool); /* Try to make straight off */ + rv = fspr_dir_make (path, perm, pool); /* Try to make straight off */ if (APR_STATUS_IS_ENOENT(rv)) { /* Missing an intermediate dir */ rv = dir_make_parent(path, perm, pool); if (rv == APR_SUCCESS) { - rv = apr_dir_make (path, perm, pool); /* And complete the path */ + rv = fspr_dir_make (path, perm, pool); /* And complete the path */ } } @@ -324,13 +324,13 @@ static apr_status_t dir_make_parent(char *path, return rv; } -APR_DECLARE(apr_status_t) apr_dir_make_recursive(const char *path, - apr_fileperms_t perm, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_dir_make_recursive(const char *path, + fspr_fileperms_t perm, + fspr_pool_t *pool) { - apr_status_t rv = 0; + fspr_status_t rv = 0; - rv = apr_dir_make (path, perm, pool); /* Try to make PATH right out */ + rv = fspr_dir_make (path, perm, pool); /* Try to make PATH right out */ if (APR_STATUS_IS_EEXIST(rv)) /* It's OK if PATH exists */ return APR_SUCCESS; @@ -338,45 +338,45 @@ APR_DECLARE(apr_status_t) apr_dir_make_recursive(const char *path, if (APR_STATUS_IS_ENOENT(rv)) { /* Missing an intermediate dir */ char *dir; - rv = apr_filepath_merge(&dir, "", path, APR_FILEPATH_NATIVE, pool); + rv = fspr_filepath_merge(&dir, "", path, APR_FILEPATH_NATIVE, pool); if (rv == APR_SUCCESS) rv = dir_make_parent(dir, perm, pool); /* Make intermediate dirs */ if (rv == APR_SUCCESS) - rv = apr_dir_make (dir, perm, pool); /* And complete the path */ + rv = fspr_dir_make (dir, perm, pool); /* And complete the path */ } return rv; } -APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_dir_remove(const char *path, fspr_pool_t *pool) { #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { - apr_wchar_t wpath[APR_PATH_MAX]; - apr_status_t rv; + fspr_wchar_t wpath[APR_PATH_MAX]; + fspr_status_t rv; if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) - / sizeof(apr_wchar_t), path)) { + / sizeof(fspr_wchar_t), path)) { return rv; } if (!RemoveDirectoryW(wpath)) { - return apr_get_os_error(); + return fspr_get_os_error(); } } #endif #if APR_HAS_ANSI_FS ELSE_WIN_OS_IS_ANSI if (!RemoveDirectory(path)) { - return apr_get_os_error(); + return fspr_get_os_error(); } #endif return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_dir_get(apr_os_dir_t **thedir, - apr_dir_t *dir) +APR_DECLARE(fspr_status_t) fspr_os_dir_get(fspr_os_dir_t **thedir, + fspr_dir_t *dir) { if (dir == NULL) { return APR_ENODIR; @@ -385,9 +385,9 @@ APR_DECLARE(apr_status_t) apr_os_dir_get(apr_os_dir_t **thedir, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_dir_put(apr_dir_t **dir, - apr_os_dir_t *thedir, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_dir_put(fspr_dir_t **dir, + fspr_os_dir_t *thedir, + fspr_pool_t *pool) { return APR_ENOTIMPL; } diff --git a/libs/apr/file_io/win32/filedup.c b/libs/apr/file_io/win32/filedup.c index 69e4d91347..f1d5cb08ea 100644 --- a/libs/apr/file_io/win32/filedup.c +++ b/libs/apr/file_io/win32/filedup.c @@ -14,15 +14,15 @@ * limitations under the License. */ -#include "win32/apr_arch_file_io.h" -#include "apr_file_io.h" -#include "apr_general.h" -#include "apr_strings.h" +#include "win32/fspr_arch_file_io.h" +#include "fspr_file_io.h" +#include "fspr_general.h" +#include "fspr_strings.h" #include -#include "apr_arch_inherit.h" +#include "fspr_arch_inherit.h" -APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, - apr_file_t *old_file, apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_file_dup(fspr_file_t **new_file, + fspr_file_t *old_file, fspr_pool_t *p) { #ifdef _WIN32_WCE return APR_ENOTIMPL; @@ -33,31 +33,31 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, if (!DuplicateHandle(hproc, old_file->filehand, hproc, &newhand, 0, FALSE, DUPLICATE_SAME_ACCESS)) { - return apr_get_os_error(); + return fspr_get_os_error(); } - (*new_file) = (apr_file_t *) apr_pcalloc(p, sizeof(apr_file_t)); + (*new_file) = (fspr_file_t *) fspr_pcalloc(p, sizeof(fspr_file_t)); (*new_file)->filehand = newhand; (*new_file)->flags = old_file->flags & ~APR_INHERIT; (*new_file)->pool = p; - (*new_file)->fname = apr_pstrdup(p, old_file->fname); + (*new_file)->fname = fspr_pstrdup(p, old_file->fname); (*new_file)->append = old_file->append; (*new_file)->buffered = FALSE; (*new_file)->ungetchar = old_file->ungetchar; #if APR_HAS_THREADS if (old_file->mutex) { - apr_thread_mutex_create(&((*new_file)->mutex), + fspr_thread_mutex_create(&((*new_file)->mutex), APR_THREAD_MUTEX_DEFAULT, p); } #endif - apr_pool_cleanup_register((*new_file)->pool, (void *)(*new_file), file_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register((*new_file)->pool, (void *)(*new_file), file_cleanup, + fspr_pool_cleanup_null); /* Create a pollset with room for one descriptor. */ /* ### check return codes */ - (void) apr_pollset_create(&(*new_file)->pollset, 1, p, 0); + (void) fspr_pollset_create(&(*new_file)->pollset, 1, p, 0); return APR_SUCCESS; #endif /* !defined(_WIN32_WCE) */ @@ -67,8 +67,8 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, #define stdout_handle 0x02 #define stderr_handle 0x04 -APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, - apr_file_t *old_file, apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_file_dup2(fspr_file_t *new_file, + fspr_file_t *old_file, fspr_pool_t *p) { #ifdef _WIN32_WCE return APR_ENOTIMPL; @@ -76,7 +76,7 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, DWORD stdhandle = 0; HANDLE hproc = GetCurrentProcess(); HANDLE newhand = NULL; - apr_int32_t newflags; + fspr_int32_t newflags; /* dup2 is not supported literaly with native Windows handles. * We can, however, emulate dup2 for the standard i/o handles, @@ -97,12 +97,12 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, if (!DuplicateHandle(hproc, old_file->filehand, hproc, &newhand, 0, TRUE, DUPLICATE_SAME_ACCESS)) { - return apr_get_os_error(); + return fspr_get_os_error(); } if (((stdhandle & stderr_handle) && !SetStdHandle(STD_ERROR_HANDLE, newhand)) || ((stdhandle & stdout_handle) && !SetStdHandle(STD_OUTPUT_HANDLE, newhand)) || ((stdhandle & stdin_handle) && !SetStdHandle(STD_INPUT_HANDLE, newhand))) { - return apr_get_os_error(); + return fspr_get_os_error(); } newflags = old_file->flags | APR_INHERIT; } @@ -110,7 +110,7 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, if (!DuplicateHandle(hproc, old_file->filehand, hproc, &newhand, 0, FALSE, DUPLICATE_SAME_ACCESS)) { - return apr_get_os_error(); + return fspr_get_os_error(); } newflags = old_file->flags & ~APR_INHERIT; } @@ -121,14 +121,14 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, new_file->flags = newflags; new_file->filehand = newhand; - new_file->fname = apr_pstrdup(new_file->pool, old_file->fname); + new_file->fname = fspr_pstrdup(new_file->pool, old_file->fname); new_file->append = old_file->append; new_file->buffered = FALSE; new_file->ungetchar = old_file->ungetchar; #if APR_HAS_THREADS if (old_file->mutex) { - apr_thread_mutex_create(&(new_file->mutex), + fspr_thread_mutex_create(&(new_file->mutex), APR_THREAD_MUTEX_DEFAULT, p); } #endif @@ -137,15 +137,15 @@ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, #endif /* !defined(_WIN32_WCE) */ } -APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, - apr_file_t *old_file, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_file_setaside(fspr_file_t **new_file, + fspr_file_t *old_file, + fspr_pool_t *p) { - *new_file = (apr_file_t *)apr_palloc(p, sizeof(apr_file_t)); - memcpy(*new_file, old_file, sizeof(apr_file_t)); + *new_file = (fspr_file_t *)fspr_palloc(p, sizeof(fspr_file_t)); + memcpy(*new_file, old_file, sizeof(fspr_file_t)); (*new_file)->pool = p; if (old_file->buffered) { - (*new_file)->buffer = apr_palloc(p, APR_FILE_BUFSIZE); + (*new_file)->buffer = fspr_palloc(p, APR_FILE_BUFSIZE); if (old_file->direction == 1) { memcpy((*new_file)->buffer, old_file->buffer, old_file->bufpos); } @@ -154,26 +154,26 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, } } if (old_file->mutex) { - apr_thread_mutex_create(&((*new_file)->mutex), + fspr_thread_mutex_create(&((*new_file)->mutex), APR_THREAD_MUTEX_DEFAULT, p); - apr_thread_mutex_destroy(old_file->mutex); + fspr_thread_mutex_destroy(old_file->mutex); } if (old_file->fname) { - (*new_file)->fname = apr_pstrdup(p, old_file->fname); + (*new_file)->fname = fspr_pstrdup(p, old_file->fname); } if (!(old_file->flags & APR_FILE_NOCLEANUP)) { - apr_pool_cleanup_register(p, (void *)(*new_file), + fspr_pool_cleanup_register(p, (void *)(*new_file), file_cleanup, file_cleanup); } old_file->filehand = INVALID_HANDLE_VALUE; - apr_pool_cleanup_kill(old_file->pool, (void *)old_file, + fspr_pool_cleanup_kill(old_file->pool, (void *)old_file, file_cleanup); /* Create a pollset with room for one descriptor. */ /* ### check return codes */ - (void) apr_pollset_create(&(*new_file)->pollset, 1, p, 0); + (void) fspr_pollset_create(&(*new_file)->pollset, 1, p, 0); return APR_SUCCESS; } diff --git a/libs/apr/file_io/win32/filepath.c b/libs/apr/file_io/win32/filepath.c index 766e35f8d8..353cb2649e 100644 --- a/libs/apr/file_io/win32/filepath.c +++ b/libs/apr/file_io/win32/filepath.c @@ -14,11 +14,11 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_private.h" -#include "apr_arch_file_io.h" -#include "apr_strings.h" -#include "apr_lib.h" +#include "fspr.h" +#include "fspr_private.h" +#include "fspr_arch_file_io.h" +#include "fspr_strings.h" +#include "fspr_lib.h" #include #include @@ -37,10 +37,10 @@ * OS2 appears immune from the nonsense :) */ -APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, +APR_DECLARE(fspr_status_t) fspr_filepath_root(const char **rootpath, const char **inpath, - apr_int32_t flags, - apr_pool_t *p) + fspr_int32_t flags, + fspr_pool_t *p) { const char *testpath = *inpath; char *newpath; @@ -78,7 +78,7 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, Otherwise we either have an incomplete or relative path */ if (volume && strlen(volume) > 0) { - newpath = apr_pcalloc(p, strlen(server)+strlen(volume)+5); + newpath = fspr_pcalloc(p, strlen(server)+strlen(volume)+5); construct(newpath, server, volume, NULL, NULL, NULL, PATH_NETWARE); /* NetWare doesn't add the root slash so we need to add it manually. @@ -106,7 +106,7 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, in same manner as unix although this path will be incomplete. */ - *rootpath = apr_pstrdup(p, seperator); + *rootpath = fspr_pstrdup(p, seperator); do { ++(*inpath); } while ((**inpath == '/') || (**inpath == '\\')); @@ -133,12 +133,12 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, && (testpath[3] == '/' || testpath[3] == '\\')) { if (IS_FNCHAR(testpath[4]) && testpath[5] == ':') { - apr_status_t rv; + fspr_status_t rv; testpath += 4; /* given '//?/C: or //./C: let us try this * all over again from the drive designator */ - rv = apr_filepath_root(rootpath, &testpath, flags, p); + rv = fspr_filepath_root(rootpath, &testpath, flags, p); if (!rv || rv == APR_EINCOMPLETE) *inpath = testpath; return rv; @@ -170,7 +170,7 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, } while (*delim1 && *delim1 != '/' && *delim1 != '\\'); if (*delim1) { - apr_status_t rv; + fspr_status_t rv; delim2 = delim1 + 1; while (*delim2 && *delim2 != '/' && *delim2 != '\\') { /* Protect against //machine/X/ where X is illegal */ @@ -181,7 +181,7 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, /* Copy the '//machine/[share[/]]' path, always providing * an extra byte for the trailing slash. */ - newpath = apr_pstrmemdup(p, testpath, delim2 - testpath + 1); + newpath = fspr_pstrmemdup(p, testpath, delim2 - testpath + 1); if (delim2 == delim1 + 1) { /* We found simply \\machine\, so give up already @@ -196,7 +196,7 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, * Win32 will argue about slashed in UNC paths, * so use backslashes till we finish testing, * and add the trailing backslash [required]. - * apr_pstrmemdup above guarentees us the new + * fspr_pstrmemdup above guarentees us the new * trailing null character. */ newpath[0] = '\\'; @@ -246,7 +246,7 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, */ delim1 = strchr(testpath, '\0'); if (delim1 > testpath + 2) { - newpath = apr_pstrndup(p, testpath, delim1 - testpath + 1); + newpath = fspr_pstrndup(p, testpath, delim1 - testpath + 1); if (flags & APR_FILEPATH_TRUENAME) newpath[delim1 - testpath] = seperator[0]; else @@ -254,7 +254,7 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, newpath[delim1 - testpath + 1] = '\0'; } else { - newpath = apr_pstrndup(p, testpath, delim1 - testpath); + newpath = fspr_pstrndup(p, testpath, delim1 - testpath); } if (flags & APR_FILEPATH_TRUENAME) { newpath[0] = seperator[0]; @@ -268,7 +268,7 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, /* Left with a path of '/', what drive are we asking about? */ *inpath = testpath + 1; - newpath = apr_palloc(p, 2); + newpath = fspr_palloc(p, 2); if (flags & APR_FILEPATH_TRUENAME) newpath[0] = seperator[0]; else @@ -281,20 +281,20 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, /* Evaluate path of 'd:[/]' */ if (IS_FNCHAR(*testpath) && testpath[1] == ':') { - apr_status_t rv; + fspr_status_t rv; /* Validate that D:\ drive exists, test must be rooted * Note that posix/win32 insists a drive letter is upper case, * so who are we to argue with a 'feature'. * It is a safe fold, since only A-Z is legal, and has no * side effects of legal mis-mapped non-us-ascii codes. */ - newpath = apr_palloc(p, 4); + newpath = fspr_palloc(p, 4); newpath[0] = testpath[0]; newpath[1] = testpath[1]; newpath[2] = seperator[0]; newpath[3] = '\0'; if (flags & APR_FILEPATH_TRUENAME) { - newpath[0] = apr_toupper(newpath[0]); + newpath[0] = fspr_toupper(newpath[0]); rv = filepath_root_test(newpath, p); if (rv) return rv; @@ -328,24 +328,24 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, } -APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, +APR_DECLARE(fspr_status_t) fspr_filepath_merge(char **newpath, const char *basepath, const char *addpath, - apr_int32_t flags, - apr_pool_t *p) + fspr_int32_t flags, + fspr_pool_t *p) { char path[APR_PATH_MAX]; /* isn't null term */ const char *baseroot = NULL; const char *addroot; - apr_size_t rootlen; /* the length of the root portion of path, d:/ is 3 */ - apr_size_t baselen; /* the length of basepath (excluding baseroot) */ - apr_size_t keptlen; /* the length of the retained basepath (incl root) */ - apr_size_t pathlen; /* the length of the result path */ - apr_size_t segend; /* the end of the current segment */ - apr_size_t seglen; /* the length of the segment (excl trailing chars) */ - apr_status_t basetype = 0; /* from parsing the basepath's baseroot */ - apr_status_t addtype; /* from parsing the addpath's addroot */ - apr_status_t rv; + fspr_size_t rootlen; /* the length of the root portion of path, d:/ is 3 */ + fspr_size_t baselen; /* the length of basepath (excluding baseroot) */ + fspr_size_t keptlen; /* the length of the retained basepath (incl root) */ + fspr_size_t pathlen; /* the length of the result path */ + fspr_size_t segend; /* the end of the current segment */ + fspr_size_t seglen; /* the length of the segment (excl trailing chars) */ + fspr_status_t basetype = 0; /* from parsing the basepath's baseroot */ + fspr_status_t addtype; /* from parsing the addpath's addroot */ + fspr_status_t rv; #ifndef NETWARE int fixunc = 0; /* flag to complete an incomplete UNC basepath */ #endif @@ -359,7 +359,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, else { /* This call _should_ test the path */ - addtype = apr_filepath_root(&addroot, &addpath, + addtype = fspr_filepath_root(&addroot, &addpath, APR_FILEPATH_TRUENAME | (flags & APR_FILEPATH_NATIVE), p); @@ -370,7 +370,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, addroot = ""; } else if (addtype != APR_EINCOMPLETE) { - /* apr_filepath_root was incomprehensible so fail already + /* fspr_filepath_root was incomprehensible so fail already */ return addtype; } @@ -425,7 +425,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, rv = filepath_drive_get(&getpath, addroot[0], flags, p); else #endif - rv = apr_filepath_get(&getpath, flags, p); + rv = fspr_filepath_get(&getpath, flags, p); if (rv != APR_SUCCESS) return rv; basepath = getpath; @@ -434,7 +434,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, if (!baseroot) { /* This call should _not_ test the path */ - basetype = apr_filepath_root(&baseroot, &basepath, + basetype = fspr_filepath_root(&baseroot, &basepath, (flags & APR_FILEPATH_NATIVE), p); if (basetype == APR_SUCCESS) { basetype = APR_EABSOLUTE; @@ -443,7 +443,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, baseroot = ""; } else if (basetype != APR_EINCOMPLETE) { - /* apr_filepath_root was incomprehensible so fail already + /* fspr_filepath_root was incomprehensible so fail already */ return basetype; } @@ -740,8 +740,8 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, if (fixunc) { const char *testpath = path; const char *testroot; - apr_status_t testtype; - apr_size_t i = (addpath[segend] != '\0'); + fspr_status_t testtype; + fspr_size_t i = (addpath[segend] != '\0'); /* This isn't legal unless the unc path is complete! */ @@ -764,7 +764,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, path[pathlen] = '\0'; /* This call _should_ test the path */ - testtype = apr_filepath_root(&testroot, &testpath, + testtype = fspr_filepath_root(&testroot, &testpath, APR_FILEPATH_TRUENAME | (flags & APR_FILEPATH_NATIVE), p); @@ -774,7 +774,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, fixunc = 0; } else if (testtype != APR_EINCOMPLETE) { - /* apr_filepath_root was very unexpected so fail already + /* fspr_filepath_root was very unexpected so fail already */ return testtype; } @@ -784,7 +784,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, { /* An actual segment, append it to the destination path */ - apr_size_t i = (addpath[segend] != '\0'); + fspr_size_t i = (addpath[segend] != '\0'); if (pathlen + seglen + i >= sizeof(path)) return APR_ENAMETOOLONG; memcpy(path + pathlen, addpath, seglen + i); @@ -835,7 +835,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, } /* Go through all the new segments */ while (keptlen < pathlen) { - apr_finfo_t finfo; + fspr_finfo_t finfo; char saveslash = 0; seglen = 0; /* find any slash and set it aside for a minute. */ @@ -848,10 +848,10 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, } /* Null term for stat! */ path[keptlen + seglen] = '\0'; - if ((rv = apr_stat(&finfo, path, + if ((rv = fspr_stat(&finfo, path, APR_FINFO_LINK | APR_FINFO_TYPE | APR_FINFO_NAME, p)) == APR_SUCCESS) { - apr_size_t namelen = strlen(finfo.name); + fspr_size_t namelen = strlen(finfo.name); #if defined(OS2) /* only has case folding, never aliases that change the length */ @@ -949,28 +949,28 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, } } - *newpath = apr_pmemdup(p, path, pathlen + 1); + *newpath = fspr_pmemdup(p, path, pathlen + 1); (*newpath)[pathlen] = '\0'; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_filepath_list_split(apr_array_header_t **pathelts, +APR_DECLARE(fspr_status_t) fspr_filepath_list_split(fspr_array_header_t **pathelts, const char *liststr, - apr_pool_t *p) + fspr_pool_t *p) { - return apr_filepath_list_split_impl(pathelts, liststr, ';', p); + return fspr_filepath_list_split_impl(pathelts, liststr, ';', p); } -APR_DECLARE(apr_status_t) apr_filepath_list_merge(char **liststr, - apr_array_header_t *pathelts, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_filepath_list_merge(char **liststr, + fspr_array_header_t *pathelts, + fspr_pool_t *p) { - return apr_filepath_list_merge_impl(liststr, pathelts, ';', p); + return fspr_filepath_list_merge_impl(liststr, pathelts, ';', p); } -APR_DECLARE(apr_status_t) apr_filepath_encoding(int *style, apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_filepath_encoding(int *style, fspr_pool_t *p) { #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE diff --git a/libs/apr/file_io/win32/filestat.c b/libs/apr/file_io/win32/filestat.c index af93bb933b..1972ccf3b3 100644 --- a/libs/apr/file_io/win32/filestat.c +++ b/libs/apr/file_io/win32/filestat.c @@ -14,28 +14,28 @@ * limitations under the License. */ -#include "apr.h" +#include "fspr.h" #include -#include "apr_private.h" -#include "apr_arch_file_io.h" -#include "apr_file_io.h" -#include "apr_general.h" -#include "apr_strings.h" -#include "apr_errno.h" -#include "apr_time.h" +#include "fspr_private.h" +#include "fspr_arch_file_io.h" +#include "fspr_file_io.h" +#include "fspr_general.h" +#include "fspr_strings.h" +#include "fspr_errno.h" +#include "fspr_time.h" #include -#include "apr_arch_atime.h" -#include "apr_arch_misc.h" +#include "fspr_arch_atime.h" +#include "fspr_arch_misc.h" /* We have to assure that the file name contains no '*'s, or other * wildcards when using FindFirstFile to recover the true file name. */ -static apr_status_t test_safe_name(const char *name) +static fspr_status_t test_safe_name(const char *name) { /* Only accept ':' in the second position of the filename, * as the drive letter delimiter: */ - if (apr_isalpha(*name) && (name[1] == ':')) { + if (fspr_isalpha(*name) && (name[1] == ':')) { name += 2; } while (*name) { @@ -50,12 +50,12 @@ static apr_status_t test_safe_name(const char *name) return APR_SUCCESS; } -static apr_status_t free_localheap(void *heap) { +static fspr_status_t free_localheap(void *heap) { LocalFree(heap); return APR_SUCCESS; } -static apr_gid_t worldid = NULL; +static fspr_gid_t worldid = NULL; static void free_world(void) { @@ -72,13 +72,13 @@ typedef enum prot_scope_e { prot_scope_user = 8 } prot_scope_e; -static apr_fileperms_t convert_prot(ACCESS_MASK acc, prot_scope_e scope) +static fspr_fileperms_t convert_prot(ACCESS_MASK acc, prot_scope_e scope) { /* These choices are based on the single filesystem bit that controls * the given behavior. They are -not- recommended for any set protection * function, such a function should -set- use GENERIC_READ/WRITE/EXECUTE */ - apr_fileperms_t prot = 0; + fspr_fileperms_t prot = 0; if (acc & FILE_EXECUTE) prot |= APR_WEXECUTE; if (acc & FILE_WRITE_DATA) @@ -88,7 +88,7 @@ static apr_fileperms_t convert_prot(ACCESS_MASK acc, prot_scope_e scope) return (prot << scope); } -static void resolve_prot(apr_finfo_t *finfo, apr_int32_t wanted, PACL dacl) +static void resolve_prot(fspr_finfo_t *finfo, fspr_int32_t wanted, PACL dacl) { TRUSTEE_W ident = {NULL, NO_MULTIPLE_TRUSTEE, TRUSTEE_IS_SID}; ACCESS_MASK acc; @@ -139,11 +139,11 @@ static void resolve_prot(apr_finfo_t *finfo, apr_int32_t wanted, PACL dacl) } } -static apr_status_t resolve_ident(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *pool) +static fspr_status_t resolve_ident(fspr_finfo_t *finfo, const char *fname, + fspr_int32_t wanted, fspr_pool_t *pool) { - apr_file_t *thefile = NULL; - apr_status_t rv; + fspr_file_t *thefile = NULL; + fspr_status_t rv; /* * NT5 (W2K) only supports symlinks in the same manner as mount points. * This code should eventually take that into account, for now treat @@ -153,28 +153,28 @@ static apr_status_t resolve_ident(apr_finfo_t *finfo, const char *fname, * user, group or permissions. */ - if ((rv = apr_file_open(&thefile, fname, APR_OPENINFO + if ((rv = fspr_file_open(&thefile, fname, APR_OPENINFO | ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0) | ((wanted & (APR_FINFO_PROT | APR_FINFO_OWNER)) ? APR_READCONTROL : 0), APR_OS_DEFAULT, pool)) == APR_SUCCESS) { - rv = apr_file_info_get(finfo, wanted, thefile); + rv = fspr_file_info_get(finfo, wanted, thefile); finfo->filehand = NULL; - apr_file_close(thefile); + fspr_file_close(thefile); } else if (APR_STATUS_IS_EACCES(rv) && (wanted & (APR_FINFO_PROT | APR_FINFO_OWNER))) { /* We have a backup plan. Perhaps we couldn't grab READ_CONTROL? * proceed without asking for that permission... */ - if ((rv = apr_file_open(&thefile, fname, APR_OPENINFO + if ((rv = fspr_file_open(&thefile, fname, APR_OPENINFO | ((wanted & APR_FINFO_LINK) ? APR_OPENLINK : 0), APR_OS_DEFAULT, pool)) == APR_SUCCESS) { - rv = apr_file_info_get(finfo, wanted & ~(APR_FINFO_PROT + rv = fspr_file_info_get(finfo, wanted & ~(APR_FINFO_PROT | APR_FINFO_OWNER), thefile); finfo->filehand = NULL; - apr_file_close(thefile); + fspr_file_close(thefile); } } @@ -188,7 +188,7 @@ static apr_status_t resolve_ident(apr_finfo_t *finfo, const char *fname, return rv; } -static void guess_protection_bits(apr_finfo_t *finfo) +static void guess_protection_bits(fspr_finfo_t *finfo) { /* Read, write execute for owner. In the Win9x environment, any * readable file is executable (well, not entirely 100% true, but @@ -207,20 +207,20 @@ static void guess_protection_bits(apr_finfo_t *finfo) finfo->valid |= APR_FINFO_UPROT | APR_FINFO_GPROT | APR_FINFO_WPROT; } -apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, - apr_int32_t wanted, int whatfile) +fspr_status_t more_finfo(fspr_finfo_t *finfo, const void *ufile, + fspr_int32_t wanted, int whatfile) { PSID user = NULL, grp = NULL; PACL dacl = NULL; - apr_status_t rv; + fspr_status_t rv; - if (apr_os_level < APR_WIN_NT) + if (fspr_os_level < APR_WIN_NT) guess_protection_bits(finfo); else if (wanted & (APR_FINFO_PROT | APR_FINFO_OWNER)) { /* On NT this request is incredibly expensive, but accurate. * Since the WinNT-only functions below are protected by the - * (apr_os_level < APR_WIN_NT) case above, we need no extra + * (fspr_os_level < APR_WIN_NT) case above, we need no extra * tests, but remember GetNamedSecurityInfo & GetSecurityInfo * are not supported on 9x. */ @@ -233,7 +233,7 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, if (wanted & APR_FINFO_PROT) sinf |= DACL_SECURITY_INFORMATION; if (whatfile == MORE_OF_WFSPEC) { - apr_wchar_t *wfile = (apr_wchar_t*) ufile; + fspr_wchar_t *wfile = (fspr_wchar_t*) ufile; int fix = 0; if (wcsncmp(wfile, L"\\\\?\\", 4) == 0) { fix = 4; @@ -266,8 +266,8 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, else return APR_INCOMPLETE; if (rv == ERROR_SUCCESS) - apr_pool_cleanup_register(finfo->pool, pdesc, free_localheap, - apr_pool_cleanup_null); + fspr_pool_cleanup_register(finfo->pool, pdesc, free_localheap, + fspr_pool_cleanup_null); else user = grp = dacl = NULL; @@ -303,9 +303,9 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, * if this is a CHR filetype. If it's reasonably certain it can't be, * then the function returns 0. */ -int fillin_fileinfo(apr_finfo_t *finfo, +int fillin_fileinfo(fspr_finfo_t *finfo, WIN32_FILE_ATTRIBUTE_DATA *wininfo, - int byhandle, apr_int32_t wanted) + int byhandle, fspr_int32_t wanted) { DWORD *sizes = &wininfo->nFileSizeHigh + byhandle; int warn = 0; @@ -317,10 +317,10 @@ int fillin_fileinfo(apr_finfo_t *finfo, FileTimeToAprTime(&finfo->mtime, &wininfo->ftLastWriteTime); #if APR_HAS_LARGE_FILES - finfo->size = (apr_off_t)sizes[1] - | ((apr_off_t)sizes[0] << 32); + finfo->size = (fspr_off_t)sizes[1] + | ((fspr_off_t)sizes[0] << 32); #else - finfo->size = (apr_off_t)sizes[1]; + finfo->size = (fspr_off_t)sizes[1]; if (finfo->size < 0 || sizes[0]) finfo->size = 0x7fffffff; #endif @@ -369,20 +369,20 @@ int fillin_fileinfo(apr_finfo_t *finfo, } -APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, - apr_file_t *thefile) +APR_DECLARE(fspr_status_t) fspr_file_info_get(fspr_finfo_t *finfo, fspr_int32_t wanted, + fspr_file_t *thefile) { BY_HANDLE_FILE_INFORMATION FileInfo; if (thefile->buffered) { /* XXX: flush here is not mutex protected */ - apr_status_t rv = apr_file_flush(thefile); + fspr_status_t rv = fspr_file_flush(thefile); if (rv != APR_SUCCESS) return rv; } if (!GetFileInformationByHandle(thefile->filehand, &FileInfo)) { - return apr_get_os_error(); + return fspr_get_os_error(); } fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) &FileInfo, 1, wanted); @@ -416,8 +416,8 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t want finfo->fname = thefile->fname; /* Extra goodies known only by GetFileInformationByHandle() */ - finfo->inode = (apr_ino_t)FileInfo.nFileIndexLow - | ((apr_ino_t)FileInfo.nFileIndexHigh << 32); + finfo->inode = (fspr_ino_t)FileInfo.nFileIndexLow + | ((fspr_ino_t)FileInfo.nFileIndexHigh << 32); finfo->device = FileInfo.dwVolumeSerialNumber; finfo->nlink = FileInfo.nNumberOfLinks; @@ -432,21 +432,21 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t want return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, - apr_fileperms_t perms) +APR_DECLARE(fspr_status_t) fspr_file_perms_set(const char *fname, + fspr_fileperms_t perms) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_stat(fspr_finfo_t *finfo, const char *fname, + fspr_int32_t wanted, fspr_pool_t *pool) { /* XXX: is constant - needs testing - which requires a lighter-weight root test fn */ int isroot = 0; - apr_status_t ident_rv = 0; - apr_status_t rv; + fspr_status_t ident_rv = 0; + fspr_status_t rv; #if APR_HAS_UNICODE_FS - apr_wchar_t wfname[APR_PATH_MAX]; + fspr_wchar_t wfname[APR_PATH_MAX]; #endif char *filename = NULL; @@ -489,12 +489,12 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, } if (rv = utf8_to_unicode_path(wfname, sizeof(wfname) - / sizeof(apr_wchar_t), fname)) + / sizeof(fspr_wchar_t), fname)) return rv; if (!(wanted & APR_FINFO_NAME)) { if (!GetFileAttributesExW(wfname, GetFileExInfoStandard, &FileInfo.i)) - return apr_get_os_error(); + return fspr_get_os_error(); } else { /* Guard against bogus wildcards and retrieve by name @@ -508,13 +508,13 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, } hFind = FindFirstFileW(wfname, &FileInfo.w); if (hFind == INVALID_HANDLE_VALUE) - return apr_get_os_error(); + return fspr_get_os_error(); FindClose(hFind); if (unicode_to_utf8_path(tmpname, sizeof(tmpname), FileInfo.w.cFileName)) { return APR_ENAMETOOLONG; } - filename = apr_pstrdup(pool, tmpname); + filename = fspr_pstrdup(pool, tmpname); } } #endif @@ -523,17 +523,17 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, { char *root = NULL; const char *test = fname; - rv = apr_filepath_root(&root, &test, APR_FILEPATH_NATIVE, pool); + rv = fspr_filepath_root(&root, &test, APR_FILEPATH_NATIVE, pool); isroot = (root && *root && !(*test)); - if ((apr_os_level >= APR_WIN_98) && (!(wanted & APR_FINFO_NAME) || isroot)) + if ((fspr_os_level >= APR_WIN_98) && (!(wanted & APR_FINFO_NAME) || isroot)) { /* cannot use FindFile on a Win98 root, it returns \* * GetFileAttributesExA is not available on Win95 */ if (!GetFileAttributesExA(fname, GetFileExInfoStandard, &FileInfo.i)) { - return apr_get_os_error(); + return fspr_get_os_error(); } } else if (isroot) { @@ -543,7 +543,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, { finfo->pool = pool; finfo->filetype = 0; - finfo->mtime = apr_time_now(); + finfo->mtime = fspr_time_now(); finfo->protection |= APR_WREAD | APR_WEXECUTE | APR_WWRITE; finfo->protection |= (finfo->protection << prot_scope_group) | (finfo->protection << prot_scope_user); @@ -567,10 +567,10 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, } hFind = FindFirstFileA(fname, &FileInfo.n); if (hFind == INVALID_HANDLE_VALUE) { - return apr_get_os_error(); + return fspr_get_os_error(); } FindClose(hFind); - filename = apr_pstrdup(pool, FileInfo.n.cFileName); + filename = fspr_pstrdup(pool, FileInfo.n.cFileName); } } #endif @@ -583,12 +583,12 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, * to reliably translate char devices to the path '\\.\device' * so go ask for the full path. */ - if (apr_os_level >= APR_WIN_NT) + if (fspr_os_level >= APR_WIN_NT) { #if APR_HAS_UNICODE_FS - apr_wchar_t tmpname[APR_FILE_MAX]; - apr_wchar_t *tmpoff = NULL; - if (GetFullPathNameW(wfname, sizeof(tmpname) / sizeof(apr_wchar_t), + fspr_wchar_t tmpname[APR_FILE_MAX]; + fspr_wchar_t *tmpoff = NULL; + if (GetFullPathNameW(wfname, sizeof(tmpname) / sizeof(fspr_wchar_t), tmpname, &tmpoff)) { if (!wcsncmp(tmpname, L"\\\\.\\", 4)) { @@ -646,7 +646,7 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, if (wanted &= ~finfo->valid) { /* Caller wants more than APR_FINFO_MIN | APR_FINFO_NAME */ #if APR_HAS_UNICODE_FS - if (apr_os_level >= APR_WIN_NT) + if (fspr_os_level >= APR_WIN_NT) return more_finfo(finfo, wfname, wanted, MORE_OF_WFSPEC); #endif return more_finfo(finfo, fname, wanted, MORE_OF_FSPEC); @@ -655,15 +655,15 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, - apr_fileattrs_t attributes, - apr_fileattrs_t attr_mask, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_file_attrs_set(const char *fname, + fspr_fileattrs_t attributes, + fspr_fileattrs_t attr_mask, + fspr_pool_t *pool) { DWORD flags; - apr_status_t rv; + fspr_status_t rv; #if APR_HAS_UNICODE_FS - apr_wchar_t wfname[APR_PATH_MAX]; + fspr_wchar_t wfname[APR_PATH_MAX]; #endif /* Don't do anything if we can't handle the requested attributes */ @@ -689,7 +689,7 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, #endif if (flags == 0xFFFFFFFF) - return apr_get_os_error(); + return fspr_get_os_error(); if (attr_mask & APR_FILE_ATTR_READONLY) { @@ -721,20 +721,20 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, #endif if (rv == 0) - return apr_get_os_error(); + return fspr_get_os_error(); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, - apr_time_t mtime, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_file_mtime_set(const char *fname, + fspr_time_t mtime, + fspr_pool_t *pool) { - apr_file_t *thefile; - apr_status_t rv; + fspr_file_t *thefile; + fspr_status_t rv; - rv = apr_file_open(&thefile, fname, + rv = fspr_file_open(&thefile, fname, APR_READ | APR_WRITEATTRS, APR_OS_DEFAULT, pool); if (!rv) @@ -745,16 +745,16 @@ APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, if (!GetFileTime(thefile->filehand, &file_ctime, &file_atime, &file_mtime)) - rv = apr_get_os_error(); + rv = fspr_get_os_error(); else { AprTimeToFileTime(&file_mtime, mtime); if (!SetFileTime(thefile->filehand, &file_ctime, &file_atime, &file_mtime)) - rv = apr_get_os_error(); + rv = fspr_get_os_error(); } - apr_file_close(thefile); + fspr_file_close(thefile); } return rv; diff --git a/libs/apr/file_io/win32/filesys.c b/libs/apr/file_io/win32/filesys.c index ad31e3387a..0694cefac9 100644 --- a/libs/apr/file_io/win32/filesys.c +++ b/libs/apr/file_io/win32/filesys.c @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_arch_file_io.h" -#include "apr_strings.h" +#include "fspr.h" +#include "fspr_arch_file_io.h" +#include "fspr_strings.h" /* Win32 Exceptions: * @@ -38,7 +38,7 @@ * Oddly, \x7f _is_ acceptable ;) */ -/* apr_c_is_fnchar[] maps Win32's file name and shell escape symbols +/* fspr_c_is_fnchar[] maps Win32's file name and shell escape symbols * * element & 1 == valid file name character [excluding delimiters] * element & 2 == character should be shell (caret) escaped from cmd.exe @@ -46,7 +46,7 @@ * this must be in-sync with Apache httpd's gen_test_char.c for cgi escaping. */ -const char apr_c_is_fnchar[256] = +const char fspr_c_is_fnchar[256] = {/* Reject all ctrl codes... Escape \n and \r (ascii 10 and 13) */ 0,0,0,0,0,0,0,0,0,0,2,0,0,2,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */ @@ -63,15 +63,15 @@ const char apr_c_is_fnchar[256] = }; -apr_status_t filepath_root_test(char *path, apr_pool_t *p) +fspr_status_t filepath_root_test(char *path, fspr_pool_t *p) { - apr_status_t rv; + fspr_status_t rv; #if APR_HAS_UNICODE_FS - if (apr_os_level >= APR_WIN_NT) + if (fspr_os_level >= APR_WIN_NT) { - apr_wchar_t wpath[APR_PATH_MAX]; + fspr_wchar_t wpath[APR_PATH_MAX]; if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) - / sizeof(apr_wchar_t), path)) + / sizeof(fspr_wchar_t), path)) return rv; rv = GetDriveTypeW(wpath); } @@ -85,24 +85,24 @@ apr_status_t filepath_root_test(char *path, apr_pool_t *p) } -apr_status_t filepath_drive_get(char **rootpath, char drive, - apr_int32_t flags, apr_pool_t *p) +fspr_status_t filepath_drive_get(char **rootpath, char drive, + fspr_int32_t flags, fspr_pool_t *p) { char path[APR_PATH_MAX]; #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { - apr_wchar_t *ignored; - apr_wchar_t wdrive[8]; - apr_wchar_t wpath[APR_PATH_MAX]; - apr_status_t rv; + fspr_wchar_t *ignored; + fspr_wchar_t wdrive[8]; + fspr_wchar_t wpath[APR_PATH_MAX]; + fspr_status_t rv; /* ???: This needs review, apparently "\\?\d:." returns "\\?\d:" * as if that is useful for anything. */ wcscpy(wdrive, L"D:."); - wdrive[0] = (apr_wchar_t)(unsigned char)drive; - if (!GetFullPathNameW(wdrive, sizeof(wpath) / sizeof(apr_wchar_t), wpath, &ignored)) - return apr_get_os_error(); + wdrive[0] = (fspr_wchar_t)(unsigned char)drive; + if (!GetFullPathNameW(wdrive, sizeof(wpath) / sizeof(fspr_wchar_t), wpath, &ignored)) + return fspr_get_os_error(); if ((rv = unicode_to_utf8_path(path, sizeof(path), wpath))) return rv; } @@ -117,7 +117,7 @@ apr_status_t filepath_drive_get(char **rootpath, char drive, drivestr[2] = '.';; drivestr[3] = '\0'; if (!GetFullPathName(drivestr, sizeof(path), path, &ignored)) - return apr_get_os_error(); + return fspr_get_os_error(); } #endif if (!(flags & APR_FILEPATH_NATIVE)) { @@ -126,34 +126,34 @@ apr_status_t filepath_drive_get(char **rootpath, char drive, **rootpath = '/'; } } - *rootpath = apr_pstrdup(p, path); + *rootpath = fspr_pstrdup(p, path); return APR_SUCCESS; } -apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p) +fspr_status_t filepath_root_case(char **rootpath, char *root, fspr_pool_t *p) { #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { - apr_wchar_t *ignored; - apr_wchar_t wpath[APR_PATH_MAX]; - apr_status_t rv; - apr_wchar_t wroot[APR_PATH_MAX]; + fspr_wchar_t *ignored; + fspr_wchar_t wpath[APR_PATH_MAX]; + fspr_status_t rv; + fspr_wchar_t wroot[APR_PATH_MAX]; /* ???: This needs review, apparently "\\?\d:." returns "\\?\d:" * as if that is useful for anything. */ if (rv = utf8_to_unicode_path(wroot, sizeof(wroot) - / sizeof(apr_wchar_t), root)) + / sizeof(fspr_wchar_t), root)) return rv; - if (!GetFullPathNameW(wroot, sizeof(wpath) / sizeof(apr_wchar_t), wpath, &ignored)) - return apr_get_os_error(); + if (!GetFullPathNameW(wroot, sizeof(wpath) / sizeof(fspr_wchar_t), wpath, &ignored)) + return fspr_get_os_error(); /* Borrow wroot as a char buffer (twice as big as necessary) */ if ((rv = unicode_to_utf8_path((char*)wroot, sizeof(wroot), wpath))) return rv; - *rootpath = apr_pstrdup(p, (char*)wroot); + *rootpath = fspr_pstrdup(p, (char*)wroot); } #endif #if APR_HAS_ANSI_FS @@ -162,25 +162,25 @@ apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p) char path[APR_PATH_MAX]; char *ignored; if (!GetFullPathName(root, sizeof(path), path, &ignored)) - return apr_get_os_error(); - *rootpath = apr_pstrdup(p, path); + return fspr_get_os_error(); + *rootpath = fspr_pstrdup(p, path); } #endif return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_filepath_get(char **rootpath, apr_int32_t flags, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_filepath_get(char **rootpath, fspr_int32_t flags, + fspr_pool_t *p) { char path[APR_PATH_MAX]; #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { - apr_wchar_t wpath[APR_PATH_MAX]; - apr_status_t rv; - if (!GetCurrentDirectoryW(sizeof(wpath) / sizeof(apr_wchar_t), wpath)) - return apr_get_os_error(); + fspr_wchar_t wpath[APR_PATH_MAX]; + fspr_status_t rv; + if (!GetCurrentDirectoryW(sizeof(wpath) / sizeof(fspr_wchar_t), wpath)) + return fspr_get_os_error(); if ((rv = unicode_to_utf8_path(path, sizeof(path), wpath))) return rv; } @@ -189,7 +189,7 @@ APR_DECLARE(apr_status_t) apr_filepath_get(char **rootpath, apr_int32_t flags, ELSE_WIN_OS_IS_ANSI { if (!GetCurrentDirectory(sizeof(path), path)) - return apr_get_os_error(); + return fspr_get_os_error(); } #endif if (!(flags & APR_FILEPATH_NATIVE)) { @@ -198,31 +198,31 @@ APR_DECLARE(apr_status_t) apr_filepath_get(char **rootpath, apr_int32_t flags, **rootpath = '/'; } } - *rootpath = apr_pstrdup(p, path); + *rootpath = fspr_pstrdup(p, path); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_filepath_set(const char *rootpath, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_filepath_set(const char *rootpath, + fspr_pool_t *p) { #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { - apr_wchar_t wpath[APR_PATH_MAX]; - apr_status_t rv; + fspr_wchar_t wpath[APR_PATH_MAX]; + fspr_status_t rv; if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) - / sizeof(apr_wchar_t), rootpath)) + / sizeof(fspr_wchar_t), rootpath)) return rv; if (!SetCurrentDirectoryW(wpath)) - return apr_get_os_error(); + return fspr_get_os_error(); } #endif #if APR_HAS_ANSI_FS ELSE_WIN_OS_IS_ANSI { if (!SetCurrentDirectory(rootpath)) - return apr_get_os_error(); + return fspr_get_os_error(); } #endif return APR_SUCCESS; diff --git a/libs/apr/file_io/win32/flock.c b/libs/apr/file_io/win32/flock.c index e08e08a7a4..17b8459642 100644 --- a/libs/apr/file_io/win32/flock.c +++ b/libs/apr/file_io/win32/flock.c @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "apr_arch_file_io.h" +#include "fspr_arch_file_io.h" -APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) +APR_DECLARE(fspr_status_t) fspr_file_lock(fspr_file_t *thefile, int type) { #ifdef _WIN32_WCE /* The File locking is unsuported on WCE */ @@ -28,12 +28,12 @@ APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) flags = ((type & APR_FLOCK_NONBLOCK) ? LOCKFILE_FAIL_IMMEDIATELY : 0) + (((type & APR_FLOCK_TYPEMASK) == APR_FLOCK_SHARED) ? 0 : LOCKFILE_EXCLUSIVE_LOCK); - if (apr_os_level >= APR_WIN_NT) { + if (fspr_os_level >= APR_WIN_NT) { /* Syntax is correct, len is passed for LengthLow and LengthHigh*/ OVERLAPPED offset; memset (&offset, 0, sizeof(offset)); if (!LockFileEx(thefile->filehand, flags, 0, len, len, &offset)) - return apr_get_os_error(); + return fspr_get_os_error(); } else { /* On Win9x, LockFile() never blocks. Hack in a crufty poll. @@ -62,23 +62,23 @@ APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) #endif /* !defined(_WIN32_WCE) */ } -APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile) +APR_DECLARE(fspr_status_t) fspr_file_unlock(fspr_file_t *thefile) { #ifdef _WIN32_WCE return APR_ENOTIMPL; #else DWORD len = 0xffffffff; - if (apr_os_level >= APR_WIN_NT) { + if (fspr_os_level >= APR_WIN_NT) { /* Syntax is correct, len is passed for LengthLow and LengthHigh*/ OVERLAPPED offset; memset (&offset, 0, sizeof(offset)); if (!UnlockFileEx(thefile->filehand, 0, len, len, &offset)) - return apr_get_os_error(); + return fspr_get_os_error(); } else { if (!UnlockFile(thefile->filehand, 0, 0, len, 0)) - return apr_get_os_error(); + return fspr_get_os_error(); } return APR_SUCCESS; diff --git a/libs/apr/file_io/win32/open.c b/libs/apr/file_io/win32/open.c index b3a5176729..2ed23c1d33 100644 --- a/libs/apr/file_io/win32/open.c +++ b/libs/apr/file_io/win32/open.c @@ -14,13 +14,13 @@ * limitations under the License. */ -#include "apr_private.h" -#include "apr_arch_file_io.h" -#include "apr_file_io.h" -#include "apr_general.h" -#include "apr_strings.h" -#include "apr_portable.h" -#include "apr_thread_mutex.h" +#include "fspr_private.h" +#include "fspr_arch_file_io.h" +#include "fspr_file_io.h" +#include "fspr_general.h" +#include "fspr_strings.h" +#include "fspr_portable.h" +#include "fspr_thread_mutex.h" #if APR_HAVE_ERRNO_H #include #endif @@ -29,11 +29,11 @@ #if APR_HAVE_SYS_STAT_H #include #endif -#include "apr_arch_misc.h" -#include "apr_arch_inherit.h" +#include "fspr_arch_misc.h" +#include "fspr_arch_inherit.h" #if APR_HAS_UNICODE_FS -apr_status_t utf8_to_unicode_path(apr_wchar_t* retstr, apr_size_t retlen, +fspr_status_t utf8_to_unicode_path(fspr_wchar_t* retstr, fspr_size_t retlen, const char* srcstr) { /* TODO: The computations could preconvert the string to determine @@ -48,9 +48,9 @@ apr_status_t utf8_to_unicode_path(apr_wchar_t* retstr, apr_size_t retlen, * Note that the \\?\ form only works for local drive paths, and * \\?\UNC\ is needed UNC paths. */ - apr_size_t srcremains = strlen(srcstr) + 1; - apr_wchar_t *t = retstr; - apr_status_t rv; + fspr_size_t srcremains = strlen(srcstr) + 1; + fspr_wchar_t *t = retstr; + fspr_status_t rv; /* This is correct, we don't twist the filename if it is will * definately be shorter than MAX_PATH. It merits some @@ -81,7 +81,7 @@ apr_status_t utf8_to_unicode_path(apr_wchar_t* retstr, apr_size_t retlen, } } - if (rv = apr_conv_utf8_to_ucs2(srcstr, &srcremains, t, &retlen)) { + if (rv = fspr_conv_utf8_to_ucs2(srcstr, &srcremains, t, &retlen)) { return (rv == APR_INCOMPLETE) ? APR_EINVAL : rv; } if (srcremains) { @@ -93,8 +93,8 @@ apr_status_t utf8_to_unicode_path(apr_wchar_t* retstr, apr_size_t retlen, return APR_SUCCESS; } -apr_status_t unicode_to_utf8_path(char* retstr, apr_size_t retlen, - const apr_wchar_t* srcstr) +fspr_status_t unicode_to_utf8_path(char* retstr, fspr_size_t retlen, + const fspr_wchar_t* srcstr) { /* Skip the leading 4 characters if the path begins \\?\, or substitute * // for the \\?\UNC\ path prefix, allocating the maximum string @@ -102,8 +102,8 @@ apr_status_t unicode_to_utf8_path(char* retstr, apr_size_t retlen, * then transform \\'s back into /'s since the \\?\ form never * allows '/' path seperators, and APR always uses '/'s. */ - apr_size_t srcremains = wcslen(srcstr) + 1; - apr_status_t rv; + fspr_size_t srcremains = wcslen(srcstr) + 1; + fspr_status_t rv; char *t = retstr; if (srcstr[0] == L'\\' && srcstr[1] == L'\\' && srcstr[2] == L'?' && srcstr[3] == L'\\') { @@ -122,7 +122,7 @@ apr_status_t unicode_to_utf8_path(char* retstr, apr_size_t retlen, } } - if (rv = apr_conv_ucs2_to_utf8(srcstr, &srcremains, t, &retlen)) { + if (rv = fspr_conv_ucs2_to_utf8(srcstr, &srcremains, t, &retlen)) { return rv; } if (srcremains) { @@ -132,17 +132,17 @@ apr_status_t unicode_to_utf8_path(char* retstr, apr_size_t retlen, } #endif -void *res_name_from_filename(const char *file, int global, apr_pool_t *pool) +void *res_name_from_filename(const char *file, int global, fspr_pool_t *pool) { #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { - apr_wchar_t *wpre, *wfile, *ch; - apr_size_t n = strlen(file) + 1; - apr_size_t r, d; - apr_status_t rv; + fspr_wchar_t *wpre, *wfile, *ch; + fspr_size_t n = strlen(file) + 1; + fspr_size_t r, d; + fspr_status_t rv; - if (apr_os_level >= APR_WIN_2000) { + if (fspr_os_level >= APR_WIN_2000) { if (global) wpre = L"Global\\"; else @@ -161,10 +161,10 @@ void *res_name_from_filename(const char *file, int global, apr_pool_t *pool) --n; } } - wfile = apr_palloc(pool, (r + n) * sizeof(apr_wchar_t)); + wfile = fspr_palloc(pool, (r + n) * sizeof(fspr_wchar_t)); wcscpy(wfile, wpre); d = n; - if (rv = apr_conv_utf8_to_ucs2(file, &n, wfile + r, &d)) { + if (rv = fspr_conv_utf8_to_ucs2(file, &n, wfile + r, &d)) { return NULL; } for (ch = wfile + r; *ch; ++ch) { @@ -178,14 +178,14 @@ void *res_name_from_filename(const char *file, int global, apr_pool_t *pool) ELSE_WIN_OS_IS_ANSI { char *nfile, *ch; - apr_size_t n = strlen(file) + 1; + fspr_size_t n = strlen(file) + 1; #if !APR_HAS_UNICODE_FS - apr_status_t rv; - apr_size_t r, d; + fspr_status_t rv; + fspr_size_t r, d; char *pre; - if (apr_os_level >= APR_WIN_2000) { + if (fspr_os_level >= APR_WIN_2000) { if (global) pre = "Global\\"; else @@ -199,16 +199,16 @@ void *res_name_from_filename(const char *file, int global, apr_pool_t *pool) file += n - 256 - r; n = 256; } - nfile = apr_palloc(pool, (r + n) * sizeof(apr_wchar_t)); + nfile = fspr_palloc(pool, (r + n) * sizeof(fspr_wchar_t)); memcpy(nfile, pre, r); memcpy(nfile + r, file, n); #else - const apr_size_t r = 0; + const fspr_size_t r = 0; if (n > 256) { file += n - 256; n = 256; } - nfile = apr_pmemdup(pool, file, n); + nfile = fspr_pmemdup(pool, file, n); #endif for (ch = nfile + r; *ch; ++ch) { if (*ch == ':' || *ch == '/' || *ch == '\\') @@ -220,10 +220,10 @@ void *res_name_from_filename(const char *file, int global, apr_pool_t *pool) } -apr_status_t file_cleanup(void *thefile) +fspr_status_t file_cleanup(void *thefile) { - apr_file_t *file = thefile; - apr_status_t flush_rv = APR_SUCCESS; + fspr_file_t *file = thefile; + fspr_status_t flush_rv = APR_SUCCESS; if (file->filehand != INVALID_HANDLE_VALUE) { @@ -243,7 +243,7 @@ apr_status_t file_cleanup(void *thefile) if (file->buffered) { /* XXX: flush here is not mutex protected */ - flush_rv = apr_file_flush((apr_file_t *)thefile); + flush_rv = fspr_file_flush((fspr_file_t *)thefile); } CloseHandle(file->filehand); file->filehand = INVALID_HANDLE_VALUE; @@ -255,16 +255,16 @@ apr_status_t file_cleanup(void *thefile) return flush_rv; } -APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, - apr_int32_t flag, apr_fileperms_t perm, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_file_open(fspr_file_t **new, const char *fname, + fspr_int32_t flag, fspr_fileperms_t perm, + fspr_pool_t *pool) { HANDLE handle = INVALID_HANDLE_VALUE; DWORD oflags = 0; DWORD createflags = 0; DWORD attributes = 0; DWORD sharemode = FILE_SHARE_READ | FILE_SHARE_WRITE; - apr_status_t rv; + fspr_status_t rv; if (flag & APR_READ) { oflags |= GENERIC_READ; @@ -276,7 +276,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, oflags |= FILE_WRITE_ATTRIBUTES; } - if (apr_os_level >= APR_WIN_NT) + if (fspr_os_level >= APR_WIN_NT) sharemode |= FILE_SHARE_DELETE; if (flag & APR_CREATE) { @@ -310,7 +310,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, attributes |= FILE_FLAG_OPEN_REPARSE_POINT; } - /* Without READ or WRITE, we fail unless apr called apr_file_open + /* Without READ or WRITE, we fail unless apr called fspr_file_open * internally with the private APR_OPENINFO flag. * * With the APR_OPENINFO flag on NT, use the option flag @@ -319,7 +319,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, */ if (!(flag & (APR_READ | APR_WRITE))) { if (flag & APR_OPENINFO) { - if (apr_os_level >= APR_WIN_NT) { + if (fspr_os_level >= APR_WIN_NT) { attributes |= FILE_FLAG_BACKUP_SEMANTICS; } } @@ -340,7 +340,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { - apr_wchar_t wfname[APR_PATH_MAX]; + fspr_wchar_t wfname[APR_PATH_MAX]; if (flag & APR_SENDFILE_ENABLED) { /* This feature is required to enable sendfile operations @@ -351,7 +351,7 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, } if (rv = utf8_to_unicode_path(wfname, sizeof(wfname) - / sizeof(apr_wchar_t), fname)) + / sizeof(fspr_wchar_t), fname)) return rv; handle = CreateFileW(wfname, oflags, sharemode, NULL, createflags, attributes, 0); @@ -370,13 +370,13 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, } #endif if (handle == INVALID_HANDLE_VALUE) { - return apr_get_os_error(); + return fspr_get_os_error(); } - (*new) = (apr_file_t *)apr_pcalloc(pool, sizeof(apr_file_t)); + (*new) = (fspr_file_t *)fspr_pcalloc(pool, sizeof(fspr_file_t)); (*new)->pool = pool; (*new)->filehand = handle; - (*new)->fname = apr_pstrdup(pool, fname); + (*new)->fname = fspr_pstrdup(pool, fname); (*new)->flags = flag; (*new)->timeout = -1; (*new)->ungetchar = -1; @@ -387,15 +387,15 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, } if (flag & APR_BUFFERED) { (*new)->buffered = 1; - (*new)->buffer = apr_palloc(pool, APR_FILE_BUFSIZE); + (*new)->buffer = fspr_palloc(pool, APR_FILE_BUFSIZE); } /* Need the mutex to handled buffered and O_APPEND style file i/o */ if ((*new)->buffered || (*new)->append) { - rv = apr_thread_mutex_create(&(*new)->mutex, + rv = fspr_thread_mutex_create(&(*new)->mutex, APR_THREAD_MUTEX_DEFAULT, pool); if (rv) { if (file_cleanup(*new) == APR_SUCCESS) { - apr_pool_cleanup_kill(pool, *new, file_cleanup); + fspr_pool_cleanup_kill(pool, *new, file_cleanup); } return rv; } @@ -403,23 +403,23 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, /* Create a pollset with room for one descriptor. */ /* ### check return codes */ - (void) apr_pollset_create(&(*new)->pollset, 1, pool, 0); + (void) fspr_pollset_create(&(*new)->pollset, 1, pool, 0); if (!(flag & APR_FILE_NOCLEANUP)) { - apr_pool_cleanup_register((*new)->pool, (void *)(*new), file_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register((*new)->pool, (void *)(*new), file_cleanup, + fspr_pool_cleanup_null); } return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) +APR_DECLARE(fspr_status_t) fspr_file_close(fspr_file_t *file) { - apr_status_t stat; + fspr_status_t stat; if ((stat = file_cleanup(file)) == APR_SUCCESS) { - apr_pool_cleanup_kill(file->pool, file, file_cleanup); + fspr_pool_cleanup_kill(file->pool, file, file_cleanup); if (file->mutex) { - apr_thread_mutex_destroy(file->mutex); + fspr_thread_mutex_destroy(file->mutex); } return APR_SUCCESS; @@ -427,15 +427,15 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file) return stat; } -APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_file_remove(const char *path, fspr_pool_t *pool) { #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { - apr_wchar_t wpath[APR_PATH_MAX]; - apr_status_t rv; + fspr_wchar_t wpath[APR_PATH_MAX]; + fspr_status_t rv; if (rv = utf8_to_unicode_path(wpath, sizeof(wpath) - / sizeof(apr_wchar_t), path)) { + / sizeof(fspr_wchar_t), path)) { return rv; } if (DeleteFileW(wpath)) @@ -447,24 +447,24 @@ APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *pool) if (DeleteFile(path)) return APR_SUCCESS; #endif - return apr_get_os_error(); + return fspr_get_os_error(); } -APR_DECLARE(apr_status_t) apr_file_rename(const char *frompath, +APR_DECLARE(fspr_status_t) fspr_file_rename(const char *frompath, const char *topath, - apr_pool_t *pool) + fspr_pool_t *pool) { IF_WIN_OS_IS_UNICODE { #if APR_HAS_UNICODE_FS - apr_wchar_t wfrompath[APR_PATH_MAX], wtopath[APR_PATH_MAX]; - apr_status_t rv; + fspr_wchar_t wfrompath[APR_PATH_MAX], wtopath[APR_PATH_MAX]; + fspr_status_t rv; if (rv = utf8_to_unicode_path(wfrompath, sizeof(wfrompath) - / sizeof(apr_wchar_t), frompath)) { + / sizeof(fspr_wchar_t), frompath)) { return rv; } if (rv = utf8_to_unicode_path(wtopath, sizeof(wtopath) - / sizeof(apr_wchar_t), topath)) { + / sizeof(fspr_wchar_t), topath)) { return rv; } #ifndef _WIN32_WCE @@ -496,28 +496,28 @@ APR_DECLARE(apr_status_t) apr_file_rename(const char *frompath, { CloseHandle(handle); if (!DeleteFile(topath)) - return apr_get_os_error(); + return fspr_get_os_error(); } if (MoveFile(frompath, topath)) return APR_SUCCESS; } #endif - return apr_get_os_error(); + return fspr_get_os_error(); } -APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, - apr_file_t *file) +APR_DECLARE(fspr_status_t) fspr_os_file_get(fspr_os_file_t *thefile, + fspr_file_t *file) { *thefile = file->filehand; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, - apr_os_file_t *thefile, - apr_int32_t flags, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_file_put(fspr_file_t **file, + fspr_os_file_t *thefile, + fspr_int32_t flags, + fspr_pool_t *pool) { - (*file) = apr_pcalloc(pool, sizeof(apr_file_t)); + (*file) = fspr_pcalloc(pool, sizeof(fspr_file_t)); (*file)->pool = pool; (*file)->filehand = *thefile; (*file)->ungetchar = -1; /* no char avail */ @@ -529,16 +529,16 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, } if (flags & APR_BUFFERED) { (*file)->buffered = 1; - (*file)->buffer = apr_palloc(pool, APR_FILE_BUFSIZE); + (*file)->buffer = fspr_palloc(pool, APR_FILE_BUFSIZE); } if ((*file)->append || (*file)->buffered) { - apr_status_t rv; - rv = apr_thread_mutex_create(&(*file)->mutex, + fspr_status_t rv; + rv = fspr_thread_mutex_create(&(*file)->mutex, APR_THREAD_MUTEX_DEFAULT, pool); if (rv) { if (file_cleanup(*file) == APR_SUCCESS) { - apr_pool_cleanup_kill(pool, *file, file_cleanup); + fspr_pool_cleanup_kill(pool, *file, file_cleanup); } return rv; } @@ -546,7 +546,7 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, /* Create a pollset with room for one descriptor. */ /* ### check return codes */ - (void) apr_pollset_create(&(*file)->pollset, 1, pool, 0); + (void) fspr_pollset_create(&(*file)->pollset, 1, pool, 0); /* XXX... we pcalloc above so all others are zeroed. * Should we be testing if thefile is a handle to @@ -557,7 +557,7 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr) +APR_DECLARE(fspr_status_t) fspr_file_eof(fspr_file_t *fptr) { if (fptr->eof_hit == 1) { return APR_EOF; @@ -565,66 +565,66 @@ APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_file_open_stderr(fspr_file_t **thefile, fspr_pool_t *pool) { #ifdef _WIN32_WCE return APR_ENOTIMPL; #else - apr_os_file_t file_handle; + fspr_os_file_t file_handle; - apr_set_os_error(APR_SUCCESS); + fspr_set_os_error(APR_SUCCESS); file_handle = GetStdHandle(STD_ERROR_HANDLE); if (!file_handle || (file_handle == INVALID_HANDLE_VALUE)) { - apr_status_t rv = apr_get_os_error(); + fspr_status_t rv = fspr_get_os_error(); if (rv == APR_SUCCESS) { return APR_EINVAL; } return rv; } - return apr_os_file_put(thefile, &file_handle, 0, pool); + return fspr_os_file_put(thefile, &file_handle, 0, pool); #endif } -APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_file_open_stdout(fspr_file_t **thefile, fspr_pool_t *pool) { #ifdef _WIN32_WCE return APR_ENOTIMPL; #else - apr_os_file_t file_handle; + fspr_os_file_t file_handle; - apr_set_os_error(APR_SUCCESS); + fspr_set_os_error(APR_SUCCESS); file_handle = GetStdHandle(STD_OUTPUT_HANDLE); if (!file_handle || (file_handle == INVALID_HANDLE_VALUE)) { - apr_status_t rv = apr_get_os_error(); + fspr_status_t rv = fspr_get_os_error(); if (rv == APR_SUCCESS) { return APR_EINVAL; } return rv; } - return apr_os_file_put(thefile, &file_handle, 0, pool); + return fspr_os_file_put(thefile, &file_handle, 0, pool); #endif } -APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_file_open_stdin(fspr_file_t **thefile, fspr_pool_t *pool) { #ifdef _WIN32_WCE return APR_ENOTIMPL; #else - apr_os_file_t file_handle; + fspr_os_file_t file_handle; - apr_set_os_error(APR_SUCCESS); + fspr_set_os_error(APR_SUCCESS); file_handle = GetStdHandle(STD_INPUT_HANDLE); if (!file_handle || (file_handle == INVALID_HANDLE_VALUE)) { - apr_status_t rv = apr_get_os_error(); + fspr_status_t rv = fspr_get_os_error(); if (rv == APR_SUCCESS) { return APR_EINVAL; } return rv; } - return apr_os_file_put(thefile, &file_handle, 0, pool); + return fspr_os_file_put(thefile, &file_handle, 0, pool); #endif } diff --git a/libs/apr/file_io/win32/pipe.c b/libs/apr/file_io/win32/pipe.c index cda79e3af3..a9da026a37 100644 --- a/libs/apr/file_io/win32/pipe.c +++ b/libs/apr/file_io/win32/pipe.c @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "win32/apr_arch_file_io.h" -#include "apr_file_io.h" -#include "apr_general.h" -#include "apr_strings.h" +#include "win32/fspr_arch_file_io.h" +#include "fspr_file_io.h" +#include "fspr_general.h" +#include "fspr_strings.h" #if APR_HAVE_ERRNO_H #include #endif @@ -29,9 +29,9 @@ #if APR_HAVE_SYS_STAT_H #include #endif -#include "apr_arch_misc.h" +#include "fspr_arch_misc.h" -APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout) +APR_DECLARE(fspr_status_t) fspr_file_pipe_timeout_set(fspr_file_t *thepipe, fspr_interval_time_t timeout) { /* Always OK to unset timeouts */ if (timeout == -1) { @@ -50,30 +50,30 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_int return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout) +APR_DECLARE(fspr_status_t) fspr_file_pipe_timeout_get(fspr_file_t *thepipe, fspr_interval_time_t *timeout) { /* Always OK to get the timeout (even if it's unset ... -1) */ *timeout = thepipe->timeout; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_file_pipe_create(fspr_file_t **in, fspr_file_t **out, fspr_pool_t *p) { /* Unix creates full blocking pipes. */ - return apr_create_nt_pipe(in, out, APR_FULL_BLOCK, p); + return fspr_create_nt_pipe(in, out, APR_FULL_BLOCK, p); } -/* apr_create_nt_pipe() - * An internal (for now) APR function used by apr_proc_create() +/* fspr_create_nt_pipe() + * An internal (for now) APR function used by fspr_proc_create() * when setting up pipes to communicate with the child process. - * apr_create_nt_pipe() allows setting the blocking mode of each end of + * fspr_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). * A pipe handle must be opened in full async i/o mode in order to * emulate Unix non-blocking pipes with timeouts. * * 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 - * apr_file_pipe_create. + * fspr_file_pipe_create. * * 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, @@ -81,9 +81,9 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out * WaitForSinglelObject, et. al. will not detect pipe i/o). On NT, you * have to poll the pipe to detect i/o on a non-blocking pipe. */ -apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, - apr_int32_t blocking_mode, - apr_pool_t *p) +fspr_status_t fspr_create_nt_pipe(fspr_file_t **in, fspr_file_t **out, + fspr_int32_t blocking_mode, + fspr_pool_t *p) { #ifdef _WIN32_WCE return APR_ENOTIMPL; @@ -98,7 +98,7 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, sa.bInheritHandle = TRUE; sa.lpSecurityDescriptor = NULL; - (*in) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); + (*in) = (fspr_file_t *)fspr_pcalloc(p, sizeof(fspr_file_t)); (*in)->pool = p; (*in)->fname = NULL; (*in)->pipe = 1; @@ -110,9 +110,9 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, (*in)->dataRead = 0; (*in)->direction = 0; (*in)->pOverlapped = NULL; - (void) apr_pollset_create(&(*in)->pollset, 1, p, 0); + (void) fspr_pollset_create(&(*in)->pollset, 1, p, 0); - (*out) = (apr_file_t *)apr_pcalloc(p, sizeof(apr_file_t)); + (*out) = (fspr_file_t *)fspr_pcalloc(p, sizeof(fspr_file_t)); (*out)->pool = p; (*out)->fname = NULL; (*out)->pipe = 1; @@ -124,15 +124,15 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, (*out)->dataRead = 0; (*out)->direction = 0; (*out)->pOverlapped = NULL; - (void) apr_pollset_create(&(*out)->pollset, 1, p, 0); + (void) fspr_pollset_create(&(*out)->pollset, 1, p, 0); - if (apr_os_level >= APR_WIN_NT) { + if (fspr_os_level >= APR_WIN_NT) { /* Create the read end of the pipe */ dwOpenMode = PIPE_ACCESS_INBOUND; if (blocking_mode == APR_WRITE_BLOCK /* READ_NONBLOCK */ || blocking_mode == APR_FULL_NONBLOCK) { dwOpenMode |= FILE_FLAG_OVERLAPPED; - (*in)->pOverlapped = (OVERLAPPED*) apr_pcalloc(p, sizeof(OVERLAPPED)); + (*in)->pOverlapped = (OVERLAPPED*) fspr_pcalloc(p, sizeof(OVERLAPPED)); (*in)->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); } @@ -154,7 +154,7 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, if (blocking_mode == APR_READ_BLOCK /* WRITE_NONBLOCK */ || blocking_mode == APR_FULL_NONBLOCK) { dwOpenMode |= FILE_FLAG_OVERLAPPED; - (*out)->pOverlapped = (OVERLAPPED*) apr_pcalloc(p, sizeof(OVERLAPPED)); + (*out)->pOverlapped = (OVERLAPPED*) fspr_pcalloc(p, sizeof(OVERLAPPED)); (*out)->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); } @@ -169,22 +169,22 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, else { /* Pipes on Win9* are blocking. Live with it. */ if (!CreatePipe(&(*in)->filehand, &(*out)->filehand, &sa, 65536)) { - return apr_get_os_error(); + return fspr_get_os_error(); } } - apr_pool_cleanup_register((*in)->pool, (void *)(*in), file_cleanup, - apr_pool_cleanup_null); - apr_pool_cleanup_register((*out)->pool, (void *)(*out), file_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register((*in)->pool, (void *)(*in), file_cleanup, + fspr_pool_cleanup_null); + fspr_pool_cleanup_register((*out)->pool, (void *)(*out), file_cleanup, + fspr_pool_cleanup_null); return APR_SUCCESS; #endif /* _WIN32_WCE */ } -APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, - apr_fileperms_t perm, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_file_namedpipe_create(const char *filename, + fspr_fileperms_t perm, + fspr_pool_t *pool) { /* Not yet implemented, interface not suitable. * Win32 requires the named pipe to be *opened* at the time it's @@ -200,31 +200,31 @@ APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, * would be to handle stdio-style or blocking pipes. Win32 doesn't have * select() blocking for pipes anyways :( */ -APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file, - apr_os_file_t *thefile, +APR_DECLARE(fspr_status_t) fspr_os_pipe_put_ex(fspr_file_t **file, + fspr_os_file_t *thefile, int register_cleanup, - apr_pool_t *pool) + fspr_pool_t *pool) { - (*file) = apr_pcalloc(pool, sizeof(apr_file_t)); + (*file) = fspr_pcalloc(pool, sizeof(fspr_file_t)); (*file)->pool = pool; (*file)->pipe = 1; (*file)->timeout = -1; (*file)->ungetchar = -1; (*file)->filehand = *thefile; - (void) apr_pollset_create(&(*file)->pollset, 1, pool, 0); + (void) fspr_pollset_create(&(*file)->pollset, 1, pool, 0); if (register_cleanup) { - apr_pool_cleanup_register(pool, *file, file_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register(pool, *file, file_cleanup, + fspr_pool_cleanup_null); } return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, - apr_os_file_t *thefile, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_pipe_put(fspr_file_t **file, + fspr_os_file_t *thefile, + fspr_pool_t *pool) { - return apr_os_pipe_put_ex(file, thefile, 0, pool); + return fspr_os_pipe_put_ex(file, thefile, 0, pool); } diff --git a/libs/apr/file_io/win32/readwrite.c b/libs/apr/file_io/win32/readwrite.c index d15ac7c1ac..a0acc26943 100644 --- a/libs/apr/file_io/win32/readwrite.c +++ b/libs/apr/file_io/win32/readwrite.c @@ -14,23 +14,23 @@ * limitations under the License. */ -#include "win32/apr_arch_file_io.h" -#include "apr_file_io.h" -#include "apr_general.h" -#include "apr_strings.h" -#include "apr_lib.h" -#include "apr_errno.h" +#include "win32/fspr_arch_file_io.h" +#include "fspr_file_io.h" +#include "fspr_general.h" +#include "fspr_strings.h" +#include "fspr_lib.h" +#include "fspr_errno.h" #include -#include "apr_arch_atime.h" -#include "apr_arch_misc.h" +#include "fspr_arch_atime.h" +#include "fspr_arch_misc.h" /* * read_with_timeout() * Uses async i/o to emulate unix non-blocking i/o with timeouts. */ -static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t len_in, apr_size_t *nbytes) +static fspr_status_t read_with_timeout(fspr_file_t *file, void *buf, fspr_size_t len_in, fspr_size_t *nbytes) { - apr_status_t rv; + fspr_status_t rv; DWORD len = (DWORD)len_in; DWORD bytesread = 0; @@ -42,7 +42,7 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le if (file->pipe) { DWORD bytes; if (!PeekNamedPipe(file->filehand, NULL, 0, NULL, &bytes, NULL)) { - rv = apr_get_os_error(); + rv = fspr_get_os_error(); if (rv == APR_FROM_OS_ERROR(ERROR_BROKEN_PIPE)) { rv = APR_EOF; } @@ -77,7 +77,7 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le *nbytes = bytesread; if (!rv) { - rv = apr_get_os_error(); + rv = fspr_get_os_error(); if (rv == APR_FROM_OS_ERROR(ERROR_IO_PENDING)) { /* Wait for the pending i/o */ if (file->timeout > 0) { @@ -101,7 +101,7 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le break; case WAIT_FAILED: - rv = apr_get_os_error(); + rv = fspr_get_os_error(); break; default: @@ -109,7 +109,7 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le } if (rv != APR_SUCCESS) { - if (apr_os_level >= APR_WIN_98) { + if (fspr_os_level >= APR_WIN_98) { CancelIo(file->filehand); } } @@ -131,9 +131,9 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le return rv; } -APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *len) +APR_DECLARE(fspr_status_t) fspr_file_read(fspr_file_t *thefile, void *buf, fspr_size_t *len) { - apr_status_t rv; + fspr_status_t rv; DWORD bytes_read = 0; if (*len <= 0) { @@ -143,14 +143,14 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size /* If the file is open for xthread support, allocate and * initialize the overlapped and io completion event (hEvent). - * Threads should NOT share an apr_file_t or its hEvent. + * Threads should NOT share an fspr_file_t or its hEvent. */ if ((thefile->flags & APR_XTHREAD) && !thefile->pOverlapped ) { - thefile->pOverlapped = (OVERLAPPED*) apr_pcalloc(thefile->pool, + thefile->pOverlapped = (OVERLAPPED*) fspr_pcalloc(thefile->pool, sizeof(OVERLAPPED)); thefile->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); if (!thefile->pOverlapped->hEvent) { - rv = apr_get_os_error(); + rv = fspr_get_os_error(); return rv; } } @@ -169,15 +169,15 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size } if (thefile->buffered) { char *pos = (char *)buf; - apr_size_t blocksize; - apr_size_t size = *len; + fspr_size_t blocksize; + fspr_size_t size = *len; - apr_thread_mutex_lock(thefile->mutex); + fspr_thread_mutex_lock(thefile->mutex); if (thefile->direction == 1) { - rv = apr_file_flush(thefile); + rv = fspr_file_flush(thefile); if (rv != APR_SUCCESS) { - apr_thread_mutex_unlock(thefile->mutex); + fspr_thread_mutex_unlock(thefile->mutex); return rv; } thefile->bufpos = 0; @@ -188,7 +188,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size rv = 0; while (rv == 0 && size > 0) { if (thefile->bufpos >= thefile->dataRead) { - apr_size_t read; + fspr_size_t read; rv = read_with_timeout(thefile, thefile->buffer, APR_FILE_BUFSIZE, &read); if (read == 0) { @@ -214,10 +214,10 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size if (*len) { rv = APR_SUCCESS; } - apr_thread_mutex_unlock(thefile->mutex); + fspr_thread_mutex_unlock(thefile->mutex); } else { /* Unbuffered i/o */ - apr_size_t nbytes; + fspr_size_t nbytes; rv = read_with_timeout(thefile, buf, *len, &nbytes); if (rv == APR_EOF) thefile->eof_hit = TRUE; @@ -227,35 +227,35 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size return rv; } -APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) +APR_DECLARE(fspr_status_t) fspr_file_write(fspr_file_t *thefile, const void *buf, fspr_size_t *nbytes) { - apr_status_t rv; + fspr_status_t rv; DWORD bwrote; /* If the file is open for xthread support, allocate and * initialize the overlapped and io completion event (hEvent). - * Threads should NOT share an apr_file_t or its hEvent. + * Threads should NOT share an fspr_file_t or its hEvent. */ if ((thefile->flags & APR_XTHREAD) && !thefile->pOverlapped ) { - thefile->pOverlapped = (OVERLAPPED*) apr_pcalloc(thefile->pool, + thefile->pOverlapped = (OVERLAPPED*) fspr_pcalloc(thefile->pool, sizeof(OVERLAPPED)); thefile->pOverlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); if (!thefile->pOverlapped->hEvent) { - rv = apr_get_os_error(); + rv = fspr_get_os_error(); return rv; } } if (thefile->buffered) { char *pos = (char *)buf; - apr_size_t blocksize; - apr_size_t size = *nbytes; + fspr_size_t blocksize; + fspr_size_t size = *nbytes; - apr_thread_mutex_lock(thefile->mutex); + fspr_thread_mutex_lock(thefile->mutex); if (thefile->direction == 0) { // Position file pointer for writing at the offset we are logically reading from - apr_off_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; + fspr_off_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos; DWORD offlo = (DWORD)offset; DWORD offhi = (DWORD)(offset >> 32); if (offset != thefile->filePtr) @@ -267,7 +267,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a rv = 0; while (rv == 0 && size > 0) { if (thefile->bufpos == APR_FILE_BUFSIZE) // write buffer is full - rv = apr_file_flush(thefile); + rv = fspr_file_flush(thefile); blocksize = size > APR_FILE_BUFSIZE - thefile->bufpos ? APR_FILE_BUFSIZE - thefile->bufpos : size; memcpy(thefile->buffer + thefile->bufpos, pos, blocksize); @@ -276,27 +276,27 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a size -= blocksize; } - apr_thread_mutex_unlock(thefile->mutex); + fspr_thread_mutex_unlock(thefile->mutex); return rv; } else { if (!thefile->pipe) { - apr_off_t offset = 0; - apr_status_t rc; + fspr_off_t offset = 0; + fspr_status_t rc; if (thefile->append) { - /* apr_file_lock will mutex the file across processes. - * The call to apr_thread_mutex_lock is added to avoid + /* fspr_file_lock will mutex the file across processes. + * The call to fspr_thread_mutex_lock is added to avoid * a race condition between LockFile and WriteFile * that occasionally leads to deadlocked threads. */ - apr_thread_mutex_lock(thefile->mutex); - rc = apr_file_lock(thefile, APR_FLOCK_EXCLUSIVE); + fspr_thread_mutex_lock(thefile->mutex); + rc = fspr_file_lock(thefile, APR_FLOCK_EXCLUSIVE); if (rc != APR_SUCCESS) { - apr_thread_mutex_unlock(thefile->mutex); + fspr_thread_mutex_unlock(thefile->mutex); return rc; } - rc = apr_file_seek(thefile, APR_END, &offset); + rc = fspr_file_seek(thefile, APR_END, &offset); if (rc != APR_SUCCESS) { - apr_thread_mutex_unlock(thefile->mutex); + fspr_thread_mutex_unlock(thefile->mutex); return rc; } } @@ -307,8 +307,8 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a rv = WriteFile(thefile->filehand, buf, (DWORD)*nbytes, &bwrote, thefile->pOverlapped); if (thefile->append) { - apr_file_unlock(thefile); - apr_thread_mutex_unlock(thefile->mutex); + fspr_file_unlock(thefile); + fspr_thread_mutex_unlock(thefile->mutex); } } else { @@ -321,7 +321,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a } else { (*nbytes) = 0; - rv = apr_get_os_error(); + rv = fspr_get_os_error(); if (rv == APR_FROM_OS_ERROR(ERROR_IO_PENDING)) { DWORD timeout_ms; @@ -348,13 +348,13 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a rv = APR_TIMEUP; break; case WAIT_FAILED: - rv = apr_get_os_error(); + rv = fspr_get_os_error(); break; default: break; } if (rv != APR_SUCCESS) { - if (apr_os_level >= APR_WIN_98) + if (fspr_os_level >= APR_WIN_98) CancelIo(thefile->filehand); } } @@ -368,21 +368,21 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a /* ToDo: Write for it anyway and test the oslevel! * Too bad WriteFileGather() is not supported on 95&98 (or NT prior to SP2) */ -APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, +APR_DECLARE(fspr_status_t) fspr_file_writev(fspr_file_t *thefile, const struct iovec *vec, - apr_size_t nvec, - apr_size_t *nbytes) + fspr_size_t nvec, + fspr_size_t *nbytes) { - apr_status_t rv = APR_SUCCESS; - apr_size_t i; - apr_size_t bwrote = 0; + fspr_status_t rv = APR_SUCCESS; + fspr_size_t i; + fspr_size_t bwrote = 0; char *buf; *nbytes = 0; for (i = 0; i < nvec; i++) { buf = vec[i].iov_base; bwrote = vec[i].iov_len; - rv = apr_file_write(thefile, buf, &bwrote); + rv = fspr_file_write(thefile, buf, &bwrote); *nbytes += bwrote; if (rv != APR_SUCCESS) { break; @@ -391,26 +391,26 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, return rv; } -APR_DECLARE(apr_status_t) apr_file_putc(char ch, apr_file_t *thefile) +APR_DECLARE(fspr_status_t) fspr_file_putc(char ch, fspr_file_t *thefile) { - apr_size_t len = 1; + fspr_size_t len = 1; - return apr_file_write(thefile, &ch, &len); + return fspr_file_write(thefile, &ch, &len); } -APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile) +APR_DECLARE(fspr_status_t) fspr_file_ungetc(char ch, fspr_file_t *thefile) { thefile->ungetchar = (unsigned char) ch; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_getc(char *ch, apr_file_t *thefile) +APR_DECLARE(fspr_status_t) fspr_file_getc(char *ch, fspr_file_t *thefile) { - apr_status_t rc; - apr_size_t bread; + fspr_status_t rc; + fspr_size_t bread; bread = 1; - rc = apr_file_read(thefile, ch, &bread); + rc = fspr_file_read(thefile, ch, &bread); if (rc) { return rc; @@ -423,22 +423,22 @@ APR_DECLARE(apr_status_t) apr_file_getc(char *ch, apr_file_t *thefile) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile) +APR_DECLARE(fspr_status_t) fspr_file_puts(const char *str, fspr_file_t *thefile) { - apr_size_t len = strlen(str); + fspr_size_t len = strlen(str); - return apr_file_write(thefile, str, &len); + return fspr_file_write(thefile, str, &len); } -APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) +APR_DECLARE(fspr_status_t) fspr_file_gets(char *str, int len, fspr_file_t *thefile) { - apr_size_t readlen; - apr_status_t rv = APR_SUCCESS; + fspr_size_t readlen; + fspr_status_t rv = APR_SUCCESS; int i; for (i = 0; i < len-1; i++) { readlen = 1; - rv = apr_file_read(thefile, str+i, &readlen); + rv = fspr_file_read(thefile, str+i, &readlen); if (rv != APR_SUCCESS && rv != APR_EOF) return rv; @@ -459,13 +459,13 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile) return rv; } -APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile) +APR_DECLARE(fspr_status_t) fspr_file_flush(fspr_file_t *thefile) { if (thefile->buffered) { DWORD numbytes, written = 0; - apr_status_t rc = 0; + fspr_status_t rc = 0; char *buffer; - apr_size_t bytesleft; + fspr_size_t bytesleft; if (thefile->direction == 1 && thefile->bufpos) { buffer = thefile->buffer; @@ -480,7 +480,7 @@ APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile) } if (!WriteFile(thefile->filehand, buffer, numbytes, &written, NULL)) { - rc = apr_get_os_error(); + rc = fspr_get_os_error(); thefile->filePtr += written; break; } @@ -504,17 +504,17 @@ APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile) return APR_SUCCESS; } -struct apr_file_printf_data { - apr_vformatter_buff_t vbuff; - apr_file_t *fptr; +struct fspr_file_printf_data { + fspr_vformatter_buff_t vbuff; + fspr_file_t *fptr; char *buf; }; -static int file_printf_flush(apr_vformatter_buff_t *buff) +static int file_printf_flush(fspr_vformatter_buff_t *buff) { - struct apr_file_printf_data *data = (struct apr_file_printf_data *)buff; + struct fspr_file_printf_data *data = (struct fspr_file_printf_data *)buff; - if (apr_file_write_full(data->fptr, data->buf, + if (fspr_file_write_full(data->fptr, data->buf, data->vbuff.curpos - data->buf, NULL)) { return -1; } @@ -523,10 +523,10 @@ static int file_printf_flush(apr_vformatter_buff_t *buff) return 0; } -APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, +APR_DECLARE_NONSTD(int) fspr_file_printf(fspr_file_t *fptr, const char *format, ...) { - struct apr_file_printf_data data; + struct fspr_file_printf_data data; va_list ap; int count; @@ -538,10 +538,10 @@ APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, data.vbuff.endpos = data.buf + HUGE_STRING_LEN; data.fptr = fptr; va_start(ap, format); - count = apr_vformatter(file_printf_flush, - (apr_vformatter_buff_t *)&data, format, ap); - /* apr_vformatter does not call flush for the last bits */ - if (count >= 0) file_printf_flush((apr_vformatter_buff_t *)&data); + count = fspr_vformatter(file_printf_flush, + (fspr_vformatter_buff_t *)&data, format, ap); + /* fspr_vformatter does not call flush for the last bits */ + if (count >= 0) file_printf_flush((fspr_vformatter_buff_t *)&data); va_end(ap); diff --git a/libs/apr/file_io/win32/seek.c b/libs/apr/file_io/win32/seek.c index 2566d061cf..1bd59de25e 100644 --- a/libs/apr/file_io/win32/seek.c +++ b/libs/apr/file_io/win32/seek.c @@ -14,20 +14,20 @@ * limitations under the License. */ -#include "win32/apr_arch_file_io.h" -#include "apr_file_io.h" +#include "win32/fspr_arch_file_io.h" +#include "fspr_file_io.h" #include #include -static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) +static fspr_status_t setptr(fspr_file_t *thefile, fspr_off_t pos ) { - apr_size_t newbufpos; - apr_status_t rv; + fspr_size_t newbufpos; + fspr_status_t rv; DWORD rc; if (thefile->direction == 1) { /* XXX: flush here is not mutex protected */ - rv = apr_file_flush(thefile); + rv = fspr_file_flush(thefile); if (rv != APR_SUCCESS) return rv; thefile->bufpos = thefile->dataRead = 0; @@ -37,11 +37,11 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) /* We may be truncating to size here. * XXX: testing an 'unsigned' as >= 0 below indicates a bug */ - newbufpos = (apr_size_t)(pos - (thefile->filePtr + newbufpos = (fspr_size_t)(pos - (thefile->filePtr - thefile->dataRead)); if (newbufpos >= 0 && newbufpos <= thefile->dataRead) { - thefile->bufpos = (apr_size_t)newbufpos; + thefile->bufpos = (fspr_size_t)newbufpos; rv = APR_SUCCESS; } else { DWORD offlo = (DWORD)pos; @@ -54,7 +54,7 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) * to confirm this. INVALID_SET_FILE_POINTER is too recently * added for us to rely on it as a constant. */ - rv = apr_get_os_error(); + rv = fspr_get_os_error(); else rv = APR_SUCCESS; @@ -70,10 +70,10 @@ static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos ) } -APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) +APR_DECLARE(fspr_status_t) fspr_file_seek(fspr_file_t *thefile, fspr_seek_where_t where, fspr_off_t *offset) { - apr_finfo_t finfo; - apr_status_t rc = APR_SUCCESS; + fspr_finfo_t finfo; + fspr_status_t rc = APR_SUCCESS; thefile->eof_hit = 0; @@ -89,7 +89,7 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh break; case APR_END: - rc = apr_file_info_get(&finfo, APR_FINFO_SIZE, thefile); + rc = fspr_file_info_get(&finfo, APR_FINFO_SIZE, thefile); if (rc == APR_SUCCESS) rc = setptr(thefile, finfo.size + *offset); break; @@ -115,7 +115,7 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh break; case APR_END: - rc = apr_file_info_get(&finfo, APR_FINFO_SIZE, thefile); + rc = fspr_file_info_get(&finfo, APR_FINFO_SIZE, thefile); if (rc == APR_SUCCESS && finfo.size + *offset >= 0) thefile->filePtr = finfo.size + *offset; break; @@ -144,31 +144,31 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t wh offlo = SetFilePointer(thefile->filehand, (LONG)offlo, (LONG*)&offhi, howmove); if (offlo == 0xFFFFFFFF) - rc = apr_get_os_error(); + rc = fspr_get_os_error(); else rc = APR_SUCCESS; /* Since we can land at 0xffffffff we will measure our APR_SUCCESS */ if (rc == APR_SUCCESS) - *offset = ((apr_off_t)offhi << 32) | offlo; + *offset = ((fspr_off_t)offhi << 32) | offlo; return rc; } } -APR_DECLARE(apr_status_t) apr_file_trunc(apr_file_t *thefile, apr_off_t offset) +APR_DECLARE(fspr_status_t) fspr_file_trunc(fspr_file_t *thefile, fspr_off_t offset) { - apr_status_t rv; + fspr_status_t rv; DWORD offlo = (DWORD)offset; DWORD offhi = (DWORD)(offset >> 32); DWORD rc; rc = SetFilePointer(thefile->filehand, offlo, &offhi, FILE_BEGIN); if (rc == 0xFFFFFFFF) - if ((rv = apr_get_os_error()) != APR_SUCCESS) + if ((rv = fspr_get_os_error()) != APR_SUCCESS) return rv; if (!SetEndOfFile(thefile->filehand)) - return apr_get_os_error(); + return fspr_get_os_error(); if (thefile->buffered) { return setptr(thefile, offset); diff --git a/libs/apr/helpers/apr_rename.pl b/libs/apr/helpers/apr_rename.pl index 25b9d52d4c..5254978574 100755 --- a/libs/apr/helpers/apr_rename.pl +++ b/libs/apr/helpers/apr_rename.pl @@ -8,7 +8,7 @@ shift if $just_check; my $dir = shift || '.'; my %names; -my $prefix = 'apr_'; +my $prefix = 'fspr_'; while () { chomp; @@ -41,7 +41,7 @@ sub replace { while () { for (m/[^_\"]*$prefix($pattern)\b/og) { $found++; - print " $file:$. apr_$_ -> apr_$names{$_}\n"; + print " $file:$. fspr_$_ -> fspr_$names{$_}\n"; } push @lines, $_ if $replace; } @@ -66,41 +66,41 @@ sub replace { } __DATA__ -apr_time_t: -apr_implode_gmt apr_time_exp_gmt_get +fspr_time_t: +fspr_implode_gmt fspr_time_exp_gmt_get -apr_socket_t: -apr_close_socket apr_socket_close -apr_create_socket apr_socket_create -apr_get_sockaddr apr_socket_addr_get -apr_get_socketdata apr_socket_data_get -apr_set_socketdata apr_socket_data_set -apr_shutdown apr_socket_shutdown -apr_bind apr_socket_bind -apr_listen apr_socket_listen -apr_accept apr_socket_accept -apr_connect apr_socket_connect -apr_send apr_socket_send -apr_sendv apr_socket_sendv -apr_sendto apr_socket_sendto -apr_recvfrom apr_socket_recvfrom -apr_sendfile apr_socket_sendfile -apr_recv apr_socket_recv +fspr_socket_t: +fspr_close_socket fspr_socket_close +fspr_create_socket fspr_socket_create +fspr_get_sockaddr fspr_socket_addr_get +fspr_get_socketdata fspr_socket_data_get +fspr_set_socketdata fspr_socket_data_set +fspr_shutdown fspr_socket_shutdown +fspr_bind fspr_socket_bind +fspr_listen fspr_socket_listen +fspr_accept fspr_socket_accept +fspr_connect fspr_socket_connect +fspr_send fspr_socket_send +fspr_sendv fspr_socket_sendv +fspr_sendto fspr_socket_sendto +fspr_recvfrom fspr_socket_recvfrom +fspr_sendfile fspr_socket_sendfile +fspr_recv fspr_socket_recv -apr_filepath_*: -apr_filename_of_pathname apr_filepath_name_get +fspr_filepath_*: +fspr_filename_of_pathname fspr_filepath_name_get -apr_gid_t: -apr_get_groupid apr_gid_get -apr_get_groupname apr_gid_name_get -apr_group_name_get apr_gid_name_get -apr_compare_groups apr_gid_compare +fspr_gid_t: +fspr_get_groupid fspr_gid_get +fspr_get_groupname fspr_gid_name_get +fspr_group_name_get fspr_gid_name_get +fspr_compare_groups fspr_gid_compare -apr_uid_t: -apr_get_home_directory apr_uid_homepath_get -apr_get_userid apr_uid_get -apr_current_userid apr_uid_current -apr_compare_users apr_uid_compare -apr_get_username apr_uid_name_get -apr_compare_users apr_uid_compare +fspr_uid_t: +fspr_get_home_directory fspr_uid_homepath_get +fspr_get_userid fspr_uid_get +fspr_current_userid fspr_uid_current +fspr_compare_users fspr_uid_compare +fspr_get_username fspr_uid_name_get +fspr_compare_users fspr_uid_compare diff --git a/libs/apr/include/apr_random.h b/libs/apr/include/apr_random.h deleted file mode 100644 index 9c0eac23ad..0000000000 --- a/libs/apr/include/apr_random.h +++ /dev/null @@ -1,74 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef APR_RANDOM_H -#define APR_RANDOM_H - -#include - -typedef struct apr_crypto_hash_t apr_crypto_hash_t; - -typedef void apr_crypto_hash_init_t(apr_crypto_hash_t *hash); -typedef void apr_crypto_hash_add_t(apr_crypto_hash_t *hash,const void *data, - apr_size_t bytes); -typedef void apr_crypto_hash_finish_t(apr_crypto_hash_t *hash, - unsigned char *result); - -/* FIXME: make this opaque */ -struct apr_crypto_hash_t { - apr_crypto_hash_init_t *init; - apr_crypto_hash_add_t *add; - apr_crypto_hash_finish_t *finish; - apr_size_t size; - void *data; -}; - -APR_DECLARE(apr_crypto_hash_t *) apr_crypto_sha256_new(apr_pool_t *p); - -typedef struct apr_random_t apr_random_t; - -APR_DECLARE(void) apr_random_init(apr_random_t *g,apr_pool_t *p, - apr_crypto_hash_t *pool_hash, - apr_crypto_hash_t *key_hash, - apr_crypto_hash_t *prng_hash); -APR_DECLARE(apr_random_t *) apr_random_standard_new(apr_pool_t *p); -APR_DECLARE(void) apr_random_add_entropy(apr_random_t *g, - const void *entropy_, - apr_size_t bytes); -APR_DECLARE(apr_status_t) apr_random_insecure_bytes(apr_random_t *g, - void *random, - apr_size_t bytes); -APR_DECLARE(apr_status_t) apr_random_secure_bytes(apr_random_t *g, - void *random, - apr_size_t bytes); -APR_DECLARE(void) apr_random_barrier(apr_random_t *g); -APR_DECLARE(apr_status_t) apr_random_secure_ready(apr_random_t *r); -APR_DECLARE(apr_status_t) apr_random_insecure_ready(apr_random_t *r); - -/* Call this in the child after forking to mix the randomness - pools. Note that its generally a bad idea to fork a process with a - real PRNG in it - better to have the PRNG externally and get the - randomness from there. However, if you really must do it, then you - should supply all your entropy to all the PRNGs - don't worry, they - won't produce the same output. - - Note that apr_proc_fork() calls this for you, so only weird - applications need ever call it themselves. -*/ -struct apr_proc_t; -APR_DECLARE(void) apr_random_after_fork(struct apr_proc_t *proc); - -#endif /* ndef APR_RANDOM_H */ diff --git a/libs/apr/include/arch/aix/apr_arch_dso.h b/libs/apr/include/arch/aix/fspr_arch_dso.h similarity index 86% rename from libs/apr/include/arch/aix/apr_arch_dso.h rename to libs/apr/include/arch/aix/fspr_arch_dso.h index d1cac684f6..04a2700285 100644 --- a/libs/apr/include/arch/aix/apr_arch_dso.h +++ b/libs/apr/include/arch/aix/fspr_arch_dso.h @@ -17,11 +17,11 @@ #ifndef DSO_H #define DSO_H -#include "apr_private.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_dso.h" -#include "apr.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_pools.h" +#include "fspr_dso.h" +#include "fspr.h" #if APR_HAS_DSO @@ -30,8 +30,8 @@ void *dlsym(void *handle, const char *symbol); const char *dlerror(void); int dlclose(void *handle); -struct apr_dso_handle_t { - apr_pool_t *pool; +struct fspr_dso_handle_t { + fspr_pool_t *pool; void *handle; const char *errormsg; }; diff --git a/libs/apr/include/arch/beos/apr_arch_dso.h b/libs/apr/include/arch/beos/fspr_arch_dso.h similarity index 85% rename from libs/apr/include/arch/beos/apr_arch_dso.h rename to libs/apr/include/arch/beos/fspr_arch_dso.h index fbc5c2ff01..0be76ade03 100644 --- a/libs/apr/include/arch/beos/apr_arch_dso.h +++ b/libs/apr/include/arch/beos/fspr_arch_dso.h @@ -17,20 +17,20 @@ #ifndef DSO_H #define DSO_H -#include "apr_private.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_errno.h" -#include "apr_dso.h" -#include "apr.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_pools.h" +#include "fspr_errno.h" +#include "fspr_dso.h" +#include "fspr.h" #include #include #if APR_HAS_DSO -struct apr_dso_handle_t { +struct fspr_dso_handle_t { image_id handle; /* Handle to the DSO loaded */ - apr_pool_t *pool; + fspr_pool_t *pool; const char *errormsg; /* if the load fails, we have an error * message here :) */ diff --git a/libs/apr/include/arch/beos/apr_arch_proc_mutex.h b/libs/apr/include/arch/beos/fspr_arch_proc_mutex.h similarity index 82% rename from libs/apr/include/arch/beos/apr_arch_proc_mutex.h rename to libs/apr/include/arch/beos/fspr_arch_proc_mutex.h index c60d8c6228..c0a08b465a 100644 --- a/libs/apr/include/arch/beos/apr_arch_proc_mutex.h +++ b/libs/apr/include/arch/beos/fspr_arch_proc_mutex.h @@ -17,15 +17,15 @@ #ifndef PROC_MUTEX_H #define PROC_MUTEX_H -#include "apr_pools.h" -#include "apr_proc_mutex.h" -#include "apr_file_io.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_portable.h" +#include "fspr_pools.h" +#include "fspr_proc_mutex.h" +#include "fspr_file_io.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_portable.h" -struct apr_proc_mutex_t { - apr_pool_t *pool; +struct fspr_proc_mutex_t { + fspr_pool_t *pool; /* Our lock :) */ sem_id Lock; diff --git a/libs/apr/include/arch/beos/apr_arch_thread_cond.h b/libs/apr/include/arch/beos/fspr_arch_thread_cond.h similarity index 81% rename from libs/apr/include/arch/beos/apr_arch_thread_cond.h rename to libs/apr/include/arch/beos/fspr_arch_thread_cond.h index c9420b53cb..f18aba7d6c 100644 --- a/libs/apr/include/arch/beos/apr_arch_thread_cond.h +++ b/libs/apr/include/arch/beos/fspr_arch_thread_cond.h @@ -18,23 +18,23 @@ #define THREAD_COND_H #include -#include "apr_pools.h" -#include "apr_thread_cond.h" -#include "apr_file_io.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_portable.h" -#include "apr_ring.h" +#include "fspr_pools.h" +#include "fspr_thread_cond.h" +#include "fspr_file_io.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_portable.h" +#include "fspr_ring.h" struct waiter_t { APR_RING_ENTRY(waiter_t) link; sem_id sem; }; -struct apr_thread_cond_t { - apr_pool_t *pool; +struct fspr_thread_cond_t { + fspr_pool_t *pool; sem_id lock; - apr_thread_mutex_t *condlock; + fspr_thread_mutex_t *condlock; thread_id owner; /* active list */ APR_RING_HEAD(active_list, waiter_t) alist; diff --git a/libs/apr/include/arch/beos/apr_arch_thread_mutex.h b/libs/apr/include/arch/beos/fspr_arch_thread_mutex.h similarity index 81% rename from libs/apr/include/arch/beos/apr_arch_thread_mutex.h rename to libs/apr/include/arch/beos/fspr_arch_thread_mutex.h index bb7d4ae80b..f2fbb22388 100644 --- a/libs/apr/include/arch/beos/apr_arch_thread_mutex.h +++ b/libs/apr/include/arch/beos/fspr_arch_thread_mutex.h @@ -18,15 +18,15 @@ #define THREAD_MUTEX_H #include -#include "apr_pools.h" -#include "apr_thread_mutex.h" -#include "apr_file_io.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_portable.h" +#include "fspr_pools.h" +#include "fspr_thread_mutex.h" +#include "fspr_file_io.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_portable.h" -struct apr_thread_mutex_t { - apr_pool_t *pool; +struct fspr_thread_mutex_t { + fspr_pool_t *pool; /* Our lock :) */ sem_id Lock; @@ -34,7 +34,7 @@ struct apr_thread_mutex_t { /* If we nest locks we need these... */ int nested; - apr_os_thread_t owner; + fspr_os_thread_t owner; int owner_ref; }; diff --git a/libs/apr/include/arch/beos/apr_arch_thread_rwlock.h b/libs/apr/include/arch/beos/fspr_arch_thread_rwlock.h similarity index 84% rename from libs/apr/include/arch/beos/apr_arch_thread_rwlock.h rename to libs/apr/include/arch/beos/fspr_arch_thread_rwlock.h index 694b0d5046..9a7849fbd5 100644 --- a/libs/apr/include/arch/beos/apr_arch_thread_rwlock.h +++ b/libs/apr/include/arch/beos/fspr_arch_thread_rwlock.h @@ -18,15 +18,15 @@ #define THREAD_RWLOCK_H #include -#include "apr_pools.h" -#include "apr_thread_rwlock.h" -#include "apr_file_io.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_portable.h" +#include "fspr_pools.h" +#include "fspr_thread_rwlock.h" +#include "fspr_file_io.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_portable.h" -struct apr_thread_rwlock_t { - apr_pool_t *pool; +struct fspr_thread_rwlock_t { + fspr_pool_t *pool; /* Our lock :) */ sem_id Lock; diff --git a/libs/apr/include/arch/beos/apr_arch_threadproc.h b/libs/apr/include/arch/beos/fspr_arch_threadproc.h similarity index 71% rename from libs/apr/include/arch/beos/apr_arch_threadproc.h rename to libs/apr/include/arch/beos/fspr_arch_threadproc.h index 13de053634..aa55461a4a 100644 --- a/libs/apr/include/arch/beos/apr_arch_threadproc.h +++ b/libs/apr/include/arch/beos/fspr_arch_threadproc.h @@ -14,12 +14,12 @@ * limitations under the License. */ -#include "apr_thread_proc.h" -#include "apr_arch_file_io.h" -#include "apr_file_io.h" -#include "apr_thread_proc.h" -#include "apr_general.h" -#include "apr_portable.h" +#include "fspr_thread_proc.h" +#include "fspr_arch_file_io.h" +#include "fspr_file_io.h" +#include "fspr_thread_proc.h" +#include "fspr_general.h" +#include "fspr_portable.h" #include #include #include @@ -39,23 +39,23 @@ #define BEOS_MAX_DATAKEYS 128 -struct apr_thread_t { - apr_pool_t *pool; +struct fspr_thread_t { + fspr_pool_t *pool; thread_id td; void *data; - apr_thread_start_t func; - apr_status_t exitval; + fspr_thread_start_t func; + fspr_status_t exitval; }; -struct apr_threadattr_t { - apr_pool_t *pool; +struct fspr_threadattr_t { + fspr_pool_t *pool; int32 attr; int detached; int joinable; }; -struct apr_threadkey_t { - apr_pool_t *pool; +struct fspr_threadkey_t { + fspr_pool_t *pool; int32 key; }; @@ -73,20 +73,20 @@ struct beos_key { void (* destructor) (void *); }; -struct apr_procattr_t { - apr_pool_t *pool; - 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; +struct fspr_procattr_t { + fspr_pool_t *pool; + fspr_file_t *parent_in; + fspr_file_t *child_in; + fspr_file_t *parent_out; + fspr_file_t *child_out; + fspr_file_t *parent_err; + fspr_file_t *child_err; char *currdir; - apr_int32_t cmdtype; - apr_int32_t detached; + fspr_int32_t cmdtype; + fspr_int32_t detached; }; -struct apr_thread_once_t { +struct fspr_thread_once_t { sem_id sem; int hit; }; diff --git a/libs/apr/include/arch/apr_private_common.h b/libs/apr/include/arch/fspr_private_common.h similarity index 75% rename from libs/apr/include/arch/apr_private_common.h rename to libs/apr/include/arch/fspr_private_common.h index 9cd52ecf22..2213744b1c 100644 --- a/libs/apr/include/arch/apr_private_common.h +++ b/libs/apr/include/arch/fspr_private_common.h @@ -21,22 +21,22 @@ #ifndef APR_PRIVATE_COMMON_H #define APR_PRIVATE_COMMON_H -#include "apr_pools.h" -#include "apr_tables.h" +#include "fspr_pools.h" +#include "fspr_tables.h" -apr_status_t apr_filepath_list_split_impl(apr_array_header_t **pathelts, +fspr_status_t fspr_filepath_list_split_impl(fspr_array_header_t **pathelts, const char *liststr, char separator, - apr_pool_t *p); + fspr_pool_t *p); -apr_status_t apr_filepath_list_merge_impl(char **liststr, - apr_array_header_t *pathelts, +fspr_status_t fspr_filepath_list_merge_impl(char **liststr, + fspr_array_header_t *pathelts, char separator, - apr_pool_t *p); + fspr_pool_t *p); /* temporary defines to handle 64bit compile mismatches */ #define APR_INT_TRUNC_CAST int -#define APR_UINT32_TRUNC_CAST apr_uint32_t +#define APR_UINT32_TRUNC_CAST fspr_uint32_t #define APR_UINT32_MAX 0xFFFFFFFFUL #endif /*APR_PRIVATE_COMMON_H*/ diff --git a/libs/apr/include/arch/netware/apr_arch_dso.h b/libs/apr/include/arch/netware/fspr_arch_dso.h similarity index 86% rename from libs/apr/include/arch/netware/apr_arch_dso.h rename to libs/apr/include/arch/netware/fspr_arch_dso.h index ea0fe8c254..54bf22f72f 100644 --- a/libs/apr/include/arch/netware/apr_arch_dso.h +++ b/libs/apr/include/arch/netware/fspr_arch_dso.h @@ -17,11 +17,11 @@ #ifndef DSO_H #define DSO_H -#include "apr_private.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_dso.h" -#include "apr.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_pools.h" +#include "fspr_dso.h" +#include "fspr.h" #include @@ -32,8 +32,8 @@ struct sym_list { char *symbol; }; -struct apr_dso_handle_t { - apr_pool_t *pool; +struct fspr_dso_handle_t { + fspr_pool_t *pool; void *handle; const char *errormsg; sym_list *symbols; diff --git a/libs/apr/include/arch/netware/apr_arch_file_io.h b/libs/apr/include/arch/netware/fspr_arch_file_io.h similarity index 76% rename from libs/apr/include/arch/netware/apr_arch_file_io.h rename to libs/apr/include/arch/netware/fspr_arch_file_io.h index 6b2bfeca44..d1172e2153 100644 --- a/libs/apr/include/arch/netware/apr_arch_file_io.h +++ b/libs/apr/include/arch/netware/fspr_arch_file_io.h @@ -17,15 +17,15 @@ #ifndef FILE_IO_H #define FILE_IO_H -#include "apr.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_tables.h" -#include "apr_file_io.h" -#include "apr_file_info.h" -#include "apr_errno.h" -#include "apr_lib.h" -#include "apr_poll.h" +#include "fspr.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_tables.h" +#include "fspr_file_io.h" +#include "fspr_file_info.h" +#include "fspr_errno.h" +#include "fspr_lib.h" +#include "fspr_poll.h" /* System headers the file I/O library needs */ #if APR_HAVE_FCNTL_H @@ -78,45 +78,45 @@ typedef struct stat struct_stat; -struct apr_file_t { - apr_pool_t *pool; +struct fspr_file_t { + fspr_pool_t *pool; int filedes; char *fname; - apr_int32_t flags; + fspr_int32_t flags; int eof_hit; int is_pipe; - apr_interval_time_t timeout; + fspr_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)*/ /* if there is a timeout set, then this pollset is used */ - apr_pollset_t *pollset; + fspr_pollset_t *pollset; /* Stuff for buffered mode */ char *buffer; int bufpos; /* Read/Write position in buffer */ - apr_off_t dataRead; /* amount of valid data read into buffer */ + fspr_off_t dataRead; /* amount of valid data read into buffer */ int direction; /* buffer being used for 0 = read, 1 = write */ - apr_off_t filePtr; /* position in file of handle */ + fspr_off_t filePtr; /* position in file of handle */ #if APR_HAS_THREADS - struct apr_thread_mutex_t *thlock; + struct fspr_thread_mutex_t *thlock; #endif }; -struct apr_dir_t { - apr_pool_t *pool; +struct fspr_dir_t { + fspr_pool_t *pool; char *dirname; DIR *dirstruct; struct dirent *entry; }; -typedef struct apr_stat_entry_t apr_stat_entry_t; +typedef struct fspr_stat_entry_t fspr_stat_entry_t; -struct apr_stat_entry_t { +struct fspr_stat_entry_t { struct stat info; char *casedName; - apr_time_t expire; + fspr_time_t expire; NXPathCtx_t pathCtx; }; @@ -131,21 +131,21 @@ struct apr_stat_entry_t { * we need to fold the case to canonical form. This function is * supposed to do so. */ -apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p); +fspr_status_t filepath_root_case(char **rootpath, char *root, fspr_pool_t *p); /* This function check to see of the given path includes a drive/volume * specifier. If the _only_ parameter is set to DRIVE_ONLY then it * check to see of the path only contains a drive/volume specifier and * nothing else. */ -apr_status_t filepath_has_drive(const char *rootpath, int only, apr_pool_t *p); +fspr_status_t filepath_has_drive(const char *rootpath, int only, fspr_pool_t *p); /* This function compares the drive/volume specifiers for each given path. * It returns zero if they match or non-zero if not. */ -apr_status_t filepath_compare_drive(const char *path1, const char *path2, apr_pool_t *p); +fspr_status_t filepath_compare_drive(const char *path1, const char *path2, fspr_pool_t *p); -apr_status_t apr_unix_file_cleanup(void *); +fspr_status_t fspr_unix_file_cleanup(void *); #endif /* ! FILE_IO_H */ diff --git a/libs/apr/include/arch/netware/apr_arch_global_mutex.h b/libs/apr/include/arch/netware/fspr_arch_global_mutex.h similarity index 85% rename from libs/apr/include/arch/netware/apr_arch_global_mutex.h rename to libs/apr/include/arch/netware/fspr_arch_global_mutex.h index 4167d37821..bceaddb5b6 100644 --- a/libs/apr/include/arch/netware/apr_arch_global_mutex.h +++ b/libs/apr/include/arch/netware/fspr_arch_global_mutex.h @@ -17,12 +17,12 @@ #ifndef GLOBAL_MUTEX_H #define GLOBAL_MUTEX_H -#include "apr_global_mutex.h" -#include "apr_thread_mutex.h" +#include "fspr_global_mutex.h" +#include "fspr_thread_mutex.h" -struct apr_global_mutex_t { - apr_pool_t *pool; - apr_thread_mutex_t *mutex; +struct fspr_global_mutex_t { + fspr_pool_t *pool; + fspr_thread_mutex_t *mutex; }; #endif /* GLOBAL_MUTEX_H */ diff --git a/libs/apr/include/arch/netware/apr_arch_internal_time.h b/libs/apr/include/arch/netware/fspr_arch_internal_time.h similarity index 94% rename from libs/apr/include/arch/netware/apr_arch_internal_time.h rename to libs/apr/include/arch/netware/fspr_arch_internal_time.h index 59f1067208..8f43fb1cce 100644 --- a/libs/apr/include/arch/netware/apr_arch_internal_time.h +++ b/libs/apr/include/arch/netware/fspr_arch_internal_time.h @@ -17,10 +17,10 @@ #ifndef TIME_INTERNAL_H #define TIME_INTERNAL_H -#include "apr.h" +#include "fspr.h" #define TZONE (*___timezone()) -void apr_netware_setup_time(void); +void fspr_netware_setup_time(void); #endif /* TIME_INTERNAL_H */ diff --git a/libs/apr/include/arch/netware/apr_arch_networkio.h b/libs/apr/include/arch/netware/fspr_arch_networkio.h similarity index 93% rename from libs/apr/include/arch/netware/apr_arch_networkio.h rename to libs/apr/include/arch/netware/fspr_arch_networkio.h index 63f17abe59..0779530996 100644 --- a/libs/apr/include/arch/netware/apr_arch_networkio.h +++ b/libs/apr/include/arch/netware/fspr_arch_networkio.h @@ -22,9 +22,9 @@ arch/netware and then arch/unix. But in this specific case we want arch/win32. */ -#include <../win32/apr_arch_networkio.h> +#include <../win32/fspr_arch_networkio.h> #else -#include <../unix/apr_arch_networkio.h> +#include <../unix/fspr_arch_networkio.h> #endif #endif /* ! NETWORK_IO_H */ diff --git a/libs/apr/include/arch/netware/apr_arch_pre_nw.h b/libs/apr/include/arch/netware/fspr_arch_pre_nw.h similarity index 100% rename from libs/apr/include/arch/netware/apr_arch_pre_nw.h rename to libs/apr/include/arch/netware/fspr_arch_pre_nw.h diff --git a/libs/apr/include/arch/netware/apr_arch_proc_mutex.h b/libs/apr/include/arch/netware/fspr_arch_proc_mutex.h similarity index 86% rename from libs/apr/include/arch/netware/apr_arch_proc_mutex.h rename to libs/apr/include/arch/netware/fspr_arch_proc_mutex.h index 7a634c2e50..169a6c292e 100644 --- a/libs/apr/include/arch/netware/apr_arch_proc_mutex.h +++ b/libs/apr/include/arch/netware/fspr_arch_proc_mutex.h @@ -17,12 +17,12 @@ #ifndef PROC_MUTEX_H #define PROC_MUTEX_H -#include "apr_proc_mutex.h" -#include "apr_thread_mutex.h" +#include "fspr_proc_mutex.h" +#include "fspr_thread_mutex.h" -struct apr_proc_mutex_t { - apr_pool_t *pool; - apr_thread_mutex_t *mutex; +struct fspr_proc_mutex_t { + fspr_pool_t *pool; + fspr_thread_mutex_t *mutex; }; #endif /* PROC_MUTEX_H */ diff --git a/libs/apr/include/arch/netware/apr_arch_thread_cond.h b/libs/apr/include/arch/netware/fspr_arch_thread_cond.h similarity index 91% rename from libs/apr/include/arch/netware/apr_arch_thread_cond.h rename to libs/apr/include/arch/netware/fspr_arch_thread_cond.h index b11a5f86a7..ec0e69018f 100644 --- a/libs/apr/include/arch/netware/apr_arch_thread_cond.h +++ b/libs/apr/include/arch/netware/fspr_arch_thread_cond.h @@ -17,11 +17,11 @@ #ifndef THREAD_COND_H #define THREAD_COND_H -#include "apr_thread_cond.h" +#include "fspr_thread_cond.h" #include -struct apr_thread_cond_t { - apr_pool_t *pool; +struct fspr_thread_cond_t { + fspr_pool_t *pool; NXCond_t *cond; }; diff --git a/libs/apr/include/arch/netware/apr_arch_thread_mutex.h b/libs/apr/include/arch/netware/fspr_arch_thread_mutex.h similarity index 91% rename from libs/apr/include/arch/netware/apr_arch_thread_mutex.h rename to libs/apr/include/arch/netware/fspr_arch_thread_mutex.h index 0453799c2d..7691795a3d 100644 --- a/libs/apr/include/arch/netware/apr_arch_thread_mutex.h +++ b/libs/apr/include/arch/netware/fspr_arch_thread_mutex.h @@ -17,11 +17,11 @@ #ifndef THREAD_MUTEX_H #define THREAD_MUTEX_H -#include "apr_thread_mutex.h" +#include "fspr_thread_mutex.h" #include -struct apr_thread_mutex_t { - apr_pool_t *pool; +struct fspr_thread_mutex_t { + fspr_pool_t *pool; NXMutex_t *mutex; }; diff --git a/libs/apr/include/arch/netware/apr_arch_thread_rwlock.h b/libs/apr/include/arch/netware/fspr_arch_thread_rwlock.h similarity index 91% rename from libs/apr/include/arch/netware/apr_arch_thread_rwlock.h rename to libs/apr/include/arch/netware/fspr_arch_thread_rwlock.h index d2dbd42f79..56df129656 100644 --- a/libs/apr/include/arch/netware/apr_arch_thread_rwlock.h +++ b/libs/apr/include/arch/netware/fspr_arch_thread_rwlock.h @@ -17,11 +17,11 @@ #ifndef THREAD_RWLOCK_H #define THREAD_RWLOCK_H -#include "apr_thread_rwlock.h" +#include "fspr_thread_rwlock.h" #include -struct apr_thread_rwlock_t { - apr_pool_t *pool; +struct fspr_thread_rwlock_t { + fspr_pool_t *pool; NXRwLock_t *rwlock; }; diff --git a/libs/apr/include/arch/netware/apr_arch_threadproc.h b/libs/apr/include/arch/netware/fspr_arch_threadproc.h similarity index 59% rename from libs/apr/include/arch/netware/apr_arch_threadproc.h rename to libs/apr/include/arch/netware/fspr_arch_threadproc.h index 713ed295af..5dd85058f7 100644 --- a/libs/apr/include/arch/netware/apr_arch_threadproc.h +++ b/libs/apr/include/arch/netware/fspr_arch_threadproc.h @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_thread_proc.h" -#include "apr_file_io.h" +#include "fspr.h" +#include "fspr_thread_proc.h" +#include "fspr_file_io.h" #include @@ -26,52 +26,52 @@ #define SHELL_PATH "" #define APR_DEFAULT_STACK_SIZE 65536 -struct apr_thread_t { - apr_pool_t *pool; +struct fspr_thread_t { + fspr_pool_t *pool; NXContext_t ctx; NXThreadId_t td; char *thread_name; - apr_int32_t cancel; - apr_int32_t cancel_how; + fspr_int32_t cancel; + fspr_int32_t cancel_how; void *data; - apr_thread_start_t func; - apr_status_t exitval; + fspr_thread_start_t func; + fspr_status_t exitval; }; -struct apr_threadattr_t { - apr_pool_t *pool; - apr_size_t stack_size; - apr_int32_t detach; +struct fspr_threadattr_t { + fspr_pool_t *pool; + fspr_size_t stack_size; + fspr_int32_t detach; char *thread_name; }; -struct apr_threadkey_t { - apr_pool_t *pool; +struct fspr_threadkey_t { + fspr_pool_t *pool; NXKey_t key; }; -struct apr_procattr_t { - apr_pool_t *pool; - 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; +struct fspr_procattr_t { + fspr_pool_t *pool; + fspr_file_t *parent_in; + fspr_file_t *child_in; + fspr_file_t *parent_out; + fspr_file_t *child_out; + fspr_file_t *parent_err; + fspr_file_t *child_err; char *currdir; - apr_int32_t cmdtype; - apr_int32_t detached; - apr_int32_t addrspace; + fspr_int32_t cmdtype; + fspr_int32_t detached; + fspr_int32_t addrspace; }; -struct apr_thread_once_t { +struct fspr_thread_once_t { unsigned long value; }; -//struct apr_proc_t { -// apr_pool_t *pool; +//struct fspr_proc_t { +// fspr_pool_t *pool; // pid_t pid; -// apr_procattr_t *attr; +// fspr_procattr_t *attr; //}; #endif /* ! THREAD_PROC_H */ diff --git a/libs/apr/include/arch/netware/apr_private.h b/libs/apr/include/arch/netware/fspr_private.h similarity index 98% rename from libs/apr/include/arch/netware/apr_private.h rename to libs/apr/include/arch/netware/fspr_private.h index ad659b5988..a200fcc6a1 100644 --- a/libs/apr/include/arch/netware/apr_private.h +++ b/libs/apr/include/arch/netware/fspr_private.h @@ -28,7 +28,7 @@ /* Include the public APR symbols, include our idea of the 'right' * subset of the Windows.h header. This saves us repetition. */ -#include "apr.h" +#include "fspr.h" #include #include @@ -185,7 +185,7 @@ void* getStatCache(); /* * Include common private declarations. */ -#include "../apr_private_common.h" +#include "../fspr_private_common.h" #endif /*APR_PRIVATE_H*/ #endif /*NETWARE*/ diff --git a/libs/apr/include/arch/os2/apr_arch_os2calls.h b/libs/apr/include/arch/os2/apr_arch_os2calls.h deleted file mode 100644 index 3c739bfd19..0000000000 --- a/libs/apr/include/arch/os2/apr_arch_os2calls.h +++ /dev/null @@ -1,59 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "apr_errno.h" -#include -#include - -extern int (*apr_os2_socket)(int, int, int); -extern int (*apr_os2_select)(int *, int, int, int, long); -extern int (*apr_os2_sock_errno)(); -extern int (*apr_os2_accept)(int, struct sockaddr *, int *); -extern int (*apr_os2_bind)(int, struct sockaddr *, int); -extern int (*apr_os2_connect)(int, struct sockaddr *, int); -extern int (*apr_os2_getpeername)(int, struct sockaddr *, int *); -extern int (*apr_os2_getsockname)(int, struct sockaddr *, int *); -extern int (*apr_os2_getsockopt)(int, int, int, char *, int *); -extern int (*apr_os2_ioctl)(int, int, caddr_t, int); -extern int (*apr_os2_listen)(int, int); -extern int (*apr_os2_recv)(int, char *, int, int); -extern int (*apr_os2_send)(int, const char *, int, int); -extern int (*apr_os2_setsockopt)(int, int, int, char *, int); -extern int (*apr_os2_shutdown)(int, int); -extern int (*apr_os2_soclose)(int); -extern int (*apr_os2_writev)(int, struct iovec *, int); -extern int (*apr_os2_sendto)(int, const char *, int, int, const struct sockaddr *, int); -extern int (*apr_os2_recvfrom)(int, char *, int, int, struct sockaddr *, int *); - -#define socket apr_os2_socket -#define select apr_os2_select -#define sock_errno apr_os2_sock_errno -#define accept apr_os2_accept -#define bind apr_os2_bind -#define connect apr_os2_connect -#define getpeername apr_os2_getpeername -#define getsockname apr_os2_getsockname -#define getsockopt apr_os2_getsockopt -#define ioctl apr_os2_ioctl -#define listen apr_os2_listen -#define recv apr_os2_recv -#define send apr_os2_send -#define setsockopt apr_os2_setsockopt -#define shutdown apr_os2_shutdown -#define soclose apr_os2_soclose -#define writev apr_os2_writev -#define sendto apr_os2_sendto -#define recvfrom apr_os2_recvfrom diff --git a/libs/apr/include/arch/os2/apr_arch_dso.h b/libs/apr/include/arch/os2/fspr_arch_dso.h similarity index 79% rename from libs/apr/include/arch/os2/apr_arch_dso.h rename to libs/apr/include/arch/os2/fspr_arch_dso.h index 2bda6b7c66..ee6eb45ae7 100644 --- a/libs/apr/include/arch/os2/apr_arch_dso.h +++ b/libs/apr/include/arch/os2/fspr_arch_dso.h @@ -17,18 +17,18 @@ #ifndef DSO_H #define DSO_H -#include "apr_private.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_dso.h" -#include "apr.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_pools.h" +#include "fspr_dso.h" +#include "fspr.h" #if APR_HAS_DSO -struct apr_dso_handle_t { - apr_pool_t *cont; /* Context for returning error strings */ +struct fspr_dso_handle_t { + fspr_pool_t *cont; /* Context for returning error strings */ HMODULE handle; /* Handle to the DSO loaded */ - apr_status_t load_error; + fspr_status_t load_error; char *failed_module; }; diff --git a/libs/apr/include/arch/os2/apr_arch_file_io.h b/libs/apr/include/arch/os2/fspr_arch_file_io.h similarity index 67% rename from libs/apr/include/arch/os2/apr_arch_file_io.h rename to libs/apr/include/arch/os2/fspr_arch_file_io.h index a8884c34dc..8f2c2da0f6 100644 --- a/libs/apr/include/arch/os2/apr_arch_file_io.h +++ b/libs/apr/include/arch/os2/fspr_arch_file_io.h @@ -17,13 +17,13 @@ #ifndef FILE_IO_H #define FILE_IO_H -#include "apr_private.h" -#include "apr_general.h" -#include "apr_thread_mutex.h" -#include "apr_file_io.h" -#include "apr_file_info.h" -#include "apr_errno.h" -#include "apr_poll.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_thread_mutex.h" +#include "fspr_file_io.h" +#include "fspr_file_info.h" +#include "fspr_errno.h" +#include "fspr_poll.h" /* We have an implementation of mkstemp but it's not very multi-threading * friendly & is part of the POSIX emulation rather than native so don't @@ -33,14 +33,14 @@ #define APR_FILE_BUFSIZE 4096 -struct apr_file_t { - apr_pool_t *pool; +struct fspr_file_t { + fspr_pool_t *pool; HFILE filedes; char * fname; int isopen; int buffered; int eof_hit; - apr_int32_t flags; + fspr_int32_t flags; int timeout; int pipe; HEV pipeSem; @@ -52,32 +52,32 @@ struct apr_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 - apr_thread_mutex_t *mutex;// mutex semaphore, must be owned to access the above fields + fspr_thread_mutex_t *mutex;// mutex semaphore, must be owned to access the above fields }; -struct apr_dir_t { - apr_pool_t *pool; +struct fspr_dir_t { + fspr_pool_t *pool; char *dirname; ULONG handle; FILEFINDBUF3 entry; int validentry; }; -apr_status_t apr_file_cleanup(void *); -apr_status_t apr_os2_time_to_apr_time(apr_time_t *result, FDATE os2date, +fspr_status_t fspr_file_cleanup(void *); +fspr_status_t fspr_os2_time_to_fspr_time(fspr_time_t *result, FDATE os2date, FTIME os2time); -apr_status_t apr_apr_time_to_os2_time(FDATE *os2date, FTIME *os2time, - apr_time_t aprtime); +fspr_status_t fspr_fspr_time_to_os2_time(FDATE *os2date, FTIME *os2time, + fspr_time_t aprtime); /* see win32/fileio.h for description of these */ extern const char c_is_fnchar[256]; #define IS_FNCHAR(c) c_is_fnchar[(unsigned char)c] -apr_status_t filepath_root_test(char *path, apr_pool_t *p); -apr_status_t filepath_drive_get(char **rootpath, char drive, - apr_int32_t flags, apr_pool_t *p); -apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p); +fspr_status_t filepath_root_test(char *path, fspr_pool_t *p); +fspr_status_t filepath_drive_get(char **rootpath, char drive, + fspr_int32_t flags, fspr_pool_t *p); +fspr_status_t filepath_root_case(char **rootpath, char *root, fspr_pool_t *p); #endif /* ! FILE_IO_H */ diff --git a/libs/apr/include/arch/os2/apr_arch_networkio.h b/libs/apr/include/arch/os2/fspr_arch_networkio.h similarity index 80% rename from libs/apr/include/arch/os2/apr_arch_networkio.h rename to libs/apr/include/arch/os2/fspr_arch_networkio.h index 10c6de81fb..9fd277ab8d 100644 --- a/libs/apr/include/arch/os2/apr_arch_networkio.h +++ b/libs/apr/include/arch/os2/fspr_arch_networkio.h @@ -17,11 +17,11 @@ #ifndef NETWORK_IO_H #define NETWORK_IO_H -#include "apr_private.h" -#include "apr_network_io.h" -#include "apr_general.h" -#include "apr_arch_os2calls.h" -#include "apr_poll.h" +#include "fspr_private.h" +#include "fspr_network_io.h" +#include "fspr_general.h" +#include "fspr_arch_os2calls.h" +#include "fspr_poll.h" #if APR_HAVE_NETDB_H #include @@ -34,24 +34,24 @@ struct sock_userdata_t { void *data; }; -struct apr_socket_t { - apr_pool_t *pool; +struct fspr_socket_t { + fspr_pool_t *pool; int socketdes; int type; int protocol; - apr_sockaddr_t *local_addr; - apr_sockaddr_t *remote_addr; - apr_interval_time_t timeout; + fspr_sockaddr_t *local_addr; + fspr_sockaddr_t *remote_addr; + fspr_interval_time_t timeout; int nonblock; int local_port_unknown; int local_interface_unknown; int remote_addr_unknown; - apr_int32_t options; - apr_int32_t inherit; + fspr_int32_t options; + fspr_int32_t inherit; sock_userdata_t *userdata; /* if there is a timeout set, then this pollset is used */ - apr_pollset_t *pollset; + fspr_pollset_t *pollset; }; /* Error codes returned from sock_errno() */ @@ -68,9 +68,9 @@ struct apr_socket_t { #define SOCEPIPE (SOCBASEERR+32) /* Broken pipe */ #define SOCEOS2ERR (SOCBASEERR+100) /* OS/2 Error */ -const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size); -int apr_inet_pton(int af, const char *src, void *dst); -void apr_sockaddr_vars_set(apr_sockaddr_t *, int, apr_port_t); +const char *fspr_inet_ntop(int af, const void *src, char *dst, fspr_size_t size); +int fspr_inet_pton(int af, const char *src, void *dst); +void fspr_sockaddr_vars_set(fspr_sockaddr_t *, int, fspr_port_t); #endif /* ! NETWORK_IO_H */ diff --git a/libs/apr/include/arch/os2/fspr_arch_os2calls.h b/libs/apr/include/arch/os2/fspr_arch_os2calls.h new file mode 100644 index 0000000000..335662ffce --- /dev/null +++ b/libs/apr/include/arch/os2/fspr_arch_os2calls.h @@ -0,0 +1,59 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "fspr_errno.h" +#include +#include + +extern int (*fspr_os2_socket)(int, int, int); +extern int (*fspr_os2_select)(int *, int, int, int, long); +extern int (*fspr_os2_sock_errno)(); +extern int (*fspr_os2_accept)(int, struct sockaddr *, int *); +extern int (*fspr_os2_bind)(int, struct sockaddr *, int); +extern int (*fspr_os2_connect)(int, struct sockaddr *, int); +extern int (*fspr_os2_getpeername)(int, struct sockaddr *, int *); +extern int (*fspr_os2_getsockname)(int, struct sockaddr *, int *); +extern int (*fspr_os2_getsockopt)(int, int, int, char *, int *); +extern int (*fspr_os2_ioctl)(int, int, caddr_t, int); +extern int (*fspr_os2_listen)(int, int); +extern int (*fspr_os2_recv)(int, char *, int, int); +extern int (*fspr_os2_send)(int, const char *, int, int); +extern int (*fspr_os2_setsockopt)(int, int, int, char *, int); +extern int (*fspr_os2_shutdown)(int, int); +extern int (*fspr_os2_soclose)(int); +extern int (*fspr_os2_writev)(int, struct iovec *, int); +extern int (*fspr_os2_sendto)(int, const char *, int, int, const struct sockaddr *, int); +extern int (*fspr_os2_recvfrom)(int, char *, int, int, struct sockaddr *, int *); + +#define socket fspr_os2_socket +#define select fspr_os2_select +#define sock_errno fspr_os2_sock_errno +#define accept fspr_os2_accept +#define bind fspr_os2_bind +#define connect fspr_os2_connect +#define getpeername fspr_os2_getpeername +#define getsockname fspr_os2_getsockname +#define getsockopt fspr_os2_getsockopt +#define ioctl fspr_os2_ioctl +#define listen fspr_os2_listen +#define recv fspr_os2_recv +#define send fspr_os2_send +#define setsockopt fspr_os2_setsockopt +#define shutdown fspr_os2_shutdown +#define soclose fspr_os2_soclose +#define writev fspr_os2_writev +#define sendto fspr_os2_sendto +#define recvfrom fspr_os2_recvfrom diff --git a/libs/apr/include/arch/os2/apr_arch_proc_mutex.h b/libs/apr/include/arch/os2/fspr_arch_proc_mutex.h similarity index 89% rename from libs/apr/include/arch/os2/apr_arch_proc_mutex.h rename to libs/apr/include/arch/os2/fspr_arch_proc_mutex.h index 8caf3369dc..5270fbf277 100644 --- a/libs/apr/include/arch/os2/apr_arch_proc_mutex.h +++ b/libs/apr/include/arch/os2/fspr_arch_proc_mutex.h @@ -17,11 +17,11 @@ #ifndef PROC_MUTEX_H #define PROC_MUTEX_H -#include "apr_proc_mutex.h" -#include "apr_file_io.h" +#include "fspr_proc_mutex.h" +#include "fspr_file_io.h" -struct apr_proc_mutex_t { - apr_pool_t *pool; +struct fspr_proc_mutex_t { + fspr_pool_t *pool; HMTX hMutex; TID owner; int lock_count; diff --git a/libs/apr/include/arch/os2/apr_arch_thread_cond.h b/libs/apr/include/arch/os2/fspr_arch_thread_cond.h similarity index 89% rename from libs/apr/include/arch/os2/apr_arch_thread_cond.h rename to libs/apr/include/arch/os2/fspr_arch_thread_cond.h index 648b85d148..6a2ecd8e01 100644 --- a/libs/apr/include/arch/os2/apr_arch_thread_cond.h +++ b/libs/apr/include/arch/os2/fspr_arch_thread_cond.h @@ -17,11 +17,11 @@ #ifndef THREAD_COND_H #define THREAD_COND_H -#include "apr_thread_cond.h" -#include "apr_file_io.h" +#include "fspr_thread_cond.h" +#include "fspr_file_io.h" -struct apr_thread_cond_t { - apr_pool_t *pool; +struct fspr_thread_cond_t { + fspr_pool_t *pool; }; #endif /* THREAD_COND_H */ diff --git a/libs/apr/include/arch/os2/apr_arch_thread_mutex.h b/libs/apr/include/arch/os2/fspr_arch_thread_mutex.h similarity index 89% rename from libs/apr/include/arch/os2/apr_arch_thread_mutex.h rename to libs/apr/include/arch/os2/fspr_arch_thread_mutex.h index 3ae2a41db7..fc6aeed45a 100644 --- a/libs/apr/include/arch/os2/apr_arch_thread_mutex.h +++ b/libs/apr/include/arch/os2/fspr_arch_thread_mutex.h @@ -17,11 +17,11 @@ #ifndef THREAD_MUTEX_H #define THREAD_MUTEX_H -#include "apr_thread_mutex.h" -#include "apr_file_io.h" +#include "fspr_thread_mutex.h" +#include "fspr_file_io.h" -struct apr_thread_mutex_t { - apr_pool_t *pool; +struct fspr_thread_mutex_t { + fspr_pool_t *pool; HMTX hMutex; }; diff --git a/libs/apr/include/arch/os2/apr_arch_thread_rwlock.h b/libs/apr/include/arch/os2/fspr_arch_thread_rwlock.h similarity index 89% rename from libs/apr/include/arch/os2/apr_arch_thread_rwlock.h rename to libs/apr/include/arch/os2/fspr_arch_thread_rwlock.h index 7187d5cb2e..fa721bf5a2 100644 --- a/libs/apr/include/arch/os2/apr_arch_thread_rwlock.h +++ b/libs/apr/include/arch/os2/fspr_arch_thread_rwlock.h @@ -17,11 +17,11 @@ #ifndef THREAD_RWLOCK_H #define THREAD_RWLOCK_H -#include "apr_thread_rwlock.h" -#include "apr_file_io.h" +#include "fspr_thread_rwlock.h" +#include "fspr_file_io.h" -struct apr_thread_rwlock_t { - apr_pool_t *pool; +struct fspr_thread_rwlock_t { + fspr_pool_t *pool; int readers; HMTX write_lock; HEV read_done; diff --git a/libs/apr/include/arch/os2/apr_arch_threadproc.h b/libs/apr/include/arch/os2/fspr_arch_threadproc.h similarity index 64% rename from libs/apr/include/arch/os2/apr_arch_threadproc.h rename to libs/apr/include/arch/os2/fspr_arch_threadproc.h index c8017adbff..ac1aa39c10 100644 --- a/libs/apr/include/arch/os2/apr_arch_threadproc.h +++ b/libs/apr/include/arch/os2/fspr_arch_threadproc.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "apr_thread_proc.h" -#include "apr_file_io.h" +#include "fspr_thread_proc.h" +#include "fspr_file_io.h" #ifndef THREAD_PROC_H #define THREAD_PROC_H @@ -25,40 +25,40 @@ #define SHELL_PATH "cmd.exe" #define APR_THREAD_STACKSIZE 65536 -struct apr_threadattr_t { - apr_pool_t *pool; +struct fspr_threadattr_t { + fspr_pool_t *pool; unsigned long attr; - apr_size_t stacksize; + fspr_size_t stacksize; }; -struct apr_thread_t { - apr_pool_t *pool; - struct apr_threadattr_t *attr; +struct fspr_thread_t { + fspr_pool_t *pool; + struct fspr_threadattr_t *attr; unsigned long tid; - apr_thread_start_t func; + fspr_thread_start_t func; void *data; - apr_status_t exitval; + fspr_status_t exitval; }; -struct apr_threadkey_t { - apr_pool_t *pool; +struct fspr_threadkey_t { + fspr_pool_t *pool; unsigned long *key; }; -struct apr_procattr_t { - apr_pool_t *pool; - 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; +struct fspr_procattr_t { + fspr_pool_t *pool; + fspr_file_t *parent_in; + fspr_file_t *child_in; + fspr_file_t *parent_out; + fspr_file_t *child_out; + fspr_file_t *parent_err; + fspr_file_t *child_err; char *currdir; - apr_int32_t cmdtype; - apr_int32_t detached; + fspr_int32_t cmdtype; + fspr_int32_t detached; }; -struct apr_thread_once_t { +struct fspr_thread_once_t { unsigned long sem; char hit; }; diff --git a/libs/apr/include/arch/os390/apr_arch_dso.h b/libs/apr/include/arch/os390/fspr_arch_dso.h similarity index 86% rename from libs/apr/include/arch/os390/apr_arch_dso.h rename to libs/apr/include/arch/os390/fspr_arch_dso.h index 4263297b40..5fb8845ff6 100644 --- a/libs/apr/include/arch/os390/apr_arch_dso.h +++ b/libs/apr/include/arch/os390/fspr_arch_dso.h @@ -17,21 +17,21 @@ #ifndef DSO_H #define DSO_H -#include "apr_private.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_dso.h" -#include "apr.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_pools.h" +#include "fspr_dso.h" +#include "fspr.h" #if APR_HAS_DSO #include -struct apr_dso_handle_t { +struct fspr_dso_handle_t { dllhandle *handle; /* Handle to the DSO loaded */ int failing_errno; /* Don't save the buffer returned by strerror(); it gets reused */ - apr_pool_t *pool; + fspr_pool_t *pool; }; #endif diff --git a/libs/apr/include/arch/unix/apr_arch_dso.h b/libs/apr/include/arch/unix/fspr_arch_dso.h similarity index 88% rename from libs/apr/include/arch/unix/apr_arch_dso.h rename to libs/apr/include/arch/unix/fspr_arch_dso.h index d82182d48b..c65ccfccca 100644 --- a/libs/apr/include/arch/unix/apr_arch_dso.h +++ b/libs/apr/include/arch/unix/fspr_arch_dso.h @@ -17,11 +17,11 @@ #ifndef DSO_H #define DSO_H -#include "apr_private.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_dso.h" -#include "apr.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_pools.h" +#include "fspr_dso.h" +#include "fspr.h" #if APR_HAS_DSO @@ -52,8 +52,8 @@ #define DLSYM_NEEDS_UNDERSCORE #endif -struct apr_dso_handle_t { - apr_pool_t *pool; +struct fspr_dso_handle_t { + fspr_pool_t *pool; void *handle; const char *errormsg; }; diff --git a/libs/apr/include/arch/unix/apr_arch_file_io.h b/libs/apr/include/arch/unix/fspr_arch_file_io.h similarity index 80% rename from libs/apr/include/arch/unix/apr_arch_file_io.h rename to libs/apr/include/arch/unix/fspr_arch_file_io.h index 05ef8ed741..70a1cf9984 100644 --- a/libs/apr/include/arch/unix/apr_arch_file_io.h +++ b/libs/apr/include/arch/unix/fspr_arch_file_io.h @@ -17,17 +17,17 @@ #ifndef FILE_IO_H #define FILE_IO_H -#include "apr.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_tables.h" -#include "apr_file_io.h" -#include "apr_file_info.h" -#include "apr_errno.h" -#include "apr_lib.h" -#include "apr_thread_mutex.h" +#include "fspr.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_tables.h" +#include "fspr_file_io.h" +#include "fspr_file_info.h" +#include "fspr_errno.h" +#include "fspr_lib.h" +#include "fspr_thread_mutex.h" #ifndef WAITIO_USES_POLL -#include "apr_poll.h" +#include "fspr_poll.h" #endif /* System headers the file I/O library needs */ @@ -84,29 +84,29 @@ #define APR_FILE_BUFSIZE 4096 -struct apr_file_t { - apr_pool_t *pool; +struct fspr_file_t { + fspr_pool_t *pool; int filedes; char *fname; - apr_int32_t flags; + fspr_int32_t flags; int eof_hit; int is_pipe; - apr_interval_time_t timeout; + fspr_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)*/ #ifndef WAITIO_USES_POLL /* if there is a timeout set, then this pollset is used */ - apr_pollset_t *pollset; + fspr_pollset_t *pollset; #endif /* Stuff for buffered mode */ char *buffer; int bufpos; /* Read/Write position in buffer */ unsigned long dataRead; /* amount of valid data read into buffer */ int direction; /* buffer being used for 0 = read, 1 = write */ - apr_off_t filePtr; /* position in file of handle */ + fspr_off_t filePtr; /* position in file of handle */ #if APR_HAS_THREADS - struct apr_thread_mutex_t *thlock; + struct fspr_thread_mutex_t *thlock; #endif }; @@ -121,17 +121,17 @@ typedef struct stat64 struct_stat; typedef struct stat struct_stat; #endif -struct apr_dir_t { - apr_pool_t *pool; +struct fspr_dir_t { + fspr_pool_t *pool; char *dirname; DIR *dirstruct; struct dirent *entry; }; -apr_status_t apr_unix_file_cleanup(void *); +fspr_status_t fspr_unix_file_cleanup(void *); -mode_t apr_unix_perms2mode(apr_fileperms_t perms); -apr_fileperms_t apr_unix_mode2perms(mode_t mode); +mode_t fspr_unix_perms2mode(fspr_fileperms_t perms); +fspr_fileperms_t fspr_unix_mode2perms(mode_t mode); #endif /* ! FILE_IO_H */ diff --git a/libs/apr/include/arch/unix/apr_arch_global_mutex.h b/libs/apr/include/arch/unix/fspr_arch_global_mutex.h similarity index 74% rename from libs/apr/include/arch/unix/apr_arch_global_mutex.h rename to libs/apr/include/arch/unix/fspr_arch_global_mutex.h index 3add9ecfa7..85c8c68745 100644 --- a/libs/apr/include/arch/unix/apr_arch_global_mutex.h +++ b/libs/apr/include/arch/unix/fspr_arch_global_mutex.h @@ -17,19 +17,19 @@ #ifndef GLOBAL_MUTEX_H #define GLOBAL_MUTEX_H -#include "apr.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_global_mutex.h" -#include "apr_arch_proc_mutex.h" -#include "apr_arch_thread_mutex.h" +#include "fspr.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_global_mutex.h" +#include "fspr_arch_proc_mutex.h" +#include "fspr_arch_thread_mutex.h" -struct apr_global_mutex_t { - apr_pool_t *pool; - apr_proc_mutex_t *proc_mutex; +struct fspr_global_mutex_t { + fspr_pool_t *pool; + fspr_proc_mutex_t *proc_mutex; #if APR_HAS_THREADS - apr_thread_mutex_t *thread_mutex; + fspr_thread_mutex_t *thread_mutex; #endif /* APR_HAS_THREADS */ }; diff --git a/libs/apr/include/arch/unix/apr_arch_inherit.h b/libs/apr/include/arch/unix/fspr_arch_inherit.h similarity index 85% rename from libs/apr/include/arch/unix/apr_arch_inherit.h rename to libs/apr/include/arch/unix/fspr_arch_inherit.h index 9a6bdbca58..50c9ca9c19 100644 --- a/libs/apr/include/arch/unix/apr_arch_inherit.h +++ b/libs/apr/include/arch/unix/fspr_arch_inherit.h @@ -17,32 +17,32 @@ #ifndef INHERIT_H #define INHERIT_H -#include "apr_inherit.h" +#include "fspr_inherit.h" #define APR_INHERIT (1 << 24) /* Must not conflict with other bits */ #define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \ -apr_status_t apr_##name##_inherit_set(apr_##name##_t *the##name) \ +fspr_status_t fspr_##name##_inherit_set(fspr_##name##_t *the##name) \ { \ if (the##name->flag & APR_FILE_NOCLEANUP) \ return APR_EINVAL; \ if (!(the##name->flag & APR_INHERIT)) { \ the##name->flag |= APR_INHERIT; \ - apr_pool_child_cleanup_set(the##name->pool, \ + fspr_pool_child_cleanup_set(the##name->pool, \ (void *)the##name, \ - cleanup, apr_pool_cleanup_null); \ + cleanup, fspr_pool_cleanup_null); \ } \ return APR_SUCCESS; \ } #define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \ -apr_status_t apr_##name##_inherit_unset(apr_##name##_t *the##name) \ +fspr_status_t fspr_##name##_inherit_unset(fspr_##name##_t *the##name) \ { \ if (the##name->flag & APR_FILE_NOCLEANUP) \ return APR_EINVAL; \ if (the##name->flag & APR_INHERIT) { \ the##name->flag &= ~APR_INHERIT; \ - apr_pool_child_cleanup_set(the##name->pool, \ + fspr_pool_child_cleanup_set(the##name->pool, \ (void *)the##name, \ cleanup, cleanup); \ } \ diff --git a/libs/apr/include/arch/unix/apr_arch_internal_time.h b/libs/apr/include/arch/unix/fspr_arch_internal_time.h similarity index 94% rename from libs/apr/include/arch/unix/apr_arch_internal_time.h rename to libs/apr/include/arch/unix/fspr_arch_internal_time.h index 6e12c67439..4ea5d3e95d 100644 --- a/libs/apr/include/arch/unix/apr_arch_internal_time.h +++ b/libs/apr/include/arch/unix/fspr_arch_internal_time.h @@ -17,8 +17,8 @@ #ifndef TIME_INTERNAL_H #define TIME_INTERNAL_H -#include "apr.h" +#include "fspr.h" -void apr_unix_setup_time(void); +void fspr_unix_setup_time(void); #endif /* TIME_INTERNAL_H */ diff --git a/libs/apr/include/arch/unix/apr_arch_misc.h b/libs/apr/include/arch/unix/fspr_arch_misc.h similarity index 76% rename from libs/apr/include/arch/unix/apr_arch_misc.h rename to libs/apr/include/arch/unix/fspr_arch_misc.h index 823512506c..70b3b5531d 100644 --- a/libs/apr/include/arch/unix/apr_arch_misc.h +++ b/libs/apr/include/arch/unix/fspr_arch_misc.h @@ -17,16 +17,16 @@ #ifndef MISC_H #define MISC_H -#include "apr.h" -#include "apr_portable.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_getopt.h" -#include "apr_thread_proc.h" -#include "apr_file_io.h" -#include "apr_errno.h" -#include "apr_getopt.h" +#include "fspr.h" +#include "fspr_portable.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_pools.h" +#include "fspr_getopt.h" +#include "fspr_thread_proc.h" +#include "fspr_file_io.h" +#include "fspr_errno.h" +#include "fspr_getopt.h" #if APR_HAVE_STDIO_H #include @@ -49,13 +49,13 @@ #include #endif -struct apr_other_child_rec_t { - apr_pool_t *p; - struct apr_other_child_rec_t *next; - apr_proc_t *proc; +struct fspr_other_child_rec_t { + fspr_pool_t *p; + struct fspr_other_child_rec_t *next; + fspr_proc_t *proc; void (*maintenance) (int, void *, int); void *data; - apr_os_file_t write_fd; + fspr_os_file_t write_fd; }; #if defined(WIN32) || defined(NETWARE) diff --git a/libs/apr/include/arch/unix/apr_arch_networkio.h b/libs/apr/include/arch/unix/fspr_arch_networkio.h similarity index 80% rename from libs/apr/include/arch/unix/apr_arch_networkio.h rename to libs/apr/include/arch/unix/fspr_arch_networkio.h index 91018f7c6b..facbfe4382 100644 --- a/libs/apr/include/arch/unix/apr_arch_networkio.h +++ b/libs/apr/include/arch/unix/fspr_arch_networkio.h @@ -17,14 +17,14 @@ #ifndef NETWORK_IO_H #define NETWORK_IO_H -#include "apr.h" -#include "apr_private.h" -#include "apr_network_io.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_lib.h" +#include "fspr.h" +#include "fspr_private.h" +#include "fspr_network_io.h" +#include "fspr_errno.h" +#include "fspr_general.h" +#include "fspr_lib.h" #ifndef WAITIO_USES_POLL -#include "apr_poll.h" +#include "fspr_poll.h" #endif /* System headers the network I/O library needs */ @@ -100,37 +100,37 @@ struct sock_userdata_t { void *data; }; -struct apr_socket_t { - apr_pool_t *pool; +struct fspr_socket_t { + fspr_pool_t *pool; int socketdes; int type; int protocol; - apr_sockaddr_t *local_addr; - apr_sockaddr_t *remote_addr; - apr_interval_time_t timeout; + fspr_sockaddr_t *local_addr; + fspr_sockaddr_t *remote_addr; + fspr_interval_time_t timeout; #ifndef HAVE_POLL int connected; #endif int local_port_unknown; int local_interface_unknown; int remote_addr_unknown; - apr_int32_t options; - apr_int32_t inherit; + fspr_int32_t options; + fspr_int32_t inherit; sock_userdata_t *userdata; #ifndef WAITIO_USES_POLL /* if there is a timeout set, then this pollset is used */ - apr_pollset_t *pollset; + fspr_pollset_t *pollset; #endif }; -const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size); -int apr_inet_pton(int af, const char *src, void *dst); -void apr_sockaddr_vars_set(apr_sockaddr_t *, int, apr_port_t); +const char *fspr_inet_ntop(int af, const void *src, char *dst, fspr_size_t size); +int fspr_inet_pton(int af, const char *src, void *dst); +void fspr_sockaddr_vars_set(fspr_sockaddr_t *, int, fspr_port_t); -#define apr_is_option_set(skt, option) \ +#define fspr_is_option_set(skt, option) \ (((skt)->options & (option)) == (option)) -#define apr_set_option(skt, option, on) \ +#define fspr_set_option(skt, option, on) \ do { \ if (on) \ (skt)->options |= (option); \ diff --git a/libs/apr/include/arch/unix/apr_arch_poll_private.h b/libs/apr/include/arch/unix/fspr_arch_poll_private.h similarity index 83% rename from libs/apr/include/arch/unix/apr_arch_poll_private.h rename to libs/apr/include/arch/unix/fspr_arch_poll_private.h index f176eac0e5..93ad7b891c 100644 --- a/libs/apr/include/arch/unix/apr_arch_poll_private.h +++ b/libs/apr/include/arch/unix/fspr_arch_poll_private.h @@ -17,12 +17,12 @@ #ifndef APR_ARCH_POLL_PRIVATE_H #define APR_ARCH_POLL_PRIVATE_H -#include "apr.h" -#include "apr_poll.h" -#include "apr_time.h" -#include "apr_portable.h" -#include "apr_arch_networkio.h" -#include "apr_arch_file_io.h" +#include "fspr.h" +#include "fspr_poll.h" +#include "fspr_time.h" +#include "fspr_portable.h" +#include "fspr_arch_networkio.h" +#include "fspr_arch_file_io.h" #if HAVE_POLL_H #include @@ -52,7 +52,7 @@ #define HAS_PIPES(dt) (dt == APR_POLL_FILE) ? 1 : 0 #endif -/* Choose the best method platform specific to use in apr_pollset */ +/* Choose the best method platform specific to use in fspr_pollset */ #ifdef HAVE_KQUEUE #define POLLSET_USES_KQUEUE #elif defined(HAVE_PORT_CREATE) @@ -73,16 +73,16 @@ #if defined(POLLSET_USES_KQUEUE) || defined(POLLSET_USES_EPOLL) || defined(POLLSET_USES_PORT) -#include "apr_ring.h" +#include "fspr_ring.h" #if APR_HAS_THREADS -#include "apr_thread_mutex.h" +#include "fspr_thread_mutex.h" #define pollset_lock_rings() \ if (pollset->flags & APR_POLLSET_THREADSAFE) \ - apr_thread_mutex_lock(pollset->ring_lock); + fspr_thread_mutex_lock(pollset->ring_lock); #define pollset_unlock_rings() \ if (pollset->flags & APR_POLLSET_THREADSAFE) \ - apr_thread_mutex_unlock(pollset->ring_lock); + fspr_thread_mutex_unlock(pollset->ring_lock); #else #define pollset_lock_rings() #define pollset_unlock_rings() @@ -92,7 +92,7 @@ typedef struct pfd_elem_t pfd_elem_t; struct pfd_elem_t { APR_RING_ENTRY(pfd_elem_t) link; - apr_pollfd_t pfd; + fspr_pollfd_t pfd; }; #endif diff --git a/libs/apr/include/arch/unix/apr_arch_proc_mutex.h b/libs/apr/include/arch/unix/fspr_arch_proc_mutex.h similarity index 68% rename from libs/apr/include/arch/unix/apr_arch_proc_mutex.h rename to libs/apr/include/arch/unix/fspr_arch_proc_mutex.h index a307d94657..8f21801c7a 100644 --- a/libs/apr/include/arch/unix/apr_arch_proc_mutex.h +++ b/libs/apr/include/arch/unix/fspr_arch_proc_mutex.h @@ -23,15 +23,15 @@ #endif #endif -#include "apr.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_proc_mutex.h" -#include "apr_pools.h" -#include "apr_portable.h" -#include "apr_file_io.h" -#include "apr_arch_file_io.h" +#include "fspr.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_proc_mutex.h" +#include "fspr_pools.h" +#include "fspr_portable.h" +#include "fspr_file_io.h" +#include "fspr_arch_file_io.h" /* System headers required by Locks library */ #if APR_HAVE_SYS_TYPES_H @@ -73,19 +73,19 @@ #endif /* End System Headers */ -struct apr_proc_mutex_unix_lock_methods_t { +struct fspr_proc_mutex_unix_lock_methods_t { unsigned int flags; - apr_status_t (*create)(apr_proc_mutex_t *, const char *); - apr_status_t (*acquire)(apr_proc_mutex_t *); - apr_status_t (*tryacquire)(apr_proc_mutex_t *); - apr_status_t (*release)(apr_proc_mutex_t *); - apr_status_t (*cleanup)(void *); - apr_status_t (*child_init)(apr_proc_mutex_t **, apr_pool_t *, const char *); + fspr_status_t (*create)(fspr_proc_mutex_t *, const char *); + fspr_status_t (*acquire)(fspr_proc_mutex_t *); + fspr_status_t (*tryacquire)(fspr_proc_mutex_t *); + fspr_status_t (*release)(fspr_proc_mutex_t *); + fspr_status_t (*cleanup)(void *); + fspr_status_t (*child_init)(fspr_proc_mutex_t **, fspr_pool_t *, const char *); const char *name; }; -typedef struct apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_lock_methods_t; +typedef struct fspr_proc_mutex_unix_lock_methods_t fspr_proc_mutex_unix_lock_methods_t; -/* bit values for flags field in apr_unix_lock_methods_t */ +/* bit values for flags field in fspr_unix_lock_methods_t */ #define APR_PROCESS_LOCK_MECH_IS_GLOBAL 1 #if !APR_HAVE_UNION_SEMUN && defined(APR_HAS_SYSVSEM_SERIALIZE) @@ -96,14 +96,14 @@ union semun { }; #endif -struct apr_proc_mutex_t { - apr_pool_t *pool; - const apr_proc_mutex_unix_lock_methods_t *meth; - const apr_proc_mutex_unix_lock_methods_t *inter_meth; +struct fspr_proc_mutex_t { + fspr_pool_t *pool; + const fspr_proc_mutex_unix_lock_methods_t *meth; + const fspr_proc_mutex_unix_lock_methods_t *inter_meth; int curr_locked; char *fname; #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE - apr_file_t *interproc; + fspr_file_t *interproc; #endif #if APR_HAS_POSIXSEM_SERIALIZE sem_t *psem_interproc; @@ -113,7 +113,7 @@ struct apr_proc_mutex_t { #endif }; -void apr_proc_mutex_unix_setup_lock(void); +void fspr_proc_mutex_unix_setup_lock(void); #endif /* PROC_MUTEX_H */ diff --git a/libs/apr/include/arch/unix/apr_arch_shm.h b/libs/apr/include/arch/unix/fspr_arch_shm.h similarity index 81% rename from libs/apr/include/arch/unix/apr_arch_shm.h rename to libs/apr/include/arch/unix/fspr_arch_shm.h index dbd9b9bc5c..39b344ccdf 100644 --- a/libs/apr/include/arch/unix/apr_arch_shm.h +++ b/libs/apr/include/arch/unix/fspr_arch_shm.h @@ -17,15 +17,15 @@ #ifndef SHM_H #define SHM_H -#include "apr.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_shm.h" -#include "apr_pools.h" -#include "apr_file_io.h" -#include "apr_network_io.h" -#include "apr_portable.h" +#include "fspr.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_shm.h" +#include "fspr_pools.h" +#include "fspr_file_io.h" +#include "fspr_network_io.h" +#include "fspr_portable.h" #ifdef HAVE_SYS_MMAN_H #include @@ -55,12 +55,12 @@ #define MAP_FAILED ((void *)-1) #endif -struct apr_shm_t { - apr_pool_t *pool; +struct fspr_shm_t { + fspr_pool_t *pool; void *base; /* base real address */ void *usable; /* base usable address */ - apr_size_t reqsize; /* requested segment size */ - apr_size_t realsize; /* actual segment size */ + fspr_size_t reqsize; /* requested segment size */ + fspr_size_t realsize; /* actual segment size */ const char *filename; /* NULL if anonymous */ #if APR_USE_SHMEM_SHMGET || APR_USE_SHMEM_SHMGET_ANON int shmid; /* shmem ID returned from shmget() */ diff --git a/libs/apr/include/arch/unix/apr_arch_thread_cond.h b/libs/apr/include/arch/unix/fspr_arch_thread_cond.h similarity index 82% rename from libs/apr/include/arch/unix/apr_arch_thread_cond.h rename to libs/apr/include/arch/unix/fspr_arch_thread_cond.h index 5c2b51d1f4..369bc23b17 100644 --- a/libs/apr/include/arch/unix/apr_arch_thread_cond.h +++ b/libs/apr/include/arch/unix/fspr_arch_thread_cond.h @@ -17,13 +17,13 @@ #ifndef THREAD_COND_H #define THREAD_COND_H -#include "apr.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_thread_mutex.h" -#include "apr_thread_cond.h" -#include "apr_pools.h" +#include "fspr.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_thread_mutex.h" +#include "fspr_thread_cond.h" +#include "fspr_pools.h" #if APR_HAVE_PTHREAD_H #include @@ -32,8 +32,8 @@ /* XXX: Should we have a better autoconf search, something like * APR_HAS_PTHREAD_COND? -aaron */ #if APR_HAS_THREADS -struct apr_thread_cond_t { - apr_pool_t *pool; +struct fspr_thread_cond_t { + fspr_pool_t *pool; pthread_cond_t cond; }; #endif diff --git a/libs/apr/include/arch/unix/apr_arch_thread_mutex.h b/libs/apr/include/arch/unix/fspr_arch_thread_mutex.h similarity index 83% rename from libs/apr/include/arch/unix/apr_arch_thread_mutex.h rename to libs/apr/include/arch/unix/fspr_arch_thread_mutex.h index 0f9798701e..b11bd4ae1b 100644 --- a/libs/apr/include/arch/unix/apr_arch_thread_mutex.h +++ b/libs/apr/include/arch/unix/fspr_arch_thread_mutex.h @@ -23,20 +23,20 @@ #endif #endif -#include "apr.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_thread_mutex.h" -#include "apr_portable.h" -#include "apr_atomic.h" +#include "fspr.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_thread_mutex.h" +#include "fspr_portable.h" +#include "fspr_atomic.h" #if APR_HAVE_PTHREAD_H #include #endif #if APR_HAS_THREADS -struct apr_thread_mutex_t { - apr_pool_t *pool; +struct fspr_thread_mutex_t { + fspr_pool_t *pool; pthread_mutex_t mutex; }; #endif diff --git a/libs/apr/include/arch/unix/apr_arch_thread_rwlock.h b/libs/apr/include/arch/unix/fspr_arch_thread_rwlock.h similarity index 82% rename from libs/apr/include/arch/unix/apr_arch_thread_rwlock.h rename to libs/apr/include/arch/unix/fspr_arch_thread_rwlock.h index 2cb43af6a3..06a7e2a232 100644 --- a/libs/apr/include/arch/unix/apr_arch_thread_rwlock.h +++ b/libs/apr/include/arch/unix/fspr_arch_thread_rwlock.h @@ -17,11 +17,11 @@ #ifndef THREAD_RWLOCK_H #define THREAD_RWLOCK_H -#include "apr.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_thread_rwlock.h" -#include "apr_pools.h" +#include "fspr.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_thread_rwlock.h" +#include "fspr_pools.h" #if APR_HAVE_PTHREAD_H /* this gives us pthread_rwlock_t */ @@ -31,15 +31,15 @@ #if APR_HAS_THREADS #ifdef HAVE_PTHREAD_RWLOCKS -struct apr_thread_rwlock_t { - apr_pool_t *pool; +struct fspr_thread_rwlock_t { + fspr_pool_t *pool; pthread_rwlock_t rwlock; }; #else -struct apr_thread_rwlock_t { - apr_pool_t *pool; +struct fspr_thread_rwlock_t { + fspr_pool_t *pool; }; #endif diff --git a/libs/apr/include/arch/unix/apr_arch_threadproc.h b/libs/apr/include/arch/unix/fspr_arch_threadproc.h similarity index 71% rename from libs/apr/include/arch/unix/apr_arch_threadproc.h rename to libs/apr/include/arch/unix/fspr_arch_threadproc.h index 348c6c55d3..2573421b50 100644 --- a/libs/apr/include/arch/unix/apr_arch_threadproc.h +++ b/libs/apr/include/arch/unix/fspr_arch_threadproc.h @@ -14,11 +14,11 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_private.h" -#include "apr_thread_proc.h" -#include "apr_file_io.h" -#include "apr_arch_file_io.h" +#include "fspr.h" +#include "fspr_private.h" +#include "fspr_thread_proc.h" +#include "fspr_file_io.h" +#include "fspr_arch_file_io.h" /* System headers required for thread/process library */ #if APR_HAVE_PTHREAD_H @@ -49,43 +49,43 @@ #if APR_HAS_THREADS -struct apr_thread_t { - apr_pool_t *pool; +struct fspr_thread_t { + fspr_pool_t *pool; pthread_t *td; void *data; - apr_thread_start_t func; - apr_status_t exitval; + fspr_thread_start_t func; + fspr_status_t exitval; int priority; }; -struct apr_threadattr_t { - apr_pool_t *pool; +struct fspr_threadattr_t { + fspr_pool_t *pool; pthread_attr_t attr; int priority; }; -struct apr_threadkey_t { - apr_pool_t *pool; +struct fspr_threadkey_t { + fspr_pool_t *pool; pthread_key_t key; }; -struct apr_thread_once_t { +struct fspr_thread_once_t { pthread_once_t once; }; #endif -struct apr_procattr_t { - apr_pool_t *pool; - 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; +struct fspr_procattr_t { + fspr_pool_t *pool; + fspr_file_t *parent_in; + fspr_file_t *child_in; + fspr_file_t *parent_out; + fspr_file_t *child_out; + fspr_file_t *parent_err; + fspr_file_t *child_err; char *currdir; - apr_int32_t cmdtype; - apr_int32_t detached; + fspr_int32_t cmdtype; + fspr_int32_t detached; #ifdef RLIMIT_CPU struct rlimit *limit_cpu; #endif @@ -98,10 +98,10 @@ struct apr_procattr_t { #ifdef RLIMIT_NOFILE struct rlimit *limit_nofile; #endif - apr_child_errfn_t *errfn; - apr_int32_t errchk; - apr_uid_t uid; - apr_gid_t gid; + fspr_child_errfn_t *errfn; + fspr_int32_t errchk; + fspr_uid_t uid; + fspr_gid_t gid; }; #endif /* ! THREAD_PROC_H */ diff --git a/libs/apr/include/arch/win32/apr_arch_atime.h b/libs/apr/include/arch/win32/fspr_arch_atime.h similarity index 87% rename from libs/apr/include/arch/win32/apr_arch_atime.h rename to libs/apr/include/arch/win32/fspr_arch_atime.h index 47b75a9565..c1a47d12a9 100644 --- a/libs/apr/include/arch/win32/apr_arch_atime.h +++ b/libs/apr/include/arch/win32/fspr_arch_atime.h @@ -17,15 +17,15 @@ #ifndef ATIME_H #define ATIME_H -#include "apr_private.h" -#include "apr_time.h" +#include "fspr_private.h" +#include "fspr_time.h" #if APR_HAVE_TIME_H #include #endif struct atime_t { - apr_pool_t *cntxt; - apr_time_t currtime; + fspr_pool_t *cntxt; + fspr_time_t currtime; SYSTEMTIME *explodedtime; }; @@ -36,7 +36,7 @@ struct atime_t { #define APR_DELTA_EPOCH_IN_USEC APR_TIME_C(11644473600000000); -__inline void FileTimeToAprTime(apr_time_t *result, FILETIME *input) +__inline void FileTimeToAprTime(fspr_time_t *result, FILETIME *input) { /* Convert FILETIME one 64 bit number so we can work with it. */ *result = input->dwHighDateTime; @@ -48,7 +48,7 @@ __inline void FileTimeToAprTime(apr_time_t *result, FILETIME *input) } -__inline void AprTimeToFileTime(LPFILETIME pft, apr_time_t t) +__inline void AprTimeToFileTime(LPFILETIME pft, fspr_time_t t) { LONGLONG ll; t += APR_DELTA_EPOCH_IN_USEC; diff --git a/libs/apr/include/arch/win32/apr_arch_dso.h b/libs/apr/include/arch/win32/fspr_arch_dso.h similarity index 81% rename from libs/apr/include/arch/win32/apr_arch_dso.h rename to libs/apr/include/arch/win32/fspr_arch_dso.h index e2e4e40f2e..983b42eca7 100644 --- a/libs/apr/include/arch/win32/apr_arch_dso.h +++ b/libs/apr/include/arch/win32/fspr_arch_dso.h @@ -17,18 +17,18 @@ #ifndef DSO_H #define DSO_H -#include "apr_private.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_dso.h" -#include "apr.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_pools.h" +#include "fspr_dso.h" +#include "fspr.h" #if APR_HAS_DSO -struct apr_dso_handle_t { - apr_pool_t *cont; +struct fspr_dso_handle_t { + fspr_pool_t *cont; void *handle; - apr_status_t load_error; + fspr_status_t load_error; }; #endif diff --git a/libs/apr/include/arch/win32/apr_arch_file_io.h b/libs/apr/include/arch/win32/fspr_arch_file_io.h similarity index 72% rename from libs/apr/include/arch/win32/apr_arch_file_io.h rename to libs/apr/include/arch/win32/fspr_arch_file_io.h index 35c3c072ec..852d89dd65 100644 --- a/libs/apr/include/arch/win32/apr_arch_file_io.h +++ b/libs/apr/include/arch/win32/fspr_arch_file_io.h @@ -17,17 +17,17 @@ #ifndef FILE_IO_H #define FILE_IO_H -#include "apr.h" -#include "apr_private.h" -#include "apr_pools.h" -#include "apr_general.h" -#include "apr_tables.h" -#include "apr_thread_mutex.h" -#include "apr_file_io.h" -#include "apr_file_info.h" -#include "apr_errno.h" -#include "apr_arch_misc.h" -#include "apr_poll.h" +#include "fspr.h" +#include "fspr_private.h" +#include "fspr_pools.h" +#include "fspr_general.h" +#include "fspr_tables.h" +#include "fspr_thread_mutex.h" +#include "fspr_file_io.h" +#include "fspr_file_info.h" +#include "fspr_errno.h" +#include "fspr_arch_misc.h" +#include "fspr_poll.h" #ifdef HAVE_SYS_STAT_H #include @@ -49,10 +49,10 @@ #endif #if APR_HAS_UNICODE_FS -#include "arch/win32/apr_arch_utf8.h" +#include "arch/win32/fspr_arch_utf8.h" #include -typedef apr_uint16_t apr_wchar_t; +typedef fspr_uint16_t fspr_wchar_t; /* Helper functions for the WinNT ApiW() functions. APR treats all * resource identifiers (files, etc) by their UTF-8 name, to provide @@ -66,10 +66,10 @@ typedef apr_uint16_t apr_wchar_t; * Ascii API calls. So we tack them on in utf8_to_unicode_path, and * strip them right back off in unicode_to_utf8_path. */ -apr_status_t utf8_to_unicode_path(apr_wchar_t* dststr, apr_size_t dstchars, +fspr_status_t utf8_to_unicode_path(fspr_wchar_t* dststr, fspr_size_t dstchars, const char* srcstr); -apr_status_t unicode_to_utf8_path(char* dststr, apr_size_t dstchars, - const apr_wchar_t* srcstr); +fspr_status_t unicode_to_utf8_path(char* dststr, fspr_size_t dstchars, + const fspr_wchar_t* srcstr); #endif /* APR_HAS_UNICODE_FS */ @@ -80,7 +80,7 @@ apr_status_t unicode_to_utf8_path(char* dststr, apr_size_t dstchars, * and return the appropriate char* or wchar* for ApiA or ApiW calls. */ -void *res_name_from_filename(const char *file, int global, apr_pool_t *pool); +void *res_name_from_filename(const char *file, int global, fspr_pool_t *pool); #define APR_FILE_MAX MAX_PATH @@ -95,7 +95,7 @@ void *res_name_from_filename(const char *file, int global, apr_pool_t *pool); #define S_IFWHT 0160000 /* Whiteout */ #endif -/* Internal Flags for apr_file_open */ +/* Internal Flags for fspr_file_open */ #define APR_OPENINFO 0x00100000 /* Open without READ or WRITE access */ #define APR_OPENLINK 0x00200000 /* Open a link itself, if supported */ #define APR_READCONTROL 0x00400000 /* Read the file's owner/perms */ @@ -128,20 +128,20 @@ void *res_name_from_filename(const char *file, int global, apr_pool_t *pool); /* Sneak the Readonly bit through finfo->protection for internal use _only_ */ #define APR_FREADONLY 0x10000000 -/* Private function for apr_stat/lstat/getfileinfo/dir_read */ -int fillin_fileinfo(apr_finfo_t *finfo, WIN32_FILE_ATTRIBUTE_DATA *wininfo, - int byhandle, apr_int32_t wanted); +/* Private function for fspr_stat/lstat/getfileinfo/dir_read */ +int fillin_fileinfo(fspr_finfo_t *finfo, WIN32_FILE_ATTRIBUTE_DATA *wininfo, + int byhandle, fspr_int32_t wanted); -/* Private function that extends apr_stat/lstat/getfileinfo/dir_read */ -apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, - apr_int32_t wanted, int whatfile); +/* Private function that extends fspr_stat/lstat/getfileinfo/dir_read */ +fspr_status_t more_finfo(fspr_finfo_t *finfo, const void *ufile, + fspr_int32_t wanted, int whatfile); /* whatfile types for the ufile arg */ #define MORE_OF_HANDLE 0 #define MORE_OF_FSPEC 1 #define MORE_OF_WFSPEC 2 -/* quick run-down of fields in windows' apr_file_t structure that may have +/* quick run-down of fields in windows' fspr_file_t structure that may have * obvious uses. * fname -- the filename as passed to the open call. * dwFileAttricutes -- Attributes used to open the file. @@ -150,19 +150,19 @@ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, * correctly when writing to a file with this flag set TRUE. */ -// for apr_poll.c; +// for fspr_poll.c; #define filedes filehand -struct apr_file_t { - apr_pool_t *pool; +struct fspr_file_t { + fspr_pool_t *pool; HANDLE filehand; BOOLEAN pipe; // Is this a pipe of a file? OVERLAPPED *pOverlapped; - apr_interval_time_t timeout; - apr_int32_t flags; + fspr_interval_time_t timeout; + fspr_int32_t flags; /* File specific info */ - apr_finfo_t *finfo; + fspr_finfo_t *finfo; char *fname; DWORD dwFileAttributes; int eof_hit; @@ -172,22 +172,22 @@ struct apr_file_t { /* Stuff for buffered mode */ char *buffer; - apr_size_t bufpos; // Read/Write position in buffer - apr_size_t dataRead; // amount of valid data read into buffer + fspr_size_t bufpos; // Read/Write position in buffer + fspr_size_t dataRead; // amount of valid data read into buffer int direction; // buffer being used for 0 = read, 1 = write - apr_off_t filePtr; // position in file of handle - apr_thread_mutex_t *mutex; // mutex semaphore, must be owned to access the above fields + fspr_off_t filePtr; // position in file of handle + fspr_thread_mutex_t *mutex; // mutex semaphore, must be owned to access the above fields /* if there is a timeout set, then this pollset is used */ - apr_pollset_t *pollset; + fspr_pollset_t *pollset; /* Pipe specific info */ }; -struct apr_dir_t { - apr_pool_t *pool; +struct fspr_dir_t { + fspr_pool_t *pool; HANDLE dirhand; - apr_size_t rootlen; + fspr_size_t rootlen; char *dirname; char *name; union { @@ -209,21 +209,21 @@ struct apr_dir_t { * or can confound the cmd.exe shell. Here's the list * [declared in filesys.c] */ -extern const char apr_c_is_fnchar[256]; +extern const char fspr_c_is_fnchar[256]; -#define IS_FNCHAR(c) (apr_c_is_fnchar[(unsigned char)(c)] & 1) -#define IS_SHCHAR(c) ((apr_c_is_fnchar[(unsigned char)(c)] & 2) == 2) +#define IS_FNCHAR(c) (fspr_c_is_fnchar[(unsigned char)(c)] & 1) +#define IS_SHCHAR(c) ((fspr_c_is_fnchar[(unsigned char)(c)] & 2) == 2) /* If the user passes APR_FILEPATH_TRUENAME to either - * apr_filepath_root or apr_filepath_merge, this fn determines + * fspr_filepath_root or fspr_filepath_merge, this fn determines * that the root really exists. It's expensive, wouldn't want * to do this too frequenly. */ -apr_status_t filepath_root_test(char *path, apr_pool_t *p); +fspr_status_t filepath_root_test(char *path, fspr_pool_t *p); -/* The apr_filepath_merge wants to canonicalize the cwd to the +/* The fspr_filepath_merge wants to canonicalize the cwd to the * addpath if the user passes NULL as the old root path (this * isn't true of an empty string "", which won't be concatenated. * @@ -233,18 +233,18 @@ apr_status_t filepath_root_test(char *path, apr_pool_t *p); * If flags includes the bit APR_FILEPATH_NATIVE, the path returned * is in the os-native format. */ -apr_status_t filepath_drive_get(char **rootpath, char drive, - apr_int32_t flags, apr_pool_t *p); +fspr_status_t filepath_drive_get(char **rootpath, char drive, + fspr_int32_t flags, fspr_pool_t *p); /* If the user passes d: vs. D: (or //mach/share vs. //MACH/SHARE), * we need to fold the case to canonical form. This function is * supposed to do so. */ -apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p); +fspr_status_t filepath_root_case(char **rootpath, char *root, fspr_pool_t *p); -apr_status_t file_cleanup(void *); +fspr_status_t file_cleanup(void *); /** * Internal function to create a Win32/NT pipe that respects some async @@ -259,20 +259,20 @@ apr_status_t file_cleanup(void *); * APR_FULL_NONBLOCK * * @remark It so happens that APR_FULL_BLOCK and APR_FULL_NONBLOCK - * are common to apr_procattr_io_set() in, out and err modes. + * are common to fspr_procattr_io_set() in, out and err modes. * Because APR_CHILD_BLOCK and APR_WRITE_BLOCK share the same value, * as do APR_PARENT_BLOCK and APR_READ_BLOCK, it's possible to use * that value directly for creating the stdout/stderr pipes. When * creating the stdin pipe, the values must be transposed. - * @see apr_procattr_io_set + * @see fspr_procattr_io_set */ -apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, - apr_int32_t blocking_mode, - apr_pool_t *p); +fspr_status_t fspr_create_nt_pipe(fspr_file_t **in, fspr_file_t **out, + fspr_int32_t blocking_mode, + fspr_pool_t *p); -/** @see apr_create_nt_pipe */ +/** @see fspr_create_nt_pipe */ #define APR_READ_BLOCK 3 -/** @see apr_create_nt_pipe */ +/** @see fspr_create_nt_pipe */ #define APR_WRITE_BLOCK 4 #endif /* ! FILE_IO_H */ diff --git a/libs/apr/include/arch/win32/apr_arch_inherit.h b/libs/apr/include/arch/win32/fspr_arch_inherit.h similarity index 87% rename from libs/apr/include/arch/win32/apr_arch_inherit.h rename to libs/apr/include/arch/win32/fspr_arch_inherit.h index 97c7d05d0a..02d9e05506 100644 --- a/libs/apr/include/arch/win32/apr_arch_inherit.h +++ b/libs/apr/include/arch/win32/fspr_arch_inherit.h @@ -17,19 +17,19 @@ #ifndef INHERIT_H #define INHERIT_H -#include "apr_inherit.h" +#include "fspr_inherit.h" #define APR_INHERIT (1 << 24) /* Must not conflict with other bits */ #define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \ -APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *the##name) \ +APR_DECLARE(fspr_status_t) fspr_##name##_inherit_set(fspr_##name##_t *the##name) \ { \ IF_WIN_OS_IS_UNICODE \ { \ if (!SetHandleInformation(the##name->filehand, \ HANDLE_FLAG_INHERIT, \ HANDLE_FLAG_INHERIT)) \ - return apr_get_os_error(); \ + return fspr_get_os_error(); \ } \ ELSE_WIN_OS_IS_ANSI \ { \ @@ -37,7 +37,7 @@ APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *the##name) \ if (!DuplicateHandle(hproc, the##name->filehand, \ hproc, &temp, 0, TRUE, \ DUPLICATE_SAME_ACCESS)) \ - return apr_get_os_error(); \ + return fspr_get_os_error(); \ CloseHandle(the##name->filehand); \ the##name->filehand = temp; \ } \ @@ -45,13 +45,13 @@ APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *the##name) \ } #define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \ -APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t *the##name)\ +APR_DECLARE(fspr_status_t) fspr_##name##_inherit_unset(fspr_##name##_t *the##name)\ { \ IF_WIN_OS_IS_UNICODE \ { \ if (!SetHandleInformation(the##name->filehand, \ HANDLE_FLAG_INHERIT, 0)) \ - return apr_get_os_error(); \ + return fspr_get_os_error(); \ } \ ELSE_WIN_OS_IS_ANSI \ { \ @@ -59,7 +59,7 @@ APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t *the##name)\ if (!DuplicateHandle(hproc, the##name->filehand, \ hproc, &temp, 0, FALSE, \ DUPLICATE_SAME_ACCESS)) \ - return apr_get_os_error(); \ + return fspr_get_os_error(); \ CloseHandle(the##name->filehand); \ the##name->filehand = temp; \ } \ diff --git a/libs/apr/include/arch/win32/apr_arch_misc.h b/libs/apr/include/arch/win32/fspr_arch_misc.h similarity index 78% rename from libs/apr/include/arch/win32/apr_arch_misc.h rename to libs/apr/include/arch/win32/fspr_arch_misc.h index 6db6a1b9d2..89f01d1f6d 100644 --- a/libs/apr/include/arch/win32/apr_arch_misc.h +++ b/libs/apr/include/arch/win32/fspr_arch_misc.h @@ -17,16 +17,16 @@ #ifndef MISC_H #define MISC_H -#include "apr.h" -#include "apr_portable.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_getopt.h" -#include "apr_thread_proc.h" -#include "apr_file_io.h" -#include "apr_errno.h" -#include "apr_getopt.h" +#include "fspr.h" +#include "fspr_portable.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_pools.h" +#include "fspr_getopt.h" +#include "fspr_thread_proc.h" +#include "fspr_file_io.h" +#include "fspr_errno.h" +#include "fspr_getopt.h" #if APR_HAVE_STDIO_H #include @@ -46,26 +46,26 @@ #include #endif -struct apr_other_child_rec_t { - apr_pool_t *p; - struct apr_other_child_rec_t *next; - apr_proc_t *proc; +struct fspr_other_child_rec_t { + fspr_pool_t *p; + struct fspr_other_child_rec_t *next; + fspr_proc_t *proc; void (*maintenance) (int, void *, int); void *data; - apr_os_file_t write_fd; + fspr_os_file_t write_fd; }; #define WSAHighByte 2 #define WSALowByte 0 -/* start.c and apr_app.c helpers and communication within misc.c +/* start.c and fspr_app.c helpers and communication within misc.c * - * They are not for public consumption, although apr_app_init_complete + * They are not for public consumption, although fspr_app_init_complete * must be an exported symbol to avoid reinitialization. */ -extern int APR_DECLARE_DATA apr_app_init_complete; +extern int APR_DECLARE_DATA fspr_app_init_complete; -int apr_wastrtoastr(char const * const * *retarr, +int fspr_wastrtoastr(char const * const * *retarr, wchar_t const * const *arr, int args); /* Platform specific designation of run time os version. @@ -104,11 +104,11 @@ typedef enum { APR_WIN_XP_SP1 = 61, APR_WIN_XP_SP2 = 62, APR_WIN_2003 = 70 -} apr_oslevel_e; +} fspr_oslevel_e; -extern APR_DECLARE_DATA apr_oslevel_e apr_os_level; +extern APR_DECLARE_DATA fspr_oslevel_e fspr_os_level; -apr_status_t apr_get_oslevel(apr_oslevel_e *); +fspr_status_t fspr_get_oslevel(fspr_oslevel_e *); /* The APR_HAS_ANSI_FS symbol is PRIVATE, and internal to APR. * APR only supports char data for filenames. Like most applications, @@ -131,7 +131,7 @@ apr_status_t apr_get_oslevel(apr_oslevel_e *); * build which supports only WINNT or WCE. */ #if APR_HAS_ANSI_FS && APR_HAS_UNICODE_FS -#define IF_WIN_OS_IS_UNICODE if (apr_os_level >= APR_WIN_UNICODE) +#define IF_WIN_OS_IS_UNICODE if (fspr_os_level >= APR_WIN_UNICODE) #define ELSE_WIN_OS_IS_ANSI else #else /* APR_HAS_UNICODE_FS */ #define IF_WIN_OS_IS_UNICODE @@ -146,26 +146,26 @@ typedef enum { DLL_SHSTDAPI = 4, // shell32 From ShellAPI.h DLL_NTDLL = 5, // shell32 From our real kernel DLL_defined = 6 // must define as last idx_ + 1 -} apr_dlltoken_e; +} fspr_dlltoken_e; -FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal); +FARPROC fspr_load_dll_func(fspr_dlltoken_e fnLib, char *fnName, int ordinal); -/* The apr_load_dll_func call WILL fault if the function cannot be loaded */ +/* The fspr_load_dll_func call WILL fault if the function cannot be loaded */ #define APR_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \ - typedef rettype (calltype *apr_winapi_fpt_##fn) args; \ - static apr_winapi_fpt_##fn apr_winapi_pfn_##fn = NULL; \ - __inline rettype apr_winapi_##fn args \ - { if (!apr_winapi_pfn_##fn) \ - apr_winapi_pfn_##fn = (apr_winapi_fpt_##fn) \ - apr_load_dll_func(lib, #fn, ord); \ - return (*(apr_winapi_pfn_##fn)) names; }; \ + typedef rettype (calltype *fspr_winapi_fpt_##fn) args; \ + static fspr_winapi_fpt_##fn fspr_winapi_pfn_##fn = NULL; \ + __inline rettype fspr_winapi_##fn args \ + { if (!fspr_winapi_pfn_##fn) \ + fspr_winapi_pfn_##fn = (fspr_winapi_fpt_##fn) \ + fspr_load_dll_func(lib, #fn, ord); \ + return (*(fspr_winapi_pfn_##fn)) names; }; \ /* Provide late bound declarations of every API function missing from * one or more supported releases of the Win32 API * - * lib is the enumerated token from apr_dlltoken_e, and must correspond - * to the string table entry in start.c used by the apr_load_dll_func(). + * lib is the enumerated token from fspr_dlltoken_e, and must correspond + * to the string table entry in start.c used by the fspr_load_dll_func(). * Token names (attempt to) follow Windows.h declarations prefixed by DLL_ * in order to facilitate comparison. Use the exact declaration syntax * and names from Windows.h to prevent ambigutity and bugs. @@ -190,9 +190,9 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExA, 0, IN GET_FILEEX_INFO_LEVELS fInfoLevelId, OUT LPVOID lpFileInformation), (lpFileName, fInfoLevelId, lpFileInformation)); -#define GetFileAttributesExA apr_winapi_GetFileAttributesExA +#define GetFileAttributesExA fspr_winapi_GetFileAttributesExA #undef GetFileAttributesEx -#define GetFileAttributesEx apr_winapi_GetFileAttributesExA +#define GetFileAttributesEx fspr_winapi_GetFileAttributesExA #ifdef GetFileAttributesExW #undef GetFileAttributesExW @@ -202,29 +202,29 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExW, 0, IN GET_FILEEX_INFO_LEVELS fInfoLevelId, OUT LPVOID lpFileInformation), (lpFileName, fInfoLevelId, lpFileInformation)); -#define GetFileAttributesExW apr_winapi_GetFileAttributesExW +#define GetFileAttributesExW fspr_winapi_GetFileAttributesExW APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, ( IN HANDLE hFile), (hFile)); -#define CancelIo apr_winapi_CancelIo +#define CancelIo fspr_winapi_CancelIo APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, TryEnterCriticalSection, 0, ( LPCRITICAL_SECTION lpCriticalSection), (lpCriticalSection)); -#define TryEnterCriticalSection apr_winapi_TryEnterCriticalSection +#define TryEnterCriticalSection fspr_winapi_TryEnterCriticalSection APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, SwitchToThread, 0, ( void), ()); -#define SwitchToThread apr_winapi_SwitchToThread +#define SwitchToThread fspr_winapi_SwitchToThread APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetEffectiveRightsFromAclW, 0, ( IN PACL pacl, IN PTRUSTEE_W pTrustee, OUT PACCESS_MASK pAccessRights), (pacl, pTrustee, pAccessRights)); -#define GetEffectiveRightsFromAclW apr_winapi_GetEffectiveRightsFromAclW +#define GetEffectiveRightsFromAclW fspr_winapi_GetEffectiveRightsFromAclW APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetNamedSecurityInfoW, 0, ( IN LPWSTR pObjectName, @@ -237,7 +237,7 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetNamedSecurityInfoW, 0, OUT PSECURITY_DESCRIPTOR *ppSecurityDescriptor), (pObjectName, ObjectType, SecurityInfo, ppsidOwner, ppsidGroup, ppDacl, ppSacl, ppSecurityDescriptor)); -#define GetNamedSecurityInfoW apr_winapi_GetNamedSecurityInfoW +#define GetNamedSecurityInfoW fspr_winapi_GetNamedSecurityInfoW APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetNamedSecurityInfoA, 0, ( IN LPSTR pObjectName, @@ -250,9 +250,9 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetNamedSecurityInfoA, 0, OUT PSECURITY_DESCRIPTOR *ppSecurityDescriptor), (pObjectName, ObjectType, SecurityInfo, ppsidOwner, ppsidGroup, ppDacl, ppSacl, ppSecurityDescriptor)); -#define GetNamedSecurityInfoA apr_winapi_GetNamedSecurityInfoA +#define GetNamedSecurityInfoA fspr_winapi_GetNamedSecurityInfoA #undef GetNamedSecurityInfo -#define GetNamedSecurityInfo apr_winapi_GetNamedSecurityInfoA +#define GetNamedSecurityInfo fspr_winapi_GetNamedSecurityInfoA APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetSecurityInfo, 0, ( IN HANDLE handle, @@ -265,13 +265,13 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetSecurityInfo, 0, ( OUT PSECURITY_DESCRIPTOR *ppSecurityDescriptor), (handle, ObjectType, SecurityInfo, ppsidOwner, ppsidGroup, ppDacl, ppSacl, ppSecurityDescriptor)); -#define GetSecurityInfo apr_winapi_GetSecurityInfo +#define GetSecurityInfo fspr_winapi_GetSecurityInfo APR_DECLARE_LATE_DLL_FUNC(DLL_SHSTDAPI, LPWSTR *, WINAPI, CommandLineToArgvW, 0, ( LPCWSTR lpCmdLine, int *pNumArgs), (lpCmdLine, pNumArgs)); -#define CommandLineToArgvW apr_winapi_CommandLineToArgvW +#define CommandLineToArgvW fspr_winapi_CommandLineToArgvW #endif /* !defined(_WIN32_WCE) && !defined(WINNT) */ @@ -282,14 +282,14 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtQueryTimerResolution, 0, ( ULONG *pMinRes, /* Maximum NS Resolution */ ULONG *pCurRes), /* Current NS Resolution */ (pMaxRes, pMinRes, pCurRes)); -#define QueryTimerResolution apr_winapi_NtQueryTimerResolution +#define QueryTimerResolution fspr_winapi_NtQueryTimerResolution APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtSetTimerResolution, 0, ( ULONG ReqRes, /* Requested NS Clock Resolution */ BOOL Acquire, /* Aquire (1) or Release (0) our interest */ ULONG *pNewRes), /* The NS Clock Resolution granted */ (ReqRes, Acquire, pNewRes)); -#define SetTimerResolution apr_winapi_NtSetTimerResolution +#define SetTimerResolution fspr_winapi_NtSetTimerResolution /* ### These are ULONG_PTR values, but that's int32 for all we care * until the Win64 port is prepared. @@ -310,7 +310,7 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtQueryInformationProcess, 0 ULONG LenPI, /* Use sizeof(PBI) */ ULONG *pSizePI), /* returns pPI buffer used (may pass NULL) */ (hProcess, info, pPI, LenPI, pSizePI)); -#define QueryInformationProcess apr_winapi_NtQueryInformationProcess +#define QueryInformationProcess fspr_winapi_NtQueryInformationProcess APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtQueryObject, 0, ( HANDLE hObject, /* Obvious */ @@ -319,7 +319,7 @@ APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, DWORD, WINAPI, NtQueryObject, 0, ( ULONG LenOI, /* Use sizeof(PBI) */ ULONG *pSizeOI), /* returns pPI buffer used (may pass NULL) */ (hObject, info, pOI, LenOI, pSizeOI)); -#define QueryObject apr_winapi_NtQueryObject +#define QueryObject fspr_winapi_NtQueryObject #endif /* !defined(_WIN32_WCE) */ diff --git a/libs/apr/include/arch/win32/apr_arch_networkio.h b/libs/apr/include/arch/win32/fspr_arch_networkio.h similarity index 74% rename from libs/apr/include/arch/win32/apr_arch_networkio.h rename to libs/apr/include/arch/win32/fspr_arch_networkio.h index bb58dde224..d125adc067 100644 --- a/libs/apr/include/arch/win32/apr_arch_networkio.h +++ b/libs/apr/include/arch/win32/fspr_arch_networkio.h @@ -17,9 +17,9 @@ #ifndef NETWORK_IO_H #define NETWORK_IO_H -#include "apr_network_io.h" -#include "apr_general.h" -#include "apr_poll.h" +#include "fspr_network_io.h" +#include "fspr_general.h" +#include "fspr_poll.h" #ifdef _MSC_VER #undef MCAST_JOIN_SOURCE_GROUP #endif @@ -31,24 +31,24 @@ struct sock_userdata_t { void *data; }; -struct apr_socket_t { - apr_pool_t *pool; +struct fspr_socket_t { + fspr_pool_t *pool; SOCKET socketdes; int type; /* SOCK_STREAM, SOCK_DGRAM */ int protocol; - apr_sockaddr_t *local_addr; - apr_sockaddr_t *remote_addr; + fspr_sockaddr_t *local_addr; + fspr_sockaddr_t *remote_addr; int timeout_ms; /* MUST MATCH if timeout > 0 */ - apr_interval_time_t timeout; - apr_int32_t disconnected; + fspr_interval_time_t timeout; + fspr_int32_t disconnected; int local_port_unknown; int local_interface_unknown; int remote_addr_unknown; - apr_int32_t options; - apr_int32_t inherit; + fspr_int32_t options; + fspr_int32_t inherit; #if APR_HAS_SENDFILE /* As of 07.20.04, the overlapped structure is only used by - * apr_socket_sendfile and that's where it will be allocated + * fspr_socket_sendfile and that's where it will be allocated * and initialized. */ OVERLAPPED *overlapped; @@ -56,7 +56,7 @@ struct apr_socket_t { sock_userdata_t *userdata; /* if there is a timeout set, then this pollset is used */ - apr_pollset_t *pollset; + fspr_pollset_t *pollset; }; #ifdef _WIN32_WCE @@ -71,16 +71,16 @@ typedef struct _WSABUF { #define HAVE_STRUCT_IPMREQ #endif -apr_status_t status_from_res_error(int); +fspr_status_t status_from_res_error(int); -const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size); -int apr_inet_pton(int af, const char *src, void *dst); -void apr_sockaddr_vars_set(apr_sockaddr_t *, int, apr_port_t); +const char *fspr_inet_ntop(int af, const void *src, char *dst, fspr_size_t size); +int fspr_inet_pton(int af, const char *src, void *dst); +void fspr_sockaddr_vars_set(fspr_sockaddr_t *, int, fspr_port_t); -#define apr_is_option_set(skt, option) \ +#define fspr_is_option_set(skt, option) \ (((skt)->options & (option)) == (option)) -#define apr_set_option(skt, option, on) \ +#define fspr_set_option(skt, option, on) \ do { \ if (on) \ (skt)->options |= (option); \ diff --git a/libs/apr/include/arch/win32/apr_arch_proc_mutex.h b/libs/apr/include/arch/win32/fspr_arch_proc_mutex.h similarity index 92% rename from libs/apr/include/arch/win32/apr_arch_proc_mutex.h rename to libs/apr/include/arch/win32/fspr_arch_proc_mutex.h index 4e3e399399..cde7698a09 100644 --- a/libs/apr/include/arch/win32/apr_arch_proc_mutex.h +++ b/libs/apr/include/arch/win32/fspr_arch_proc_mutex.h @@ -17,10 +17,10 @@ #ifndef PROC_MUTEX_H #define PROC_MUTEX_H -#include "apr_proc_mutex.h" +#include "fspr_proc_mutex.h" -struct apr_proc_mutex_t { - apr_pool_t *pool; +struct fspr_proc_mutex_t { + fspr_pool_t *pool; HANDLE handle; const char *fname; }; diff --git a/libs/apr/include/arch/win32/apr_arch_thread_cond.h b/libs/apr/include/arch/win32/fspr_arch_thread_cond.h similarity index 92% rename from libs/apr/include/arch/win32/apr_arch_thread_cond.h rename to libs/apr/include/arch/win32/fspr_arch_thread_cond.h index c7f69f8064..482ddf4021 100644 --- a/libs/apr/include/arch/win32/apr_arch_thread_cond.h +++ b/libs/apr/include/arch/win32/fspr_arch_thread_cond.h @@ -17,10 +17,10 @@ #ifndef THREAD_COND_H #define THREAD_COND_H -#include "apr_thread_cond.h" +#include "fspr_thread_cond.h" -struct apr_thread_cond_t { - apr_pool_t *pool; +struct fspr_thread_cond_t { + fspr_pool_t *pool; HANDLE semaphore; CRITICAL_SECTION csection; unsigned long num_waiting; diff --git a/libs/apr/include/arch/win32/apr_arch_thread_mutex.h b/libs/apr/include/arch/win32/fspr_arch_thread_mutex.h similarity index 94% rename from libs/apr/include/arch/win32/apr_arch_thread_mutex.h rename to libs/apr/include/arch/win32/fspr_arch_thread_mutex.h index 13d3c1cbd5..c74255b86f 100644 --- a/libs/apr/include/arch/win32/apr_arch_thread_mutex.h +++ b/libs/apr/include/arch/win32/fspr_arch_thread_mutex.h @@ -17,7 +17,7 @@ #ifndef THREAD_MUTEX_H #define THREAD_MUTEX_H -#include "apr_pools.h" +#include "fspr_pools.h" typedef enum thread_mutex_type { thread_mutex_critical_section, @@ -29,8 +29,8 @@ typedef enum thread_mutex_type { * and nested_mutex on Win9x only. Otherwise critical_section * is used for NT nexted mutexes providing optimal performance. */ -struct apr_thread_mutex_t { - apr_pool_t *pool; +struct fspr_thread_mutex_t { + fspr_pool_t *pool; thread_mutex_type type; HANDLE handle; CRITICAL_SECTION section; diff --git a/libs/apr/include/arch/win32/apr_arch_thread_rwlock.h b/libs/apr/include/arch/win32/fspr_arch_thread_rwlock.h similarity index 92% rename from libs/apr/include/arch/win32/apr_arch_thread_rwlock.h rename to libs/apr/include/arch/win32/fspr_arch_thread_rwlock.h index 0a6889df83..28e8f953fe 100644 --- a/libs/apr/include/arch/win32/apr_arch_thread_rwlock.h +++ b/libs/apr/include/arch/win32/fspr_arch_thread_rwlock.h @@ -17,10 +17,10 @@ #ifndef THREAD_RWLOCK_H #define THREAD_RWLOCK_H -#include "apr_thread_rwlock.h" +#include "fspr_thread_rwlock.h" -struct apr_thread_rwlock_t { - apr_pool_t *pool; +struct fspr_thread_rwlock_t { + fspr_pool_t *pool; HANDLE write_mutex; HANDLE read_event; LONG readers; diff --git a/libs/apr/include/arch/win32/apr_arch_threadproc.h b/libs/apr/include/arch/win32/fspr_arch_threadproc.h similarity index 60% rename from libs/apr/include/arch/win32/apr_arch_threadproc.h rename to libs/apr/include/arch/win32/fspr_arch_threadproc.h index 056090bf11..47d9cff910 100644 --- a/libs/apr/include/arch/win32/apr_arch_threadproc.h +++ b/libs/apr/include/arch/win32/fspr_arch_threadproc.h @@ -14,50 +14,50 @@ * limitations under the License. */ -#include "apr_private.h" -#include "apr_thread_proc.h" -#include "apr_file_io.h" +#include "fspr_private.h" +#include "fspr_thread_proc.h" +#include "fspr_file_io.h" #ifndef THREAD_PROC_H #define THREAD_PROC_H #define SHELL_PATH "cmd.exe" -struct apr_thread_t { - apr_pool_t *pool; +struct fspr_thread_t { + fspr_pool_t *pool; HANDLE td; - apr_int32_t cancel; - apr_int32_t cancel_how; + fspr_int32_t cancel; + fspr_int32_t cancel_how; void *data; - apr_thread_start_t func; - apr_status_t exitval; + fspr_thread_start_t func; + fspr_status_t exitval; }; -struct apr_threadattr_t { - apr_pool_t *pool; - apr_int32_t detach; - apr_size_t stacksize; +struct fspr_threadattr_t { + fspr_pool_t *pool; + fspr_int32_t detach; + fspr_size_t stacksize; int priority; }; -struct apr_threadkey_t { - apr_pool_t *pool; +struct fspr_threadkey_t { + fspr_pool_t *pool; DWORD key; }; -struct apr_procattr_t { - apr_pool_t *pool; - 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; +struct fspr_procattr_t { + fspr_pool_t *pool; + fspr_file_t *parent_in; + fspr_file_t *child_in; + fspr_file_t *parent_out; + fspr_file_t *child_out; + fspr_file_t *parent_err; + fspr_file_t *child_err; char *currdir; - apr_int32_t cmdtype; - apr_int32_t detached; - apr_child_errfn_t *errfn; - apr_int32_t errchk; + fspr_int32_t cmdtype; + fspr_int32_t detached; + fspr_child_errfn_t *errfn; + fspr_int32_t errchk; #ifndef _WIN32_WCE HANDLE user_token; LPSECURITY_ATTRIBUTES sa; @@ -65,7 +65,7 @@ struct apr_procattr_t { #endif }; -struct apr_thread_once_t { +struct fspr_thread_once_t { long value; }; diff --git a/libs/apr/include/arch/win32/apr_arch_utf8.h b/libs/apr/include/arch/win32/fspr_arch_utf8.h similarity index 76% rename from libs/apr/include/arch/win32/apr_arch_utf8.h rename to libs/apr/include/arch/win32/fspr_arch_utf8.h index 84f8bf775e..435ee03006 100644 --- a/libs/apr/include/arch/win32/apr_arch_utf8.h +++ b/libs/apr/include/arch/win32/fspr_arch_utf8.h @@ -17,13 +17,13 @@ #ifndef UTF8_H #define UTF8_H -#include "apr.h" -#include "apr_lib.h" -#include "apr_errno.h" +#include "fspr.h" +#include "fspr_lib.h" +#include "fspr_errno.h" /* If we ever support anything more exciting than char... this could move. */ -typedef apr_uint16_t apr_wchar_t; +typedef fspr_uint16_t fspr_wchar_t; /** * An APR internal function for fast utf-8 octet-encoded Unicode conversion @@ -34,10 +34,10 @@ typedef apr_uint16_t apr_wchar_t; * when the character code is invalid (in or out of context) and the later * when more characters were expected, but insufficient characters remain. */ -APR_DECLARE(apr_status_t) apr_conv_utf8_to_ucs2(const char *in, - apr_size_t *inbytes, - apr_wchar_t *out, - apr_size_t *outwords); +APR_DECLARE(fspr_status_t) fspr_conv_utf8_to_ucs2(const char *in, + fspr_size_t *inbytes, + fspr_wchar_t *out, + fspr_size_t *outwords); /** * An APR internal function for fast ucs-2 wide Unicode format conversion to @@ -48,9 +48,9 @@ APR_DECLARE(apr_status_t) apr_conv_utf8_to_ucs2(const char *in, * when the character code is invalid (in or out of context) and the later * when more words were expected, but insufficient words remain. */ -APR_DECLARE(apr_status_t) apr_conv_ucs2_to_utf8(const apr_wchar_t *in, - apr_size_t *inwords, +APR_DECLARE(fspr_status_t) fspr_conv_ucs2_to_utf8(const fspr_wchar_t *in, + fspr_size_t *inwords, char *out, - apr_size_t *outbytes); + fspr_size_t *outbytes); #endif /* def UTF8_H */ diff --git a/libs/apr/include/arch/win32/apr_dbg_win32_handles.h b/libs/apr/include/arch/win32/fspr_dbg_win32_handles.h similarity index 62% rename from libs/apr/include/arch/win32/apr_dbg_win32_handles.h rename to libs/apr/include/arch/win32/fspr_dbg_win32_handles.h index 471cd66dbf..ba576016a8 100644 --- a/libs/apr/include/arch/win32/apr_dbg_win32_handles.h +++ b/libs/apr/include/arch/win32/fspr_dbg_win32_handles.h @@ -23,18 +23,18 @@ extern "C" { /* USAGE: * - * Add the following include to apr_private.h for internal debugging, + * Add the following include to fspr_private.h for internal debugging, * or copy this header into apr/include add the include below to apr.h * for really global debugging; * - * #include "apr_dbg_win32_handles.h" + * #include "fspr_dbg_win32_handles.h" * - * apr_dbg_log is the crux of this function ... it uses Win32 API and + * fspr_dbg_log is the crux of this function ... it uses Win32 API and * no apr calls itself to log all activity to a file named for the * executing application with a .pid suffix. Ergo several instances * may be executing and logged at once. * - * HANDLE apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, int nh + * HANDLE fspr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, int nh * [, HANDLE *hv, char *dsc...]) * * returns: the handle passed in ha, which is cast back to the real return type. @@ -42,7 +42,7 @@ extern "C" { * formats one line into the debug log file if nh is zero; * ha (hex) seq(hex) tid(hex) fn fl ln * xxxxxxxx xxxxxxxx xxxxxxxx func() sourcefile:lineno - * The macro apr_dbg_rv makes this simple to implement for many APIs + * The macro fspr_dbg_rv makes this simple to implement for many APIs * that simply take args that don't interest us, and return a handle. * * formats multiple lines (nh) into the debug log file for each hv/dsc pair @@ -53,67 +53,67 @@ extern "C" { * treated as a handle. */ -APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, +APR_DECLARE_NONSTD(HANDLE) fspr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, int nh,/* HANDLE *hv, char *dsc */...); -#define apr_dbg_rv(fn, args) (apr_dbg_log(#fn,(fn) args,__FILE__,__LINE__,0)) +#define fspr_dbg_rv(fn, args) (fspr_dbg_log(#fn,(fn) args,__FILE__,__LINE__,0)) #define CloseHandle(h) \ - ((BOOL)apr_dbg_log("CloseHandle", \ + ((BOOL)fspr_dbg_log("CloseHandle", \ (HANDLE)(CloseHandle)(h), \ __FILE__,__LINE__,1, \ &(h),"")) -#define CreateEventA(sd,b1,b2,nm) apr_dbg_rv(CreateEventA,(sd,b1,b2,nm)) -#define CreateEventW(sd,b1,b2,nm) apr_dbg_rv(CreateEventW,(sd,b1,b2,nm)) +#define CreateEventA(sd,b1,b2,nm) fspr_dbg_rv(CreateEventA,(sd,b1,b2,nm)) +#define CreateEventW(sd,b1,b2,nm) fspr_dbg_rv(CreateEventW,(sd,b1,b2,nm)) -#define CreateFileA(nm,d1,d2,sd,d3,d4,h) apr_dbg_rv(CreateFileA,(nm,d1,d2,sd,d3,d4,h)) -#define CreateFileW(nm,d1,d2,sd,d3,d4,h) apr_dbg_rv(CreateFileW,(nm,d1,d2,sd,d3,d4,h)) +#define CreateFileA(nm,d1,d2,sd,d3,d4,h) fspr_dbg_rv(CreateFileA,(nm,d1,d2,sd,d3,d4,h)) +#define CreateFileW(nm,d1,d2,sd,d3,d4,h) fspr_dbg_rv(CreateFileW,(nm,d1,d2,sd,d3,d4,h)) -#define CreateFileMappingA(fh,sd,d1,d2,d3,nm) apr_dbg_rv(CreateFileMappingA,(fh,sd,d1,d2,d3,nm)) -#define CreateFileMappingW(fh,sd,d1,d2,d3,nm) apr_dbg_rv(CreateFileMappingW,(fh,sd,d1,d2,d3,nm)) +#define CreateFileMappingA(fh,sd,d1,d2,d3,nm) fspr_dbg_rv(CreateFileMappingA,(fh,sd,d1,d2,d3,nm)) +#define CreateFileMappingW(fh,sd,d1,d2,d3,nm) fspr_dbg_rv(CreateFileMappingW,(fh,sd,d1,d2,d3,nm)) -#define CreateMutexA(sd,b,nm) apr_dbg_rv(CreateMutexA,(sd,b,nm)) -#define CreateMutexW(sd,b,nm) apr_dbg_rv(CreateMutexW,(sd,b,nm)) +#define CreateMutexA(sd,b,nm) fspr_dbg_rv(CreateMutexA,(sd,b,nm)) +#define CreateMutexW(sd,b,nm) fspr_dbg_rv(CreateMutexW,(sd,b,nm)) -#define CreateIoCompletionPort(h1,h2,pd1,d2) apr_dbg_rv(CreateIoCompletionPort,(h1,h2,pd1,d2)) +#define CreateIoCompletionPort(h1,h2,pd1,d2) fspr_dbg_rv(CreateIoCompletionPort,(h1,h2,pd1,d2)) -#define CreateNamedPipeA(nm,d1,d2,d3,d4,d5,d6,sd) apr_dbg_rv(CreateNamedPipeA,(nm,d1,d2,d3,d4,d5,d6,sd)) -#define CreateNamedPipeW(nm,d1,d2,d3,d4,d5,d6,sd) apr_dbg_rv(CreateNamedPipeW,(nm,d1,d2,d3,d4,d5,d6,sd)) +#define CreateNamedPipeA(nm,d1,d2,d3,d4,d5,d6,sd) fspr_dbg_rv(CreateNamedPipeA,(nm,d1,d2,d3,d4,d5,d6,sd)) +#define CreateNamedPipeW(nm,d1,d2,d3,d4,d5,d6,sd) fspr_dbg_rv(CreateNamedPipeW,(nm,d1,d2,d3,d4,d5,d6,sd)) #define CreatePipe(ph1,ph2,sd,d) \ - ((BOOL)apr_dbg_log("CreatePipe", \ + ((BOOL)fspr_dbg_log("CreatePipe", \ (HANDLE)(CreatePipe)(ph1,ph2,sd,d), \ __FILE__,__LINE__,2, \ (ph1),"hRead", \ (ph2),"hWrite")) #define CreateProcessA(s1,s2,sd1,sd2,b,d1,s3,s4,pd2,hr) \ - ((BOOL)apr_dbg_log("CreateProcessA", \ + ((BOOL)fspr_dbg_log("CreateProcessA", \ (HANDLE)(CreateProcessA)(s1,s2,sd1,sd2,b,d1,s3,s4,pd2,hr), \ __FILE__,__LINE__,2, \ &((hr)->hProcess),"hProcess", \ &((hr)->hThread),"hThread")) #define CreateProcessW(s1,s2,sd1,sd2,b,d1,s3,s4,pd2,hr) \ - ((BOOL)apr_dbg_log("CreateProcessW", \ + ((BOOL)fspr_dbg_log("CreateProcessW", \ (HANDLE)(CreateProcessW)(s1,s2,sd1,sd2,b,d1,s3,s4,pd2,hr), \ __FILE__,__LINE__,2, \ &((hr)->hProcess),"hProcess", \ &((hr)->hThread),"hThread")) -#define CreateSemaphoreA(sd,d1,d2,nm) apr_dbg_rv(CreateSemaphoreA,(sd,d1,d2,nm)) -#define CreateSemaphoreW(sd,d1,d2,nm) apr_dbg_rv(CreateSemaphoreW,(sd,d1,d2,nm)) +#define CreateSemaphoreA(sd,d1,d2,nm) fspr_dbg_rv(CreateSemaphoreA,(sd,d1,d2,nm)) +#define CreateSemaphoreW(sd,d1,d2,nm) fspr_dbg_rv(CreateSemaphoreW,(sd,d1,d2,nm)) -#define CreateThread(sd,d1,fn,pv,d2,pd3) apr_dbg_rv(CreateThread,(sd,d1,fn,pv,d2,pd3)) +#define CreateThread(sd,d1,fn,pv,d2,pd3) fspr_dbg_rv(CreateThread,(sd,d1,fn,pv,d2,pd3)) #define DeregisterEventSource(h) \ - ((BOOL)apr_dbg_log("DeregisterEventSource", \ + ((BOOL)fspr_dbg_log("DeregisterEventSource", \ (HANDLE)(DeregisterEventSource)(h), \ __FILE__,__LINE__,1, \ &(h),"")) #define DuplicateHandle(h1,h2,h3,ph4,d1,b,d2) \ - ((BOOL)apr_dbg_log("DuplicateHandle", \ + ((BOOL)fspr_dbg_log("DuplicateHandle", \ (HANDLE)(DuplicateHandle)(h1,h2,h3,ph4,d1,b,d2), \ __FILE__,__LINE__,2, \ (ph4),((h3)==GetCurrentProcess()) \ @@ -122,91 +122,91 @@ APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, ? "Source" : "EXTERN Source")) #define GetCurrentProcess() \ - (apr_dbg_log("GetCurrentProcess", \ + (fspr_dbg_log("GetCurrentProcess", \ (GetCurrentProcess)(),__FILE__,__LINE__,0)) #define GetCurrentThread() \ - (apr_dbg_log("GetCurrentThread", \ + (fspr_dbg_log("GetCurrentThread", \ (GetCurrentThread)(),__FILE__,__LINE__,0)) -#define GetModuleHandleA(nm) apr_dbg_rv(GetModuleHandleA,(nm)) -#define GetModuleHandleW(nm) apr_dbg_rv(GetModuleHandleW,(nm)) +#define GetModuleHandleA(nm) fspr_dbg_rv(GetModuleHandleA,(nm)) +#define GetModuleHandleW(nm) fspr_dbg_rv(GetModuleHandleW,(nm)) -#define GetStdHandle(d) apr_dbg_rv(GetStdHandle,(d)) +#define GetStdHandle(d) fspr_dbg_rv(GetStdHandle,(d)) -#define LoadLibraryA(nm) apr_dbg_rv(LoadLibraryA,(nm)) -#define LoadLibraryW(nm) apr_dbg_rv(LoadLibraryW,(nm)) +#define LoadLibraryA(nm) fspr_dbg_rv(LoadLibraryA,(nm)) +#define LoadLibraryW(nm) fspr_dbg_rv(LoadLibraryW,(nm)) -#define LoadLibraryExA(nm,h,d) apr_dbg_rv(LoadLibraryExA,(nm,h,d)) -#define LoadLibraryExW(nm,h,d) apr_dbg_rv(LoadLibraryExW,(nm,h,d)) +#define LoadLibraryExA(nm,h,d) fspr_dbg_rv(LoadLibraryExA,(nm,h,d)) +#define LoadLibraryExW(nm,h,d) fspr_dbg_rv(LoadLibraryExW,(nm,h,d)) -#define OpenEventA(d,b,nm) apr_dbg_rv(OpenEventA,(d,b,nm)) -#define OpenEventW(d,b,nm) apr_dbg_rv(OpenEventW,(d,b,nm)) +#define OpenEventA(d,b,nm) fspr_dbg_rv(OpenEventA,(d,b,nm)) +#define OpenEventW(d,b,nm) fspr_dbg_rv(OpenEventW,(d,b,nm)) -#define OpenFileMappingA(d,b,nm) apr_dbg_rv(OpenFileMappingA,(d,b,nm)) -#define OpenFileMappingW(d,b,nm) apr_dbg_rv(OpenFileMappingW,(d,b,nm)) +#define OpenFileMappingA(d,b,nm) fspr_dbg_rv(OpenFileMappingA,(d,b,nm)) +#define OpenFileMappingW(d,b,nm) fspr_dbg_rv(OpenFileMappingW,(d,b,nm)) -#define RegisterEventSourceA(s1,s2) apr_dbg_rv(RegisterEventSourceA,(s1,s2)) -#define RegisterEventSourceW(s1,s2) apr_dbg_rv(RegisterEventSourceW,(s1,s2)) +#define RegisterEventSourceA(s1,s2) fspr_dbg_rv(RegisterEventSourceA,(s1,s2)) +#define RegisterEventSourceW(s1,s2) fspr_dbg_rv(RegisterEventSourceW,(s1,s2)) #define SetEvent(h) \ - ((BOOL)apr_dbg_log("SetEvent", \ + ((BOOL)fspr_dbg_log("SetEvent", \ (HANDLE)(SetEvent)(h), \ __FILE__,__LINE__,1, \ &(h),"")) #define SetStdHandle(d,h) \ - ((BOOL)apr_dbg_log("SetStdHandle", \ + ((BOOL)fspr_dbg_log("SetStdHandle", \ (HANDLE)(SetStdHandle)(d,h), \ __FILE__,__LINE__,1,&(h),"")) #define socket(i1,i2,i3) \ - ((SOCKET)apr_dbg_log("socket", \ + ((SOCKET)fspr_dbg_log("socket", \ (HANDLE)(socket)(i1,i2,i3), \ __FILE__,__LINE__,0)) #define WaitForSingleObject(h,d) \ - ((DWORD)apr_dbg_log("WaitForSingleObject", \ + ((DWORD)fspr_dbg_log("WaitForSingleObject", \ (HANDLE)(WaitForSingleObject)(h,d), \ __FILE__,__LINE__,1,&(h),"Signaled")) #define WaitForSingleObjectEx(h,d,b) \ - ((DWORD)apr_dbg_log("WaitForSingleObjectEx", \ + ((DWORD)fspr_dbg_log("WaitForSingleObjectEx", \ (HANDLE)(WaitForSingleObjectEx)(h,d,b), \ __FILE__,__LINE__,1,&(h),"Signaled")) #define WaitForMultipleObjects(d1,ah,b,d2) \ - ((DWORD)apr_dbg_log("WaitForMultipleObjects", \ + ((DWORD)fspr_dbg_log("WaitForMultipleObjects", \ (HANDLE)(WaitForMultipleObjects)(d1,ah,b,d2), \ __FILE__,__LINE__,1,ah,"Signaled")) #define WaitForMultipleObjectsEx(d1,ah,b1,d2,b2) \ - ((DWORD)apr_dbg_log("WaitForMultipleObjectsEx", \ + ((DWORD)fspr_dbg_log("WaitForMultipleObjectsEx", \ (HANDLE)(WaitForMultipleObjectsEx)(d1,ah,b1,d2,b2), \ __FILE__,__LINE__,1,ah,"Signaled")) #define WSASocketA(i1,i2,i3,pi,g,dw) \ - ((SOCKET)apr_dbg_log("WSASocketA", \ + ((SOCKET)fspr_dbg_log("WSASocketA", \ (HANDLE)(WSASocketA)(i1,i2,i3,pi,g,dw), \ __FILE__,__LINE__,0)) #define WSASocketW(i1,i2,i3,pi,g,dw) \ - ((SOCKET)apr_dbg_log("WSASocketW", \ + ((SOCKET)fspr_dbg_log("WSASocketW", \ (HANDLE)(WSASocketW)(i1,i2,i3,pi,g,dw), \ __FILE__,__LINE__,0)) #define closesocket(sh) \ - ((int)apr_dbg_log("closesocket", \ + ((int)fspr_dbg_log("closesocket", \ (HANDLE)(closesocket)(sh), \ __FILE__,__LINE__,1,&(sh),"")) #define _beginthread(fn,d,pv) \ - ((unsigned long)apr_dbg_log("_beginthread", \ + ((unsigned long)fspr_dbg_log("_beginthread", \ (HANDLE)(_beginthread)(fn,d,pv), \ __FILE__,__LINE__,0)) #define _beginthreadex(sd,d1,fn,pv,d2,pd3) \ - ((unsigned long)apr_dbg_log("_beginthreadex", \ + ((unsigned long)fspr_dbg_log("_beginthreadex", \ (HANDLE)(_beginthreadex)(sd,d1,fn,pv,d2,pd3), \ __FILE__,__LINE__,0)) diff --git a/libs/apr/include/arch/win32/apr_private.h b/libs/apr/include/arch/win32/fspr_private.h similarity index 97% rename from libs/apr/include/arch/win32/apr_private.h rename to libs/apr/include/arch/win32/fspr_private.h index 0dc5f98963..53af7067ef 100644 --- a/libs/apr/include/arch/win32/apr_private.h +++ b/libs/apr/include/arch/win32/fspr_private.h @@ -28,7 +28,7 @@ /* Include the public APR symbols, include our idea of the 'right' * subset of the Windows.h header. This saves us repetition. */ -#include "apr.h" +#include "fspr.h" /* * Add a _very_few_ declarations missing from the restricted set of headers @@ -153,7 +153,7 @@ APR_DECLARE_DATA int errno; #ifdef APR_INT64_STRFN #define APR_OFF_T_STRFN APR_INT64_STRFN #else -#define APR_OFF_T_STRFN apr_strtoi64 +#define APR_OFF_T_STRFN fspr_strtoi64 #endif #else #define APR_OFF_T_STRFN strtoi @@ -165,7 +165,7 @@ APR_DECLARE_DATA int errno; /* * Include common private declarations. */ -#include "../apr_private_common.h" +#include "../fspr_private_common.h" #endif /*APR_PRIVATE_H*/ #endif /*WIN32*/ diff --git a/libs/apr/include/apr.h.in b/libs/apr/include/fspr.h.in similarity index 92% rename from libs/apr/include/apr.h.in rename to libs/apr/include/fspr.h.in index 2a916184b7..4c0e80b400 100644 --- a/libs/apr/include/apr.h.in +++ b/libs/apr/include/fspr.h.in @@ -38,7 +38,7 @@ * @{ */ /** - * @defgroup apr_platform Platform Definitions + * @defgroup fspr_platform Platform Definitions * @{ */ @@ -152,7 +152,7 @@ extern "C" { #endif /** - * @addtogroup apr_platform + * @addtogroup fspr_platform * @ingroup APR * @{ */ @@ -254,21 +254,21 @@ extern "C" { /* Typedefs that APR needs. */ -typedef unsigned char apr_byte_t; +typedef unsigned char fspr_byte_t; -typedef @short_value@ apr_int16_t; -typedef unsigned @short_value@ apr_uint16_t; +typedef @short_value@ fspr_int16_t; +typedef unsigned @short_value@ fspr_uint16_t; -typedef @int_value@ apr_int32_t; -typedef unsigned @int_value@ apr_uint32_t; +typedef @int_value@ fspr_int32_t; +typedef unsigned @int_value@ fspr_uint32_t; -typedef @long_value@ apr_int64_t; -typedef unsigned @long_value@ apr_uint64_t; +typedef @long_value@ fspr_int64_t; +typedef unsigned @long_value@ fspr_uint64_t; -typedef @size_t_value@ apr_size_t; -typedef @ssize_t_value@ apr_ssize_t; -typedef @off_t_value@ apr_off_t; -typedef @socklen_t_value@ apr_socklen_t; +typedef @size_t_value@ fspr_size_t; +typedef @ssize_t_value@ fspr_ssize_t; +typedef @off_t_value@ fspr_off_t; +typedef @socklen_t_value@ fspr_socklen_t; #define APR_SIZEOF_VOIDP @voidp_size@ @@ -286,7 +286,7 @@ typedef @socklen_t_value@ apr_socklen_t; * so that they follow the platform's calling convention. * @example */ -/** void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data); +/** void* APR_THREAD_FUNC my_thread_entry_fn(fspr_thread_t *thd, void *data); */ #define APR_THREAD_FUNC @@ -298,7 +298,7 @@ typedef @socklen_t_value@ apr_socklen_t; * @remark Both the declaration and implementations must use the same macro. * @example */ -/** APR_DECLARE(rettype) apr_func(args) +/** APR_DECLARE(rettype) fspr_func(args) * @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA * @remark Note that when APR compiles the library itself, it passes the * symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32) @@ -319,7 +319,7 @@ typedef @socklen_t_value@ apr_socklen_t; * @remark Both the declaration and implementations must use the same macro. * @example */ -/** APR_DECLARE_NONSTD(rettype) apr_func(args, ...); +/** APR_DECLARE_NONSTD(rettype) fspr_func(args, ...); */ #define APR_DECLARE_NONSTD(type) type @@ -331,8 +331,8 @@ typedef @socklen_t_value@ apr_socklen_t; * but both must include the macro. * @example */ -/** extern APR_DECLARE_DATA type apr_variable;\n - * APR_DECLARE_DATA type apr_variable = value; +/** extern APR_DECLARE_DATA type fspr_variable;\n + * APR_DECLARE_DATA type fspr_variable = value; */ #define APR_DECLARE_DATA @@ -373,9 +373,9 @@ typedef @socklen_t_value@ apr_socklen_t; #if APR_HAVE_SYS_WAIT_H #ifdef WEXITSTATUS -#define apr_wait_t int +#define fspr_wait_t int #else -#define apr_wait_t union wait +#define fspr_wait_t union wait #define WEXITSTATUS(status) (int)((status).w_retcode) #define WTERMSIG(status) (int)((status).w_termsig) #endif /* !WEXITSTATUS */ diff --git a/libs/apr/include/apr.hnw b/libs/apr/include/fspr.hnw similarity index 91% rename from libs/apr/include/apr.hnw rename to libs/apr/include/fspr.hnw index 6f1e1559e5..774103f835 100644 --- a/libs/apr/include/apr.hnw +++ b/libs/apr/include/fspr.hnw @@ -73,7 +73,7 @@ extern "C" { #endif /** - * @defgroup apr_platform Platform Definitions + * @defgroup fspr_platform Platform Definitions * @ingroup APR * @{ */ @@ -232,28 +232,28 @@ extern "C" { /* Typedefs that APR needs. */ -typedef unsigned char apr_byte_t; +typedef unsigned char fspr_byte_t; -typedef short apr_int16_t; -typedef unsigned short apr_uint16_t; +typedef short fspr_int16_t; +typedef unsigned short fspr_uint16_t; -typedef int apr_int32_t; -typedef unsigned int apr_uint32_t; +typedef int fspr_int32_t; +typedef unsigned int fspr_uint32_t; -typedef long long apr_int64_t; -typedef unsigned long long apr_uint64_t; +typedef long long fspr_int64_t; +typedef unsigned long long fspr_uint64_t; -typedef size_t apr_size_t; -typedef ssize_t apr_ssize_t; +typedef size_t fspr_size_t; +typedef ssize_t fspr_ssize_t; #if APR_HAS_LARGE_FILES -typedef off64_t apr_off_t; +typedef off64_t fspr_off_t; #else -typedef off_t apr_off_t; +typedef off_t fspr_off_t; #endif #ifdef USE_WINSOCK -typedef int apr_socklen_t; +typedef int fspr_socklen_t; #else -typedef size_t apr_socklen_t; +typedef size_t fspr_socklen_t; #endif /* Are we big endian? */ @@ -280,7 +280,7 @@ typedef size_t apr_socklen_t; * so that they follow the platform's calling convention. * @example */ -/** void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data); +/** void* APR_THREAD_FUNC my_thread_entry_fn(fspr_thread_t *thd, void *data); */ #define APR_THREAD_FUNC @@ -292,7 +292,7 @@ typedef size_t apr_socklen_t; * @remark Both the declaration and implementations must use the same macro. * @example */ -/** APR_DECLARE(rettype) apr_func(args) +/** APR_DECLARE(rettype) fspr_func(args) * @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA * @remark Note that when APR compiles the library itself, it passes the * symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32) @@ -313,7 +313,7 @@ typedef size_t apr_socklen_t; * @remark Both the declaration and implementations must use the same macro. * @example */ -/** APR_DECLARE_NONSTD(rettype) apr_func(args, ...); +/** APR_DECLARE_NONSTD(rettype) fspr_func(args, ...); */ #define APR_DECLARE_NONSTD(type) type @@ -325,8 +325,8 @@ typedef size_t apr_socklen_t; * but both must include the macro. * @example */ -/** extern APR_DECLARE_DATA type apr_variable;\n - * APR_DECLARE_DATA type apr_variable = value; +/** extern APR_DECLARE_DATA type fspr_variable;\n + * APR_DECLARE_DATA type fspr_variable = value; */ #define APR_DECLARE_DATA @@ -345,7 +345,7 @@ typedef size_t apr_socklen_t; /* Local machine definition for console and log output. */ #define APR_EOL_STR "\r\n" -typedef int apr_wait_t; +typedef int fspr_wait_t; #define APR_PATH_MAX PATH_MAX diff --git a/libs/apr/include/apr.hw b/libs/apr/include/fspr.hw similarity index 92% rename from libs/apr/include/apr.hw rename to libs/apr/include/fspr.hw index aa47ec0374..e061ae49bf 100644 --- a/libs/apr/include/apr.hw +++ b/libs/apr/include/fspr.hw @@ -106,7 +106,7 @@ #endif /* !_WINDOWS_ */ /** - * @defgroup apr_platform Platform Definitions + * @defgroup fspr_platform Platform Definitions * @ingroup APR * @{ */ @@ -275,7 +275,7 @@ extern "C" { #endif /** - * @addtogroup apr_platform + * @addtogroup fspr_platform * @ingroup APR * @{ */ @@ -322,29 +322,29 @@ extern "C" { /* Typedefs that APR needs. */ -typedef unsigned char apr_byte_t; +typedef unsigned char fspr_byte_t; -typedef short apr_int16_t; -typedef unsigned short apr_uint16_t; +typedef short fspr_int16_t; +typedef unsigned short fspr_uint16_t; -typedef int apr_int32_t; -typedef unsigned int apr_uint32_t; +typedef int fspr_int32_t; +typedef unsigned int fspr_uint32_t; -typedef __int64 apr_int64_t; -typedef unsigned __int64 apr_uint64_t; +typedef __int64 fspr_int64_t; +typedef unsigned __int64 fspr_uint64_t; -typedef size_t apr_size_t; +typedef size_t fspr_size_t; #if APR_HAVE_STDDEF_H -typedef ptrdiff_t apr_ssize_t; +typedef ptrdiff_t fspr_ssize_t; #else -typedef int apr_ssize_t; +typedef int fspr_ssize_t; #endif #if APR_HAS_LARGE_FILES -typedef __int64 apr_off_t; +typedef __int64 fspr_off_t; #else -typedef int apr_off_t; +typedef int fspr_off_t; #endif -typedef int apr_socklen_t; +typedef int fspr_socklen_t; /* Are we big endian? */ /* XXX: Fatal assumption on Alpha platforms */ @@ -356,7 +356,7 @@ typedef int apr_socklen_t; #define APR_SIZEOF_VOIDP 4 #endif -/* XXX These simply don't belong here, perhaps in apr_portable.h +/* XXX These simply don't belong here, perhaps in fspr_portable.h * based on some APR_HAVE_PID/GID/UID? */ typedef int pid_t; @@ -378,8 +378,8 @@ typedef int gid_t; #ifndef WS2TCPIP_INLINE #define IN6_IS_ADDR_V4MAPPED(a) \ - ( (*(const apr_uint64_t *)(const void *)(&(a)->s6_addr[0]) == 0) \ - && (*(const apr_uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) + ( (*(const fspr_uint64_t *)(const void *)(&(a)->s6_addr[0]) == 0) \ + && (*(const fspr_uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) #endif #endif /* APR_HAS_IPV6 */ @@ -391,7 +391,7 @@ typedef int gid_t; * so that they follow the platform's calling convention. * @example */ -/** void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data); +/** void* APR_THREAD_FUNC my_thread_entry_fn(fspr_thread_t *thd, void *data); */ #define APR_THREAD_FUNC __stdcall @@ -406,7 +406,7 @@ typedef int gid_t; * @remark Both the declaration and implementations must use the same macro. * @example */ -/** APR_DECLARE(rettype) apr_func(args) +/** APR_DECLARE(rettype) fspr_func(args) * @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA * @remark Note that when APR compiles the library itself, it passes the * symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32) @@ -427,7 +427,7 @@ typedef int gid_t; * @remark Both the declaration and implementations must use the same macro. * @example */ -/** APR_DECLARE_NONSTD(rettype) apr_func(args, ...); +/** APR_DECLARE_NONSTD(rettype) fspr_func(args, ...); */ #define APR_DECLARE_NONSTD(type) type @@ -439,8 +439,8 @@ typedef int gid_t; * but both must include the macro. * @example */ -/** extern APR_DECLARE_DATA type apr_variable;\n - * APR_DECLARE_DATA type apr_variable = value; +/** extern APR_DECLARE_DATA type fspr_variable;\n + * APR_DECLARE_DATA type fspr_variable = value; */ #define APR_DECLARE_DATA @@ -484,12 +484,12 @@ typedef int gid_t; /* No difference between PROC and GLOBAL mutex */ #define APR_PROC_MUTEX_IS_GLOBAL 1 -typedef int apr_wait_t; +typedef int fspr_wait_t; /* struct iovec is needed to emulate Unix writev */ struct iovec { char* iov_base; - apr_size_t iov_len; + fspr_size_t iov_len; }; /* Nasty Win32 .h ommissions we really need */ diff --git a/libs/apr/include/apr_allocator.h b/libs/apr/include/fspr_allocator.h similarity index 65% rename from libs/apr/include/apr_allocator.h rename to libs/apr/include/fspr_allocator.h index 5aaeb1b2fa..17de2cb285 100644 --- a/libs/apr/include/apr_allocator.h +++ b/libs/apr/include/fspr_allocator.h @@ -18,50 +18,50 @@ #define APR_ALLOCATOR_H /** - * @file apr_allocator.h + * @file fspr_allocator.h * @brief APR Internal Memory Allocation */ -#include "apr.h" -#include "apr_errno.h" +#include "fspr.h" +#include "fspr_errno.h" #define APR_WANT_MEMFUNC /**< For no good reason? */ -#include "apr_want.h" +#include "fspr_want.h" #ifdef __cplusplus extern "C" { #endif /** - * @defgroup apr_allocator Internal Memory Allocation + * @defgroup fspr_allocator Internal Memory Allocation * @ingroup APR * @{ */ /** the allocator structure */ -typedef struct apr_allocator_t apr_allocator_t; +typedef struct fspr_allocator_t fspr_allocator_t; /** the structure which holds information about the allocation */ -typedef struct apr_memnode_t apr_memnode_t; +typedef struct fspr_memnode_t fspr_memnode_t; /** basic memory node structure * @note The next, ref and first_avail fields are available for use by the - * caller of apr_allocator_alloc(), the remaining fields are read-only. + * caller of fspr_allocator_alloc(), the remaining fields are read-only. * The next field has to be used with caution and sensibly set when the - * memnode is passed back to apr_allocator_free(). See apr_allocator_free() + * memnode is passed back to fspr_allocator_free(). See fspr_allocator_free() * for details. * The ref and first_avail fields will be properly restored by - * apr_allocator_free(). + * fspr_allocator_free(). */ -struct apr_memnode_t { - apr_memnode_t *next; /**< next memnode */ - apr_memnode_t **ref; /**< reference to self */ - apr_uint32_t index; /**< size */ - apr_uint32_t free_index; /**< how much free */ +struct fspr_memnode_t { + fspr_memnode_t *next; /**< next memnode */ + fspr_memnode_t **ref; /**< reference to self */ + fspr_uint32_t index; /**< size */ + fspr_uint32_t free_index; /**< how much free */ char *first_avail; /**< pointer to first free memory */ char *endp; /**< pointer to end of free memory */ }; /** The base size of a memory node - aligned. */ -#define APR_MEMNODE_T_SIZE APR_ALIGN_DEFAULT(sizeof(apr_memnode_t)) +#define APR_MEMNODE_T_SIZE APR_ALIGN_DEFAULT(sizeof(fspr_memnode_t)) /** Symbolic constants */ #define APR_ALLOCATOR_MAX_FREE_UNLIMITED 0 @@ -71,7 +71,7 @@ struct apr_memnode_t { * @param allocator The allocator we have just created. * */ -APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator); +APR_DECLARE(fspr_status_t) fspr_allocator_create(fspr_allocator_t **allocator); /** * Destroy an allocator @@ -79,7 +79,7 @@ APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator); * @remark Any memnodes not given back to the allocator prior to destroying * will _not_ be free()d. */ -APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator); +APR_DECLARE(void) fspr_allocator_destroy(fspr_allocator_t *allocator); /** * Allocate a block of mem from the allocator @@ -87,8 +87,8 @@ APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator); * @param size The size of the mem to allocate (excluding the * memnode structure) */ -APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator, - apr_size_t size); +APR_DECLARE(fspr_memnode_t *) fspr_allocator_alloc(fspr_allocator_t *allocator, + fspr_size_t size); /** * Free a list of blocks of mem, giving them back to the allocator. @@ -97,10 +97,10 @@ APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator, * @param allocator The allocator to give the mem back to * @param memnode The memory node to return */ -APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, - apr_memnode_t *memnode); +APR_DECLARE(void) fspr_allocator_free(fspr_allocator_t *allocator, + fspr_memnode_t *memnode); -#include "apr_pools.h" +#include "fspr_pools.h" /** * Set the owner of the allocator @@ -113,14 +113,14 @@ APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, * you can make a pool an owner, but if the pool doesn't use the allocator * the allocator will never be destroyed. */ -APR_DECLARE(void) apr_allocator_owner_set(apr_allocator_t *allocator, - apr_pool_t *pool); +APR_DECLARE(void) fspr_allocator_owner_set(fspr_allocator_t *allocator, + fspr_pool_t *pool); /** * Get the current owner of the allocator * @param allocator The allocator to get the owner from */ -APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator); +APR_DECLARE(fspr_pool_t *) fspr_allocator_owner_get(fspr_allocator_t *allocator); /** * Set the current threshold at which the allocator should start @@ -128,10 +128,10 @@ APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator); * @param allocator The allocator the set the threshold on * @param size The threshold. 0 == unlimited. */ -APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator, - apr_size_t size); +APR_DECLARE(void) fspr_allocator_max_free_set(fspr_allocator_t *allocator, + fspr_size_t size); -#include "apr_thread_mutex.h" +#include "fspr_thread_mutex.h" #if APR_HAS_THREADS /** @@ -139,15 +139,15 @@ APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator, * @param allocator The allocator to set the mutex for * @param mutex The mutex */ -APR_DECLARE(void) apr_allocator_mutex_set(apr_allocator_t *allocator, - apr_thread_mutex_t *mutex); +APR_DECLARE(void) fspr_allocator_mutex_set(fspr_allocator_t *allocator, + fspr_thread_mutex_t *mutex); /** * Get the mutex currently set for the allocator * @param allocator The allocator */ -APR_DECLARE(apr_thread_mutex_t *) apr_allocator_mutex_get( - apr_allocator_t *allocator); +APR_DECLARE(fspr_thread_mutex_t *) fspr_allocator_mutex_get( + fspr_allocator_t *allocator); #endif /* APR_HAS_THREADS */ diff --git a/libs/apr/include/apr_atomic.h b/libs/apr/include/fspr_atomic.h similarity index 64% rename from libs/apr/include/apr_atomic.h rename to libs/apr/include/fspr_atomic.h index b169ff3dc1..c06069ccc9 100644 --- a/libs/apr/include/apr_atomic.h +++ b/libs/apr/include/fspr_atomic.h @@ -18,19 +18,19 @@ #define APR_ATOMIC_H /** - * @file apr_atomic.h + * @file fspr_atomic.h * @brief APR Atomic Operations */ -#include "apr.h" -#include "apr_pools.h" +#include "fspr.h" +#include "fspr_pools.h" #ifdef __cplusplus extern "C" { #endif /** - * @defgroup apr_atomic Atomic Operations + * @defgroup fspr_atomic Atomic Operations * @ingroup APR * @{ */ @@ -41,7 +41,7 @@ extern "C" { * @param p pool * @return APR_SUCCESS on successful completion */ -APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p); +APR_DECLARE(fspr_status_t) fspr_atomic_init(fspr_pool_t *p); /* * Atomic operations on 32-bit values @@ -50,65 +50,65 @@ APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p); */ /** - * atomically read an apr_uint32_t from memory + * atomically read an fspr_uint32_t from memory * @param mem the pointer */ -APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem); +APR_DECLARE(fspr_uint32_t) fspr_atomic_read32(volatile fspr_uint32_t *mem); /** - * atomically set an apr_uint32_t in memory + * atomically set an fspr_uint32_t in memory * @param mem pointer to the object * @param val value that the object will assume */ -APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val); +APR_DECLARE(void) fspr_atomic_set32(volatile fspr_uint32_t *mem, fspr_uint32_t val); /** - * atomically add 'val' to an apr_uint32_t + * atomically add 'val' to an fspr_uint32_t * @param mem pointer to the object * @param val amount to add * @return old value pointed to by mem */ -APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val); +APR_DECLARE(fspr_uint32_t) fspr_atomic_add32(volatile fspr_uint32_t *mem, fspr_uint32_t val); /** - * atomically subtract 'val' from an apr_uint32_t + * atomically subtract 'val' from an fspr_uint32_t * @param mem pointer to the object * @param val amount to subtract */ -APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val); +APR_DECLARE(void) fspr_atomic_sub32(volatile fspr_uint32_t *mem, fspr_uint32_t val); /** - * atomically increment an apr_uint32_t by 1 + * atomically increment an fspr_uint32_t by 1 * @param mem pointer to the object * @return old value pointed to by mem */ -APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem); +APR_DECLARE(fspr_uint32_t) fspr_atomic_inc32(volatile fspr_uint32_t *mem); /** - * atomically decrement an apr_uint32_t by 1 + * atomically decrement an fspr_uint32_t by 1 * @param mem pointer to the atomic value * @return zero if the value becomes zero on decrement, otherwise non-zero */ -APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem); +APR_DECLARE(int) fspr_atomic_dec32(volatile fspr_uint32_t *mem); /** - * compare an apr_uint32_t's value with 'cmp'. + * compare an fspr_uint32_t's value with 'cmp'. * If they are the same swap the value with 'with' * @param mem pointer to the value * @param with what to swap it with * @param cmp the value to compare it to * @return the old value of *mem */ -APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, - apr_uint32_t cmp); +APR_DECLARE(fspr_uint32_t) fspr_atomic_cas32(volatile fspr_uint32_t *mem, fspr_uint32_t with, + fspr_uint32_t cmp); /** - * exchange an apr_uint32_t's value with 'val'. + * exchange an fspr_uint32_t's value with 'val'. * @param mem pointer to the value * @param val what to swap it with * @return the old value of *mem */ -APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val); +APR_DECLARE(fspr_uint32_t) fspr_atomic_xchg32(volatile fspr_uint32_t *mem, fspr_uint32_t val); /** * compare the pointer's value with cmp. @@ -118,7 +118,7 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint * @param cmp the value to compare it to * @return the old value of the pointer */ -APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp); +APR_DECLARE(void*) fspr_atomic_casptr(volatile void **mem, void *with, const void *cmp); /** @} */ diff --git a/libs/apr/include/apr_dso.h b/libs/apr/include/fspr_dso.h similarity index 74% rename from libs/apr/include/apr_dso.h rename to libs/apr/include/fspr_dso.h index ac701cfdf5..b43ad24040 100644 --- a/libs/apr/include/apr_dso.h +++ b/libs/apr/include/fspr_dso.h @@ -18,20 +18,20 @@ #define APR_DSO_DOT_H /** - * @file apr_dso.h + * @file fspr_dso.h * @brief APR Dynamic Object Handling Routines */ -#include "apr.h" -#include "apr_pools.h" -#include "apr_errno.h" +#include "fspr.h" +#include "fspr_pools.h" +#include "fspr_errno.h" #ifdef __cplusplus extern "C" { #endif /** - * @defgroup apr_dso Dynamic Object Handling + * @defgroup fspr_dso Dynamic Object Handling * @ingroup APR * @{ */ @@ -41,12 +41,12 @@ extern "C" { /** * Structure for referencing dynamic objects */ -typedef struct apr_dso_handle_t apr_dso_handle_t; +typedef struct fspr_dso_handle_t fspr_dso_handle_t; /** * Structure for referencing symbols from dynamic objects */ -typedef void * apr_dso_handle_sym_t; +typedef void * fspr_dso_handle_sym_t; /** * Load a DSO library. @@ -56,14 +56,14 @@ typedef void * apr_dso_handle_sym_t; * @bug We aught to provide an alternative to RTLD_GLOBAL, which * is the only supported method of loading DSOs today. */ -APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, - const char *path, apr_pool_t *ctx); +APR_DECLARE(fspr_status_t) fspr_dso_load(fspr_dso_handle_t **res_handle, + const char *path, fspr_pool_t *ctx); /** * Close a DSO library. * @param handle handle to close. */ -APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle); +APR_DECLARE(fspr_status_t) fspr_dso_unload(fspr_dso_handle_t *handle); /** * Load a symbol from a DSO handle. @@ -71,8 +71,8 @@ APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle); * @param handle handle to load the symbol from. * @param symname Name of the symbol to load. */ -APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, - apr_dso_handle_t *handle, +APR_DECLARE(fspr_status_t) fspr_dso_sym(fspr_dso_handle_sym_t *ressym, + fspr_dso_handle_t *handle, const char *symname); /** @@ -81,7 +81,7 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, * @param buf Location to store the dso error * @param bufsize The size of the provided buffer */ -APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buf, apr_size_t bufsize); +APR_DECLARE(const char *) fspr_dso_error(fspr_dso_handle_t *dso, char *buf, fspr_size_t bufsize); #endif /* APR_HAS_DSO */ diff --git a/libs/apr/include/apr_env.h b/libs/apr/include/fspr_env.h similarity index 77% rename from libs/apr/include/apr_env.h rename to libs/apr/include/fspr_env.h index 05419c37c1..d6f7ad6750 100644 --- a/libs/apr/include/apr_env.h +++ b/libs/apr/include/fspr_env.h @@ -17,18 +17,18 @@ #ifndef APR_ENV_H #define APR_ENV_H /** - * @file apr_env.h + * @file fspr_env.h * @brief APR Environment functions */ -#include "apr_errno.h" -#include "apr_pools.h" +#include "fspr_errno.h" +#include "fspr_pools.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** - * @defgroup apr_env Functions for manupulating the environment + * @defgroup fspr_env Functions for manupulating the environment * @ingroup APR * @{ */ @@ -39,8 +39,8 @@ extern "C" { * @param envvar the name of the environment variable * @param pool where to allocate @a value and any temporary storage from */ -APR_DECLARE(apr_status_t) apr_env_get(char **value, const char *envvar, - apr_pool_t *pool); +APR_DECLARE(fspr_status_t) fspr_env_get(char **value, const char *envvar, + fspr_pool_t *pool); /** * Set the value of an environment variable @@ -48,15 +48,15 @@ APR_DECLARE(apr_status_t) apr_env_get(char **value, const char *envvar, * @param value the value to set * @param pool where to allocate temporary storage from */ -APR_DECLARE(apr_status_t) apr_env_set(const char *envvar, const char *value, - apr_pool_t *pool); +APR_DECLARE(fspr_status_t) fspr_env_set(const char *envvar, const char *value, + fspr_pool_t *pool); /** * Delete a variable from the environment * @param envvar the name of the environment variable * @param pool where to allocate temporary storage from */ -APR_DECLARE(apr_status_t) apr_env_delete(const char *envvar, apr_pool_t *pool); +APR_DECLARE(fspr_status_t) fspr_env_delete(const char *envvar, fspr_pool_t *pool); /** @} */ diff --git a/libs/apr/include/apr_errno.h b/libs/apr/include/fspr_errno.h similarity index 95% rename from libs/apr/include/apr_errno.h rename to libs/apr/include/fspr_errno.h index c74e44df95..13441ae324 100644 --- a/libs/apr/include/apr_errno.h +++ b/libs/apr/include/fspr_errno.h @@ -18,11 +18,11 @@ #define APR_ERRNO_H /** - * @file apr_errno.h + * @file fspr_errno.h * @brief APR Error Codes */ -#include "apr.h" +#include "fspr.h" #if APR_HAVE_ERRNO_H #include @@ -33,7 +33,7 @@ extern "C" { #endif /* __cplusplus */ /** - * @defgroup apr_errno Error Codes + * @defgroup fspr_errno Error Codes * @ingroup APR * @{ */ @@ -41,7 +41,7 @@ extern "C" { /** * Type for specifying an error or status code. */ -typedef int apr_status_t; +typedef int fspr_status_t; /** * Return a human readable string describing the specified error. @@ -49,14 +49,14 @@ typedef int apr_status_t; * @param buf A buffer to hold the error string. * @param bufsize Size of the buffer to hold the string. */ -APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, - apr_size_t bufsize); +APR_DECLARE(char *) fspr_strerror(fspr_status_t statcode, char *buf, + fspr_size_t bufsize); #if defined(DOXYGEN) /** * @def APR_FROM_OS_ERROR(os_err_type syserr) - * Fold a platform specific error into an apr_status_t code. - * @return apr_status_t + * Fold a platform specific error into an fspr_status_t code. + * @return fspr_status_t * @param e The platform os error code. * @warning macro implementation; the syserr argument may be evaluated * multiple times. @@ -64,46 +64,46 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR) /** - * @def APR_TO_OS_ERROR(apr_status_t statcode) + * @def APR_TO_OS_ERROR(fspr_status_t statcode) * @return os_err_type - * Fold an apr_status_t code back to the native platform defined error. - * @param e The apr_status_t folded platform os error code. + * Fold an fspr_status_t code back to the native platform defined error. + * @param e The fspr_status_t folded platform os error code. * @warning macro implementation; the statcode argument may be evaluated - * multiple times. If the statcode was not created by apr_get_os_error + * multiple times. If the statcode was not created by fspr_get_os_error * or APR_FROM_OS_ERROR, the results are undefined. */ #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR) -/** @def apr_get_os_error() - * @return apr_status_t the last platform error, folded into apr_status_t, on most platforms +/** @def fspr_get_os_error() + * @return fspr_status_t the last platform error, folded into fspr_status_t, on most platforms * @remark This retrieves errno, or calls a GetLastError() style function, and * folds it with APR_FROM_OS_ERROR. Some platforms (such as OS2) have no * such mechanism, so this call may be unsupported. Do NOT use this * call for socket errors from socket, send, recv etc! */ -/** @def apr_set_os_error(e) - * Reset the last platform error, unfolded from an apr_status_t, on some platforms +/** @def fspr_set_os_error(e) + * Reset the last platform error, unfolded from an fspr_status_t, on some platforms * @param e The OS error folded in a prior call to APR_FROM_OS_ERROR() * @warning This is a macro implementation; the statcode argument may be evaluated - * multiple times. If the statcode was not created by apr_get_os_error + * multiple times. If the statcode was not created by fspr_get_os_error * or APR_FROM_OS_ERROR, the results are undefined. This macro sets * errno, or calls a SetLastError() style function, unfolding statcode * with APR_TO_OS_ERROR. Some platforms (such as OS2) have no such * mechanism, so this call may be unsupported. */ -/** @def apr_get_netos_error() - * Return the last socket error, folded into apr_status_t, on all platforms +/** @def fspr_get_netos_error() + * Return the last socket error, folded into fspr_status_t, on all platforms * @remark This retrieves errno or calls a GetLastSocketError() style function, * and folds it with APR_FROM_OS_ERROR. */ -/** @def apr_set_netos_error(e) - * Reset the last socket error, unfolded from an apr_status_t +/** @def fspr_set_netos_error(e) + * Reset the last socket error, unfolded from an fspr_status_t * @param e The socket error folded in a prior call to APR_FROM_OS_ERROR() * @warning This is a macro implementation; the statcode argument may be evaluated - * multiple times. If the statcode was not created by apr_get_os_error + * multiple times. If the statcode was not created by fspr_get_os_error * or APR_FROM_OS_ERROR, the results are undefined. This macro sets * errno, or calls a WSASetLastError() style function, unfolding * socketcode with APR_TO_OS_ERROR. @@ -146,12 +146,12 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, + (APR_OS_ERRSPACE_SIZE * 10)) /** * APR_OS_START_EAIERR folds EAI_ error codes from getaddrinfo() into - * apr_status_t values. + * fspr_status_t values. */ #define APR_OS_START_EAIERR (APR_OS_START_CANONERR + APR_OS_ERRSPACE_SIZE) /** * APR_OS_START_SYSERR folds platform-specific system error values into - * apr_status_t values. + * fspr_status_t values. */ #define APR_OS_START_SYSERR (APR_OS_START_EAIERR + APR_OS_ERRSPACE_SIZE) @@ -176,7 +176,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, * 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 apr_dso_error(). + * information call fspr_dso_error(). * APR_EGENERAL General failure (specific information not available) * APR_EBADIP The specified IP address is invalid * APR_EBADMASK The specified netmask is invalid @@ -327,7 +327,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, /* empty slot: +18 */ /** * APR was unable to open the dso object. - * For more information call apr_dso_error(). + * For more information call fspr_dso_error(). */ #if defined(WIN32) #define APR_STATUS_IS_EDSOOPEN(s) ((s) == APR_EDSOOPEN \ @@ -348,7 +348,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, /** The given path contained wildcards. */ #define APR_STATUS_IS_EPATHWILD(s) ((s) == APR_EPATHWILD) /** Could not find the requested symbol. - * For more information call apr_dso_error(). + * For more information call fspr_dso_error(). */ #if defined(WIN32) #define APR_STATUS_IS_ESYMNOTFOUND(s) ((s) == APR_ESYMNOTFOUND \ @@ -775,14 +775,14 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, * The API calls always return a result codes which * should be filtered through APR_FROM_OS_ERROR(). * - * #define apr_get_os_error() (APR_FROM_OS_ERROR(GetLastError())) - * #define apr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e))) + * #define fspr_get_os_error() (APR_FROM_OS_ERROR(GetLastError())) + * #define fspr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e))) */ /* A special case, only socket calls require this; */ -#define apr_get_netos_error() (APR_FROM_OS_ERROR(errno)) -#define apr_set_netos_error(e) (errno = APR_TO_OS_ERROR(e)) +#define fspr_get_netos_error() (APR_FROM_OS_ERROR(errno)) +#define fspr_set_netos_error(e) (errno = APR_TO_OS_ERROR(e)) /* And this needs to be greped away for good: */ @@ -938,13 +938,13 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR) #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR) -#define apr_get_os_error() (APR_FROM_OS_ERROR(GetLastError())) -#define apr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e))) +#define fspr_get_os_error() (APR_FROM_OS_ERROR(GetLastError())) +#define fspr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e))) /* A special case, only socket calls require this: */ -#define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError())) -#define apr_set_netos_error(e) (WSASetLastError(APR_TO_OS_ERROR(e))) +#define fspr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError())) +#define fspr_set_netos_error(e) (WSASetLastError(APR_TO_OS_ERROR(e))) /* APR CANONICAL ERROR TESTS */ #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \ @@ -1051,12 +1051,12 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR) #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR) -#define apr_get_os_error() (errno) -#define apr_set_os_error(e) (errno = (e)) +#define fspr_get_os_error() (errno) +#define fspr_set_os_error(e) (errno = (e)) /* A special case, only socket calls require this: */ -#define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError())) -#define apr_set_netos_error(e) (WSASetLastError(APR_TO_OS_ERROR(e))) +#define fspr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError())) +#define fspr_set_netos_error(e) (WSASetLastError(APR_TO_OS_ERROR(e))) /* APR CANONICAL ERROR TESTS */ #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES) @@ -1113,13 +1113,13 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, #define APR_FROM_OS_ERROR(e) (e) #define APR_TO_OS_ERROR(e) (e) -#define apr_get_os_error() (errno) -#define apr_set_os_error(e) (errno = (e)) +#define fspr_get_os_error() (errno) +#define fspr_set_os_error(e) (errno = (e)) /* A special case, only socket calls require this: */ -#define apr_get_netos_error() (errno) -#define apr_set_netos_error(e) (errno = (e)) +#define fspr_get_netos_error() (errno) +#define fspr_set_netos_error(e) (errno = (e)) /** * @addtogroup APR_STATUS_IS diff --git a/libs/apr/include/apr_file_info.h b/libs/apr/include/fspr_file_info.h similarity index 78% rename from libs/apr/include/apr_file_info.h rename to libs/apr/include/fspr_file_info.h index 94146f0ae3..44a75ee348 100644 --- a/libs/apr/include/apr_file_info.h +++ b/libs/apr/include/fspr_file_info.h @@ -18,16 +18,16 @@ #define APR_FILE_INFO_H /** - * @file apr_file_info.h + * @file fspr_file_info.h * @brief APR File Information */ -#include "apr.h" -#include "apr_user.h" -#include "apr_pools.h" -#include "apr_tables.h" -#include "apr_time.h" -#include "apr_errno.h" +#include "fspr.h" +#include "fspr_user.h" +#include "fspr_pools.h" +#include "fspr_tables.h" +#include "fspr_time.h" +#include "fspr_errno.h" #if APR_HAVE_SYS_UIO_H #include @@ -38,7 +38,7 @@ extern "C" { #endif /* __cplusplus */ /** - * @defgroup apr_file_info File Information + * @defgroup fspr_file_info File Information * @ingroup APR * @{ */ @@ -48,8 +48,8 @@ extern "C" { * so the APR_NOFILE value must be distinct from APR_UNKFILE. */ -/** apr_filetype_e values for the filetype member of the - * apr_file_info_t structure +/** fspr_filetype_e values for the filetype member of the + * fspr_file_info_t structure * @warning: Not all of the filetypes below can be determined. * For example, a given platform might not correctly report * a socket descriptor as APR_SOCK if that type isn't @@ -69,10 +69,10 @@ typedef enum { APR_LNK, /**< a symbolic link */ APR_SOCK, /**< a [unix domain] socket */ APR_UNKFILE = 127 /**< a file of some other unknown type */ -} apr_filetype_e; +} fspr_filetype_e; /** - * @defgroup apr_file_permissions File Permissions flags + * @defgroup fspr_file_permissions File Permissions flags * @{ */ @@ -93,7 +93,7 @@ typedef enum { #define APR_FPROT_OS_DEFAULT 0x0FFF /**< use OS's default permissions */ -/* additional permission flags for apr_file_copy and apr_file_append */ +/* additional permission flags for fspr_file_copy and fspr_file_append */ #define APR_FPROT_FILE_SOURCE_PERMS 0x1000 /**< Copy source file's permissions */ /* backcompat */ @@ -118,35 +118,35 @@ typedef enum { /** * Structure for referencing directories. */ -typedef struct apr_dir_t apr_dir_t; +typedef struct fspr_dir_t fspr_dir_t; /** * Structure for determining file permissions. */ -typedef apr_int32_t apr_fileperms_t; +typedef fspr_int32_t fspr_fileperms_t; #if (defined WIN32) || (defined NETWARE) /** * Structure for determining the inode of the file. */ -typedef apr_uint64_t apr_ino_t; +typedef fspr_uint64_t fspr_ino_t; /** * Structure for determining the device the file is on. */ -typedef apr_uint32_t apr_dev_t; +typedef fspr_uint32_t fspr_dev_t; #else /** The inode of the file. */ -typedef ino_t apr_ino_t; +typedef ino_t fspr_ino_t; /** * Structure for determining the device the file is on. */ -typedef dev_t apr_dev_t; +typedef dev_t fspr_dev_t; #endif /** - * @defgroup apr_file_stat Stat Functions + * @defgroup fspr_file_stat Stat Functions * @{ */ /** file info structure */ -typedef struct apr_finfo_t apr_finfo_t; +typedef struct fspr_finfo_t fspr_finfo_t; #define APR_FINFO_LINK 0x00000001 /**< Stat the link not the file itself if it is a link */ #define APR_FINFO_MTIME 0x00000010 /**< Modification Time */ @@ -170,52 +170,52 @@ typedef struct apr_finfo_t apr_finfo_t; #define APR_FINFO_IDENT 0x00003000 /**< dev and inode */ #define APR_FINFO_OWNER 0x00030000 /**< user and group */ #define APR_FINFO_PROT 0x00700000 /**< all protections */ -#define APR_FINFO_NORM 0x0073b170 /**< an atomic unix apr_stat() */ -#define APR_FINFO_DIRENT 0x02000000 /**< an atomic unix apr_dir_read() */ +#define APR_FINFO_NORM 0x0073b170 /**< an atomic unix fspr_stat() */ +#define APR_FINFO_DIRENT 0x02000000 /**< an atomic unix fspr_dir_read() */ /** * The file information structure. This is analogous to the POSIX * stat structure. */ -struct apr_finfo_t { +struct fspr_finfo_t { /** Allocates memory and closes lingering handles in the specified pool */ - apr_pool_t *pool; - /** The bitmask describing valid fields of this apr_finfo_t structure + fspr_pool_t *pool; + /** The bitmask describing valid fields of this fspr_finfo_t structure * including all available 'wanted' fields and potentially more */ - apr_int32_t valid; + fspr_int32_t valid; /** The access permissions of the file. Mimics Unix access rights. */ - apr_fileperms_t protection; + fspr_fileperms_t protection; /** The type of file. One of APR_REG, APR_DIR, APR_CHR, APR_BLK, APR_PIPE, * APR_LNK or APR_SOCK. If the type is undetermined, the value is APR_NOFILE. * If the type cannot be determined, the value is APR_UNKFILE. */ - apr_filetype_e filetype; + fspr_filetype_e filetype; /** The user id that owns the file */ - apr_uid_t user; + fspr_uid_t user; /** The group id that owns the file */ - apr_gid_t group; + fspr_gid_t group; /** The inode of the file. */ - apr_ino_t inode; + fspr_ino_t inode; /** The id of the device the file is on. */ - apr_dev_t device; + fspr_dev_t device; /** The number of hard links to the file. */ - apr_int32_t nlink; + fspr_int32_t nlink; /** The size of the file */ - apr_off_t size; + fspr_off_t size; /** The storage size consumed by the file */ - apr_off_t csize; + fspr_off_t csize; /** The time the file was last accessed */ - apr_time_t atime; + fspr_time_t atime; /** The time the file was last modified */ - apr_time_t mtime; + fspr_time_t mtime; /** The time the file was created, or the inode was last changed */ - apr_time_t ctime; + fspr_time_t ctime; /** The pathname of the file (possibly unrooted) */ const char *fname; /** The file's name (no path) in filesystem case */ const char *name; - /** The file's handle, if accessed (can be submitted to apr_duphandle) */ - struct apr_file_t *filehand; + /** The file's handle, if accessed (can be submitted to fspr_duphandle) */ + struct fspr_file_t *filehand; }; /** @@ -224,7 +224,7 @@ struct apr_finfo_t { * @param finfo Where to store the information about the file, which is * never touched if the call fails. * @param fname The name of the file to stat. - * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ + * @param wanted The desired fspr_finfo_t fields, as a bit flag of APR_FINFO_ values * @param pool the pool to use to allocate the new file. * @@ -232,12 +232,12 @@ struct apr_finfo_t { * not be filled in, and you need to check the @c finfo->valid bitmask * to verify that what you're looking for is there. */ -APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, - apr_int32_t wanted, apr_pool_t *pool); +APR_DECLARE(fspr_status_t) fspr_stat(fspr_finfo_t *finfo, const char *fname, + fspr_int32_t wanted, fspr_pool_t *pool); /** @} */ /** - * @defgroup apr_dir Directory Manipulation Functions + * @defgroup fspr_dir Directory Manipulation Functions * @{ */ @@ -247,58 +247,58 @@ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, * @param dirname The full path to the directory (use / on all systems) * @param pool The pool to use. */ -APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new_dir, +APR_DECLARE(fspr_status_t) fspr_dir_open(fspr_dir_t **new_dir, const char *dirname, - apr_pool_t *pool); + fspr_pool_t *pool); /** * close the specified directory. * @param thedir the directory descriptor to close. */ -APR_DECLARE(apr_status_t) apr_dir_close(apr_dir_t *thedir); +APR_DECLARE(fspr_status_t) fspr_dir_close(fspr_dir_t *thedir); /** * Read the next entry from the specified directory. - * @param finfo the file info structure and filled in by apr_dir_read - * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ + * @param finfo the file info structure and filled in by fspr_dir_read + * @param wanted The desired fspr_finfo_t fields, as a bit flag of APR_FINFO_ values - * @param thedir the directory descriptor returned from apr_dir_open + * @param thedir the directory descriptor returned from fspr_dir_open * @remark No ordering is guaranteed for the entries read. * * @note If @c APR_INCOMPLETE is returned all the fields in @a finfo may * not be filled in, and you need to check the @c finfo->valid bitmask * to verify that what you're looking for is there. */ -APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, - apr_dir_t *thedir); +APR_DECLARE(fspr_status_t) fspr_dir_read(fspr_finfo_t *finfo, fspr_int32_t wanted, + fspr_dir_t *thedir); /** * Rewind the directory to the first entry. * @param thedir the directory descriptor to rewind. */ -APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir); +APR_DECLARE(fspr_status_t) fspr_dir_rewind(fspr_dir_t *thedir); /** @} */ /** - * @defgroup apr_filepath Filepath Manipulation Functions + * @defgroup fspr_filepath Filepath Manipulation Functions * @{ */ -/** Cause apr_filepath_merge to fail if addpath is above rootpath */ +/** Cause fspr_filepath_merge to fail if addpath is above rootpath */ #define APR_FILEPATH_NOTABOVEROOT 0x01 /** internal: Only meaningful with APR_FILEPATH_NOTABOVEROOT */ #define APR_FILEPATH_SECUREROOTTEST 0x02 -/** Cause apr_filepath_merge to fail if addpath is above rootpath, +/** Cause fspr_filepath_merge to fail if addpath is above rootpath, * even given a rootpath /foo/bar and an addpath ../bar/bash */ #define APR_FILEPATH_SECUREROOT 0x03 -/** Fail apr_filepath_merge if the merged path is relative */ +/** Fail fspr_filepath_merge if the merged path is relative */ #define APR_FILEPATH_NOTRELATIVE 0x04 -/** Fail apr_filepath_merge if the merged path is absolute */ +/** Fail fspr_filepath_merge if the merged path is absolute */ #define APR_FILEPATH_NOTABSOLUTE 0x08 /** Return the file system's native path format (e.g. path delimiters @@ -334,10 +334,10 @@ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir); * the drive letter), or APR_EBADPATH if the root is simply invalid. * APR_SUCCESS is returned if filepath is an absolute path. */ -APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, +APR_DECLARE(fspr_status_t) fspr_filepath_root(const char **rootpath, const char **filepath, - apr_int32_t flags, - apr_pool_t *p); + fspr_int32_t flags, + fspr_pool_t *p); /** * Merge additional file path onto the previously processed rootpath @@ -352,11 +352,11 @@ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, * result code will be APR_EPATHWILD, and all further segments will not * reflect the true filenames including the wildcard and following segments. */ -APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, +APR_DECLARE(fspr_status_t) fspr_filepath_merge(char **newpath, const char *rootpath, const char *addpath, - apr_int32_t flags, - apr_pool_t *p); + fspr_int32_t flags, + fspr_pool_t *p); /** * Split a search path into separate components @@ -367,9 +367,9 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, * @remark the path separator in @a liststr is system specific; * e.g., ':' on Unix, ';' on Windows, etc. */ -APR_DECLARE(apr_status_t) apr_filepath_list_split(apr_array_header_t **pathelts, +APR_DECLARE(fspr_status_t) fspr_filepath_list_split(fspr_array_header_t **pathelts, const char *liststr, - apr_pool_t *p); + fspr_pool_t *p); /** * Merge a list of search path components into a single search path @@ -380,9 +380,9 @@ APR_DECLARE(apr_status_t) apr_filepath_list_split(apr_array_header_t **pathelts, * @remark the path separator in @a liststr is system specific; * e.g., ':' on Unix, ';' on Windows, etc. */ -APR_DECLARE(apr_status_t) apr_filepath_list_merge(char **liststr, - apr_array_header_t *pathelts, - apr_pool_t *p); +APR_DECLARE(fspr_status_t) fspr_filepath_list_merge(char **liststr, + fspr_array_header_t *pathelts, + fspr_pool_t *p); /** * Return the default file path (for relative file names) @@ -391,15 +391,15 @@ APR_DECLARE(apr_status_t) apr_filepath_list_merge(char **liststr, * default file path in os-native format. * @param p the pool to allocate the default path string from */ -APR_DECLARE(apr_status_t) apr_filepath_get(char **path, apr_int32_t flags, - apr_pool_t *p); +APR_DECLARE(fspr_status_t) fspr_filepath_get(char **path, fspr_int32_t flags, + fspr_pool_t *p); /** * Set the default file path (for relative file names) * @param path the default path returned * @param p the pool to allocate any working storage */ -APR_DECLARE(apr_status_t) apr_filepath_set(const char *path, apr_pool_t *p); +APR_DECLARE(fspr_status_t) fspr_filepath_set(const char *path, fspr_pool_t *p); /** The FilePath character encoding is unknown */ #define APR_FILEPATH_ENCODING_UNKNOWN 0 @@ -414,10 +414,10 @@ APR_DECLARE(apr_status_t) apr_filepath_set(const char *path, apr_pool_t *p); * Determine the encoding used internally by the FilePath functions * @param style points to a variable which receives the encoding style flag * @param p the pool to allocate any working storage - * @remark Use @c apr_os_locale_encoding and/or @c apr_os_default_encoding + * @remark Use @c fspr_os_locale_encoding and/or @c fspr_os_default_encoding * to get the name of the path encoding if it's not UTF-8. */ -APR_DECLARE(apr_status_t) apr_filepath_encoding(int *style, apr_pool_t *p); +APR_DECLARE(fspr_status_t) fspr_filepath_encoding(int *style, fspr_pool_t *p); /** @} */ /** @} */ diff --git a/libs/apr/include/apr_file_io.h b/libs/apr/include/fspr_file_io.h similarity index 72% rename from libs/apr/include/apr_file_io.h rename to libs/apr/include/fspr_file_io.h index b8146eea65..d19901e2b8 100644 --- a/libs/apr/include/apr_file_io.h +++ b/libs/apr/include/fspr_file_io.h @@ -18,33 +18,33 @@ #define APR_FILE_IO_H /** - * @file apr_file_io.h + * @file fspr_file_io.h * @brief APR File I/O Handling */ -#include "apr.h" -#include "apr_pools.h" -#include "apr_time.h" -#include "apr_errno.h" -#include "apr_file_info.h" -#include "apr_inherit.h" +#include "fspr.h" +#include "fspr_pools.h" +#include "fspr_time.h" +#include "fspr_errno.h" +#include "fspr_file_info.h" +#include "fspr_inherit.h" #define APR_WANT_STDIO /**< for SEEK_* */ -#define APR_WANT_IOVEC /**< for apr_file_writev */ -#include "apr_want.h" +#define APR_WANT_IOVEC /**< for fspr_file_writev */ +#include "fspr_want.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** - * @defgroup apr_file_io File I/O Handling Functions + * @defgroup fspr_file_io File I/O Handling Functions * @ingroup APR * @{ */ /** - * @defgroup apr_file_open_flags File Open Flags/Routines + * @defgroup fspr_file_open_flags File Open Flags/Routines * @{ */ @@ -73,7 +73,7 @@ extern "C" { when the file is opened */ #define APR_FOPEN_SENDFILE_ENABLED 0x01000 /**< Advisory flag that this file should support - apr_socket_sendfile operation */ + fspr_socket_sendfile operation */ #define APR_FOPEN_LARGEFILE 0x04000 /**< Platform dependent flag to enable large file support; WARNING see below. */ @@ -94,12 +94,12 @@ extern "C" { #define APR_LARGEFILE APR_FOPEN_LARGEFILE /**< @deprecated @see APR_FOPEN_LARGEFILE */ /** @warning The APR_LARGEFILE flag only has effect on some platforms - * where sizeof(apr_off_t) == 4. Where implemented, it allows opening + * where sizeof(fspr_off_t) == 4. Where implemented, it allows opening * and writing to a file which exceeds the size which can be - * represented by apr_off_t (2 gigabytes). When a file's size does - * exceed 2Gb, apr_file_info_get() will fail with an error on the - * descriptor, likewise apr_stat()/apr_lstat() will fail on the - * filename. apr_dir_read() will fail with APR_INCOMPLETE on a + * represented by fspr_off_t (2 gigabytes). When a file's size does + * exceed 2Gb, fspr_file_info_get() will fail with an error on the + * descriptor, likewise fspr_stat()/fspr_lstat() will fail on the + * filename. fspr_dir_read() will fail with APR_INCOMPLETE on a * directory entry for a large file depending on the particular * APR_FINFO_* flags. Generally, it is not recommended to use this * flag. */ @@ -107,11 +107,11 @@ extern "C" { /** @} */ /** - * @defgroup apr_file_seek_flags File Seek Flags + * @defgroup fspr_file_seek_flags File Seek Flags * @{ */ -/* flags for apr_file_seek */ +/* flags for fspr_file_seek */ /** Set the file position */ #define APR_SET SEEK_SET /** Current */ @@ -121,18 +121,18 @@ extern "C" { /** @} */ /** - * @defgroup apr_file_attrs_set_flags File Attribute Flags + * @defgroup fspr_file_attrs_set_flags File Attribute Flags * @{ */ -/* flags for apr_file_attrs_set */ +/* flags for fspr_file_attrs_set */ #define APR_FILE_ATTR_READONLY 0x01 /**< File is read-only */ #define APR_FILE_ATTR_EXECUTABLE 0x02 /**< File is executable */ #define APR_FILE_ATTR_HIDDEN 0x04 /**< File is hidden */ /** @} */ /** - * @defgroup apr_file_writev{_full} max iovec size + * @defgroup fspr_file_writev{_full} max iovec size * @{ */ #if defined(DOXYGEN) @@ -148,19 +148,19 @@ extern "C" { /** @} */ /** File attributes */ -typedef apr_uint32_t apr_fileattrs_t; +typedef fspr_uint32_t fspr_fileattrs_t; -/** Type to pass as whence argument to apr_file_seek. */ -typedef int apr_seek_where_t; +/** Type to pass as whence argument to fspr_file_seek. */ +typedef int fspr_seek_where_t; /** * Structure for referencing files. */ -typedef struct apr_file_t apr_file_t; +typedef struct fspr_file_t fspr_file_t; /* File lock types/flags */ /** - * @defgroup apr_file_lock_types File Lock Types + * @defgroup fspr_file_lock_types File Lock Types * @{ */ @@ -203,29 +203,29 @@ typedef struct apr_file_t apr_file_t; * writes across process/machines * APR_FILE_NOCLEANUP Do not register a cleanup with the pool * passed in on the pool argument (see below). - * The apr_os_file_t handle in apr_file_t will not + * The fspr_os_file_t handle in fspr_file_t will not * be closed when the pool is destroyed. * APR_SENDFILE_ENABLED Open with appropriate platform semantics * for sendfile operations. Advisory only, - * apr_socket_sendfile does not check this flag. + * fspr_socket_sendfile does not check this flag. * * @param perm Access permissions for file. * @param pool The pool to use. * @remark If perm is APR_OS_DEFAULT and the file is being created, * appropriate default permissions will be used. * @remark By default, the returned file descriptor will not be - * inherited by child processes created by apr_proc_create(). This - * can be changed using apr_file_inherit_set(). + * inherited by child processes created by fspr_proc_create(). This + * can be changed using fspr_file_inherit_set(). */ -APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **newf, const char *fname, - apr_int32_t flag, apr_fileperms_t perm, - apr_pool_t *pool); +APR_DECLARE(fspr_status_t) fspr_file_open(fspr_file_t **newf, const char *fname, + fspr_int32_t flag, fspr_fileperms_t perm, + fspr_pool_t *pool); /** * Close the specified file. * @param file The file descriptor to close. */ -APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file); +APR_DECLARE(fspr_status_t) fspr_file_close(fspr_file_t *file); /** * Delete the specified file. @@ -234,7 +234,7 @@ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file); * @remark If the file is open, it won't be removed until all * instances are closed. */ -APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *pool); +APR_DECLARE(fspr_status_t) fspr_file_remove(const char *path, fspr_pool_t *pool); /** * Rename the specified file. @@ -245,9 +245,9 @@ APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *pool); * overwritten. Moving files or directories across devices may not be * possible. */ -APR_DECLARE(apr_status_t) apr_file_rename(const char *from_path, +APR_DECLARE(fspr_status_t) fspr_file_rename(const char *from_path, const char *to_path, - apr_pool_t *pool); + fspr_pool_t *pool); /** * Copy the specified file to another file. @@ -261,10 +261,10 @@ APR_DECLARE(apr_status_t) apr_file_rename(const char *from_path, * @remark The new file does not need to exist, it will be created if required. * @warning If the new file already exists, its contents will be overwritten. */ -APR_DECLARE(apr_status_t) apr_file_copy(const char *from_path, +APR_DECLARE(fspr_status_t) fspr_file_copy(const char *from_path, const char *to_path, - apr_fileperms_t perms, - apr_pool_t *pool); + fspr_fileperms_t perms, + fspr_pool_t *pool); /** * Append the specified file to another file. @@ -277,55 +277,55 @@ APR_DECLARE(apr_status_t) apr_file_copy(const char *from_path, * @param pool The pool to use. * @remark The new file does not need to exist, it will be created if required. */ -APR_DECLARE(apr_status_t) apr_file_append(const char *from_path, +APR_DECLARE(fspr_status_t) fspr_file_append(const char *from_path, const char *to_path, - apr_fileperms_t perms, - apr_pool_t *pool); + fspr_fileperms_t perms, + fspr_pool_t *pool); /** * Are we at the end of the file * @param fptr The apr file we are testing. * @remark Returns APR_EOF if we are at the end of file, APR_SUCCESS otherwise. */ -APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr); +APR_DECLARE(fspr_status_t) fspr_file_eof(fspr_file_t *fptr); /** * Open standard error as an apr file pointer. * @param thefile The apr file to use as stderr. * @param pool The pool to allocate the file out of. * - * @remark The only reason that the apr_file_open_std* functions exist + * @remark The only reason that the fspr_file_open_std* functions exist * is that you may not always have a stderr/out/in on Windows. This * is generally a problem with newer versions of Windows and services. * * @remark The other problem is that the C library functions generally work - * differently on Windows and Unix. So, by using apr_file_open_std* + * differently on Windows and Unix. So, by using fspr_file_open_std* * functions, you can get a handle to an APR struct that works with * the APR functions which are supposed to work identically on all * platforms. */ -APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, - apr_pool_t *pool); +APR_DECLARE(fspr_status_t) fspr_file_open_stderr(fspr_file_t **thefile, + fspr_pool_t *pool); /** * open standard output as an apr file pointer. * @param thefile The apr file to use as stdout. * @param pool The pool to allocate the file out of. * - * @remark See remarks for apr_file_open_stdout. + * @remark See remarks for fspr_file_open_stdout. */ -APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, - apr_pool_t *pool); +APR_DECLARE(fspr_status_t) fspr_file_open_stdout(fspr_file_t **thefile, + fspr_pool_t *pool); /** * open standard input as an apr file pointer. * @param thefile The apr file to use as stdin. * @param pool The pool to allocate the file out of. * - * @remark See remarks for apr_file_open_stdout. + * @remark See remarks for fspr_file_open_stdout. */ -APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, - apr_pool_t *pool); +APR_DECLARE(fspr_status_t) fspr_file_open_stdin(fspr_file_t **thefile, + fspr_pool_t *pool); /** * Read data from the specified file. @@ -334,7 +334,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, * @param nbytes On entry, the number of bytes to read; on exit, the number * of bytes read. * - * @remark apr_file_read will read up to the specified number of + * @remark fspr_file_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 @@ -344,8 +344,8 @@ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, * @remark It is not possible for both bytes to be read and an APR_EOF * or other error to be returned. APR_EINTR is never returned. */ -APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, - apr_size_t *nbytes); +APR_DECLARE(fspr_status_t) fspr_file_read(fspr_file_t *thefile, void *buf, + fspr_size_t *nbytes); /** * Write data to the specified file. @@ -354,7 +354,7 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, * @param nbytes On entry, the number of bytes to write; on exit, the number * of bytes written. * - * @remark apr_file_write will write up to the specified number of + * @remark fspr_file_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. @@ -362,8 +362,8 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, * @remark It is possible for both bytes to be written and an error to * be returned. APR_EINTR is never returned. */ -APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, - apr_size_t *nbytes); +APR_DECLARE(fspr_status_t) fspr_file_write(fspr_file_t *thefile, const void *buf, + fspr_size_t *nbytes); /** * Write data from iovec array to the specified file. @@ -377,12 +377,12 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, * @remark It is possible for both bytes to be written and an error to * be returned. APR_EINTR is never returned. * - * @remark apr_file_writev is available even if the underlying + * @remark fspr_file_writev is available even if the underlying * operating system doesn't provide writev(). */ -APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, +APR_DECLARE(fspr_status_t) fspr_file_writev(fspr_file_t *thefile, const struct iovec *vec, - apr_size_t nvec, apr_size_t *nbytes); + fspr_size_t nvec, fspr_size_t *nbytes); /** * Read data from the specified file, ensuring that the buffer is filled @@ -392,7 +392,7 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, * @param nbytes The number of bytes to read. * @param bytes_read If non-NULL, this will contain the number of bytes read. * - * @remark apr_file_read will read up to the specified number of + * @remark fspr_file_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 @@ -404,9 +404,9 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, * * @remark APR_EINTR is never returned. */ -APR_DECLARE(apr_status_t) apr_file_read_full(apr_file_t *thefile, void *buf, - apr_size_t nbytes, - apr_size_t *bytes_read); +APR_DECLARE(fspr_status_t) fspr_file_read_full(fspr_file_t *thefile, void *buf, + fspr_size_t nbytes, + fspr_size_t *bytes_read); /** * Write data to the specified file, ensuring that all of the data is @@ -416,7 +416,7 @@ APR_DECLARE(apr_status_t) apr_file_read_full(apr_file_t *thefile, void *buf, * @param nbytes The number of bytes to write. * @param bytes_written If non-NULL, set to the number of bytes written. * - * @remark apr_file_write will write up to the specified number of + * @remark fspr_file_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 @@ -428,10 +428,10 @@ APR_DECLARE(apr_status_t) apr_file_read_full(apr_file_t *thefile, void *buf, * * @remark APR_EINTR is never returned. */ -APR_DECLARE(apr_status_t) apr_file_write_full(apr_file_t *thefile, +APR_DECLARE(fspr_status_t) fspr_file_write_full(fspr_file_t *thefile, const void *buf, - apr_size_t nbytes, - apr_size_t *bytes_written); + fspr_size_t nbytes, + fspr_size_t *bytes_written); /** @@ -444,33 +444,33 @@ APR_DECLARE(apr_status_t) apr_file_write_full(apr_file_t *thefile, * will fail with APR_EINVAL. * @param nbytes The number of bytes written. * - * @remark apr_file_writev_full is available even if the underlying + * @remark fspr_file_writev_full is available even if the underlying * operating system doesn't provide writev(). */ -APR_DECLARE(apr_status_t) apr_file_writev_full(apr_file_t *thefile, +APR_DECLARE(fspr_status_t) fspr_file_writev_full(fspr_file_t *thefile, const struct iovec *vec, - apr_size_t nvec, - apr_size_t *nbytes); + fspr_size_t nvec, + fspr_size_t *nbytes); /** * Write a character into the specified file. * @param ch The character to write. * @param thefile The file descriptor to write to */ -APR_DECLARE(apr_status_t) apr_file_putc(char ch, apr_file_t *thefile); +APR_DECLARE(fspr_status_t) fspr_file_putc(char ch, fspr_file_t *thefile); /** * Read a character from the specified file. * @param ch The character to read into * @param thefile The file descriptor to read from */ -APR_DECLARE(apr_status_t) apr_file_getc(char *ch, apr_file_t *thefile); +APR_DECLARE(fspr_status_t) fspr_file_getc(char *ch, fspr_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 */ -APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile); +APR_DECLARE(fspr_status_t) fspr_file_ungetc(char ch, fspr_file_t *thefile); /** * Read a string from the specified file. @@ -479,32 +479,32 @@ APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile); * @param thefile The file descriptor to read from * @remark The buffer will be NUL-terminated if any characters are stored. */ -APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, - apr_file_t *thefile); +APR_DECLARE(fspr_status_t) fspr_file_gets(char *str, int len, + fspr_file_t *thefile); /** * Write the string into the specified file. * @param str The string to write. * @param thefile The file descriptor to write to */ -APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile); +APR_DECLARE(fspr_status_t) fspr_file_puts(const char *str, fspr_file_t *thefile); /** * Flush the file's buffer. * @param thefile The file descriptor to flush */ -APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile); +APR_DECLARE(fspr_status_t) fspr_file_flush(fspr_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. - * @remark *new_file must point to a valid apr_file_t, or point to NULL. + * @remark *new_file must point to a valid fspr_file_t, or point to NULL. */ -APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, - apr_file_t *old_file, - apr_pool_t *p); +APR_DECLARE(fspr_status_t) fspr_file_dup(fspr_file_t **new_file, + fspr_file_t *old_file, + fspr_pool_t *p); /** * Duplicate the specified file descriptor and close the original @@ -512,26 +512,26 @@ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, * @param old_file The file to duplicate * @param p The pool to use for the new file * - * @remark new_file MUST point at a valid apr_file_t. It cannot be NULL. + * @remark new_file MUST point at a valid fspr_file_t. It cannot be NULL. */ -APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, - apr_file_t *old_file, - apr_pool_t *p); +APR_DECLARE(fspr_status_t) fspr_file_dup2(fspr_file_t *new_file, + fspr_file_t *old_file, + fspr_pool_t *p); /** * Move the specified file descriptor to a new pool - * @param new_file Pointer in which to return the new apr_file_t + * @param new_file Pointer in which to return the new fspr_file_t * @param old_file The file to move * @param p The pool to which the descriptor is to be moved - * @remark Unlike apr_file_dup2(), this function doesn't do an + * @remark Unlike fspr_file_dup2(), this function doesn't do an * OS dup() operation on the underlying descriptor; it just - * moves the descriptor's apr_file_t wrapper to a new pool. + * moves the descriptor's fspr_file_t wrapper to a new pool. * @remark The new pool need not be an ancestor of old_file's pool. * @remark After calling this function, old_file may not be used */ -APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, - apr_file_t *old_file, - apr_pool_t *p); +APR_DECLARE(fspr_status_t) fspr_file_setaside(fspr_file_t **new_file, + fspr_file_t *old_file, + fspr_pool_t *p); /** * Move the read/write file offset to a specified byte within a file. @@ -546,9 +546,9 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, * @remark The third argument is modified to be the offset the pointer was actually moved to. */ -APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, - apr_seek_where_t where, - apr_off_t *offset); +APR_DECLARE(fspr_status_t) fspr_file_seek(fspr_file_t *thefile, + fspr_seek_where_t where, + fspr_off_t *offset); /** * Create an anonymous pipe. @@ -556,12 +556,12 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, * @param out The file descriptor to use as output from the pipe. * @param pool The pool to operate on. * @remark By default, the returned file descriptors will be inherited - * by child processes created using apr_proc_create(). This can be - * changed using apr_file_inherit_unset(). + * by child processes created using fspr_proc_create(). This can be + * changed using fspr_file_inherit_unset(). */ -APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, - apr_file_t **out, - apr_pool_t *pool); +APR_DECLARE(fspr_status_t) fspr_file_pipe_create(fspr_file_t **in, + fspr_file_t **out, + fspr_pool_t *pool); /** * Create a named pipe. @@ -569,17 +569,17 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, * @param perm The permissions for the newly created pipe. * @param pool The pool to operate on. */ -APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, - apr_fileperms_t perm, - apr_pool_t *pool); +APR_DECLARE(fspr_status_t) fspr_file_namedpipe_create(const char *filename, + fspr_fileperms_t perm, + fspr_pool_t *pool); /** * Get the timeout value for a pipe or manipulate the blocking state. * @param thepipe The pipe we are getting a timeout for. * @param timeout The current timeout value in microseconds. */ -APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, - apr_interval_time_t *timeout); +APR_DECLARE(fspr_status_t) fspr_file_pipe_timeout_get(fspr_file_t *thepipe, + fspr_interval_time_t *timeout); /** * Set the timeout value for a pipe or manipulate the blocking state. @@ -587,8 +587,8 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, * @param timeout The timeout value in microseconds. Values < 0 mean wait * forever, 0 means do not wait at all. */ -APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, - apr_interval_time_t timeout); +APR_DECLARE(fspr_status_t) fspr_file_pipe_timeout_set(fspr_file_t *thepipe, + fspr_interval_time_t timeout); /** file (un)locking functions. */ @@ -601,13 +601,13 @@ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, * @param thefile The file to lock. * @param type The type of lock to establish on the file. */ -APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type); +APR_DECLARE(fspr_status_t) fspr_file_lock(fspr_file_t *thefile, int type); /** * Remove any outstanding locks on the file. * @param thefile The file to unlock. */ -APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile); +APR_DECLARE(fspr_status_t) fspr_file_unlock(fspr_file_t *thefile); /**accessor and general file_io functions. */ @@ -616,8 +616,8 @@ APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile); * @param new_path The path of the file. * @param thefile The currently open file. */ -APR_DECLARE(apr_status_t) apr_file_name_get(const char **new_path, - apr_file_t *thefile); +APR_DECLARE(fspr_status_t) fspr_file_name_get(const char **new_path, + fspr_file_t *thefile); /** * Return the data associated with the current file. @@ -625,8 +625,8 @@ APR_DECLARE(apr_status_t) apr_file_name_get(const char **new_path, * @param key The key to use for retreiving data associated with this file. * @param file The currently open file. */ -APR_DECLARE(apr_status_t) apr_file_data_get(void **data, const char *key, - apr_file_t *file); +APR_DECLARE(fspr_status_t) fspr_file_data_get(void **data, const char *key, + fspr_file_t *file); /** * Set the data associated with the current file. @@ -635,9 +635,9 @@ APR_DECLARE(apr_status_t) apr_file_data_get(void **data, const char *key, * @param key The key to use for assocaiteing data with the file. * @param cleanup The cleanup routine to use when the file is destroyed. */ -APR_DECLARE(apr_status_t) apr_file_data_set(apr_file_t *file, void *data, +APR_DECLARE(fspr_status_t) fspr_file_data_set(fspr_file_t *file, void *data, const char *key, - apr_status_t (*cleanup)(void *)); + fspr_status_t (*cleanup)(void *)); /** * Write a string to a file using a printf format. @@ -646,7 +646,7 @@ APR_DECLARE(apr_status_t) apr_file_data_set(apr_file_t *file, void *data, * @param ... The values to substitute in the format string * @return The number of bytes written */ -APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, +APR_DECLARE_NONSTD(int) fspr_file_printf(fspr_file_t *fptr, const char *format, ...) __attribute__((format(printf,2,3))); @@ -662,8 +662,8 @@ APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, * @warning Platforms which do not implement this feature will return * APR_ENOTIMPL. */ -APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, - apr_fileperms_t perms); +APR_DECLARE(fspr_status_t) fspr_file_perms_set(const char *fname, + fspr_fileperms_t perms); /** * Set attributes of the specified file. @@ -683,10 +683,10 @@ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, * @warning Platforms which do not implement this feature will return * APR_ENOTIMPL. */ -APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, - apr_fileattrs_t attributes, - apr_fileattrs_t attr_mask, - apr_pool_t *pool); +APR_DECLARE(fspr_status_t) fspr_file_attrs_set(const char *fname, + fspr_fileattrs_t attributes, + fspr_fileattrs_t attr_mask, + fspr_pool_t *pool); /** * Set the mtime of the specified file. @@ -696,9 +696,9 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, * @warning Platforms which do not implement this feature will return * APR_ENOTIMPL. */ -APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, - apr_time_t mtime, - apr_pool_t *pool); +APR_DECLARE(fspr_status_t) fspr_file_mtime_set(const char *fname, + fspr_time_t mtime, + fspr_pool_t *pool); /** * Create a new directory on the file system. @@ -706,8 +706,8 @@ APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, * @param perm Permissions for the new direcoty. * @param pool the pool to use. */ -APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, - apr_pool_t *pool); +APR_DECLARE(fspr_status_t) fspr_dir_make(const char *path, fspr_fileperms_t perm, + fspr_pool_t *pool); /** Creates a new directory on the file system, but behaves like * 'mkdir -p'. Creates intermediate directories as required. No error @@ -716,26 +716,26 @@ APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, * @param perm Permissions for the new direcoty. * @param pool the pool to use. */ -APR_DECLARE(apr_status_t) apr_dir_make_recursive(const char *path, - apr_fileperms_t perm, - apr_pool_t *pool); +APR_DECLARE(fspr_status_t) fspr_dir_make_recursive(const char *path, + fspr_fileperms_t perm, + fspr_pool_t *pool); /** * Remove directory from the file system. * @param path the path for the directory to be removed. (use / on all systems) * @param pool the pool to use. */ -APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *pool); +APR_DECLARE(fspr_status_t) fspr_dir_remove(const char *path, fspr_pool_t *pool); /** * get the specified file's stats. * @param finfo Where to store the information about the file. - * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values + * @param wanted The desired fspr_finfo_t fields, as a bit flag of APR_FINFO_ values * @param thefile The file to get information about. */ -APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, - apr_int32_t wanted, - apr_file_t *thefile); +APR_DECLARE(fspr_status_t) fspr_file_info_get(fspr_finfo_t *finfo, + fspr_int32_t wanted, + fspr_file_t *thefile); /** @@ -743,14 +743,14 @@ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, * @param fp The file to truncate * @param offset The offset to truncate to. */ -APR_DECLARE(apr_status_t) apr_file_trunc(apr_file_t *fp, apr_off_t offset); +APR_DECLARE(fspr_status_t) fspr_file_trunc(fspr_file_t *fp, fspr_off_t offset); /** - * Retrieve the flags that were passed into apr_file_open() + * Retrieve the flags that were passed into fspr_file_open() * when the file was opened. - * @return apr_int32_t the flags + * @return fspr_int32_t the flags */ -APR_DECLARE(apr_int32_t) apr_file_flags_get(apr_file_t *f); +APR_DECLARE(fspr_int32_t) fspr_file_flags_get(fspr_file_t *f); /** * Get the pool used by the file. @@ -784,8 +784,8 @@ APR_DECLARE_INHERIT_UNSET(file); * array. * */ -APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *templ, - apr_int32_t flags, apr_pool_t *p); +APR_DECLARE(fspr_status_t) fspr_file_mktemp(fspr_file_t **fp, char *templ, + fspr_int32_t flags, fspr_pool_t *p); /** @@ -800,8 +800,8 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *templ, * is successful. * */ -APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir, - apr_pool_t *p); +APR_DECLARE(fspr_status_t) fspr_temp_dir_get(const char **temp_dir, + fspr_pool_t *p); /** @} */ diff --git a/libs/apr/include/apr_fnmatch.h b/libs/apr/include/fspr_fnmatch.h similarity index 89% rename from libs/apr/include/apr_fnmatch.h rename to libs/apr/include/fspr_fnmatch.h index 7a2811aac8..18c0f138d7 100644 --- a/libs/apr/include/apr_fnmatch.h +++ b/libs/apr/include/fspr_fnmatch.h @@ -38,19 +38,19 @@ #define _APR_FNMATCH_H_ /** - * @file apr_fnmatch.h + * @file fspr_fnmatch.h * @brief APR FNMatch Functions */ -#include "apr_errno.h" -#include "apr_tables.h" +#include "fspr_errno.h" +#include "fspr_tables.h" #ifdef __cplusplus extern "C" { #endif /** - * @defgroup apr_fnmatch Filename Matching Functions + * @defgroup fspr_fnmatch Filename Matching Functions * @ingroup APR * @{ */ @@ -78,7 +78,7 @@ extern "C" { * */ -APR_DECLARE(apr_status_t) apr_fnmatch(const char *pattern, +APR_DECLARE(fspr_status_t) fspr_fnmatch(const char *pattern, const char *strings, int flags); /** @@ -86,7 +86,7 @@ APR_DECLARE(apr_status_t) apr_fnmatch(const char *pattern, * @param pattern The pattern to search for glob characters. * @return non-zero if pattern has any glob characters in it */ -APR_DECLARE(int) apr_fnmatch_test(const char *pattern); +APR_DECLARE(int) fspr_fnmatch_test(const char *pattern); /** * Find all files that match a specified pattern. @@ -95,9 +95,9 @@ APR_DECLARE(int) apr_fnmatch_test(const char *pattern); * @param p The pool to use. * @return non-zero if pattern has any glob characters in it */ -APR_DECLARE(apr_status_t) apr_match_glob(const char *pattern, - apr_array_header_t **result, - apr_pool_t *p); +APR_DECLARE(fspr_status_t) fspr_match_glob(const char *pattern, + fspr_array_header_t **result, + fspr_pool_t *p); /** @} */ diff --git a/libs/apr/include/apr_general.h b/libs/apr/include/fspr_general.h similarity index 80% rename from libs/apr/include/apr_general.h rename to libs/apr/include/fspr_general.h index 3a956288e3..103f69f1df 100644 --- a/libs/apr/include/apr_general.h +++ b/libs/apr/include/fspr_general.h @@ -18,16 +18,16 @@ #define APR_GENERAL_H /** - * @file apr_general.h + * @file fspr_general.h * This is collection of oddballs that didn't fit anywhere else, * and might move to more appropriate headers with the release * of APR 1.0. * @brief APR Miscellaneous library routines */ -#include "apr.h" -#include "apr_pools.h" -#include "apr_errno.h" +#include "fspr.h" +#include "fspr_pools.h" +#include "fspr_errno.h" #if !defined(_ANSI_SOURCE) && defined(_DARWIN_C_SOURCE) #define NSIG __DARWIN_NSIG @@ -42,7 +42,7 @@ extern "C" { #endif /* __cplusplus */ /** - * @defgroup apr_general Miscellaneous library routines + * @defgroup fspr_general Miscellaneous library routines * @ingroup APR * This is collection of oddballs that didn't fit anywhere else, * and might move to more appropriate headers with the release @@ -69,7 +69,7 @@ extern "C" { #define APR_ASCII_TAB '\011' /** signal numbers typedef */ -typedef int apr_signum_t; +typedef int fspr_signum_t; /** * Finding offsets of elements within structures. @@ -148,7 +148,7 @@ int strncasecmp(const char *a, const char *b, size_t n); * String and memory functions */ -/* APR_STRINGIFY is defined here, and also in apr_release.h, so wrap it */ +/* APR_STRINGIFY is defined here, and also in fspr_release.h, so wrap it */ #ifndef APR_STRINGIFY /** Properly quote a value as a string in the C preprocessor */ #define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n) @@ -167,17 +167,17 @@ void *memchr(const void *s, int c, size_t n); /** @} */ /** - * @defgroup apr_library Library initialization and termination + * @defgroup fspr_library Library initialization and termination * @{ */ /** * Setup any APR internal data structures. This MUST be the first function * called for any APR library. - * @remark See apr_app_initialize if this is an application, rather than + * @remark See fspr_app_initialize if this is an application, rather than * a library consumer of apr. */ -APR_DECLARE(apr_status_t) apr_initialize(void); +APR_DECLARE(fspr_status_t) fspr_initialize(void); /** * Set up an application with normalized argc, argv (and optionally env) in @@ -187,11 +187,11 @@ APR_DECLARE(apr_status_t) apr_initialize(void); * @param argc Pointer to the argc that may be corrected * @param argv Pointer to the argv that may be corrected * @param env Pointer to the env that may be corrected, may be NULL - * @remark See apr_initialize if this is a library consumer of apr. - * Otherwise, this call is identical to apr_initialize, and must be closed - * with a call to apr_terminate at the end of program execution. + * @remark See fspr_initialize if this is a library consumer of apr. + * Otherwise, this call is identical to fspr_initialize, and must be closed + * with a call to fspr_terminate at the end of program execution. */ -APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, +APR_DECLARE(fspr_status_t) fspr_app_initialize(int *argc, char const * const * *argv, char const * const * *env); @@ -202,25 +202,25 @@ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, * has stopped using APR services. The APR developers suggest using * atexit to ensure this is called. When using APR from a language * other than C that has problems with the calling convention, use - * apr_terminate2() instead. + * fspr_terminate2() instead. */ -APR_DECLARE_NONSTD(void) apr_terminate(void); +APR_DECLARE_NONSTD(void) fspr_terminate(void); /** * Tear down any APR internal data structures which aren't torn down - * automatically, same as apr_terminate - * @remark An APR program must call either the apr_terminate or apr_terminate2 + * automatically, same as fspr_terminate + * @remark An APR program must call either the fspr_terminate or fspr_terminate2 * function once it it has finished using APR services. The APR - * developers suggest using atexit(apr_terminate) to ensure this is done. - * apr_terminate2 exists to allow non-c language apps to tear down apr, - * while apr_terminate is recommended from c language applications. + * developers suggest using atexit(fspr_terminate) to ensure this is done. + * fspr_terminate2 exists to allow non-c language apps to tear down apr, + * while fspr_terminate is recommended from c language applications. */ -APR_DECLARE(void) apr_terminate2(void); +APR_DECLARE(void) fspr_terminate2(void); /** @} */ /** - * @defgroup apr_random Random Functions + * @defgroup fspr_random Random Functions * @{ */ @@ -232,8 +232,8 @@ APR_DECLARE(void) apr_terminate2(void); * @param buf Buffer to fill with random bytes * @param length Length of buffer in bytes */ -APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf, - apr_size_t length); +APR_DECLARE(fspr_status_t) fspr_generate_random_bytes(unsigned char * buf, + fspr_size_t length); #endif /** @} */ diff --git a/libs/apr/include/apr_getopt.h b/libs/apr/include/fspr_getopt.h similarity index 78% rename from libs/apr/include/apr_getopt.h rename to libs/apr/include/fspr_getopt.h index 131aa4b38d..5299fa7ae3 100644 --- a/libs/apr/include/apr_getopt.h +++ b/libs/apr/include/fspr_getopt.h @@ -18,18 +18,18 @@ #define APR_GETOPT_H /** - * @file apr_getopt.h + * @file fspr_getopt.h * @brief APR Command Arguments (getopt) */ -#include "apr_pools.h" +#include "fspr_pools.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** - * @defgroup apr_getopt Command Argument Parsing + * @defgroup fspr_getopt Command Argument Parsing * @ingroup APR * @{ */ @@ -37,19 +37,19 @@ extern "C" { /** * defintion of a error function */ -typedef void (apr_getopt_err_fn_t)(void *arg, const char *err, ...); +typedef void (fspr_getopt_err_fn_t)(void *arg, const char *err, ...); -/** @see apr_getopt_t */ -typedef struct apr_getopt_t apr_getopt_t; +/** @see fspr_getopt_t */ +typedef struct fspr_getopt_t fspr_getopt_t; /** * Structure to store command line argument information. */ -struct apr_getopt_t { +struct fspr_getopt_t { /** context for processing */ - apr_pool_t *cont; + fspr_pool_t *cont; /** function to print error message (NULL == no messages) */ - apr_getopt_err_fn_t *errfn; + fspr_getopt_err_fn_t *errfn; /** user defined first arg to pass to error message */ void *errarg; /** index into parent argv vector */ @@ -72,13 +72,13 @@ struct apr_getopt_t { int skip_end; }; -/** @see apr_getopt_option_t */ -typedef struct apr_getopt_option_t apr_getopt_option_t; +/** @see fspr_getopt_option_t */ +typedef struct fspr_getopt_option_t fspr_getopt_option_t; /** * Structure used to describe options that getopt should search for. */ -struct apr_getopt_option_t { +struct fspr_getopt_option_t { /** long option name, or NULL if option has no long name */ const char *name; /** option letter, or a value greater than 255 if option has no letter */ @@ -90,20 +90,20 @@ struct apr_getopt_option_t { }; /** - * Initialize the arguments for parsing by apr_getopt(). - * @param os The options structure created for apr_getopt() + * Initialize the arguments for parsing by fspr_getopt(). + * @param os The options structure created for fspr_getopt() * @param cont The pool to operate on * @param argc The number of arguments to parse * @param argv The array of arguments to parse * @remark Arguments 2 and 3 are most commonly argc and argv from main(argc, argv) * The errfn is initialized to fprintf(stderr... but may be overridden. */ -APR_DECLARE(apr_status_t) apr_getopt_init(apr_getopt_t **os, apr_pool_t *cont, +APR_DECLARE(fspr_status_t) fspr_getopt_init(fspr_getopt_t **os, fspr_pool_t *cont, int argc, const char * const *argv); /** - * Parse the options initialized by apr_getopt_init(). - * @param os The apr_opt_t structure returned by apr_getopt_init() + * Parse the options initialized by fspr_getopt_init(). + * @param os The fspr_opt_t structure returned by fspr_getopt_init() * @param opts A string of characters that are acceptable options to the * program. Characters followed by ":" are required to have an * option associated @@ -117,19 +117,19 @@ APR_DECLARE(apr_status_t) apr_getopt_init(apr_getopt_t **os, apr_pool_t *cont, * APR_SUCCESS -- The next option was found. * */ -APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, +APR_DECLARE(fspr_status_t) fspr_getopt(fspr_getopt_t *os, const char *opts, char *option_ch, const char **option_arg); /** - * Parse the options initialized by apr_getopt_init(), accepting long + * Parse the options initialized by fspr_getopt_init(), accepting long * options beginning with "--" in addition to single-character * options beginning with "-". - * @param os The apr_getopt_t structure created by apr_getopt_init() - * @param opts A pointer to a list of apr_getopt_option_t structures, which + * @param os The fspr_getopt_t structure created by fspr_getopt_init() + * @param opts A pointer to a list of fspr_getopt_option_t structures, which * can be initialized with { "name", optch, has_args }. has_args * is nonzero if the option requires an argument. A structure * with an optch value of 0 terminates the list. - * @param option_ch Receives the value of "optch" from the apr_getopt_option_t + * @param option_ch Receives the value of "optch" from the fspr_getopt_option_t * structure corresponding to the next option matched. * @param option_arg Receives the argument following the option, if any. * @return There are four potential status values on exit. They are: @@ -145,8 +145,8 @@ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, * after arguments, and os->argv will be permuted to leave non-option arguments * at the end (the original argv is unaffected). */ -APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os, - const apr_getopt_option_t *opts, +APR_DECLARE(fspr_status_t) fspr_getopt_long(fspr_getopt_t *os, + const fspr_getopt_option_t *opts, int *option_ch, const char **option_arg); /** @} */ diff --git a/libs/apr/include/apr_global_mutex.h b/libs/apr/include/fspr_global_mutex.h similarity index 71% rename from libs/apr/include/apr_global_mutex.h rename to libs/apr/include/fspr_global_mutex.h index 9316001ce6..3e82a3e7dd 100644 --- a/libs/apr/include/apr_global_mutex.h +++ b/libs/apr/include/fspr_global_mutex.h @@ -18,16 +18,16 @@ #define APR_GLOBAL_MUTEX_H /** - * @file apr_global_mutex.h + * @file fspr_global_mutex.h * @brief APR Global Locking Routines */ -#include "apr.h" -#include "apr_proc_mutex.h" /* only for apr_lockmech_e */ -#include "apr_pools.h" -#include "apr_errno.h" +#include "fspr.h" +#include "fspr_proc_mutex.h" /* only for fspr_lockmech_e */ +#include "fspr_pools.h" +#include "fspr_errno.h" #if APR_PROC_MUTEX_IS_GLOBAL -#include "apr_proc_mutex.h" +#include "fspr_proc_mutex.h" #endif #ifdef __cplusplus @@ -43,7 +43,7 @@ extern "C" { #if !APR_PROC_MUTEX_IS_GLOBAL || defined(DOXYGEN) /** Opaque global mutex structure. */ -typedef struct apr_global_mutex_t apr_global_mutex_t; +typedef struct fspr_global_mutex_t fspr_global_mutex_t; /* Function definitions */ @@ -51,7 +51,7 @@ typedef struct apr_global_mutex_t apr_global_mutex_t; * Create and initialize a mutex that can be used to synchronize both * processes and threads. Note: There is considerable overhead in using * this API if only cross-process or cross-thread mutual exclusion is - * required. See apr_proc_mutex.h and apr_thread_mutex.h for more + * required. See fspr_proc_mutex.h and fspr_thread_mutex.h for more * specialized lock routines. * @param mutex the memory address where the newly created mutex will be * stored. @@ -71,10 +71,10 @@ typedef struct apr_global_mutex_t apr_global_mutex_t; * @warning Check APR_HAS_foo_SERIALIZE defines to see if the platform supports * APR_LOCK_foo. Only APR_LOCK_DEFAULT is portable. */ -APR_DECLARE(apr_status_t) apr_global_mutex_create(apr_global_mutex_t **mutex, +APR_DECLARE(fspr_status_t) fspr_global_mutex_create(fspr_global_mutex_t **mutex, const char *fname, - apr_lockmech_e mech, - apr_pool_t *pool); + fspr_lockmech_e mech, + fspr_pool_t *pool); /** * Re-open a mutex in a child process. @@ -82,22 +82,22 @@ APR_DECLARE(apr_status_t) apr_global_mutex_create(apr_global_mutex_t **mutex, * @param fname A file name to use if the mutex mechanism requires one. This * argument should always be provided. The mutex code itself will * determine if it should be used. This filename should be the - * same one that was passed to apr_global_mutex_create(). + * same one that was passed to fspr_global_mutex_create(). * @param pool The pool to operate on. * @remark This function must be called to maintain portability, even * if the underlying lock mechanism does not require it. */ -APR_DECLARE(apr_status_t) apr_global_mutex_child_init( - apr_global_mutex_t **mutex, +APR_DECLARE(fspr_status_t) fspr_global_mutex_child_init( + fspr_global_mutex_t **mutex, const char *fname, - apr_pool_t *pool); + fspr_pool_t *pool); /** * Acquire the lock for the given mutex. If the mutex is already locked, * the current thread will be put to sleep until the lock becomes available. * @param mutex the mutex on which to acquire the lock. */ -APR_DECLARE(apr_status_t) apr_global_mutex_lock(apr_global_mutex_t *mutex); +APR_DECLARE(fspr_status_t) fspr_global_mutex_lock(fspr_global_mutex_t *mutex); /** * Attempt to acquire the lock for the given mutex. If the mutex has already @@ -106,23 +106,23 @@ APR_DECLARE(apr_status_t) apr_global_mutex_lock(apr_global_mutex_t *mutex); * if the return value was APR_EBUSY, for portability reasons. * @param mutex the mutex on which to attempt the lock acquiring. */ -APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex); +APR_DECLARE(fspr_status_t) fspr_global_mutex_trylock(fspr_global_mutex_t *mutex); /** * Release the lock for the given mutex. * @param mutex the mutex from which to release the lock. */ -APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex); +APR_DECLARE(fspr_status_t) fspr_global_mutex_unlock(fspr_global_mutex_t *mutex); /** * Destroy the mutex and free the memory associated with the lock. * @param mutex the mutex to destroy. */ -APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex); +APR_DECLARE(fspr_status_t) fspr_global_mutex_destroy(fspr_global_mutex_t *mutex); /** * Get the pool used by this global_mutex. - * @return apr_pool_t the pool + * @return fspr_pool_t the pool */ APR_POOL_DECLARE_ACCESSOR(global_mutex); @@ -130,17 +130,17 @@ APR_POOL_DECLARE_ACCESSOR(global_mutex); /* Some platforms [e.g. Win32] have cross process locks that are truly * global locks, since there isn't the concept of cross-process locks. - * Define these platforms in terms of an apr_proc_mutex_t. + * Define these platforms in terms of an fspr_proc_mutex_t. */ -#define apr_global_mutex_t apr_proc_mutex_t -#define apr_global_mutex_create apr_proc_mutex_create -#define apr_global_mutex_child_init apr_proc_mutex_child_init -#define apr_global_mutex_lock apr_proc_mutex_lock -#define apr_global_mutex_trylock apr_proc_mutex_trylock -#define apr_global_mutex_unlock apr_proc_mutex_unlock -#define apr_global_mutex_destroy apr_proc_mutex_destroy -#define apr_global_mutex_pool_get apr_proc_mutex_pool_get +#define fspr_global_mutex_t fspr_proc_mutex_t +#define fspr_global_mutex_create fspr_proc_mutex_create +#define fspr_global_mutex_child_init fspr_proc_mutex_child_init +#define fspr_global_mutex_lock fspr_proc_mutex_lock +#define fspr_global_mutex_trylock fspr_proc_mutex_trylock +#define fspr_global_mutex_unlock fspr_proc_mutex_unlock +#define fspr_global_mutex_destroy fspr_proc_mutex_destroy +#define fspr_global_mutex_pool_get fspr_proc_mutex_pool_get #endif diff --git a/libs/apr/include/apr_hash.h b/libs/apr/include/fspr_hash.h similarity index 69% rename from libs/apr/include/apr_hash.h rename to libs/apr/include/fspr_hash.h index 353709b145..fca4458cb3 100644 --- a/libs/apr/include/apr_hash.h +++ b/libs/apr/include/fspr_hash.h @@ -18,43 +18,43 @@ #define APR_HASH_H /** - * @file apr_hash.h + * @file fspr_hash.h * @brief APR Hash Tables */ -#include "apr_pools.h" +#include "fspr_pools.h" #ifdef __cplusplus extern "C" { #endif /** - * @defgroup apr_hash Hash Tables + * @defgroup fspr_hash Hash Tables * @ingroup APR * @{ */ /** - * When passing a key to apr_hash_set or apr_hash_get, this value can be - * passed to indicate a string-valued key, and have apr_hash compute the + * When passing a key to fspr_hash_set or fspr_hash_get, this value can be + * passed to indicate a string-valued key, and have fspr_hash compute the * length automatically. * - * @remark apr_hash will use strlen(key) for the length. The NUL terminator + * @remark fspr_hash will use strlen(key) for the length. The NUL terminator * is not included in the hash value (why throw a constant in?). * Since the hash table merely references the provided key (rather - * than copying it), apr_hash_this() will return the NUL-term'd key. + * than copying it), fspr_hash_this() will return the NUL-term'd key. */ #define APR_HASH_KEY_STRING (-1) /** * Abstract type for hash tables. */ -typedef struct apr_hash_t apr_hash_t; +typedef struct fspr_hash_t fspr_hash_t; /** * Abstract type for scanning hash tables. */ -typedef struct apr_hash_index_t apr_hash_index_t; +typedef struct fspr_hash_index_t fspr_hash_index_t; /** * Callback functions for calculating hash values. @@ -62,20 +62,20 @@ typedef struct apr_hash_index_t apr_hash_index_t; * @param klen The length of the key, or APR_HASH_KEY_STRING to use the string * length. If APR_HASH_KEY_STRING then returns the actual key length. */ -typedef unsigned int (*apr_hashfunc_t)(const char *key, apr_ssize_t *klen); +typedef unsigned int (*fspr_hashfunc_t)(const char *key, fspr_ssize_t *klen); /** * The default hash function. */ -APR_DECLARE_NONSTD(unsigned int) apr_hashfunc_default(const char *key, - apr_ssize_t *klen); +APR_DECLARE_NONSTD(unsigned int) fspr_hashfunc_default(const char *key, + fspr_ssize_t *klen); /** * Create a hash table. * @param pool The pool to allocate the hash table out of * @return The hash table just created */ -APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool); +APR_DECLARE(fspr_hash_t *) fspr_hash_make(fspr_pool_t *pool); /** * Create a hash table with a custom hash function @@ -83,8 +83,8 @@ APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool); * @param hash_func A custom hash function. * @return The hash table just created */ -APR_DECLARE(apr_hash_t *) apr_hash_make_custom(apr_pool_t *pool, - apr_hashfunc_t hash_func); +APR_DECLARE(fspr_hash_t *) fspr_hash_make_custom(fspr_pool_t *pool, + fspr_hashfunc_t hash_func); /** * Make a copy of a hash table @@ -93,8 +93,8 @@ APR_DECLARE(apr_hash_t *) apr_hash_make_custom(apr_pool_t *pool, * @return The hash table just created * @remark Makes a shallow copy */ -APR_DECLARE(apr_hash_t *) apr_hash_copy(apr_pool_t *pool, - const apr_hash_t *h); +APR_DECLARE(fspr_hash_t *) fspr_hash_copy(fspr_pool_t *pool, + const fspr_hash_t *h); /** * Associate a value with a key in a hash table. @@ -104,8 +104,8 @@ APR_DECLARE(apr_hash_t *) apr_hash_copy(apr_pool_t *pool, * @param val Value to associate with the key * @remark If the value is NULL the hash entry is deleted. */ -APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, const void *key, - apr_ssize_t klen, const void *val); +APR_DECLARE(void) fspr_hash_set(fspr_hash_t *ht, const void *key, + fspr_ssize_t klen, const void *val); /** * Look up the value associated with a key in a hash table. @@ -114,12 +114,12 @@ APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, const void *key, * @param klen Length of the key. Can be APR_HASH_KEY_STRING to use the string length. * @return Returns NULL if the key is not present. */ -APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, const void *key, - apr_ssize_t klen); +APR_DECLARE(void *) fspr_hash_get(fspr_hash_t *ht, const void *key, + fspr_ssize_t klen); /** * Start iterating over the entries in a hash table. - * @param p The pool to allocate the apr_hash_index_t iterator. If this + * @param p The pool to allocate the fspr_hash_index_t iterator. If this * pool is NULL, then an internal, non-thread-safe iterator is used. * @param ht The hash table * @remark There is no restriction on adding or deleting hash entries during @@ -132,20 +132,20 @@ APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, const void *key, /** *

      * 
    - * int sum_values(apr_pool_t *p, apr_hash_t *ht)
    + * int sum_values(fspr_pool_t *p, fspr_hash_t *ht)
      * {
    - *     apr_hash_index_t *hi;
    + *     fspr_hash_index_t *hi;
      *     void *val;
      *     int sum = 0;
    - *     for (hi = apr_hash_first(p, ht); hi; hi = apr_hash_next(hi)) {
    - *         apr_hash_this(hi, NULL, NULL, &val);
    + *     for (hi = fspr_hash_first(p, ht); hi; hi = fspr_hash_next(hi)) {
    + *         fspr_hash_this(hi, NULL, NULL, &val);
      *         sum += *(int *)val;
      *     }
      *     return sum;
      * }
      * 
    */ -APR_DECLARE(apr_hash_index_t *) apr_hash_first(apr_pool_t *p, apr_hash_t *ht); +APR_DECLARE(fspr_hash_index_t *) fspr_hash_first(fspr_pool_t *p, fspr_hash_t *ht); /** * Continue iterating over the entries in a hash table. @@ -153,7 +153,7 @@ APR_DECLARE(apr_hash_index_t *) apr_hash_first(apr_pool_t *p, apr_hash_t *ht); * @return a pointer to the updated iteration state. NULL if there are no more * entries. */ -APR_DECLARE(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi); +APR_DECLARE(fspr_hash_index_t *) fspr_hash_next(fspr_hash_index_t *hi); /** * Get the current entry's details from the iteration state. @@ -164,21 +164,21 @@ APR_DECLARE(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi); * @remark 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_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, const void **key, - apr_ssize_t *klen, void **val); +APR_DECLARE(void) fspr_hash_this(fspr_hash_index_t *hi, const void **key, + fspr_ssize_t *klen, void **val); /** * Get the number of key/value pairs in the hash table. * @param ht The hash table * @return The number of key/value pairs in the hash table. */ -APR_DECLARE(unsigned int) apr_hash_count(apr_hash_t *ht); +APR_DECLARE(unsigned int) fspr_hash_count(fspr_hash_t *ht); /** * Clear any key/value pairs in the hash table. * @param ht The hash table */ -APR_DECLARE(void) apr_hash_clear(apr_hash_t *ht); +APR_DECLARE(void) fspr_hash_clear(fspr_hash_t *ht); /** * Merge two hash tables into one new hash table. The values of the overlay @@ -189,9 +189,9 @@ APR_DECLARE(void) apr_hash_clear(apr_hash_t *ht); * @param base The table that represents the initial values of the new table * @return A new hash table containing all of the data from the two passed in */ -APR_DECLARE(apr_hash_t *) apr_hash_overlay(apr_pool_t *p, - const apr_hash_t *overlay, - const apr_hash_t *base); +APR_DECLARE(fspr_hash_t *) fspr_hash_overlay(fspr_pool_t *p, + const fspr_hash_t *overlay, + const fspr_hash_t *base); /** * Merge two hash tables into one new hash table. If the same key @@ -203,16 +203,16 @@ APR_DECLARE(apr_hash_t *) apr_hash_overlay(apr_pool_t *p, * @param h2 The second of the tables to merge * @param merger A callback function to merge values, or NULL to * make values from h1 override values from h2 (same semantics as - * apr_hash_overlay()) + * fspr_hash_overlay()) * @param data Client data to pass to the merger function * @return A new hash table containing all of the data from the two passed in */ -APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, - const apr_hash_t *h1, - const apr_hash_t *h2, - void * (*merger)(apr_pool_t *p, +APR_DECLARE(fspr_hash_t *) fspr_hash_merge(fspr_pool_t *p, + const fspr_hash_t *h1, + const fspr_hash_t *h2, + void * (*merger)(fspr_pool_t *p, const void *key, - apr_ssize_t klen, + fspr_ssize_t klen, const void *h1_val, const void *h2_val, const void *data), diff --git a/libs/apr/include/apr_inherit.h b/libs/apr/include/fspr_inherit.h similarity index 70% rename from libs/apr/include/apr_inherit.h rename to libs/apr/include/fspr_inherit.h index b7f7480f1f..c73cd8aa60 100644 --- a/libs/apr/include/apr_inherit.h +++ b/libs/apr/include/fspr_inherit.h @@ -18,34 +18,34 @@ #define APR_INHERIT_H /** - * @file apr_inherit.h + * @file fspr_inherit.h * @brief APR File Handle Inheritance Helpers * @remark This internal header includes internal declaration helpers - * for other headers to declare apr_foo_inherit_[un]set functions. + * for other headers to declare fspr_foo_inherit_[un]set functions. */ /** - * Prototype for type-specific declarations of apr_foo_inherit_set + * Prototype for type-specific declarations of fspr_foo_inherit_set * functions. * @remark Doxygen unwraps this macro (via doxygen.conf) to provide - * actual help for each specific occurance of apr_foo_inherit_set. + * actual help for each specific occurance of fspr_foo_inherit_set. * @remark the linkage is specified for APR. It would be possible to expand * the macros to support other linkages. */ #define APR_DECLARE_INHERIT_SET(type) \ - APR_DECLARE(apr_status_t) apr_##type##_inherit_set( \ - apr_##type##_t *the##type) + APR_DECLARE(fspr_status_t) fspr_##type##_inherit_set( \ + fspr_##type##_t *the##type) /** - * Prototype for type-specific declarations of apr_foo_inherit_unset + * Prototype for type-specific declarations of fspr_foo_inherit_unset * functions. * @remark Doxygen unwraps this macro (via doxygen.conf) to provide - * actual help for each specific occurance of apr_foo_inherit_unset. + * actual help for each specific occurance of fspr_foo_inherit_unset. * @remark the linkage is specified for APR. It would be possible to expand * the macros to support other linkages. */ #define APR_DECLARE_INHERIT_UNSET(type) \ - APR_DECLARE(apr_status_t) apr_##type##_inherit_unset( \ - apr_##type##_t *the##type) + APR_DECLARE(fspr_status_t) fspr_##type##_inherit_unset( \ + fspr_##type##_t *the##type) #endif /* ! APR_INHERIT_H */ diff --git a/libs/apr/include/apr_lib.h b/libs/apr/include/fspr_lib.h similarity index 65% rename from libs/apr/include/apr_lib.h rename to libs/apr/include/fspr_lib.h index ed25d869f5..6642950ecf 100644 --- a/libs/apr/include/apr_lib.h +++ b/libs/apr/include/fspr_lib.h @@ -18,15 +18,15 @@ #define APR_LIB_H /** - * @file apr_lib.h + * @file fspr_lib.h * This is collection of oddballs that didn't fit anywhere else, * and might move to more appropriate headers with the release * of APR 1.0. * @brief APR general purpose library routines */ -#include "apr.h" -#include "apr_errno.h" +#include "fspr.h" +#include "fspr_errno.h" #if APR_HAVE_CTYPE_H #include @@ -40,7 +40,7 @@ extern "C" { #endif /* __cplusplus */ /** - * @defgroup apr_lib General Purpose Library Routines + * @defgroup fspr_lib General Purpose Library Routines * @ingroup APR * This is collection of oddballs that didn't fit anywhere else, * and might move to more appropriate headers with the release @@ -55,13 +55,13 @@ extern "C" { * Define the structures used by the APR general-purpose library. */ -/** @see apr_vformatter_buff_t */ -typedef struct apr_vformatter_buff_t apr_vformatter_buff_t; +/** @see fspr_vformatter_buff_t */ +typedef struct fspr_vformatter_buff_t fspr_vformatter_buff_t; /** * Structure used by the variable-formatter routines. */ -struct apr_vformatter_buff_t { +struct fspr_vformatter_buff_t { /** The current position */ char *curpos; /** The end position of the format string */ @@ -81,26 +81,26 @@ struct apr_vformatter_buff_t { * "bs\\path\\stuff" -> "stuff" * */ -APR_DECLARE(const char *) apr_filepath_name_get(const char *pathname); +APR_DECLARE(const char *) fspr_filepath_name_get(const char *pathname); /** - * apr_killpg + * fspr_killpg * Small utility macros to make things easier to read. Not usually a * goal, to be sure.. */ #ifdef WIN32 -#define apr_killpg(x, y) +#define fspr_killpg(x, y) #else /* WIN32 */ #ifdef NO_KILLPG -#define apr_killpg(x, y) (kill (-(x), (y))) +#define fspr_killpg(x, y) (kill (-(x), (y))) #else /* NO_KILLPG */ -#define apr_killpg(x, y) (killpg ((x), (y))) +#define fspr_killpg(x, y) (killpg ((x), (y))) #endif /* NO_KILLPG */ #endif /* WIN32 */ /** - * apr_vformatter() is a generic printf-style formatting routine + * fspr_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 @@ -112,11 +112,11 @@ APR_DECLARE(const char *) apr_filepath_name_get(const char *pathname); * The extensions are: * * %%pA takes a struct in_addr *, and prints it as a.b.c.d - * %%pI takes an apr_sockaddr_t * and prints it as a.b.c.d:port or + * %%pI takes an fspr_sockaddr_t * and prints it as a.b.c.d:port or * [ipv6-address]:port - * %%pT takes an apr_os_thread_t * and prints it in decimal + * %%pT takes an fspr_os_thread_t * and prints it in decimal * ('0' is printed if !APR_HAS_THREADS) - * %%pt takes an apr_os_thread_t * and prints it in hexadecimal + * %%pt takes an fspr_os_thread_t * and prints it in hexadecimal * ('0' is printed if !APR_HAS_THREADS) * %%pp takes a void * and outputs it in hex * @@ -126,44 +126,44 @@ APR_DECLARE(const char *) apr_filepath_name_get(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, apr_vformatter allows for arbitrary output methods - * using the apr_vformatter_buff and flush_func. + * Additionally, fspr_vformatter allows for arbitrary output methods + * using the fspr_vformatter_buff and flush_func. * - * The apr_vformatter_buff has two elements curpos and endpos. - * curpos is where apr_vformatter will write the next byte of output. + * The fspr_vformatter_buff has two elements curpos and endpos. + * curpos is where fspr_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, apr_vformatter returns the + * If the end of output is reached, fspr_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 apr_vformatter will return immediately with -1. Otherwise + * and fspr_vformatter will return immediately with -1. Otherwise * the flush_func should flush the buffer in whatever manner is - * appropriate, re apr_pool_t nitialize curpos and endpos, and return 0. + * appropriate, re fspr_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 - * apr_vformatter returns. + * fspr_vformatter returns. * - * apr_vformatter does not call out to any other code, it is entirely + * fspr_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, apr_psprintf uses the "scratch" + * otherwise "unsafe". For example, fspr_psprintf uses the "scratch" * space at the unallocated end of a block, and doesn't actually - * complete the allocation until apr_vformatter returns. apr_psprintf - * would be completely broken if apr_vformatter were to call anything + * complete the allocation until fspr_vformatter returns. fspr_psprintf + * would be completely broken if fspr_vformatter were to call anything * that used this same pool. 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 apr_vformatter returns. + * or until fspr_vformatter returns. * */ -APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b), - apr_vformatter_buff_t *c, const char *fmt, +APR_DECLARE(int) fspr_vformatter(int (*flush_func)(fspr_vformatter_buff_t *b), + fspr_vformatter_buff_t *c, const char *fmt, va_list ap); /** @@ -174,16 +174,16 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b), * @remark If the password entered must be truncated to fit in * the provided buffer, APR_ENAMETOOLONG will be returned. * Note that the bufsize paramater is passed by reference for no - * reason; its value will never be modified by the apr_password_get() + * reason; its value will never be modified by the fspr_password_get() * function. */ -APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, - apr_size_t *bufsize); +APR_DECLARE(fspr_status_t) fspr_password_get(const char *prompt, char *pwbuf, + fspr_size_t *bufsize); /** @} */ /** - * @defgroup apr_ctype ctype functions + * @defgroup fspr_ctype ctype functions * These macros allow correct support of 8-bit characters on systems which * support 8-bit characters. Pretty dumb how the cast is required, but * that's legacy libc for ya. These new macros do not support EOF like @@ -191,37 +191,37 @@ APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, * @{ */ /** @see isalnum */ -#define apr_isalnum(c) (isalnum(((unsigned char)(c)))) +#define fspr_isalnum(c) (isalnum(((unsigned char)(c)))) /** @see isalpha */ -#define apr_isalpha(c) (isalpha(((unsigned char)(c)))) +#define fspr_isalpha(c) (isalpha(((unsigned char)(c)))) /** @see iscntrl */ -#define apr_iscntrl(c) (iscntrl(((unsigned char)(c)))) +#define fspr_iscntrl(c) (iscntrl(((unsigned char)(c)))) /** @see isdigit */ -#define apr_isdigit(c) (isdigit(((unsigned char)(c)))) +#define fspr_isdigit(c) (isdigit(((unsigned char)(c)))) /** @see isgraph */ -#define apr_isgraph(c) (isgraph(((unsigned char)(c)))) +#define fspr_isgraph(c) (isgraph(((unsigned char)(c)))) /** @see islower*/ -#define apr_islower(c) (islower(((unsigned char)(c)))) +#define fspr_islower(c) (islower(((unsigned char)(c)))) /** @see isascii */ #ifdef isascii -#define apr_isascii(c) (isascii(((unsigned char)(c)))) +#define fspr_isascii(c) (isascii(((unsigned char)(c)))) #else -#define apr_isascii(c) (((c) & ~0x7f)==0) +#define fspr_isascii(c) (((c) & ~0x7f)==0) #endif /** @see isprint */ -#define apr_isprint(c) (isprint(((unsigned char)(c)))) +#define fspr_isprint(c) (isprint(((unsigned char)(c)))) /** @see ispunct */ -#define apr_ispunct(c) (ispunct(((unsigned char)(c)))) +#define fspr_ispunct(c) (ispunct(((unsigned char)(c)))) /** @see isspace */ -#define apr_isspace(c) (isspace(((unsigned char)(c)))) +#define fspr_isspace(c) (isspace(((unsigned char)(c)))) /** @see isupper */ -#define apr_isupper(c) (isupper(((unsigned char)(c)))) +#define fspr_isupper(c) (isupper(((unsigned char)(c)))) /** @see isxdigit */ -#define apr_isxdigit(c) (isxdigit(((unsigned char)(c)))) +#define fspr_isxdigit(c) (isxdigit(((unsigned char)(c)))) /** @see tolower */ -#define apr_tolower(c) (tolower(((unsigned char)(c)))) +#define fspr_tolower(c) (tolower(((unsigned char)(c)))) /** @see toupper */ -#define apr_toupper(c) (toupper(((unsigned char)(c)))) +#define fspr_toupper(c) (toupper(((unsigned char)(c)))) /** @} */ diff --git a/libs/apr/include/apr_mmap.h b/libs/apr/include/fspr_mmap.h similarity index 76% rename from libs/apr/include/apr_mmap.h rename to libs/apr/include/fspr_mmap.h index 77d697f5b5..88b99b8fe1 100644 --- a/libs/apr/include/apr_mmap.h +++ b/libs/apr/include/fspr_mmap.h @@ -18,15 +18,15 @@ #define APR_MMAP_H /** - * @file apr_mmap.h + * @file fspr_mmap.h * @brief APR MMAP routines */ -#include "apr.h" -#include "apr_pools.h" -#include "apr_errno.h" -#include "apr_ring.h" -#include "apr_file_io.h" /* for apr_file_t */ +#include "fspr.h" +#include "fspr_pools.h" +#include "fspr_errno.h" +#include "fspr_ring.h" +#include "fspr_file_io.h" /* for fspr_file_t */ #ifdef BEOS #include @@ -37,7 +37,7 @@ extern "C" { #endif /* __cplusplus */ /** - * @defgroup apr_mmap MMAP (Memory Map) Routines + * @defgroup fspr_mmap MMAP (Memory Map) Routines * @ingroup APR * @{ */ @@ -47,8 +47,8 @@ extern "C" { /** MMap opened for writing */ #define APR_MMAP_WRITE 2 -/** @see apr_mmap_t */ -typedef struct apr_mmap_t apr_mmap_t; +/** @see fspr_mmap_t */ +typedef struct fspr_mmap_t fspr_mmap_t; /** * @remark @@ -59,9 +59,9 @@ typedef struct apr_mmap_t apr_mmap_t; * Apache. */ /** The MMAP structure */ -struct apr_mmap_t { +struct fspr_mmap_t { /** The pool the mmap structure was allocated out of. */ - apr_pool_t *cntxt; + fspr_pool_t *cntxt; #ifdef BEOS /** An area ID. Only valid on BeOS */ area_id area; @@ -72,17 +72,17 @@ struct apr_mmap_t { /** The start of the real memory page area (mapped view) */ void *mv; /** The physical start, size and offset */ - apr_off_t pstart; - apr_size_t psize; - apr_off_t poffset; + fspr_off_t pstart; + fspr_size_t psize; + fspr_off_t poffset; #endif /** The start of the memory mapped area */ void *mm; /** The amount of data in the mmap */ - apr_size_t size; - /** ring of apr_mmap_t's that reference the same + fspr_size_t size; + /** ring of fspr_mmap_t's that reference the same * mmap'ed region; acts in place of a reference count */ - APR_RING_ENTRY(apr_mmap_t) link; + APR_RING_ENTRY(fspr_mmap_t) link; }; #if APR_HAS_MMAP || defined(DOXYGEN) @@ -130,10 +130,10 @@ struct apr_mmap_t { * * @param cntxt The pool to use when creating the mmap. */ -APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **newmmap, - apr_file_t *file, apr_off_t offset, - apr_size_t size, apr_int32_t flag, - apr_pool_t *cntxt); +APR_DECLARE(fspr_status_t) fspr_mmap_create(fspr_mmap_t **newmmap, + fspr_file_t *file, fspr_off_t offset, + fspr_size_t size, fspr_int32_t flag, + fspr_pool_t *cntxt); /** * Duplicate the specified MMAP. @@ -141,15 +141,15 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **newmmap, * @param old_mmap The mmap to duplicate. * @param p The pool to use for new_mmap. */ -APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap, - apr_mmap_t *old_mmap, - apr_pool_t *p); +APR_DECLARE(fspr_status_t) fspr_mmap_dup(fspr_mmap_t **new_mmap, + fspr_mmap_t *old_mmap, + fspr_pool_t *p); /** * Remove a mmap'ed. * @param mm The mmap'ed file. */ -APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mm); +APR_DECLARE(fspr_status_t) fspr_mmap_delete(fspr_mmap_t *mm); /** * Move the pointer into the mmap'ed file to the specified offset. @@ -157,8 +157,8 @@ APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mm); * @param mm The mmap'ed file. * @param offset The offset to move to. */ -APR_DECLARE(apr_status_t) apr_mmap_offset(void **addr, apr_mmap_t *mm, - apr_off_t offset); +APR_DECLARE(fspr_status_t) fspr_mmap_offset(void **addr, fspr_mmap_t *mm, + fspr_off_t offset); #endif /* APR_HAS_MMAP */ diff --git a/libs/apr/include/apr_network_io.h b/libs/apr/include/fspr_network_io.h similarity index 72% rename from libs/apr/include/apr_network_io.h rename to libs/apr/include/fspr_network_io.h index 1d65f1cb09..384b329143 100644 --- a/libs/apr/include/apr_network_io.h +++ b/libs/apr/include/fspr_network_io.h @@ -17,15 +17,15 @@ #ifndef APR_NETWORK_IO_H #define APR_NETWORK_IO_H /** - * @file apr_network_io.h + * @file fspr_network_io.h * @brief APR Network library */ -#include "apr.h" -#include "apr_pools.h" -#include "apr_file_io.h" -#include "apr_errno.h" -#include "apr_inherit.h" +#include "fspr.h" +#include "fspr_pools.h" +#include "fspr_file_io.h" +#include "fspr_errno.h" +#include "fspr_inherit.h" #if APR_HAVE_NETINET_IN_H #include @@ -36,7 +36,7 @@ extern "C" { #endif /* __cplusplus */ /** - * @defgroup apr_network_io Network Routines + * @defgroup fspr_network_io Network Routines * @ingroup APR * @{ */ @@ -57,7 +57,7 @@ extern "C" { #endif /** - * @defgroup apr_sockopt Socket option definitions + * @defgroup fspr_sockopt Socket option definitions * @{ */ #define APR_SO_LINGER 1 /**< Linger */ @@ -81,7 +81,7 @@ extern "C" { #define APR_INCOMPLETE_READ 4096 /**< Set on non-blocking sockets * (timeout != 0) on which the * previous read() did not fill a buffer - * completely. the next apr_socket_recv() + * completely. the next fspr_socket_recv() * will first call select()/poll() rather than * going straight into read(). (Can also * be set by an application to force a @@ -97,7 +97,7 @@ extern "C" { */ #define APR_TCP_DEFER_ACCEPT 32768 /**< Delay accepting of new connections * until data is available. - * @see apr_socket_accept_filter + * @see fspr_socket_accept_filter */ /** @} */ @@ -107,10 +107,10 @@ typedef enum { APR_SHUTDOWN_READ, /**< no longer allow read request */ APR_SHUTDOWN_WRITE, /**< no longer allow write requests */ APR_SHUTDOWN_READWRITE /**< no longer allow read or write requests */ -} apr_shutdown_how_e; +} fspr_shutdown_how_e; -#define APR_IPV4_ADDR_OK 0x01 /**< @see apr_sockaddr_info_get() */ -#define APR_IPV6_ADDR_OK 0x02 /**< @see apr_sockaddr_info_get() */ +#define APR_IPV4_ADDR_OK 0x01 /**< @see fspr_sockaddr_info_get() */ +#define APR_IPV6_ADDR_OK 0x02 /**< @see fspr_sockaddr_info_get() */ #if (!APR_HAVE_IN_ADDR) /** @@ -118,7 +118,7 @@ typedef enum { * define it ourselves, if the platform doesn't provide it. */ struct in_addr { - apr_uint32_t s_addr; /**< storage to hold the IP# */ + fspr_uint32_t s_addr; /**< storage to hold the IP# */ }; #endif @@ -169,7 +169,7 @@ struct in_addr { typedef enum { APR_LOCAL, APR_REMOTE -} apr_interface_e; +} fspr_interface_e; /** * The specific declaration of inet_addr's ... some platforms fall back @@ -177,49 +177,49 @@ typedef enum { */ #if APR_HAVE_INET_ADDR -#define apr_inet_addr inet_addr +#define fspr_inet_addr inet_addr #elif APR_HAVE_INET_NETWORK /* only DGUX, as far as I know */ /** * @warning * not generally safe... inet_network() and inet_addr() perform * different functions */ -#define apr_inet_addr inet_network +#define fspr_inet_addr inet_network #endif /** A structure to represent sockets */ -typedef struct apr_socket_t apr_socket_t; +typedef struct fspr_socket_t fspr_socket_t; /** - * A structure to encapsulate headers and trailers for apr_socket_sendfile + * A structure to encapsulate headers and trailers for fspr_socket_sendfile */ -typedef struct apr_hdtr_t apr_hdtr_t; +typedef struct fspr_hdtr_t fspr_hdtr_t; /** A structure to represent in_addr */ -typedef struct in_addr apr_in_addr_t; +typedef struct in_addr fspr_in_addr_t; /** A structure to represent an IP subnet */ -typedef struct apr_ipsubnet_t apr_ipsubnet_t; +typedef struct fspr_ipsubnet_t fspr_ipsubnet_t; -/** @remark use apr_uint16_t just in case some system has a short that isn't 16 bits... */ -typedef apr_uint16_t apr_port_t; +/** @remark use fspr_uint16_t just in case some system has a short that isn't 16 bits... */ +typedef fspr_uint16_t fspr_port_t; /** @remark It's defined here as I think it should all be platform safe... - * @see apr_sockaddr_t + * @see fspr_sockaddr_t */ -typedef struct apr_sockaddr_t apr_sockaddr_t; +typedef struct fspr_sockaddr_t fspr_sockaddr_t; /** * APRs socket address type, used to ensure protocol independence */ -struct apr_sockaddr_t { +struct fspr_sockaddr_t { /** The pool to use... */ - apr_pool_t *pool; + fspr_pool_t *pool; /** The hostname */ char *hostname; /** Either a string of the port number or the service name for the port */ char *servname; /** The numeric port */ - apr_port_t port; + fspr_port_t port; /** The family */ - apr_int32_t family; + fspr_int32_t family; /** How big is the sockaddr we're using? */ - apr_socklen_t salen; + fspr_socklen_t salen; /** How big is the ip address structure we're using? */ int ipaddr_len; /** How big should the address buffer be? 16 for v4 or 46 for v6 @@ -228,9 +228,9 @@ struct apr_sockaddr_t { /** This points to the IP address structure within the appropriate * sockaddr structure. */ void *ipaddr_ptr; - /** If multiple addresses were found by apr_sockaddr_info_get(), this + /** If multiple addresses were found by fspr_sockaddr_info_get(), this * points to a representation of the next address. */ - apr_sockaddr_t *next; + fspr_sockaddr_t *next; /** Union of either IPv4 or IPv6 sockaddr. */ union { /** IPv4 sockaddr structure */ @@ -251,13 +251,13 @@ struct apr_sockaddr_t { /** * Support reusing the socket on platforms which support it (from disconnect, * specifically Win32. - * @remark Optional flag passed into apr_socket_sendfile() + * @remark Optional flag passed into fspr_socket_sendfile() */ #define APR_SENDFILE_DISCONNECT_SOCKET 1 #endif -/** A structure to encapsulate headers and trailers for apr_socket_sendfile */ -struct apr_hdtr_t { +/** A structure to encapsulate headers and trailers for fspr_socket_sendfile */ +struct fspr_hdtr_t { /** An iovec to store the headers sent before the file. */ struct iovec* headers; /** number of headers in the iovec */ @@ -278,10 +278,10 @@ struct apr_hdtr_t { * @param protocol The protocol of the socket (e.g., APR_PROTO_TCP). * @param cont The pool to use */ -APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new_sock, +APR_DECLARE(fspr_status_t) fspr_socket_create(fspr_socket_t **new_sock, int family, int type, int protocol, - apr_pool_t *cont); + fspr_pool_t *cont); /** * Shutdown either reading, writing, or both sides of a socket. @@ -292,18 +292,18 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new_sock, * APR_SHUTDOWN_WRITE no longer allow write requests * APR_SHUTDOWN_READWRITE no longer allow read or write requests * - * @see apr_shutdown_how_e + * @see fspr_shutdown_how_e * @remark This does not actually close the socket descriptor, it just * controls which calls are still valid on the socket. */ -APR_DECLARE(apr_status_t) apr_socket_shutdown(apr_socket_t *thesocket, - apr_shutdown_how_e how); +APR_DECLARE(fspr_status_t) fspr_socket_shutdown(fspr_socket_t *thesocket, + fspr_shutdown_how_e how); /** * Close a socket. * @param thesocket The socket to close */ -APR_DECLARE(apr_status_t) apr_socket_close(apr_socket_t *thesocket); +APR_DECLARE(fspr_status_t) fspr_socket_close(fspr_socket_t *thesocket); /** * Bind the socket to its associated port @@ -312,8 +312,8 @@ APR_DECLARE(apr_status_t) apr_socket_close(apr_socket_t *thesocket); * @remark This may be where we will find out if there is any other process * using the selected port. */ -APR_DECLARE(apr_status_t) apr_socket_bind(apr_socket_t *sock, - apr_sockaddr_t *sa); +APR_DECLARE(fspr_status_t) fspr_socket_bind(fspr_socket_t *sock, + fspr_sockaddr_t *sa); /** * Listen to a bound socket for connections. @@ -322,8 +322,8 @@ APR_DECLARE(apr_status_t) apr_socket_bind(apr_socket_t *sock, * listen queue. If this value is less than zero, the listen * queue size is set to zero. */ -APR_DECLARE(apr_status_t) apr_socket_listen(apr_socket_t *sock, - apr_int32_t backlog); +APR_DECLARE(fspr_status_t) fspr_socket_listen(fspr_socket_t *sock, + fspr_int32_t backlog); /** * Accept a new connection request @@ -333,9 +333,9 @@ APR_DECLARE(apr_status_t) apr_socket_listen(apr_socket_t *sock, * @param sock The socket we are listening on. * @param connection_pool The pool for the new socket. */ -APR_DECLARE(apr_status_t) apr_socket_accept(apr_socket_t **new_sock, - apr_socket_t *sock, - apr_pool_t *connection_pool); +APR_DECLARE(fspr_status_t) fspr_socket_accept(fspr_socket_t **new_sock, + fspr_socket_t *sock, + fspr_pool_t *connection_pool); /** * Issue a connection request to a socket either on the same machine @@ -343,12 +343,12 @@ APR_DECLARE(apr_status_t) apr_socket_accept(apr_socket_t **new_sock, * @param sock The socket we wish to use for our side of the connection * @param sa The address of the machine we wish to connect to. */ -APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, - apr_sockaddr_t *sa); +APR_DECLARE(fspr_status_t) fspr_socket_connect(fspr_socket_t *sock, + fspr_sockaddr_t *sa); /** - * Create apr_sockaddr_t from hostname, address family, and port. - * @param sa The new apr_sockaddr_t. + * Create fspr_sockaddr_t from hostname, address family, and port. + * @param sa The new fspr_sockaddr_t. * @param hostname The hostname or numeric address string to resolve/parse, or * NULL to build an address that corresponds to 0.0.0.0 or :: * @param family The address family to use, or APR_UNSPEC if the system should @@ -367,24 +367,24 @@ APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, * isn't NULL and APR_HAVE_IPV6; mutually exclusive * with APR_IPV4_ADDR_OK * - * @param p The pool for the apr_sockaddr_t and associated storage. + * @param p The pool for the fspr_sockaddr_t and associated storage. */ -APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, +APR_DECLARE(fspr_status_t) fspr_sockaddr_info_get(fspr_sockaddr_t **sa, const char *hostname, - apr_int32_t family, - apr_port_t port, - apr_int32_t flags, - apr_pool_t *p); + fspr_int32_t family, + fspr_port_t port, + fspr_int32_t flags, + fspr_pool_t *p); /** - * Look up the host name from an apr_sockaddr_t. + * Look up the host name from an fspr_sockaddr_t. * @param hostname The hostname. - * @param sa The apr_sockaddr_t. + * @param sa The fspr_sockaddr_t. * @param flags Special processing flags. */ -APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, - apr_sockaddr_t *sa, - apr_int32_t flags); +APR_DECLARE(fspr_status_t) fspr_getnameinfo(char **hostname, + fspr_sockaddr_t *sa, + fspr_int32_t flags); /** * Parse hostname/IP address with scope id and port. @@ -416,11 +416,11 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, * required, check for addr == NULL in addition to checking the * return code. */ -APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr, +APR_DECLARE(fspr_status_t) fspr_parse_addr_port(char **addr, char **scope_id, - apr_port_t *port, + fspr_port_t *port, const char *str, - apr_pool_t *p); + fspr_pool_t *p); /** * Get name of the current machine @@ -430,7 +430,7 @@ APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr, * @param cont The pool to use. * @remark If the buffer was not large enough, an error will be returned. */ -APR_DECLARE(apr_status_t) apr_gethostname(char *buf, int len, apr_pool_t *cont); +APR_DECLARE(fspr_status_t) fspr_gethostname(char *buf, int len, fspr_pool_t *cont); /** * Return the data associated with the current socket @@ -438,8 +438,8 @@ APR_DECLARE(apr_status_t) apr_gethostname(char *buf, int len, apr_pool_t *cont); * @param key The key to associate with the user data. * @param sock The currently open socket. */ -APR_DECLARE(apr_status_t) apr_socket_data_get(void **data, const char *key, - apr_socket_t *sock); +APR_DECLARE(fspr_status_t) fspr_socket_data_get(void **data, const char *key, + fspr_socket_t *sock); /** * Set the data associated with the current socket. @@ -448,9 +448,9 @@ APR_DECLARE(apr_status_t) apr_socket_data_get(void **data, const char *key, * @param key The key to associate with the data. * @param cleanup The cleanup to call when the socket is destroyed. */ -APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *sock, void *data, +APR_DECLARE(fspr_status_t) fspr_socket_data_set(fspr_socket_t *sock, void *data, const char *key, - apr_status_t (*cleanup)(void*)); + fspr_status_t (*cleanup)(void*)); /** * Send data over a network. @@ -461,7 +461,7 @@ APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *sock, void *data, * @remark *
      * This functions acts like a blocking write by default.  To change 
    - * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK
    + * this behavior, use fspr_socket_timeout_set() or the APR_SO_NONBLOCK
      * socket option.
      *
      * It is possible for both bytes to be sent and an error to be returned.
    @@ -469,8 +469,8 @@ APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *sock, void *data,
      * APR_EINTR is never returned.
      * 
    */ -APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf, - apr_size_t *len); +APR_DECLARE(fspr_status_t) fspr_socket_send(fspr_socket_t *sock, const char *buf, + fspr_size_t *len); /** * Send multiple packets of data over a network. @@ -481,7 +481,7 @@ APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf, * @remark *
      * This functions acts like a blocking write by default.  To change 
    - * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK
    + * this behavior, use fspr_socket_timeout_set() or the APR_SO_NONBLOCK
      * socket option.
      * The number of bytes actually sent is stored in argument 3.
      *
    @@ -490,34 +490,34 @@ APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf,
      * APR_EINTR is never returned.
      * 
    */ -APR_DECLARE(apr_status_t) apr_socket_sendv(apr_socket_t *sock, +APR_DECLARE(fspr_status_t) fspr_socket_sendv(fspr_socket_t *sock, const struct iovec *vec, - apr_int32_t nvec, apr_size_t *len); + fspr_int32_t nvec, fspr_size_t *len); /** * @param sock The socket to send from - * @param where The apr_sockaddr_t describing where to send the data + * @param where The fspr_sockaddr_t describing where to send the data * @param flags The flags to use * @param buf The data to send * @param len The length of the data to send */ -APR_DECLARE(apr_status_t) apr_socket_sendto(apr_socket_t *sock, - apr_sockaddr_t *where, - apr_int32_t flags, const char *buf, - apr_size_t *len); +APR_DECLARE(fspr_status_t) fspr_socket_sendto(fspr_socket_t *sock, + fspr_sockaddr_t *where, + fspr_int32_t flags, const char *buf, + fspr_size_t *len); /** - * @param from The apr_sockaddr_t to fill in the recipient info + * @param from The fspr_sockaddr_t to fill in the recipient info * @param sock The socket to use * @param flags The flags to use * @param buf The buffer to use * @param len The length of the available buffer */ -APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from, - apr_socket_t *sock, - apr_int32_t flags, char *buf, - apr_size_t *len); +APR_DECLARE(fspr_status_t) fspr_socket_recvfrom(fspr_sockaddr_t *from, + fspr_socket_t *sock, + fspr_int32_t flags, char *buf, + fspr_size_t *len); #if APR_HAS_SENDFILE || defined(DOXYGEN) @@ -533,18 +533,18 @@ APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from, * including headers, file, and trailers * @param flags APR flags that are mapped to OS specific flags * @remark This functions acts like a blocking write by default. To change - * this behavior, use apr_socket_timeout_set() or the + * this behavior, use fspr_socket_timeout_set() or the * APR_SO_NONBLOCK socket option. * The number of bytes actually sent is stored in the len parameter. * The offset parameter is passed by reference for no reason; its - * value will never be modified by the apr_socket_sendfile() function. + * value will never be modified by the fspr_socket_sendfile() function. */ -APR_DECLARE(apr_status_t) apr_socket_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); +APR_DECLARE(fspr_status_t) fspr_socket_sendfile(fspr_socket_t *sock, + fspr_file_t *file, + fspr_hdtr_t *hdtr, + fspr_off_t *offset, + fspr_size_t *len, + fspr_int32_t flags); #endif /* APR_HAS_SENDFILE */ @@ -557,7 +557,7 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, * @remark *
      * This functions acts like a blocking read by default.  To change 
    - * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK
    + * this behavior, use fspr_socket_timeout_set() or the APR_SO_NONBLOCK
      * socket option.
      * The number of bytes actually received is stored in argument 3.
      *
    @@ -567,8 +567,8 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock,
      * APR_EINTR is never returned.
      * 
    */ -APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock, - char *buf, apr_size_t *len); +APR_DECLARE(fspr_status_t) fspr_socket_recv(fspr_socket_t *sock, + char *buf, fspr_size_t *len); /** * Setup socket options for the specified socket @@ -592,8 +592,8 @@ APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock, * * @param on Value for the option. */ -APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, - apr_int32_t opt, apr_int32_t on); +APR_DECLARE(fspr_status_t) fspr_socket_opt_set(fspr_socket_t *sock, + fspr_int32_t opt, fspr_int32_t on); /** * Setup socket timeout for the specified socket @@ -606,8 +606,8 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, * t < 0 -- read and write calls block * */ -APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, - apr_interval_time_t t); +APR_DECLARE(fspr_status_t) fspr_socket_timeout_set(fspr_socket_t *sock, + fspr_interval_time_t t); /** * Query socket options for the specified socket @@ -628,14 +628,14 @@ APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, * * @param on Socket option returned on the call. */ -APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock, - apr_int32_t opt, apr_int32_t *on); +APR_DECLARE(fspr_status_t) fspr_socket_opt_get(fspr_socket_t *sock, + fspr_int32_t opt, fspr_int32_t *on); /** * Get Socket fd for the socket passed * @param sock The socket to quesry for the socket fd */ -APR_DECLARE(int) apr_socket_fd_get(apr_socket_t *sock); +APR_DECLARE(int) fspr_socket_fd_get(fspr_socket_t *sock); /** @@ -643,8 +643,8 @@ APR_DECLARE(int) apr_socket_fd_get(apr_socket_t *sock); * @param sock The socket to query * @param t Socket timeout returned from the query. */ -APR_DECLARE(apr_status_t) apr_socket_timeout_get(apr_socket_t *sock, - apr_interval_time_t *t); +APR_DECLARE(fspr_status_t) fspr_socket_timeout_get(fspr_socket_t *sock, + fspr_interval_time_t *t); /** * Query the specified socket if at the OOB/Urgent data mark @@ -652,28 +652,28 @@ APR_DECLARE(apr_status_t) apr_socket_timeout_get(apr_socket_t *sock, * @param atmark Is set to true if socket is at the OOB/urgent mark, * otherwise is set to false. */ -APR_DECLARE(apr_status_t) apr_socket_atmark(apr_socket_t *sock, +APR_DECLARE(fspr_status_t) fspr_socket_atmark(fspr_socket_t *sock, int *atmark); /** - * Return an apr_sockaddr_t from an apr_socket_t - * @param sa The returned apr_sockaddr_t. - * @param which Which interface do we want the apr_sockaddr_t for? + * Return an fspr_sockaddr_t from an fspr_socket_t + * @param sa The returned fspr_sockaddr_t. + * @param which Which interface do we want the fspr_sockaddr_t for? * @param sock The socket to use */ -APR_DECLARE(apr_status_t) apr_socket_addr_get(apr_sockaddr_t **sa, - apr_interface_e which, - apr_socket_t *sock); +APR_DECLARE(fspr_status_t) fspr_socket_addr_get(fspr_sockaddr_t **sa, + fspr_interface_e which, + fspr_socket_t *sock); /** * Return the IP address (in numeric address string format) in * an APR socket address. APR will allocate storage for the IP address - * string from the pool of the apr_sockaddr_t. + * string from the pool of the fspr_sockaddr_t. * @param addr The IP address. * @param sockaddr The socket address to reference. */ -APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr, - apr_sockaddr_t *sockaddr); +APR_DECLARE(fspr_status_t) fspr_sockaddr_ip_get(char **addr, + fspr_sockaddr_t *sockaddr); /** * See if the IP addresses in two APR socket addresses are @@ -685,23 +685,23 @@ APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr, * @remark The return value will be non-zero if the addresses * are equivalent. */ -APR_DECLARE(int) apr_sockaddr_equal(const apr_sockaddr_t *addr1, - const apr_sockaddr_t *addr2); +APR_DECLARE(int) fspr_sockaddr_equal(const fspr_sockaddr_t *addr1, + const fspr_sockaddr_t *addr2); /** * Return the type of the socket. * @param sock The socket to query. * @param type The returned type (e.g., SOCK_STREAM). */ -APR_DECLARE(apr_status_t) apr_socket_type_get(apr_socket_t *sock, +APR_DECLARE(fspr_status_t) fspr_socket_type_get(fspr_socket_t *sock, int *type); /** - * Given an apr_sockaddr_t and a service name, set the port for the service - * @param sockaddr The apr_sockaddr_t that will have its port set + * Given an fspr_sockaddr_t and a service name, set the port for the service + * @param sockaddr The fspr_sockaddr_t that will have its port set * @param servname The name of the service you wish to use */ -APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr, +APR_DECLARE(fspr_status_t) fspr_getservbyname(fspr_sockaddr_t *sockaddr, const char *servname); /** * Build an ip-subnet representation from an IP address and optional netmask or @@ -711,19 +711,19 @@ APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr, * @param mask_or_numbits The input netmask or number-of-bits string, or NULL * @param p The pool to allocate from */ -APR_DECLARE(apr_status_t) apr_ipsubnet_create(apr_ipsubnet_t **ipsub, +APR_DECLARE(fspr_status_t) fspr_ipsubnet_create(fspr_ipsubnet_t **ipsub, const char *ipstr, const char *mask_or_numbits, - apr_pool_t *p); + fspr_pool_t *p); /** - * Test the IP address in an apr_sockaddr_t against a pre-built ip-subnet + * Test the IP address in an fspr_sockaddr_t against a pre-built ip-subnet * representation. * @param ipsub The ip-subnet representation * @param sa The socket address to test * @return non-zero if the socket address is within the subnet, 0 otherwise */ -APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa); +APR_DECLARE(int) fspr_ipsubnet_test(fspr_ipsubnet_t *ipsub, fspr_sockaddr_t *sa); #if APR_HAS_SO_ACCEPTFILTER || defined(DOXYGEN) /** @@ -733,7 +733,7 @@ APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa); * @param args Any extra args to the accept filter. Passing NULL here removes * the accept filter. */ -apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name, +fspr_status_t fspr_socket_accept_filter(fspr_socket_t *sock, char *name, char *args); #endif @@ -742,7 +742,7 @@ apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name, * @param sock The socket to query. * @param protocol The returned protocol (e.g., APR_PROTO_TCP). */ -APR_DECLARE(apr_status_t) apr_socket_protocol_get(apr_socket_t *sock, +APR_DECLARE(fspr_status_t) fspr_socket_protocol_get(fspr_socket_t *sock, int *protocol); /** @@ -761,7 +761,7 @@ APR_DECLARE_INHERIT_SET(socket); APR_DECLARE_INHERIT_UNSET(socket); /** - * @defgroup apr_mcast IP Multicast + * @defgroup fspr_mcast IP Multicast * @{ */ @@ -774,14 +774,14 @@ APR_DECLARE_INHERIT_UNSET(socket); * @param source Source Address to accept transmissions from (non-NULL * implies Source-Specific Multicast) */ -APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock, - apr_sockaddr_t *join, - apr_sockaddr_t *iface, - apr_sockaddr_t *source); +APR_DECLARE(fspr_status_t) fspr_mcast_join(fspr_socket_t *sock, + fspr_sockaddr_t *join, + fspr_sockaddr_t *iface, + fspr_sockaddr_t *source); /** * Leave a Multicast Group. All arguments must be the same as - * apr_mcast_join. + * fspr_mcast_join. * @param sock The socket to leave a multicast group * @param addr The address of the multicast group to leave * @param iface Address of the interface to use. If NULL is passed, the @@ -789,10 +789,10 @@ APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock, * @param source Source Address to accept transmissions from (non-NULL * implies Source-Specific Multicast) */ -APR_DECLARE(apr_status_t) apr_mcast_leave(apr_socket_t *sock, - apr_sockaddr_t *addr, - apr_sockaddr_t *iface, - apr_sockaddr_t *source); +APR_DECLARE(fspr_status_t) fspr_mcast_leave(fspr_socket_t *sock, + fspr_sockaddr_t *addr, + fspr_sockaddr_t *iface, + fspr_sockaddr_t *source); /** * Set the Multicast Time to Live (ttl) for a multicast transmission. @@ -801,16 +801,16 @@ APR_DECLARE(apr_status_t) apr_mcast_leave(apr_socket_t *sock, * @remark If the TTL is 0, packets will only be seen by sockets on * the local machine, and only when multicast loopback is enabled. */ -APR_DECLARE(apr_status_t) apr_mcast_hops(apr_socket_t *sock, - apr_byte_t ttl); +APR_DECLARE(fspr_status_t) fspr_mcast_hops(fspr_socket_t *sock, + fspr_byte_t ttl); /** * Toggle IP Multicast Loopback * @param sock The socket to set multicast loopback * @param opt 0=disable, 1=enable */ -APR_DECLARE(apr_status_t) apr_mcast_loopback(apr_socket_t *sock, - apr_byte_t opt); +APR_DECLARE(fspr_status_t) fspr_mcast_loopback(fspr_socket_t *sock, + fspr_byte_t opt); /** @@ -818,8 +818,8 @@ APR_DECLARE(apr_status_t) apr_mcast_loopback(apr_socket_t *sock, * @param sock The socket to set the multicast interface on * @param iface Address of the interface to use for Multicast */ -APR_DECLARE(apr_status_t) apr_mcast_interface(apr_socket_t *sock, - apr_sockaddr_t *iface); +APR_DECLARE(fspr_status_t) fspr_mcast_interface(fspr_socket_t *sock, + fspr_sockaddr_t *iface); /** @} */ diff --git a/libs/apr/include/apr_poll.h b/libs/apr/include/fspr_poll.h similarity index 65% rename from libs/apr/include/apr_poll.h rename to libs/apr/include/fspr_poll.h index c5266495f9..a3fa5c42f2 100644 --- a/libs/apr/include/apr_poll.h +++ b/libs/apr/include/fspr_poll.h @@ -17,15 +17,15 @@ #ifndef APR_POLL_H #define APR_POLL_H /** - * @file apr_poll.h + * @file fspr_poll.h * @brief APR Poll interface */ -#include "apr.h" -#include "apr_pools.h" -#include "apr_errno.h" -#include "apr_inherit.h" -#include "apr_file_io.h" -#include "apr_network_io.h" +#include "fspr.h" +#include "fspr_pools.h" +#include "fspr_errno.h" +#include "fspr_inherit.h" +#include "fspr_file_io.h" +#include "fspr_network_io.h" #if APR_HAVE_NETINET_IN_H #include @@ -36,7 +36,7 @@ extern "C" { #endif /* __cplusplus */ /** - * @defgroup apr_poll Poll Routines + * @defgroup fspr_poll Poll Routines * @ingroup APR * @{ */ @@ -56,30 +56,30 @@ extern "C" { */ #define APR_POLLSET_THREADSAFE 0x001 /**< Adding or Removing a Descriptor is thread safe */ -/** Used in apr_pollfd_t to determine what the apr_descriptor is */ +/** Used in fspr_pollfd_t to determine what the fspr_descriptor is */ typedef enum { APR_NO_DESC, /**< nothing here */ APR_POLL_SOCKET, /**< descriptor refers to a socket */ APR_POLL_FILE, /**< descriptor refers to a file */ APR_POLL_LASTDESC /**< descriptor is the last one in the list */ -} apr_datatype_e ; +} fspr_datatype_e ; /** Union of either an APR file or socket. */ typedef union { - apr_file_t *f; /**< file */ - apr_socket_t *s; /**< socket */ -} apr_descriptor; + fspr_file_t *f; /**< file */ + fspr_socket_t *s; /**< socket */ +} fspr_descriptor; -/** @see apr_pollfd_t */ -typedef struct apr_pollfd_t apr_pollfd_t; +/** @see fspr_pollfd_t */ +typedef struct fspr_pollfd_t fspr_pollfd_t; /** Poll descriptor set. */ -struct apr_pollfd_t { - apr_pool_t *p; /**< associated pool */ - apr_datatype_e desc_type; /**< descriptor type */ - apr_int16_t reqevents; /**< requested events */ - apr_int16_t rtnevents; /**< returned events */ - apr_descriptor desc; /**< @see apr_descriptor */ +struct fspr_pollfd_t { + fspr_pool_t *p; /**< associated pool */ + fspr_datatype_e desc_type; /**< descriptor type */ + fspr_int16_t reqevents; /**< requested events */ + fspr_int16_t rtnevents; /**< returned events */ + fspr_descriptor desc; /**< @see fspr_descriptor */ void *client_data; /**< allows app to associate context */ }; @@ -89,7 +89,7 @@ struct apr_pollfd_t { */ /** Opaque structure used for pollset API */ -typedef struct apr_pollset_t apr_pollset_t; +typedef struct fspr_pollset_t fspr_pollset_t; /** * Setup a pollset object @@ -100,21 +100,21 @@ typedef struct apr_pollset_t apr_pollset_t; * * @remark If flags equals APR_POLLSET_THREADSAFE, then a pollset is * created on which it is safe to make concurrent calls to - * apr_pollset_add(), apr_pollset_remove() and apr_pollset_poll() from + * fspr_pollset_add(), fspr_pollset_remove() and fspr_pollset_poll() from * separate threads. This feature is only supported on some - * platforms; the apr_pollset_create() call will fail with + * platforms; the fspr_pollset_create() call will fail with * APR_ENOTIMPL on platforms where it is not supported. */ -APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, - apr_uint32_t size, - apr_pool_t *p, - apr_uint32_t flags); +APR_DECLARE(fspr_status_t) fspr_pollset_create(fspr_pollset_t **pollset, + fspr_uint32_t size, + fspr_pool_t *p, + fspr_uint32_t flags); /** * Destroy a pollset object * @param pollset The pollset to destroy */ -APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset); +APR_DECLARE(fspr_status_t) fspr_pollset_destroy(fspr_pollset_t *pollset); /** * Add a socket or file descriptor to a pollset @@ -122,36 +122,36 @@ APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset); * @param descriptor The descriptor to add * @remark If you set client_data in the descriptor, that value * will be returned in the client_data field whenever this - * descriptor is signalled in apr_pollset_poll(). + * descriptor is signalled in fspr_pollset_poll(). * @remark If the pollset has been created with APR_POLLSET_THREADSAFE - * and thread T1 is blocked in a call to apr_pollset_poll() for - * this same pollset that is being modified via apr_pollset_add() - * in thread T2, the currently executing apr_pollset_poll() call in + * and thread T1 is blocked in a call to fspr_pollset_poll() for + * this same pollset that is being modified via fspr_pollset_add() + * in thread T2, the currently executing fspr_pollset_poll() call in * T1 will either: (1) automatically include the newly added descriptor * in the set of descriptors it is watching or (2) return immediately * with APR_EINTR. Option (1) is recommended, but option (2) is * allowed for implementations where option (1) is impossible * or impractical. */ -APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, - const apr_pollfd_t *descriptor); +APR_DECLARE(fspr_status_t) fspr_pollset_add(fspr_pollset_t *pollset, + const fspr_pollfd_t *descriptor); /** * Remove a descriptor from a pollset * @param pollset The pollset from which to remove the descriptor * @param descriptor The descriptor to remove * @remark If the pollset has been created with APR_POLLSET_THREADSAFE - * and thread T1 is blocked in a call to apr_pollset_poll() for - * this same pollset that is being modified via apr_pollset_remove() - * in thread T2, the currently executing apr_pollset_poll() call in + * and thread T1 is blocked in a call to fspr_pollset_poll() for + * this same pollset that is being modified via fspr_pollset_remove() + * in thread T2, the currently executing fspr_pollset_poll() call in * T1 will either: (1) automatically exclude the newly added descriptor * in the set of descriptors it is watching or (2) return immediately * with APR_EINTR. Option (1) is recommended, but option (2) is * allowed for implementations where option (1) is impossible * or impractical. */ -APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, - const apr_pollfd_t *descriptor); +APR_DECLARE(fspr_status_t) fspr_pollset_remove(fspr_pollset_t *pollset, + const fspr_pollfd_t *descriptor); /** * Block for activity on the descriptor(s) in a pollset @@ -160,10 +160,10 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, * @param num Number of signalled descriptors (output parameter) * @param descriptors Array of signalled descriptors (output parameter) */ -APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, - apr_interval_time_t timeout, - apr_int32_t *num, - const apr_pollfd_t **descriptors); +APR_DECLARE(fspr_status_t) fspr_pollset_poll(fspr_pollset_t *pollset, + fspr_interval_time_t timeout, + fspr_int32_t *num, + const fspr_pollfd_t **descriptors); /** @@ -178,12 +178,12 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, * @remark The number of descriptors signalled is returned in the third argument. * This is a blocking call, and it will not return until either a * descriptor has been signalled, or the timeout has expired. - * @remark The rtnevents field in the apr_pollfd_t array will only be filled- + * @remark The rtnevents field in the fspr_pollfd_t array will only be filled- * in if the return value is APR_SUCCESS. */ -APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t numsock, - apr_int32_t *nsds, - apr_interval_time_t timeout); +APR_DECLARE(fspr_status_t) fspr_poll(fspr_pollfd_t *aprset, fspr_int32_t numsock, + fspr_int32_t *nsds, + fspr_interval_time_t timeout); /** @} */ diff --git a/libs/apr/include/apr_pools.h b/libs/apr/include/fspr_pools.h similarity index 70% rename from libs/apr/include/apr_pools.h rename to libs/apr/include/fspr_pools.h index 9b7f15685a..5764b96d16 100644 --- a/libs/apr/include/apr_pools.h +++ b/libs/apr/include/fspr_pools.h @@ -18,7 +18,7 @@ #define APR_POOLS_H /** - * @file apr_pools.h + * @file fspr_pools.h * @brief APR memory allocation * * Resource allocation routines... @@ -30,61 +30,61 @@ * 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 apr_pool_t without fear, + * we can delete everything in the per-transaction fspr_pool_t without fear, * and without thinking too hard about it either. */ -#include "apr.h" -#include "apr_errno.h" -#include "apr_general.h" /* for APR_STRINGIFY */ +#include "fspr.h" +#include "fspr_errno.h" +#include "fspr_general.h" /* for APR_STRINGIFY */ #define APR_WANT_MEMFUNC /**< for no good reason? */ -#include "apr_want.h" +#include "fspr_want.h" #ifdef __cplusplus extern "C" { #endif /** - * @defgroup apr_pools Memory Pool Functions + * @defgroup fspr_pools Memory Pool Functions * @ingroup APR * @{ */ /** The fundamental pool type */ -typedef struct apr_pool_t apr_pool_t; +typedef struct fspr_pool_t fspr_pool_t; /** - * Declaration helper macro to construct apr_foo_pool_get()s. + * Declaration helper macro to construct fspr_foo_pool_get()s. * * This standardized macro is used by opaque (APR) data types to return - * the apr_pool_t that is associated with the data type. + * the fspr_pool_t that is associated with the data type. * * APR_POOL_DECLARE_ACCESSOR() is used in a header file to declare the * accessor function. A typical usage and result would be: *
      *    APR_POOL_DECLARE_ACCESSOR(file);
      * becomes:
    - *    APR_DECLARE(apr_pool_t *) apr_file_pool_get(apr_file_t *ob);
    + *    APR_DECLARE(fspr_pool_t *) fspr_file_pool_get(fspr_file_t *ob);
      * 
    * @remark Doxygen unwraps this macro (via doxygen.conf) to provide - * actual help for each specific occurance of apr_foo_pool_get. + * actual help for each specific occurance of fspr_foo_pool_get. * @remark the linkage is specified for APR. It would be possible to expand * the macros to support other linkages. */ #define APR_POOL_DECLARE_ACCESSOR(type) \ - APR_DECLARE(apr_pool_t *) apr_##type##_pool_get \ - (const apr_##type##_t *the##type) + APR_DECLARE(fspr_pool_t *) fspr_##type##_pool_get \ + (const fspr_##type##_t *the##type) /** - * Implementation helper macro to provide apr_foo_pool_get()s. + * Implementation helper macro to provide fspr_foo_pool_get()s. * * In the implementation, the APR_POOL_IMPLEMENT_ACCESSOR() is used to * actually define the function. It assumes the field is named "pool". */ #define APR_POOL_IMPLEMENT_ACCESSOR(type) \ - APR_DECLARE(apr_pool_t *) apr_##type##_pool_get \ - (const apr_##type##_t *the##type) \ + APR_DECLARE(fspr_pool_t *) fspr_##type##_pool_get \ + (const fspr_##type##_t *the##type) \ { return the##type->pool; } @@ -116,7 +116,7 @@ typedef struct apr_pool_t apr_pool_t; * combination with the verbose flag above, * it will output OWNER in such an event * prior to aborting. Use the debug - * function apr_pool_owner_set() to switch + * function fspr_pool_owner_set() to switch * a pools ownership. * * When no debug level was specified, assume general debug mode. @@ -139,7 +139,7 @@ typedef struct apr_pool_t apr_pool_t; /** A function that is called when allocation fails. */ -typedef int (*apr_abortfunc_t)(int retcode); +typedef int (*fspr_abortfunc_t)(int retcode); /* * APR memory structure manipulators (pools, tables, and arrays). @@ -152,74 +152,74 @@ typedef int (*apr_abortfunc_t)(int retcode); /** * Setup all of the internal structures required to use pools * @remark Programs do NOT need to call this directly. APR will call this - * automatically from apr_initialize. + * automatically from fspr_initialize. * @internal */ -APR_DECLARE(apr_status_t) apr_pool_initialize(void); +APR_DECLARE(fspr_status_t) fspr_pool_initialize(void); /** * Tear down all of the internal structures required to use pools * @remark Programs do NOT need to call this directly. APR will call this - * automatically from apr_terminate. + * automatically from fspr_terminate. * @internal */ -APR_DECLARE(void) apr_pool_terminate(void); +APR_DECLARE(void) fspr_pool_terminate(void); /* * Pool creation/destruction */ -#include "apr_allocator.h" +#include "fspr_allocator.h" /** * Create a new pool. * @param newpool The pool we have just created. * @param parent 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 its parent pool's attributes, except the apr_pool_t will + * of its parent pool's attributes, except the fspr_pool_t will * be a sub-pool. * @param abort_fn A function to use if the pool cannot allocate more memory. * @param allocator The allocator to use with the new pool. If NULL the * allocator of the parent pool will be used. */ -APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, - apr_pool_t *parent, - apr_abortfunc_t abort_fn, - apr_allocator_t *allocator); +APR_DECLARE(fspr_status_t) fspr_pool_create_ex(fspr_pool_t **newpool, + fspr_pool_t *parent, + fspr_abortfunc_t abort_fn, + fspr_allocator_t *allocator); /** - * Debug version of apr_pool_create_ex. - * @param newpool @see apr_pool_create. - * @param parent @see apr_pool_create. - * @param abort_fn @see apr_pool_create. - * @param allocator @see apr_pool_create. + * Debug version of fspr_pool_create_ex. + * @param newpool @see fspr_pool_create. + * @param parent @see fspr_pool_create. + * @param abort_fn @see fspr_pool_create. + * @param allocator @see fspr_pool_create. * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. * @remark Only available when APR_POOL_DEBUG is defined. - * Call this directly if you have you apr_pool_create_ex + * Call this directly if you have you fspr_pool_create_ex * calls in a wrapper function and wish to override * the file_line argument to reflect the caller of * your wrapper function. If you do not have - * apr_pool_create_ex in a wrapper, trust the macro - * and don't call apr_pool_create_ex_debug directly. + * fspr_pool_create_ex in a wrapper, trust the macro + * and don't call fspr_pool_create_ex_debug directly. */ -APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, - apr_pool_t *parent, - apr_abortfunc_t abort_fn, - apr_allocator_t *allocator, +APR_DECLARE(fspr_status_t) fspr_pool_create_ex_debug(fspr_pool_t **newpool, + fspr_pool_t *parent, + fspr_abortfunc_t abort_fn, + fspr_allocator_t *allocator, const char *file_line); #if APR_POOL_DEBUG -#define apr_pool_create_ex(newpool, parent, abort_fn, allocator) \ - apr_pool_create_ex_debug(newpool, parent, abort_fn, allocator, \ +#define fspr_pool_create_ex(newpool, parent, abort_fn, allocator) \ + fspr_pool_create_ex_debug(newpool, parent, abort_fn, allocator, \ APR_POOL__FILE_LINE__) -APR_DECLARE(int) apr_pool_walk_tree_debug(apr_pool_t *pool, - int(*fn)(apr_pool_t *pool, void *data), +APR_DECLARE(int) fspr_pool_walk_tree_debug(fspr_pool_t *pool, + int(*fn)(fspr_pool_t *pool, void *data), void *data); -APR_DECLARE(void) apr_pool_get_stats(apr_pool_t *pool, unsigned int *alloc, unsigned int *total_alloc, unsigned int *clear); +APR_DECLARE(void) fspr_pool_get_stats(fspr_pool_t *pool, unsigned int *alloc, unsigned int *total_alloc, unsigned int *clear); #endif /** @@ -227,20 +227,20 @@ APR_DECLARE(void) apr_pool_get_stats(apr_pool_t *pool, unsigned int *alloc, unsi * @param newpool The pool we have just created. * @param parent 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 its parent pool's attributes, except the apr_pool_t will + * of its parent pool's attributes, except the fspr_pool_t will * be a sub-pool. */ #if defined(DOXYGEN) -APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, - apr_pool_t *parent); +APR_DECLARE(fspr_status_t) fspr_pool_create(fspr_pool_t **newpool, + fspr_pool_t *parent); #else #if APR_POOL_DEBUG -#define apr_pool_create(newpool, parent) \ - apr_pool_create_ex_debug(newpool, parent, NULL, NULL, \ +#define fspr_pool_create(newpool, parent) \ + fspr_pool_create_ex_debug(newpool, parent, NULL, NULL, \ APR_POOL__FILE_LINE__) #else -#define apr_pool_create(newpool, parent) \ - apr_pool_create_ex(newpool, parent, NULL, NULL) +#define fspr_pool_create(newpool, parent) \ + fspr_pool_create_ex(newpool, parent, NULL, NULL) #endif #endif @@ -248,7 +248,7 @@ APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, * Find the pools allocator * @param pool The pool to get the allocator from. */ -APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool); +APR_DECLARE(fspr_allocator_t *) fspr_pool_allocator_get(fspr_pool_t *pool); /** * Clear all memory in the pool and run all the cleanups. This also destroys all @@ -256,58 +256,58 @@ APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool); * @param p The pool to clear * @remark This does not actually free the memory, it just allows the pool * to re-use this memory for the next allocation. - * @see apr_pool_destroy() + * @see fspr_pool_destroy() */ -APR_DECLARE(void) apr_pool_clear(apr_pool_t *p); +APR_DECLARE(void) fspr_pool_clear(fspr_pool_t *p); /** - * Debug version of apr_pool_clear. - * @param p See: apr_pool_clear. + * Debug version of fspr_pool_clear. + * @param p See: fspr_pool_clear. * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. * @remark Only available when APR_POOL_DEBUG is defined. - * Call this directly if you have you apr_pool_clear + * Call this directly if you have you fspr_pool_clear * calls in a wrapper function and wish to override * the file_line argument to reflect the caller of * your wrapper function. If you do not have - * apr_pool_clear in a wrapper, trust the macro - * and don't call apr_pool_destroy_clear directly. + * fspr_pool_clear in a wrapper, trust the macro + * and don't call fspr_pool_destroy_clear directly. */ -APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *p, +APR_DECLARE(void) fspr_pool_clear_debug(fspr_pool_t *p, const char *file_line); #if APR_POOL_DEBUG -#define apr_pool_clear(p) \ - apr_pool_clear_debug(p, APR_POOL__FILE_LINE__) +#define fspr_pool_clear(p) \ + fspr_pool_clear_debug(p, APR_POOL__FILE_LINE__) #endif /** - * Destroy the pool. This takes similar action as apr_pool_clear() and then + * Destroy the pool. This takes similar action as fspr_pool_clear() and then * frees all the memory. * @param p The pool to destroy * @remark This will actually free the memory */ -APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p); +APR_DECLARE(void) fspr_pool_destroy(fspr_pool_t *p); /** - * Debug version of apr_pool_destroy. - * @param p See: apr_pool_destroy. + * Debug version of fspr_pool_destroy. + * @param p See: fspr_pool_destroy. * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. * @remark Only available when APR_POOL_DEBUG is defined. - * Call this directly if you have you apr_pool_destroy + * Call this directly if you have you fspr_pool_destroy * calls in a wrapper function and wish to override * the file_line argument to reflect the caller of * your wrapper function. If you do not have - * apr_pool_destroy in a wrapper, trust the macro - * and don't call apr_pool_destroy_debug directly. + * fspr_pool_destroy in a wrapper, trust the macro + * and don't call fspr_pool_destroy_debug directly. */ -APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *p, +APR_DECLARE(void) fspr_pool_destroy_debug(fspr_pool_t *p, const char *file_line); #if APR_POOL_DEBUG -#define apr_pool_destroy(p) \ - apr_pool_destroy_debug(p, APR_POOL__FILE_LINE__) +#define fspr_pool_destroy(p) \ + fspr_pool_destroy_debug(p, APR_POOL__FILE_LINE__) #endif @@ -321,22 +321,22 @@ APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *p, * @param size The amount of memory to allocate * @return The allocated memory */ -APR_DECLARE(void *) apr_palloc(apr_pool_t *p, apr_size_t size); +APR_DECLARE(void *) fspr_palloc(fspr_pool_t *p, fspr_size_t size); /** - * Debug version of apr_palloc - * @param p See: apr_palloc - * @param size See: apr_palloc + * Debug version of fspr_palloc + * @param p See: fspr_palloc + * @param size See: fspr_palloc * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. - * @return See: apr_palloc + * @return See: fspr_palloc */ -APR_DECLARE(void *) apr_palloc_debug(apr_pool_t *p, apr_size_t size, +APR_DECLARE(void *) fspr_palloc_debug(fspr_pool_t *p, fspr_size_t size, const char *file_line); #if APR_POOL_DEBUG -#define apr_palloc(p, size) \ - apr_palloc_debug(p, size, APR_POOL__FILE_LINE__) +#define fspr_palloc(p, size) \ + fspr_palloc_debug(p, size, APR_POOL__FILE_LINE__) #endif /** @@ -346,25 +346,25 @@ APR_DECLARE(void *) apr_palloc_debug(apr_pool_t *p, apr_size_t size, * @return The allocated memory */ #if defined(DOXYGEN) -APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); +APR_DECLARE(void *) fspr_pcalloc(fspr_pool_t *p, fspr_size_t size); #elif !APR_POOL_DEBUG -#define apr_pcalloc(p, size) memset(apr_palloc(p, size), 0, size) +#define fspr_pcalloc(p, size) memset(fspr_palloc(p, size), 0, size) #endif /** - * Debug version of apr_pcalloc - * @param p See: apr_pcalloc - * @param size See: apr_pcalloc + * Debug version of fspr_pcalloc + * @param p See: fspr_pcalloc + * @param size See: fspr_pcalloc * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. - * @return See: apr_pcalloc + * @return See: fspr_pcalloc */ -APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *p, apr_size_t size, +APR_DECLARE(void *) fspr_pcalloc_debug(fspr_pool_t *p, fspr_size_t size, const char *file_line); #if APR_POOL_DEBUG -#define apr_pcalloc(p, size) \ - apr_pcalloc_debug(p, size, APR_POOL__FILE_LINE__) +#define fspr_pcalloc(p, size) \ + fspr_pcalloc_debug(p, size, APR_POOL__FILE_LINE__) #endif @@ -380,22 +380,22 @@ APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *p, apr_size_t size, * then APR will return an error and expect the calling program to * deal with the error accordingly. */ -APR_DECLARE(void) apr_pool_abort_set(apr_abortfunc_t abortfunc, - apr_pool_t *pool); +APR_DECLARE(void) fspr_pool_abort_set(fspr_abortfunc_t abortfunc, + fspr_pool_t *pool); /** * Get the abort function associated with the specified pool. * @param pool The pool for retrieving the abort function. * @return The abort function for the given pool. */ -APR_DECLARE(apr_abortfunc_t) apr_pool_abort_get(apr_pool_t *pool); +APR_DECLARE(fspr_abortfunc_t) fspr_pool_abort_get(fspr_pool_t *pool); /** * Get the parent pool of the specified pool. * @param pool The pool for retrieving the parent pool. * @return The parent of the given pool. */ -APR_DECLARE(apr_pool_t *) apr_pool_parent_get(apr_pool_t *pool); +APR_DECLARE(fspr_pool_t *) fspr_pool_parent_get(fspr_pool_t *pool); /** * Determine if pool a is an ancestor of pool b. @@ -405,17 +405,17 @@ APR_DECLARE(apr_pool_t *) apr_pool_parent_get(apr_pool_t *pool); * of all pools. * @remark if compiled with APR_POOL_DEBUG, this function will also * return true if A is a pool which has been guaranteed by the caller - * (using apr_pool_join) to have a lifetime at least as long as some + * (using fspr_pool_join) to have a lifetime at least as long as some * ancestor of pool B. */ -APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); +APR_DECLARE(int) fspr_pool_is_ancestor(fspr_pool_t *a, fspr_pool_t *b); /** * Tag a pool (give it a name) * @param pool The pool to tag * @param tag The tag */ -APR_DECLARE(const char *) apr_pool_tag(apr_pool_t *pool, const char *tag); +APR_DECLARE(const char *) fspr_pool_tag(fspr_pool_t *pool, const char *tag); #if APR_HAS_THREADS /** @@ -424,8 +424,8 @@ APR_DECLARE(const char *) apr_pool_tag(apr_pool_t *pool, const char *tag); * @param mutex The mutex * @remark The mutex does not protect the destroy operation just the low level allocs. */ -APR_DECLARE(void) apr_pool_mutex_set(apr_pool_t *pool, - apr_thread_mutex_t *mutex); +APR_DECLARE(void) fspr_pool_mutex_set(fspr_pool_t *pool, + fspr_thread_mutex_t *mutex); #endif @@ -453,11 +453,11 @@ APR_DECLARE(void) apr_pool_mutex_set(apr_pool_t *pool, * */ -APR_DECLARE(apr_status_t) apr_pool_userdata_set( +APR_DECLARE(fspr_status_t) fspr_pool_userdata_set( const void *data, const char *key, - apr_status_t (*cleanup)(void *), - apr_pool_t *pool); + fspr_status_t (*cleanup)(void *), + fspr_pool_t *pool); /** * Set the data associated with the current pool @@ -465,24 +465,24 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_set( * @param key The key to use for association * @param cleanup The cleanup program to use to cleanup the data (NULL if none) * @param pool The current pool - * @note same as apr_pool_userdata_set(), except that this version doesn't + * @note same as fspr_pool_userdata_set(), except that this version doesn't * make a copy of the key (this function is useful, for example, when * the key is a string literal) * @warning This should NOT be used if the key could change addresses by - * any means between the apr_pool_userdata_setn() call and a - * subsequent apr_pool_userdata_get() on that key, such as if a + * any means between the fspr_pool_userdata_setn() call and a + * subsequent fspr_pool_userdata_get() on that key, such as if a * static string is used as a userdata key in a DSO and the DSO could * be unloaded and reloaded between the _setn() and the _get(). You - * MUST use apr_pool_userdata_set() in such cases. + * MUST use fspr_pool_userdata_set() in such cases. * @warning More generally, the key and the data to be attached to the * pool should have a life span at least as long as the pool itself. * */ -APR_DECLARE(apr_status_t) apr_pool_userdata_setn( +APR_DECLARE(fspr_status_t) fspr_pool_userdata_setn( const void *data, const char *key, - apr_status_t (*cleanup)(void *), - apr_pool_t *pool); + fspr_status_t (*cleanup)(void *), + fspr_pool_t *pool); /** * Return the data associated with the current pool. @@ -490,8 +490,8 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_setn( * @param key The key for the data to retrieve * @param pool The current pool. */ -APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, - apr_pool_t *pool); +APR_DECLARE(fspr_status_t) fspr_pool_userdata_get(void **data, const char *key, + fspr_pool_t *pool); /** @@ -517,11 +517,11 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, * @param child_cleanup The function to call when a child process is about * to exec - this function is called in the child, obviously! */ -APR_DECLARE(void) apr_pool_cleanup_register( - apr_pool_t *p, +APR_DECLARE(void) fspr_pool_cleanup_register( + fspr_pool_t *p, const void *data, - apr_status_t (*plain_cleanup)(void *), - apr_status_t (*child_cleanup)(void *)); + fspr_status_t (*plain_cleanup)(void *), + fspr_status_t (*child_cleanup)(void *)); /** * Remove a previously registered cleanup function. @@ -535,8 +535,8 @@ APR_DECLARE(void) apr_pool_cleanup_register( * @remarks For some strange reason only the plain_cleanup is handled by this * function */ -APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, - apr_status_t (*cleanup)(void *)); +APR_DECLARE(void) fspr_pool_cleanup_kill(fspr_pool_t *p, const void *data, + fspr_status_t (*cleanup)(void *)); /** * Replace the child cleanup function of a previously registered cleanup. @@ -550,11 +550,11 @@ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, * @param plain_cleanup The plain cleanup function of the registered cleanup * @param child_cleanup The function to register as the child cleanup */ -APR_DECLARE(void) apr_pool_child_cleanup_set( - apr_pool_t *p, +APR_DECLARE(void) fspr_pool_child_cleanup_set( + fspr_pool_t *p, const void *data, - apr_status_t (*plain_cleanup)(void *), - apr_status_t (*child_cleanup)(void *)); + fspr_status_t (*plain_cleanup)(void *), + fspr_status_t (*child_cleanup)(void *)); /** * Run the specified cleanup function immediately and unregister it. @@ -567,19 +567,19 @@ APR_DECLARE(void) apr_pool_child_cleanup_set( * @param data The data to remove from cleanup * @param cleanup The function to remove from cleanup */ -APR_DECLARE(apr_status_t) apr_pool_cleanup_run( - apr_pool_t *p, +APR_DECLARE(fspr_status_t) fspr_pool_cleanup_run( + fspr_pool_t *p, void *data, - apr_status_t (*cleanup)(void *)); + fspr_status_t (*cleanup)(void *)); /** * An empty cleanup function. * - * Passed to apr_pool_cleanup_register() when no cleanup is required. + * Passed to fspr_pool_cleanup_register() when no cleanup is required. * * @param data The data to cleanup, will not be used by this function. */ -APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data); +APR_DECLARE_NONSTD(fspr_status_t) fspr_pool_cleanup_null(void *data); /** * Run all registered child cleanups, in preparation for an exec() @@ -587,7 +587,7 @@ APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data); * buffers, *don't* wait for subprocesses, and *don't* free any * memory. */ -APR_DECLARE(void) apr_pool_cleanup_for_exec(void); +APR_DECLARE(void) fspr_pool_cleanup_for_exec(void); /** @} */ @@ -615,7 +615,7 @@ APR_DECLARE(void) apr_pool_cleanup_for_exec(void); * if the data is allocated in any ancestor of T's pool. This is the * basis on which the APR_POOL_DEBUG code works -- it tests these ancestor * relationships for all data inserted into tables. APR_POOL_DEBUG also - * provides tools (apr_pool_find, and apr_pool_is_ancestor) for other + * provides tools (fspr_pool_find, and fspr_pool_is_ancestor) for other * folks to implement similar restrictions for their own data * structures. * @@ -626,7 +626,7 @@ APR_DECLARE(void) apr_pool_cleanup_for_exec(void); * is, the caller guarantees they won't destroy the sub pool * individually prior to destroying the parent pool. * - * In this case the caller must call apr_pool_join() to indicate this + * In this case the caller must call fspr_pool_join() to indicate this * guarantee to the APR_POOL_DEBUG code. * * These functions are only implemented when #APR_POOL_DEBUG is set. @@ -639,14 +639,14 @@ APR_DECLARE(void) apr_pool_cleanup_for_exec(void); * @param p The parent pool * @param sub The subpool */ -APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub); +APR_DECLARE(void) fspr_pool_join(fspr_pool_t *p, fspr_pool_t *sub); /** * Find a pool from something allocated in it. * @param mem The thing allocated in the pool * @return The pool it is allocated in */ -APR_DECLARE(apr_pool_t *) apr_pool_find(const void *mem); +APR_DECLARE(fspr_pool_t *) fspr_pool_find(const void *mem); /** * Report the number of bytes currently in the pool @@ -654,28 +654,28 @@ APR_DECLARE(apr_pool_t *) apr_pool_find(const void *mem); * @param recurse Recurse/include the subpools' sizes * @return The number of bytes */ -APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse); +APR_DECLARE(fspr_size_t) fspr_pool_num_bytes(fspr_pool_t *p, int recurse); /** * Lock a pool * @param pool The pool to lock * @param flag The flag */ -APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag); +APR_DECLARE(void) fspr_pool_lock(fspr_pool_t *pool, int flag); /* @} */ #else /* APR_POOL_DEBUG or DOXYGEN */ -#ifdef apr_pool_join -#undef apr_pool_join +#ifdef fspr_pool_join +#undef fspr_pool_join #endif -#define apr_pool_join(a,b) +#define fspr_pool_join(a,b) -#ifdef apr_pool_lock -#undef apr_pool_lock +#ifdef fspr_pool_lock +#undef fspr_pool_lock #endif -#define apr_pool_lock(pool, lock) +#define fspr_pool_lock(pool, lock) #endif /* APR_POOL_DEBUG or DOXYGEN */ diff --git a/libs/apr/include/apr_portable.h b/libs/apr/include/fspr_portable.h similarity index 51% rename from libs/apr/include/apr_portable.h rename to libs/apr/include/fspr_portable.h index b1b21e37b7..d4118d0cfe 100644 --- a/libs/apr/include/apr_portable.h +++ b/libs/apr/include/fspr_portable.h @@ -21,21 +21,21 @@ #ifndef APR_PORTABLE_H #define APR_PORTABLE_H /** - * @file apr_portable.h + * @file fspr_portable.h * @brief APR Portability Routines */ -#include "apr.h" -#include "apr_pools.h" -#include "apr_thread_proc.h" -#include "apr_file_io.h" -#include "apr_network_io.h" -#include "apr_errno.h" -#include "apr_global_mutex.h" -#include "apr_proc_mutex.h" -#include "apr_time.h" -#include "apr_dso.h" -#include "apr_shm.h" +#include "fspr.h" +#include "fspr_pools.h" +#include "fspr_thread_proc.h" +#include "fspr_file_io.h" +#include "fspr_network_io.h" +#include "fspr_errno.h" +#include "fspr_global_mutex.h" +#include "fspr_proc_mutex.h" +#include "fspr_time.h" +#include "fspr_dso.h" +#include "fspr_shm.h" #if APR_HAVE_DIRENT_H #include @@ -52,71 +52,71 @@ extern "C" { #endif /* __cplusplus */ /** - * @defgroup apr_portabile Portability Routines + * @defgroup fspr_portabile Portability Routines * @ingroup APR * @{ */ #ifdef WIN32 /* The primitives for Windows types */ -typedef HANDLE apr_os_file_t; -typedef HANDLE apr_os_dir_t; -typedef SOCKET apr_os_sock_t; -typedef HANDLE apr_os_proc_mutex_t; -typedef HANDLE apr_os_thread_t; -typedef HANDLE apr_os_proc_t; -typedef DWORD apr_os_threadkey_t; -typedef FILETIME apr_os_imp_time_t; -typedef SYSTEMTIME apr_os_exp_time_t; -typedef HANDLE apr_os_dso_handle_t; -typedef HANDLE apr_os_shm_t; +typedef HANDLE fspr_os_file_t; +typedef HANDLE fspr_os_dir_t; +typedef SOCKET fspr_os_sock_t; +typedef HANDLE fspr_os_proc_mutex_t; +typedef HANDLE fspr_os_thread_t; +typedef HANDLE fspr_os_proc_t; +typedef DWORD fspr_os_threadkey_t; +typedef FILETIME fspr_os_imp_time_t; +typedef SYSTEMTIME fspr_os_exp_time_t; +typedef HANDLE fspr_os_dso_handle_t; +typedef HANDLE fspr_os_shm_t; #elif defined(OS2) -typedef HFILE apr_os_file_t; -typedef HDIR apr_os_dir_t; -typedef int apr_os_sock_t; -typedef HMTX apr_os_proc_mutex_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; -typedef HMODULE apr_os_dso_handle_t; -typedef void* apr_os_shm_t; +typedef HFILE fspr_os_file_t; +typedef HDIR fspr_os_dir_t; +typedef int fspr_os_sock_t; +typedef HMTX fspr_os_proc_mutex_t; +typedef TID fspr_os_thread_t; +typedef PID fspr_os_proc_t; +typedef PULONG fspr_os_threadkey_t; +typedef struct timeval fspr_os_imp_time_t; +typedef struct tm fspr_os_exp_time_t; +typedef HMODULE fspr_os_dso_handle_t; +typedef void* fspr_os_shm_t; #elif defined(__BEOS__) #include #include -struct apr_os_proc_mutex_t { +struct fspr_os_proc_mutex_t { sem_id sem; int32 ben; }; -typedef int apr_os_file_t; -typedef DIR apr_os_dir_t; -typedef int apr_os_sock_t; -typedef struct apr_os_proc_mutex_t apr_os_proc_mutex_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; -typedef image_id apr_os_dso_handle_t; -typedef void* apr_os_shm_t; +typedef int fspr_os_file_t; +typedef DIR fspr_os_dir_t; +typedef int fspr_os_sock_t; +typedef struct fspr_os_proc_mutex_t fspr_os_proc_mutex_t; +typedef thread_id fspr_os_thread_t; +typedef thread_id fspr_os_proc_t; +typedef int fspr_os_threadkey_t; +typedef struct timeval fspr_os_imp_time_t; +typedef struct tm fspr_os_exp_time_t; +typedef image_id fspr_os_dso_handle_t; +typedef void* fspr_os_shm_t; #elif defined(NETWARE) -typedef int apr_os_file_t; -typedef DIR apr_os_dir_t; -typedef int apr_os_sock_t; -typedef NXMutex_t apr_os_proc_mutex_t; -typedef NXThreadId_t apr_os_thread_t; -typedef long apr_os_proc_t; -typedef NXKey_t apr_os_threadkey_t; -typedef struct timeval apr_os_imp_time_t; -typedef struct tm apr_os_exp_time_t; -typedef void * apr_os_dso_handle_t; -typedef void* apr_os_shm_t; +typedef int fspr_os_file_t; +typedef DIR fspr_os_dir_t; +typedef int fspr_os_sock_t; +typedef NXMutex_t fspr_os_proc_mutex_t; +typedef NXThreadId_t fspr_os_thread_t; +typedef long fspr_os_proc_t; +typedef NXKey_t fspr_os_threadkey_t; +typedef struct timeval fspr_os_imp_time_t; +typedef struct tm fspr_os_exp_time_t; +typedef void * fspr_os_dso_handle_t; +typedef void* fspr_os_shm_t; #else /* Any other OS should go above this one. This is the lowest common @@ -124,7 +124,7 @@ typedef void* apr_os_shm_t; */ /** Basic OS process mutex structure. */ -struct apr_os_proc_mutex_t { +struct fspr_os_proc_mutex_t { #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE /** Value used for SYS V Semaphore, FCNTL and FLOCK serialization */ int crossproc; @@ -142,46 +142,46 @@ struct apr_os_proc_mutex_t { #endif }; -typedef int apr_os_file_t; /**< native file */ -typedef DIR apr_os_dir_t; /**< native dir */ -typedef int apr_os_sock_t; /**< native dir */ -typedef struct apr_os_proc_mutex_t apr_os_proc_mutex_t; /**< native proces +typedef int fspr_os_file_t; /**< native file */ +typedef DIR fspr_os_dir_t; /**< native dir */ +typedef int fspr_os_sock_t; /**< native dir */ +typedef struct fspr_os_proc_mutex_t fspr_os_proc_mutex_t; /**< native proces * mutex */ #if APR_HAS_THREADS && APR_HAVE_PTHREAD_H -typedef pthread_t apr_os_thread_t; /**< native thread */ -typedef pthread_key_t apr_os_threadkey_t; /**< native thread address +typedef pthread_t fspr_os_thread_t; /**< native thread */ +typedef pthread_key_t fspr_os_threadkey_t; /**< native thread address * space */ #endif -typedef pid_t apr_os_proc_t; /**< native pid */ -typedef struct timeval apr_os_imp_time_t; /**< native timeval */ -typedef struct tm apr_os_exp_time_t; /**< native tm */ -/** @var apr_os_dso_handle_t +typedef pid_t fspr_os_proc_t; /**< native pid */ +typedef struct timeval fspr_os_imp_time_t; /**< native timeval */ +typedef struct tm fspr_os_exp_time_t; /**< native tm */ +/** @var fspr_os_dso_handle_t * native dso types */ #if defined(HPUX) || defined(HPUX10) || defined(HPUX11) #include -typedef shl_t apr_os_dso_handle_t; +typedef shl_t fspr_os_dso_handle_t; #elif defined(DARWIN) #include -typedef NSModule apr_os_dso_handle_t; +typedef NSModule fspr_os_dso_handle_t; #else -typedef void * apr_os_dso_handle_t; +typedef void * fspr_os_dso_handle_t; #endif -typedef void* apr_os_shm_t; /**< native SHM */ +typedef void* fspr_os_shm_t; /**< native SHM */ #endif /** - * @typedef apr_os_sock_info_t + * @typedef fspr_os_sock_info_t * @brief alias for local OS socket */ /** * everything APR needs to know about an active socket to construct * an APR socket from it; currently, this is platform-independent */ -struct apr_os_sock_info_t { - apr_os_sock_t *os_sock; /**< always required */ +struct fspr_os_sock_info_t { + fspr_os_sock_t *os_sock; /**< always required */ struct sockaddr *local; /**< NULL if not yet bound */ struct sockaddr *remote; /**< NULL if not connected */ int family; /**< always required (APR_INET, APR_INET6, etc.) */ @@ -189,28 +189,28 @@ struct apr_os_sock_info_t { int protocol; /**< 0 or actual protocol (APR_PROTO_SCTP, APR_PROTO_TCP, etc.) */ }; -typedef struct apr_os_sock_info_t apr_os_sock_info_t; +typedef struct fspr_os_sock_info_t fspr_os_sock_info_t; #if APR_PROC_MUTEX_IS_GLOBAL || defined(DOXYGEN) /** Opaque global mutex type */ -#define apr_os_global_mutex_t apr_os_proc_mutex_t -/** @return apr_os_global_mutex */ -#define apr_os_global_mutex_get apr_os_proc_mutex_get +#define fspr_os_global_mutex_t fspr_os_proc_mutex_t +/** @return fspr_os_global_mutex */ +#define fspr_os_global_mutex_get fspr_os_proc_mutex_get #else /** Thread and process mutex for those platforms where process mutexes * are not held in threads. */ - struct apr_os_global_mutex_t { - apr_pool_t *pool; - apr_proc_mutex_t *proc_mutex; + struct fspr_os_global_mutex_t { + fspr_pool_t *pool; + fspr_proc_mutex_t *proc_mutex; #if APR_HAS_THREADS - apr_thread_mutex_t *thread_mutex; + fspr_thread_mutex_t *thread_mutex; #endif /* APR_HAS_THREADS */ }; - typedef struct apr_os_global_mutex_t apr_os_global_mutex_t; + typedef struct fspr_os_global_mutex_t fspr_os_global_mutex_t; -APR_DECLARE(apr_status_t) apr_os_global_mutex_get(apr_os_global_mutex_t *ospmutex, - apr_global_mutex_t *pmutex); +APR_DECLARE(fspr_status_t) fspr_os_global_mutex_get(fspr_os_global_mutex_t *ospmutex, + fspr_global_mutex_t *pmutex); #endif @@ -221,60 +221,60 @@ APR_DECLARE(apr_status_t) apr_os_global_mutex_get(apr_os_global_mutex_t *ospmute * @remark On Unix, it is only possible to get a file descriptor from * an apr file type. */ -APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, - apr_file_t *file); +APR_DECLARE(fspr_status_t) fspr_os_file_get(fspr_os_file_t *thefile, + fspr_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. */ -APR_DECLARE(apr_status_t) apr_os_dir_get(apr_os_dir_t **thedir, - apr_dir_t *dir); +APR_DECLARE(fspr_status_t) fspr_os_dir_get(fspr_os_dir_t **thedir, + fspr_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.. */ -APR_DECLARE(apr_status_t) apr_os_sock_get(apr_os_sock_t *thesock, - apr_socket_t *sock); +APR_DECLARE(fspr_status_t) fspr_os_sock_get(fspr_os_sock_t *thesock, + fspr_socket_t *sock); /** * Convert the proc mutex from os specific type to apr type * @param ospmutex The os specific proc mutex we are converting to. * @param pmutex The apr proc mutex to convert. */ -APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, - apr_proc_mutex_t *pmutex); +APR_DECLARE(fspr_status_t) fspr_os_proc_mutex_get(fspr_os_proc_mutex_t *ospmutex, + fspr_proc_mutex_t *pmutex); /** * Get the exploded time in the platforms native format. * @param ostime the native time format * @param aprtime the time to convert */ -APR_DECLARE(apr_status_t) apr_os_exp_time_get(apr_os_exp_time_t **ostime, - apr_time_exp_t *aprtime); +APR_DECLARE(fspr_status_t) fspr_os_exp_time_get(fspr_os_exp_time_t **ostime, + fspr_time_exp_t *aprtime); /** * Get the imploded time in the platforms native format. * @param ostime the native time format * @param aprtime the time to convert */ -APR_DECLARE(apr_status_t) apr_os_imp_time_get(apr_os_imp_time_t **ostime, - apr_time_t *aprtime); +APR_DECLARE(fspr_status_t) fspr_os_imp_time_get(fspr_os_imp_time_t **ostime, + fspr_time_t *aprtime); /** * convert the shm from apr type to os specific type. * @param osshm The os specific shm representation * @param shm The apr shm to convert. */ -APR_DECLARE(apr_status_t) apr_os_shm_get(apr_os_shm_t *osshm, - apr_shm_t *shm); +APR_DECLARE(fspr_status_t) fspr_os_shm_get(fspr_os_shm_t *osshm, + fspr_shm_t *shm); #if APR_HAS_THREADS || defined(DOXYGEN) /** - * @defgroup apr_os_thread Thread portability Routines + * @defgroup fspr_os_thread Thread portability Routines * @{ */ /** @@ -282,16 +282,16 @@ APR_DECLARE(apr_status_t) apr_os_shm_get(apr_os_shm_t *osshm, * @param thethd The apr thread to convert * @param thd The os specific thread we are converting to */ -APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, - apr_thread_t *thd); +APR_DECLARE(fspr_status_t) fspr_os_thread_get(fspr_os_thread_t **thethd, + fspr_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. */ -APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, - apr_threadkey_t *key); +APR_DECLARE(fspr_status_t) fspr_os_threadkey_get(fspr_os_threadkey_t *thekey, + fspr_threadkey_t *key); /** * convert the thread from os specific type to apr type. @@ -299,9 +299,9 @@ APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, * @param thethd The os specific thread to convert * @param cont The pool to use if it is needed. */ -APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, - apr_os_thread_t *thethd, - apr_pool_t *cont); +APR_DECLARE(fspr_status_t) fspr_os_thread_put(fspr_thread_t **thd, + fspr_os_thread_t *thethd, + fspr_pool_t *cont); /** * convert the thread private memory key from os specific type to apr type. @@ -309,21 +309,21 @@ APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, * @param thekey The os specific handle to convert * @param cont The pool to use if it is needed. */ -APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, - apr_os_threadkey_t *thekey, - apr_pool_t *cont); +APR_DECLARE(fspr_status_t) fspr_os_threadkey_put(fspr_threadkey_t **key, + fspr_os_threadkey_t *thekey, + fspr_pool_t *cont); /** * Get the thread ID */ -APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void); +APR_DECLARE(fspr_os_thread_t) fspr_os_thread_current(void); /** * Compare two thread id's * @param tid1 1st Thread ID to compare * @param tid2 2nd Thread ID to compare */ -APR_DECLARE(int) apr_os_thread_equal(apr_os_thread_t tid1, - apr_os_thread_t tid2); +APR_DECLARE(int) fspr_os_thread_equal(fspr_os_thread_t tid1, + fspr_os_thread_t tid2); /** @} */ #endif /* APR_HAS_THREADS */ @@ -337,9 +337,9 @@ APR_DECLARE(int) apr_os_thread_equal(apr_os_thread_t tid1, * @remark On Unix, it is only possible to put a file descriptor into * an apr file type. */ -APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, - apr_os_file_t *thefile, - apr_int32_t flags, apr_pool_t *cont); +APR_DECLARE(fspr_status_t) fspr_os_file_put(fspr_file_t **file, + fspr_os_file_t *thefile, + fspr_int32_t flags, fspr_pool_t *cont); /** * convert the file from os specific type to apr type. @@ -349,24 +349,24 @@ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, * @remark On Unix, it is only possible to put a file descriptor into * an apr file type. */ -APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, - apr_os_file_t *thefile, - apr_pool_t *cont); +APR_DECLARE(fspr_status_t) fspr_os_pipe_put(fspr_file_t **file, + fspr_os_file_t *thefile, + fspr_pool_t *cont); /** * convert the file from os specific type to apr type. * @param file The apr file we are converting to. * @param thefile The os specific pipe to convert - * @param register_cleanup A cleanup will be registered on the apr_file_t - * to issue apr_file_close(). + * @param register_cleanup A cleanup will be registered on the fspr_file_t + * to issue fspr_file_close(). * @param cont The pool to use if it is needed. * @remark On Unix, it is only possible to put a file descriptor into * an apr file type. */ -APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file, - apr_os_file_t *thefile, +APR_DECLARE(fspr_status_t) fspr_os_pipe_put_ex(fspr_file_t **file, + fspr_os_file_t *thefile, int register_cleanup, - apr_pool_t *cont); + fspr_pool_t *cont); /** * convert the dir from os specific type to apr type. @@ -374,35 +374,35 @@ APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file, * @param thedir The os specific dir to convert * @param cont The pool to use when creating to apr directory. */ -APR_DECLARE(apr_status_t) apr_os_dir_put(apr_dir_t **dir, - apr_os_dir_t *thedir, - apr_pool_t *cont); +APR_DECLARE(fspr_status_t) fspr_os_dir_put(fspr_dir_t **dir, + fspr_os_dir_t *thedir, + fspr_pool_t *cont); /** * Convert a socket from the os specific type to the apr type * @param sock The pool to use. * @param thesock The socket to convert to. * @param cont The socket we are converting to an apr type. - * @remark If it is a true socket, it is best to call apr_os_sock_make() + * @remark If it is a true socket, it is best to call fspr_os_sock_make() * and provide APR with more information about the socket. */ -APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, - apr_os_sock_t *thesock, - apr_pool_t *cont); +APR_DECLARE(fspr_status_t) fspr_os_sock_put(fspr_socket_t **sock, + fspr_os_sock_t *thesock, + fspr_pool_t *cont); /** * Create a socket from an existing descriptor and local and remote * socket addresses. - * @param apr_sock The new socket that has been set up + * @param fspr_sock The new socket that has been set up * @param os_sock_info The os representation of the socket handle and * other characteristics of the socket * @param cont The pool to use * @remark If you only know the descriptor/handle or if it isn't really - * a true socket, use apr_os_sock_put() instead. + * a true socket, use fspr_os_sock_put() instead. */ -APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, - apr_os_sock_info_t *os_sock_info, - apr_pool_t *cont); +APR_DECLARE(fspr_status_t) fspr_os_sock_make(fspr_socket_t **fspr_sock, + fspr_os_sock_info_t *os_sock_info, + fspr_pool_t *cont); /** * Convert the proc mutex from os specific type to apr type @@ -410,9 +410,9 @@ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, * @param ospmutex The os specific proc mutex to convert. * @param cont The pool to use if it is needed. */ -APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, - apr_os_proc_mutex_t *ospmutex, - apr_pool_t *cont); +APR_DECLARE(fspr_status_t) fspr_os_proc_mutex_put(fspr_proc_mutex_t **pmutex, + fspr_os_proc_mutex_t *ospmutex, + fspr_pool_t *cont); /** * Put the imploded time in the APR format. @@ -420,9 +420,9 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, * @param ostime the time to convert * @param cont the pool to use if necessary */ -APR_DECLARE(apr_status_t) apr_os_imp_time_put(apr_time_t *aprtime, - apr_os_imp_time_t **ostime, - apr_pool_t *cont); +APR_DECLARE(fspr_status_t) fspr_os_imp_time_put(fspr_time_t *aprtime, + fspr_os_imp_time_t **ostime, + fspr_pool_t *cont); /** * Put the exploded time in the APR format. @@ -430,9 +430,9 @@ APR_DECLARE(apr_status_t) apr_os_imp_time_put(apr_time_t *aprtime, * @param ostime the time to convert * @param cont the pool to use if necessary */ -APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_time_exp_t *aprtime, - apr_os_exp_time_t **ostime, - apr_pool_t *cont); +APR_DECLARE(fspr_status_t) fspr_os_exp_time_put(fspr_time_exp_t *aprtime, + fspr_os_exp_time_t **ostime, + fspr_pool_t *cont); /** * convert the shared memory from os specific type to apr type. @@ -443,14 +443,14 @@ APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_time_exp_t *aprtime, * the memory block mapped. On non-fork architectures, this is typically * some internal handle to pass the mapping from process to process. */ -APR_DECLARE(apr_status_t) apr_os_shm_put(apr_shm_t **shm, - apr_os_shm_t *osshm, - apr_pool_t *cont); +APR_DECLARE(fspr_status_t) fspr_os_shm_put(fspr_shm_t **shm, + fspr_os_shm_t *osshm, + fspr_pool_t *cont); #if APR_HAS_DSO || defined(DOXYGEN) /** - * @defgroup apr_os_dso DSO (Dynamic Loading) Portabiliity Routines + * @defgroup fspr_os_dso DSO (Dynamic Loading) Portabiliity Routines * @{ */ /** @@ -459,23 +459,23 @@ APR_DECLARE(apr_status_t) apr_os_shm_put(apr_shm_t **shm, * @param thedso the os specific handle to convert * @param pool the pool to use if it is needed */ -APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **dso, - apr_os_dso_handle_t thedso, - apr_pool_t *pool); +APR_DECLARE(fspr_status_t) fspr_os_dso_handle_put(fspr_dso_handle_t **dso, + fspr_os_dso_handle_t thedso, + fspr_pool_t *pool); /** * convert the apr dso handle into an os specific one * @param aprdso The apr dso handle to convert * @param dso The os specific dso to return */ -APR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *dso, - apr_dso_handle_t *aprdso); +APR_DECLARE(fspr_status_t) fspr_os_dso_handle_get(fspr_os_dso_handle_t *dso, + fspr_dso_handle_t *aprdso); #if APR_HAS_OS_UUID /** - * Private: apr-util's apr_uuid module when supported by the platform + * Private: apr-util's fspr_uuid module when supported by the platform */ -APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data); +APR_DECLARE(fspr_status_t) fspr_os_uuid_get(unsigned char *uuid_data); #endif /** @} */ @@ -486,16 +486,16 @@ APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data); * Get the name of the system default characer set. * @param pool the pool to allocate the name from, if needed */ -APR_DECLARE(const char*) apr_os_default_encoding(apr_pool_t *pool); +APR_DECLARE(const char*) fspr_os_default_encoding(fspr_pool_t *pool); /** * Get the name of the current locale character set. * @param pool the pool to allocate the name from, if needed - * @remark Defers to apr_os_default_encoding if the current locale's + * @remark Defers to fspr_os_default_encoding if the current locale's * data can't be retreved on this system. */ -APR_DECLARE(const char*) apr_os_locale_encoding(apr_pool_t *pool); +APR_DECLARE(const char*) fspr_os_locale_encoding(fspr_pool_t *pool); /** @} */ diff --git a/libs/apr/include/apr_proc_mutex.h b/libs/apr/include/fspr_proc_mutex.h similarity index 78% rename from libs/apr/include/apr_proc_mutex.h rename to libs/apr/include/fspr_proc_mutex.h index ceb9c82a8d..9e1b6d6b48 100644 --- a/libs/apr/include/apr_proc_mutex.h +++ b/libs/apr/include/fspr_proc_mutex.h @@ -18,20 +18,20 @@ #define APR_PROC_MUTEX_H /** - * @file apr_proc_mutex.h + * @file fspr_proc_mutex.h * @brief APR Process Locking Routines */ -#include "apr.h" -#include "apr_pools.h" -#include "apr_errno.h" +#include "fspr.h" +#include "fspr_pools.h" +#include "fspr_errno.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** - * @defgroup apr_proc_mutex Process Locking Routines + * @defgroup fspr_proc_mutex Process Locking Routines * @ingroup APR * @{ */ @@ -48,10 +48,10 @@ typedef enum { APR_LOCK_PROC_PTHREAD, /**< POSIX pthread process-based locking */ APR_LOCK_POSIXSEM, /**< POSIX semaphore process-based locking */ APR_LOCK_DEFAULT /**< Use the default process lock */ -} apr_lockmech_e; +} fspr_lockmech_e; /** Opaque structure representing a process mutex. */ -typedef struct apr_proc_mutex_t apr_proc_mutex_t; +typedef struct fspr_proc_mutex_t fspr_proc_mutex_t; /* Function definitions */ @@ -72,14 +72,14 @@ typedef struct apr_proc_mutex_t apr_proc_mutex_t; * APR_LOCK_DEFAULT pick the default mechanism for the platform * * @param pool the pool from which to allocate the mutex. - * @see apr_lockmech_e + * @see fspr_lockmech_e * @warning Check APR_HAS_foo_SERIALIZE defines to see if the platform supports * APR_LOCK_foo. Only APR_LOCK_DEFAULT is portable. */ -APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, +APR_DECLARE(fspr_status_t) fspr_proc_mutex_create(fspr_proc_mutex_t **mutex, const char *fname, - apr_lockmech_e mech, - apr_pool_t *pool); + fspr_lockmech_e mech, + fspr_pool_t *pool); /** * Re-open a mutex in a child process. @@ -87,21 +87,21 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, * @param fname A file name to use if the mutex mechanism requires one. This * argument should always be provided. The mutex code itself will * determine if it should be used. This filename should be the - * same one that was passed to apr_proc_mutex_create(). + * same one that was passed to fspr_proc_mutex_create(). * @param pool The pool to operate on. * @remark This function must be called to maintain portability, even * if the underlying lock mechanism does not require it. */ -APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, +APR_DECLARE(fspr_status_t) fspr_proc_mutex_child_init(fspr_proc_mutex_t **mutex, const char *fname, - apr_pool_t *pool); + fspr_pool_t *pool); /** * Acquire the lock for the given mutex. If the mutex is already locked, * the current thread will be put to sleep until the lock becomes available. * @param mutex the mutex on which to acquire the lock. */ -APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex); +APR_DECLARE(fspr_status_t) fspr_proc_mutex_lock(fspr_proc_mutex_t *mutex); /** * Attempt to acquire the lock for the given mutex. If the mutex has already @@ -110,19 +110,19 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex); * if the return value was APR_EBUSY, for portability reasons. * @param mutex the mutex on which to attempt the lock acquiring. */ -APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex); +APR_DECLARE(fspr_status_t) fspr_proc_mutex_trylock(fspr_proc_mutex_t *mutex); /** * Release the lock for the given mutex. * @param mutex the mutex from which to release the lock. */ -APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex); +APR_DECLARE(fspr_status_t) fspr_proc_mutex_unlock(fspr_proc_mutex_t *mutex); /** * Destroy the mutex and free the memory associated with the lock. * @param mutex the mutex to destroy. */ -APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex); +APR_DECLARE(fspr_status_t) fspr_proc_mutex_destroy(fspr_proc_mutex_t *mutex); /** * Destroy the mutex and free the memory associated with the lock. @@ -130,30 +130,30 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex); * @note This function is generally used to kill a cleanup on an already * created mutex */ -APR_DECLARE(apr_status_t) apr_proc_mutex_cleanup(void *mutex); +APR_DECLARE(fspr_status_t) fspr_proc_mutex_cleanup(void *mutex); /** * Return the name of the lockfile for the mutex, or NULL * if the mutex doesn't use a lock file */ -APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex); +APR_DECLARE(const char *) fspr_proc_mutex_lockfile(fspr_proc_mutex_t *mutex); /** * Display the name of the mutex, as it relates to the actual method used. * This matches the valid options for Apache's AcceptMutex directive * @param mutex the name of the mutex */ -APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex); +APR_DECLARE(const char *) fspr_proc_mutex_name(fspr_proc_mutex_t *mutex); /** * Display the name of the default mutex: APR_LOCK_DEFAULT */ -APR_DECLARE(const char *) apr_proc_mutex_defname(void); +APR_DECLARE(const char *) fspr_proc_mutex_defname(void); /** * Get the pool used by this proc_mutex. - * @return apr_pool_t the pool + * @return fspr_pool_t the pool */ APR_POOL_DECLARE_ACCESSOR(proc_mutex); diff --git a/libs/apr/include/fspr_random.h b/libs/apr/include/fspr_random.h new file mode 100644 index 0000000000..7ba2c78dbf --- /dev/null +++ b/libs/apr/include/fspr_random.h @@ -0,0 +1,74 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APR_RANDOM_H +#define APR_RANDOM_H + +#include + +typedef struct fspr_crypto_hash_t fspr_crypto_hash_t; + +typedef void fspr_crypto_hash_init_t(fspr_crypto_hash_t *hash); +typedef void fspr_crypto_hash_add_t(fspr_crypto_hash_t *hash,const void *data, + fspr_size_t bytes); +typedef void fspr_crypto_hash_finish_t(fspr_crypto_hash_t *hash, + unsigned char *result); + +/* FIXME: make this opaque */ +struct fspr_crypto_hash_t { + fspr_crypto_hash_init_t *init; + fspr_crypto_hash_add_t *add; + fspr_crypto_hash_finish_t *finish; + fspr_size_t size; + void *data; +}; + +APR_DECLARE(fspr_crypto_hash_t *) fspr_crypto_sha256_new(fspr_pool_t *p); + +typedef struct fspr_random_t fspr_random_t; + +APR_DECLARE(void) fspr_random_init(fspr_random_t *g,fspr_pool_t *p, + fspr_crypto_hash_t *pool_hash, + fspr_crypto_hash_t *key_hash, + fspr_crypto_hash_t *prng_hash); +APR_DECLARE(fspr_random_t *) fspr_random_standard_new(fspr_pool_t *p); +APR_DECLARE(void) fspr_random_add_entropy(fspr_random_t *g, + const void *entropy_, + fspr_size_t bytes); +APR_DECLARE(fspr_status_t) fspr_random_insecure_bytes(fspr_random_t *g, + void *random, + fspr_size_t bytes); +APR_DECLARE(fspr_status_t) fspr_random_secure_bytes(fspr_random_t *g, + void *random, + fspr_size_t bytes); +APR_DECLARE(void) fspr_random_barrier(fspr_random_t *g); +APR_DECLARE(fspr_status_t) fspr_random_secure_ready(fspr_random_t *r); +APR_DECLARE(fspr_status_t) fspr_random_insecure_ready(fspr_random_t *r); + +/* Call this in the child after forking to mix the randomness + pools. Note that its generally a bad idea to fork a process with a + real PRNG in it - better to have the PRNG externally and get the + randomness from there. However, if you really must do it, then you + should supply all your entropy to all the PRNGs - don't worry, they + won't produce the same output. + + Note that fspr_proc_fork() calls this for you, so only weird + applications need ever call it themselves. +*/ +struct fspr_proc_t; +APR_DECLARE(void) fspr_random_after_fork(struct fspr_proc_t *proc); + +#endif /* ndef APR_RANDOM_H */ diff --git a/libs/apr/include/apr_ring.h b/libs/apr/include/fspr_ring.h similarity index 99% rename from libs/apr/include/apr_ring.h rename to libs/apr/include/fspr_ring.h index a360254a38..4af513b41e 100644 --- a/libs/apr/include/apr_ring.h +++ b/libs/apr/include/fspr_ring.h @@ -28,17 +28,17 @@ #define APR_RING_H /** - * @file apr_ring.h + * @file fspr_ring.h * @brief APR Rings */ /* * for offsetof() */ -#include "apr_general.h" +#include "fspr_general.h" /** - * @defgroup apr_ring Ring Macro Implementations + * @defgroup fspr_ring Ring Macro Implementations * @ingroup APR * A ring is a kind of doubly-linked list that can be manipulated * without knowing where its head is. diff --git a/libs/apr/include/apr_shm.h b/libs/apr/include/fspr_shm.h similarity index 81% rename from libs/apr/include/apr_shm.h rename to libs/apr/include/fspr_shm.h index 4875ee1ff8..81bfd994ab 100644 --- a/libs/apr/include/apr_shm.h +++ b/libs/apr/include/fspr_shm.h @@ -18,20 +18,20 @@ #define APR_SHM_H /** - * @file apr_shm.h + * @file fspr_shm.h * @brief APR Shared Memory Routines */ -#include "apr.h" -#include "apr_pools.h" -#include "apr_errno.h" +#include "fspr.h" +#include "fspr_pools.h" +#include "fspr_errno.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** - * @defgroup apr_shm Shared Memory Routines + * @defgroup fspr_shm Shared Memory Routines * @ingroup APR * @{ */ @@ -40,7 +40,7 @@ extern "C" { * Private, platform-specific data struture representing a shared memory * segment. */ -typedef struct apr_shm_t apr_shm_t; +typedef struct fspr_shm_t fspr_shm_t; /** * Create and make accessable a shared memory segment. @@ -61,14 +61,14 @@ typedef struct apr_shm_t apr_shm_t; * about the segment within the actual segment. In order to supply * the caller with the requested size it may be necessary for the * implementation to request a slightly greater segment length - * from the subsystem. In all cases, the apr_shm_baseaddr_get() + * from the subsystem. In all cases, the fspr_shm_baseaddr_get() * function will return the first usable byte of memory. * */ -APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, - apr_size_t reqsize, +APR_DECLARE(fspr_status_t) fspr_shm_create(fspr_shm_t **m, + fspr_size_t reqsize, const char *filename, - apr_pool_t *pool); + fspr_pool_t *pool); /** * Remove shared memory segment associated with a filename. @@ -79,14 +79,14 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, * name-based shared memory segments, and will return APR_ENOTIMPL on * platforms without such support. */ -APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, - apr_pool_t *pool); +APR_DECLARE(fspr_status_t) fspr_shm_remove(const char *filename, + fspr_pool_t *pool); /** * Destroy a shared memory segment and associated memory. * @param m The shared memory segment structure to destroy. */ -APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m); +APR_DECLARE(fspr_status_t) fspr_shm_destroy(fspr_shm_t *m); /** * Attach to a shared memory segment that was created @@ -97,16 +97,16 @@ APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m); * @param pool the pool from which to allocate the shared memory * structure for this process. */ -APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, +APR_DECLARE(fspr_status_t) fspr_shm_attach(fspr_shm_t **m, const char *filename, - apr_pool_t *pool); + fspr_pool_t *pool); /** * Detach from a shared memory segment without destroying it. * @param m The shared memory structure representing the segment * to detach from. */ -APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m); +APR_DECLARE(fspr_status_t) fspr_shm_detach(fspr_shm_t *m); /** * Retrieve the base address of the shared memory segment. @@ -117,14 +117,14 @@ APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m); * the base address. * @return address, aligned by APR_ALIGN_DEFAULT. */ -APR_DECLARE(void *) apr_shm_baseaddr_get(const apr_shm_t *m); +APR_DECLARE(void *) fspr_shm_baseaddr_get(const fspr_shm_t *m); /** * Retrieve the length of a shared memory segment in bytes. * @param m The shared memory segment from which to retrieve * the segment length. */ -APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m); +APR_DECLARE(fspr_size_t) fspr_shm_size_get(const fspr_shm_t *m); /** * Get the pool used by this shared memory segment. diff --git a/libs/apr/include/apr_signal.h b/libs/apr/include/fspr_signal.h similarity index 81% rename from libs/apr/include/apr_signal.h rename to libs/apr/include/fspr_signal.h index 991cbadbae..6a53efa24d 100644 --- a/libs/apr/include/apr_signal.h +++ b/libs/apr/include/fspr_signal.h @@ -18,12 +18,12 @@ #define APR_SIGNAL_H /** - * @file apr_signal.h + * @file fspr_signal.h * @brief APR Signal Handling */ -#include "apr.h" -#include "apr_pools.h" +#include "fspr.h" +#include "fspr_pools.h" #if APR_HAVE_SIGNAL_H #include @@ -34,7 +34,7 @@ extern "C" { #endif /* __cplusplus */ /** - * @defgroup apr_signal Handling + * @defgroup fspr_signal Handling * @ingroup APR * @{ */ @@ -54,21 +54,21 @@ extern "C" { #endif /** Function prototype for signal handlers */ -typedef void apr_sigfunc_t(int); +typedef void fspr_sigfunc_t(int); /** * Set the signal handler function for a given signal * @param signo The signal (eg... SIGWINCH) * @param func the function to get called */ -APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func); +APR_DECLARE(fspr_sigfunc_t *) fspr_signal(int signo, fspr_sigfunc_t * func); #if defined(SIG_IGN) && !defined(SIG_ERR) -#define SIG_ERR ((apr_sigfunc_t *) -1) +#define SIG_ERR ((fspr_sigfunc_t *) -1) #endif #else /* !APR_HAVE_SIGACTION */ -#define apr_signal(a, b) signal(a, b) +#define fspr_signal(a, b) signal(a, b) #endif @@ -77,28 +77,28 @@ APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func); * @param signum The signal number * @return The description of the signal */ -APR_DECLARE(const char *) apr_signal_description_get(int signum); +APR_DECLARE(const char *) fspr_signal_description_get(int signum); /** * APR-private function for initializing the signal package * @internal * @param pglobal The internal, global pool */ -void apr_signal_init(apr_pool_t *pglobal); +void fspr_signal_init(fspr_pool_t *pglobal); /** * Block the delivery of a particular signal * @param signum The signal number * @return status */ -APR_DECLARE(apr_status_t) apr_signal_block(int signum); +APR_DECLARE(fspr_status_t) fspr_signal_block(int signum); /** * Enable the delivery of a particular signal * @param signum The signal number * @return status */ -APR_DECLARE(apr_status_t) apr_signal_unblock(int signum); +APR_DECLARE(fspr_status_t) fspr_signal_unblock(int signum); /** @} */ diff --git a/libs/apr/include/apr_strings.h b/libs/apr/include/fspr_strings.h similarity index 77% rename from libs/apr/include/apr_strings.h rename to libs/apr/include/fspr_strings.h index fcfb7777a2..27a15bdb79 100644 --- a/libs/apr/include/apr_strings.h +++ b/libs/apr/include/fspr_strings.h @@ -41,15 +41,15 @@ #define APR_STRINGS_H /** - * @file apr_strings.h + * @file fspr_strings.h * @brief APR Strings library */ -#include "apr.h" -#include "apr_errno.h" -#include "apr_pools.h" +#include "fspr.h" +#include "fspr_errno.h" +#include "fspr_pools.h" #define APR_WANT_IOVEC -#include "apr_want.h" +#include "fspr_want.h" #if APR_HAVE_STDARG_H #include @@ -60,7 +60,7 @@ extern "C" { #endif /* __cplusplus */ /** - * @defgroup apr_strings String routines + * @defgroup fspr_strings String routines * @ingroup APR * @{ */ @@ -73,7 +73,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. */ -APR_DECLARE(int) apr_strnatcmp(char const *a, char const *b); +APR_DECLARE(int) fspr_strnatcmp(char const *a, char const *b); /** * Do a natural order comparison of two strings ignoring the case of the @@ -84,7 +84,7 @@ APR_DECLARE(int) apr_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. */ -APR_DECLARE(int) apr_strnatcasecmp(char const *a, char const *b); +APR_DECLARE(int) fspr_strnatcasecmp(char const *a, char const *b); /** * duplicate a string into memory allocated out of a pool @@ -92,7 +92,7 @@ APR_DECLARE(int) apr_strnatcasecmp(char const *a, char const *b); * @param s The string to duplicate * @return The new string */ -APR_DECLARE(char *) apr_pstrdup(apr_pool_t *p, const char *s); +APR_DECLARE(char *) fspr_pstrdup(fspr_pool_t *p, const char *s); /** * Create a null-terminated string by making a copy of a sequence @@ -101,12 +101,12 @@ APR_DECLARE(char *) apr_pstrdup(apr_pool_t *p, const char *s); * @param s The block of characters to duplicate * @param n The number of characters to duplicate * @return The new string - * @remark This is a faster alternative to apr_pstrndup, for use + * @remark This is a faster alternative to fspr_pstrndup, for use * when you know that the string being duplicated really * has 'n' or more characters. If the string might contain - * fewer characters, use apr_pstrndup. + * fewer characters, use fspr_pstrndup. */ -APR_DECLARE(char *) apr_pstrmemdup(apr_pool_t *p, const char *s, apr_size_t n); +APR_DECLARE(char *) fspr_pstrmemdup(fspr_pool_t *p, const char *s, fspr_size_t n); /** * Duplicate at most n characters of a string into memory allocated @@ -118,7 +118,7 @@ APR_DECLARE(char *) apr_pstrmemdup(apr_pool_t *p, const char *s, apr_size_t n); * @remark The amount of memory allocated from the pool is the length * of the returned string including the NUL terminator */ -APR_DECLARE(char *) apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n); +APR_DECLARE(char *) fspr_pstrndup(fspr_pool_t *p, const char *s, fspr_size_t n); /** * Duplicate a block of memory. @@ -128,7 +128,7 @@ APR_DECLARE(char *) apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n); * @param n The number of bytes to duplicate * @return The new block of memory */ -APR_DECLARE(void *) apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n); +APR_DECLARE(void *) fspr_pmemdup(fspr_pool_t *p, const void *m, fspr_size_t n); /** * Concatenate multiple strings, allocating memory out a pool @@ -136,7 +136,7 @@ APR_DECLARE(void *) apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n); * @param ... The strings to concatenate. The final string must be NULL * @return The new string */ -APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *p, ...); +APR_DECLARE_NONSTD(char *) fspr_pstrcat(fspr_pool_t *p, ...); /** * Concatenate multiple strings specified in a writev-style vector @@ -146,8 +146,8 @@ APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *p, ...); * @param nbytes (output) strlen of new string (pass in NULL to omit) * @return The new string */ -APR_DECLARE(char *) apr_pstrcatv(apr_pool_t *p, const struct iovec *vec, - apr_size_t nvec, apr_size_t *nbytes); +APR_DECLARE(char *) fspr_pstrcatv(fspr_pool_t *p, const struct iovec *vec, + fspr_size_t nvec, fspr_size_t *nbytes); /** * printf-style style printing routine. The data is output to a string @@ -157,7 +157,7 @@ APR_DECLARE(char *) apr_pstrcatv(apr_pool_t *p, const struct iovec *vec, * @param ap The arguments to use while printing the data * @return The new string */ -APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap); +APR_DECLARE(char *) fspr_pvsprintf(fspr_pool_t *p, const char *fmt, va_list ap); /** * printf-style style printing routine. The data is output to a string @@ -167,7 +167,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap); * @param ... The arguments to use while printing the data * @return The new string */ -APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) +APR_DECLARE_NONSTD(char *) fspr_psprintf(fspr_pool_t *p, const char *fmt, ...) __attribute__((format(printf,2,3))); /** @@ -184,16 +184,16 @@ APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) * @remark *
      * Note the differences between this function and strncpy():
    - *  1) strncpy() doesn't always NUL terminate; apr_cpystrn() does.
    + *  1) strncpy() doesn't always NUL terminate; fspr_cpystrn() does.
      *  2) strncpy() pads the destination string with NULs, which is often 
    - *     unnecessary; apr_cpystrn() does not.
    + *     unnecessary; fspr_cpystrn() does not.
      *  3) strncpy() returns a pointer to the beginning of the dst string;
    - *     apr_cpystrn() returns a pointer to the NUL terminator of dst, 
    + *     fspr_cpystrn() returns a pointer to the NUL terminator of dst, 
      *     to allow a check for truncation.
      * 
    */ -APR_DECLARE(char *) apr_cpystrn(char *dst, const char *src, - apr_size_t dst_size); +APR_DECLARE(char *) fspr_cpystrn(char *dst, const char *src, + fspr_size_t dst_size); /** * Strip spaces from a string @@ -202,7 +202,7 @@ APR_DECLARE(char *) apr_cpystrn(char *dst, const char *src, * @param src The string to rid the spaces from. * @return The destination string, dest. */ -APR_DECLARE(char *) apr_collapse_spaces(char *dest, const char *src); +APR_DECLARE(char *) fspr_collapse_spaces(char *dest, const char *src); /** * Convert the arguments to a program from one string to an array of @@ -211,66 +211,66 @@ APR_DECLARE(char *) apr_collapse_spaces(char *dest, const char *src); * @param argv_out Output location. This is a pointer to an array of strings. * @param token_context Pool to use. */ -APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str, +APR_DECLARE(fspr_status_t) fspr_tokenize_to_argv(const char *arg_str, char ***argv_out, - apr_pool_t *token_context); + fspr_pool_t *token_context); /** * Split a string into separate null-terminated tokens. The tokens are * delimited in the string by one or more characters from the sep * argument. * @param str The string to separate; this should be specified on the - * first call to apr_strtok() for a given string, and NULL + * first call to fspr_strtok() for a given string, and NULL * on subsequent calls. * @param sep The set of delimiters - * @param last Internal state saved by apr_strtok() between calls. + * @param last Internal state saved by fspr_strtok() between calls. * @return The next token from the string */ -APR_DECLARE(char *) apr_strtok(char *str, const char *sep, char **last); +APR_DECLARE(char *) fspr_strtok(char *str, const char *sep, char **last); /** * @defgroup APR_Strings_Snprintf snprintf implementations * @warning - * These are snprintf implementations based on apr_vformatter(). + * These are snprintf implementations based on fspr_vformatter(). * * Note that various standards and implementations disagree on the return * value of snprintf, and side-effects due to %n in the formatting string. - * apr_snprintf (and apr_vsnprintf) behaves as follows: + * fspr_snprintf (and fspr_vsnprintf) 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. It will return the * number of characters inserted into the buffer, not including the - * terminating NUL. As a special case, if len is 0, apr_snprintf will + * terminating NUL. As a special case, if len is 0, fspr_snprintf will * return the number of characters that would have been inserted if * the buffer had been infinite (in this case, *buffer can be NULL) * - * In no event does apr_snprintf return a negative number. + * In no event does fspr_snprintf return a negative number. * @{ */ /** - * snprintf routine based on apr_vformatter. This means it understands the + * snprintf routine based on fspr_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. */ -APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, apr_size_t len, +APR_DECLARE_NONSTD(int) fspr_snprintf(char *buf, fspr_size_t len, const char *format, ...) __attribute__((format(printf,3,4))); /** - * vsnprintf routine based on apr_vformatter. This means it understands the + * vsnprintf routine based on fspr_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. */ -APR_DECLARE(int) apr_vsnprintf(char *buf, apr_size_t len, const char *format, +APR_DECLARE(int) fspr_vsnprintf(char *buf, fspr_size_t len, const char *format, va_list ap); /** @} */ @@ -280,7 +280,7 @@ APR_DECLARE(int) apr_vsnprintf(char *buf, apr_size_t len, const char *format, * @param n The number to format * @return The string representation of the number */ -APR_DECLARE(char *) apr_itoa(apr_pool_t *p, int n); +APR_DECLARE(char *) fspr_itoa(fspr_pool_t *p, int n); /** * create a string representation of a long, allocated from a pool @@ -288,18 +288,18 @@ APR_DECLARE(char *) apr_itoa(apr_pool_t *p, int n); * @param n The number to format * @return The string representation of the number */ -APR_DECLARE(char *) apr_ltoa(apr_pool_t *p, long n); +APR_DECLARE(char *) fspr_ltoa(fspr_pool_t *p, long n); /** - * create a string representation of an apr_off_t, allocated from a pool + * create a string representation of an fspr_off_t, allocated from a pool * @param p The pool from which to allocate * @param n The number to format * @return The string representation of the number */ -APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, apr_off_t n); +APR_DECLARE(char *) fspr_off_t_toa(fspr_pool_t *p, fspr_off_t n); /** - * Convert a numeric string into an apr_off_t numeric value. + * Convert a numeric string into an fspr_off_t numeric value. * @param offset The value of the parsed string. * @param buf The string to parse. It may contain optional whitespace, * followed by an optional '+' (positive, default) or '-' (negative) @@ -312,7 +312,7 @@ APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, apr_off_t n); * digits are prefixed with '0x', in which case it will be treated as * base 16. */ -APR_DECLARE(apr_status_t) apr_strtoff(apr_off_t *offset, const char *buf, +APR_DECLARE(fspr_status_t) fspr_strtoff(fspr_off_t *offset, const char *buf, char **end, int base); /** @@ -330,25 +330,25 @@ APR_DECLARE(apr_status_t) apr_strtoff(apr_off_t *offset, const char *buf, * @return The numeric value of the string. On overflow, errno is set * to ERANGE. */ -APR_DECLARE(apr_int64_t) apr_strtoi64(const char *buf, char **end, int base); +APR_DECLARE(fspr_int64_t) fspr_strtoi64(const char *buf, char **end, int base); /** * parse a base-10 numeric string into a 64-bit numeric value. - * Equivalent to apr_strtoi64(buf, (char**)NULL, 10). + * Equivalent to fspr_strtoi64(buf, (char**)NULL, 10). * @param buf The string to parse * @return The numeric value of the string */ -APR_DECLARE(apr_int64_t) apr_atoi64(const char *buf); +APR_DECLARE(fspr_int64_t) fspr_atoi64(const char *buf); /** - * Format a binary size (magnitiudes are 2^10 rather than 10^3) from an apr_off_t, + * Format a binary size (magnitiudes are 2^10 rather than 10^3) from an fspr_off_t, * as bytes, K, M, T, etc, to a four character compacted human readable string. * @param size The size to format * @param buf The 5 byte text buffer (counting the trailing null) - * @return The buf passed to apr_strfsize() - * @remark All negative sizes report ' - ', apr_strfsize only formats positive values. + * @return The buf passed to fspr_strfsize() + * @remark All negative sizes report ' - ', fspr_strfsize only formats positive values. */ -APR_DECLARE(char *) apr_strfsize(apr_off_t size, char *buf); +APR_DECLARE(char *) fspr_strfsize(fspr_off_t size, char *buf); /** @} */ diff --git a/libs/apr/include/apr_support.h b/libs/apr/include/fspr_support.h similarity index 83% rename from libs/apr/include/apr_support.h rename to libs/apr/include/fspr_support.h index a6115172d1..3fa0611d28 100644 --- a/libs/apr/include/apr_support.h +++ b/libs/apr/include/fspr_support.h @@ -18,20 +18,20 @@ #define APR_SUPPORT_H /** - * @file apr_support.h + * @file fspr_support.h * @brief APR Support functions */ -#include "apr.h" -#include "apr_network_io.h" -#include "apr_file_io.h" +#include "fspr.h" +#include "fspr_network_io.h" +#include "fspr_file_io.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** - * @defgroup apr_support Internal APR support functions + * @defgroup fspr_support Internal APR support functions * @ingroup APR * @{ */ @@ -41,7 +41,7 @@ extern "C" { * * Uses POOL for temporary allocations. */ -apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, +fspr_status_t fspr_wait_for_io_or_timeout(fspr_file_t *f, fspr_socket_t *s, int for_read); /** @} */ diff --git a/libs/apr/include/apr_tables.h b/libs/apr/include/fspr_tables.h similarity index 74% rename from libs/apr/include/apr_tables.h rename to libs/apr/include/fspr_tables.h index 632f5b71b4..93d7f3bf87 100644 --- a/libs/apr/include/apr_tables.h +++ b/libs/apr/include/fspr_tables.h @@ -18,12 +18,12 @@ #define APR_TABLES_H /** - * @file apr_tables.h + * @file fspr_tables.h * @brief APR Table library */ -#include "apr.h" -#include "apr_pools.h" +#include "fspr.h" +#include "fspr_pools.h" #if APR_HAVE_STDARG_H #include /* for va_list */ @@ -34,7 +34,7 @@ extern "C" { #endif /* __cplusplus */ /** - * @defgroup apr_tables Table and Array Functions + * @defgroup fspr_tables Table and Array Functions * @ingroup APR * Tables are used to store entirely opaque structures * for applications, while Arrays are usually used to @@ -43,15 +43,15 @@ extern "C" { */ /** the table abstract data type */ -typedef struct apr_table_t apr_table_t; +typedef struct fspr_table_t fspr_table_t; -/** @see apr_array_header_t */ -typedef struct apr_array_header_t apr_array_header_t; +/** @see fspr_array_header_t */ +typedef struct fspr_array_header_t fspr_array_header_t; /** An opaque array type */ -struct apr_array_header_t { +struct fspr_array_header_t { /** The pool the array is allocated out of */ - apr_pool_t *pool; + fspr_pool_t *pool; /** The amount of memory allocated for each element of the array */ int elt_size; /** The number of active elements in the array */ @@ -65,10 +65,10 @@ struct apr_array_header_t { /** * The (opaque) structure for string-content tables. */ -typedef struct apr_table_entry_t apr_table_entry_t; +typedef struct fspr_table_entry_t fspr_table_entry_t; /** The type for each entry in a string-content table */ -struct apr_table_entry_t { +struct fspr_table_entry_t { /** The key for the current table entry */ char *key; /* maybe NULL in future; * check when iterating thru table_elts @@ -76,8 +76,8 @@ struct apr_table_entry_t { /** The value for the current table entry */ char *val; - /** A checksum for the key, for use by the apr_table internals */ - apr_uint32_t key_checksum; + /** A checksum for the key, for use by the fspr_table internals */ + fspr_uint32_t key_checksum; }; /** @@ -85,21 +85,21 @@ struct apr_table_entry_t { * @param t The table * @return An array containing the contents of the table */ -APR_DECLARE(const apr_array_header_t *) apr_table_elts(const apr_table_t *t); +APR_DECLARE(const fspr_array_header_t *) fspr_table_elts(const fspr_table_t *t); /** * Determine if the table is empty * @param t The table to check * @return True if empty, False otherwise */ -APR_DECLARE(int) apr_is_empty_table(const apr_table_t *t); +APR_DECLARE(int) fspr_is_empty_table(const fspr_table_t *t); /** * Determine if the array is empty * @param a The array to check * @return True if empty, False otherwise */ -APR_DECLARE(int) apr_is_empty_array(const apr_array_header_t *a); +APR_DECLARE(int) fspr_is_empty_array(const fspr_array_header_t *a); /** * Create an array @@ -108,7 +108,7 @@ APR_DECLARE(int) apr_is_empty_array(const apr_array_header_t *a); * @param elt_size The size of each element in the array. * @return The new array */ -APR_DECLARE(apr_array_header_t *) apr_array_make(apr_pool_t *p, +APR_DECLARE(fspr_array_header_t *) fspr_array_make(fspr_pool_t *p, int nelts, int elt_size); /** @@ -118,7 +118,7 @@ APR_DECLARE(apr_array_header_t *) apr_array_make(apr_pool_t *p, * @remark If there are no free spots in the array, then this function will * allocate new space for the new element. */ -APR_DECLARE(void *) apr_array_push(apr_array_header_t *arr); +APR_DECLARE(void *) fspr_array_push(fspr_array_header_t *arr); /** A helper macro for accessing a member of an APR array. * @@ -137,7 +137,7 @@ APR_DECLARE(void *) apr_array_push(apr_array_header_t *arr); * * @return the location where the new object should be placed */ -#define APR_ARRAY_PUSH(ary,type) (*((type *)apr_array_push(ary))) +#define APR_ARRAY_PUSH(ary,type) (*((type *)fspr_array_push(ary))) /** * Remove an element from an array (as a first-in, last-out stack) @@ -145,7 +145,7 @@ APR_DECLARE(void *) apr_array_push(apr_array_header_t *arr); * @return Location of the element in the array. * @remark If there are no elements in the array, NULL is returned. */ -APR_DECLARE(void *) apr_array_pop(apr_array_header_t *arr); +APR_DECLARE(void *) fspr_array_pop(fspr_array_header_t *arr); /** * Remove all elements from an array. @@ -153,7 +153,7 @@ APR_DECLARE(void *) apr_array_pop(apr_array_header_t *arr); * @remark As the underlying storage is allocated from a pool, no * memory is freed by this operation, but is available for reuse. */ -APR_DECLARE(void) apr_array_clear(apr_array_header_t *arr); +APR_DECLARE(void) fspr_array_clear(fspr_array_header_t *arr); /** * Concatenate two arrays together @@ -161,30 +161,30 @@ APR_DECLARE(void) apr_array_clear(apr_array_header_t *arr); * array * @param src The source array to add to the destination array */ -APR_DECLARE(void) apr_array_cat(apr_array_header_t *dst, - const apr_array_header_t *src); +APR_DECLARE(void) fspr_array_cat(fspr_array_header_t *dst, + const fspr_array_header_t *src); /** * Copy the entire array * @param p The pool to allocate the copy of the array out of * @param arr The array to copy * @return An exact copy of the array passed in - * @remark The alternate apr_array_copy_hdr copies only the header, and arranges + * @remark The alternate fspr_array_copy_hdr copies only the header, and arranges * for the elements to be copied if (and only if) the code subsequently * does a push or arraycat. */ -APR_DECLARE(apr_array_header_t *) apr_array_copy(apr_pool_t *p, - const apr_array_header_t *arr); +APR_DECLARE(fspr_array_header_t *) fspr_array_copy(fspr_pool_t *p, + const fspr_array_header_t *arr); /** * Copy the headers of the array, and arrange for the elements to be copied if * and only if the code subsequently does a push or arraycat. * @param p The pool to allocate the copy of the array out of * @param arr The array to copy * @return An exact copy of the array passed in - * @remark The alternate apr_array_copy copies the *entire* array. + * @remark The alternate fspr_array_copy copies the *entire* array. */ -APR_DECLARE(apr_array_header_t *) apr_array_copy_hdr(apr_pool_t *p, - const apr_array_header_t *arr); +APR_DECLARE(fspr_array_header_t *) fspr_array_copy_hdr(fspr_pool_t *p, + const fspr_array_header_t *arr); /** * Append one array to the end of another, creating a new array in the process. @@ -193,12 +193,12 @@ APR_DECLARE(apr_array_header_t *) apr_array_copy_hdr(apr_pool_t *p, * @param second The array to put second in the new array. * @return A new array containing the data from the two arrays passed in. */ -APR_DECLARE(apr_array_header_t *) apr_array_append(apr_pool_t *p, - const apr_array_header_t *first, - const apr_array_header_t *second); +APR_DECLARE(fspr_array_header_t *) fspr_array_append(fspr_pool_t *p, + const fspr_array_header_t *first, + const fspr_array_header_t *second); /** - * Generates a new string from the apr_pool_t containing the concatenated + * Generates a new string from the fspr_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 @@ -208,8 +208,8 @@ APR_DECLARE(apr_array_header_t *) apr_array_append(apr_pool_t *p, * @param sep The separator to use * @return A string containing all of the data in the array. */ -APR_DECLARE(char *) apr_array_pstrcat(apr_pool_t *p, - const apr_array_header_t *arr, +APR_DECLARE(char *) fspr_array_pstrcat(fspr_pool_t *p, + const fspr_array_header_t *arr, const char sep); /** @@ -219,7 +219,7 @@ APR_DECLARE(char *) apr_array_pstrcat(apr_pool_t *p, * @return The new table. * @warning This table can only store text data */ -APR_DECLARE(apr_table_t *) apr_table_make(apr_pool_t *p, int nelts); +APR_DECLARE(fspr_table_t *) fspr_table_make(fspr_pool_t *p, int nelts); /** * Create a new table and copy another table into it @@ -227,14 +227,14 @@ APR_DECLARE(apr_table_t *) apr_table_make(apr_pool_t *p, int nelts); * @param t The table to copy * @return A copy of the table passed in */ -APR_DECLARE(apr_table_t *) apr_table_copy(apr_pool_t *p, - const apr_table_t *t); +APR_DECLARE(fspr_table_t *) fspr_table_copy(fspr_pool_t *p, + const fspr_table_t *t); /** * Delete all of the elements from a table * @param t The table to clear */ -APR_DECLARE(void) apr_table_clear(apr_table_t *t); +APR_DECLARE(void) fspr_table_clear(fspr_table_t *t); /** * Get the value associated with a given key from the table. After this call, @@ -243,7 +243,7 @@ APR_DECLARE(void) apr_table_clear(apr_table_t *t); * @param key The key to search for * @return The value associated with the key, or NULL if the key does not exist. */ -APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key); +APR_DECLARE(const char *) fspr_table_get(const fspr_table_t *t, const char *key); /** * Add a key/value pair to a table, if another element already exists with the @@ -254,7 +254,7 @@ APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key); * @remark When adding data, this function makes a copy of both the key and the * value. */ -APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, +APR_DECLARE(void) fspr_table_set(fspr_table_t *t, const char *key, const char *val); /** @@ -267,7 +267,7 @@ APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, * the value, so care should be taken to ensure that the values will * not change after they have been added.. */ -APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, +APR_DECLARE(void) fspr_table_setn(fspr_table_t *t, const char *key, const char *val); /** @@ -275,7 +275,7 @@ APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, * @param t The table to remove data from * @param key The key of the data being removed */ -APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key); +APR_DECLARE(void) fspr_table_unset(fspr_table_t *t, const char *key); /** * Add data to a table by merging the value with data that has already been @@ -283,9 +283,9 @@ APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key); * @param t The table to search for the data * @param key The key to merge data for * @param val The data to add - * @remark If the key is not found, then this function acts like apr_table_add + * @remark If the key is not found, then this function acts like fspr_table_add */ -APR_DECLARE(void) apr_table_merge(apr_table_t *t, const char *key, +APR_DECLARE(void) fspr_table_merge(fspr_table_t *t, const char *key, const char *val); /** @@ -294,9 +294,9 @@ APR_DECLARE(void) apr_table_merge(apr_table_t *t, const char *key, * @param t The table to search for the data * @param key The key to merge data for * @param val The data to add - * @remark If the key is not found, then this function acts like apr_table_addn + * @remark If the key is not found, then this function acts like fspr_table_addn */ -APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, +APR_DECLARE(void) fspr_table_mergen(fspr_table_t *t, const char *key, const char *val); /** @@ -308,7 +308,7 @@ APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, * @remark When adding data, this function makes a copy of both the key and the * value. */ -APR_DECLARE(void) apr_table_add(apr_table_t *t, const char *key, +APR_DECLARE(void) fspr_table_add(fspr_table_t *t, const char *key, const char *val); /** @@ -321,7 +321,7 @@ APR_DECLARE(void) apr_table_add(apr_table_t *t, const char *key, * value, so care should be taken to ensure that the values will not * change after they have been added.. */ -APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, +APR_DECLARE(void) fspr_table_addn(fspr_table_t *t, const char *key, const char *val); /** @@ -331,21 +331,21 @@ APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, * @param base The table to add at the end of the new table * @return A new table containing all of the data from the two passed in */ -APR_DECLARE(apr_table_t *) apr_table_overlay(apr_pool_t *p, - const apr_table_t *overlay, - const apr_table_t *base); +APR_DECLARE(fspr_table_t *) fspr_table_overlay(fspr_pool_t *p, + const fspr_table_t *overlay, + const fspr_table_t *base); /** - * Declaration prototype for the iterator callback function of apr_table_do() - * and apr_table_vdo(). - * @param rec The data passed as the first argument to apr_table_[v]do() + * Declaration prototype for the iterator callback function of fspr_table_do() + * and fspr_table_vdo(). + * @param rec The data passed as the first argument to fspr_table_[v]do() * @param key The key from this iteration of the table * @param value The value from this iteration of the table * @remark Iteration continues while this callback function returns non-zero. - * To export the callback function for apr_table_[v]do() it must be declared + * To export the callback function for fspr_table_[v]do() it must be declared * in the _NONSTD convention. */ -typedef int (apr_table_do_callback_fn_t)(void *rec, const char *key, +typedef int (fspr_table_do_callback_fn_t)(void *rec, const char *key, const char *value); /** @@ -362,10 +362,10 @@ typedef int (apr_table_do_callback_fn_t)(void *rec, const char *key, * are run. * @return FALSE if one of the comp() iterations returned zero; TRUE if all * iterations returned non-zero - * @see apr_table_do_callback_fn_t + * @see fspr_table_do_callback_fn_t */ -APR_DECLARE_NONSTD(int) apr_table_do(apr_table_do_callback_fn_t *comp, - void *rec, const apr_table_t *t, ...); +APR_DECLARE_NONSTD(int) fspr_table_do(fspr_table_do_callback_fn_t *comp, + void *rec, const fspr_table_t *t, ...); /** * Iterate over a table running the provided function once for every @@ -381,14 +381,14 @@ APR_DECLARE_NONSTD(int) apr_table_do(apr_table_do_callback_fn_t *comp, * whose key matches are run. * @return FALSE if one of the comp() iterations returned zero; TRUE if all * iterations returned non-zero - * @see apr_table_do_callback_fn_t + * @see fspr_table_do_callback_fn_t */ -APR_DECLARE(int) apr_table_vdo(apr_table_do_callback_fn_t *comp, - void *rec, const apr_table_t *t, va_list vp); +APR_DECLARE(int) fspr_table_vdo(fspr_table_do_callback_fn_t *comp, + void *rec, const fspr_table_t *t, va_list vp); -/** flag for overlap to use apr_table_setn */ +/** flag for overlap to use fspr_table_setn */ #define APR_OVERLAP_TABLES_SET (0) -/** flag for overlap to use apr_table_mergen */ +/** flag for overlap to use fspr_table_mergen */ #define APR_OVERLAP_TABLES_MERGE (1) /** * For each element in table b, either use setn or mergen to add the data @@ -396,25 +396,25 @@ APR_DECLARE(int) apr_table_vdo(apr_table_do_callback_fn_t *comp, * @param a The table to add the data to. * @param b The table to iterate over, adding its data to table a * @param flags How to add the table to table a. One of: - * APR_OVERLAP_TABLES_SET Use apr_table_setn - * APR_OVERLAP_TABLES_MERGE Use apr_table_mergen + * APR_OVERLAP_TABLES_SET Use fspr_table_setn + * APR_OVERLAP_TABLES_MERGE Use fspr_table_mergen * @remark This function is highly optimized, and uses less memory and CPU cycles * than a function that just loops through table b calling other functions. */ /** *
    - * Conceptually, apr_table_overlap does this:
    + * Conceptually, fspr_table_overlap does this:
      *
    - *  apr_array_header_t *barr = apr_table_elts(b);
    - *  apr_table_entry_t *belt = (apr_table_entry_t *)barr->elts;
    + *  fspr_array_header_t *barr = fspr_table_elts(b);
    + *  fspr_table_entry_t *belt = (fspr_table_entry_t *)barr->elts;
      *  int i;
      *
      *  for (i = 0; i < barr->nelts; ++i) {
      *      if (flags & APR_OVERLAP_TABLES_MERGE) {
    - *          apr_table_mergen(a, belt[i].key, belt[i].val);
    + *          fspr_table_mergen(a, belt[i].key, belt[i].val);
      *      }
      *      else {
    - *          apr_table_setn(a, belt[i].key, belt[i].val);
    + *          fspr_table_setn(a, belt[i].key, belt[i].val);
      *      }
      *  }
      *
    @@ -427,7 +427,7 @@ APR_DECLARE(int) apr_table_vdo(apr_table_do_callback_fn_t *comp,
      * 
    */ -APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, +APR_DECLARE(void) fspr_table_overlap(fspr_table_t *a, const fspr_table_t *b, unsigned flags); /** @@ -438,7 +438,7 @@ APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, * @param flags APR_OVERLAP_TABLES_MERGE to merge, or * APR_OVERLAP_TABLES_SET to overwrite */ -APR_DECLARE(void) apr_table_compress(apr_table_t *t, unsigned flags); +APR_DECLARE(void) fspr_table_compress(fspr_table_t *t, unsigned flags); /** @} */ diff --git a/libs/apr/include/apr_thread_cond.h b/libs/apr/include/fspr_thread_cond.h similarity index 79% rename from libs/apr/include/apr_thread_cond.h rename to libs/apr/include/fspr_thread_cond.h index 3744b09042..7ece46e281 100644 --- a/libs/apr/include/apr_thread_cond.h +++ b/libs/apr/include/fspr_thread_cond.h @@ -18,15 +18,15 @@ #define APR_THREAD_COND_H /** - * @file apr_thread_cond.h + * @file fspr_thread_cond.h * @brief APR Condition Variable Routines */ -#include "apr.h" -#include "apr_pools.h" -#include "apr_errno.h" -#include "apr_time.h" -#include "apr_thread_mutex.h" +#include "fspr.h" +#include "fspr_pools.h" +#include "fspr_errno.h" +#include "fspr_time.h" +#include "fspr_thread_mutex.h" #ifdef __cplusplus extern "C" { @@ -35,13 +35,13 @@ extern "C" { #if APR_HAS_THREADS || defined(DOXYGEN) /** - * @defgroup apr_thread_cond Condition Variable Routines + * @defgroup fspr_thread_cond Condition Variable Routines * @ingroup APR * @{ */ /** Opaque structure for thread condition variables */ -typedef struct apr_thread_cond_t apr_thread_cond_t; +typedef struct fspr_thread_cond_t fspr_thread_cond_t; /** * Note: destroying a condition variable (or likewise, destroying or @@ -56,8 +56,8 @@ typedef struct apr_thread_cond_t apr_thread_cond_t; * will be stored. * @param pool the pool from which to allocate the mutex. */ -APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, - apr_pool_t *pool); +APR_DECLARE(fspr_status_t) fspr_thread_cond_create(fspr_thread_cond_t **cond, + fspr_pool_t *pool); /** * Put the active calling thread to sleep until signaled to wake up. Each @@ -71,8 +71,8 @@ APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, * is released while the thread is asleep, and is again acquired before * returning from this function. */ -APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, - apr_thread_mutex_t *mutex); +APR_DECLARE(fspr_status_t) fspr_thread_cond_wait(fspr_thread_cond_t *cond, + fspr_thread_mutex_t *mutex); /** * Put the active calling thread to sleep until signaled to wake up or @@ -90,9 +90,9 @@ APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, * will wake up before this time, otherwise the error APR_TIMEUP * is returned. */ -APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, - apr_thread_mutex_t *mutex, - apr_interval_time_t timeout); +APR_DECLARE(fspr_status_t) fspr_thread_cond_timedwait(fspr_thread_cond_t *cond, + fspr_thread_mutex_t *mutex, + fspr_interval_time_t timeout); /** * Signals a single thread, if one exists, that is blocking on the given @@ -101,7 +101,7 @@ APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, * is desired, that mutex must be locked while calling this function. * @param cond the condition variable on which to produce the signal. */ -APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond); +APR_DECLARE(fspr_status_t) fspr_thread_cond_signal(fspr_thread_cond_t *cond); /** * Signals all threads blocking on the given condition variable. @@ -109,17 +109,17 @@ APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond); * the associated mutex. This will happen in a serialized manner. * @param cond the condition variable on which to produce the broadcast. */ -APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond); +APR_DECLARE(fspr_status_t) fspr_thread_cond_broadcast(fspr_thread_cond_t *cond); /** * Destroy the condition variable and free the associated memory. * @param cond the condition variable to destroy. */ -APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond); +APR_DECLARE(fspr_status_t) fspr_thread_cond_destroy(fspr_thread_cond_t *cond); /** * Get the pool used by this thread_cond. - * @return apr_pool_t the pool + * @return fspr_pool_t the pool */ APR_POOL_DECLARE_ACCESSOR(thread_cond); diff --git a/libs/apr/include/apr_thread_mutex.h b/libs/apr/include/fspr_thread_mutex.h similarity index 81% rename from libs/apr/include/apr_thread_mutex.h rename to libs/apr/include/fspr_thread_mutex.h index 4596dce5d2..0edf7942d6 100644 --- a/libs/apr/include/apr_thread_mutex.h +++ b/libs/apr/include/fspr_thread_mutex.h @@ -18,12 +18,12 @@ #define APR_THREAD_MUTEX_H /** - * @file apr_thread_mutex.h + * @file fspr_thread_mutex.h * @brief APR Thread Mutex Routines */ -#include "apr.h" -#include "apr_errno.h" +#include "fspr.h" +#include "fspr_errno.h" #ifdef __cplusplus extern "C" { @@ -32,20 +32,20 @@ extern "C" { #if APR_HAS_THREADS || defined(DOXYGEN) /** - * @defgroup apr_thread_mutex Thread Mutex Routines + * @defgroup fspr_thread_mutex Thread Mutex Routines * @ingroup APR * @{ */ /** Opaque thread-local mutex structure */ -typedef struct apr_thread_mutex_t apr_thread_mutex_t; +typedef struct fspr_thread_mutex_t fspr_thread_mutex_t; #define APR_THREAD_MUTEX_DEFAULT 0x0 /**< platform-optimal lock behavior */ #define APR_THREAD_MUTEX_NESTED 0x1 /**< enable nested (recursive) locks */ #define APR_THREAD_MUTEX_UNNESTED 0x2 /**< disable nested locks */ /* Delayed the include to avoid a circular reference */ -#include "apr_pools.h" +#include "fspr_pools.h" /** * Create and initialize a mutex that can be used to synchronize threads. @@ -62,15 +62,15 @@ typedef struct apr_thread_mutex_t apr_thread_mutex_t; * most optimial mutex based on a given platform's performance charateristics, * it will behave as either a nested or an unnested lock. */ -APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, +APR_DECLARE(fspr_status_t) fspr_thread_mutex_create(fspr_thread_mutex_t **mutex, unsigned int flags, - apr_pool_t *pool); + fspr_pool_t *pool); /** * Acquire the lock for the given mutex. If the mutex is already locked, * the current thread will be put to sleep until the lock becomes available. * @param mutex the mutex on which to acquire the lock. */ -APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex); +APR_DECLARE(fspr_status_t) fspr_thread_mutex_lock(fspr_thread_mutex_t *mutex); /** * Attempt to acquire the lock for the given mutex. If the mutex has already @@ -79,23 +79,23 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex); * if the return value was APR_EBUSY, for portability reasons. * @param mutex the mutex on which to attempt the lock acquiring. */ -APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex); +APR_DECLARE(fspr_status_t) fspr_thread_mutex_trylock(fspr_thread_mutex_t *mutex); /** * Release the lock for the given mutex. * @param mutex the mutex from which to release the lock. */ -APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex); +APR_DECLARE(fspr_status_t) fspr_thread_mutex_unlock(fspr_thread_mutex_t *mutex); /** * Destroy the mutex and free the memory associated with the lock. * @param mutex the mutex to destroy. */ -APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex); +APR_DECLARE(fspr_status_t) fspr_thread_mutex_destroy(fspr_thread_mutex_t *mutex); /** * Get the pool used by this thread_mutex. - * @return apr_pool_t the pool + * @return fspr_pool_t the pool */ APR_POOL_DECLARE_ACCESSOR(thread_mutex); diff --git a/libs/apr/include/apr_thread_proc.h b/libs/apr/include/fspr_thread_proc.h similarity index 71% rename from libs/apr/include/apr_thread_proc.h rename to libs/apr/include/fspr_thread_proc.h index c7930901b2..842f045092 100644 --- a/libs/apr/include/apr_thread_proc.h +++ b/libs/apr/include/fspr_thread_proc.h @@ -18,14 +18,14 @@ #define APR_THREAD_PROC_H /** - * @file apr_thread_proc.h + * @file fspr_thread_proc.h * @brief APR Thread and Process Library */ -#include "apr.h" -#include "apr_file_io.h" -#include "apr_pools.h" -#include "apr_errno.h" +#include "fspr.h" +#include "fspr_file_io.h" +#include "fspr_pools.h" +#include "fspr_errno.h" #if APR_HAVE_STRUCT_RLIMIT #include @@ -37,7 +37,7 @@ extern "C" { #endif /* __cplusplus */ /** - * @defgroup apr_thread_proc Threads and Process Functions + * @defgroup fspr_thread_proc Threads and Process Functions * @ingroup APR * @{ */ @@ -50,12 +50,12 @@ typedef enum { APR_SHELLCMD_ENV /**< use the shell to invoke the program, * replicating our environment */ -} apr_cmdtype_e; +} fspr_cmdtype_e; typedef enum { APR_WAIT, /**< wait for the specified process to finish */ APR_NOWAIT /**< do not wait -- just see if it has finished */ -} apr_wait_how_e; +} fspr_wait_how_e; /* I am specifically calling out the values so that the macros below make * more sense. Yes, I know I don't need to, but I am hoping this makes what @@ -66,7 +66,7 @@ typedef enum { APR_PROC_EXIT = 1, /**< process exited normally */ APR_PROC_SIGNAL = 2, /**< process exited due to a signal */ APR_PROC_SIGNAL_CORE = 4 /**< process exited and dumped a core file */ -} apr_exit_why_e; +} fspr_exit_why_e; /** did we exit the process */ #define APR_PROC_CHECK_EXIT(x) (x & APR_PROC_EXIT) @@ -75,25 +75,25 @@ typedef enum { /** did we get core */ #define APR_PROC_CHECK_CORE_DUMP(x) (x & APR_PROC_SIGNAL_CORE) -/** @see apr_procattr_io_set */ +/** @see fspr_procattr_io_set */ #define APR_NO_PIPE 0 -/** @see apr_procattr_io_set */ +/** @see fspr_procattr_io_set */ #define APR_FULL_BLOCK 1 -/** @see apr_procattr_io_set */ +/** @see fspr_procattr_io_set */ #define APR_FULL_NONBLOCK 2 -/** @see apr_procattr_io_set */ +/** @see fspr_procattr_io_set */ #define APR_PARENT_BLOCK 3 -/** @see apr_procattr_io_set */ +/** @see fspr_procattr_io_set */ #define APR_CHILD_BLOCK 4 -/** @see apr_procattr_limit_set */ +/** @see fspr_procattr_limit_set */ #define APR_LIMIT_CPU 0 -/** @see apr_procattr_limit_set */ +/** @see fspr_procattr_limit_set */ #define APR_LIMIT_MEM 1 -/** @see apr_procattr_limit_set */ +/** @see fspr_procattr_limit_set */ #define APR_LIMIT_NPROC 2 -/** @see apr_procattr_limit_set */ +/** @see fspr_procattr_limit_set */ #define APR_LIMIT_NOFILE 3 /** @@ -119,15 +119,15 @@ typedef enum { /** @} */ /** The APR process type */ -typedef struct apr_proc_t { +typedef struct fspr_proc_t { /** The process ID */ pid_t pid; /** Parent's side of pipe to child's stdin */ - apr_file_t *in; + fspr_file_t *in; /** Parent's side of pipe to child's stdout */ - apr_file_t *out; + fspr_file_t *out; /** Parent's side of pipe to child's stdouterr */ - apr_file_t *err; + fspr_file_t *err; #if APR_HAS_PROC_INVOKED || defined(DOXYGEN) /** Diagnositics/debugging string of the command invoked for * this process [only present if APR_HAS_PROC_INVOKED is true] @@ -147,51 +147,51 @@ typedef struct apr_proc_t { */ HANDLE hproc; #endif -} apr_proc_t; +} fspr_proc_t; /** * The prototype for APR child errfn functions. (See the description - * of apr_procattr_child_errfn_set() for more information.) + * of fspr_procattr_child_errfn_set() for more information.) * It is passed the following parameters: - * @param pool Pool associated with the apr_proc_t. If your child + * @param pool Pool associated with the fspr_proc_t. If your child * error function needs user data, associate it with this * pool. * @param err APR error code describing the error * @param description Text description of type of processing which failed */ -typedef void (apr_child_errfn_t)(apr_pool_t *proc, apr_status_t err, +typedef void (fspr_child_errfn_t)(fspr_pool_t *proc, fspr_status_t err, const char *description); /** Opaque Thread structure. */ -typedef struct apr_thread_t apr_thread_t; +typedef struct fspr_thread_t fspr_thread_t; /** Opaque Thread attributes structure. */ -typedef struct apr_threadattr_t apr_threadattr_t; +typedef struct fspr_threadattr_t fspr_threadattr_t; /** Opaque Process attributes structure. */ -typedef struct apr_procattr_t apr_procattr_t; +typedef struct fspr_procattr_t fspr_procattr_t; /** Opaque control variable for one-time atomic variables. */ -typedef struct apr_thread_once_t apr_thread_once_t; +typedef struct fspr_thread_once_t fspr_thread_once_t; /** Opaque thread private address space. */ -typedef struct apr_threadkey_t apr_threadkey_t; +typedef struct fspr_threadkey_t fspr_threadkey_t; /** Opaque record of child process. */ -typedef struct apr_other_child_rec_t apr_other_child_rec_t; +typedef struct fspr_other_child_rec_t fspr_other_child_rec_t; /** * The prototype for any APR thread worker functions. */ -typedef void *(APR_THREAD_FUNC *apr_thread_start_t)(apr_thread_t*, void*); +typedef void *(APR_THREAD_FUNC *fspr_thread_start_t)(fspr_thread_t*, void*); typedef enum { APR_KILL_NEVER, /**< process is never sent any signals */ - APR_KILL_ALWAYS, /**< process is sent SIGKILL on apr_pool_t cleanup */ + APR_KILL_ALWAYS, /**< process is sent SIGKILL on fspr_pool_t cleanup */ APR_KILL_AFTER_TIMEOUT, /**< SIGTERM, wait 3 seconds, SIGKILL */ APR_JUST_WAIT, /**< wait forever for the process to complete */ APR_KILL_ONLY_ONCE /**< send SIGTERM and then wait */ -} apr_kill_conditions_e; +} fspr_kill_conditions_e; /* Thread Function definitions */ @@ -202,16 +202,16 @@ typedef enum { * @param new_attr The newly created threadattr. * @param cont The pool to use */ -APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new_attr, - apr_pool_t *cont); +APR_DECLARE(fspr_status_t) fspr_threadattr_create(fspr_threadattr_t **new_attr, + fspr_pool_t *cont); /** * Set if newly created threads should be created in detached state. * @param attr The threadattr to affect * @param on Non-zero if detached threads should be created. */ -APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, - apr_int32_t on); +APR_DECLARE(fspr_status_t) fspr_threadattr_detach_set(fspr_threadattr_t *attr, + fspr_int32_t on); /** * Get the detach state for this threadattr. @@ -219,15 +219,15 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, * @return APR_DETACH if threads are to be detached, or APR_NOTDETACH * if threads are to be joinable. */ -APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr); +APR_DECLARE(fspr_status_t) fspr_threadattr_detach_get(fspr_threadattr_t *attr); /** * Set the stack size of newly created threads. * @param attr The threadattr to affect * @param stacksize The stack size in bytes */ -APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr, - apr_size_t stacksize); +APR_DECLARE(fspr_status_t) fspr_threadattr_stacksize_set(fspr_threadattr_t *attr, + fspr_size_t stacksize); /** * Set the stack guard area size of newly created threads. @@ -239,8 +239,8 @@ APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr, * and increases memory management overhead. Setting the guard area * size to zero hence trades off reliable behaviour on stack overflow * for performance. */ -APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr, - apr_size_t guardsize); +APR_DECLARE(fspr_status_t) fspr_threadattr_guardsize_set(fspr_threadattr_t *attr, + fspr_size_t guardsize); /** * Create a new thread of execution @@ -250,40 +250,40 @@ APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr, * @param data Any data to be passed to the starting function * @param cont The pool to use */ -APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new_thread, - apr_threadattr_t *attr, - apr_thread_start_t func, - void *data, apr_pool_t *cont); +APR_DECLARE(fspr_status_t) fspr_thread_create(fspr_thread_t **new_thread, + fspr_threadattr_t *attr, + fspr_thread_start_t func, + void *data, fspr_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 */ -APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, - apr_status_t retval); +APR_DECLARE(fspr_status_t) fspr_thread_exit(fspr_thread_t *thd, + fspr_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 */ -APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, - apr_thread_t *thd); +APR_DECLARE(fspr_status_t) fspr_thread_join(fspr_status_t *retval, + fspr_thread_t *thd); /** * force the current thread to yield the processor */ -APR_DECLARE(void) apr_thread_yield(void); +APR_DECLARE(void) fspr_thread_yield(void); /** - * Initialize the control variable for apr_thread_once. If this isn't - * called, apr_initialize won't work. + * Initialize the control variable for fspr_thread_once. If this isn't + * called, fspr_initialize won't work. * @param control The control variable to initialize * @param p The pool to allocate data from. */ -APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control, - apr_pool_t *p); +APR_DECLARE(fspr_status_t) fspr_thread_once_init(fspr_thread_once_t **control, + fspr_pool_t *p); /** * Run the specified function one time, regardless of how many threads @@ -294,14 +294,14 @@ APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control, * if the function has ever been called before. * @param func The function to call. */ -APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, +APR_DECLARE(fspr_status_t) fspr_thread_once(fspr_thread_once_t *control, void (*func)(void)); /** * detach a thread * @param thd The thread to detach */ -APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd); +APR_DECLARE(fspr_status_t) fspr_thread_detach(fspr_thread_t *thd); /** * Return the pool associated with the current thread. @@ -309,8 +309,8 @@ APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd); * @param key The key to associate with the data * @param thread The currently open thread. */ -APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, - apr_thread_t *thread); +APR_DECLARE(fspr_status_t) fspr_thread_data_get(void **data, const char *key, + fspr_thread_t *thread); /** * Return the pool associated with the current thread. @@ -319,9 +319,9 @@ APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, * @param cleanup The cleanup routine to use when the thread is destroyed. * @param thread The currently open thread. */ -APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_thread_t *thread); +APR_DECLARE(fspr_status_t) fspr_thread_data_set(void *data, const char *key, + fspr_status_t (*cleanup) (void *), + fspr_thread_t *thread); /** * Create and initialize a new thread private address space @@ -329,31 +329,31 @@ APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key, * @param dest The destructor to use when freeing the private memory. * @param cont The pool to use */ -APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, +APR_DECLARE(fspr_status_t) fspr_threadkey_private_create(fspr_threadkey_t **key, void (*dest)(void *), - apr_pool_t *cont); + fspr_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 */ -APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new_mem, - apr_threadkey_t *key); +APR_DECLARE(fspr_status_t) fspr_threadkey_private_get(void **new_mem, + fspr_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 */ -APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, - apr_threadkey_t *key); +APR_DECLARE(fspr_status_t) fspr_threadkey_private_set(void *priv, + fspr_threadkey_t *key); /** * Free the thread private memory * @param key The handle for the desired thread private memory */ -APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key); +APR_DECLARE(fspr_status_t) fspr_threadkey_private_delete(fspr_threadkey_t *key); /** * Return the pool associated with the current threadkey. @@ -361,8 +361,8 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key); * @param key The key associated with the data * @param threadkey The currently open threadkey. */ -APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key, - apr_threadkey_t *threadkey); +APR_DECLARE(fspr_status_t) fspr_threadkey_data_get(void **data, const char *key, + fspr_threadkey_t *threadkey); /** * Return the pool associated with the current threadkey. @@ -371,9 +371,9 @@ APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key, * @param cleanup The cleanup routine to use when the file is destroyed. * @param threadkey The currently open threadkey. */ -APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_threadkey_t *threadkey); +APR_DECLARE(fspr_status_t) fspr_threadkey_data_set(void *data, const char *key, + fspr_status_t (*cleanup) (void *), + fspr_threadkey_t *threadkey); #endif @@ -382,8 +382,8 @@ APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key, * @param new_attr The newly created procattr. * @param cont The pool to use */ -APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new_attr, - apr_pool_t *cont); +APR_DECLARE(fspr_status_t) fspr_procattr_create(fspr_procattr_t **new_attr, + fspr_pool_t *cont); /** * Determine if any of stdin, stdout, or stderr should be linked to pipes @@ -393,15 +393,15 @@ APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new_attr, * @param out Should stdout be a pipe back to the parent? * @param err Should stderr be a pipe back to the parent? */ -APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, - apr_int32_t in, apr_int32_t out, - apr_int32_t err); +APR_DECLARE(fspr_status_t) fspr_procattr_io_set(fspr_procattr_t *attr, + fspr_int32_t in, fspr_int32_t out, + fspr_int32_t err); /** - * Set the child_in and/or parent_in values to existing apr_file_t values. + * Set the child_in and/or parent_in values to existing fspr_file_t values. * @param attr The procattr we care about. - * @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. + * @param child_in fspr_file_t value to use as child_in. Must be a valid file. + * @param parent_in fspr_file_t value to use as parent_in. Must be a valid file. * @remark 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 multiple @@ -409,37 +409,37 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, * extra function calls by not creating your own pipe since this * creates one in the process space for you. */ -APR_DECLARE(apr_status_t) apr_procattr_child_in_set(struct apr_procattr_t *attr, - apr_file_t *child_in, - apr_file_t *parent_in); +APR_DECLARE(fspr_status_t) fspr_procattr_child_in_set(struct fspr_procattr_t *attr, + fspr_file_t *child_in, + fspr_file_t *parent_in); /** - * Set the child_out and parent_out values to existing apr_file_t values. + * Set the child_out and parent_out values to existing fspr_file_t values. * @param attr The procattr we care about. - * @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. + * @param child_out fspr_file_t value to use as child_out. Must be a valid file. + * @param parent_out fspr_file_t value to use as parent_out. Must be a valid file. * @remark 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 multiple * process invocations - such as a log file. */ -APR_DECLARE(apr_status_t) apr_procattr_child_out_set(struct apr_procattr_t *attr, - apr_file_t *child_out, - apr_file_t *parent_out); +APR_DECLARE(fspr_status_t) fspr_procattr_child_out_set(struct fspr_procattr_t *attr, + fspr_file_t *child_out, + fspr_file_t *parent_out); /** - * Set the child_err and parent_err values to existing apr_file_t values. + * Set the child_err and parent_err values to existing fspr_file_t values. * @param attr The procattr we care about. - * @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. + * @param child_err fspr_file_t value to use as child_err. Must be a valid file. + * @param parent_err fspr_file_t value to use as parent_err. Must be a valid file. * @remark 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 multiple * process invocations - such as a log file. */ -APR_DECLARE(apr_status_t) apr_procattr_child_err_set(struct apr_procattr_t *attr, - apr_file_t *child_err, - apr_file_t *parent_err); +APR_DECLARE(fspr_status_t) fspr_procattr_child_err_set(struct fspr_procattr_t *attr, + fspr_file_t *child_err, + fspr_file_t *parent_err); /** * Set which directory the child process should start executing in. @@ -448,7 +448,7 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(struct apr_procattr_t *attr * the parent currently resides in, when the createprocess call * is made. */ -APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, +APR_DECLARE(fspr_status_t) fspr_procattr_dir_set(fspr_procattr_t *attr, const char *dir); /** @@ -462,16 +462,16 @@ APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, * APR_PROGRAM_PATH -- Executable program on PATH, copy env * */ -APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, - apr_cmdtype_e cmd); +APR_DECLARE(fspr_status_t) fspr_procattr_cmdtype_set(fspr_procattr_t *attr, + fspr_cmdtype_e cmd); /** * Determine if the child should start in detached state. * @param attr The procattr we care about. * @param detach Should the child start in detached state? Default is no. */ -APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, - apr_int32_t detach); +APR_DECLARE(fspr_status_t) fspr_procattr_detach_set(fspr_procattr_t *attr, + fspr_int32_t detach); #if APR_HAVE_STRUCT_RLIMIT /** @@ -486,8 +486,8 @@ APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, * * @param limit Value to set the limit to. */ -APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, - apr_int32_t what, +APR_DECLARE(fspr_status_t) fspr_procattr_limit_set(fspr_procattr_t *attr, + fspr_int32_t what, struct rlimit *limit); #endif @@ -496,29 +496,29 @@ APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, * encounters an error in the child prior to running the specified program. * @param attr The procattr describing the child process to be created. * @param errfn The function to call in the child process. - * @remark At the present time, it will only be called from apr_proc_create() + * @remark At the present time, it will only be called from fspr_proc_create() * on platforms where fork() is used. It will never be called on other - * platforms, on those platforms apr_proc_create() will return the error + * platforms, on those platforms fspr_proc_create() will return the error * in the parent process rather than invoke the callback in the now-forked * child process. */ -APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr, - apr_child_errfn_t *errfn); +APR_DECLARE(fspr_status_t) fspr_procattr_child_errfn_set(fspr_procattr_t *attr, + fspr_child_errfn_t *errfn); /** - * Specify that apr_proc_create() should do whatever it can to report - * failures to the caller of apr_proc_create(), rather than find out in + * Specify that fspr_proc_create() should do whatever it can to report + * failures to the caller of fspr_proc_create(), rather than find out in * the child. * @param attr The procattr describing the child process to be created. * @param chk Flag to indicate whether or not extra work should be done * to try to report failures to the caller. - * @remark This flag only affects apr_proc_create() on platforms where + * @remark This flag only affects fspr_proc_create() on platforms where * fork() is used. This leads to extra overhead in the calling * process, but that may help the application handle such * errors more gracefully. */ -APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr, - apr_int32_t chk); +APR_DECLARE(fspr_status_t) fspr_procattr_error_check_set(fspr_procattr_t *attr, + fspr_int32_t chk); /** * Determine if the child should start in its own address space or using the @@ -527,8 +527,8 @@ APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr, * @param addrspace Should the child start in its own address space? Default * is no on NetWare and yes on other platforms. */ -APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr, - apr_int32_t addrspace); +APR_DECLARE(fspr_status_t) fspr_procattr_addrspace_set(fspr_procattr_t *attr, + fspr_int32_t addrspace); /** * Set the username used for running process @@ -538,7 +538,7 @@ APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr, * or any other platform having * APR_PROCATTR_USER_SET_REQUIRES_PASSWORD set. */ -APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, +APR_DECLARE(fspr_status_t) fspr_procattr_user_set(fspr_procattr_t *attr, const char *username, const char *password); @@ -547,7 +547,7 @@ APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, * @param attr The procattr we care about. * @param groupname The group name used */ -APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr, +APR_DECLARE(fspr_status_t) fspr_procattr_group_set(fspr_procattr_t *attr, const char *groupname); @@ -560,7 +560,7 @@ APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr, * @remark returns APR_INCHILD for the child, and APR_INPARENT for the parent * or an error. */ -APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont); +APR_DECLARE(fspr_status_t) fspr_proc_fork(fspr_proc_t *proc, fspr_pool_t *cont); #endif /** @@ -577,14 +577,14 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont); * process * @param pool The pool to use. * @note This function returns without waiting for the new process to terminate; - * use apr_proc_wait for that. + * use fspr_proc_wait for that. */ -APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new_proc, +APR_DECLARE(fspr_status_t) fspr_proc_create(fspr_proc_t *new_proc, const char *progname, const char * const *args, const char * const *env, - apr_procattr_t *attr, - apr_pool_t *pool); + fspr_procattr_t *attr, + fspr_pool_t *pool); /** * Wait for a child process to die @@ -612,9 +612,9 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new_proc, * APR_CHILD_NOTDONE -- child is still running. * */ -APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, - int *exitcode, apr_exit_why_e *exitwhy, - apr_wait_how_e waithow); +APR_DECLARE(fspr_status_t) fspr_proc_wait(fspr_proc_t *proc, + int *exitcode, fspr_exit_why_e *exitwhy, + fspr_wait_how_e waithow); /** * Wait for any current child process to die and return information @@ -642,11 +642,11 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, * @bug Passing proc as a *proc rather than **proc was an odd choice * for some platforms... this should be revisited in 1.0 */ -APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, +APR_DECLARE(fspr_status_t) fspr_proc_wait_all_procs(fspr_proc_t *proc, int *exitcode, - apr_exit_why_e *exitwhy, - apr_wait_how_e waithow, - apr_pool_t *p); + fspr_exit_why_e *exitwhy, + fspr_wait_how_e waithow, + fspr_pool_t *p); #define APR_PROC_DETACH_FOREGROUND 0 /**< Do not detach */ #define APR_PROC_DETACH_DAEMONIZE 1 /**< Detach */ @@ -657,7 +657,7 @@ APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, * and become a background process, else it will * stay in the foreground. */ -APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize); +APR_DECLARE(fspr_status_t) fspr_proc_detach(int daemonize); /** * Register an other_child -- a child associated to its registered @@ -676,12 +676,12 @@ APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize); * proc->in/out/err handles should be health checked. * @bug no platform currently tests the pipes health. */ -APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *proc, +APR_DECLARE(void) fspr_proc_other_child_register(fspr_proc_t *proc, void (*maintenance) (int reason, void *, int status), - void *data, apr_file_t *write_fd, - apr_pool_t *p); + void *data, fspr_file_t *write_fd, + fspr_pool_t *p); /** * Stop watching the specified other child. @@ -692,7 +692,7 @@ APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *proc, * themself by loading ocr->next before calling any maintenance * function. */ -APR_DECLARE(void) apr_proc_other_child_unregister(void *data); +APR_DECLARE(void) fspr_proc_other_child_unregister(void *data); /** * Notify the maintenance callback of a registered other child process @@ -702,10 +702,10 @@ APR_DECLARE(void) apr_proc_other_child_unregister(void *data); * @param status The status to pass to the maintenance function * @remark An example of code using this behavior; *
    - * rv = apr_proc_wait_all_procs(&proc, &exitcode, &status, APR_WAIT, p);
    + * rv = fspr_proc_wait_all_procs(&proc, &exitcode, &status, APR_WAIT, p);
      * if (APR_STATUS_IS_CHILD_DONE(rv)) {
      * #if APR_HAS_OTHER_CHILD
    - *     if (apr_proc_other_child_alert(&proc, APR_OC_REASON_DEATH, status)
    + *     if (fspr_proc_other_child_alert(&proc, APR_OC_REASON_DEATH, status)
      *             == APR_SUCCESS) {
      *         ;  (already handled)
      *     }
    @@ -714,7 +714,7 @@ APR_DECLARE(void) apr_proc_other_child_unregister(void *data);
      *         [... handling non-otherchild processes death ...]
      * 
    */ -APR_DECLARE(apr_status_t) apr_proc_other_child_alert(apr_proc_t *proc, +APR_DECLARE(fspr_status_t) fspr_proc_other_child_alert(fspr_proc_t *proc, int reason, int status); @@ -725,7 +725,7 @@ APR_DECLARE(apr_status_t) apr_proc_other_child_alert(apr_proc_t *proc, * @param ocr The registered other child * @param reason The reason code (e.g. APR_OC_REASON_RESTART) if still running */ -APR_DECLARE(void) apr_proc_other_child_refresh(apr_other_child_rec_t *ocr, +APR_DECLARE(void) fspr_proc_other_child_refresh(fspr_other_child_rec_t *ocr, int reason); /** @@ -734,14 +734,14 @@ APR_DECLARE(void) apr_proc_other_child_refresh(apr_other_child_rec_t *ocr, * code if the process is no longer healthy. * @param reason The reason code (e.g. APR_OC_REASON_RESTART) to running processes */ -APR_DECLARE(void) apr_proc_other_child_refresh_all(int reason); +APR_DECLARE(void) fspr_proc_other_child_refresh_all(int reason); /** * Terminate a process. * @param proc The process to terminate. * @param sig How to kill the process. */ -APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int sig); +APR_DECLARE(fspr_status_t) fspr_proc_kill(fspr_proc_t *proc, int sig); /** * Register a process to be killed when a pool dies. @@ -750,14 +750,14 @@ APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int sig); * @param how How to kill the process, one of: *
      *         APR_KILL_NEVER         -- process is never sent any signals
    - *         APR_KILL_ALWAYS        -- process is sent SIGKILL on apr_pool_t cleanup
    + *         APR_KILL_ALWAYS        -- process is sent SIGKILL on fspr_pool_t cleanup
      *         APR_KILL_AFTER_TIMEOUT -- SIGTERM, wait 3 seconds, SIGKILL
      *         APR_JUST_WAIT          -- wait forever for the process to complete
      *         APR_KILL_ONLY_ONCE     -- send SIGTERM and then wait
      * 
    */ -APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *proc, - apr_kill_conditions_e how); +APR_DECLARE(void) fspr_pool_note_subprocess(fspr_pool_t *a, fspr_proc_t *proc, + fspr_kill_conditions_e how); #if APR_HAS_THREADS @@ -767,22 +767,22 @@ APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *proc, * Setup the process for a single thread to be used for all signal handling. * @warning This must be called before any threads are created */ -APR_DECLARE(apr_status_t) apr_setup_signal_thread(void); +APR_DECLARE(fspr_status_t) fspr_setup_signal_thread(void); /** * Make the current thread listen for signals. This thread will loop * forever, calling a provided function whenever it receives a signal. That * functions should return 1 if the signal has been handled, 0 otherwise. * @param signal_handler The function to call when a signal is received - * apr_status_t apr_signal_thread((int)(*signal_handler)(int signum)) + * fspr_status_t fspr_signal_thread((int)(*signal_handler)(int signum)) */ -APR_DECLARE(apr_status_t) apr_signal_thread(int(*signal_handler)(int signum)); +APR_DECLARE(fspr_status_t) fspr_signal_thread(int(*signal_handler)(int signum)); #endif /* (APR_HAVE_SIGWAIT || APR_HAVE_SIGSUSPEND) && !defined(OS2) */ /** * Get the child-pool used by the thread from the thread info. - * @return apr_pool_t the pool + * @return fspr_pool_t the pool */ APR_POOL_DECLARE_ACCESSOR(thread); diff --git a/libs/apr/include/apr_thread_rwlock.h b/libs/apr/include/fspr_thread_rwlock.h similarity index 78% rename from libs/apr/include/apr_thread_rwlock.h rename to libs/apr/include/fspr_thread_rwlock.h index 0bd958fbfa..57f36fce31 100644 --- a/libs/apr/include/apr_thread_rwlock.h +++ b/libs/apr/include/fspr_thread_rwlock.h @@ -18,13 +18,13 @@ #define APR_THREAD_RWLOCK_H /** - * @file apr_thread_rwlock.h + * @file fspr_thread_rwlock.h * @brief APR Reader/Writer Lock Routines */ -#include "apr.h" -#include "apr_pools.h" -#include "apr_errno.h" +#include "fspr.h" +#include "fspr_pools.h" +#include "fspr_errno.h" #ifdef __cplusplus extern "C" { @@ -33,13 +33,13 @@ extern "C" { #if APR_HAS_THREADS /** - * @defgroup apr_thread_rwlock Reader/Writer Lock Routines + * @defgroup fspr_thread_rwlock Reader/Writer Lock Routines * @ingroup APR * @{ */ /** Opaque read-write thread-safe lock. */ -typedef struct apr_thread_rwlock_t apr_thread_rwlock_t; +typedef struct fspr_thread_rwlock_t fspr_thread_rwlock_t; /** * Note: The following operations have undefined results: unlocking a @@ -57,19 +57,19 @@ typedef struct apr_thread_rwlock_t apr_thread_rwlock_t; * will be stored. * @param pool the pool from which to allocate the mutex. */ -APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, - apr_pool_t *pool); +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_create(fspr_thread_rwlock_t **rwlock, + fspr_pool_t *pool); /** * Acquire a shared-read lock on the given read-write lock. This will allow * multiple threads to enter the same critical section while they have acquired * the read lock. * @param rwlock the read-write lock on which to acquire the shared read. */ -APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock); +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_rdlock(fspr_thread_rwlock_t *rwlock); /** * Attempt to acquire the shared-read lock on the given read-write lock. This - * is the same as apr_thread_rwlock_rdlock(), only that the function fails + * is the same as fspr_thread_rwlock_rdlock(), only that the function fails * if there is another thread holding the write lock, or if there are any * write threads blocking on the lock. If the function fails for this case, * APR_EBUSY will be returned. Note: it is important that the @@ -77,7 +77,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock); * APR_EBUSY, for portability reasons. * @param rwlock the rwlock on which to attempt the shared read. */ -APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwlock); +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_tryrdlock(fspr_thread_rwlock_t *rwlock); /** * Acquire an exclusive-write lock on the given read-write lock. This will @@ -86,35 +86,35 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwloc * sleep until it can have exclusive access to the lock. * @param rwlock the read-write lock on which to acquire the exclusive write. */ -APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock); +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_wrlock(fspr_thread_rwlock_t *rwlock); /** * Attempt to acquire the exclusive-write lock on the given read-write lock. - * This is the same as apr_thread_rwlock_wrlock(), only that the function fails + * This is the same as fspr_thread_rwlock_wrlock(), only that the function fails * if there is any other thread holding the lock (for reading or writing), * in which case the function will return APR_EBUSY. Note: it is important * that the APR_STATUS_IS_EBUSY(s) macro be used to determine if the return * value was APR_EBUSY, for portability reasons. * @param rwlock the rwlock on which to attempt the exclusive write. */ -APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwlock); +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_trywrlock(fspr_thread_rwlock_t *rwlock); /** * Release either the read or write lock currently held by the calling thread * associated with the given read-write lock. * @param rwlock the read-write lock to be released (unlocked). */ -APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock); +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_unlock(fspr_thread_rwlock_t *rwlock); /** * Destroy the read-write lock and free the associated memory. * @param rwlock the rwlock to destroy. */ -APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock); +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_destroy(fspr_thread_rwlock_t *rwlock); /** * Get the pool used by this thread_rwlock. - * @return apr_pool_t the pool + * @return fspr_pool_t the pool */ APR_POOL_DECLARE_ACCESSOR(thread_rwlock); diff --git a/libs/apr/include/apr_time.h b/libs/apr/include/fspr_time.h similarity index 56% rename from libs/apr/include/apr_time.h rename to libs/apr/include/fspr_time.h index 253aa72b4a..acf6686469 100644 --- a/libs/apr/include/apr_time.h +++ b/libs/apr/include/fspr_time.h @@ -18,111 +18,111 @@ #define APR_TIME_H /** - * @file apr_time.h + * @file fspr_time.h * @brief APR Time Library */ -#include "apr.h" -#include "apr_pools.h" -#include "apr_errno.h" +#include "fspr.h" +#include "fspr_pools.h" +#include "fspr_errno.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** - * @defgroup apr_time Time Routines + * @defgroup fspr_time Time Routines * @ingroup APR * @{ */ /** month names */ -APR_DECLARE_DATA extern const char apr_month_snames[12][4]; +APR_DECLARE_DATA extern const char fspr_month_snames[12][4]; /** day names */ -APR_DECLARE_DATA extern const char apr_day_snames[7][4]; +APR_DECLARE_DATA extern const char fspr_day_snames[7][4]; /** number of microseconds since 00:00:00 january 1, 1970 UTC */ -typedef apr_int64_t apr_time_t; +typedef fspr_int64_t fspr_time_t; -/** mechanism to properly type apr_time_t literals */ +/** mechanism to properly type fspr_time_t literals */ #define APR_TIME_C(val) APR_INT64_C(val) -/** mechanism to properly print apr_time_t values */ +/** mechanism to properly print fspr_time_t values */ #define APR_TIME_T_FMT APR_INT64_T_FMT /** intervals for I/O timeouts, in microseconds */ -typedef apr_int64_t apr_interval_time_t; +typedef fspr_int64_t fspr_interval_time_t; /** short interval for I/O timeouts, in microseconds */ -typedef apr_int32_t apr_short_interval_time_t; +typedef fspr_int32_t fspr_short_interval_time_t; /** number of microseconds per second */ #define APR_USEC_PER_SEC APR_TIME_C(1000000) -/** @return apr_time_t as a second */ -#define apr_time_sec(time) ((time) / APR_USEC_PER_SEC) +/** @return fspr_time_t as a second */ +#define fspr_time_sec(time) ((time) / APR_USEC_PER_SEC) -/** @return apr_time_t as a usec */ -#define apr_time_usec(time) ((time) % APR_USEC_PER_SEC) +/** @return fspr_time_t as a usec */ +#define fspr_time_usec(time) ((time) % APR_USEC_PER_SEC) -/** @return apr_time_t as a msec */ -#define apr_time_msec(time) (((time) / 1000) % 1000) +/** @return fspr_time_t as a msec */ +#define fspr_time_msec(time) (((time) / 1000) % 1000) -/** @return apr_time_t as a msec */ -#define apr_time_as_msec(time) ((time) / 1000) +/** @return fspr_time_t as a msec */ +#define fspr_time_as_msec(time) ((time) / 1000) -/** @return a second as an apr_time_t */ -#define apr_time_from_sec(sec) ((apr_time_t)(sec) * APR_USEC_PER_SEC) +/** @return a second as an fspr_time_t */ +#define fspr_time_from_sec(sec) ((fspr_time_t)(sec) * APR_USEC_PER_SEC) -/** @return a second and usec combination as an apr_time_t */ -#define apr_time_make(sec, usec) ((apr_time_t)(sec) * APR_USEC_PER_SEC \ - + (apr_time_t)(usec)) +/** @return a second and usec combination as an fspr_time_t */ +#define fspr_time_make(sec, usec) ((fspr_time_t)(sec) * APR_USEC_PER_SEC \ + + (fspr_time_t)(usec)) /** * @return the current time */ -APR_DECLARE(apr_time_t) apr_time_now(void); +APR_DECLARE(fspr_time_t) fspr_time_now(void); -/** @see apr_time_exp_t */ -typedef struct apr_time_exp_t apr_time_exp_t; +/** @see fspr_time_exp_t */ +typedef struct fspr_time_exp_t fspr_time_exp_t; /** * 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) */ -struct apr_time_exp_t { +struct fspr_time_exp_t { /** microseconds past tm_sec */ - apr_int32_t tm_usec; + fspr_int32_t tm_usec; /** (0-61) seconds past tm_min */ - apr_int32_t tm_sec; + fspr_int32_t tm_sec; /** (0-59) minutes past tm_hour */ - apr_int32_t tm_min; + fspr_int32_t tm_min; /** (0-23) hours past midnight */ - apr_int32_t tm_hour; + fspr_int32_t tm_hour; /** (1-31) day of the month */ - apr_int32_t tm_mday; + fspr_int32_t tm_mday; /** (0-11) month of the year */ - apr_int32_t tm_mon; + fspr_int32_t tm_mon; /** year since 1900 */ - apr_int32_t tm_year; + fspr_int32_t tm_year; /** (0-6) days since sunday */ - apr_int32_t tm_wday; + fspr_int32_t tm_wday; /** (0-365) days since jan 1 */ - apr_int32_t tm_yday; + fspr_int32_t tm_yday; /** daylight saving time */ - apr_int32_t tm_isdst; + fspr_int32_t tm_isdst; /** seconds east of UTC */ - apr_int32_t tm_gmtoff; + fspr_int32_t tm_gmtoff; }; /** - * convert an ansi time_t to an apr_time_t - * @param result the resulting apr_time_t + * convert an ansi time_t to an fspr_time_t + * @param result the resulting fspr_time_t * @param input the time_t to convert */ -APR_DECLARE(apr_status_t) apr_time_ansi_put(apr_time_t *result, +APR_DECLARE(fspr_status_t) fspr_time_ansi_put(fspr_time_t *result, time_t input); /** @@ -132,76 +132,76 @@ APR_DECLARE(apr_status_t) apr_time_ansi_put(apr_time_t *result, * @param input the time to explode * @param offs the number of seconds offset to apply */ -APR_DECLARE(apr_status_t) apr_time_exp_tz(apr_time_exp_t *result, - apr_time_t input, - apr_int32_t offs); +APR_DECLARE(fspr_status_t) fspr_time_exp_tz(fspr_time_exp_t *result, + fspr_time_t input, + fspr_int32_t offs); /** * convert a time to its human readable components in GMT timezone * @param result the exploded time * @param input the time to explode */ -APR_DECLARE(apr_status_t) apr_time_exp_gmt(apr_time_exp_t *result, - apr_time_t input); +APR_DECLARE(fspr_status_t) fspr_time_exp_gmt(fspr_time_exp_t *result, + fspr_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 */ -APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, - apr_time_t input); +APR_DECLARE(fspr_status_t) fspr_time_exp_lt(fspr_time_exp_t *result, + fspr_time_t input); /** - * Convert time value from human readable format to a numeric apr_time_t + * Convert time value from human readable format to a numeric fspr_time_t * e.g. elapsed usec since epoch * @param result the resulting imploded time * @param input the input exploded time */ -APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *result, - apr_time_exp_t *input); +APR_DECLARE(fspr_status_t) fspr_time_exp_get(fspr_time_t *result, + fspr_time_exp_t *input); /** - * Convert time value from human readable format to a numeric apr_time_t that + * Convert time value from human readable format to a numeric fspr_time_t that * always represents GMT * @param result the resulting imploded time * @param input the input exploded time */ -APR_DECLARE(apr_status_t) apr_time_exp_gmt_get(apr_time_t *result, - apr_time_exp_t *input); +APR_DECLARE(fspr_status_t) fspr_time_exp_gmt_get(fspr_time_t *result, + fspr_time_exp_t *input); /** * Sleep for the specified number of micro-seconds. * @param t desired amount of time to sleep. * @warning May sleep for longer than the specified time. */ -APR_DECLARE(void) apr_sleep(apr_interval_time_t t); +APR_DECLARE(void) fspr_sleep(fspr_interval_time_t t); /** length of a RFC822 Date */ #define APR_RFC822_DATE_LEN (30) /** - * apr_rfc822_date formats dates in the RFC822 + * fspr_rfc822_date formats dates in the RFC822 * format in an efficient manner. It is a fixed length * format which requires the indicated amount of storage, * including the trailing NUL terminator. * @param date_str String to write to. * @param t the time to convert */ -APR_DECLARE(apr_status_t) apr_rfc822_date(char *date_str, apr_time_t t); +APR_DECLARE(fspr_status_t) fspr_rfc822_date(char *date_str, fspr_time_t t); /** length of a CTIME date */ #define APR_CTIME_LEN (25) /** - * apr_ctime formats dates in the ctime() format + * fspr_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 * the trailing NUL terminator. - * Unlike ANSI/ISO C ctime(), apr_ctime() does not include + * Unlike ANSI/ISO C ctime(), fspr_ctime() does not include * a \n at the end of the string. * @param date_str String to write to. * @param t the time to convert */ -APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t); +APR_DECLARE(fspr_status_t) fspr_ctime(char *date_str, fspr_time_t t); /** * formats the exploded time according to the format specified @@ -211,9 +211,9 @@ APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t); * @param format The format for the time string * @param tm The time to convert */ -APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize, - apr_size_t max, const char *format, - apr_time_exp_t *tm); +APR_DECLARE(fspr_status_t) fspr_strftime(char *s, fspr_size_t *retsize, + fspr_size_t max, const char *format, + fspr_time_exp_t *tm); /** * Improve the clock resolution for the lifetime of the given pool. @@ -221,7 +221,7 @@ APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize, * time-sensitive applications, and has no impact on most platforms. * @param p The pool to associate the finer clock resolution */ -APR_DECLARE(void) apr_time_clock_hires(apr_pool_t *p); +APR_DECLARE(void) fspr_time_clock_hires(fspr_pool_t *p); /** @} */ diff --git a/libs/apr/include/apr_user.h b/libs/apr/include/fspr_user.h similarity index 65% rename from libs/apr/include/apr_user.h rename to libs/apr/include/fspr_user.h index 0179e22644..68c7c753de 100644 --- a/libs/apr/include/apr_user.h +++ b/libs/apr/include/fspr_user.h @@ -18,20 +18,20 @@ #define APR_USER_H /** - * @file apr_user.h + * @file fspr_user.h * @brief APR User ID Services */ -#include "apr.h" -#include "apr_errno.h" -#include "apr_pools.h" +#include "fspr.h" +#include "fspr_errno.h" +#include "fspr_pools.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** - * @defgroup apr_user User and Group ID Services + * @defgroup fspr_user User and Group ID Services * @ingroup APR * @{ */ @@ -40,18 +40,18 @@ extern "C" { * Structure for determining user ownership. */ #ifdef WIN32 -typedef PSID apr_uid_t; +typedef PSID fspr_uid_t; #else -typedef uid_t apr_uid_t; +typedef uid_t fspr_uid_t; #endif /** * Structure for determining group ownership. */ #ifdef WIN32 -typedef PSID apr_gid_t; +typedef PSID fspr_gid_t; #else -typedef gid_t apr_gid_t; +typedef gid_t fspr_gid_t; #endif #if APR_HAS_USER @@ -63,9 +63,9 @@ typedef gid_t apr_gid_t; * @param p The pool from which to allocate working space * @remark This function is available only if APR_HAS_USER is defined. */ -APR_DECLARE(apr_status_t) apr_uid_current(apr_uid_t *userid, - apr_gid_t *groupid, - apr_pool_t *p); +APR_DECLARE(fspr_status_t) fspr_uid_current(fspr_uid_t *userid, + fspr_gid_t *groupid, + fspr_pool_t *p); /** * Get the user name for a specified userid @@ -74,8 +74,8 @@ APR_DECLARE(apr_status_t) apr_uid_current(apr_uid_t *userid, * @param p The pool from which to allocate the string * @remark This function is available only if APR_HAS_USER is defined. */ -APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid, - apr_pool_t *p); +APR_DECLARE(fspr_status_t) fspr_uid_name_get(char **username, fspr_uid_t userid, + fspr_pool_t *p); /** * Get the userid (and groupid) for the specified username @@ -85,8 +85,8 @@ APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid, * @param p The pool from which to allocate working space * @remark This function is available only if APR_HAS_USER is defined. */ -APR_DECLARE(apr_status_t) apr_uid_get(apr_uid_t *userid, apr_gid_t *groupid, - const char *username, apr_pool_t *p); +APR_DECLARE(fspr_status_t) fspr_uid_get(fspr_uid_t *userid, fspr_gid_t *groupid, + const char *username, fspr_pool_t *p); /** * Get the home directory for the named user @@ -95,22 +95,22 @@ APR_DECLARE(apr_status_t) apr_uid_get(apr_uid_t *userid, apr_gid_t *groupid, * @param p The pool from which to allocate the string * @remark This function is available only if APR_HAS_USER is defined. */ -APR_DECLARE(apr_status_t) apr_uid_homepath_get(char **dirname, +APR_DECLARE(fspr_status_t) fspr_uid_homepath_get(char **dirname, const char *username, - apr_pool_t *p); + fspr_pool_t *p); /** * Compare two user identifiers for equality. * @param left One uid to test * @param right Another uid to test - * @return APR_SUCCESS if the apr_uid_t strutures identify the same user, - * APR_EMISMATCH if not, APR_BADARG if an apr_uid_t is invalid. + * @return APR_SUCCESS if the fspr_uid_t strutures identify the same user, + * APR_EMISMATCH if not, APR_BADARG if an fspr_uid_t is invalid. * @remark This function is available only if APR_HAS_USER is defined. */ #if defined(WIN32) -APR_DECLARE(apr_status_t) apr_uid_compare(apr_uid_t left, apr_uid_t right); +APR_DECLARE(fspr_status_t) fspr_uid_compare(fspr_uid_t left, fspr_uid_t right); #else -#define apr_uid_compare(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH) +#define fspr_uid_compare(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH) #endif /** @@ -120,8 +120,8 @@ APR_DECLARE(apr_status_t) apr_uid_compare(apr_uid_t left, apr_uid_t right); * @param p The pool from which to allocate the string * @remark This function is available only if APR_HAS_USER is defined. */ -APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname, - apr_gid_t groupid, apr_pool_t *p); +APR_DECLARE(fspr_status_t) fspr_gid_name_get(char **groupname, + fspr_gid_t groupid, fspr_pool_t *p); /** * Get the groupid for a specified group name @@ -130,21 +130,21 @@ APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname, * @param p The pool from which to allocate the string * @remark This function is available only if APR_HAS_USER is defined. */ -APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *groupid, - const char *groupname, apr_pool_t *p); +APR_DECLARE(fspr_status_t) fspr_gid_get(fspr_gid_t *groupid, + const char *groupname, fspr_pool_t *p); /** * Compare two group identifiers for equality. * @param left One gid to test * @param right Another gid to test - * @return APR_SUCCESS if the apr_gid_t strutures identify the same group, - * APR_EMISMATCH if not, APR_BADARG if an apr_gid_t is invalid. + * @return APR_SUCCESS if the fspr_gid_t strutures identify the same group, + * APR_EMISMATCH if not, APR_BADARG if an fspr_gid_t is invalid. * @remark This function is available only if APR_HAS_USER is defined. */ #if defined(WIN32) -APR_DECLARE(apr_status_t) apr_gid_compare(apr_gid_t left, apr_gid_t right); +APR_DECLARE(fspr_status_t) fspr_gid_compare(fspr_gid_t left, fspr_gid_t right); #else -#define apr_gid_compare(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH) +#define fspr_gid_compare(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH) #endif #endif /* ! APR_HAS_USER */ diff --git a/libs/apr/include/apr_version.h b/libs/apr/include/fspr_version.h similarity index 93% rename from libs/apr/include/apr_version.h rename to libs/apr/include/fspr_version.h index a3bd6b893b..7d5b05f77c 100644 --- a/libs/apr/include/apr_version.h +++ b/libs/apr/include/fspr_version.h @@ -18,7 +18,7 @@ #define APR_VERSION_H /** - * @file apr_version.h + * @file fspr_version.h * @brief APR Versioning Interface * * APR's Version @@ -76,7 +76,7 @@ #define APR_IS_DEV_STRING "" #endif -/* APR_STRINGIFY is defined here, and also in apr_general.h, so wrap it */ +/* APR_STRINGIFY is defined here, and also in fspr_general.h, so wrap it */ #ifndef APR_STRINGIFY /** Properly quote a value as a string in the C preprocessor */ #define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n) @@ -102,11 +102,11 @@ /* The C language API to access the version at run time, * as opposed to compile time. APR_VERSION_ONLY may be defined - * externally when preprocessing apr_version.h to obtain strictly + * externally when preprocessing fspr_version.h to obtain strictly * the C Preprocessor macro declarations. */ -#include "apr.h" +#include "fspr.h" #ifdef __cplusplus extern "C" { @@ -121,7 +121,7 @@ typedef struct { int minor; /**< minor number */ int patch; /**< patch number */ int is_dev; /**< is development (1 or 0) */ -} apr_version_t; +} fspr_version_t; /** * Return APR's version information information in a numeric form. @@ -129,10 +129,10 @@ typedef struct { * @param pvsn Pointer to a version structure for returning the version * information. */ -APR_DECLARE(void) apr_version(apr_version_t *pvsn); +APR_DECLARE(void) fspr_version(fspr_version_t *pvsn); /** Return APR's version information as a string. */ -APR_DECLARE(const char *) apr_version_string(void); +APR_DECLARE(const char *) fspr_version_string(void); #ifdef __cplusplus } diff --git a/libs/apr/include/apr_want.h b/libs/apr/include/fspr_want.h similarity index 94% rename from libs/apr/include/apr_want.h rename to libs/apr/include/fspr_want.h index 39cc4fcb6b..238c2b1a2f 100644 --- a/libs/apr/include/apr_want.h +++ b/libs/apr/include/fspr_want.h @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "apr.h" /* configuration data */ +#include "fspr.h" /* configuration data */ /** - * @file apr_want.h + * @file fspr_want.h * @brief APR Standard Headers Support * *
    @@ -32,12 +32,12 @@
      *
      *   #define APR_WANT_STRFUNC
      *   #define APR_WANT_MEMFUNC
    - *   #include "apr_want.h"
    + *   #include "fspr_want.h"
      *
      * The appropriate headers will be included.
      *
      * Note: it is safe to use this in a header (it won't interfere with other
    - *       headers' or source files' use of apr_want.h)
    + *       headers' or source files' use of fspr_want.h)
      * 
    */ diff --git a/libs/apr/libapr.dsp b/libs/apr/libapr.dsp index be347a7767..b4dbace5a9 100644 --- a/libs/apr/libapr.dsp +++ b/libs/apr/libapr.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Release\libapr_src" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Release\libfspr_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -75,7 +75,7 @@ PostBuild_Cmds=if exist $(OUTDIR)\libapr-1.dll.manifest mt.exe -manifest $(OUTDI # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\libapr_src" /FD /c +# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\libfspr_src" /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -107,7 +107,7 @@ PostBuild_Cmds=if exist $(OUTDIR)\libapr-1.dll.manifest mt.exe -manifest $(OUTDI # PROP Default_Filter "" # Begin Source File -SOURCE=.\atomic\win32\apr_atomic.c +SOURCE=.\atomic\win32\fspr_atomic.c # End Source File # End Group # Begin Group "dso" @@ -211,7 +211,7 @@ SOURCE=.\locks\win32\thread_rwlock.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\memory\unix\apr_pools.c +SOURCE=.\memory\unix\fspr_pools.c # End Source File # End Group # Begin Group "misc" @@ -219,7 +219,7 @@ SOURCE=.\memory\unix\apr_pools.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\misc\win32\apr_app.c +SOURCE=.\misc\win32\fspr_app.c # PROP Exclude_From_Build 1 # End Source File # Begin Source File @@ -320,7 +320,7 @@ SOURCE=.\network_io\win32\sockopt.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\passwd\apr_getpass.c +SOURCE=.\passwd\fspr_getpass.c # End Source File # End Group # Begin Group "random" @@ -328,7 +328,7 @@ SOURCE=.\passwd\apr_getpass.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\random\unix\apr_random.c +SOURCE=.\random\unix\fspr_random.c # End Source File # Begin Source File @@ -352,27 +352,27 @@ SOURCE=.\shmem\win32\shm.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\strings\apr_cpystrn.c +SOURCE=.\strings\fspr_cpystrn.c # End Source File # Begin Source File -SOURCE=.\strings\apr_fnmatch.c +SOURCE=.\strings\fspr_fnmatch.c # End Source File # Begin Source File -SOURCE=.\strings\apr_snprintf.c +SOURCE=.\strings\fspr_snprintf.c # End Source File # Begin Source File -SOURCE=.\strings\apr_strings.c +SOURCE=.\strings\fspr_strings.c # End Source File # Begin Source File -SOURCE=.\strings\apr_strnatcmp.c +SOURCE=.\strings\fspr_strnatcmp.c # End Source File # Begin Source File -SOURCE=.\strings\apr_strtok.c +SOURCE=.\strings\fspr_strtok.c # End Source File # End Group # Begin Group "tables" @@ -380,11 +380,11 @@ SOURCE=.\strings\apr_strtok.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\tables\apr_hash.c +SOURCE=.\tables\fspr_hash.c # End Source File # Begin Source File -SOURCE=.\tables\apr_tables.c +SOURCE=.\tables\fspr_tables.c # End Source File # End Group # Begin Group "threadproc" @@ -441,51 +441,51 @@ SOURCE=.\user\win32\userinfo.c # PROP Default_Filter "" # Begin Source File -SOURCE=.\include\arch\win32\apr_arch_atime.h +SOURCE=.\include\arch\win32\fspr_arch_atime.h # End Source File # Begin Source File -SOURCE=.\include\arch\win32\apr_arch_dso.h +SOURCE=.\include\arch\win32\fspr_arch_dso.h # End Source File # Begin Source File -SOURCE=.\include\arch\win32\apr_arch_file_io.h +SOURCE=.\include\arch\win32\fspr_arch_file_io.h # End Source File # Begin Source File -SOURCE=.\include\arch\win32\apr_arch_inherit.h +SOURCE=.\include\arch\win32\fspr_arch_inherit.h # End Source File # Begin Source File -SOURCE=.\include\arch\win32\apr_arch_misc.h +SOURCE=.\include\arch\win32\fspr_arch_misc.h # End Source File # Begin Source File -SOURCE=.\include\arch\win32\apr_arch_networkio.h +SOURCE=.\include\arch\win32\fspr_arch_networkio.h # End Source File # Begin Source File -SOURCE=.\include\arch\win32\apr_arch_thread_mutex.h +SOURCE=.\include\arch\win32\fspr_arch_thread_mutex.h # End Source File # Begin Source File -SOURCE=.\include\arch\win32\apr_arch_thread_rwlock.h +SOURCE=.\include\arch\win32\fspr_arch_thread_rwlock.h # End Source File # Begin Source File -SOURCE=.\include\arch\win32\apr_arch_threadproc.h +SOURCE=.\include\arch\win32\fspr_arch_threadproc.h # End Source File # Begin Source File -SOURCE=.\include\arch\win32\apr_arch_utf8.h +SOURCE=.\include\arch\win32\fspr_arch_utf8.h # End Source File # Begin Source File -SOURCE=.\include\arch\win32\apr_private.h +SOURCE=.\include\arch\win32\fspr_private.h # End Source File # Begin Source File -SOURCE=.\include\arch\apr_private_common.h +SOURCE=.\include\arch\fspr_private_common.h # End Source File # End Group # Begin Group "Public Header Files" @@ -493,35 +493,35 @@ SOURCE=.\include\arch\apr_private_common.h # PROP Default_Filter "" # Begin Source File -SOURCE=.\include\apr.h.in +SOURCE=.\include\fspr.h.in # PROP Exclude_From_Build 1 # End Source File # Begin Source File -SOURCE=.\include\apr.hnw +SOURCE=.\include\fspr.hnw # PROP Exclude_From_Build 1 # End Source File # Begin Source File -SOURCE=.\include\apr.hw +SOURCE=.\include\fspr.hw !IF "$(CFG)" == "libapr - Win32 Release" # Begin Custom Build - Creating apr.h from apr.hw -InputPath=.\include\apr.hw +InputPath=.\include\fspr.hw -".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr.hw > .\include\apr.h +".\include\fspr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\fspr.hw > .\include\fspr.h # End Custom Build !ELSEIF "$(CFG)" == "libapr - Win32 Debug" # Begin Custom Build - Creating apr.h from apr.hw -InputPath=.\include\apr.hw +InputPath=.\include\fspr.hw -".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr.hw > .\include\apr.h +".\include\fspr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + type .\include\fspr.hw > .\include\fspr.h # End Custom Build @@ -530,139 +530,139 @@ InputPath=.\include\apr.hw # End Source File # Begin Source File -SOURCE=.\include\apr_allocator.h +SOURCE=.\include\fspr_allocator.h # End Source File # Begin Source File -SOURCE=.\include\apr_atomic.h +SOURCE=.\include\fspr_atomic.h # End Source File # Begin Source File -SOURCE=.\include\apr_dso.h +SOURCE=.\include\fspr_dso.h # End Source File # Begin Source File -SOURCE=.\include\apr_env.h +SOURCE=.\include\fspr_env.h # End Source File # Begin Source File -SOURCE=.\include\apr_errno.h +SOURCE=.\include\fspr_errno.h # End Source File # Begin Source File -SOURCE=.\include\apr_file_info.h +SOURCE=.\include\fspr_file_info.h # End Source File # Begin Source File -SOURCE=.\include\apr_file_io.h +SOURCE=.\include\fspr_file_io.h # End Source File # Begin Source File -SOURCE=.\include\apr_fnmatch.h +SOURCE=.\include\fspr_fnmatch.h # End Source File # Begin Source File -SOURCE=.\include\apr_general.h +SOURCE=.\include\fspr_general.h # End Source File # Begin Source File -SOURCE=.\include\apr_getopt.h +SOURCE=.\include\fspr_getopt.h # End Source File # Begin Source File -SOURCE=.\include\apr_global_mutex.h +SOURCE=.\include\fspr_global_mutex.h # End Source File # Begin Source File -SOURCE=.\include\apr_hash.h +SOURCE=.\include\fspr_hash.h # End Source File # Begin Source File -SOURCE=.\include\apr_inherit.h +SOURCE=.\include\fspr_inherit.h # End Source File # Begin Source File -SOURCE=.\include\apr_lib.h +SOURCE=.\include\fspr_lib.h # End Source File # Begin Source File -SOURCE=.\include\apr_mmap.h +SOURCE=.\include\fspr_mmap.h # End Source File # Begin Source File -SOURCE=.\include\apr_network_io.h +SOURCE=.\include\fspr_network_io.h # End Source File # Begin Source File -SOURCE=.\include\apr_poll.h +SOURCE=.\include\fspr_poll.h # End Source File # Begin Source File -SOURCE=.\include\apr_pools.h +SOURCE=.\include\fspr_pools.h # End Source File # Begin Source File -SOURCE=.\include\apr_portable.h +SOURCE=.\include\fspr_portable.h # End Source File # Begin Source File -SOURCE=.\include\apr_proc_mutex.h +SOURCE=.\include\fspr_proc_mutex.h # End Source File # Begin Source File -SOURCE=.\include\apr_ring.h +SOURCE=.\include\fspr_ring.h # End Source File # Begin Source File -SOURCE=.\include\apr_shm.h +SOURCE=.\include\fspr_shm.h # End Source File # Begin Source File -SOURCE=.\include\apr_signal.h +SOURCE=.\include\fspr_signal.h # End Source File # Begin Source File -SOURCE=.\include\apr_strings.h +SOURCE=.\include\fspr_strings.h # End Source File # Begin Source File -SOURCE=.\include\apr_support.h +SOURCE=.\include\fspr_support.h # End Source File # Begin Source File -SOURCE=.\include\apr_tables.h +SOURCE=.\include\fspr_tables.h # End Source File # Begin Source File -SOURCE=.\include\apr_thread_cond.h +SOURCE=.\include\fspr_thread_cond.h # End Source File # Begin Source File -SOURCE=.\include\apr_thread_mutex.h +SOURCE=.\include\fspr_thread_mutex.h # End Source File # Begin Source File -SOURCE=.\include\apr_thread_proc.h +SOURCE=.\include\fspr_thread_proc.h # End Source File # Begin Source File -SOURCE=.\include\apr_thread_rwlock.h +SOURCE=.\include\fspr_thread_rwlock.h # End Source File # Begin Source File -SOURCE=.\include\apr_time.h +SOURCE=.\include\fspr_time.h # End Source File # Begin Source File -SOURCE=.\include\apr_user.h +SOURCE=.\include\fspr_user.h # End Source File # Begin Source File -SOURCE=.\include\apr_version.h +SOURCE=.\include\fspr_version.h # End Source File # Begin Source File -SOURCE=.\include\apr_want.h +SOURCE=.\include\fspr_want.h # End Source File # End Group # Begin Source File diff --git a/libs/apr/locks/beos/proc_mutex.c b/libs/apr/locks/beos/proc_mutex.c index ce2a580bac..b7227d2ff2 100644 --- a/libs/apr/locks/beos/proc_mutex.c +++ b/libs/apr/locks/beos/proc_mutex.c @@ -18,13 +18,13 @@ * Stephen Beaulieu */ -#include "apr_arch_proc_mutex.h" -#include "apr_strings.h" -#include "apr_portable.h" +#include "fspr_arch_proc_mutex.h" +#include "fspr_strings.h" +#include "fspr_portable.h" -static apr_status_t _proc_mutex_cleanup(void * data) +static fspr_status_t _proc_mutex_cleanup(void * data) { - apr_proc_mutex_t *lock = (apr_proc_mutex_t*)data; + fspr_proc_mutex_t *lock = (fspr_proc_mutex_t*)data; if (lock->LockCount != 0) { /* we're still locked... */ while (atomic_add(&lock->LockCount , -1) > 1){ @@ -39,19 +39,19 @@ static apr_status_t _proc_mutex_cleanup(void * data) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, +APR_DECLARE(fspr_status_t) fspr_proc_mutex_create(fspr_proc_mutex_t **mutex, const char *fname, - apr_lockmech_e mech, - apr_pool_t *pool) + fspr_lockmech_e mech, + fspr_pool_t *pool) { - apr_proc_mutex_t *new; - apr_status_t stat = APR_SUCCESS; + fspr_proc_mutex_t *new; + fspr_status_t stat = APR_SUCCESS; if (mech != APR_LOCK_DEFAULT) { return APR_ENOTIMPL; } - new = (apr_proc_mutex_t *)apr_pcalloc(pool, sizeof(apr_proc_mutex_t)); + new = (fspr_proc_mutex_t *)fspr_pcalloc(pool, sizeof(fspr_proc_mutex_t)); if (new == NULL){ return APR_ENOMEM; } @@ -64,21 +64,21 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, new->Lock = stat; new->pool = pool; - apr_pool_cleanup_register(new->pool, (void *)new, _proc_mutex_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register(new->pool, (void *)new, _proc_mutex_cleanup, + fspr_pool_cleanup_null); (*mutex) = new; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, +APR_DECLARE(fspr_status_t) fspr_proc_mutex_child_init(fspr_proc_mutex_t **mutex, const char *fname, - apr_pool_t *pool) + fspr_pool_t *pool) { return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_proc_mutex_lock(fspr_proc_mutex_t *mutex) { int32 stat; @@ -91,12 +91,12 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_proc_mutex_trylock(fspr_proc_mutex_t *mutex) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_proc_mutex_unlock(fspr_proc_mutex_t *mutex) { int32 stat; @@ -109,58 +109,58 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_proc_mutex_destroy(fspr_proc_mutex_t *mutex) { - apr_status_t stat; + fspr_status_t stat; if ((stat = _proc_mutex_cleanup(mutex)) == APR_SUCCESS) { - apr_pool_cleanup_kill(mutex->pool, mutex, _proc_mutex_cleanup); + fspr_pool_cleanup_kill(mutex->pool, mutex, _proc_mutex_cleanup); return APR_SUCCESS; } return stat; } -APR_DECLARE(apr_status_t) apr_proc_mutex_cleanup(void *mutex) +APR_DECLARE(fspr_status_t) fspr_proc_mutex_cleanup(void *mutex) { return _proc_mutex_cleanup(mutex); } -APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex) +APR_DECLARE(const char *) fspr_proc_mutex_lockfile(fspr_proc_mutex_t *mutex) { return NULL; } -APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) +APR_DECLARE(const char *) fspr_proc_mutex_name(fspr_proc_mutex_t *mutex) { return "beossem"; } -APR_DECLARE(const char *) apr_proc_mutex_defname(void) +APR_DECLARE(const char *) fspr_proc_mutex_defname(void) { return "beossem"; } APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) -/* Implement OS-specific accessors defined in apr_portable.h */ +/* Implement OS-specific accessors defined in fspr_portable.h */ -APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, - apr_proc_mutex_t *pmutex) +APR_DECLARE(fspr_status_t) fspr_os_proc_mutex_get(fspr_os_proc_mutex_t *ospmutex, + fspr_proc_mutex_t *pmutex) { ospmutex->sem = pmutex->Lock; ospmutex->ben = pmutex->LockCount; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, - apr_os_proc_mutex_t *ospmutex, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_proc_mutex_put(fspr_proc_mutex_t **pmutex, + fspr_os_proc_mutex_t *ospmutex, + fspr_pool_t *pool) { if (pool == NULL) { return APR_ENOPOOL; } if ((*pmutex) == NULL) { - (*pmutex) = (apr_proc_mutex_t *)apr_pcalloc(pool, sizeof(apr_proc_mutex_t)); + (*pmutex) = (fspr_proc_mutex_t *)fspr_pcalloc(pool, sizeof(fspr_proc_mutex_t)); (*pmutex)->pool = pool; } (*pmutex)->Lock = ospmutex->sem; diff --git a/libs/apr/locks/beos/thread_cond.c b/libs/apr/locks/beos/thread_cond.c index e3ea460003..6585f61f12 100644 --- a/libs/apr/locks/beos/thread_cond.c +++ b/libs/apr/locks/beos/thread_cond.c @@ -14,15 +14,15 @@ * limitations under the License. */ -#include "apr_arch_thread_mutex.h" -#include "apr_arch_thread_cond.h" -#include "apr_strings.h" -#include "apr_portable.h" +#include "fspr_arch_thread_mutex.h" +#include "fspr_arch_thread_cond.h" +#include "fspr_strings.h" +#include "fspr_portable.h" -static apr_status_t thread_cond_cleanup(void *data) +static fspr_status_t thread_cond_cleanup(void *data) { struct waiter *w; - apr_thread_cond_t *cond = (apr_thread_cond_t *)data; + fspr_thread_cond_t *cond = (fspr_thread_cond_t *)data; acquire_sem(cond->lock); delete_sem(cond->lock); @@ -30,10 +30,10 @@ static apr_status_t thread_cond_cleanup(void *data) return APR_SUCCESS; } -static struct waiter_t *make_waiter(apr_pool_t *pool) +static struct waiter_t *make_waiter(fspr_pool_t *pool) { struct waiter_t *w = (struct waiter_t*) - apr_palloc(pool, sizeof(struct waiter_t)); + fspr_palloc(pool, sizeof(struct waiter_t)); if (w == NULL) return NULL; @@ -46,14 +46,14 @@ static struct waiter_t *make_waiter(apr_pool_t *pool) return w; } -APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_thread_cond_create(fspr_thread_cond_t **cond, + fspr_pool_t *pool) { - apr_thread_cond_t *new_cond; + fspr_thread_cond_t *new_cond; sem_id rv; int i; - new_cond = (apr_thread_cond_t *)apr_palloc(pool, sizeof(apr_thread_cond_t)); + new_cond = (fspr_thread_cond_t *)fspr_palloc(pool, sizeof(fspr_thread_cond_t)); if (new_cond == NULL) return APR_ENOMEM; @@ -71,21 +71,21 @@ APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, APR_RING_INSERT_TAIL(&new_cond->flist, nw, waiter_t, link); } - apr_pool_cleanup_register(new_cond->pool, + fspr_pool_cleanup_register(new_cond->pool, (void *)new_cond, thread_cond_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_null); *cond = new_cond; return APR_SUCCESS; } -static apr_status_t do_wait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex, +static fspr_status_t do_wait(fspr_thread_cond_t *cond, fspr_thread_mutex_t *mutex, int timeout) { struct waiter_t *wait; thread_id cth = find_thread(NULL); - apr_status_t rv; + fspr_status_t rv; int flags = B_RELATIVE_TIMEOUT; /* We must be the owner of the mutex or we can't do this... */ @@ -104,14 +104,14 @@ static apr_status_t do_wait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex, cond->condlock = mutex; release_sem(cond->lock); - apr_thread_mutex_unlock(cond->condlock); + fspr_thread_mutex_unlock(cond->condlock); if (timeout == 0) flags = 0; rv = acquire_sem_etc(wait->sem, 1, flags, timeout); - apr_thread_mutex_lock(cond->condlock); + fspr_thread_mutex_lock(cond->condlock); if (rv != B_OK) if (rv == B_TIMED_OUT) @@ -126,20 +126,20 @@ static apr_status_t do_wait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, - apr_thread_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_thread_cond_wait(fspr_thread_cond_t *cond, + fspr_thread_mutex_t *mutex) { return do_wait(cond, mutex, 0); } -APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, - apr_thread_mutex_t *mutex, - apr_interval_time_t timeout) +APR_DECLARE(fspr_status_t) fspr_thread_cond_timedwait(fspr_thread_cond_t *cond, + fspr_thread_mutex_t *mutex, + fspr_interval_time_t timeout) { return do_wait(cond, mutex, timeout); } -APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) +APR_DECLARE(fspr_status_t) fspr_thread_cond_signal(fspr_thread_cond_t *cond) { struct waiter_t *wake; @@ -155,7 +155,7 @@ APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond) +APR_DECLARE(fspr_status_t) fspr_thread_cond_broadcast(fspr_thread_cond_t *cond) { struct waiter_t *wake; @@ -171,11 +171,11 @@ APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond) +APR_DECLARE(fspr_status_t) fspr_thread_cond_destroy(fspr_thread_cond_t *cond) { - apr_status_t stat; + fspr_status_t stat; if ((stat = thread_cond_cleanup(cond)) == APR_SUCCESS) { - apr_pool_cleanup_kill(cond->pool, cond, thread_cond_cleanup); + fspr_pool_cleanup_kill(cond->pool, cond, thread_cond_cleanup); return APR_SUCCESS; } return stat; diff --git a/libs/apr/locks/beos/thread_mutex.c b/libs/apr/locks/beos/thread_mutex.c index b87f76606f..4604939802 100644 --- a/libs/apr/locks/beos/thread_mutex.c +++ b/libs/apr/locks/beos/thread_mutex.c @@ -18,13 +18,13 @@ * Stephen Beaulieu */ -#include "apr_arch_thread_mutex.h" -#include "apr_strings.h" -#include "apr_portable.h" +#include "fspr_arch_thread_mutex.h" +#include "fspr_strings.h" +#include "fspr_portable.h" -static apr_status_t _thread_mutex_cleanup(void * data) +static fspr_status_t _thread_mutex_cleanup(void * data) { - apr_thread_mutex_t *lock = (apr_thread_mutex_t*)data; + fspr_thread_mutex_t *lock = (fspr_thread_mutex_t*)data; if (lock->LockCount != 0) { /* we're still locked... */ while (atomic_add(&lock->LockCount , -1) > 1){ @@ -39,14 +39,14 @@ static apr_status_t _thread_mutex_cleanup(void * data) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, +APR_DECLARE(fspr_status_t) fspr_thread_mutex_create(fspr_thread_mutex_t **mutex, unsigned int flags, - apr_pool_t *pool) + fspr_pool_t *pool) { - apr_thread_mutex_t *new_m; - apr_status_t stat = APR_SUCCESS; + fspr_thread_mutex_t *new_m; + fspr_status_t stat = APR_SUCCESS; - new_m = (apr_thread_mutex_t *)apr_pcalloc(pool, sizeof(apr_thread_mutex_t)); + new_m = (fspr_thread_mutex_t *)fspr_pcalloc(pool, sizeof(fspr_thread_mutex_t)); if (new_m == NULL){ return APR_ENOMEM; } @@ -64,24 +64,24 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, */ new_m->nested = flags & APR_THREAD_MUTEX_NESTED; - apr_pool_cleanup_register(new_m->pool, (void *)new_m, _thread_mutex_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register(new_m->pool, (void *)new_m, _thread_mutex_cleanup, + fspr_pool_cleanup_null); (*mutex) = new_m; return APR_SUCCESS; } #if APR_HAS_CREATE_LOCKS_NP -APR_DECLARE(apr_status_t) apr_thread_mutex_create_np(apr_thread_mutex_t **mutex, +APR_DECLARE(fspr_status_t) fspr_thread_mutex_create_np(fspr_thread_mutex_t **mutex, const char *fname, - apr_lockmech_e_np mech, - apr_pool_t *pool) + fspr_lockmech_e_np mech, + fspr_pool_t *pool) { return APR_ENOTIMPL; } #endif -APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_thread_mutex_lock(fspr_thread_mutex_t *mutex) { int32 stat; thread_id me = find_thread(NULL); @@ -105,12 +105,12 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_thread_mutex_trylock(fspr_thread_mutex_t *mutex) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_thread_mutex_unlock(fspr_thread_mutex_t *mutex) { int32 stat; @@ -133,11 +133,11 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_thread_mutex_destroy(fspr_thread_mutex_t *mutex) { - apr_status_t stat; + fspr_status_t stat; if ((stat = _thread_mutex_cleanup(mutex)) == APR_SUCCESS) { - apr_pool_cleanup_kill(mutex->pool, mutex, _thread_mutex_cleanup); + fspr_pool_cleanup_kill(mutex->pool, mutex, _thread_mutex_cleanup); return APR_SUCCESS; } return stat; diff --git a/libs/apr/locks/beos/thread_rwlock.c b/libs/apr/locks/beos/thread_rwlock.c index a540b44557..d006b3183a 100644 --- a/libs/apr/locks/beos/thread_rwlock.c +++ b/libs/apr/locks/beos/thread_rwlock.c @@ -18,15 +18,15 @@ * Stephen Beaulieu */ -#include "apr_arch_thread_rwlock.h" -#include "apr_strings.h" -#include "apr_portable.h" +#include "fspr_arch_thread_rwlock.h" +#include "fspr_strings.h" +#include "fspr_portable.h" #define BIG_NUM 100000 -static apr_status_t _thread_rw_cleanup(void * data) +static fspr_status_t _thread_rw_cleanup(void * data) { - apr_thread_rwlock_t *mutex = (apr_thread_rwlock_t*)data; + fspr_thread_rwlock_t *mutex = (fspr_thread_rwlock_t*)data; if (mutex->ReadCount != 0) { while (atomic_add(&mutex->ReadCount , -1) > 1){ @@ -50,12 +50,12 @@ static apr_status_t _thread_rw_cleanup(void * data) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_create(fspr_thread_rwlock_t **rwlock, + fspr_pool_t *pool) { - apr_thread_rwlock_t *new; + fspr_thread_rwlock_t *new; - new = (apr_thread_rwlock_t *)apr_pcalloc(pool, sizeof(apr_thread_rwlock_t)); + new = (fspr_thread_rwlock_t *)fspr_pcalloc(pool, sizeof(fspr_thread_rwlock_t)); if (new == NULL){ return APR_ENOMEM; } @@ -74,13 +74,13 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, return -1; } - apr_pool_cleanup_register(new->pool, (void *)new, _thread_rw_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register(new->pool, (void *)new, _thread_rw_cleanup, + fspr_pool_cleanup_null); (*rwlock) = new; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_rdlock(fspr_thread_rwlock_t *rwlock) { int32 rv = APR_SUCCESS; @@ -100,12 +100,12 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock) return rv; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_tryrdlock(fspr_thread_rwlock_t *rwlock) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_wrlock(fspr_thread_rwlock_t *rwlock) { int rv = APR_SUCCESS; @@ -136,14 +136,14 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock) return rv; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_trywrlock(fspr_thread_rwlock_t *rwlock) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_unlock(fspr_thread_rwlock_t *rwlock) { - apr_status_t rv = APR_SUCCESS; + fspr_status_t rv = APR_SUCCESS; int32 readers; /* we know we hold the lock, so don't check it :) */ @@ -176,11 +176,11 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock) return rv; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_destroy(fspr_thread_rwlock_t *rwlock) { - apr_status_t stat; + fspr_status_t stat; if ((stat = _thread_rw_cleanup(rwlock)) == APR_SUCCESS) { - apr_pool_cleanup_kill(rwlock->pool, rwlock, _thread_rw_cleanup); + fspr_pool_cleanup_kill(rwlock->pool, rwlock, _thread_rw_cleanup); return APR_SUCCESS; } return stat; diff --git a/libs/apr/locks/netware/proc_mutex.c b/libs/apr/locks/netware/proc_mutex.c index 77411d0bf2..31bbd9ca05 100644 --- a/libs/apr/locks/netware/proc_mutex.c +++ b/libs/apr/locks/netware/proc_mutex.c @@ -14,27 +14,27 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_private.h" -#include "apr_portable.h" -#include "apr_arch_proc_mutex.h" -#include "apr_arch_thread_mutex.h" +#include "fspr.h" +#include "fspr_private.h" +#include "fspr_portable.h" +#include "fspr_arch_proc_mutex.h" +#include "fspr_arch_thread_mutex.h" -APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, +APR_DECLARE(fspr_status_t) fspr_proc_mutex_create(fspr_proc_mutex_t **mutex, const char *fname, - apr_lockmech_e mech, - apr_pool_t *pool) + fspr_lockmech_e mech, + fspr_pool_t *pool) { - apr_status_t ret; - apr_proc_mutex_t *new_mutex = NULL; - new_mutex = (apr_proc_mutex_t *)apr_pcalloc(pool, sizeof(apr_proc_mutex_t)); + fspr_status_t ret; + fspr_proc_mutex_t *new_mutex = NULL; + new_mutex = (fspr_proc_mutex_t *)fspr_pcalloc(pool, sizeof(fspr_proc_mutex_t)); if(new_mutex ==NULL) { return APR_ENOMEM; } new_mutex->pool = pool; - ret = apr_thread_mutex_create(&(new_mutex->mutex), APR_THREAD_MUTEX_DEFAULT, pool); + ret = fspr_thread_mutex_create(&(new_mutex->mutex), APR_THREAD_MUTEX_DEFAULT, pool); if (ret == APR_SUCCESS) *mutex = new_mutex; @@ -42,76 +42,76 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, return ret; } -APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, +APR_DECLARE(fspr_status_t) fspr_proc_mutex_child_init(fspr_proc_mutex_t **mutex, const char *fname, - apr_pool_t *pool) + fspr_pool_t *pool) { return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_proc_mutex_lock(fspr_proc_mutex_t *mutex) { if (mutex) - return apr_thread_mutex_lock(mutex->mutex); + return fspr_thread_mutex_lock(mutex->mutex); return APR_ENOLOCK; } -APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_proc_mutex_trylock(fspr_proc_mutex_t *mutex) { if (mutex) - return apr_thread_mutex_trylock(mutex->mutex); + return fspr_thread_mutex_trylock(mutex->mutex); return APR_ENOLOCK; } -APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_proc_mutex_unlock(fspr_proc_mutex_t *mutex) { if (mutex) - return apr_thread_mutex_unlock(mutex->mutex); + return fspr_thread_mutex_unlock(mutex->mutex); return APR_ENOLOCK; } -APR_DECLARE(apr_status_t) apr_proc_mutex_cleanup(void *mutex) +APR_DECLARE(fspr_status_t) fspr_proc_mutex_cleanup(void *mutex) { - return apr_proc_mutex_destroy(mutex); + return fspr_proc_mutex_destroy(mutex); } -APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_proc_mutex_destroy(fspr_proc_mutex_t *mutex) { if (mutex) - return apr_thread_mutex_destroy(mutex->mutex); + return fspr_thread_mutex_destroy(mutex->mutex); return APR_ENOLOCK; } -APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex) +APR_DECLARE(const char *) fspr_proc_mutex_lockfile(fspr_proc_mutex_t *mutex) { return NULL; } -APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) +APR_DECLARE(const char *) fspr_proc_mutex_name(fspr_proc_mutex_t *mutex) { return "netwarethread"; } -APR_DECLARE(const char *) apr_proc_mutex_defname(void) +APR_DECLARE(const char *) fspr_proc_mutex_defname(void) { return "netwarethread"; } APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) -/* Implement OS-specific accessors defined in apr_portable.h */ +/* Implement OS-specific accessors defined in fspr_portable.h */ -apr_status_t apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, - apr_proc_mutex_t *pmutex) +fspr_status_t fspr_os_proc_mutex_get(fspr_os_proc_mutex_t *ospmutex, + fspr_proc_mutex_t *pmutex) { if (pmutex) ospmutex = pmutex->mutex->mutex; return APR_ENOLOCK; } -apr_status_t apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, - apr_os_proc_mutex_t *ospmutex, - apr_pool_t *pool) +fspr_status_t fspr_os_proc_mutex_put(fspr_proc_mutex_t **pmutex, + fspr_os_proc_mutex_t *ospmutex, + fspr_pool_t *pool) { return APR_ENOTIMPL; } diff --git a/libs/apr/locks/netware/thread_cond.c b/libs/apr/locks/netware/thread_cond.c index dcb21edc9e..19f4649fe5 100644 --- a/libs/apr/locks/netware/thread_cond.c +++ b/libs/apr/locks/netware/thread_cond.c @@ -16,28 +16,28 @@ #include -#include "apr.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_strings.h" -#include "apr_arch_thread_mutex.h" -#include "apr_arch_thread_cond.h" -#include "apr_portable.h" +#include "fspr.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_strings.h" +#include "fspr_arch_thread_mutex.h" +#include "fspr_arch_thread_cond.h" +#include "fspr_portable.h" -static apr_status_t thread_cond_cleanup(void *data) +static fspr_status_t thread_cond_cleanup(void *data) { - apr_thread_cond_t *cond = (apr_thread_cond_t *)data; + fspr_thread_cond_t *cond = (fspr_thread_cond_t *)data; NXCondFree(cond->cond); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_thread_cond_create(fspr_thread_cond_t **cond, + fspr_pool_t *pool) { - apr_thread_cond_t *new_cond = NULL; + fspr_thread_cond_t *new_cond = NULL; - new_cond = (apr_thread_cond_t *)apr_pcalloc(pool, sizeof(apr_thread_cond_t)); + new_cond = (fspr_thread_cond_t *)fspr_pcalloc(pool, sizeof(fspr_thread_cond_t)); if(new_cond ==NULL) { return APR_ENOMEM; @@ -49,24 +49,24 @@ APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, if(new_cond->cond == NULL) return APR_ENOMEM; - apr_pool_cleanup_register(new_cond->pool, new_cond, + fspr_pool_cleanup_register(new_cond->pool, new_cond, (void*)thread_cond_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_null); *cond = new_cond; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, - apr_thread_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_thread_cond_wait(fspr_thread_cond_t *cond, + fspr_thread_mutex_t *mutex) { if (NXCondWait(cond->cond, mutex->mutex) != 0) return APR_EINTR; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, - apr_thread_mutex_t *mutex, - apr_interval_time_t timeout){ +APR_DECLARE(fspr_status_t) fspr_thread_cond_timedwait(fspr_thread_cond_t *cond, + fspr_thread_mutex_t *mutex, + fspr_interval_time_t timeout){ if (NXCondTimedWait(cond->cond, mutex->mutex, (timeout*1000)/NXGetSystemTick()) == NX_ETIMEDOUT) { return APR_TIMEUP; @@ -74,23 +74,23 @@ APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) +APR_DECLARE(fspr_status_t) fspr_thread_cond_signal(fspr_thread_cond_t *cond) { NXCondSignal(cond->cond); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond) +APR_DECLARE(fspr_status_t) fspr_thread_cond_broadcast(fspr_thread_cond_t *cond) { NXCondBroadcast(cond->cond); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond) +APR_DECLARE(fspr_status_t) fspr_thread_cond_destroy(fspr_thread_cond_t *cond) { - apr_status_t stat; + fspr_status_t stat; if ((stat = thread_cond_cleanup(cond)) == APR_SUCCESS) { - apr_pool_cleanup_kill(cond->pool, cond, thread_cond_cleanup); + fspr_pool_cleanup_kill(cond->pool, cond, thread_cond_cleanup); return APR_SUCCESS; } return stat; diff --git a/libs/apr/locks/netware/thread_mutex.c b/libs/apr/locks/netware/thread_mutex.c index 98bf33bd22..8607211a4b 100644 --- a/libs/apr/locks/netware/thread_mutex.c +++ b/libs/apr/locks/netware/thread_mutex.c @@ -14,33 +14,33 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_strings.h" -#include "apr_arch_thread_mutex.h" -#include "apr_portable.h" +#include "fspr.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_strings.h" +#include "fspr_arch_thread_mutex.h" +#include "fspr_portable.h" -static apr_status_t thread_mutex_cleanup(void *data) +static fspr_status_t thread_mutex_cleanup(void *data) { - apr_thread_mutex_t *mutex = (apr_thread_mutex_t *)data; + fspr_thread_mutex_t *mutex = (fspr_thread_mutex_t *)data; NXMutexFree(mutex->mutex); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, +APR_DECLARE(fspr_status_t) fspr_thread_mutex_create(fspr_thread_mutex_t **mutex, unsigned int flags, - apr_pool_t *pool) + fspr_pool_t *pool) { - apr_thread_mutex_t *new_mutex = NULL; + fspr_thread_mutex_t *new_mutex = NULL; /* XXX: Implement _UNNESTED flavor and favor _DEFAULT for performance */ if (flags & APR_THREAD_MUTEX_UNNESTED) { return APR_ENOTIMPL; } - new_mutex = (apr_thread_mutex_t *)apr_pcalloc(pool, sizeof(apr_thread_mutex_t)); + new_mutex = (fspr_thread_mutex_t *)fspr_pcalloc(pool, sizeof(fspr_thread_mutex_t)); if(new_mutex ==NULL) { return APR_ENOMEM; @@ -52,37 +52,37 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, if(new_mutex->mutex == NULL) return APR_ENOMEM; - apr_pool_cleanup_register(new_mutex->pool, new_mutex, + fspr_pool_cleanup_register(new_mutex->pool, new_mutex, (void*)thread_mutex_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_null); *mutex = new_mutex; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_thread_mutex_lock(fspr_thread_mutex_t *mutex) { NXLock(mutex->mutex); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_thread_mutex_trylock(fspr_thread_mutex_t *mutex) { if (!NXTryLock(mutex->mutex)) return APR_EBUSY; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_thread_mutex_unlock(fspr_thread_mutex_t *mutex) { NXUnlock(mutex->mutex); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_thread_mutex_destroy(fspr_thread_mutex_t *mutex) { - apr_status_t stat; + fspr_status_t stat; if ((stat = thread_mutex_cleanup(mutex)) == APR_SUCCESS) { - apr_pool_cleanup_kill(mutex->pool, mutex, thread_mutex_cleanup); + fspr_pool_cleanup_kill(mutex->pool, mutex, thread_mutex_cleanup); return APR_SUCCESS; } return stat; diff --git a/libs/apr/locks/netware/thread_rwlock.c b/libs/apr/locks/netware/thread_rwlock.c index d0bf3ddf34..d0f094d2df 100644 --- a/libs/apr/locks/netware/thread_rwlock.c +++ b/libs/apr/locks/netware/thread_rwlock.c @@ -14,85 +14,85 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_strings.h" -#include "apr_arch_thread_rwlock.h" -#include "apr_portable.h" +#include "fspr.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_strings.h" +#include "fspr_arch_thread_rwlock.h" +#include "fspr_portable.h" -static apr_status_t thread_rwlock_cleanup(void *data) +static fspr_status_t thread_rwlock_cleanup(void *data) { - apr_thread_rwlock_t *rwlock = (apr_thread_rwlock_t *)data; + fspr_thread_rwlock_t *rwlock = (fspr_thread_rwlock_t *)data; NXRwLockFree (rwlock->rwlock); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_create(fspr_thread_rwlock_t **rwlock, + fspr_pool_t *pool) { - apr_thread_rwlock_t *new_rwlock = NULL; + fspr_thread_rwlock_t *new_rwlock = NULL; NXHierarchy_t hierarchy = 1; //for libc NKS NXRwLockAlloc NXLockInfo_t *info; //for libc NKS NXRwLockAlloc - new_rwlock = (apr_thread_rwlock_t *)apr_pcalloc(pool, sizeof(apr_thread_rwlock_t)); + new_rwlock = (fspr_thread_rwlock_t *)fspr_pcalloc(pool, sizeof(fspr_thread_rwlock_t)); if(new_rwlock ==NULL) { return APR_ENOMEM; } new_rwlock->pool = pool; - info = (NXLockInfo_t *)apr_pcalloc(pool, sizeof(NXLockInfo_t)); + info = (NXLockInfo_t *)fspr_pcalloc(pool, sizeof(NXLockInfo_t)); new_rwlock->rwlock = NXRwLockAlloc(hierarchy, info); if(new_rwlock->rwlock == NULL) return APR_ENOMEM; - apr_pool_cleanup_register(new_rwlock->pool, new_rwlock, thread_rwlock_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register(new_rwlock->pool, new_rwlock, thread_rwlock_cleanup, + fspr_pool_cleanup_null); *rwlock = new_rwlock; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_rdlock(fspr_thread_rwlock_t *rwlock) { NXRdLock(rwlock->rwlock); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_tryrdlock(fspr_thread_rwlock_t *rwlock) { if (!NXTryRdLock(rwlock->rwlock)) return APR_EBUSY; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_wrlock(fspr_thread_rwlock_t *rwlock) { NXWrLock(rwlock->rwlock); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_trywrlock(fspr_thread_rwlock_t *rwlock) { if (!NXTryWrLock(rwlock->rwlock)) return APR_EBUSY; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_unlock(fspr_thread_rwlock_t *rwlock) { NXRwUnlock(rwlock->rwlock); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_destroy(fspr_thread_rwlock_t *rwlock) { - apr_status_t stat; + fspr_status_t stat; if ((stat = thread_rwlock_cleanup(rwlock)) == APR_SUCCESS) { - apr_pool_cleanup_kill(rwlock->pool, rwlock, thread_rwlock_cleanup); + fspr_pool_cleanup_kill(rwlock->pool, rwlock, thread_rwlock_cleanup); return APR_SUCCESS; } return stat; diff --git a/libs/apr/locks/os2/proc_mutex.c b/libs/apr/locks/os2/proc_mutex.c index 5a49356355..695dc0931e 100644 --- a/libs/apr/locks/os2/proc_mutex.c +++ b/libs/apr/locks/os2/proc_mutex.c @@ -14,18 +14,18 @@ * limitations under the License. */ -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_strings.h" -#include "apr_portable.h" -#include "apr_arch_proc_mutex.h" -#include "apr_arch_file_io.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_strings.h" +#include "fspr_portable.h" +#include "fspr_arch_proc_mutex.h" +#include "fspr_arch_file_io.h" #include #include #define CurrentTid (*_threadid) -static char *fixed_name(const char *fname, apr_pool_t *pool) +static char *fixed_name(const char *fname, fspr_pool_t *pool) { char *semname; @@ -37,7 +37,7 @@ static char *fixed_name(const char *fname, apr_pool_t *pool) fname++; } - semname = apr_pstrcat(pool, "/SEM32/", fname, NULL); + semname = fspr_pstrcat(pool, "/SEM32/", fname, NULL); if (semname[8] == ':') { semname[8] = '$'; @@ -49,34 +49,34 @@ static char *fixed_name(const char *fname, apr_pool_t *pool) -APR_DECLARE(apr_status_t) apr_proc_mutex_cleanup(void *vmutex) +APR_DECLARE(fspr_status_t) fspr_proc_mutex_cleanup(void *vmutex) { - apr_proc_mutex_t *mutex = vmutex; - return apr_proc_mutex_destroy(mutex); + fspr_proc_mutex_t *mutex = vmutex; + return fspr_proc_mutex_destroy(mutex); } -APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex) +APR_DECLARE(const char *) fspr_proc_mutex_lockfile(fspr_proc_mutex_t *mutex) { return NULL; } -APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) +APR_DECLARE(const char *) fspr_proc_mutex_name(fspr_proc_mutex_t *mutex) { return "os2sem"; } -APR_DECLARE(const char *) apr_proc_mutex_defname(void) +APR_DECLARE(const char *) fspr_proc_mutex_defname(void) { return "os2sem"; } -APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, +APR_DECLARE(fspr_status_t) fspr_proc_mutex_create(fspr_proc_mutex_t **mutex, const char *fname, - apr_lockmech_e mech, - apr_pool_t *pool) + fspr_lockmech_e mech, + fspr_pool_t *pool) { - apr_proc_mutex_t *new; + fspr_proc_mutex_t *new; ULONG rc; char *semname; @@ -84,7 +84,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, return APR_ENOTIMPL; } - new = (apr_proc_mutex_t *)apr_palloc(pool, sizeof(apr_proc_mutex_t)); + new = (fspr_proc_mutex_t *)fspr_palloc(pool, sizeof(fspr_proc_mutex_t)); new->pool = pool; new->owner = 0; new->lock_count = 0; @@ -94,7 +94,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, rc = DosCreateMutexSem(semname, &(new->hMutex), DC_SEM_SHARED, FALSE); if (!rc) { - apr_pool_cleanup_register(pool, new, apr_proc_mutex_cleanup, apr_pool_cleanup_null); + fspr_pool_cleanup_register(pool, new, fspr_proc_mutex_cleanup, fspr_pool_cleanup_null); } return APR_FROM_OS_ERROR(rc); @@ -102,15 +102,15 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, -APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, +APR_DECLARE(fspr_status_t) fspr_proc_mutex_child_init(fspr_proc_mutex_t **mutex, const char *fname, - apr_pool_t *pool) + fspr_pool_t *pool) { - apr_proc_mutex_t *new; + fspr_proc_mutex_t *new; ULONG rc; char *semname; - new = (apr_proc_mutex_t *)apr_palloc(pool, sizeof(apr_proc_mutex_t)); + new = (fspr_proc_mutex_t *)fspr_palloc(pool, sizeof(fspr_proc_mutex_t)); new->pool = pool; new->owner = 0; new->lock_count = 0; @@ -120,7 +120,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, *mutex = new; if (!rc) { - apr_pool_cleanup_register(pool, new, apr_proc_mutex_cleanup, apr_pool_cleanup_null); + fspr_pool_cleanup_register(pool, new, fspr_proc_mutex_cleanup, fspr_pool_cleanup_null); } return APR_FROM_OS_ERROR(rc); @@ -128,7 +128,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, -APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_proc_mutex_lock(fspr_proc_mutex_t *mutex) { ULONG rc = DosRequestMutexSem(mutex->hMutex, SEM_INDEFINITE_WAIT); @@ -142,7 +142,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex) -APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_proc_mutex_trylock(fspr_proc_mutex_t *mutex) { ULONG rc = DosRequestMutexSem(mutex->hMutex, SEM_IMMEDIATE_RETURN); @@ -156,7 +156,7 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) -APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_proc_mutex_unlock(fspr_proc_mutex_t *mutex) { ULONG rc; @@ -171,14 +171,14 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) -APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_proc_mutex_destroy(fspr_proc_mutex_t *mutex) { ULONG rc; - apr_status_t status = APR_SUCCESS; + fspr_status_t status = APR_SUCCESS; if (mutex->owner == CurrentTid) { while (mutex->lock_count > 0 && status == APR_SUCCESS) { - status = apr_proc_mutex_unlock(mutex); + status = fspr_proc_mutex_unlock(mutex); } } @@ -205,10 +205,10 @@ APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) -/* Implement OS-specific accessors defined in apr_portable.h */ +/* Implement OS-specific accessors defined in fspr_portable.h */ -APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, - apr_proc_mutex_t *pmutex) +APR_DECLARE(fspr_status_t) fspr_os_proc_mutex_get(fspr_os_proc_mutex_t *ospmutex, + fspr_proc_mutex_t *pmutex) { *ospmutex = pmutex->hMutex; return APR_ENOTIMPL; @@ -216,13 +216,13 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, -APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, - apr_os_proc_mutex_t *ospmutex, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_proc_mutex_put(fspr_proc_mutex_t **pmutex, + fspr_os_proc_mutex_t *ospmutex, + fspr_pool_t *pool) { - apr_proc_mutex_t *new; + fspr_proc_mutex_t *new; - new = (apr_proc_mutex_t *)apr_palloc(pool, sizeof(apr_proc_mutex_t)); + new = (fspr_proc_mutex_t *)fspr_palloc(pool, sizeof(fspr_proc_mutex_t)); new->pool = pool; new->owner = 0; new->lock_count = 0; diff --git a/libs/apr/locks/os2/thread_cond.c b/libs/apr/locks/os2/thread_cond.c index ec6034f55d..509d159363 100644 --- a/libs/apr/locks/os2/thread_cond.c +++ b/libs/apr/locks/os2/thread_cond.c @@ -14,44 +14,44 @@ * limitations under the License. */ -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_strings.h" -#include "apr_portable.h" -#include "apr_arch_thread_mutex.h" -#include "apr_arch_thread_cond.h" -#include "apr_arch_file_io.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_strings.h" +#include "fspr_portable.h" +#include "fspr_arch_thread_mutex.h" +#include "fspr_arch_thread_cond.h" +#include "fspr_arch_file_io.h" #include -APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_thread_cond_create(fspr_thread_cond_t **cond, + fspr_pool_t *pool) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, - apr_thread_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_thread_cond_wait(fspr_thread_cond_t *cond, + fspr_thread_mutex_t *mutex) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, - apr_thread_mutex_t *mutex, - apr_interval_time_t timeout){ +APR_DECLARE(fspr_status_t) fspr_thread_cond_timedwait(fspr_thread_cond_t *cond, + fspr_thread_mutex_t *mutex, + fspr_interval_time_t timeout){ return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) +APR_DECLARE(fspr_status_t) fspr_thread_cond_signal(fspr_thread_cond_t *cond) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond) +APR_DECLARE(fspr_status_t) fspr_thread_cond_broadcast(fspr_thread_cond_t *cond) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond) +APR_DECLARE(fspr_status_t) fspr_thread_cond_destroy(fspr_thread_cond_t *cond) { return APR_ENOTIMPL; } diff --git a/libs/apr/locks/os2/thread_mutex.c b/libs/apr/locks/os2/thread_mutex.c index 5d8436be4f..873820ded2 100644 --- a/libs/apr/locks/os2/thread_mutex.c +++ b/libs/apr/locks/os2/thread_mutex.c @@ -14,19 +14,19 @@ * limitations under the License. */ -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_strings.h" -#include "apr_portable.h" -#include "apr_arch_thread_mutex.h" -#include "apr_arch_file_io.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_strings.h" +#include "fspr_portable.h" +#include "fspr_arch_thread_mutex.h" +#include "fspr_arch_file_io.h" #include #include -static apr_status_t thread_mutex_cleanup(void *themutex) +static fspr_status_t thread_mutex_cleanup(void *themutex) { - apr_thread_mutex_t *mutex = themutex; - return apr_thread_mutex_destroy(mutex); + fspr_thread_mutex_t *mutex = themutex; + return fspr_thread_mutex_destroy(mutex); } @@ -34,28 +34,28 @@ static apr_status_t thread_mutex_cleanup(void *themutex) /* XXX: Need to respect APR_THREAD_MUTEX_[UN]NESTED flags argument * or return APR_ENOTIMPL!!! */ -APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, +APR_DECLARE(fspr_status_t) fspr_thread_mutex_create(fspr_thread_mutex_t **mutex, unsigned int flags, - apr_pool_t *pool) + fspr_pool_t *pool) { - apr_thread_mutex_t *new_mutex; + fspr_thread_mutex_t *new_mutex; ULONG rc; - new_mutex = (apr_thread_mutex_t *)apr_palloc(pool, sizeof(apr_thread_mutex_t)); + new_mutex = (fspr_thread_mutex_t *)fspr_palloc(pool, sizeof(fspr_thread_mutex_t)); new_mutex->pool = pool; rc = DosCreateMutexSem(NULL, &(new_mutex->hMutex), 0, FALSE); *mutex = new_mutex; if (!rc) - apr_pool_cleanup_register(pool, new_mutex, thread_mutex_cleanup, apr_pool_cleanup_null); + fspr_pool_cleanup_register(pool, new_mutex, thread_mutex_cleanup, fspr_pool_cleanup_null); return APR_OS2_STATUS(rc); } -APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_thread_mutex_lock(fspr_thread_mutex_t *mutex) { ULONG rc = DosRequestMutexSem(mutex->hMutex, SEM_INDEFINITE_WAIT); return APR_OS2_STATUS(rc); @@ -63,7 +63,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) -APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_thread_mutex_trylock(fspr_thread_mutex_t *mutex) { ULONG rc = DosRequestMutexSem(mutex->hMutex, SEM_IMMEDIATE_RETURN); return APR_OS2_STATUS(rc); @@ -71,7 +71,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) -APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_thread_mutex_unlock(fspr_thread_mutex_t *mutex) { ULONG rc = DosReleaseMutexSem(mutex->hMutex); return APR_OS2_STATUS(rc); @@ -79,7 +79,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) -APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_thread_mutex_destroy(fspr_thread_mutex_t *mutex) { ULONG rc; diff --git a/libs/apr/locks/os2/thread_rwlock.c b/libs/apr/locks/os2/thread_rwlock.c index 195a56bda3..6d7ad2280f 100644 --- a/libs/apr/locks/os2/thread_rwlock.c +++ b/libs/apr/locks/os2/thread_rwlock.c @@ -14,29 +14,29 @@ * limitations under the License. */ -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_strings.h" -#include "apr_portable.h" -#include "apr_arch_thread_rwlock.h" -#include "apr_arch_file_io.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_strings.h" +#include "fspr_portable.h" +#include "fspr_arch_thread_rwlock.h" +#include "fspr_arch_file_io.h" #include -static apr_status_t thread_rwlock_cleanup(void *therwlock) +static fspr_status_t thread_rwlock_cleanup(void *therwlock) { - apr_thread_rwlock_t *rwlock = therwlock; - return apr_thread_rwlock_destroy(rwlock); + fspr_thread_rwlock_t *rwlock = therwlock; + return fspr_thread_rwlock_destroy(rwlock); } -APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_create(fspr_thread_rwlock_t **rwlock, + fspr_pool_t *pool) { - apr_thread_rwlock_t *new_rwlock; + fspr_thread_rwlock_t *new_rwlock; ULONG rc; - new_rwlock = (apr_thread_rwlock_t *)apr_palloc(pool, sizeof(apr_thread_rwlock_t)); + new_rwlock = (fspr_thread_rwlock_t *)fspr_palloc(pool, sizeof(fspr_thread_rwlock_t)); new_rwlock->pool = pool; new_rwlock->readers = 0; @@ -53,15 +53,15 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, *rwlock = new_rwlock; if (!rc) - apr_pool_cleanup_register(pool, new_rwlock, thread_rwlock_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register(pool, new_rwlock, thread_rwlock_cleanup, + fspr_pool_cleanup_null); return APR_FROM_OS_ERROR(rc); } -APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_rdlock(fspr_thread_rwlock_t *rwlock) { ULONG rc, posts; @@ -82,7 +82,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock) -APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_tryrdlock(fspr_thread_rwlock_t *rwlock) { /* As above but with different wait time */ ULONG rc, posts; @@ -100,7 +100,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwloc -APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_wrlock(fspr_thread_rwlock_t *rwlock) { ULONG rc; @@ -125,7 +125,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock) -APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_trywrlock(fspr_thread_rwlock_t *rwlock) { ULONG rc; @@ -149,7 +149,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwloc -APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_unlock(fspr_thread_rwlock_t *rwlock) { ULONG rc; @@ -176,7 +176,7 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock) -APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_destroy(fspr_thread_rwlock_t *rwlock) { ULONG rc; diff --git a/libs/apr/locks/unix/global_mutex.c b/libs/apr/locks/unix/global_mutex.c index bfe360aa99..193482a62d 100644 --- a/libs/apr/locks/unix/global_mutex.c +++ b/libs/apr/locks/unix/global_mutex.c @@ -14,27 +14,27 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_strings.h" -#include "apr_arch_global_mutex.h" -#include "apr_proc_mutex.h" -#include "apr_thread_mutex.h" -#include "apr_portable.h" +#include "fspr.h" +#include "fspr_strings.h" +#include "fspr_arch_global_mutex.h" +#include "fspr_proc_mutex.h" +#include "fspr_thread_mutex.h" +#include "fspr_portable.h" -static apr_status_t global_mutex_cleanup(void *data) +static fspr_status_t global_mutex_cleanup(void *data) { - apr_global_mutex_t *m = (apr_global_mutex_t *)data; - apr_status_t rv; + fspr_global_mutex_t *m = (fspr_global_mutex_t *)data; + fspr_status_t rv; - rv = apr_proc_mutex_destroy(m->proc_mutex); + rv = fspr_proc_mutex_destroy(m->proc_mutex); #if APR_HAS_THREADS if (m->thread_mutex) { if (rv != APR_SUCCESS) { - (void)apr_thread_mutex_destroy(m->thread_mutex); + (void)fspr_thread_mutex_destroy(m->thread_mutex); } else { - rv = apr_thread_mutex_destroy(m->thread_mutex); + rv = fspr_thread_mutex_destroy(m->thread_mutex); } } #endif /* APR_HAS_THREADS */ @@ -42,18 +42,18 @@ static apr_status_t global_mutex_cleanup(void *data) return rv; } -APR_DECLARE(apr_status_t) apr_global_mutex_create(apr_global_mutex_t **mutex, +APR_DECLARE(fspr_status_t) fspr_global_mutex_create(fspr_global_mutex_t **mutex, const char *fname, - apr_lockmech_e mech, - apr_pool_t *pool) + fspr_lockmech_e mech, + fspr_pool_t *pool) { - apr_status_t rv; - apr_global_mutex_t *m; + fspr_status_t rv; + fspr_global_mutex_t *m; - m = (apr_global_mutex_t *)apr_palloc(pool, sizeof(*m)); + m = (fspr_global_mutex_t *)fspr_palloc(pool, sizeof(*m)); m->pool = pool; - rv = apr_proc_mutex_create(&m->proc_mutex, fname, mech, m->pool); + rv = fspr_proc_mutex_create(&m->proc_mutex, fname, mech, m->pool); if (rv != APR_SUCCESS) { return rv; } @@ -63,51 +63,51 @@ APR_DECLARE(apr_status_t) apr_global_mutex_create(apr_global_mutex_t **mutex, m->thread_mutex = NULL; /* We don't need a thread lock. */ } else { - rv = apr_thread_mutex_create(&m->thread_mutex, + rv = fspr_thread_mutex_create(&m->thread_mutex, APR_THREAD_MUTEX_DEFAULT, m->pool); if (rv != APR_SUCCESS) { - rv = apr_proc_mutex_destroy(m->proc_mutex); + rv = fspr_proc_mutex_destroy(m->proc_mutex); return rv; } } #endif /* APR_HAS_THREADS */ - apr_pool_cleanup_register(m->pool, (void *)m, - global_mutex_cleanup, apr_pool_cleanup_null); + fspr_pool_cleanup_register(m->pool, (void *)m, + global_mutex_cleanup, fspr_pool_cleanup_null); *mutex = m; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_global_mutex_child_init( - apr_global_mutex_t **mutex, +APR_DECLARE(fspr_status_t) fspr_global_mutex_child_init( + fspr_global_mutex_t **mutex, const char *fname, - apr_pool_t *pool) + fspr_pool_t *pool) { - apr_status_t rv; + fspr_status_t rv; - rv = apr_proc_mutex_child_init(&((*mutex)->proc_mutex), fname, pool); + rv = fspr_proc_mutex_child_init(&((*mutex)->proc_mutex), fname, pool); return rv; } -APR_DECLARE(apr_status_t) apr_global_mutex_lock(apr_global_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_global_mutex_lock(fspr_global_mutex_t *mutex) { - apr_status_t rv; + fspr_status_t rv; #if APR_HAS_THREADS if (mutex->thread_mutex) { - rv = apr_thread_mutex_lock(mutex->thread_mutex); + rv = fspr_thread_mutex_lock(mutex->thread_mutex); if (rv != APR_SUCCESS) { return rv; } } #endif /* APR_HAS_THREADS */ - rv = apr_proc_mutex_lock(mutex->proc_mutex); + rv = fspr_proc_mutex_lock(mutex->proc_mutex); #if APR_HAS_THREADS if (rv != APR_SUCCESS) { if (mutex->thread_mutex) { - (void)apr_thread_mutex_unlock(mutex->thread_mutex); + (void)fspr_thread_mutex_unlock(mutex->thread_mutex); } } #endif /* APR_HAS_THREADS */ @@ -115,25 +115,25 @@ APR_DECLARE(apr_status_t) apr_global_mutex_lock(apr_global_mutex_t *mutex) return rv; } -APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_global_mutex_trylock(fspr_global_mutex_t *mutex) { - apr_status_t rv; + fspr_status_t rv; #if APR_HAS_THREADS if (mutex->thread_mutex) { - rv = apr_thread_mutex_trylock(mutex->thread_mutex); + rv = fspr_thread_mutex_trylock(mutex->thread_mutex); if (rv != APR_SUCCESS) { return rv; } } #endif /* APR_HAS_THREADS */ - rv = apr_proc_mutex_trylock(mutex->proc_mutex); + rv = fspr_proc_mutex_trylock(mutex->proc_mutex); #if APR_HAS_THREADS if (rv != APR_SUCCESS) { if (mutex->thread_mutex) { - (void)apr_thread_mutex_unlock(mutex->thread_mutex); + (void)fspr_thread_mutex_unlock(mutex->thread_mutex); } } #endif /* APR_HAS_THREADS */ @@ -141,26 +141,26 @@ APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex) return rv; } -APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_global_mutex_unlock(fspr_global_mutex_t *mutex) { - apr_status_t rv; + fspr_status_t rv; - rv = apr_proc_mutex_unlock(mutex->proc_mutex); + rv = fspr_proc_mutex_unlock(mutex->proc_mutex); #if APR_HAS_THREADS if (mutex->thread_mutex) { if (rv != APR_SUCCESS) { - (void)apr_thread_mutex_unlock(mutex->thread_mutex); + (void)fspr_thread_mutex_unlock(mutex->thread_mutex); } else { - rv = apr_thread_mutex_unlock(mutex->thread_mutex); + rv = fspr_thread_mutex_unlock(mutex->thread_mutex); } } #endif /* APR_HAS_THREADS */ return rv; } -APR_DECLARE(apr_status_t) apr_os_global_mutex_get(apr_os_global_mutex_t *ospmutex, - apr_global_mutex_t *pmutex) +APR_DECLARE(fspr_status_t) fspr_os_global_mutex_get(fspr_os_global_mutex_t *ospmutex, + fspr_global_mutex_t *pmutex) { ospmutex->pool = pmutex->pool; ospmutex->proc_mutex = pmutex->proc_mutex; @@ -170,9 +170,9 @@ APR_DECLARE(apr_status_t) apr_os_global_mutex_get(apr_os_global_mutex_t *ospmute return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_global_mutex_destroy(fspr_global_mutex_t *mutex) { - return apr_pool_cleanup_run(mutex->pool, mutex, global_mutex_cleanup); + return fspr_pool_cleanup_run(mutex->pool, mutex, global_mutex_cleanup); } APR_POOL_IMPLEMENT_ACCESSOR(global_mutex) diff --git a/libs/apr/locks/unix/proc_mutex.c b/libs/apr/locks/unix/proc_mutex.c index 579bb8af4d..cebceadf7c 100644 --- a/libs/apr/locks/unix/proc_mutex.c +++ b/libs/apr/locks/unix/proc_mutex.c @@ -14,25 +14,25 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_strings.h" -#include "apr_arch_proc_mutex.h" -#include "apr_arch_file_io.h" /* for apr_mkstemp() */ +#include "fspr.h" +#include "fspr_strings.h" +#include "fspr_arch_proc_mutex.h" +#include "fspr_arch_file_io.h" /* for fspr_mkstemp() */ -APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_proc_mutex_destroy(fspr_proc_mutex_t *mutex) { - return apr_pool_cleanup_run(mutex->pool, mutex, apr_proc_mutex_cleanup); + return fspr_pool_cleanup_run(mutex->pool, mutex, fspr_proc_mutex_cleanup); } -static apr_status_t proc_mutex_no_tryacquire(apr_proc_mutex_t *new_mutex) +static fspr_status_t proc_mutex_no_tryacquire(fspr_proc_mutex_t *new_mutex) { return APR_ENOTIMPL; } #if APR_HAS_POSIXSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || \ APR_HAS_PROC_PTHREAD_SERIALIZE || APR_HAS_SYSVSEM_SERIALIZE -static apr_status_t proc_mutex_no_child_init(apr_proc_mutex_t **mutex, - apr_pool_t *cont, +static fspr_status_t proc_mutex_no_child_init(fspr_proc_mutex_t **mutex, + fspr_pool_t *cont, const char *fname) { return APR_SUCCESS; @@ -45,9 +45,9 @@ static apr_status_t proc_mutex_no_child_init(apr_proc_mutex_t **mutex, #define SEM_FAILED (-1) #endif -static apr_status_t proc_mutex_posix_cleanup(void *mutex_) +static fspr_status_t proc_mutex_posix_cleanup(void *mutex_) { - apr_proc_mutex_t *mutex = mutex_; + fspr_proc_mutex_t *mutex = mutex_; if (sem_close(mutex->psem_interproc) < 0) { return errno; @@ -56,16 +56,16 @@ static apr_status_t proc_mutex_posix_cleanup(void *mutex_) return APR_SUCCESS; } -static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex, +static fspr_status_t proc_mutex_posix_create(fspr_proc_mutex_t *new_mutex, const char *fname) { sem_t *psem; char semname[31]; - apr_time_t now; + fspr_time_t now; unsigned long sec; unsigned long usec; - new_mutex->interproc = apr_palloc(new_mutex->pool, + new_mutex->interproc = fspr_palloc(new_mutex->pool, sizeof(*new_mutex->interproc)); /* * This bogusness is to follow what appears to be the @@ -92,10 +92,10 @@ static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex, * help here however... * */ - now = apr_time_now(); - sec = apr_time_sec(now); - usec = apr_time_usec(now); - apr_snprintf(semname, sizeof(semname), "/ApR.%lxZ%lx", sec, usec); + now = fspr_time_now(); + sec = fspr_time_sec(now); + usec = fspr_time_usec(now); + fspr_snprintf(semname, sizeof(semname), "/ApR.%lxZ%lx", sec, usec); psem = sem_open(semname, O_CREAT, 0644, 1); if ((psem == (sem_t *)SEM_FAILED) && (errno == ENAMETOOLONG)) { /* Oh well, good try */ @@ -109,14 +109,14 @@ static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex, /* Ahhh. The joys of Posix sems. Predelete it... */ sem_unlink(semname); new_mutex->psem_interproc = psem; - new_mutex->fname = apr_pstrdup(new_mutex->pool, semname); - apr_pool_cleanup_register(new_mutex->pool, (void *)new_mutex, - apr_proc_mutex_cleanup, - apr_pool_cleanup_null); + new_mutex->fname = fspr_pstrdup(new_mutex->pool, semname); + fspr_pool_cleanup_register(new_mutex->pool, (void *)new_mutex, + fspr_proc_mutex_cleanup, + fspr_pool_cleanup_null); return APR_SUCCESS; } -static apr_status_t proc_mutex_posix_acquire(apr_proc_mutex_t *mutex) +static fspr_status_t proc_mutex_posix_acquire(fspr_proc_mutex_t *mutex) { if (sem_wait(mutex->psem_interproc) < 0) { return errno; @@ -125,7 +125,7 @@ static apr_status_t proc_mutex_posix_acquire(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -static apr_status_t proc_mutex_posix_release(apr_proc_mutex_t *mutex) +static fspr_status_t proc_mutex_posix_release(fspr_proc_mutex_t *mutex) { mutex->curr_locked = 0; if (sem_post(mutex->psem_interproc) < 0) { @@ -136,7 +136,7 @@ static apr_status_t proc_mutex_posix_release(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -static const apr_proc_mutex_unix_lock_methods_t mutex_posixsem_methods = +static const fspr_proc_mutex_unix_lock_methods_t mutex_posixsem_methods = { #if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS || defined(POSIXSEM_IS_GLOBAL) APR_PROCESS_LOCK_MECH_IS_GLOBAL, @@ -169,9 +169,9 @@ static void proc_mutex_sysv_setup(void) proc_mutex_op_off.sem_flg = SEM_UNDO; } -static apr_status_t proc_mutex_sysv_cleanup(void *mutex_) +static fspr_status_t proc_mutex_sysv_cleanup(void *mutex_) { - apr_proc_mutex_t *mutex=mutex_; + fspr_proc_mutex_t *mutex=mutex_; union semun ick; if (mutex->interproc->filedes != -1) { @@ -181,13 +181,13 @@ static apr_status_t proc_mutex_sysv_cleanup(void *mutex_) return APR_SUCCESS; } -static apr_status_t proc_mutex_sysv_create(apr_proc_mutex_t *new_mutex, +static fspr_status_t proc_mutex_sysv_create(fspr_proc_mutex_t *new_mutex, const char *fname) { union semun ick; - apr_status_t rv; + fspr_status_t rv; - new_mutex->interproc = apr_palloc(new_mutex->pool, sizeof(*new_mutex->interproc)); + new_mutex->interproc = fspr_palloc(new_mutex->pool, sizeof(*new_mutex->interproc)); new_mutex->interproc->filedes = semget(IPC_PRIVATE, 1, IPC_CREAT | 0600); if (new_mutex->interproc->filedes < 0) { @@ -202,13 +202,13 @@ static apr_status_t proc_mutex_sysv_create(apr_proc_mutex_t *new_mutex, return rv; } new_mutex->curr_locked = 0; - apr_pool_cleanup_register(new_mutex->pool, - (void *)new_mutex, apr_proc_mutex_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register(new_mutex->pool, + (void *)new_mutex, fspr_proc_mutex_cleanup, + fspr_pool_cleanup_null); return APR_SUCCESS; } -static apr_status_t proc_mutex_sysv_acquire(apr_proc_mutex_t *mutex) +static fspr_status_t proc_mutex_sysv_acquire(fspr_proc_mutex_t *mutex) { int rc; @@ -222,7 +222,7 @@ static apr_status_t proc_mutex_sysv_acquire(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -static apr_status_t proc_mutex_sysv_release(apr_proc_mutex_t *mutex) +static fspr_status_t proc_mutex_sysv_release(fspr_proc_mutex_t *mutex) { int rc; @@ -236,7 +236,7 @@ static apr_status_t proc_mutex_sysv_release(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -static const apr_proc_mutex_unix_lock_methods_t mutex_sysv_methods = +static const fspr_proc_mutex_unix_lock_methods_t mutex_sysv_methods = { #if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS || defined(SYSVSEM_IS_GLOBAL) APR_PROCESS_LOCK_MECH_IS_GLOBAL, @@ -256,10 +256,10 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_sysv_methods = #if APR_HAS_PROC_PTHREAD_SERIALIZE -static apr_status_t proc_mutex_proc_pthread_cleanup(void *mutex_) +static fspr_status_t proc_mutex_proc_pthread_cleanup(void *mutex_) { - apr_proc_mutex_t *mutex=mutex_; - apr_status_t rv; + fspr_proc_mutex_t *mutex=mutex_; + fspr_status_t rv; if (mutex->curr_locked == 1) { if ((rv = pthread_mutex_unlock(mutex->pthread_interproc))) { @@ -284,10 +284,10 @@ static apr_status_t proc_mutex_proc_pthread_cleanup(void *mutex_) return APR_SUCCESS; } -static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, +static fspr_status_t proc_mutex_proc_pthread_create(fspr_proc_mutex_t *new_mutex, const char *fname) { - apr_status_t rv; + fspr_status_t rv; int fd; pthread_mutexattr_t mattr; @@ -364,16 +364,16 @@ static apr_status_t proc_mutex_proc_pthread_create(apr_proc_mutex_t *new_mutex, return rv; } - apr_pool_cleanup_register(new_mutex->pool, + fspr_pool_cleanup_register(new_mutex->pool, (void *)new_mutex, - apr_proc_mutex_cleanup, - apr_pool_cleanup_null); + fspr_proc_mutex_cleanup, + fspr_pool_cleanup_null); return APR_SUCCESS; } -static apr_status_t proc_mutex_proc_pthread_acquire(apr_proc_mutex_t *mutex) +static fspr_status_t proc_mutex_proc_pthread_acquire(fspr_proc_mutex_t *mutex) { - apr_status_t rv; + fspr_status_t rv; if ((rv = pthread_mutex_lock(mutex->pthread_interproc))) { #ifdef PTHREAD_SETS_ERRNO @@ -394,11 +394,11 @@ static apr_status_t proc_mutex_proc_pthread_acquire(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -/* TODO: Add proc_mutex_proc_pthread_tryacquire(apr_proc_mutex_t *mutex) */ +/* TODO: Add proc_mutex_proc_pthread_tryacquire(fspr_proc_mutex_t *mutex) */ -static apr_status_t proc_mutex_proc_pthread_release(apr_proc_mutex_t *mutex) +static fspr_status_t proc_mutex_proc_pthread_release(fspr_proc_mutex_t *mutex) { - apr_status_t rv; + fspr_status_t rv; mutex->curr_locked = 0; if ((rv = pthread_mutex_unlock(mutex->pthread_interproc))) { @@ -410,7 +410,7 @@ static apr_status_t proc_mutex_proc_pthread_release(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -static const apr_proc_mutex_unix_lock_methods_t mutex_proc_pthread_methods = +static const fspr_proc_mutex_unix_lock_methods_t mutex_proc_pthread_methods = { APR_PROCESS_LOCK_MECH_IS_GLOBAL, proc_mutex_proc_pthread_create, @@ -429,7 +429,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_proc_pthread_methods = static struct flock proc_mutex_lock_it; static struct flock proc_mutex_unlock_it; -static apr_status_t proc_mutex_fcntl_release(apr_proc_mutex_t *); +static fspr_status_t proc_mutex_fcntl_release(fspr_proc_mutex_t *); static void proc_mutex_fcntl_setup(void) { @@ -445,10 +445,10 @@ static void proc_mutex_fcntl_setup(void) proc_mutex_unlock_it.l_pid = 0; /* pid not actually interesting */ } -static apr_status_t proc_mutex_fcntl_cleanup(void *mutex_) +static fspr_status_t proc_mutex_fcntl_cleanup(void *mutex_) { - apr_status_t status; - apr_proc_mutex_t *mutex=mutex_; + fspr_status_t status; + fspr_proc_mutex_t *mutex=mutex_; if (mutex->curr_locked == 1) { status = proc_mutex_fcntl_release(mutex); @@ -456,24 +456,24 @@ static apr_status_t proc_mutex_fcntl_cleanup(void *mutex_) return status; } - return apr_file_close(mutex->interproc); + return fspr_file_close(mutex->interproc); } -static apr_status_t proc_mutex_fcntl_create(apr_proc_mutex_t *new_mutex, +static fspr_status_t proc_mutex_fcntl_create(fspr_proc_mutex_t *new_mutex, const char *fname) { int rv; if (fname) { - new_mutex->fname = apr_pstrdup(new_mutex->pool, fname); - rv = apr_file_open(&new_mutex->interproc, new_mutex->fname, + new_mutex->fname = fspr_pstrdup(new_mutex->pool, fname); + rv = fspr_file_open(&new_mutex->interproc, new_mutex->fname, APR_CREATE | APR_WRITE | APR_EXCL, APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD, new_mutex->pool); } else { - new_mutex->fname = apr_pstrdup(new_mutex->pool, "/tmp/aprXXXXXX"); - rv = apr_file_mktemp(&new_mutex->interproc, new_mutex->fname, + new_mutex->fname = fspr_pstrdup(new_mutex->pool, "/tmp/aprXXXXXX"); + rv = fspr_file_mktemp(&new_mutex->interproc, new_mutex->fname, APR_CREATE | APR_WRITE | APR_EXCL, new_mutex->pool); } @@ -484,14 +484,14 @@ static apr_status_t proc_mutex_fcntl_create(apr_proc_mutex_t *new_mutex, new_mutex->curr_locked = 0; unlink(new_mutex->fname); - apr_pool_cleanup_register(new_mutex->pool, + fspr_pool_cleanup_register(new_mutex->pool, (void*)new_mutex, - apr_proc_mutex_cleanup, - apr_pool_cleanup_null); + fspr_proc_mutex_cleanup, + fspr_pool_cleanup_null); return APR_SUCCESS; } -static apr_status_t proc_mutex_fcntl_acquire(apr_proc_mutex_t *mutex) +static fspr_status_t proc_mutex_fcntl_acquire(fspr_proc_mutex_t *mutex) { int rc; @@ -505,7 +505,7 @@ static apr_status_t proc_mutex_fcntl_acquire(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -static apr_status_t proc_mutex_fcntl_release(apr_proc_mutex_t *mutex) +static fspr_status_t proc_mutex_fcntl_release(fspr_proc_mutex_t *mutex) { int rc; @@ -519,7 +519,7 @@ static apr_status_t proc_mutex_fcntl_release(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -static const apr_proc_mutex_unix_lock_methods_t mutex_fcntl_methods = +static const fspr_proc_mutex_unix_lock_methods_t mutex_fcntl_methods = { #if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS || defined(FCNTL_IS_GLOBAL) APR_PROCESS_LOCK_MECH_IS_GLOBAL, @@ -539,12 +539,12 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_fcntl_methods = #if APR_HAS_FLOCK_SERIALIZE -static apr_status_t proc_mutex_flock_release(apr_proc_mutex_t *); +static fspr_status_t proc_mutex_flock_release(fspr_proc_mutex_t *); -static apr_status_t proc_mutex_flock_cleanup(void *mutex_) +static fspr_status_t proc_mutex_flock_cleanup(void *mutex_) { - apr_status_t status; - apr_proc_mutex_t *mutex=mutex_; + fspr_status_t status; + fspr_proc_mutex_t *mutex=mutex_; if (mutex->curr_locked == 1) { status = proc_mutex_flock_release(mutex); @@ -552,27 +552,27 @@ static apr_status_t proc_mutex_flock_cleanup(void *mutex_) return status; } if (mutex->interproc) { /* if it was opened properly */ - apr_file_close(mutex->interproc); + fspr_file_close(mutex->interproc); } unlink(mutex->fname); return APR_SUCCESS; } -static apr_status_t proc_mutex_flock_create(apr_proc_mutex_t *new_mutex, +static fspr_status_t proc_mutex_flock_create(fspr_proc_mutex_t *new_mutex, const char *fname) { int rv; if (fname) { - new_mutex->fname = apr_pstrdup(new_mutex->pool, fname); - rv = apr_file_open(&new_mutex->interproc, new_mutex->fname, + new_mutex->fname = fspr_pstrdup(new_mutex->pool, fname); + rv = fspr_file_open(&new_mutex->interproc, new_mutex->fname, APR_CREATE | APR_WRITE | APR_EXCL, APR_UREAD | APR_UWRITE, new_mutex->pool); } else { - new_mutex->fname = apr_pstrdup(new_mutex->pool, "/tmp/aprXXXXXX"); - rv = apr_file_mktemp(&new_mutex->interproc, new_mutex->fname, + new_mutex->fname = fspr_pstrdup(new_mutex->pool, "/tmp/aprXXXXXX"); + rv = fspr_file_mktemp(&new_mutex->interproc, new_mutex->fname, APR_CREATE | APR_WRITE | APR_EXCL, new_mutex->pool); } @@ -582,13 +582,13 @@ static apr_status_t proc_mutex_flock_create(apr_proc_mutex_t *new_mutex, return errno; } new_mutex->curr_locked = 0; - apr_pool_cleanup_register(new_mutex->pool, (void *)new_mutex, - apr_proc_mutex_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register(new_mutex->pool, (void *)new_mutex, + fspr_proc_mutex_cleanup, + fspr_pool_cleanup_null); return APR_SUCCESS; } -static apr_status_t proc_mutex_flock_acquire(apr_proc_mutex_t *mutex) +static fspr_status_t proc_mutex_flock_acquire(fspr_proc_mutex_t *mutex) { int rc; @@ -602,7 +602,7 @@ static apr_status_t proc_mutex_flock_acquire(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -static apr_status_t proc_mutex_flock_release(apr_proc_mutex_t *mutex) +static fspr_status_t proc_mutex_flock_release(fspr_proc_mutex_t *mutex) { int rc; @@ -616,22 +616,22 @@ static apr_status_t proc_mutex_flock_release(apr_proc_mutex_t *mutex) return APR_SUCCESS; } -static apr_status_t proc_mutex_flock_child_init(apr_proc_mutex_t **mutex, - apr_pool_t *pool, +static fspr_status_t proc_mutex_flock_child_init(fspr_proc_mutex_t **mutex, + fspr_pool_t *pool, const char *fname) { - apr_proc_mutex_t *new_mutex; + fspr_proc_mutex_t *new_mutex; int rv; - new_mutex = (apr_proc_mutex_t *)apr_palloc(pool, sizeof(apr_proc_mutex_t)); + new_mutex = (fspr_proc_mutex_t *)fspr_palloc(pool, sizeof(fspr_proc_mutex_t)); memcpy(new_mutex, *mutex, sizeof *new_mutex); new_mutex->pool = pool; if (!fname) { fname = (*mutex)->fname; } - new_mutex->fname = apr_pstrdup(pool, fname); - rv = apr_file_open(&new_mutex->interproc, new_mutex->fname, + new_mutex->fname = fspr_pstrdup(pool, fname); + rv = fspr_file_open(&new_mutex->interproc, new_mutex->fname, APR_WRITE, 0, new_mutex->pool); if (rv != APR_SUCCESS) { return rv; @@ -640,7 +640,7 @@ static apr_status_t proc_mutex_flock_child_init(apr_proc_mutex_t **mutex, return APR_SUCCESS; } -static const apr_proc_mutex_unix_lock_methods_t mutex_flock_methods = +static const fspr_proc_mutex_unix_lock_methods_t mutex_flock_methods = { #if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS || defined(FLOCK_IS_GLOBAL) APR_PROCESS_LOCK_MECH_IS_GLOBAL, @@ -658,7 +658,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_flock_methods = #endif /* flock implementation */ -void apr_proc_mutex_unix_setup_lock(void) +void fspr_proc_mutex_unix_setup_lock(void) { /* setup only needed for sysvsem and fnctl */ #if APR_HAS_SYSVSEM_SERIALIZE @@ -669,7 +669,7 @@ void apr_proc_mutex_unix_setup_lock(void) #endif } -static apr_status_t proc_mutex_choose_method(apr_proc_mutex_t *new_mutex, apr_lockmech_e mech) +static fspr_status_t proc_mutex_choose_method(fspr_proc_mutex_t *new_mutex, fspr_lockmech_e mech) { switch (mech) { case APR_LOCK_FCNTL: @@ -728,21 +728,21 @@ static apr_status_t proc_mutex_choose_method(apr_proc_mutex_t *new_mutex, apr_lo return APR_SUCCESS; } -APR_DECLARE(const char *) apr_proc_mutex_defname(void) +APR_DECLARE(const char *) fspr_proc_mutex_defname(void) { - apr_proc_mutex_t mutex; + fspr_proc_mutex_t mutex; if (proc_mutex_choose_method(&mutex, APR_LOCK_DEFAULT) != APR_SUCCESS) { return "unknown"; } mutex.meth = mutex.inter_meth; - return apr_proc_mutex_name(&mutex); + return fspr_proc_mutex_name(&mutex); } -static apr_status_t proc_mutex_create(apr_proc_mutex_t *new_mutex, apr_lockmech_e mech, const char *fname) +static fspr_status_t proc_mutex_create(fspr_proc_mutex_t *new_mutex, fspr_lockmech_e mech, const char *fname) { - apr_status_t rv; + fspr_status_t rv; if ((rv = proc_mutex_choose_method(new_mutex, mech)) != APR_SUCCESS) { return rv; @@ -757,15 +757,15 @@ static apr_status_t proc_mutex_create(apr_proc_mutex_t *new_mutex, apr_lockmech_ return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, +APR_DECLARE(fspr_status_t) fspr_proc_mutex_create(fspr_proc_mutex_t **mutex, const char *fname, - apr_lockmech_e mech, - apr_pool_t *pool) + fspr_lockmech_e mech, + fspr_pool_t *pool) { - apr_proc_mutex_t *new_mutex; - apr_status_t rv; + fspr_proc_mutex_t *new_mutex; + fspr_status_t rv; - new_mutex = apr_pcalloc(pool, sizeof(apr_proc_mutex_t)); + new_mutex = fspr_pcalloc(pool, sizeof(fspr_proc_mutex_t)); new_mutex->pool = pool; if ((rv = proc_mutex_create(new_mutex, mech, fname)) != APR_SUCCESS) @@ -775,39 +775,39 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, +APR_DECLARE(fspr_status_t) fspr_proc_mutex_child_init(fspr_proc_mutex_t **mutex, const char *fname, - apr_pool_t *pool) + fspr_pool_t *pool) { return (*mutex)->meth->child_init(mutex, pool, fname); } -APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_proc_mutex_lock(fspr_proc_mutex_t *mutex) { return mutex->meth->acquire(mutex); } -APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_proc_mutex_trylock(fspr_proc_mutex_t *mutex) { return mutex->meth->tryacquire(mutex); } -APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_proc_mutex_unlock(fspr_proc_mutex_t *mutex) { return mutex->meth->release(mutex); } -APR_DECLARE(apr_status_t) apr_proc_mutex_cleanup(void *mutex) +APR_DECLARE(fspr_status_t) fspr_proc_mutex_cleanup(void *mutex) { - return ((apr_proc_mutex_t *)mutex)->meth->cleanup(mutex); + return ((fspr_proc_mutex_t *)mutex)->meth->cleanup(mutex); } -APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) +APR_DECLARE(const char *) fspr_proc_mutex_name(fspr_proc_mutex_t *mutex) { return mutex->meth->name; } -APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex) +APR_DECLARE(const char *) fspr_proc_mutex_lockfile(fspr_proc_mutex_t *mutex) { /* POSIX sems use the fname field but don't use a file, * so be careful. */ @@ -826,10 +826,10 @@ APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex) APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) -/* Implement OS-specific accessors defined in apr_portable.h */ +/* Implement OS-specific accessors defined in fspr_portable.h */ -APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, - apr_proc_mutex_t *pmutex) +APR_DECLARE(fspr_status_t) fspr_os_proc_mutex_get(fspr_os_proc_mutex_t *ospmutex, + fspr_proc_mutex_t *pmutex) { #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE || APR_HAS_POSIXSEM_SERIALIZE ospmutex->crossproc = pmutex->interproc->filedes; @@ -840,20 +840,20 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, - apr_os_proc_mutex_t *ospmutex, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_proc_mutex_put(fspr_proc_mutex_t **pmutex, + fspr_os_proc_mutex_t *ospmutex, + fspr_pool_t *pool) { if (pool == NULL) { return APR_ENOPOOL; } if ((*pmutex) == NULL) { - (*pmutex) = (apr_proc_mutex_t *)apr_pcalloc(pool, - sizeof(apr_proc_mutex_t)); + (*pmutex) = (fspr_proc_mutex_t *)fspr_pcalloc(pool, + sizeof(fspr_proc_mutex_t)); (*pmutex)->pool = pool; } #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE || APR_HAS_POSIXSEM_SERIALIZE - apr_os_file_put(&(*pmutex)->interproc, &ospmutex->crossproc, 0, pool); + fspr_os_file_put(&(*pmutex)->interproc, &ospmutex->crossproc, 0, pool); #endif #if APR_HAS_PROC_PTHREAD_SERIALIZE (*pmutex)->pthread_interproc = ospmutex->pthread_interproc; diff --git a/libs/apr/locks/unix/thread_cond.c b/libs/apr/locks/unix/thread_cond.c index 227c1d7f64..46f5e88e89 100644 --- a/libs/apr/locks/unix/thread_cond.c +++ b/libs/apr/locks/unix/thread_cond.c @@ -14,17 +14,17 @@ * limitations under the License. */ -#include "apr.h" +#include "fspr.h" #if APR_HAS_THREADS -#include "apr_arch_thread_mutex.h" -#include "apr_arch_thread_cond.h" +#include "fspr_arch_thread_mutex.h" +#include "fspr_arch_thread_cond.h" -static apr_status_t thread_cond_cleanup(void *data) +static fspr_status_t thread_cond_cleanup(void *data) { - apr_thread_cond_t *cond = (apr_thread_cond_t *)data; - apr_status_t rv; + fspr_thread_cond_t *cond = (fspr_thread_cond_t *)data; + fspr_status_t rv; rv = pthread_cond_destroy(&cond->cond); #ifdef PTHREAD_SETS_ERRNO @@ -35,13 +35,13 @@ static apr_status_t thread_cond_cleanup(void *data) return rv; } -APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_thread_cond_create(fspr_thread_cond_t **cond, + fspr_pool_t *pool) { - apr_thread_cond_t *new_cond; - apr_status_t rv; + fspr_thread_cond_t *new_cond; + fspr_status_t rv; - new_cond = apr_palloc(pool, sizeof(apr_thread_cond_t)); + new_cond = fspr_palloc(pool, sizeof(fspr_thread_cond_t)); new_cond->pool = pool; @@ -52,18 +52,18 @@ APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, return rv; } - apr_pool_cleanup_register(new_cond->pool, + fspr_pool_cleanup_register(new_cond->pool, (void *)new_cond, thread_cond_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_null); *cond = new_cond; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, - apr_thread_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_thread_cond_wait(fspr_thread_cond_t *cond, + fspr_thread_mutex_t *mutex) { - apr_status_t rv; + fspr_status_t rv; rv = pthread_cond_wait(&cond->cond, &mutex->mutex); #ifdef PTHREAD_SETS_ERRNO @@ -74,17 +74,17 @@ APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, return rv; } -APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, - apr_thread_mutex_t *mutex, - apr_interval_time_t timeout) +APR_DECLARE(fspr_status_t) fspr_thread_cond_timedwait(fspr_thread_cond_t *cond, + fspr_thread_mutex_t *mutex, + fspr_interval_time_t timeout) { - apr_status_t rv; - apr_time_t then; + fspr_status_t rv; + fspr_time_t then; struct timespec abstime; - then = apr_time_now() + timeout; - abstime.tv_sec = apr_time_sec(then); - abstime.tv_nsec = apr_time_usec(then) * 1000; /* nanoseconds */ + then = fspr_time_now() + timeout; + abstime.tv_sec = fspr_time_sec(then); + abstime.tv_nsec = fspr_time_usec(then) * 1000; /* nanoseconds */ rv = pthread_cond_timedwait(&cond->cond, &mutex->mutex, &abstime); #ifdef PTHREAD_SETS_ERRNO @@ -99,9 +99,9 @@ APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, } -APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) +APR_DECLARE(fspr_status_t) fspr_thread_cond_signal(fspr_thread_cond_t *cond) { - apr_status_t rv; + fspr_status_t rv; rv = pthread_cond_signal(&cond->cond); #ifdef PTHREAD_SETS_ERRNO @@ -112,9 +112,9 @@ APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) return rv; } -APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond) +APR_DECLARE(fspr_status_t) fspr_thread_cond_broadcast(fspr_thread_cond_t *cond) { - apr_status_t rv; + fspr_status_t rv; rv = pthread_cond_broadcast(&cond->cond); #ifdef PTHREAD_SETS_ERRNO @@ -125,9 +125,9 @@ APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond) return rv; } -APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond) +APR_DECLARE(fspr_status_t) fspr_thread_cond_destroy(fspr_thread_cond_t *cond) { - return apr_pool_cleanup_run(cond->pool, cond, thread_cond_cleanup); + return fspr_pool_cleanup_run(cond->pool, cond, thread_cond_cleanup); } APR_POOL_IMPLEMENT_ACCESSOR(thread_cond) diff --git a/libs/apr/locks/unix/thread_mutex.c b/libs/apr/locks/unix/thread_mutex.c index e146a28f59..30786f883f 100644 --- a/libs/apr/locks/unix/thread_mutex.c +++ b/libs/apr/locks/unix/thread_mutex.c @@ -14,16 +14,16 @@ * limitations under the License. */ -#include "apr_arch_thread_mutex.h" +#include "fspr_arch_thread_mutex.h" #define APR_WANT_MEMFUNC -#include "apr_want.h" +#include "fspr_want.h" #if APR_HAS_THREADS -static apr_status_t thread_mutex_cleanup(void *data) +static fspr_status_t thread_mutex_cleanup(void *data) { - apr_thread_mutex_t *mutex = data; - apr_status_t rv; + fspr_thread_mutex_t *mutex = data; + fspr_status_t rv; rv = pthread_mutex_destroy(&mutex->mutex); #ifdef PTHREAD_SETS_ERRNO @@ -34,12 +34,12 @@ static apr_status_t thread_mutex_cleanup(void *data) return rv; } -APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, +APR_DECLARE(fspr_status_t) fspr_thread_mutex_create(fspr_thread_mutex_t **mutex, unsigned int flags, - apr_pool_t *pool) + fspr_pool_t *pool) { - apr_thread_mutex_t *new_mutex; - apr_status_t rv; + fspr_thread_mutex_t *new_mutex; + fspr_status_t rv; #ifndef HAVE_PTHREAD_MUTEX_RECURSIVE if (flags & APR_THREAD_MUTEX_NESTED) { @@ -47,7 +47,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, } #endif - new_mutex = apr_pcalloc(pool, sizeof(apr_thread_mutex_t)); + new_mutex = fspr_pcalloc(pool, sizeof(fspr_thread_mutex_t)); new_mutex->pool = pool; #ifdef HAVE_PTHREAD_MUTEX_RECURSIVE @@ -77,17 +77,17 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, return rv; } - apr_pool_cleanup_register(new_mutex->pool, + fspr_pool_cleanup_register(new_mutex->pool, new_mutex, thread_mutex_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_null); *mutex = new_mutex; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_thread_mutex_lock(fspr_thread_mutex_t *mutex) { - apr_status_t rv; + fspr_status_t rv; rv = pthread_mutex_lock(&mutex->mutex); #ifdef PTHREAD_SETS_ERRNO @@ -99,9 +99,9 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) return rv; } -APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_thread_mutex_trylock(fspr_thread_mutex_t *mutex) { - apr_status_t rv; + fspr_status_t rv; rv = pthread_mutex_trylock(&mutex->mutex); if (rv) { @@ -114,9 +114,9 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_thread_mutex_unlock(fspr_thread_mutex_t *mutex) { - apr_status_t status; + fspr_status_t status; status = pthread_mutex_unlock(&mutex->mutex); #ifdef PTHREAD_SETS_ERRNO @@ -128,9 +128,9 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) return status; } -APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_thread_mutex_destroy(fspr_thread_mutex_t *mutex) { - return apr_pool_cleanup_run(mutex->pool, mutex, thread_mutex_cleanup); + return fspr_pool_cleanup_run(mutex->pool, mutex, thread_mutex_cleanup); } APR_POOL_IMPLEMENT_ACCESSOR(thread_mutex) diff --git a/libs/apr/locks/unix/thread_rwlock.c b/libs/apr/locks/unix/thread_rwlock.c index 4b28bb618c..533174cff9 100644 --- a/libs/apr/locks/unix/thread_rwlock.c +++ b/libs/apr/locks/unix/thread_rwlock.c @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "apr_arch_thread_rwlock.h" -#include "apr_private.h" +#include "fspr_arch_thread_rwlock.h" +#include "fspr_private.h" #if APR_HAS_THREADS @@ -23,10 +23,10 @@ /* The rwlock must be initialized but not locked by any thread when * cleanup is called. */ -static apr_status_t thread_rwlock_cleanup(void *data) +static fspr_status_t thread_rwlock_cleanup(void *data) { - apr_thread_rwlock_t *rwlock = (apr_thread_rwlock_t *)data; - apr_status_t stat; + fspr_thread_rwlock_t *rwlock = (fspr_thread_rwlock_t *)data; + fspr_status_t stat; stat = pthread_rwlock_destroy(&rwlock->rwlock); #ifdef PTHREAD_SETS_ERRNO @@ -37,13 +37,13 @@ static apr_status_t thread_rwlock_cleanup(void *data) return stat; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_create(fspr_thread_rwlock_t **rwlock, + fspr_pool_t *pool) { - apr_thread_rwlock_t *new_rwlock; - apr_status_t stat; + fspr_thread_rwlock_t *new_rwlock; + fspr_status_t stat; - new_rwlock = apr_palloc(pool, sizeof(apr_thread_rwlock_t)); + new_rwlock = fspr_palloc(pool, sizeof(fspr_thread_rwlock_t)); new_rwlock->pool = pool; if ((stat = pthread_rwlock_init(&new_rwlock->rwlock, NULL))) { @@ -53,17 +53,17 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, return stat; } - apr_pool_cleanup_register(new_rwlock->pool, + fspr_pool_cleanup_register(new_rwlock->pool, (void *)new_rwlock, thread_rwlock_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_null); *rwlock = new_rwlock; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_rdlock(fspr_thread_rwlock_t *rwlock) { - apr_status_t stat; + fspr_status_t stat; stat = pthread_rwlock_rdlock(&rwlock->rwlock); #ifdef PTHREAD_SETS_ERRNO @@ -74,9 +74,9 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock) return stat; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_tryrdlock(fspr_thread_rwlock_t *rwlock) { - apr_status_t stat; + fspr_status_t stat; stat = pthread_rwlock_tryrdlock(&rwlock->rwlock); #ifdef PTHREAD_SETS_ERRNO @@ -90,9 +90,9 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwloc return stat; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_wrlock(fspr_thread_rwlock_t *rwlock) { - apr_status_t stat; + fspr_status_t stat; stat = pthread_rwlock_wrlock(&rwlock->rwlock); #ifdef PTHREAD_SETS_ERRNO @@ -103,9 +103,9 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock) return stat; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_trywrlock(fspr_thread_rwlock_t *rwlock) { - apr_status_t stat; + fspr_status_t stat; stat = pthread_rwlock_trywrlock(&rwlock->rwlock); #ifdef PTHREAD_SETS_ERRNO @@ -119,9 +119,9 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwloc return stat; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_unlock(fspr_thread_rwlock_t *rwlock) { - apr_status_t stat; + fspr_status_t stat; stat = pthread_rwlock_unlock(&rwlock->rwlock); #ifdef PTHREAD_SETS_ERRNO @@ -132,45 +132,45 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock) return stat; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_destroy(fspr_thread_rwlock_t *rwlock) { - return apr_pool_cleanup_run(rwlock->pool, rwlock, thread_rwlock_cleanup); + return fspr_pool_cleanup_run(rwlock->pool, rwlock, thread_rwlock_cleanup); } #else /* HAVE_PTHREAD_RWLOCKS */ -APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_create(fspr_thread_rwlock_t **rwlock, + fspr_pool_t *pool) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_rdlock(fspr_thread_rwlock_t *rwlock) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_tryrdlock(fspr_thread_rwlock_t *rwlock) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_wrlock(fspr_thread_rwlock_t *rwlock) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_trywrlock(fspr_thread_rwlock_t *rwlock) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_unlock(fspr_thread_rwlock_t *rwlock) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_destroy(fspr_thread_rwlock_t *rwlock) { return APR_ENOTIMPL; } diff --git a/libs/apr/locks/win32/proc_mutex.c b/libs/apr/locks/win32/proc_mutex.c index 9620a60d00..94e497e92a 100644 --- a/libs/apr/locks/win32/proc_mutex.c +++ b/libs/apr/locks/win32/proc_mutex.c @@ -14,31 +14,31 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_strings.h" -#include "apr_portable.h" -#include "apr_arch_file_io.h" -#include "apr_arch_proc_mutex.h" -#include "apr_arch_misc.h" +#include "fspr.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_strings.h" +#include "fspr_portable.h" +#include "fspr_arch_file_io.h" +#include "fspr_arch_proc_mutex.h" +#include "fspr_arch_misc.h" -static apr_status_t proc_mutex_cleanup(void *mutex_) +static fspr_status_t proc_mutex_cleanup(void *mutex_) { - apr_proc_mutex_t *mutex = mutex_; + fspr_proc_mutex_t *mutex = mutex_; if (mutex->handle) { if (CloseHandle(mutex->handle) == 0) { - return apr_get_os_error(); + return fspr_get_os_error(); } } return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, +APR_DECLARE(fspr_status_t) fspr_proc_mutex_create(fspr_proc_mutex_t **mutex, const char *fname, - apr_lockmech_e mech, - apr_pool_t *pool) + fspr_lockmech_e mech, + fspr_pool_t *pool) { HANDLE hMutex; void *mutexkey; @@ -68,21 +68,21 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, #endif if (!hMutex) { - return apr_get_os_error(); + return fspr_get_os_error(); } - *mutex = (apr_proc_mutex_t *)apr_palloc(pool, sizeof(apr_proc_mutex_t)); + *mutex = (fspr_proc_mutex_t *)fspr_palloc(pool, sizeof(fspr_proc_mutex_t)); (*mutex)->pool = pool; (*mutex)->handle = hMutex; (*mutex)->fname = fname; - apr_pool_cleanup_register((*mutex)->pool, *mutex, - proc_mutex_cleanup, apr_pool_cleanup_null); + fspr_pool_cleanup_register((*mutex)->pool, *mutex, + proc_mutex_cleanup, fspr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, +APR_DECLARE(fspr_status_t) fspr_proc_mutex_child_init(fspr_proc_mutex_t **mutex, const char *fname, - apr_pool_t *pool) + fspr_pool_t *pool) { HANDLE hMutex; void *mutexkey; @@ -112,19 +112,19 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, #endif if (!hMutex) { - return apr_get_os_error(); + return fspr_get_os_error(); } - *mutex = (apr_proc_mutex_t *)apr_palloc(pool, sizeof(apr_proc_mutex_t)); + *mutex = (fspr_proc_mutex_t *)fspr_palloc(pool, sizeof(fspr_proc_mutex_t)); (*mutex)->pool = pool; (*mutex)->handle = hMutex; (*mutex)->fname = fname; - apr_pool_cleanup_register((*mutex)->pool, *mutex, - proc_mutex_cleanup, apr_pool_cleanup_null); + fspr_pool_cleanup_register((*mutex)->pool, *mutex, + proc_mutex_cleanup, fspr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_proc_mutex_lock(fspr_proc_mutex_t *mutex) { DWORD rv; @@ -136,10 +136,10 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex) else if (rv == WAIT_TIMEOUT) { return APR_EBUSY; } - return apr_get_os_error(); + return fspr_get_os_error(); } -APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_proc_mutex_trylock(fspr_proc_mutex_t *mutex) { DWORD rv; @@ -151,69 +151,69 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex) else if (rv == WAIT_TIMEOUT) { return APR_EBUSY; } - return apr_get_os_error(); + return fspr_get_os_error(); } -APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_proc_mutex_unlock(fspr_proc_mutex_t *mutex) { if (ReleaseMutex(mutex->handle) == 0) { - return apr_get_os_error(); + return fspr_get_os_error(); } return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_proc_mutex_destroy(fspr_proc_mutex_t *mutex) { - apr_status_t stat; + fspr_status_t stat; stat = proc_mutex_cleanup(mutex); if (stat == APR_SUCCESS) { - apr_pool_cleanup_kill(mutex->pool, mutex, proc_mutex_cleanup); + fspr_pool_cleanup_kill(mutex->pool, mutex, proc_mutex_cleanup); } return stat; } -APR_DECLARE(apr_status_t) apr_proc_mutex_cleanup(void *mutex) +APR_DECLARE(fspr_status_t) fspr_proc_mutex_cleanup(void *mutex) { - return apr_proc_mutex_destroy((apr_proc_mutex_t *)mutex); + return fspr_proc_mutex_destroy((fspr_proc_mutex_t *)mutex); } -APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex) +APR_DECLARE(const char *) fspr_proc_mutex_lockfile(fspr_proc_mutex_t *mutex) { return NULL; } -APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex) +APR_DECLARE(const char *) fspr_proc_mutex_name(fspr_proc_mutex_t *mutex) { return mutex->fname; } -APR_DECLARE(const char *) apr_proc_mutex_defname(void) +APR_DECLARE(const char *) fspr_proc_mutex_defname(void) { return "win32mutex"; } APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex) -/* Implement OS-specific accessors defined in apr_portable.h */ +/* Implement OS-specific accessors defined in fspr_portable.h */ -APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, - apr_proc_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_os_proc_mutex_get(fspr_os_proc_mutex_t *ospmutex, + fspr_proc_mutex_t *mutex) { *ospmutex = mutex->handle; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, - apr_os_proc_mutex_t *ospmutex, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_proc_mutex_put(fspr_proc_mutex_t **pmutex, + fspr_os_proc_mutex_t *ospmutex, + fspr_pool_t *pool) { if (pool == NULL) { return APR_ENOPOOL; } if ((*pmutex) == NULL) { - (*pmutex) = (apr_proc_mutex_t *)apr_palloc(pool, - sizeof(apr_proc_mutex_t)); + (*pmutex) = (fspr_proc_mutex_t *)fspr_palloc(pool, + sizeof(fspr_proc_mutex_t)); (*pmutex)->pool = pool; } (*pmutex)->handle = *ospmutex; diff --git a/libs/apr/locks/win32/thread_cond.c b/libs/apr/locks/win32/thread_cond.c index 60286e542d..dbcca776fa 100644 --- a/libs/apr/locks/win32/thread_cond.c +++ b/libs/apr/locks/win32/thread_cond.c @@ -14,59 +14,59 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_strings.h" -#include "apr_arch_thread_mutex.h" -#include "apr_arch_thread_cond.h" -#include "apr_portable.h" +#include "fspr.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_strings.h" +#include "fspr_arch_thread_mutex.h" +#include "fspr_arch_thread_cond.h" +#include "fspr_portable.h" #include -static apr_status_t thread_cond_cleanup(void *data) +static fspr_status_t thread_cond_cleanup(void *data) { - apr_thread_cond_t *cond = data; + fspr_thread_cond_t *cond = data; CloseHandle(cond->semaphore); DeleteCriticalSection(&cond->csection); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_thread_cond_create(fspr_thread_cond_t **cond, + fspr_pool_t *pool) { - apr_thread_cond_t *cv; + fspr_thread_cond_t *cv; - cv = apr_pcalloc(pool, sizeof(**cond)); + cv = fspr_pcalloc(pool, sizeof(**cond)); if (cv == NULL) { return APR_ENOMEM; } cv->semaphore = CreateSemaphore(NULL, 0, LONG_MAX, NULL); if (cv->semaphore == NULL) { - return apr_get_os_error(); + return fspr_get_os_error(); } *cond = cv; cv->pool = pool; InitializeCriticalSection(&cv->csection); - apr_pool_cleanup_register(cv->pool, cv, thread_cond_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register(cv->pool, cv, thread_cond_cleanup, + fspr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond) +APR_DECLARE(fspr_status_t) fspr_thread_cond_destroy(fspr_thread_cond_t *cond) { - return apr_pool_cleanup_run(cond->pool, cond, thread_cond_cleanup); + return fspr_pool_cleanup_run(cond->pool, cond, thread_cond_cleanup); } -static APR_INLINE apr_status_t _thread_cond_timedwait(apr_thread_cond_t *cond, - apr_thread_mutex_t *mutex, +static APR_INLINE fspr_status_t _thread_cond_timedwait(fspr_thread_cond_t *cond, + fspr_thread_mutex_t *mutex, DWORD timeout_ms ) { DWORD res; - apr_status_t rv; + fspr_status_t rv; unsigned int wake = 0; unsigned long generation; @@ -75,7 +75,7 @@ static APR_INLINE apr_status_t _thread_cond_timedwait(apr_thread_cond_t *cond, generation = cond->generation; LeaveCriticalSection(&cond->csection); - apr_thread_mutex_unlock(mutex); + fspr_thread_mutex_unlock(mutex); do { res = WaitForSingleObject(cond->semaphore, timeout_ms); @@ -107,27 +107,27 @@ static APR_INLINE apr_status_t _thread_cond_timedwait(apr_thread_cond_t *cond, } while (1); LeaveCriticalSection(&cond->csection); - apr_thread_mutex_lock(mutex); + fspr_thread_mutex_lock(mutex); return rv; } -APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, - apr_thread_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_thread_cond_wait(fspr_thread_cond_t *cond, + fspr_thread_mutex_t *mutex) { return _thread_cond_timedwait(cond, mutex, INFINITE); } -APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, - apr_thread_mutex_t *mutex, - apr_interval_time_t timeout) +APR_DECLARE(fspr_status_t) fspr_thread_cond_timedwait(fspr_thread_cond_t *cond, + fspr_thread_mutex_t *mutex, + fspr_interval_time_t timeout) { - DWORD timeout_ms = (DWORD) apr_time_as_msec(timeout); + DWORD timeout_ms = (DWORD) fspr_time_as_msec(timeout); return _thread_cond_timedwait(cond, mutex, timeout_ms); } -APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) +APR_DECLARE(fspr_status_t) fspr_thread_cond_signal(fspr_thread_cond_t *cond) { unsigned int wake = 0; @@ -146,7 +146,7 @@ APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond) +APR_DECLARE(fspr_status_t) fspr_thread_cond_broadcast(fspr_thread_cond_t *cond) { unsigned long num_wake = 0; diff --git a/libs/apr/locks/win32/thread_mutex.c b/libs/apr/locks/win32/thread_mutex.c index 9b10d7278d..6f86edb782 100644 --- a/libs/apr/locks/win32/thread_mutex.c +++ b/libs/apr/locks/win32/thread_mutex.c @@ -14,18 +14,18 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_strings.h" -#include "apr_arch_thread_mutex.h" -#include "apr_thread_mutex.h" -#include "apr_portable.h" -#include "apr_arch_misc.h" +#include "fspr.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_strings.h" +#include "fspr_arch_thread_mutex.h" +#include "fspr_thread_mutex.h" +#include "fspr_portable.h" +#include "fspr_arch_misc.h" -static apr_status_t thread_mutex_cleanup(void *data) +static fspr_status_t thread_mutex_cleanup(void *data) { - apr_thread_mutex_t *lock = data; + fspr_thread_mutex_t *lock = data; if (lock->type == thread_mutex_critical_section) { lock->type = -1; @@ -33,17 +33,17 @@ static apr_status_t thread_mutex_cleanup(void *data) } else { if (!CloseHandle(lock->handle)) { - return apr_get_os_error(); + return fspr_get_os_error(); } } return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, +APR_DECLARE(fspr_status_t) fspr_thread_mutex_create(fspr_thread_mutex_t **mutex, unsigned int flags, - apr_pool_t *pool) + fspr_pool_t *pool) { - (*mutex) = (apr_thread_mutex_t *)apr_palloc(pool, sizeof(**mutex)); + (*mutex) = (fspr_thread_mutex_t *)fspr_palloc(pool, sizeof(**mutex)); (*mutex)->pool = pool; @@ -74,12 +74,12 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, #endif } - apr_pool_cleanup_register((*mutex)->pool, (*mutex), thread_mutex_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register((*mutex)->pool, (*mutex), thread_mutex_cleanup, + fspr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_thread_mutex_lock(fspr_thread_mutex_t *mutex) { if (mutex->type == thread_mutex_critical_section) { EnterCriticalSection(&mutex->section); @@ -87,13 +87,13 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) else { DWORD rv = WaitForSingleObject(mutex->handle, INFINITE); if ((rv != WAIT_OBJECT_0) && (rv != WAIT_ABANDONED)) { - return (rv == WAIT_TIMEOUT) ? APR_EBUSY : apr_get_os_error(); + return (rv == WAIT_TIMEOUT) ? APR_EBUSY : fspr_get_os_error(); } } return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_thread_mutex_trylock(fspr_thread_mutex_t *mutex) { if (mutex->type == thread_mutex_critical_section) { if (!TryEnterCriticalSection(&mutex->section)) { @@ -103,33 +103,33 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) else { DWORD rv = WaitForSingleObject(mutex->handle, 0); if ((rv != WAIT_OBJECT_0) && (rv != WAIT_ABANDONED)) { - return (rv == WAIT_TIMEOUT) ? APR_EBUSY : apr_get_os_error(); + return (rv == WAIT_TIMEOUT) ? APR_EBUSY : fspr_get_os_error(); } } return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_thread_mutex_unlock(fspr_thread_mutex_t *mutex) { if (mutex->type == thread_mutex_critical_section) { LeaveCriticalSection(&mutex->section); } else if (mutex->type == thread_mutex_unnested_event) { if (!SetEvent(mutex->handle)) { - return apr_get_os_error(); + return fspr_get_os_error(); } } else if (mutex->type == thread_mutex_nested_mutex) { if (!ReleaseMutex(mutex->handle)) { - return apr_get_os_error(); + return fspr_get_os_error(); } } return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex) +APR_DECLARE(fspr_status_t) fspr_thread_mutex_destroy(fspr_thread_mutex_t *mutex) { - return apr_pool_cleanup_run(mutex->pool, mutex, thread_mutex_cleanup); + return fspr_pool_cleanup_run(mutex->pool, mutex, thread_mutex_cleanup); } APR_POOL_IMPLEMENT_ACCESSOR(thread_mutex) diff --git a/libs/apr/locks/win32/thread_rwlock.c b/libs/apr/locks/win32/thread_rwlock.c index 4995ca2dee..c8242adb85 100644 --- a/libs/apr/locks/win32/thread_rwlock.c +++ b/libs/apr/locks/win32/thread_rwlock.c @@ -14,56 +14,56 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_strings.h" -#include "win32/apr_arch_thread_rwlock.h" -#include "apr_portable.h" +#include "fspr.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_strings.h" +#include "win32/fspr_arch_thread_rwlock.h" +#include "fspr_portable.h" -static apr_status_t thread_rwlock_cleanup(void *data) +static fspr_status_t thread_rwlock_cleanup(void *data) { - apr_thread_rwlock_t *rwlock = data; + fspr_thread_rwlock_t *rwlock = data; if (! CloseHandle(rwlock->read_event)) - return apr_get_os_error(); + return fspr_get_os_error(); DeleteCriticalSection(&rwlock->read_section); if (! CloseHandle(rwlock->write_mutex)) - return apr_get_os_error(); + return fspr_get_os_error(); return APR_SUCCESS; } -APR_DECLARE(apr_status_t)apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t)fspr_thread_rwlock_create(fspr_thread_rwlock_t **rwlock, + fspr_pool_t *pool) { - *rwlock = apr_palloc(pool, sizeof(**rwlock)); + *rwlock = fspr_palloc(pool, sizeof(**rwlock)); (*rwlock)->pool = pool; (*rwlock)->readers = 0; if (! ((*rwlock)->read_event = CreateEvent(NULL, TRUE, FALSE, NULL))) { *rwlock = NULL; - return apr_get_os_error(); + return fspr_get_os_error(); } if (! ((*rwlock)->write_mutex = CreateMutex(NULL, FALSE, NULL))) { CloseHandle((*rwlock)->read_event); *rwlock = NULL; - return apr_get_os_error(); + return fspr_get_os_error(); } InitializeCriticalSection(&(*rwlock)->read_section); - apr_pool_cleanup_register(pool, *rwlock, thread_rwlock_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register(pool, *rwlock, thread_rwlock_cleanup, + fspr_pool_cleanup_null); return APR_SUCCESS; } -static apr_status_t apr_thread_rwlock_rdlock_core(apr_thread_rwlock_t *rwlock, +static fspr_status_t fspr_thread_rwlock_rdlock_core(fspr_thread_rwlock_t *rwlock, DWORD milliseconds) { DWORD code; @@ -83,31 +83,31 @@ static apr_status_t apr_thread_rwlock_rdlock_core(apr_thread_rwlock_t *rwlock, if (! ResetEvent(rwlock->read_event)) { LeaveCriticalSection(&rwlock->read_section); - return apr_get_os_error(); + return fspr_get_os_error(); } if (! ReleaseMutex(rwlock->write_mutex)) { LeaveCriticalSection(&rwlock->read_section); - return apr_get_os_error(); + return fspr_get_os_error(); } LeaveCriticalSection(&rwlock->read_section); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_rdlock(fspr_thread_rwlock_t *rwlock) { - return apr_thread_rwlock_rdlock_core(rwlock, INFINITE); + return fspr_thread_rwlock_rdlock_core(rwlock, INFINITE); } -APR_DECLARE(apr_status_t) -apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) +fspr_thread_rwlock_tryrdlock(fspr_thread_rwlock_t *rwlock) { - return apr_thread_rwlock_rdlock_core(rwlock, 0); + return fspr_thread_rwlock_rdlock_core(rwlock, 0); } -static apr_status_t -apr_thread_rwlock_wrlock_core(apr_thread_rwlock_t *rwlock, DWORD milliseconds) +static fspr_status_t +fspr_thread_rwlock_wrlock_core(fspr_thread_rwlock_t *rwlock, DWORD milliseconds) { DWORD code = WaitForSingleObject(rwlock->write_mutex, milliseconds); @@ -128,7 +128,7 @@ apr_thread_rwlock_wrlock_core(apr_thread_rwlock_t *rwlock, DWORD milliseconds) if (code == WAIT_FAILED || code == WAIT_TIMEOUT) { /* Unable to wait for readers to finish, release write lock: */ if (! ReleaseMutex(rwlock->write_mutex)) - return apr_get_os_error(); + return fspr_get_os_error(); return APR_FROM_OS_ERROR(code); } @@ -137,30 +137,30 @@ apr_thread_rwlock_wrlock_core(apr_thread_rwlock_t *rwlock, DWORD milliseconds) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_wrlock(fspr_thread_rwlock_t *rwlock) { - return apr_thread_rwlock_wrlock_core(rwlock, INFINITE); + return fspr_thread_rwlock_wrlock_core(rwlock, INFINITE); } -APR_DECLARE(apr_status_t)apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t)fspr_thread_rwlock_trywrlock(fspr_thread_rwlock_t *rwlock) { - return apr_thread_rwlock_wrlock_core(rwlock, 0); + return fspr_thread_rwlock_wrlock_core(rwlock, 0); } -APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_unlock(fspr_thread_rwlock_t *rwlock) { - apr_status_t rv = 0; + fspr_status_t rv = 0; /* First, guess that we're unlocking a writer */ if (! ReleaseMutex(rwlock->write_mutex)) - rv = apr_get_os_error(); + rv = fspr_get_os_error(); if (rv == APR_FROM_OS_ERROR(ERROR_NOT_OWNER)) { /* Nope, we must have a read lock */ if (rwlock->readers && ! InterlockedDecrement(&rwlock->readers) && ! SetEvent(rwlock->read_event)) { - rv = apr_get_os_error(); + rv = fspr_get_os_error(); } else { rv = 0; @@ -170,9 +170,9 @@ APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock) return rv; } -APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock) +APR_DECLARE(fspr_status_t) fspr_thread_rwlock_destroy(fspr_thread_rwlock_t *rwlock) { - return apr_pool_cleanup_run(rwlock->pool, rwlock, thread_rwlock_cleanup); + return fspr_pool_cleanup_run(rwlock->pool, rwlock, thread_rwlock_cleanup); } APR_POOL_IMPLEMENT_ACCESSOR(thread_rwlock) diff --git a/libs/apr/memory/unix/apr_pools.c b/libs/apr/memory/unix/fspr_pools.c similarity index 67% rename from libs/apr/memory/unix/apr_pools.c rename to libs/apr/memory/unix/fspr_pools.c index acd8512ca1..9f67b7ec53 100644 --- a/libs/apr/memory/unix/apr_pools.c +++ b/libs/apr/memory/unix/fspr_pools.c @@ -14,22 +14,22 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_private.h" +#include "fspr.h" +#include "fspr_private.h" -#include "apr_atomic.h" -#include "apr_portable.h" /* for get_os_proc */ -#include "apr_strings.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_allocator.h" -#include "apr_lib.h" -#include "apr_thread_mutex.h" -#include "apr_hash.h" -#include "apr_time.h" +#include "fspr_atomic.h" +#include "fspr_portable.h" /* for get_os_proc */ +#include "fspr_strings.h" +#include "fspr_general.h" +#include "fspr_pools.h" +#include "fspr_allocator.h" +#include "fspr_lib.h" +#include "fspr_thread_mutex.h" +#include "fspr_hash.h" +#include "fspr_time.h" #define APR_WANT_MEMFUNC -#include "apr_want.h" -#include "apr_env.h" +#include "fspr_want.h" +#include "fspr_env.h" #if APR_HAVE_STDLIB_H #include /* for malloc, free and abort */ @@ -64,27 +64,27 @@ * Allocator */ -struct apr_allocator_t { - apr_uint32_t max_index; - apr_uint32_t max_free_index; - apr_uint32_t current_free_index; +struct fspr_allocator_t { + fspr_uint32_t max_index; + fspr_uint32_t max_free_index; + fspr_uint32_t current_free_index; #if APR_HAS_THREADS - apr_thread_mutex_t *mutex; + fspr_thread_mutex_t *mutex; #endif /* APR_HAS_THREADS */ - apr_pool_t *owner; - apr_memnode_t *free[MAX_INDEX]; + fspr_pool_t *owner; + fspr_memnode_t *free[MAX_INDEX]; }; -#define SIZEOF_ALLOCATOR_T APR_ALIGN_DEFAULT(sizeof(apr_allocator_t)) +#define SIZEOF_ALLOCATOR_T APR_ALIGN_DEFAULT(sizeof(fspr_allocator_t)) /* * Allocator */ -APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator) +APR_DECLARE(fspr_status_t) fspr_allocator_create(fspr_allocator_t **allocator) { - apr_allocator_t *new_allocator; + fspr_allocator_t *new_allocator; *allocator = NULL; @@ -99,10 +99,10 @@ APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator) return APR_SUCCESS; } -APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator) +APR_DECLARE(void) fspr_allocator_destroy(fspr_allocator_t *allocator) { - apr_uint32_t index; - apr_memnode_t *node, **ref; + fspr_uint32_t index; + fspr_memnode_t *node, **ref; for (index = 0; index < MAX_INDEX; index++) { ref = &allocator->free[index]; @@ -116,42 +116,42 @@ APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator) } #if APR_HAS_THREADS -APR_DECLARE(void) apr_allocator_mutex_set(apr_allocator_t *allocator, - apr_thread_mutex_t *mutex) +APR_DECLARE(void) fspr_allocator_mutex_set(fspr_allocator_t *allocator, + fspr_thread_mutex_t *mutex) { allocator->mutex = mutex; } -APR_DECLARE(apr_thread_mutex_t *) apr_allocator_mutex_get( - apr_allocator_t *allocator) +APR_DECLARE(fspr_thread_mutex_t *) fspr_allocator_mutex_get( + fspr_allocator_t *allocator) { return allocator->mutex; } #endif /* APR_HAS_THREADS */ -APR_DECLARE(void) apr_allocator_owner_set(apr_allocator_t *allocator, - apr_pool_t *pool) +APR_DECLARE(void) fspr_allocator_owner_set(fspr_allocator_t *allocator, + fspr_pool_t *pool) { allocator->owner = pool; } -APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator) +APR_DECLARE(fspr_pool_t *) fspr_allocator_owner_get(fspr_allocator_t *allocator) { return allocator->owner; } -APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator, - apr_size_t in_size) +APR_DECLARE(void) fspr_allocator_max_free_set(fspr_allocator_t *allocator, + fspr_size_t in_size) { - apr_uint32_t max_free_index; - apr_uint32_t size = (APR_UINT32_TRUNC_CAST)in_size; + fspr_uint32_t max_free_index; + fspr_uint32_t size = (APR_UINT32_TRUNC_CAST)in_size; #if APR_HAS_THREADS - apr_thread_mutex_t *mutex; + fspr_thread_mutex_t *mutex; - mutex = apr_allocator_mutex_get(allocator); + mutex = fspr_allocator_mutex_get(allocator); if (mutex != NULL) - apr_thread_mutex_lock(mutex); + fspr_thread_mutex_lock(mutex); #endif /* APR_HAS_THREADS */ max_free_index = APR_ALIGN(size, BOUNDARY_SIZE) >> BOUNDARY_INDEX; @@ -163,16 +163,16 @@ APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator, #if APR_HAS_THREADS if (mutex != NULL) - apr_thread_mutex_unlock(mutex); + fspr_thread_mutex_unlock(mutex); #endif } static APR_INLINE -apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t size) +fspr_memnode_t *allocator_alloc(fspr_allocator_t *allocator, fspr_size_t size) { - apr_memnode_t *node, **ref; - apr_uint32_t max_index; - apr_size_t i, index; + fspr_memnode_t *node, **ref; + fspr_uint32_t max_index; + fspr_size_t i, index; /* Round up the block size to the next boundary, but always * allocate at least a certain size (MIN_ALLOC). @@ -196,7 +196,7 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t size) if (index <= allocator->max_index) { #if APR_HAS_THREADS if (allocator->mutex) - apr_thread_mutex_lock(allocator->mutex); + fspr_thread_mutex_lock(allocator->mutex); #endif /* APR_HAS_THREADS */ /* Walk the free list to see if there are @@ -239,7 +239,7 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t size) #if APR_HAS_THREADS if (allocator->mutex) - apr_thread_mutex_unlock(allocator->mutex); + fspr_thread_mutex_unlock(allocator->mutex); #endif /* APR_HAS_THREADS */ node->next = NULL; @@ -250,7 +250,7 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t size) #if APR_HAS_THREADS if (allocator->mutex) - apr_thread_mutex_unlock(allocator->mutex); + fspr_thread_mutex_unlock(allocator->mutex); #endif /* APR_HAS_THREADS */ } @@ -260,7 +260,7 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t size) else if (allocator->free[0]) { #if APR_HAS_THREADS if (allocator->mutex) - apr_thread_mutex_lock(allocator->mutex); + fspr_thread_mutex_lock(allocator->mutex); #endif /* APR_HAS_THREADS */ /* Walk the free list to see if there are @@ -279,7 +279,7 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t size) #if APR_HAS_THREADS if (allocator->mutex) - apr_thread_mutex_unlock(allocator->mutex); + fspr_thread_mutex_unlock(allocator->mutex); #endif /* APR_HAS_THREADS */ node->next = NULL; @@ -290,7 +290,7 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t size) #if APR_HAS_THREADS if (allocator->mutex) - apr_thread_mutex_unlock(allocator->mutex); + fspr_thread_mutex_unlock(allocator->mutex); #endif /* APR_HAS_THREADS */ } @@ -309,15 +309,15 @@ apr_memnode_t *allocator_alloc(apr_allocator_t *allocator, apr_size_t size) } static APR_INLINE -void allocator_free(apr_allocator_t *allocator, apr_memnode_t *node) +void allocator_free(fspr_allocator_t *allocator, fspr_memnode_t *node) { - apr_memnode_t *next, *freelist = NULL; - apr_uint32_t index, max_index; - apr_uint32_t max_free_index, current_free_index; + fspr_memnode_t *next, *freelist = NULL; + fspr_uint32_t index, max_index; + fspr_uint32_t max_free_index, current_free_index; #if APR_HAS_THREADS if (allocator->mutex) - apr_thread_mutex_lock(allocator->mutex); + fspr_thread_mutex_lock(allocator->mutex); #endif /* APR_HAS_THREADS */ max_index = allocator->max_index; @@ -362,7 +362,7 @@ void allocator_free(apr_allocator_t *allocator, apr_memnode_t *node) #if APR_HAS_THREADS if (allocator->mutex) - apr_thread_mutex_unlock(allocator->mutex); + fspr_thread_mutex_unlock(allocator->mutex); #endif /* APR_HAS_THREADS */ while (freelist != NULL) { @@ -372,14 +372,14 @@ void allocator_free(apr_allocator_t *allocator, apr_memnode_t *node) } } -APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator, - apr_size_t size) +APR_DECLARE(fspr_memnode_t *) fspr_allocator_alloc(fspr_allocator_t *allocator, + fspr_size_t size) { return allocator_alloc(allocator, size); } -APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, - apr_memnode_t *node) +APR_DECLARE(void) fspr_allocator_free(fspr_allocator_t *allocator, + fspr_memnode_t *node) { allocator_free(allocator, node); } @@ -409,8 +409,8 @@ typedef struct cleanup_t cleanup_t; /** A list of processes */ struct process_chain { /** The process ID */ - apr_proc_t *proc; - apr_kill_conditions_e kill_how; + fspr_proc_t *proc; + fspr_kill_conditions_e kill_how; /** The next process in the list */ struct process_chain *next; }; @@ -422,7 +422,7 @@ typedef struct debug_node_t debug_node_t; struct debug_node_t { debug_node_t *next; - apr_uint32_t index; + fspr_uint32_t index; void *beginp[64]; void *endp[64]; }; @@ -431,68 +431,68 @@ struct debug_node_t { #endif /* APR_POOL_DEBUG */ -/* The ref field in the apr_pool_t struct holds a +/* The ref field in the fspr_pool_t struct holds a * pointer to the pointer referencing this pool. * It is used for parent, child, sibling management. - * Look at apr_pool_create_ex() and apr_pool_destroy() + * Look at fspr_pool_create_ex() and fspr_pool_destroy() * to see how it is used. */ -struct apr_pool_t { - apr_pool_t *parent; - apr_pool_t *child; - apr_pool_t *sibling; - apr_pool_t **ref; +struct fspr_pool_t { + fspr_pool_t *parent; + fspr_pool_t *child; + fspr_pool_t *sibling; + fspr_pool_t **ref; cleanup_t *cleanups; cleanup_t *free_cleanups; - apr_allocator_t *allocator; + fspr_allocator_t *allocator; struct process_chain *subprocesses; - apr_abortfunc_t abort_fn; - apr_hash_t *user_data; + fspr_abortfunc_t abort_fn; + fspr_hash_t *user_data; const char *tag; #if APR_HAS_THREADS - apr_thread_mutex_t *user_mutex; + fspr_thread_mutex_t *user_mutex; #endif #if !APR_POOL_DEBUG - apr_memnode_t *active; - apr_memnode_t *self; /* The node containing the pool itself */ + fspr_memnode_t *active; + fspr_memnode_t *self; /* The node containing the pool itself */ char *self_first_avail; #else /* APR_POOL_DEBUG */ - apr_pool_t *joined; /* the caller has guaranteed that this pool + fspr_pool_t *joined; /* the caller has guaranteed that this pool * will survive as long as ->joined */ debug_node_t *nodes; const char *file_line; - apr_uint32_t creation_flags; + fspr_uint32_t creation_flags; unsigned int stat_alloc; unsigned int stat_total_alloc; unsigned int stat_clear; #if APR_HAS_THREADS - apr_os_thread_t owner; - apr_thread_mutex_t *mutex; + fspr_os_thread_t owner; + fspr_thread_mutex_t *mutex; #endif /* APR_HAS_THREADS */ #endif /* APR_POOL_DEBUG */ #ifdef NETWARE - apr_os_proc_t owner_proc; + fspr_os_proc_t owner_proc; #endif /* defined(NETWARE) */ }; -#define SIZEOF_POOL_T APR_ALIGN_DEFAULT(sizeof(apr_pool_t)) +#define SIZEOF_POOL_T APR_ALIGN_DEFAULT(sizeof(fspr_pool_t)) /* * Variables */ -static apr_byte_t apr_pools_initialized = 0; -static apr_pool_t *global_pool = NULL; +static fspr_byte_t fspr_pools_initialized = 0; +static fspr_pool_t *global_pool = NULL; #if !APR_POOL_DEBUG -static apr_allocator_t *global_allocator = NULL; +static fspr_allocator_t *global_allocator = NULL; #endif /* !APR_POOL_DEBUG */ #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) -static apr_file_t *file_stderr = NULL; +static fspr_file_t *file_stderr = NULL; #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */ /* @@ -504,13 +504,13 @@ static void run_child_cleanups(cleanup_t **c); static void free_proc_chain(struct process_chain *procs); #if APR_POOL_DEBUG -static void pool_destroy_debug(apr_pool_t *pool, const char *file_line); +static void pool_destroy_debug(fspr_pool_t *pool, const char *file_line); #endif #if APR_HAS_THREADS -APR_DECLARE(void) apr_pool_mutex_set(apr_pool_t *pool, - apr_thread_mutex_t *mutex) +APR_DECLARE(void) fspr_pool_mutex_set(fspr_pool_t *pool, + fspr_thread_mutex_t *mutex) { pool->user_mutex = mutex; } @@ -522,63 +522,63 @@ APR_DECLARE(void) apr_pool_mutex_set(apr_pool_t *pool, * Initialization */ -APR_DECLARE(apr_status_t) apr_pool_initialize(void) +APR_DECLARE(fspr_status_t) fspr_pool_initialize(void) { - apr_status_t rv; + fspr_status_t rv; - if (apr_pools_initialized++) + if (fspr_pools_initialized++) return APR_SUCCESS; - if ((rv = apr_allocator_create(&global_allocator)) != APR_SUCCESS) { - apr_pools_initialized = 0; + if ((rv = fspr_allocator_create(&global_allocator)) != APR_SUCCESS) { + fspr_pools_initialized = 0; return rv; } - if ((rv = apr_pool_create_ex(&global_pool, NULL, NULL, + if ((rv = fspr_pool_create_ex(&global_pool, NULL, NULL, global_allocator)) != APR_SUCCESS) { - apr_allocator_destroy(global_allocator); + fspr_allocator_destroy(global_allocator); global_allocator = NULL; - apr_pools_initialized = 0; + fspr_pools_initialized = 0; return rv; } - apr_pool_tag(global_pool, "apr_global_pool"); + fspr_pool_tag(global_pool, "fspr_global_pool"); /* This has to happen here because mutexes might be backed by - * atomics. It used to be snug and safe in apr_initialize(). + * atomics. It used to be snug and safe in fspr_initialize(). */ - if ((rv = apr_atomic_init(global_pool)) != APR_SUCCESS) { + if ((rv = fspr_atomic_init(global_pool)) != APR_SUCCESS) { return rv; } #if APR_HAS_THREADS { - apr_thread_mutex_t *mutex; + fspr_thread_mutex_t *mutex; - if ((rv = apr_thread_mutex_create(&mutex, + if ((rv = fspr_thread_mutex_create(&mutex, APR_THREAD_MUTEX_DEFAULT, global_pool)) != APR_SUCCESS) { return rv; } - apr_allocator_mutex_set(global_allocator, mutex); + fspr_allocator_mutex_set(global_allocator, mutex); } #endif /* APR_HAS_THREADS */ - apr_allocator_owner_set(global_allocator, global_pool); + fspr_allocator_owner_set(global_allocator, global_pool); return APR_SUCCESS; } -APR_DECLARE(void) apr_pool_terminate(void) +APR_DECLARE(void) fspr_pool_terminate(void) { - if (!apr_pools_initialized) + if (!fspr_pools_initialized) return; - if (--apr_pools_initialized) + if (--fspr_pools_initialized) return; - apr_pool_destroy(global_pool); /* This will also destroy the mutex */ + fspr_pool_destroy(global_pool); /* This will also destroy the mutex */ global_pool = NULL; global_allocator = NULL; @@ -604,19 +604,19 @@ APR_DECLARE(void) apr_pool_terminate(void) * Memory allocation */ -APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) +APR_DECLARE(void *) fspr_palloc(fspr_pool_t *pool, fspr_size_t size) { - apr_memnode_t *active, *node; + fspr_memnode_t *active, *node; void *mem = NULL; - apr_size_t free_index; + fspr_size_t free_index; #if APR_HAS_THREADS - if (pool->user_mutex) apr_thread_mutex_lock(pool->user_mutex); + if (pool->user_mutex) fspr_thread_mutex_lock(pool->user_mutex); #endif size = APR_ALIGN_DEFAULT(size); active = pool->active; /* If the active node has enough bytes left, use it. */ - if (size < (apr_size_t)(active->endp - active->first_avail)) { + if (size < (fspr_size_t)(active->endp - active->first_avail)) { mem = active->first_avail; active->first_avail += size; @@ -624,7 +624,7 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) } node = active->next; - if (size < (apr_size_t)(node->endp - node->first_avail)) { + if (size < (fspr_size_t)(node->endp - node->first_avail)) { list_remove(node); } else { @@ -664,26 +664,26 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) end: #if APR_HAS_THREADS - if (pool->user_mutex) apr_thread_mutex_unlock(pool->user_mutex); + if (pool->user_mutex) fspr_thread_mutex_unlock(pool->user_mutex); #endif return mem; } -/* Provide an implementation of apr_pcalloc for backward compatibility - * with code built before apr_pcalloc was a macro +/* Provide an implementation of fspr_pcalloc for backward compatibility + * with code built before fspr_pcalloc was a macro */ -#ifdef apr_pcalloc -#undef apr_pcalloc +#ifdef fspr_pcalloc +#undef fspr_pcalloc #endif -APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size); -APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size) +APR_DECLARE(void *) fspr_pcalloc(fspr_pool_t *pool, fspr_size_t size); +APR_DECLARE(void *) fspr_pcalloc(fspr_pool_t *pool, fspr_size_t size) { void *mem; size = APR_ALIGN_DEFAULT(size); - if ((mem = apr_palloc(pool, size)) != NULL) { + if ((mem = fspr_palloc(pool, size)) != NULL) { memset(mem, 0, size); } @@ -695,17 +695,17 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size) * Pool creation/destruction */ -APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) +APR_DECLARE(void) fspr_pool_clear(fspr_pool_t *pool) { - apr_memnode_t *active; + fspr_memnode_t *active; #if APR_HAS_THREADS - if (pool->user_mutex) apr_thread_mutex_lock(pool->user_mutex); + if (pool->user_mutex) fspr_thread_mutex_lock(pool->user_mutex); #endif /* Destroy the subpools. The subpools will detach themselves from * this pool thus this loop is safe and easy. */ while (pool->child) - apr_pool_destroy(pool->child); + fspr_pool_destroy(pool->child); /* Run cleanups */ run_cleanups(&pool->cleanups); @@ -735,20 +735,20 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) end: #if APR_HAS_THREADS - if (pool->user_mutex) apr_thread_mutex_unlock(pool->user_mutex); + if (pool->user_mutex) fspr_thread_mutex_unlock(pool->user_mutex); #endif } -APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) +APR_DECLARE(void) fspr_pool_destroy(fspr_pool_t *pool) { - apr_memnode_t *active; - apr_allocator_t *allocator; + fspr_memnode_t *active; + fspr_allocator_t *allocator; /* Destroy the subpools. The subpools will detach themselve from * this pool thus this loop is safe and easy. */ while (pool->child) - apr_pool_destroy(pool->child); + fspr_pool_destroy(pool->child); /* Run cleanups */ run_cleanups(&pool->cleanups); @@ -759,10 +759,10 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) /* Remove the pool from the parents child list */ if (pool->parent) { #if APR_HAS_THREADS - apr_thread_mutex_t *mutex; + fspr_thread_mutex_t *mutex; - if ((mutex = apr_allocator_mutex_get(pool->parent->allocator)) != NULL) - apr_thread_mutex_lock(mutex); + if ((mutex = fspr_allocator_mutex_get(pool->parent->allocator)) != NULL) + fspr_thread_mutex_lock(mutex); #endif /* APR_HAS_THREADS */ if ((*pool->ref = pool->sibling) != NULL) @@ -770,7 +770,7 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) #if APR_HAS_THREADS if (mutex) - apr_thread_mutex_unlock(mutex); + fspr_thread_mutex_unlock(mutex); #endif /* APR_HAS_THREADS */ } @@ -782,11 +782,11 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) *active->ref = NULL; #if APR_HAS_THREADS - if (apr_allocator_owner_get(allocator) == pool) { + if (fspr_allocator_owner_get(allocator) == pool) { /* Make sure to remove the lock, since it is highly likely to * be invalid now. */ - apr_allocator_mutex_set(allocator, NULL); + fspr_allocator_mutex_set(allocator, NULL); } #endif /* APR_HAS_THREADS */ @@ -800,18 +800,18 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) * and the allocator). Don't worry about destroying the optional mutex * in the allocator, it will have been destroyed by the cleanup function. */ - if (apr_allocator_owner_get(allocator) == pool) { - apr_allocator_destroy(allocator); + if (fspr_allocator_owner_get(allocator) == pool) { + fspr_allocator_destroy(allocator); } } -APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, - apr_pool_t *parent, - apr_abortfunc_t abort_fn, - apr_allocator_t *allocator) +APR_DECLARE(fspr_status_t) fspr_pool_create_ex(fspr_pool_t **newpool, + fspr_pool_t *parent, + fspr_abortfunc_t abort_fn, + fspr_allocator_t *allocator) { - apr_pool_t *pool; - apr_memnode_t *node; + fspr_pool_t *pool; + fspr_memnode_t *node; *newpool = NULL; @@ -844,7 +844,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, node->next = node; node->ref = &node->next; - pool = (apr_pool_t *)node->first_avail; + pool = (fspr_pool_t *)node->first_avail; node->first_avail = pool->self_first_avail = (char *)pool + SIZEOF_POOL_T; pool->allocator = allocator; @@ -860,15 +860,15 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, pool->user_mutex = NULL; #endif #ifdef NETWARE - pool->owner_proc = (apr_os_proc_t)getnlmhandle(); + pool->owner_proc = (fspr_os_proc_t)getnlmhandle(); #endif /* defined(NETWARE) */ if ((pool->parent = parent) != NULL) { #if APR_HAS_THREADS - apr_thread_mutex_t *mutex; + fspr_thread_mutex_t *mutex; - if ((mutex = apr_allocator_mutex_get(parent->allocator)) != NULL) - apr_thread_mutex_lock(mutex); + if ((mutex = fspr_allocator_mutex_get(parent->allocator)) != NULL) + fspr_thread_mutex_lock(mutex); #endif /* APR_HAS_THREADS */ if ((pool->sibling = parent->child) != NULL) @@ -879,7 +879,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, #if APR_HAS_THREADS if (mutex) - apr_thread_mutex_unlock(mutex); + fspr_thread_mutex_unlock(mutex); #endif /* APR_HAS_THREADS */ } else { @@ -898,37 +898,37 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, */ /* - * apr_psprintf is implemented by writing directly into the current + * fspr_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 apr_pool_t while apr_psprintf is running. alarms are - * blocked, and the only thing outside of apr_pools.c that's invoked - * is apr_vformatter -- which was purposefully written to be + * allocate in this fspr_pool_t while fspr_psprintf is running. alarms are + * blocked, and the only thing outside of fspr_pools.c that's invoked + * is fspr_vformatter -- which was purposefully written to be * self-contained with no callouts. */ struct psprintf_data { - apr_vformatter_buff_t vbuff; - apr_memnode_t *node; - apr_pool_t *pool; - apr_byte_t got_a_new_node; - apr_memnode_t *free; + fspr_vformatter_buff_t vbuff; + fspr_memnode_t *node; + fspr_pool_t *pool; + fspr_byte_t got_a_new_node; + fspr_memnode_t *free; }; #define APR_PSPRINTF_MIN_STRINGSIZE 32 -static int psprintf_flush(apr_vformatter_buff_t *vbuff) +static int psprintf_flush(fspr_vformatter_buff_t *vbuff) { struct psprintf_data *ps = (struct psprintf_data *)vbuff; - apr_memnode_t *node, *active; - apr_size_t cur_len, size; + fspr_memnode_t *node, *active; + fspr_size_t cur_len, size; char *strp; - apr_pool_t *pool; - apr_size_t free_index; + fspr_pool_t *pool; + fspr_size_t free_index; pool = ps->pool; active = ps->node; @@ -946,7 +946,7 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) node = active->next; if (!ps->got_a_new_node - && size < (apr_size_t)(node->endp - node->first_avail)) { + && size < (fspr_size_t)(node->endp - node->first_avail)) { list_remove(node); list_insert(node, active); @@ -993,16 +993,16 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) return 0; } -APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) +APR_DECLARE(char *) fspr_pvsprintf(fspr_pool_t *pool, const char *fmt, va_list ap) { struct psprintf_data ps; char *strp; - apr_size_t size; - apr_memnode_t *active, *node; - apr_size_t free_index; + fspr_size_t size; + fspr_memnode_t *active, *node; + fspr_size_t free_index; #if APR_HAS_THREADS - if (pool->user_mutex) apr_thread_mutex_lock(pool->user_mutex); + if (pool->user_mutex) fspr_thread_mutex_lock(pool->user_mutex); #endif ps.node = pool->active; @@ -1014,7 +1014,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) ps.got_a_new_node = 0; ps.free = NULL; - /* Make sure that the first node passed to apr_vformatter has at least + /* Make sure that the first node passed to fspr_vformatter has at least * room to hold the NUL terminator. */ if (ps.node->first_avail == ps.node->endp) { @@ -1028,7 +1028,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) } } - if (apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap) == -1) { + if (fspr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap) == -1) { if (pool->abort_fn) pool->abort_fn(APR_ENOMEM); @@ -1082,7 +1082,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) end: #if APR_HAS_THREADS - if (pool->user_mutex) apr_thread_mutex_unlock(pool->user_mutex); + if (pool->user_mutex) fspr_thread_mutex_unlock(pool->user_mutex); #endif return strp; @@ -1100,12 +1100,12 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) * anything other than 0, abort the traversal and return the value * returned by fn. */ -static int apr_pool_walk_tree(apr_pool_t *pool, - int (*fn)(apr_pool_t *pool, void *data), +static int fspr_pool_walk_tree(fspr_pool_t *pool, + int (*fn)(fspr_pool_t *pool, void *data), void *data) { int rv; - apr_pool_t *child; + fspr_pool_t *child; rv = fn(pool, data); if (rv) @@ -1113,13 +1113,13 @@ static int apr_pool_walk_tree(apr_pool_t *pool, #if APR_HAS_THREADS if (pool->mutex) { - apr_thread_mutex_lock(pool->mutex); + fspr_thread_mutex_lock(pool->mutex); } #endif /* APR_HAS_THREADS */ child = pool->child; while (child) { - rv = apr_pool_walk_tree(child, fn, data); + rv = fspr_pool_walk_tree(child, fn, data); if (rv) break; @@ -1128,21 +1128,21 @@ static int apr_pool_walk_tree(apr_pool_t *pool, #if APR_HAS_THREADS if (pool->mutex) { - apr_thread_mutex_unlock(pool->mutex); + fspr_thread_mutex_unlock(pool->mutex); } #endif /* APR_HAS_THREADS */ return rv; } -APR_DECLARE(int) apr_pool_walk_tree_debug(apr_pool_t *pool, - int(*fn)(apr_pool_t *pool, void *data), +APR_DECLARE(int) fspr_pool_walk_tree_debug(fspr_pool_t *pool, + int(*fn)(fspr_pool_t *pool, void *data), void *data) { - return apr_pool_walk_tree(pool, fn, data); + return fspr_pool_walk_tree(pool, fn, data); } -APR_DECLARE(void) apr_pool_get_stats(apr_pool_t *pool, unsigned int *alloc, unsigned int *total_alloc, unsigned int *clear) +APR_DECLARE(void) fspr_pool_get_stats(fspr_pool_t *pool, unsigned int *alloc, unsigned int *total_alloc, unsigned int *clear) { if (pool) { *alloc = pool->stat_alloc; @@ -1152,12 +1152,12 @@ APR_DECLARE(void) apr_pool_get_stats(apr_pool_t *pool, unsigned int *alloc, unsi } #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) -static void apr_pool_log_event(apr_pool_t *pool, const char *event, +static void fspr_pool_log_event(fspr_pool_t *pool, const char *event, const char *file_line, int deref) { if (file_stderr) { if (deref) { - apr_file_printf(file_stderr, + fspr_file_printf(file_stderr, "POOL DEBUG: " "[%lu" #if APR_HAS_THREADS @@ -1172,18 +1172,18 @@ static void apr_pool_log_event(apr_pool_t *pool, const char *event, "\n", (unsigned long)getpid(), #if APR_HAS_THREADS - (unsigned long)apr_os_thread_current(), + (unsigned long)fspr_os_thread_current(), #endif /* APR_HAS_THREADS */ event, - (unsigned long)apr_pool_num_bytes(pool, 0), - (unsigned long)apr_pool_num_bytes(pool, 1), - (unsigned long)apr_pool_num_bytes(global_pool, 1), + (unsigned long)fspr_pool_num_bytes(pool, 0), + (unsigned long)fspr_pool_num_bytes(pool, 1), + (unsigned long)fspr_pool_num_bytes(global_pool, 1), (unsigned int)pool, pool->tag, file_line, pool->stat_alloc, pool->stat_total_alloc, pool->stat_clear); } else { - apr_file_printf(file_stderr, + fspr_file_printf(file_stderr, "POOL DEBUG: " "[%lu" #if APR_HAS_THREADS @@ -1197,7 +1197,7 @@ static void apr_pool_log_event(apr_pool_t *pool, const char *event, "\n", (unsigned long)getpid(), #if APR_HAS_THREADS - (unsigned long)apr_os_thread_current(), + (unsigned long)fspr_os_thread_current(), #endif /* APR_HAS_THREADS */ event, (unsigned int)pool, @@ -1208,26 +1208,26 @@ static void apr_pool_log_event(apr_pool_t *pool, const char *event, #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */ #if (APR_POOL_DEBUG & APR_POOL_DEBUG_LIFETIME) -static int pool_is_child_of(apr_pool_t *parent, void *data) +static int pool_is_child_of(fspr_pool_t *parent, void *data) { - apr_pool_t *pool = (apr_pool_t *)data; + fspr_pool_t *pool = (fspr_pool_t *)data; return (pool == parent); } -static int apr_pool_is_child_of(apr_pool_t *pool, apr_pool_t *parent) +static int fspr_pool_is_child_of(fspr_pool_t *pool, fspr_pool_t *parent) { if (parent == NULL) return 0; - return apr_pool_walk_tree(parent, pool_is_child_of, pool); + return fspr_pool_walk_tree(parent, pool_is_child_of, pool); } #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_LIFETIME) */ -static void apr_pool_check_integrity(apr_pool_t *pool) +static void fspr_pool_check_integrity(fspr_pool_t *pool) { /* Rule of thumb: use of the global pool is always - * ok, since the only user is apr_pools.c. Unless + * ok, since the only user is fspr_pools.c. Unless * people have searched for the top level parent and * started to use that... */ @@ -1240,10 +1240,10 @@ static void apr_pool_check_integrity(apr_pool_t *pool) * destroyed, in which case we abort(). */ #if (APR_POOL_DEBUG & APR_POOL_DEBUG_LIFETIME) - if (!apr_pool_is_child_of(pool, global_pool)) { + if (!fspr_pool_is_child_of(pool, global_pool)) { #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) - apr_pool_log_event(pool, "LIFE", - __FILE__ ":apr_pool_integrity check", 0); + fspr_pool_log_event(pool, "LIFE", + __FILE__ ":fspr_pool_integrity check", 0); #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */ abort(); } @@ -1251,10 +1251,10 @@ static void apr_pool_check_integrity(apr_pool_t *pool) #if (APR_POOL_DEBUG & APR_POOL_DEBUG_OWNER) #if APR_HAS_THREADS - if (!apr_os_thread_equal(pool->owner, apr_os_thread_current())) { + if (!fspr_os_thread_equal(pool->owner, fspr_os_thread_current())) { #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) - apr_pool_log_event(pool, "THREAD", - __FILE__ ":apr_pool_integrity check", 0); + fspr_pool_log_event(pool, "THREAD", + __FILE__ ":fspr_pool_integrity check", 0); #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */ abort(); } @@ -1267,14 +1267,14 @@ static void apr_pool_check_integrity(apr_pool_t *pool) * Initialization (debug) */ -APR_DECLARE(apr_status_t) apr_pool_initialize(void) +APR_DECLARE(fspr_status_t) fspr_pool_initialize(void) { - apr_status_t rv; + fspr_status_t rv; #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) char *logpath; #endif - if (apr_pools_initialized++) + if (fspr_pools_initialized++) return APR_SUCCESS; /* Since the debug code works a bit differently then the @@ -1282,35 +1282,35 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) * pools code has got this lock embedded in the global * allocator, a concept unknown to debug mode. */ - if ((rv = apr_pool_create_ex(&global_pool, NULL, NULL, + if ((rv = fspr_pool_create_ex(&global_pool, NULL, NULL, NULL)) != APR_SUCCESS) { return rv; } - apr_pool_tag(global_pool, "APR global pool"); + fspr_pool_tag(global_pool, "APR global pool"); - apr_pools_initialized = 1; + fspr_pools_initialized = 1; /* This has to happen here because mutexes might be backed by - * atomics. It used to be snug and safe in apr_initialize(). + * atomics. It used to be snug and safe in fspr_initialize(). */ - if ((rv = apr_atomic_init(global_pool)) != APR_SUCCESS) { + if ((rv = fspr_atomic_init(global_pool)) != APR_SUCCESS) { return rv; } #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) - rv = apr_env_get(&logpath, "APR_POOL_DEBUG_LOG", global_pool); + rv = fspr_env_get(&logpath, "APR_POOL_DEBUG_LOG", global_pool); if (rv == APR_SUCCESS) { - apr_file_open(&file_stderr, logpath, APR_APPEND|APR_WRITE|APR_CREATE, + fspr_file_open(&file_stderr, logpath, APR_APPEND|APR_WRITE|APR_CREATE, APR_OS_DEFAULT, global_pool); } else { - apr_file_open_stderr(&file_stderr, global_pool); + fspr_file_open_stderr(&file_stderr, global_pool); } if (file_stderr) { - apr_file_printf(file_stderr, + fspr_file_printf(file_stderr, "POOL DEBUG: [PID" #if APR_HAS_THREADS "/TID" @@ -1318,21 +1318,21 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) "] ACTION (SIZE /POOL SIZE /TOTAL SIZE) " "POOL \"TAG\" <__FILE__:__LINE__> (ALLOCS/TOTAL ALLOCS/CLEARS)\n"); - apr_pool_log_event(global_pool, "GLOBAL", __FILE__ ":apr_pool_initialize", 0); + fspr_pool_log_event(global_pool, "GLOBAL", __FILE__ ":fspr_pool_initialize", 0); } #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */ return APR_SUCCESS; } -APR_DECLARE(void) apr_pool_terminate(void) +APR_DECLARE(void) fspr_pool_terminate(void) { - if (!apr_pools_initialized) + if (!fspr_pools_initialized) return; - apr_pools_initialized = 0; + fspr_pools_initialized = 0; - apr_pool_destroy(global_pool); /* This will also destroy the mutex */ + fspr_pool_destroy(global_pool); /* This will also destroy the mutex */ global_pool = NULL; #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) @@ -1345,7 +1345,7 @@ APR_DECLARE(void) apr_pool_terminate(void) * Memory allocation (debug) */ -static void *pool_alloc(apr_pool_t *pool, apr_size_t size) +static void *pool_alloc(fspr_pool_t *pool, fspr_size_t size) { debug_node_t *node; void *mem; @@ -1383,34 +1383,34 @@ static void *pool_alloc(apr_pool_t *pool, apr_size_t size) return mem; } -APR_DECLARE(void *) apr_palloc_debug(apr_pool_t *pool, apr_size_t size, +APR_DECLARE(void *) fspr_palloc_debug(fspr_pool_t *pool, fspr_size_t size, const char *file_line) { void *mem; - apr_pool_check_integrity(pool); + fspr_pool_check_integrity(pool); mem = pool_alloc(pool, size); #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALLOC) - apr_pool_log_event(pool, "PALLOC", file_line, 1); + fspr_pool_log_event(pool, "PALLOC", file_line, 1); #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALLOC) */ return mem; } -APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *pool, apr_size_t size, +APR_DECLARE(void *) fspr_pcalloc_debug(fspr_pool_t *pool, fspr_size_t size, const char *file_line) { void *mem; - apr_pool_check_integrity(pool); + fspr_pool_check_integrity(pool); mem = pool_alloc(pool, size); memset(mem, 0, size); #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALLOC) - apr_pool_log_event(pool, "PCALLOC", file_line, 1); + fspr_pool_log_event(pool, "PCALLOC", file_line, 1); #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALLOC) */ return mem; @@ -1423,10 +1423,10 @@ APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *pool, apr_size_t size, #define POOL_POISON_BYTE 'A' -static void pool_clear_debug(apr_pool_t *pool, const char *file_line) +static void pool_clear_debug(fspr_pool_t *pool, const char *file_line) { debug_node_t *node; - apr_uint32_t index; + fspr_uint32_t index; /* Destroy the subpools. The subpools will detach themselves from * this pool thus this loop is safe and easy. @@ -1469,17 +1469,17 @@ static void pool_clear_debug(apr_pool_t *pool, const char *file_line) pool->stat_clear++; } -APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, +APR_DECLARE(void) fspr_pool_clear_debug(fspr_pool_t *pool, const char *file_line) { #if APR_HAS_THREADS - apr_thread_mutex_t *mutex = NULL; + fspr_thread_mutex_t *mutex = NULL; #endif - apr_pool_check_integrity(pool); + fspr_pool_check_integrity(pool); #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) - apr_pool_log_event(pool, "CLEAR", file_line, 1); + fspr_pool_log_event(pool, "CLEAR", file_line, 1); #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */ #if APR_HAS_THREADS @@ -1487,11 +1487,11 @@ APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, mutex = pool->parent->mutex; /* Lock the parent mutex before clearing so that if we have our - * own mutex it won't be accessed by apr_pool_walk_tree after + * own mutex it won't be accessed by fspr_pool_walk_tree after * it has been destroyed. */ if (mutex != NULL && mutex != pool->mutex) { - apr_thread_mutex_lock(mutex); + fspr_thread_mutex_lock(mutex); } #endif @@ -1503,21 +1503,21 @@ APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, * the mutex we obtained above. */ if (mutex != pool->mutex) { - (void)apr_thread_mutex_create(&pool->mutex, + (void)fspr_thread_mutex_create(&pool->mutex, APR_THREAD_MUTEX_NESTED, pool); if (mutex != NULL) - (void)apr_thread_mutex_unlock(mutex); + (void)fspr_thread_mutex_unlock(mutex); } #endif /* APR_HAS_THREADS */ } -static void pool_destroy_debug(apr_pool_t *pool, const char *file_line) +static void pool_destroy_debug(fspr_pool_t *pool, const char *file_line) { - apr_pool_check_integrity(pool); + fspr_pool_check_integrity(pool); #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) - apr_pool_log_event(pool, "DESTROY", file_line, 1); + fspr_pool_log_event(pool, "DESTROY", file_line, 1); #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */ pool_clear_debug(pool, file_line); @@ -1525,10 +1525,10 @@ static void pool_destroy_debug(apr_pool_t *pool, const char *file_line) /* Remove the pool from the parents child list */ if (pool->parent) { #if APR_HAS_THREADS - apr_thread_mutex_t *mutex; + fspr_thread_mutex_t *mutex; if ((mutex = pool->parent->mutex) != NULL) - apr_thread_mutex_lock(mutex); + fspr_thread_mutex_lock(mutex); #endif /* APR_HAS_THREADS */ if ((*pool->ref = pool->sibling) != NULL) @@ -1536,28 +1536,28 @@ static void pool_destroy_debug(apr_pool_t *pool, const char *file_line) #if APR_HAS_THREADS if (mutex) - apr_thread_mutex_unlock(mutex); + fspr_thread_mutex_unlock(mutex); #endif /* APR_HAS_THREADS */ } if (pool->allocator != NULL - && apr_allocator_owner_get(pool->allocator) == pool) { - apr_allocator_destroy(pool->allocator); + && fspr_allocator_owner_get(pool->allocator) == pool) { + fspr_allocator_destroy(pool->allocator); } /* Free the pool itself */ free(pool); } -APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, +APR_DECLARE(void) fspr_pool_destroy_debug(fspr_pool_t *pool, const char *file_line) { if (pool->joined) { /* Joined pools must not be explicitly destroyed; the caller * has broken the guarantee. */ #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) - apr_pool_log_event(pool, "LIFE", - __FILE__ ":apr_pool_destroy abort on joined", 0); + fspr_pool_log_event(pool, "LIFE", + __FILE__ ":fspr_pool_destroy abort on joined", 0); #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */ abort(); @@ -1565,13 +1565,13 @@ APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, pool_destroy_debug(pool, file_line); } -APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, - apr_pool_t *parent, - apr_abortfunc_t abort_fn, - apr_allocator_t *allocator, +APR_DECLARE(fspr_status_t) fspr_pool_create_ex_debug(fspr_pool_t **newpool, + fspr_pool_t *parent, + fspr_abortfunc_t abort_fn, + fspr_allocator_t *allocator, const char *file_line) { - apr_pool_t *pool; + fspr_pool_t *pool; *newpool = NULL; @@ -1579,7 +1579,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, parent = global_pool; } else { - apr_pool_check_integrity(parent); + fspr_pool_check_integrity(parent); if (!allocator) allocator = parent->allocator; @@ -1605,7 +1605,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, if ((pool->parent = parent) != NULL) { #if APR_HAS_THREADS if (parent->mutex) - apr_thread_mutex_lock(parent->mutex); + fspr_thread_mutex_lock(parent->mutex); #endif /* APR_HAS_THREADS */ if ((pool->sibling = parent->child) != NULL) pool->sibling->ref = &pool->sibling; @@ -1615,7 +1615,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, #if APR_HAS_THREADS if (parent->mutex) - apr_thread_mutex_unlock(parent->mutex); + fspr_thread_mutex_unlock(parent->mutex); #endif /* APR_HAS_THREADS */ } else { @@ -1624,26 +1624,26 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, } #if APR_HAS_THREADS - pool->owner = apr_os_thread_current(); + pool->owner = fspr_os_thread_current(); #endif /* APR_HAS_THREADS */ #ifdef NETWARE - pool->owner_proc = (apr_os_proc_t)getnlmhandle(); + pool->owner_proc = (fspr_os_proc_t)getnlmhandle(); #endif /* defined(NETWARE) */ if (parent == NULL || parent->allocator != allocator) { #if APR_HAS_THREADS - apr_status_t rv; + fspr_status_t rv; /* No matter what the creation flags say, always create - * a lock. Without it integrity_check and apr_pool_num_bytes + * a lock. Without it integrity_check and fspr_pool_num_bytes * blow up (because they traverse pools child lists that * possibly belong to another thread, in combination with * the pool having no lock). However, this might actually * hide problems like creating a child pool of a pool * belonging to another thread. */ - if ((rv = apr_thread_mutex_create(&pool->mutex, + if ((rv = fspr_thread_mutex_create(&pool->mutex, APR_THREAD_MUTEX_NESTED, pool)) != APR_SUCCESS) { free(pool); return rv; @@ -1660,7 +1660,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, *newpool = pool; #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) - apr_pool_log_event(pool, "CREATE", file_line, 1); + fspr_pool_log_event(pool, "CREATE", file_line, 1); #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE) */ return APR_SUCCESS; @@ -1672,15 +1672,15 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, */ struct psprintf_data { - apr_vformatter_buff_t vbuff; + fspr_vformatter_buff_t vbuff; char *mem; - apr_size_t size; + fspr_size_t size; }; -static int psprintf_flush(apr_vformatter_buff_t *vbuff) +static int psprintf_flush(fspr_vformatter_buff_t *vbuff) { struct psprintf_data *ps = (struct psprintf_data *)vbuff; - apr_size_t size; + fspr_size_t size; size = ps->vbuff.curpos - ps->mem; @@ -1694,12 +1694,12 @@ static int psprintf_flush(apr_vformatter_buff_t *vbuff) return 0; } -APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) +APR_DECLARE(char *) fspr_pvsprintf(fspr_pool_t *pool, const char *fmt, va_list ap) { struct psprintf_data ps; debug_node_t *node; - apr_pool_check_integrity(pool); + fspr_pool_check_integrity(pool); ps.size = 64; ps.mem = malloc(ps.size); @@ -1708,7 +1708,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) /* Save a byte for the NUL terminator */ ps.vbuff.endpos = ps.mem + ps.size - 1; - if (apr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap) == -1) { + if (fspr_vformatter(psprintf_flush, &ps.vbuff, fmt, ap) == -1) { if (pool->abort_fn) pool->abort_fn(APR_ENOMEM); @@ -1746,7 +1746,7 @@ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap) * Debug functions */ -APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub) +APR_DECLARE(void) fspr_pool_join(fspr_pool_t *p, fspr_pool_t *sub) { #if APR_POOL_DEBUG if (sub->parent != p) { @@ -1756,11 +1756,11 @@ APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub) #endif } -static int pool_find(apr_pool_t *pool, void *data) +static int pool_find(fspr_pool_t *pool, void *data) { void **pmem = (void **)data; debug_node_t *node; - apr_uint32_t index; + fspr_uint32_t index; node = pool->nodes; @@ -1779,21 +1779,21 @@ static int pool_find(apr_pool_t *pool, void *data) return 0; } -APR_DECLARE(apr_pool_t *) apr_pool_find(const void *mem) +APR_DECLARE(fspr_pool_t *) fspr_pool_find(const void *mem) { void *pool = (void *)mem; - if (apr_pool_walk_tree(global_pool, pool_find, &pool)) + if (fspr_pool_walk_tree(global_pool, pool_find, &pool)) return pool; return NULL; } -static int pool_num_bytes(apr_pool_t *pool, void *data) +static int pool_num_bytes(fspr_pool_t *pool, void *data) { - apr_size_t *psize = (apr_size_t *)data; + fspr_size_t *psize = (fspr_size_t *)data; debug_node_t *node; - apr_uint32_t index; + fspr_uint32_t index; node = pool->nodes; @@ -1808,9 +1808,9 @@ static int pool_num_bytes(apr_pool_t *pool, void *data) return 0; } -APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *pool, int recurse) +APR_DECLARE(fspr_size_t) fspr_pool_num_bytes(fspr_pool_t *pool, int recurse) { - apr_size_t size = 0; + fspr_size_t size = 0; if (!recurse) { pool_num_bytes(pool, &size); @@ -1818,12 +1818,12 @@ APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *pool, int recurse) return size; } - apr_pool_walk_tree(pool, pool_num_bytes, &size); + fspr_pool_walk_tree(pool, pool_num_bytes, &size); return size; } -APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag) +APR_DECLARE(void) fspr_pool_lock(fspr_pool_t *pool, int flag) { } @@ -1832,12 +1832,12 @@ APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag) #ifdef NETWARE void netware_pool_proc_cleanup () { - apr_pool_t *pool = global_pool->child; - apr_os_proc_t owner_proc = (apr_os_proc_t)getnlmhandle(); + fspr_pool_t *pool = global_pool->child; + fspr_os_proc_t owner_proc = (fspr_os_proc_t)getnlmhandle(); while (pool) { if (pool->owner_proc == owner_proc) { - apr_pool_destroy (pool); + fspr_pool_destroy (pool); pool = global_pool->child; } else { @@ -1853,13 +1853,13 @@ void netware_pool_proc_cleanup () * "Print" functions (common) */ -APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) +APR_DECLARE_NONSTD(char *) fspr_psprintf(fspr_pool_t *p, const char *fmt, ...) { va_list ap; char *res; va_start(ap, fmt); - res = apr_pvsprintf(p, fmt, ap); + res = fspr_pvsprintf(p, fmt, ap); va_end(ap); return res; } @@ -1868,18 +1868,18 @@ APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) * Pool Properties */ -APR_DECLARE(void) apr_pool_abort_set(apr_abortfunc_t abort_fn, - apr_pool_t *pool) +APR_DECLARE(void) fspr_pool_abort_set(fspr_abortfunc_t abort_fn, + fspr_pool_t *pool) { pool->abort_fn = abort_fn; } -APR_DECLARE(apr_abortfunc_t) apr_pool_abort_get(apr_pool_t *pool) +APR_DECLARE(fspr_abortfunc_t) fspr_pool_abort_get(fspr_pool_t *pool) { return pool->abort_fn; } -APR_DECLARE(apr_pool_t *) apr_pool_parent_get(apr_pool_t *pool) +APR_DECLARE(fspr_pool_t *) fspr_pool_parent_get(fspr_pool_t *pool) { #ifdef NETWARE /* On NetWare, don't return the global_pool, return the application pool @@ -1891,7 +1891,7 @@ APR_DECLARE(apr_pool_t *) apr_pool_parent_get(apr_pool_t *pool) return pool->parent; } -APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool) +APR_DECLARE(fspr_allocator_t *) fspr_pool_allocator_get(fspr_pool_t *pool) { return pool->allocator; } @@ -1899,7 +1899,7 @@ APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool) /* return TRUE if a is an ancestor of b * NULL is considered an ancestor of all pools */ -APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) +APR_DECLARE(int) fspr_pool_is_ancestor(fspr_pool_t *a, fspr_pool_t *b) { if (a == NULL) return 1; @@ -1922,7 +1922,7 @@ APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b) return 0; } -APR_DECLARE(const char *) apr_pool_tag(apr_pool_t *pool, const char *tag) +APR_DECLARE(const char *) fspr_pool_tag(fspr_pool_t *pool, const char *tag) { if (tag) { pool->tag = tag; @@ -1936,63 +1936,63 @@ APR_DECLARE(const char *) apr_pool_tag(apr_pool_t *pool, const char *tag) * User data management */ -APR_DECLARE(apr_status_t) apr_pool_userdata_set(const void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_pool_userdata_set(const void *data, const char *key, + fspr_status_t (*cleanup) (void *), + fspr_pool_t *pool) { #if APR_POOL_DEBUG - apr_pool_check_integrity(pool); + fspr_pool_check_integrity(pool); #endif /* APR_POOL_DEBUG */ if (pool->user_data == NULL) - pool->user_data = apr_hash_make(pool); + pool->user_data = fspr_hash_make(pool); - if (apr_hash_get(pool->user_data, key, APR_HASH_KEY_STRING) == NULL) { - char *new_key = apr_pstrdup(pool, key); - apr_hash_set(pool->user_data, new_key, APR_HASH_KEY_STRING, data); + if (fspr_hash_get(pool->user_data, key, APR_HASH_KEY_STRING) == NULL) { + char *new_key = fspr_pstrdup(pool, key); + fspr_hash_set(pool->user_data, new_key, APR_HASH_KEY_STRING, data); } else { - apr_hash_set(pool->user_data, key, APR_HASH_KEY_STRING, data); + fspr_hash_set(pool->user_data, key, APR_HASH_KEY_STRING, data); } if (cleanup) - apr_pool_cleanup_register(pool, data, cleanup, cleanup); + fspr_pool_cleanup_register(pool, data, cleanup, cleanup); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pool_userdata_setn(const void *data, +APR_DECLARE(fspr_status_t) fspr_pool_userdata_setn(const void *data, const char *key, - apr_status_t (*cleanup)(void *), - apr_pool_t *pool) + fspr_status_t (*cleanup)(void *), + fspr_pool_t *pool) { #if APR_POOL_DEBUG - apr_pool_check_integrity(pool); + fspr_pool_check_integrity(pool); #endif /* APR_POOL_DEBUG */ if (pool->user_data == NULL) - pool->user_data = apr_hash_make(pool); + pool->user_data = fspr_hash_make(pool); - apr_hash_set(pool->user_data, key, APR_HASH_KEY_STRING, data); + fspr_hash_set(pool->user_data, key, APR_HASH_KEY_STRING, data); if (cleanup) - apr_pool_cleanup_register(pool, data, cleanup, cleanup); + fspr_pool_cleanup_register(pool, data, cleanup, cleanup); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_pool_userdata_get(void **data, const char *key, + fspr_pool_t *pool) { #if APR_POOL_DEBUG - apr_pool_check_integrity(pool); + fspr_pool_check_integrity(pool); #endif /* APR_POOL_DEBUG */ if (pool->user_data == NULL) { *data = NULL; } else { - *data = apr_hash_get(pool->user_data, key, APR_HASH_KEY_STRING); + *data = fspr_hash_get(pool->user_data, key, APR_HASH_KEY_STRING); } return APR_SUCCESS; @@ -2006,18 +2006,18 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, struct cleanup_t { struct cleanup_t *next; const void *data; - apr_status_t (*plain_cleanup_fn)(void *data); - apr_status_t (*child_cleanup_fn)(void *data); + fspr_status_t (*plain_cleanup_fn)(void *data); + fspr_status_t (*child_cleanup_fn)(void *data); }; -APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, - apr_status_t (*plain_cleanup_fn)(void *data), - apr_status_t (*child_cleanup_fn)(void *data)) +APR_DECLARE(void) fspr_pool_cleanup_register(fspr_pool_t *p, const void *data, + fspr_status_t (*plain_cleanup_fn)(void *data), + fspr_status_t (*child_cleanup_fn)(void *data)) { cleanup_t *c; #if APR_POOL_DEBUG - apr_pool_check_integrity(p); + fspr_pool_check_integrity(p); #endif /* APR_POOL_DEBUG */ if (p != NULL) { @@ -2026,7 +2026,7 @@ APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, c = p->free_cleanups; p->free_cleanups = c->next; } else { - c = apr_palloc(p, sizeof(cleanup_t)); + c = fspr_palloc(p, sizeof(cleanup_t)); } c->data = data; c->plain_cleanup_fn = plain_cleanup_fn; @@ -2036,13 +2036,13 @@ APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data, } } -APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, - apr_status_t (*cleanup_fn)(void *)) +APR_DECLARE(void) fspr_pool_cleanup_kill(fspr_pool_t *p, const void *data, + fspr_status_t (*cleanup_fn)(void *)) { cleanup_t *c, **lastp; #if APR_POOL_DEBUG - apr_pool_check_integrity(p); + fspr_pool_check_integrity(p); #endif /* APR_POOL_DEBUG */ if (p == NULL) @@ -2069,14 +2069,14 @@ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, } } -APR_DECLARE(void) apr_pool_child_cleanup_set(apr_pool_t *p, const void *data, - apr_status_t (*plain_cleanup_fn)(void *), - apr_status_t (*child_cleanup_fn)(void *)) +APR_DECLARE(void) fspr_pool_child_cleanup_set(fspr_pool_t *p, const void *data, + fspr_status_t (*plain_cleanup_fn)(void *), + fspr_status_t (*child_cleanup_fn)(void *)) { cleanup_t *c; #if APR_POOL_DEBUG - apr_pool_check_integrity(p); + fspr_pool_check_integrity(p); #endif /* APR_POOL_DEBUG */ if (p == NULL) @@ -2093,10 +2093,10 @@ APR_DECLARE(void) apr_pool_child_cleanup_set(apr_pool_t *p, const void *data, } } -APR_DECLARE(apr_status_t) apr_pool_cleanup_run(apr_pool_t *p, void *data, - apr_status_t (*cleanup_fn)(void *)) +APR_DECLARE(fspr_status_t) fspr_pool_cleanup_run(fspr_pool_t *p, void *data, + fspr_status_t (*cleanup_fn)(void *)) { - apr_pool_cleanup_kill(p, data, cleanup_fn); + fspr_pool_cleanup_kill(p, data, cleanup_fn); return (*cleanup_fn)(data); } @@ -2122,7 +2122,7 @@ static void run_child_cleanups(cleanup_t **cref) } } -static void cleanup_pool_for_exec(apr_pool_t *p) +static void cleanup_pool_for_exec(fspr_pool_t *p) { run_child_cleanups(&p->cleanups); @@ -2130,7 +2130,7 @@ static void cleanup_pool_for_exec(apr_pool_t *p) cleanup_pool_for_exec(p); } -APR_DECLARE(void) apr_pool_cleanup_for_exec(void) +APR_DECLARE(void) fspr_pool_cleanup_for_exec(void) { #if !defined(WIN32) && !defined(OS2) /* @@ -2146,7 +2146,7 @@ APR_DECLARE(void) apr_pool_cleanup_for_exec(void) #endif /* !defined(WIN32) && !defined(OS2) */ } -APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data) +APR_DECLARE_NONSTD(fspr_status_t) fspr_pool_cleanup_null(void *data) { /* do nothing cleanup routine */ return APR_SUCCESS; @@ -2159,10 +2159,10 @@ APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data) * we might want to fold support for that into the generic interface. * For now, it's a special case. */ -APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *pool, apr_proc_t *proc, - apr_kill_conditions_e how) +APR_DECLARE(void) fspr_pool_note_subprocess(fspr_pool_t *pool, fspr_proc_t *proc, + fspr_kill_conditions_e how) { - struct process_chain *pc = apr_palloc(pool, sizeof(struct process_chain)); + struct process_chain *pc = fspr_palloc(pool, sizeof(struct process_chain)); pc->proc = proc; pc->kill_how = how; @@ -2178,7 +2178,7 @@ static void free_proc_chain(struct process_chain *procs) */ struct process_chain *pc; int need_timeout = 0; - apr_time_t timeout_interval; + fspr_time_t timeout_interval; if (!procs) return; /* No work. Whew! */ @@ -2193,7 +2193,7 @@ static void free_proc_chain(struct process_chain *procs) #ifndef NEED_WAITPID /* Pick up all defunct processes */ for (pc = procs; pc; pc = pc->next) { - if (apr_proc_wait(pc->proc, NULL, NULL, APR_NOWAIT) != APR_CHILD_NOTDONE) + if (fspr_proc_wait(pc->proc, NULL, NULL, APR_NOWAIT) != APR_CHILD_NOTDONE) pc->kill_how = APR_KILL_NEVER; } #endif /* !defined(NEED_WAITPID) */ @@ -2204,11 +2204,11 @@ static void free_proc_chain(struct process_chain *procs) || (pc->kill_how == APR_KILL_ONLY_ONCE)) { /* * Subprocess may be dead already. Only need the timeout if not. - * Note: apr_proc_kill on Windows is TerminateProcess(), which is + * Note: fspr_proc_kill on Windows is TerminateProcess(), which is * similar to a SIGKILL, so always give the process a timeout * under Windows before killing it. */ - if (apr_proc_kill(pc->proc, SIGTERM) == APR_SUCCESS) + if (fspr_proc_kill(pc->proc, SIGTERM) == APR_SUCCESS) need_timeout = 1; } else if (pc->kill_how == APR_KILL_ALWAYS) { @@ -2217,7 +2217,7 @@ static void free_proc_chain(struct process_chain *procs) need_timeout = 1; pc->kill_how = APR_KILL_ALWAYS; #endif - apr_proc_kill(pc->proc, SIGKILL); + fspr_proc_kill(pc->proc, SIGKILL); } } @@ -2227,14 +2227,14 @@ static void free_proc_chain(struct process_chain *procs) */ if (need_timeout) { timeout_interval = TIMEOUT_INTERVAL; - apr_sleep(timeout_interval); + fspr_sleep(timeout_interval); do { /* check the status of the subprocesses */ need_timeout = 0; for (pc = procs; pc; pc = pc->next) { if (pc->kill_how == APR_KILL_AFTER_TIMEOUT) { - if (apr_proc_wait(pc->proc, NULL, NULL, APR_NOWAIT) + if (fspr_proc_wait(pc->proc, NULL, NULL, APR_NOWAIT) == APR_CHILD_NOTDONE) need_timeout = 1; /* subprocess is still active */ else @@ -2245,7 +2245,7 @@ static void free_proc_chain(struct process_chain *procs) if (timeout_interval >= TIMEOUT_USECS) { break; } - apr_sleep(timeout_interval); + fspr_sleep(timeout_interval); timeout_interval *= 2; } } while (need_timeout); @@ -2257,13 +2257,13 @@ static void free_proc_chain(struct process_chain *procs) */ for (pc = procs; pc; pc = pc->next) { if (pc->kill_how == APR_KILL_AFTER_TIMEOUT) - apr_proc_kill(pc->proc, SIGKILL); + fspr_proc_kill(pc->proc, SIGKILL); } /* Now wait for all the signaled processes to die */ for (pc = procs; pc; pc = pc->next) { if (pc->kill_how != APR_KILL_NEVER) - (void)apr_proc_wait(pc->proc, NULL, NULL, APR_WAIT); + (void)fspr_proc_wait(pc->proc, NULL, NULL, APR_WAIT); } } @@ -2274,85 +2274,85 @@ static void free_proc_chain(struct process_chain *procs) */ #if !APR_POOL_DEBUG -APR_DECLARE(void *) apr_palloc_debug(apr_pool_t *pool, apr_size_t size, +APR_DECLARE(void *) fspr_palloc_debug(fspr_pool_t *pool, fspr_size_t size, const char *file_line) { - return apr_palloc(pool, size); + return fspr_palloc(pool, size); } -APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *pool, apr_size_t size, +APR_DECLARE(void *) fspr_pcalloc_debug(fspr_pool_t *pool, fspr_size_t size, const char *file_line) { - return apr_pcalloc(pool, size); + return fspr_pcalloc(pool, size); } -APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, +APR_DECLARE(void) fspr_pool_clear_debug(fspr_pool_t *pool, const char *file_line) { - apr_pool_clear(pool); + fspr_pool_clear(pool); } -APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *pool, +APR_DECLARE(void) fspr_pool_destroy_debug(fspr_pool_t *pool, const char *file_line) { - apr_pool_destroy(pool); + fspr_pool_destroy(pool); } -APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, - apr_pool_t *parent, - apr_abortfunc_t abort_fn, - apr_allocator_t *allocator, +APR_DECLARE(fspr_status_t) fspr_pool_create_ex_debug(fspr_pool_t **newpool, + fspr_pool_t *parent, + fspr_abortfunc_t abort_fn, + fspr_allocator_t *allocator, const char *file_line) { - return apr_pool_create_ex(newpool, parent, abort_fn, allocator); + return fspr_pool_create_ex(newpool, parent, abort_fn, allocator); } #else /* APR_POOL_DEBUG */ -#undef apr_palloc -APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size); +#undef fspr_palloc +APR_DECLARE(void *) fspr_palloc(fspr_pool_t *pool, fspr_size_t size); -APR_DECLARE(void *) apr_palloc(apr_pool_t *pool, apr_size_t size) +APR_DECLARE(void *) fspr_palloc(fspr_pool_t *pool, fspr_size_t size) { - return apr_palloc_debug(pool, size, "undefined"); + return fspr_palloc_debug(pool, size, "undefined"); } -#undef apr_pcalloc -APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size); +#undef fspr_pcalloc +APR_DECLARE(void *) fspr_pcalloc(fspr_pool_t *pool, fspr_size_t size); -APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size) +APR_DECLARE(void *) fspr_pcalloc(fspr_pool_t *pool, fspr_size_t size) { - return apr_pcalloc_debug(pool, size, "undefined"); + return fspr_pcalloc_debug(pool, size, "undefined"); } -#undef apr_pool_clear -APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool); +#undef fspr_pool_clear +APR_DECLARE(void) fspr_pool_clear(fspr_pool_t *pool); -APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) +APR_DECLARE(void) fspr_pool_clear(fspr_pool_t *pool) { - apr_pool_clear_debug(pool, "undefined"); + fspr_pool_clear_debug(pool, "undefined"); } -#undef apr_pool_destroy -APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool); +#undef fspr_pool_destroy +APR_DECLARE(void) fspr_pool_destroy(fspr_pool_t *pool); -APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) +APR_DECLARE(void) fspr_pool_destroy(fspr_pool_t *pool) { - apr_pool_destroy_debug(pool, "undefined"); + fspr_pool_destroy_debug(pool, "undefined"); } -#undef apr_pool_create_ex -APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, - apr_pool_t *parent, - apr_abortfunc_t abort_fn, - apr_allocator_t *allocator); +#undef fspr_pool_create_ex +APR_DECLARE(fspr_status_t) fspr_pool_create_ex(fspr_pool_t **newpool, + fspr_pool_t *parent, + fspr_abortfunc_t abort_fn, + fspr_allocator_t *allocator); -APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, - apr_pool_t *parent, - apr_abortfunc_t abort_fn, - apr_allocator_t *allocator) +APR_DECLARE(fspr_status_t) fspr_pool_create_ex(fspr_pool_t **newpool, + fspr_pool_t *parent, + fspr_abortfunc_t abort_fn, + fspr_allocator_t *allocator) { - return apr_pool_create_ex_debug(newpool, parent, + return fspr_pool_create_ex_debug(newpool, parent, abort_fn, allocator, "undefined"); } diff --git a/libs/apr/misc/netware/charset.c b/libs/apr/misc/netware/charset.c index b79add10b5..f8f376d86b 100644 --- a/libs/apr/misc/netware/charset.c +++ b/libs/apr/misc/netware/charset.c @@ -14,21 +14,21 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_strings.h" -#include "apr_portable.h" +#include "fspr.h" +#include "fspr_strings.h" +#include "fspr_portable.h" /* static struct utsname sysinfo; */ /* XXX This needs to be fixed to produce the correct system language */ -APR_DECLARE(const char*) apr_os_default_encoding (apr_pool_t *pool) +APR_DECLARE(const char*) fspr_os_default_encoding (fspr_pool_t *pool) { - return apr_pstrdup(pool, "CP1252"); + return fspr_pstrdup(pool, "CP1252"); } -APR_DECLARE(const char*) apr_os_locale_encoding (apr_pool_t *pool) +APR_DECLARE(const char*) fspr_os_locale_encoding (fspr_pool_t *pool) { - return apr_os_default_encoding(pool); + return fspr_os_default_encoding(pool); } diff --git a/libs/apr/misc/netware/libprews.c b/libs/apr/misc/netware/libprews.c index 624bf22cfa..11fec7e7bc 100644 --- a/libs/apr/misc/netware/libprews.c +++ b/libs/apr/misc/netware/libprews.c @@ -20,8 +20,8 @@ #include "novsock2.h" #endif -#include "apr_pools.h" -#include "apr_private.h" +#include "fspr_pools.h" +#include "fspr_private.h" /* library-private data...*/ @@ -51,7 +51,7 @@ int _NonAppStart #ifdef USE_WINSOCK WSADATA wsaData; #endif - apr_status_t status; + fspr_status_t status; NX_LOCK_INFO_ALLOC(liblock, "Per-Application Data Lock", 0); @@ -83,9 +83,9 @@ int _NonAppStart return -1; } - apr_netware_setup_time(); + fspr_netware_setup_time(); - if ((status = apr_pool_initialize()) != APR_SUCCESS) + if ((status = fspr_pool_initialize()) != APR_SUCCESS) return status; #ifdef USE_WINSOCK @@ -97,7 +97,7 @@ int _NonAppStart void _NonAppStop( void ) { - apr_pool_terminate(); + fspr_pool_terminate(); #ifdef USE_WINSOCK WSACleanup(); diff --git a/libs/apr/misc/netware/rand.c b/libs/apr/misc/netware/rand.c index a2baae7ecd..f9bee2153a 100644 --- a/libs/apr/misc/netware/rand.c +++ b/libs/apr/misc/netware/rand.c @@ -15,9 +15,9 @@ */ #define APR_WANT_MEMFUNC -#include "apr_want.h" -#include "apr_general.h" -#include "apr_private.h" +#include "fspr_want.h" +#include "fspr_general.h" +#include "fspr_private.h" #if APR_HAS_RANDOM @@ -56,8 +56,8 @@ static int NXSeedRandomInternal( size_t width, void *seed ) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, - apr_size_t length) +APR_DECLARE(fspr_status_t) fspr_generate_random_bytes(unsigned char *buf, + fspr_size_t length) { if (NXSeedRandom(length, buf) != 0) { return NXSeedRandomInternal (length, buf); diff --git a/libs/apr/misc/netware/start.c b/libs/apr/misc/netware/start.c index c8ccc1c1c4..7636b2beea 100644 --- a/libs/apr/misc/netware/start.c +++ b/libs/apr/misc/netware/start.c @@ -14,14 +14,14 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_signal.h" +#include "fspr.h" +#include "fspr_general.h" +#include "fspr_pools.h" +#include "fspr_signal.h" -#include "apr_arch_misc.h" /* for WSAHighByte / WSALowByte */ -#include "apr_arch_proc_mutex.h" /* for apr_proc_mutex_unix_setup_lock() */ -#include "apr_arch_internal_time.h" +#include "fspr_arch_misc.h" /* for WSAHighByte / WSALowByte */ +#include "fspr_arch_proc_mutex.h" /* for fspr_proc_mutex_unix_setup_lock() */ +#include "fspr_arch_internal_time.h" #ifdef USE_WINSOCK /* @@ -108,7 +108,7 @@ static int RegisterAppWithWinSock (void *nlm_handle) -APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, +APR_DECLARE(fspr_status_t) fspr_app_initialize(int *argc, const char * const * *argv, const char * const * *env) { @@ -117,12 +117,12 @@ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, * control manager into the process, and it's required to fix the char* * data passed in from win32 unicode into utf-8, win32's apr internal fmt. */ - return apr_initialize(); + return fspr_initialize(); } -APR_DECLARE(apr_status_t) apr_initialize(void) +APR_DECLARE(fspr_status_t) fspr_initialize(void) { - apr_pool_t *pool; + fspr_pool_t *pool; int err; void *nlmhandle = getnlmhandle(); @@ -132,15 +132,15 @@ APR_DECLARE(apr_status_t) apr_initialize(void) return APR_SUCCESS; } - /* apr_pool_initialize() is being called from the library + /* fspr_pool_initialize() is being called from the library startup code since all of the memory resources belong to the library rather than the application. */ - if (apr_pool_create(&pool, NULL) != APR_SUCCESS) { + if (fspr_pool_create(&pool, NULL) != APR_SUCCESS) { return APR_ENOPOOL; } - apr_pool_tag(pool, "apr_initilialize"); + fspr_pool_tag(pool, "fspr_initilialize"); #ifdef USE_WINSOCK err = RegisterAppWithWinSock (nlmhandle); @@ -150,12 +150,12 @@ APR_DECLARE(apr_status_t) apr_initialize(void) } #endif - apr_signal_init(pool); + fspr_signal_init(pool); return APR_SUCCESS; } -APR_DECLARE_NONSTD(void) apr_terminate(void) +APR_DECLARE_NONSTD(void) fspr_terminate(void) { APP_DATA *app_data; @@ -169,7 +169,7 @@ APR_DECLARE_NONSTD(void) apr_terminate(void) return; } - /* apr_pool_terminate() is being called from the + /* fspr_pool_terminate() is being called from the library shutdown code since the memory resources belong to the library rather than the application */ @@ -182,7 +182,7 @@ APR_DECLARE_NONSTD(void) apr_terminate(void) #endif } -APR_DECLARE(void) apr_terminate2(void) +APR_DECLARE(void) fspr_terminate2(void) { - apr_terminate(); + fspr_terminate(); } diff --git a/libs/apr/misc/unix/charset.c b/libs/apr/misc/unix/charset.c index a66724d720..02991a7d78 100644 --- a/libs/apr/misc/unix/charset.c +++ b/libs/apr/misc/unix/charset.c @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_private.h" -#include "apr_strings.h" -#include "apr_portable.h" +#include "fspr.h" +#include "fspr_private.h" +#include "fspr_strings.h" +#include "fspr_portable.h" #ifdef HAVE_LANGINFO_H #include @@ -33,7 +33,7 @@ * unpacked. */ -APR_DECLARE(const char*) apr_os_default_encoding (apr_pool_t *pool) +APR_DECLARE(const char*) fspr_os_default_encoding (fspr_pool_t *pool) { #ifdef __MVS__ # ifdef __CODESET__ @@ -63,7 +63,7 @@ APR_DECLARE(const char*) apr_os_default_encoding (apr_pool_t *pool) } -APR_DECLARE(const char*) apr_os_locale_encoding (apr_pool_t *pool) +APR_DECLARE(const char*) fspr_os_locale_encoding (fspr_pool_t *pool) { #if defined(HAVE_NL_LANGINFO) && defined(CODESET) const char *charset; @@ -72,12 +72,12 @@ APR_DECLARE(const char*) apr_os_locale_encoding (apr_pool_t *pool) if (charset && *charset) { #ifdef _OSD_POSIX /* Bug workaround - delete as soon as fixed in OSD_POSIX */ /* Some versions of OSD_POSIX return nl_langinfo(CODESET)="^[nN]" */ - /* Ignore the bogus information and use apr_os_default_encoding() */ + /* Ignore the bogus information and use fspr_os_default_encoding() */ if (charset[0] != '^') #endif return charset; } #endif - return apr_os_default_encoding(pool); + return fspr_os_default_encoding(pool); } diff --git a/libs/apr/misc/unix/env.c b/libs/apr/misc/unix/env.c index 9ba6b61e78..37b64f107d 100644 --- a/libs/apr/misc/unix/env.c +++ b/libs/apr/misc/unix/env.c @@ -15,10 +15,10 @@ */ #define APR_WANT_STRFUNC -#include "apr_want.h" -#include "apr.h" -#include "apr_private.h" -#include "apr_env.h" +#include "fspr_want.h" +#include "fspr.h" +#include "fspr_private.h" +#include "fspr_env.h" #if APR_HAVE_UNISTD_H #include @@ -27,9 +27,9 @@ #include #endif -APR_DECLARE(apr_status_t) apr_env_get(char **value, +APR_DECLARE(fspr_status_t) fspr_env_get(char **value, const char *envvar, - apr_pool_t *pool) + fspr_pool_t *pool) { #ifdef HAVE_GETENV @@ -45,9 +45,9 @@ APR_DECLARE(apr_status_t) apr_env_get(char **value, } -APR_DECLARE(apr_status_t) apr_env_set(const char *envvar, +APR_DECLARE(fspr_status_t) fspr_env_set(const char *envvar, const char *value, - apr_pool_t *pool) + fspr_pool_t *pool) { #if defined(HAVE_SETENV) @@ -57,9 +57,9 @@ APR_DECLARE(apr_status_t) apr_env_set(const char *envvar, #elif defined(HAVE_PUTENV) - apr_size_t elen = strlen(envvar); - apr_size_t vlen = strlen(value); - char *env = apr_palloc(pool, elen + vlen + 2); + fspr_size_t elen = strlen(envvar); + fspr_size_t vlen = strlen(value); + char *env = fspr_palloc(pool, elen + vlen + 2); char *p = env + elen; memcpy(env, envvar, elen); @@ -77,7 +77,7 @@ APR_DECLARE(apr_status_t) apr_env_set(const char *envvar, } -APR_DECLARE(apr_status_t) apr_env_delete(const char *envvar, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_env_delete(const char *envvar, fspr_pool_t *pool) { #ifdef HAVE_UNSETENV diff --git a/libs/apr/misc/unix/errorcodes.c b/libs/apr/misc/unix/errorcodes.c index e953d10927..3be0b25b93 100644 --- a/libs/apr/misc/unix/errorcodes.c +++ b/libs/apr/misc/unix/errorcodes.c @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "apr_arch_misc.h" -#include "apr_strings.h" -#include "apr_lib.h" -#include "apr_dso.h" +#include "fspr_arch_misc.h" +#include "fspr_strings.h" +#include "fspr_lib.h" +#include "fspr_dso.h" #if APR_HAVE_NETDB_H #include @@ -27,16 +27,16 @@ #endif /* - * stuffbuffer - like apr_cpystrn() but returns the address of the + * stuffbuffer - like fspr_cpystrn() but returns the address of the * dest buffer instead of the address of the terminating '\0' */ -static char *stuffbuffer(char *buf, apr_size_t bufsize, const char *s) +static char *stuffbuffer(char *buf, fspr_size_t bufsize, const char *s) { - apr_cpystrn(buf,s,bufsize); + fspr_cpystrn(buf,s,bufsize); return buf; } -static char *apr_error_string(apr_status_t statcode) +static char *fspr_error_string(fspr_status_t statcode) { switch (statcode) { case APR_ENOPOOL: @@ -141,9 +141,9 @@ static char *apr_error_string(apr_status_t statcode) #ifdef OS2 #include -int apr_canonical_error(apr_status_t err); +int fspr_canonical_error(fspr_status_t err); -static char *apr_os_strerror(char* buf, apr_size_t bufsize, int err) +static char *fspr_os_strerror(char* buf, fspr_size_t bufsize, int err) { char result[200]; unsigned char message[HUGE_STRING_LEN]; @@ -153,7 +153,7 @@ static char *apr_os_strerror(char* buf, apr_size_t bufsize, int err) if (err >= 10000 && err < 12000) { /* socket error codes */ return stuffbuffer(buf, bufsize, - strerror(apr_canonical_error(err+APR_OS_START_SYSERR))); + strerror(fspr_canonical_error(err+APR_OS_START_SYSERR))); } else if (DosGetMessage(NULL, 0, message, HUGE_STRING_LEN, err, "OSO001.MSG", &len) == 0) { @@ -166,9 +166,9 @@ static char *apr_os_strerror(char* buf, apr_size_t bufsize, int err) for (c=0; ccont = cont; (*os)->reset = 0; - (*os)->errfn = (apr_getopt_err_fn_t*)(fprintf); + (*os)->errfn = (fspr_getopt_err_fn_t*)(fprintf); (*os)->errarg = (void*)(stderr); (*os)->place = EMSG; @@ -55,7 +55,7 @@ APR_DECLARE(apr_status_t) apr_getopt_init(apr_getopt_t **os, apr_pool_t *cont, that's the primary purpose of this function. But people might want to use this function with arrays other than the main argv, and we shouldn't touch the caller's data. So we copy. */ - argv_buff = apr_palloc(cont, (argc + 1) * sizeof(const char *)); + argv_buff = fspr_palloc(cont, (argc + 1) * sizeof(const char *)); memcpy(argv_buff, argv, argc * sizeof(const char *)); (*os)->argv = argv_buff; (*os)->argv[argc] = NULL; @@ -68,7 +68,7 @@ APR_DECLARE(apr_status_t) apr_getopt_init(apr_getopt_t **os, apr_pool_t *cont, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, +APR_DECLARE(fspr_status_t) fspr_getopt(fspr_getopt_t *os, const char *opts, char *optch, const char **optarg) { const char *oli; /* option letter list index */ @@ -101,7 +101,7 @@ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, ++os->ind; if (os->errfn && *opts != ':') { (os->errfn)(os->errarg, "%s: illegal option -- %c\n", - apr_filepath_name_get(*os->argv), os->opt); + fspr_filepath_name_get(*os->argv), os->opt); } *optch = os->opt; return (APR_BADCH); @@ -123,7 +123,7 @@ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, if (os->errfn) { (os->errfn)(os->errarg, "%s: option requires an argument -- %c\n", - apr_filepath_name_get(*os->argv), os->opt); + fspr_filepath_name_get(*os->argv), os->opt); } *optch = os->opt; return (APR_BADCH); @@ -155,7 +155,7 @@ static void reverse(const char **argv, int start, int len) * non-option arguments, os->skip_end is where we stopped, and os->ind * is where we are now. */ -static void permute(apr_getopt_t *os) +static void permute(fspr_getopt_t *os) { int len1 = os->skip_end - os->skip_start; int len2 = os->ind - os->skip_end; @@ -178,27 +178,27 @@ static void permute(apr_getopt_t *os) } /* Helper function to print out an error involving a long option */ -static apr_status_t serr(apr_getopt_t *os, const char *err, const char *str, - apr_status_t status) +static fspr_status_t serr(fspr_getopt_t *os, const char *err, const char *str, + fspr_status_t status) { if (os->errfn) (os->errfn)(os->errarg, "%s: %s: %s\n", - apr_filepath_name_get(*os->argv), err, str); + fspr_filepath_name_get(*os->argv), err, str); return status; } /* Helper function to print out an error involving a short option */ -static apr_status_t cerr(apr_getopt_t *os, const char *err, int ch, - apr_status_t status) +static fspr_status_t cerr(fspr_getopt_t *os, const char *err, int ch, + fspr_status_t status) { if (os->errfn) (os->errfn)(os->errarg, "%s: %s: %c\n", - apr_filepath_name_get(*os->argv), err, ch); + fspr_filepath_name_get(*os->argv), err, ch); return status; } -APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os, - const apr_getopt_option_t *opts, +APR_DECLARE(fspr_status_t) fspr_getopt_long(fspr_getopt_t *os, + const fspr_getopt_option_t *opts, int *optch, const char **optarg) { const char *p; @@ -232,7 +232,7 @@ APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os, p = os->argv[os->ind++] + 1; if (*p == '-' && p[1] != '\0') { /* Long option */ /* Search for the long option name in the caller's table. */ - apr_size_t len = 0; + fspr_size_t len = 0; p++; for (i = 0; ; i++) { diff --git a/libs/apr/misc/unix/otherchild.c b/libs/apr/misc/unix/otherchild.c index c97cfdd644..147ff6b808 100644 --- a/libs/apr/misc/unix/otherchild.c +++ b/libs/apr/misc/unix/otherchild.c @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_arch_misc.h" -#include "apr_arch_threadproc.h" -#include "apr_arch_file_io.h" +#include "fspr.h" +#include "fspr_arch_misc.h" +#include "fspr_arch_threadproc.h" +#include "fspr_arch_file_io.h" #if APR_HAS_OTHER_CHILD @@ -34,11 +34,11 @@ #include /* for fd_set definition! */ #endif -static apr_other_child_rec_t *other_children = NULL; +static fspr_other_child_rec_t *other_children = NULL; -static apr_status_t other_child_cleanup(void *data) +static fspr_status_t other_child_cleanup(void *data) { - apr_other_child_rec_t **pocr, *nocr; + fspr_other_child_rec_t **pocr, *nocr; for (pocr = &other_children; *pocr; pocr = &(*pocr)->next) { if ((*pocr)->data == data) { @@ -52,24 +52,24 @@ static apr_status_t other_child_cleanup(void *data) return APR_SUCCESS; } -APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *proc, +APR_DECLARE(void) fspr_proc_other_child_register(fspr_proc_t *proc, void (*maintenance) (int reason, void *, int status), - void *data, apr_file_t *write_fd, apr_pool_t *p) + void *data, fspr_file_t *write_fd, fspr_pool_t *p) { - apr_other_child_rec_t *ocr; + fspr_other_child_rec_t *ocr; - ocr = apr_palloc(p, sizeof(*ocr)); + ocr = fspr_palloc(p, sizeof(*ocr)); ocr->p = p; ocr->proc = proc; ocr->maintenance = maintenance; ocr->data = data; if (write_fd == NULL) { - ocr->write_fd = (apr_os_file_t) -1; + ocr->write_fd = (fspr_os_file_t) -1; } else { #ifdef WIN32 - /* This should either go away as part of eliminating apr_proc_probe_writable_fds - * or write_fd should point to an apr_file_t + /* This should either go away as part of eliminating fspr_proc_probe_writable_fds + * or write_fd should point to an fspr_file_t */ ocr->write_fd = write_fd->filehand; #else @@ -79,13 +79,13 @@ APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *proc, } ocr->next = other_children; other_children = ocr; - apr_pool_cleanup_register(p, ocr->data, other_child_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register(p, ocr->data, other_child_cleanup, + fspr_pool_cleanup_null); } -APR_DECLARE(void) apr_proc_other_child_unregister(void *data) +APR_DECLARE(void) fspr_proc_other_child_unregister(void *data) { - apr_other_child_rec_t *cur; + fspr_other_child_rec_t *cur; cur = other_children; while (cur) { @@ -96,15 +96,15 @@ APR_DECLARE(void) apr_proc_other_child_unregister(void *data) } /* segfault if this function called with invalid parm */ - if (cur) apr_pool_cleanup_kill(cur->p, cur->data, other_child_cleanup); + if (cur) fspr_pool_cleanup_kill(cur->p, cur->data, other_child_cleanup); other_child_cleanup(data); } -APR_DECLARE(apr_status_t) apr_proc_other_child_alert(apr_proc_t *proc, +APR_DECLARE(fspr_status_t) fspr_proc_other_child_alert(fspr_proc_t *proc, int reason, int status) { - apr_other_child_rec_t *ocr, *nocr; + fspr_other_child_rec_t *ocr, *nocr; for (ocr = other_children; ocr; ocr = nocr) { nocr = ocr->next; @@ -118,7 +118,7 @@ APR_DECLARE(apr_status_t) apr_proc_other_child_alert(apr_proc_t *proc, return APR_EPROC_UNKNOWN; } -APR_DECLARE(void) apr_proc_other_child_refresh(apr_other_child_rec_t *ocr, +APR_DECLARE(void) fspr_proc_other_child_refresh(fspr_other_child_rec_t *ocr, int reason) { /* Todo: @@ -131,7 +131,7 @@ APR_DECLARE(void) apr_proc_other_child_refresh(apr_other_child_rec_t *ocr, return; if (!ocr->proc->hproc) { - /* Already mopped up, perhaps we apr_proc_kill'ed it, + /* Already mopped up, perhaps we fspr_proc_kill'ed it, * they should have already unregistered! */ ocr->proc = NULL; @@ -176,44 +176,44 @@ APR_DECLARE(void) apr_proc_other_child_refresh(apr_other_child_rec_t *ocr, #endif } -APR_DECLARE(void) apr_proc_other_child_refresh_all(int reason) +APR_DECLARE(void) fspr_proc_other_child_refresh_all(int reason) { - apr_other_child_rec_t *ocr, *next_ocr; + fspr_other_child_rec_t *ocr, *next_ocr; for (ocr = other_children; ocr; ocr = next_ocr) { next_ocr = ocr->next; - apr_proc_other_child_refresh(ocr, reason); + fspr_proc_other_child_refresh(ocr, reason); } } #else /* !APR_HAS_OTHER_CHILD */ -APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *proc, +APR_DECLARE(void) fspr_proc_other_child_register(fspr_proc_t *proc, void (*maintenance) (int reason, void *, int status), - void *data, apr_file_t *write_fd, apr_pool_t *p) + void *data, fspr_file_t *write_fd, fspr_pool_t *p) { return; } -APR_DECLARE(void) apr_proc_other_child_unregister(void *data) +APR_DECLARE(void) fspr_proc_other_child_unregister(void *data) { return; } -APR_DECLARE(apr_status_t) apr_proc_other_child_alert(apr_proc_t *proc, +APR_DECLARE(fspr_status_t) fspr_proc_other_child_alert(fspr_proc_t *proc, int reason, int status) { return APR_ENOTIMPL; } -APR_DECLARE(void) apr_proc_other_child_refresh(apr_other_child_rec_t *ocr, +APR_DECLARE(void) fspr_proc_other_child_refresh(fspr_other_child_rec_t *ocr, int reason) { return; } -APR_DECLARE(void) apr_proc_other_child_refresh_all(int reason) +APR_DECLARE(void) fspr_proc_other_child_refresh_all(int reason) { return; } diff --git a/libs/apr/misc/unix/rand.c b/libs/apr/misc/unix/rand.c index 7af77eb5af..d0b5cc1294 100644 --- a/libs/apr/misc/unix/rand.c +++ b/libs/apr/misc/unix/rand.c @@ -15,10 +15,10 @@ */ #define APR_WANT_MEMFUNC -#include "apr_want.h" -#include "apr_general.h" +#include "fspr_want.h" +#include "fspr_general.h" -#include "apr_arch_misc.h" +#include "fspr_arch_misc.h" #include #if APR_HAVE_SYS_TYPES_H #include @@ -51,7 +51,7 @@ #if defined(HAVE_UUID_CREATE) -APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data) +APR_DECLARE(fspr_status_t) fspr_os_uuid_get(unsigned char *uuid_data) { uint32_t rv; uuid_t g; @@ -68,7 +68,7 @@ APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data) #elif defined(HAVE_UUID_GENERATE) -APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data) +APR_DECLARE(fspr_status_t) fspr_os_uuid_get(unsigned char *uuid_data) { uuid_t g; @@ -84,8 +84,8 @@ APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data) #if APR_HAS_RANDOM -APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, - apr_size_t length) +APR_DECLARE(fspr_status_t) fspr_generate_random_bytes(unsigned char *buf, + fspr_size_t length) { #ifdef DEV_RANDOM @@ -95,7 +95,7 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, * gives EOF, so reading 'length' bytes may require opening the * device several times. */ do { - apr_ssize_t rc; + fspr_ssize_t rc; if (fd == -1) if ((fd = open(DEV_RANDOM, O_RDONLY)) == -1) @@ -145,8 +145,8 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, int egd_socket, egd_path_len, rv, bad_errno; struct sockaddr_un addr; - apr_socklen_t egd_addr_len; - apr_size_t resp_expected; + fspr_socklen_t egd_addr_len; + fspr_size_t resp_expected; unsigned char req[2], resp[255]; unsigned char *curbuf = buf; @@ -178,7 +178,7 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf, /* EGD can only return 255 bytes of data at a time. Silly. */ while (length > 0) { - apr_ssize_t srv; + fspr_ssize_t srv; req[0] = 2; /* We'll block for now. */ req[1] = length > 255 ? 255: length; diff --git a/libs/apr/misc/unix/start.c b/libs/apr/misc/unix/start.c index 4b8ad990de..b7b239587c 100644 --- a/libs/apr/misc/unix/start.c +++ b/libs/apr/misc/unix/start.c @@ -14,17 +14,17 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_signal.h" -#include "apr_atomic.h" +#include "fspr.h" +#include "fspr_general.h" +#include "fspr_pools.h" +#include "fspr_signal.h" +#include "fspr_atomic.h" -#include "apr_arch_proc_mutex.h" /* for apr_proc_mutex_unix_setup_lock() */ -#include "apr_arch_internal_time.h" +#include "fspr_arch_proc_mutex.h" /* for fspr_proc_mutex_unix_setup_lock() */ +#include "fspr_arch_internal_time.h" -APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, +APR_DECLARE(fspr_status_t) fspr_app_initialize(int *argc, const char * const * *argv, const char * const * *env) { @@ -33,57 +33,57 @@ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, * control manager into the process, and it's required to fix the char* * data passed in from win32 unicode into utf-8, win32's apr internal fmt. */ - return apr_initialize(); + return fspr_initialize(); } static int initialized = 0; -APR_DECLARE(apr_status_t) apr_initialize(void) +APR_DECLARE(fspr_status_t) fspr_initialize(void) { - apr_pool_t *pool; - apr_status_t status; + fspr_pool_t *pool; + fspr_status_t status; if (initialized++) { return APR_SUCCESS; } #if !defined(BEOS) && !defined(OS2) - apr_proc_mutex_unix_setup_lock(); - apr_unix_setup_time(); + fspr_proc_mutex_unix_setup_lock(); + fspr_unix_setup_time(); #endif - if ((status = apr_pool_initialize()) != APR_SUCCESS) + if ((status = fspr_pool_initialize()) != APR_SUCCESS) return status; - if (apr_pool_create(&pool, NULL) != APR_SUCCESS) { + if (fspr_pool_create(&pool, NULL) != APR_SUCCESS) { return APR_ENOPOOL; } - apr_pool_tag(pool, "apr_initialize"); + fspr_pool_tag(pool, "fspr_initialize"); - /* apr_atomic_init() used to be called from here aswell. + /* fspr_atomic_init() used to be called from here aswell. * Pools rely on mutexes though, which can be backed by * atomics. Due to this circular dependency - * apr_pool_initialize() is taking care of calling - * apr_atomic_init() at the correct time. + * fspr_pool_initialize() is taking care of calling + * fspr_atomic_init() at the correct time. */ - apr_signal_init(pool); + fspr_signal_init(pool); return APR_SUCCESS; } -APR_DECLARE_NONSTD(void) apr_terminate(void) +APR_DECLARE_NONSTD(void) fspr_terminate(void) { initialized--; if (initialized) { return; } - apr_pool_terminate(); + fspr_pool_terminate(); } -APR_DECLARE(void) apr_terminate2(void) +APR_DECLARE(void) fspr_terminate2(void) { - apr_terminate(); + fspr_terminate(); } diff --git a/libs/apr/misc/unix/version.c b/libs/apr/misc/unix/version.c index 2f111bf9dc..39fb71c5b3 100644 --- a/libs/apr/misc/unix/version.c +++ b/libs/apr/misc/unix/version.c @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "apr_version.h" -#include "apr_general.h" /* for APR_STRINGIFY */ +#include "fspr_version.h" +#include "fspr_general.h" /* for APR_STRINGIFY */ -APR_DECLARE(void) apr_version(apr_version_t *pvsn) +APR_DECLARE(void) fspr_version(fspr_version_t *pvsn) { pvsn->major = APR_MAJOR_VERSION; pvsn->minor = APR_MINOR_VERSION; @@ -29,7 +29,7 @@ APR_DECLARE(void) apr_version(apr_version_t *pvsn) #endif } -APR_DECLARE(const char *) apr_version_string(void) +APR_DECLARE(const char *) fspr_version_string(void) { return APR_VERSION_STRING; } diff --git a/libs/apr/misc/win32/charset.c b/libs/apr/misc/win32/charset.c index d54d6e645c..041b60bd09 100644 --- a/libs/apr/misc/win32/charset.c +++ b/libs/apr/misc/win32/charset.c @@ -14,22 +14,22 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_strings.h" -#include "apr_portable.h" +#include "fspr.h" +#include "fspr_strings.h" +#include "fspr_portable.h" -APR_DECLARE(const char*) apr_os_default_encoding (apr_pool_t *pool) +APR_DECLARE(const char*) fspr_os_default_encoding (fspr_pool_t *pool) { - return apr_psprintf(pool, "CP%u", (unsigned) GetACP()); + return fspr_psprintf(pool, "CP%u", (unsigned) GetACP()); } -APR_DECLARE(const char*) apr_os_locale_encoding (apr_pool_t *pool) +APR_DECLARE(const char*) fspr_os_locale_encoding (fspr_pool_t *pool) { LCID locale = GetThreadLocale(); int len = GetLocaleInfo(locale, LOCALE_IDEFAULTANSICODEPAGE, NULL, 0); - char *cp = apr_palloc(pool, len + 2); + char *cp = fspr_palloc(pool, len + 2); if (0 < GetLocaleInfo(locale, LOCALE_IDEFAULTANSICODEPAGE, cp + 2, len)) { /* Fix up the returned number to make a valid codepage name of @@ -39,5 +39,5 @@ APR_DECLARE(const char*) apr_os_locale_encoding (apr_pool_t *pool) return cp; } - return apr_os_default_encoding(pool); + return fspr_os_default_encoding(pool); } diff --git a/libs/apr/misc/win32/env.c b/libs/apr/misc/win32/env.c index e99ff8d476..7b174bba1d 100644 --- a/libs/apr/misc/win32/env.c +++ b/libs/apr/misc/win32/env.c @@ -15,26 +15,26 @@ */ #define APR_WANT_STRFUNC -#include "apr_want.h" -#include "apr.h" -#include "apr_arch_misc.h" -#include "apr_arch_utf8.h" -#include "apr_env.h" -#include "apr_errno.h" -#include "apr_pools.h" -#include "apr_strings.h" +#include "fspr_want.h" +#include "fspr.h" +#include "fspr_arch_misc.h" +#include "fspr_arch_utf8.h" +#include "fspr_env.h" +#include "fspr_errno.h" +#include "fspr_pools.h" +#include "fspr_strings.h" #if APR_HAS_UNICODE_FS -static apr_status_t widen_envvar_name (apr_wchar_t *buffer, - apr_size_t bufflen, +static fspr_status_t widen_envvar_name (fspr_wchar_t *buffer, + fspr_size_t bufflen, const char *envvar) { - apr_size_t inchars; - apr_status_t status; + fspr_size_t inchars; + fspr_status_t status; inchars = strlen(envvar) + 1; - status = apr_conv_utf8_to_ucs2(envvar, &inchars, buffer, &bufflen); + status = fspr_conv_utf8_to_ucs2(envvar, &inchars, buffer, &bufflen); if (status == APR_INCOMPLETE) status = APR_ENAMETOOLONG; @@ -43,9 +43,9 @@ static apr_status_t widen_envvar_name (apr_wchar_t *buffer, #endif -APR_DECLARE(apr_status_t) apr_env_get(char **value, +APR_DECLARE(fspr_status_t) fspr_env_get(char **value, const char *envvar, - apr_pool_t *pool) + fspr_pool_t *pool) { char *val = NULL; DWORD size; @@ -53,10 +53,10 @@ APR_DECLARE(apr_status_t) apr_env_get(char **value, #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { - apr_wchar_t wenvvar[APR_PATH_MAX]; - apr_size_t inchars, outchars; - apr_wchar_t *wvalue, dummy; - apr_status_t status; + fspr_wchar_t wenvvar[APR_PATH_MAX]; + fspr_size_t inchars, outchars; + fspr_wchar_t *wvalue, dummy; + fspr_status_t status; status = widen_envvar_name(wenvvar, APR_PATH_MAX, envvar); if (status) @@ -70,11 +70,11 @@ APR_DECLARE(apr_status_t) apr_env_get(char **value, if (size == 0) { /* The environment value exists, but is zero-length. */ - *value = apr_pstrdup(pool, ""); + *value = fspr_pstrdup(pool, ""); return APR_SUCCESS; } - wvalue = apr_palloc(pool, size * sizeof(*wvalue)); + wvalue = fspr_palloc(pool, size * sizeof(*wvalue)); size = GetEnvironmentVariableW(wenvvar, wvalue, size); if (size == 0) /* Mid-air collision?. Somebody must've changed the env. var. */ @@ -82,8 +82,8 @@ APR_DECLARE(apr_status_t) apr_env_get(char **value, inchars = wcslen(wvalue) + 1; outchars = 3 * inchars; /* Enougn for any UTF-8 representation */ - val = apr_palloc(pool, outchars); - status = apr_conv_ucs2_to_utf8(wvalue, &inchars, val, &outchars); + val = fspr_palloc(pool, outchars); + status = fspr_conv_ucs2_to_utf8(wvalue, &inchars, val, &outchars); if (status) return status; } @@ -101,11 +101,11 @@ APR_DECLARE(apr_status_t) apr_env_get(char **value, if (size == 0) { /* The environment value exists, but is zero-length. */ - *value = apr_pstrdup(pool, ""); + *value = fspr_pstrdup(pool, ""); return APR_SUCCESS; } - val = apr_palloc(pool, size); + val = fspr_palloc(pool, size); size = GetEnvironmentVariableA(envvar, val, size); if (size == 0) /* Mid-air collision?. Somebody must've changed the env. var. */ @@ -118,37 +118,37 @@ APR_DECLARE(apr_status_t) apr_env_get(char **value, } -APR_DECLARE(apr_status_t) apr_env_set(const char *envvar, +APR_DECLARE(fspr_status_t) fspr_env_set(const char *envvar, const char *value, - apr_pool_t *pool) + fspr_pool_t *pool) { #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { - apr_wchar_t wenvvar[APR_PATH_MAX]; - apr_wchar_t *wvalue; - apr_size_t inchars, outchars; - apr_status_t status; + fspr_wchar_t wenvvar[APR_PATH_MAX]; + fspr_wchar_t *wvalue; + fspr_size_t inchars, outchars; + fspr_status_t status; status = widen_envvar_name(wenvvar, APR_PATH_MAX, envvar); if (status) return status; outchars = inchars = strlen(value) + 1; - wvalue = apr_palloc(pool, outchars * sizeof(*wvalue)); - status = apr_conv_utf8_to_ucs2(value, &inchars, wvalue, &outchars); + wvalue = fspr_palloc(pool, outchars * sizeof(*wvalue)); + status = fspr_conv_utf8_to_ucs2(value, &inchars, wvalue, &outchars); if (status) return status; if (!SetEnvironmentVariableW(wenvvar, wvalue)) - return apr_get_os_error(); + return fspr_get_os_error(); } #endif #if APR_HAS_ANSI_FS ELSE_WIN_OS_IS_ANSI { if (!SetEnvironmentVariableA(envvar, value)) - return apr_get_os_error(); + return fspr_get_os_error(); } #endif @@ -156,27 +156,27 @@ APR_DECLARE(apr_status_t) apr_env_set(const char *envvar, } -APR_DECLARE(apr_status_t) apr_env_delete(const char *envvar, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_env_delete(const char *envvar, fspr_pool_t *pool) { #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { - apr_wchar_t wenvvar[APR_PATH_MAX]; - apr_status_t status; + fspr_wchar_t wenvvar[APR_PATH_MAX]; + fspr_status_t status; status = widen_envvar_name(wenvvar, APR_PATH_MAX, envvar); if (status) return status; if (!SetEnvironmentVariableW(wenvvar, NULL)) - return apr_get_os_error(); + return fspr_get_os_error(); } #endif #if APR_HAS_ANSI_FS ELSE_WIN_OS_IS_ANSI { if (!SetEnvironmentVariableA(envvar, NULL)) - return apr_get_os_error(); + return fspr_get_os_error(); } #endif diff --git a/libs/apr/misc/win32/apr_app.c b/libs/apr/misc/win32/fspr_app.c similarity index 90% rename from libs/apr/misc/win32/apr_app.c rename to libs/apr/misc/win32/fspr_app.c index baac96e811..d6b580c007 100644 --- a/libs/apr/misc/win32/apr_app.c +++ b/libs/apr/misc/win32/fspr_app.c @@ -24,7 +24,7 @@ * * This module is only compatible with Unicode-only executables. * Mixed (Win9x backwards compatible) binaries should refer instead - * to the apr_startup.c module. + * to the fspr_startup.c module. * * _dbg_malloc/realloc is used in place of the usual API, in order * to convince the MSVCRT that they created these entities. If we @@ -33,14 +33,14 @@ * since we are single threaded [so far]. */ -#include "apr_general.h" +#include "fspr_general.h" #include "ShellAPI.h" #include "crtdbg.h" #include "wchar.h" -#include "apr_arch_file_io.h" +#include "fspr_arch_file_io.h" #include "assert.h" -#include "apr_private.h" -#include "apr_arch_misc.h" +#include "fspr_private.h" +#include "fspr_arch_misc.h" /* This symbol is _private_, although it must be exported. */ @@ -53,9 +53,9 @@ int wmain(int argc, const wchar_t **wargv, const wchar_t **wenv) char **env; int dupenv; - (void)apr_wastrtoastr(&argv, wargv, argc); + (void)fspr_wastrtoastr(&argv, wargv, argc); - dupenv = apr_wastrtoastr(&env, wenv, -1); + dupenv = fspr_wastrtoastr(&env, wenv, -1); _environ = _malloc_dbg((dupenv + 1) * sizeof (char *), _CRT_BLOCK, __FILE__, __LINE__ ); @@ -74,7 +74,7 @@ int wmain(int argc, const wchar_t **wargv, const wchar_t **wenv) free((wchar_t **)wenv); } - apr_app_init_complete = 1; + fspr_app_init_complete = 1; return main(argc, argv, env); } diff --git a/libs/apr/misc/win32/internal.c b/libs/apr/misc/win32/internal.c index b045bd4258..22c9122a65 100644 --- a/libs/apr/misc/win32/internal.c +++ b/libs/apr/misc/win32/internal.c @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "apr_private.h" +#include "fspr_private.h" -#include "apr_arch_misc.h" -#include "apr_arch_file_io.h" +#include "fspr_arch_misc.h" +#include "fspr_arch_file_io.h" #include #include @@ -30,7 +30,7 @@ */ -/* Shared by apr_app.c and start.c +/* Shared by fspr_app.c and start.c * * An internal apr function to convert an array of strings (either * a counted or NULL terminated list, such as an argv[argc] or env[] @@ -38,10 +38,10 @@ * These are allocated from the MSVCRT's _CRT_BLOCK to trick the system * into trusting our store. */ -int apr_wastrtoastr(char const * const * *retarr, +int fspr_wastrtoastr(char const * const * *retarr, wchar_t const * const *arr, int args) { - apr_size_t elesize = 0; + fspr_size_t elesize = 0; char **newarr; char *elements; char *ele; @@ -57,7 +57,7 @@ int apr_wastrtoastr(char const * const * *retarr, for (arg = 0; arg < args; ++arg) { newarr[arg] = (void*)(wcslen(arr[arg]) + 1); - elesize += (apr_size_t)newarr[arg]; + elesize += (fspr_size_t)newarr[arg]; } /* This is a safe max allocation, we will realloc after @@ -70,11 +70,11 @@ int apr_wastrtoastr(char const * const * *retarr, _CRT_BLOCK, __FILE__, __LINE__); for (arg = 0; arg < args; ++arg) { - apr_size_t len = (apr_size_t)newarr[arg]; - apr_size_t newlen = elesize; + fspr_size_t len = (fspr_size_t)newarr[arg]; + fspr_size_t newlen = elesize; newarr[arg] = ele; - (void)apr_conv_ucs2_to_utf8(arr[arg], &len, + (void)fspr_conv_ucs2_to_utf8(arr[arg], &len, newarr[arg], &elesize); newlen -= elesize; @@ -91,7 +91,7 @@ int apr_wastrtoastr(char const * const * *retarr, _CRT_BLOCK, __FILE__, __LINE__); if (ele != elements) { - apr_size_t diff = ele - elements; + fspr_size_t diff = ele - elements; for (arg = 0; arg < args; ++arg) { newarr[arg] += diff; } diff --git a/libs/apr/misc/win32/misc.c b/libs/apr/misc/win32/misc.c index 9975eef613..ad7bfdfbcb 100644 --- a/libs/apr/misc/win32/misc.c +++ b/libs/apr/misc/win32/misc.c @@ -14,18 +14,18 @@ * limitations under the License. */ -#include "apr_private.h" -#include "apr_arch_misc.h" +#include "fspr_private.h" +#include "fspr_arch_misc.h" #include "crtdbg.h" -#include "apr_arch_file_io.h" +#include "fspr_arch_file_io.h" #include "assert.h" -#include "apr_lib.h" +#include "fspr_lib.h" -APR_DECLARE_DATA apr_oslevel_e apr_os_level = APR_WIN_UNK; +APR_DECLARE_DATA fspr_oslevel_e fspr_os_level = APR_WIN_UNK; -apr_status_t apr_get_oslevel(apr_oslevel_e *level) +fspr_status_t fspr_get_oslevel(fspr_oslevel_e *level) { - if (apr_os_level == APR_WIN_UNK) + if (fspr_os_level == APR_WIN_UNK) { static OSVERSIONINFO oslev; oslev.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); @@ -36,7 +36,7 @@ apr_status_t apr_get_oslevel(apr_oslevel_e *level) static unsigned int servpack = 0; char *pservpack; if (pservpack = oslev.szCSDVersion) { - while (*pservpack && !apr_isdigit(*pservpack)) { + while (*pservpack && !fspr_isdigit(*pservpack)) { pservpack++; } if (*pservpack) @@ -44,63 +44,63 @@ apr_status_t apr_get_oslevel(apr_oslevel_e *level) } if (oslev.dwMajorVersion < 3) { - apr_os_level = APR_WIN_UNSUP; + fspr_os_level = APR_WIN_UNSUP; } else if (oslev.dwMajorVersion == 3) { if (oslev.dwMajorVersion < 50) { - apr_os_level = APR_WIN_UNSUP; + fspr_os_level = APR_WIN_UNSUP; } else if (oslev.dwMajorVersion == 50) { - apr_os_level = APR_WIN_NT_3_5; + fspr_os_level = APR_WIN_NT_3_5; } else { - apr_os_level = APR_WIN_NT_3_51; + fspr_os_level = APR_WIN_NT_3_51; } } else if (oslev.dwMajorVersion == 4) { if (servpack < 2) - apr_os_level = APR_WIN_NT_4; + fspr_os_level = APR_WIN_NT_4; else if (servpack <= 2) - apr_os_level = APR_WIN_NT_4_SP2; + fspr_os_level = APR_WIN_NT_4_SP2; else if (servpack <= 3) - apr_os_level = APR_WIN_NT_4_SP3; + fspr_os_level = APR_WIN_NT_4_SP3; else if (servpack <= 4) - apr_os_level = APR_WIN_NT_4_SP4; + fspr_os_level = APR_WIN_NT_4_SP4; else if (servpack <= 5) - apr_os_level = APR_WIN_NT_4_SP5; + fspr_os_level = APR_WIN_NT_4_SP5; else - apr_os_level = APR_WIN_NT_4_SP6; + fspr_os_level = APR_WIN_NT_4_SP6; } else if (oslev.dwMajorVersion == 5) { if (oslev.dwMinorVersion == 0) { if (servpack == 0) - apr_os_level = APR_WIN_2000; + fspr_os_level = APR_WIN_2000; else if (servpack == 1) - apr_os_level = APR_WIN_2000_SP1; + fspr_os_level = APR_WIN_2000_SP1; else - apr_os_level = APR_WIN_2000_SP2; + fspr_os_level = APR_WIN_2000_SP2; } else if (oslev.dwMinorVersion == 2) { - apr_os_level = APR_WIN_2003; + fspr_os_level = APR_WIN_2003; } else { if (servpack < 1) - apr_os_level = APR_WIN_XP; + fspr_os_level = APR_WIN_XP; else if (servpack == 1) - apr_os_level = APR_WIN_XP_SP1; + fspr_os_level = APR_WIN_XP_SP1; else - apr_os_level = APR_WIN_XP_SP2; + fspr_os_level = APR_WIN_XP_SP2; } } else { - apr_os_level = APR_WIN_XP; + fspr_os_level = APR_WIN_XP; } } #ifndef WINNT else if (oslev.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) { char *prevision; if (prevision = oslev.szCSDVersion) { - while (*prevision && !apr_isupper(*prevision)) { + while (*prevision && !fspr_isupper(*prevision)) { prevision++; } } @@ -108,18 +108,18 @@ apr_status_t apr_get_oslevel(apr_oslevel_e *level) if (oslev.dwMinorVersion < 10) { if (*prevision < 'C') - apr_os_level = APR_WIN_95; + fspr_os_level = APR_WIN_95; else - apr_os_level = APR_WIN_95_OSR2; + fspr_os_level = APR_WIN_95_OSR2; } else if (oslev.dwMinorVersion < 90) { if (*prevision < 'A') - apr_os_level = APR_WIN_98; + fspr_os_level = APR_WIN_98; else - apr_os_level = APR_WIN_98_SE; + fspr_os_level = APR_WIN_98_SE; } else { - apr_os_level = APR_WIN_ME; + fspr_os_level = APR_WIN_ME; } } #endif @@ -127,21 +127,21 @@ apr_status_t apr_get_oslevel(apr_oslevel_e *level) else if (oslev.dwPlatformId == VER_PLATFORM_WIN32_CE) { if (oslev.dwMajorVersion < 3) { - apr_os_level = APR_WIN_UNSUP; + fspr_os_level = APR_WIN_UNSUP; } else { - apr_os_level = APR_WIN_CE_3; + fspr_os_level = APR_WIN_CE_3; } } #endif else { - apr_os_level = APR_WIN_UNSUP; + fspr_os_level = APR_WIN_UNSUP; } } - *level = apr_os_level; + *level = fspr_os_level; - if (apr_os_level < APR_WIN_UNSUP) { + if (fspr_os_level < APR_WIN_UNSUP) { return APR_EGENERAL; } @@ -158,7 +158,7 @@ static const char* const lateDllName[DLL_defined] = { static HMODULE lateDllHandle[DLL_defined] = { NULL, NULL, NULL, NULL, NULL, NULL }; -FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char* fnName, int ordinal) +FARPROC fspr_load_dll_func(fspr_dlltoken_e fnLib, char* fnName, int ordinal) { if (!lateDllHandle[fnLib]) { lateDllHandle[fnLib] = LoadLibrary(lateDllName[fnLib]); @@ -171,9 +171,9 @@ FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char* fnName, int ordinal) return GetProcAddress(lateDllHandle[fnLib], fnName); } -/* Declared in include/arch/win32/apr_dbg_win32_handles.h +/* Declared in include/arch/win32/fspr_dbg_win32_handles.h */ -APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, +APR_DECLARE_NONSTD(HANDLE) fspr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, int nh, /* HANDLE hv, char *dsc */...) { static DWORD tlsid = 0xFFFFFFFF; diff --git a/libs/apr/misc/win32/rand.c b/libs/apr/misc/win32/rand.c index fb50fb9b32..130c87b85b 100644 --- a/libs/apr/misc/win32/rand.c +++ b/libs/apr/misc/win32/rand.c @@ -14,42 +14,42 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_portable.h" -#include "apr_arch_misc.h" +#include "fspr.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_portable.h" +#include "fspr_arch_misc.h" #include -APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf, - apr_size_t length) +APR_DECLARE(fspr_status_t) fspr_generate_random_bytes(unsigned char * buf, + fspr_size_t length) { HCRYPTPROV hProv; - apr_status_t res = APR_SUCCESS; + fspr_status_t res = APR_SUCCESS; /* 0x40 bit = CRYPT_SILENT, only introduced in more recent PSDKs * and will only work for Win2K and later. */ DWORD flags = CRYPT_VERIFYCONTEXT - | ((apr_os_level >= APR_WIN_2000) ? 0x40 : 0); + | ((fspr_os_level >= APR_WIN_2000) ? 0x40 : 0); if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, flags)) { - return apr_get_os_error(); + return fspr_get_os_error(); } /* XXX: An ugly hack for Win64, randomness is such that noone should * ever expect > 2^31 bytes of data at once without the prng * coming to a complete halt. */ if (!CryptGenRandom(hProv, (DWORD)length, buf)) { - res = apr_get_os_error(); + res = fspr_get_os_error(); } CryptReleaseContext(hProv, 0); return res; } -APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data) +APR_DECLARE(fspr_status_t) fspr_os_uuid_get(unsigned char *uuid_data) { /* Note: this call doesn't actually require CoInitialize() first * @@ -59,7 +59,7 @@ APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data) * be appropriate in all cases. * * Note that Win2000, XP and later no longer suffer from this problem, - * a scrambling fix is only needed for (apr_os_level < APR_WIN_2000) + * a scrambling fix is only needed for (fspr_os_level < APR_WIN_2000) */ if (FAILED(UuidCreate((UUID *)uuid_data))) { return APR_EGENERAL; diff --git a/libs/apr/misc/win32/start.c b/libs/apr/misc/win32/start.c index f51b749d2c..4a87e23c1e 100644 --- a/libs/apr/misc/win32/start.c +++ b/libs/apr/misc/win32/start.c @@ -14,23 +14,23 @@ * limitations under the License. */ -#include "apr_private.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_signal.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_pools.h" +#include "fspr_signal.h" #include "ShellAPI.h" -#include "apr_arch_misc.h" /* for WSAHighByte / WSALowByte */ +#include "fspr_arch_misc.h" /* for WSAHighByte / WSALowByte */ #include "wchar.h" -#include "apr_arch_file_io.h" +#include "fspr_arch_file_io.h" #include "crtdbg.h" #include "assert.h" /* This symbol is _private_, although it must be exported. */ -int APR_DECLARE_DATA apr_app_init_complete = 0; +int APR_DECLARE_DATA fspr_app_init_complete = 0; -/* Used by apr_app_initialize to reprocess the environment +/* Used by fspr_app_initialize to reprocess the environment * * An internal apr function to convert a double-null terminated set * of single-null terminated strings from wide Unicode to narrow utf-8 @@ -40,10 +40,10 @@ int APR_DECLARE_DATA apr_app_init_complete = 0; static int warrsztoastr(const char * const * *retarr, const wchar_t * arrsz, int args) { - const apr_wchar_t *wch; - apr_size_t totlen; - apr_size_t newlen; - apr_size_t wsize; + const fspr_wchar_t *wch; + fspr_size_t totlen; + fspr_size_t newlen; + fspr_size_t wsize; char **newarr; int arg; @@ -66,7 +66,7 @@ static int warrsztoastr(const char * const * *retarr, newarr[0] = _malloc_dbg(newlen * sizeof(char), _CRT_BLOCK, __FILE__, __LINE__); - (void)apr_conv_ucs2_to_utf8(arrsz, &wsize, + (void)fspr_conv_ucs2_to_utf8(arrsz, &wsize, newarr[0], &newlen); assert(newlen && !wsize); @@ -91,11 +91,11 @@ static int warrsztoastr(const char * const * *retarr, /* Reprocess the arguments to main() for a completely apr-ized application */ -APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, +APR_DECLARE(fspr_status_t) fspr_app_initialize(int *argc, const char * const * *argv, const char * const * *env) { - apr_status_t rv = apr_initialize(); + fspr_status_t rv = fspr_initialize(); if (rv != APR_SUCCESS) { return rv; @@ -104,22 +104,22 @@ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { - apr_wchar_t **wstrs; - apr_wchar_t *sysstr; + fspr_wchar_t **wstrs; + fspr_wchar_t *sysstr; int wstrc; int dupenv; - if (apr_app_init_complete) { + if (fspr_app_init_complete) { return rv; } - apr_app_init_complete = 1; + fspr_app_init_complete = 1; sysstr = GetCommandLineW(); if (sysstr) { wstrs = CommandLineToArgvW(sysstr, &wstrc); if (wstrs) { - *argc = apr_wastrtoastr(argv, wstrs, wstrc); + *argc = fspr_wastrtoastr(argv, wstrs, wstrc); GlobalFree(wstrs); } } @@ -145,7 +145,7 @@ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, * Reset _wenviron for good measure. */ if (_wenviron) { - apr_wchar_t **wenv = _wenviron; + fspr_wchar_t **wenv = _wenviron; _wenviron = NULL; free(wenv); } @@ -158,35 +158,35 @@ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, static int initialized = 0; /* Provide to win32/thread.c */ -extern DWORD tls_apr_thread; +extern DWORD tls_fspr_thread; -APR_DECLARE(apr_status_t) apr_initialize(void) +APR_DECLARE(fspr_status_t) fspr_initialize(void) { - apr_pool_t *pool; - apr_status_t status; + fspr_pool_t *pool; + fspr_status_t status; int iVersionRequested; WSADATA wsaData; int err; - apr_oslevel_e osver; + fspr_oslevel_e osver; if (initialized++) { return APR_SUCCESS; } - /* Initialize apr_os_level global */ - if (apr_get_oslevel(&osver) != APR_SUCCESS) { + /* Initialize fspr_os_level global */ + if (fspr_get_oslevel(&osver) != APR_SUCCESS) { return APR_EEXIST; } - tls_apr_thread = TlsAlloc(); - if ((status = apr_pool_initialize()) != APR_SUCCESS) + tls_fspr_thread = TlsAlloc(); + if ((status = fspr_pool_initialize()) != APR_SUCCESS) return status; - if (apr_pool_create(&pool, NULL) != APR_SUCCESS) { + if (fspr_pool_create(&pool, NULL) != APR_SUCCESS) { return APR_ENOPOOL; } - apr_pool_tag(pool, "apr_initialize"); + fspr_pool_tag(pool, "fspr_initialize"); iVersionRequested = MAKEWORD(WSAHighByte, WSALowByte); err = WSAStartup((WORD) iVersionRequested, &wsaData); @@ -199,25 +199,25 @@ APR_DECLARE(apr_status_t) apr_initialize(void) return APR_EEXIST; } - apr_signal_init(pool); + fspr_signal_init(pool); return APR_SUCCESS; } -APR_DECLARE_NONSTD(void) apr_terminate(void) +APR_DECLARE_NONSTD(void) fspr_terminate(void) { initialized--; if (initialized) { return; } - apr_pool_terminate(); + fspr_pool_terminate(); WSACleanup(); - TlsFree(tls_apr_thread); + TlsFree(tls_fspr_thread); } -APR_DECLARE(void) apr_terminate2(void) +APR_DECLARE(void) fspr_terminate2(void) { - apr_terminate(); + fspr_terminate(); } diff --git a/libs/apr/misc/win32/utf8.c b/libs/apr/misc/win32/utf8.c index b37dba44da..57167235c4 100644 --- a/libs/apr/misc/win32/utf8.c +++ b/libs/apr/misc/win32/utf8.c @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_private.h" -#include "apr_errno.h" -#include "apr_arch_utf8.h" +#include "fspr.h" +#include "fspr_private.h" +#include "fspr_errno.h" +#include "fspr_arch_utf8.h" /* Implement the design principal specified by RFC 2718 2.2.5 * Guidelines for new URL Schemes - within the APR. @@ -58,18 +58,18 @@ * W1 = 110110yyyyyyyyyy * W2 = 110111xxxxxxxxxx * - * apr_conv_utf8_to_ucs2 out bytes:sizeof(in) * 1 <= Req <= sizeof(in) * 2 + * fspr_conv_utf8_to_ucs2 out bytes:sizeof(in) * 1 <= Req <= sizeof(in) * 2 * - * apr_conv_ucs2_to_utf8 out words:sizeof(in) / 2 <= Req <= sizeof(in) * 3 / 2 + * fspr_conv_ucs2_to_utf8 out words:sizeof(in) / 2 <= Req <= sizeof(in) * 3 / 2 */ -APR_DECLARE(apr_status_t) apr_conv_utf8_to_ucs2(const char *in, - apr_size_t *inbytes, - apr_wchar_t *out, - apr_size_t *outwords) +APR_DECLARE(fspr_status_t) fspr_conv_utf8_to_ucs2(const char *in, + fspr_size_t *inbytes, + fspr_wchar_t *out, + fspr_size_t *outwords) { - apr_int64_t newch, mask; - apr_size_t expect, eating; + fspr_int64_t newch, mask; + fspr_size_t expect, eating; int ch; while (*inbytes && *outwords) @@ -138,7 +138,7 @@ APR_DECLARE(apr_status_t) apr_conv_utf8_to_ucs2(const char *in, /* Where the boolean (expect > 2) is true, we will need * an extra word for the output. */ - if (*outwords < (apr_size_t)(expect > 2) + 1) + if (*outwords < (fspr_size_t)(expect > 2) + 1) break; /* buffer full */ while (expect--) { @@ -156,14 +156,14 @@ APR_DECLARE(apr_status_t) apr_conv_utf8_to_ucs2(const char *in, if (newch < 0x10000) { --*outwords; - *(out++) = (apr_wchar_t) newch; + *(out++) = (fspr_wchar_t) newch; } else { *outwords -= 2; newch -= 0x10000; - *(out++) = (apr_wchar_t) (0xD800 | (newch >> 10)); - *(out++) = (apr_wchar_t) (0xDC00 | (newch & 0x03FF)); + *(out++) = (fspr_wchar_t) (0xD800 | (newch >> 10)); + *(out++) = (fspr_wchar_t) (0xDC00 | (newch & 0x03FF)); } } } @@ -174,13 +174,13 @@ APR_DECLARE(apr_status_t) apr_conv_utf8_to_ucs2(const char *in, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_conv_ucs2_to_utf8(const apr_wchar_t *in, - apr_size_t *inwords, +APR_DECLARE(fspr_status_t) fspr_conv_ucs2_to_utf8(const fspr_wchar_t *in, + fspr_size_t *inwords, char *out, - apr_size_t *outbytes) + fspr_size_t *outbytes) { - apr_int64_t newch, require; - apr_size_t need; + fspr_int64_t newch, require; + fspr_size_t need; char *invout; int ch; diff --git a/libs/apr/mmap/unix/common.c b/libs/apr/mmap/unix/common.c index a978992880..a9b0b4c2f6 100644 --- a/libs/apr/mmap/unix/common.c +++ b/libs/apr/mmap/unix/common.c @@ -23,15 +23,15 @@ * */ -#include "apr.h" -#include "apr_private.h" -#include "apr_mmap.h" -#include "apr_errno.h" +#include "fspr.h" +#include "fspr_private.h" +#include "fspr_mmap.h" +#include "fspr_errno.h" #if APR_HAS_MMAP || defined(BEOS) -APR_DECLARE(apr_status_t) apr_mmap_offset(void **addr, apr_mmap_t *mmap, - apr_off_t offset) +APR_DECLARE(fspr_status_t) fspr_mmap_offset(void **addr, fspr_mmap_t *mmap, + fspr_off_t offset) { if (offset < 0 || offset > mmap->size) return APR_EINVAL; diff --git a/libs/apr/mmap/unix/mmap.c b/libs/apr/mmap/unix/mmap.c index 6719570967..e86938bde5 100644 --- a/libs/apr/mmap/unix/mmap.c +++ b/libs/apr/mmap/unix/mmap.c @@ -14,14 +14,14 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_strings.h" -#include "apr_mmap.h" -#include "apr_errno.h" -#include "apr_arch_file_io.h" -#include "apr_portable.h" +#include "fspr.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_strings.h" +#include "fspr_mmap.h" +#include "fspr_errno.h" +#include "fspr_arch_file_io.h" +#include "fspr_portable.h" /* System headers required for the mmap library */ #ifdef BEOS @@ -42,10 +42,10 @@ #if APR_HAS_MMAP || defined(BEOS) -static apr_status_t mmap_cleanup(void *themmap) +static fspr_status_t mmap_cleanup(void *themmap) { - apr_mmap_t *mm = themmap; - apr_mmap_t *next = APR_RING_NEXT(mm,link); + fspr_mmap_t *mm = themmap; + fspr_mmap_t *next = APR_RING_NEXT(mm,link); int rv = 0; /* we no longer refer to the mmaped region */ @@ -71,24 +71,24 @@ static apr_status_t mmap_cleanup(void *themmap) return errno; } -APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, - apr_file_t *file, apr_off_t offset, - apr_size_t size, apr_int32_t flag, - apr_pool_t *cont) +APR_DECLARE(fspr_status_t) fspr_mmap_create(fspr_mmap_t **new, + fspr_file_t *file, fspr_off_t offset, + fspr_size_t size, fspr_int32_t flag, + fspr_pool_t *cont) { void *mm; #ifdef BEOS area_id aid = -1; uint32 pages = 0; #else - apr_int32_t native_flags = 0; + fspr_int32_t native_flags = 0; #endif #if APR_HAS_LARGE_FILES && defined(HAVE_MMAP64) #define mmap mmap64 #elif APR_HAS_LARGE_FILES && SIZEOF_OFF_T == 4 /* LFS but no mmap64: check for overflow */ - if ((apr_int64_t)offset + size > INT_MAX) + if ((fspr_int64_t)offset + size > INT_MAX) return APR_EINVAL; #endif @@ -97,18 +97,18 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, if (file == NULL || file->filedes == -1 || file->buffered) return APR_EBADF; - (*new) = (apr_mmap_t *)apr_pcalloc(cont, sizeof(apr_mmap_t)); + (*new) = (fspr_mmap_t *)fspr_pcalloc(cont, sizeof(fspr_mmap_t)); #ifdef BEOS /* XXX: mmap shouldn't really change the seek offset */ - apr_file_seek(file, APR_SET, &offset); + fspr_file_seek(file, APR_SET, &offset); /* There seems to be some strange interactions that mean our area must * be set as READ & WRITE or writev will fail! Go figure... * So we ignore the value in flags and always ask for both READ and WRITE */ pages = (size + B_PAGE_SIZE -1) / B_PAGE_SIZE; - aid = create_area("apr_mmap", &mm , B_ANY_ADDRESS, pages * B_PAGE_SIZE, + aid = create_area("fspr_mmap", &mm , B_ANY_ADDRESS, pages * B_PAGE_SIZE, B_NO_LOCK, B_WRITE_AREA|B_READ_AREA); if (aid < B_NO_ERROR) { @@ -145,28 +145,28 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, APR_RING_ELEM_INIT(*new, link); /* register the cleanup... */ - apr_pool_cleanup_register((*new)->cntxt, (void*)(*new), mmap_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register((*new)->cntxt, (void*)(*new), mmap_cleanup, + fspr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap, - apr_mmap_t *old_mmap, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_mmap_dup(fspr_mmap_t **new_mmap, + fspr_mmap_t *old_mmap, + fspr_pool_t *p) { - *new_mmap = (apr_mmap_t *)apr_pmemdup(p, old_mmap, sizeof(apr_mmap_t)); + *new_mmap = (fspr_mmap_t *)fspr_pmemdup(p, old_mmap, sizeof(fspr_mmap_t)); (*new_mmap)->cntxt = p; APR_RING_INSERT_AFTER(old_mmap, *new_mmap, link); - apr_pool_cleanup_register(p, *new_mmap, mmap_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register(p, *new_mmap, mmap_cleanup, + fspr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mm) +APR_DECLARE(fspr_status_t) fspr_mmap_delete(fspr_mmap_t *mm) { - return apr_pool_cleanup_run(mm->cntxt, mm, mmap_cleanup); + return fspr_pool_cleanup_run(mm->cntxt, mm, mmap_cleanup); } #endif diff --git a/libs/apr/mmap/win32/mmap.c b/libs/apr/mmap/win32/mmap.c index 134417707f..495b168438 100644 --- a/libs/apr/mmap/win32/mmap.c +++ b/libs/apr/mmap/win32/mmap.c @@ -14,22 +14,22 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_mmap.h" -#include "apr_errno.h" -#include "apr_arch_file_io.h" -#include "apr_portable.h" -#include "apr_strings.h" +#include "fspr.h" +#include "fspr_private.h" +#include "fspr_general.h" +#include "fspr_mmap.h" +#include "fspr_errno.h" +#include "fspr_arch_file_io.h" +#include "fspr_portable.h" +#include "fspr_strings.h" #if APR_HAS_MMAP -static apr_status_t mmap_cleanup(void *themmap) +static fspr_status_t mmap_cleanup(void *themmap) { - apr_mmap_t *mm = themmap; - apr_mmap_t *next = APR_RING_NEXT(mm,link); - apr_status_t rv = 0; + fspr_mmap_t *mm = themmap; + fspr_mmap_t *next = APR_RING_NEXT(mm,link); + fspr_status_t rv = 0; /* we no longer refer to the mmaped region */ APR_RING_REMOVE(mm,link); @@ -44,7 +44,7 @@ static apr_status_t mmap_cleanup(void *themmap) if (mm->mv) { if (!UnmapViewOfFile(mm->mv)) { - apr_status_t rv = apr_get_os_error(); + fspr_status_t rv = fspr_get_os_error(); CloseHandle(mm->mhandle); mm->mv = NULL; mm->mhandle = NULL; @@ -56,7 +56,7 @@ static apr_status_t mmap_cleanup(void *themmap) { if (!CloseHandle(mm->mhandle)) { - apr_status_t rv = apr_get_os_error(); + fspr_status_t rv = fspr_get_os_error(); CloseHandle(mm->mhandle); mm->mhandle = NULL; return rv; @@ -66,9 +66,9 @@ static apr_status_t mmap_cleanup(void *themmap) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, apr_file_t *file, - apr_off_t offset, apr_size_t size, - apr_int32_t flag, apr_pool_t *cont) +APR_DECLARE(fspr_status_t) fspr_mmap_create(fspr_mmap_t **new, fspr_file_t *file, + fspr_off_t offset, fspr_size_t size, + fspr_int32_t flag, fspr_pool_t *cont) { static DWORD memblock = 0; DWORD fmaccess = 0; @@ -100,10 +100,10 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, apr_file_t *file, memblock = si.dwAllocationGranularity; } - *new = apr_pcalloc(cont, sizeof(apr_mmap_t)); + *new = fspr_pcalloc(cont, sizeof(fspr_mmap_t)); (*new)->pstart = (offset / memblock) * memblock; (*new)->poffset = offset - (*new)->pstart; - (*new)->psize = (apr_size_t)((*new)->poffset) + size; + (*new)->psize = (fspr_size_t)((*new)->poffset) + size; /* The size of the CreateFileMapping object is the current size * of the size of the mmap object (e.g. file size), not the size * of the mapped region! @@ -114,7 +114,7 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, apr_file_t *file, if (!(*new)->mhandle || (*new)->mhandle == INVALID_HANDLE_VALUE) { *new = NULL; - return apr_get_os_error(); + return fspr_get_os_error(); } offlo = (DWORD)(*new)->pstart; @@ -123,7 +123,7 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, apr_file_t *file, offlo, (*new)->psize); if (!(*new)->mv) { - apr_status_t rv = apr_get_os_error(); + fspr_status_t rv = fspr_get_os_error(); CloseHandle((*new)->mhandle); *new = NULL; return rv; @@ -135,28 +135,28 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, apr_file_t *file, APR_RING_ELEM_INIT(*new, link); /* register the cleanup... */ - apr_pool_cleanup_register((*new)->cntxt, (void*)(*new), mmap_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register((*new)->cntxt, (void*)(*new), mmap_cleanup, + fspr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap, - apr_mmap_t *old_mmap, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_mmap_dup(fspr_mmap_t **new_mmap, + fspr_mmap_t *old_mmap, + fspr_pool_t *p) { - *new_mmap = (apr_mmap_t *)apr_pmemdup(p, old_mmap, sizeof(apr_mmap_t)); + *new_mmap = (fspr_mmap_t *)fspr_pmemdup(p, old_mmap, sizeof(fspr_mmap_t)); (*new_mmap)->cntxt = p; APR_RING_INSERT_AFTER(old_mmap, *new_mmap, link); - apr_pool_cleanup_register(p, *new_mmap, mmap_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register(p, *new_mmap, mmap_cleanup, + fspr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mm) +APR_DECLARE(fspr_status_t) fspr_mmap_delete(fspr_mmap_t *mm) { - return apr_pool_cleanup_run(mm->cntxt, mm, mmap_cleanup); + return fspr_pool_cleanup_run(mm->cntxt, mm, mmap_cleanup); } #endif diff --git a/libs/apr/network_io/beos/sendrecv.c b/libs/apr/network_io/beos/sendrecv.c index 1aeb426e9c..618b2c6a8b 100644 --- a/libs/apr/network_io/beos/sendrecv.c +++ b/libs/apr/network_io/beos/sendrecv.c @@ -14,14 +14,14 @@ * limitations under the License. */ -#include "apr_private.h" +#include "fspr_private.h" #if BEOS_BONE /* BONE uses the unix code - woohoo */ #include "../unix/sendrecv.c" #else -#include "apr_arch_networkio.h" -#include "apr_time.h" +#include "fspr_arch_networkio.h" +#include "fspr_time.h" -static apr_status_t wait_for_io_or_timeout(apr_socket_t *sock, int for_read) +static fspr_status_t wait_for_io_or_timeout(fspr_socket_t *sock, int for_read) { struct timeval tv, *tvptr; fd_set fdset; @@ -57,23 +57,23 @@ static apr_status_t wait_for_io_or_timeout(apr_socket_t *sock, int for_read) #define SEND_WAIT APR_USEC_PER_SEC / 10 -APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf, - apr_size_t *len) +APR_DECLARE(fspr_status_t) fspr_socket_send(fspr_socket_t *sock, const char *buf, + fspr_size_t *len) { - apr_ssize_t rv; + fspr_ssize_t rv; do { rv = send(sock->socketdes, buf, (*len), 0); } while (rv == -1 && errno == EINTR); if (rv == -1 && errno == EWOULDBLOCK && sock->timeout > 0) { - apr_int32_t snooze_val = SEND_WAIT; - apr_int32_t zzz = 0; + fspr_int32_t snooze_val = SEND_WAIT; + fspr_int32_t zzz = 0; do { rv = send(sock->socketdes, buf, (*len), 0); if (rv == -1 && errno == EWOULDBLOCK){ - apr_sleep (snooze_val); + fspr_sleep (snooze_val); zzz += snooze_val; snooze_val += SEND_WAIT; /* have we passed our timeout value */ @@ -91,17 +91,17 @@ APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock, char *buf, - apr_size_t *len) +APR_DECLARE(fspr_status_t) fspr_socket_recv(fspr_socket_t *sock, char *buf, + fspr_size_t *len) { - apr_ssize_t rv; + fspr_ssize_t rv; do { rv = recv(sock->socketdes, buf, (*len), 0); } while (rv == -1 && errno == EINTR); if (rv == -1 && errno == EWOULDBLOCK && sock->timeout > 0) { - apr_status_t arv = wait_for_io_or_timeout(sock, 1); + fspr_status_t arv = wait_for_io_or_timeout(sock, 1); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -124,20 +124,20 @@ APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock, char *buf, /* BeOS doesn't have writev for sockets so we use the following instead... */ -APR_DECLARE(apr_status_t) apr_socket_sendv(apr_socket_t * sock, +APR_DECLARE(fspr_status_t) fspr_socket_sendv(fspr_socket_t * sock, const struct iovec *vec, - apr_int32_t nvec, apr_size_t *len) + fspr_int32_t nvec, fspr_size_t *len) { *len = vec[0].iov_len; - return apr_socket_send(sock, vec[0].iov_base, len); + return fspr_socket_send(sock, vec[0].iov_base, len); } -APR_DECLARE(apr_status_t) apr_socket_sendto(apr_socket_t *sock, - apr_sockaddr_t *where, - apr_int32_t flags, const char *buf, - apr_size_t *len) +APR_DECLARE(fspr_status_t) fspr_socket_sendto(fspr_socket_t *sock, + fspr_sockaddr_t *where, + fspr_int32_t flags, const char *buf, + fspr_size_t *len) { - apr_ssize_t rv; + fspr_ssize_t rv; do { rv = sendto(sock->socketdes, buf, (*len), flags, @@ -147,7 +147,7 @@ APR_DECLARE(apr_status_t) apr_socket_sendto(apr_socket_t *sock, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout != 0) { - apr_status_t arv = wait_for_io_or_timeout(sock, 0); + fspr_status_t arv = wait_for_io_or_timeout(sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -167,12 +167,12 @@ APR_DECLARE(apr_status_t) apr_socket_sendto(apr_socket_t *sock, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from, - apr_socket_t *sock, - apr_int32_t flags, char *buf, - apr_size_t *len) +APR_DECLARE(fspr_status_t) fspr_socket_recvfrom(fspr_sockaddr_t *from, + fspr_socket_t *sock, + fspr_int32_t flags, char *buf, + fspr_size_t *len) { - apr_ssize_t rv; + fspr_ssize_t rv; if (from == NULL){ return APR_ENOMEM; @@ -188,7 +188,7 @@ APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from, if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && sock->timeout != 0) { - apr_status_t arv = wait_for_io_or_timeout(sock, 1); + fspr_status_t arv = wait_for_io_or_timeout(sock, 1); if (arv != APR_SUCCESS) { *len = 0; return arv; diff --git a/libs/apr/network_io/os2/os2calls.c b/libs/apr/network_io/os2/os2calls.c index 6bf1fcd02e..b68e93e294 100644 --- a/libs/apr/network_io/os2/os2calls.c +++ b/libs/apr/network_io/os2/os2calls.c @@ -14,33 +14,33 @@ * limitations under the License. */ -#include "apr_arch_networkio.h" -#include "apr_network_io.h" -#include "apr_portable.h" -#include "apr_general.h" -#include "apr_lib.h" +#include "fspr_arch_networkio.h" +#include "fspr_network_io.h" +#include "fspr_portable.h" +#include "fspr_general.h" +#include "fspr_lib.h" static int os2_socket_init(int, int ,int); -int (*apr_os2_socket)(int, int, int) = os2_socket_init; -int (*apr_os2_select)(int *, int, int, int, long) = NULL; -int (*apr_os2_sock_errno)() = NULL; -int (*apr_os2_accept)(int, struct sockaddr *, int *) = NULL; -int (*apr_os2_bind)(int, struct sockaddr *, int) = NULL; -int (*apr_os2_connect)(int, struct sockaddr *, int) = NULL; -int (*apr_os2_getpeername)(int, struct sockaddr *, int *) = NULL; -int (*apr_os2_getsockname)(int, struct sockaddr *, int *) = NULL; -int (*apr_os2_getsockopt)(int, int, int, char *, int *) = NULL; -int (*apr_os2_ioctl)(int, int, caddr_t, int) = NULL; -int (*apr_os2_listen)(int, int) = NULL; -int (*apr_os2_recv)(int, char *, int, int) = NULL; -int (*apr_os2_send)(int, const char *, int, int) = NULL; -int (*apr_os2_setsockopt)(int, int, int, char *, int) = NULL; -int (*apr_os2_shutdown)(int, int) = NULL; -int (*apr_os2_soclose)(int) = NULL; -int (*apr_os2_writev)(int, struct iovec *, int) = NULL; -int (*apr_os2_sendto)(int, const char *, int, int, const struct sockaddr *, int); -int (*apr_os2_recvfrom)(int, char *, int, int, struct sockaddr *, int *); +int (*fspr_os2_socket)(int, int, int) = os2_socket_init; +int (*fspr_os2_select)(int *, int, int, int, long) = NULL; +int (*fspr_os2_sock_errno)() = NULL; +int (*fspr_os2_accept)(int, struct sockaddr *, int *) = NULL; +int (*fspr_os2_bind)(int, struct sockaddr *, int) = NULL; +int (*fspr_os2_connect)(int, struct sockaddr *, int) = NULL; +int (*fspr_os2_getpeername)(int, struct sockaddr *, int *) = NULL; +int (*fspr_os2_getsockname)(int, struct sockaddr *, int *) = NULL; +int (*fspr_os2_getsockopt)(int, int, int, char *, int *) = NULL; +int (*fspr_os2_ioctl)(int, int, caddr_t, int) = NULL; +int (*fspr_os2_listen)(int, int) = NULL; +int (*fspr_os2_recv)(int, char *, int, int) = NULL; +int (*fspr_os2_send)(int, const char *, int, int) = NULL; +int (*fspr_os2_setsockopt)(int, int, int, char *, int) = NULL; +int (*fspr_os2_shutdown)(int, int) = NULL; +int (*fspr_os2_soclose)(int) = NULL; +int (*fspr_os2_writev)(int, struct iovec *, int) = NULL; +int (*fspr_os2_sendto)(int, const char *, int, int, const struct sockaddr *, int); +int (*fspr_os2_recvfrom)(int, char *, int, int, struct sockaddr *, int *); static HMODULE hSO32DLL; @@ -48,7 +48,7 @@ static int os2_fn_link() { DosEnterCritSec(); /* Stop two threads doing this at the same time */ - if (apr_os2_socket == os2_socket_init) { + if (fspr_os2_socket == os2_socket_init) { ULONG rc; char errorstr[200]; @@ -57,61 +57,61 @@ static int os2_fn_link() if (rc) return APR_OS2_STATUS(rc); - rc = DosQueryProcAddr(hSO32DLL, 0, "SOCKET", &apr_os2_socket); + rc = DosQueryProcAddr(hSO32DLL, 0, "SOCKET", &fspr_os2_socket); if (!rc) - rc = DosQueryProcAddr(hSO32DLL, 0, "SELECT", &apr_os2_select); + rc = DosQueryProcAddr(hSO32DLL, 0, "SELECT", &fspr_os2_select); if (!rc) - rc = DosQueryProcAddr(hSO32DLL, 0, "SOCK_ERRNO", &apr_os2_sock_errno); + rc = DosQueryProcAddr(hSO32DLL, 0, "SOCK_ERRNO", &fspr_os2_sock_errno); if (!rc) - rc = DosQueryProcAddr(hSO32DLL, 0, "ACCEPT", &apr_os2_accept); + rc = DosQueryProcAddr(hSO32DLL, 0, "ACCEPT", &fspr_os2_accept); if (!rc) - rc = DosQueryProcAddr(hSO32DLL, 0, "BIND", &apr_os2_bind); + rc = DosQueryProcAddr(hSO32DLL, 0, "BIND", &fspr_os2_bind); if (!rc) - rc = DosQueryProcAddr(hSO32DLL, 0, "CONNECT", &apr_os2_connect); + rc = DosQueryProcAddr(hSO32DLL, 0, "CONNECT", &fspr_os2_connect); if (!rc) - rc = DosQueryProcAddr(hSO32DLL, 0, "GETPEERNAME", &apr_os2_getpeername); + rc = DosQueryProcAddr(hSO32DLL, 0, "GETPEERNAME", &fspr_os2_getpeername); if (!rc) - rc = DosQueryProcAddr(hSO32DLL, 0, "GETSOCKNAME", &apr_os2_getsockname); + rc = DosQueryProcAddr(hSO32DLL, 0, "GETSOCKNAME", &fspr_os2_getsockname); if (!rc) - rc = DosQueryProcAddr(hSO32DLL, 0, "GETSOCKOPT", &apr_os2_getsockopt); + rc = DosQueryProcAddr(hSO32DLL, 0, "GETSOCKOPT", &fspr_os2_getsockopt); if (!rc) - rc = DosQueryProcAddr(hSO32DLL, 0, "IOCTL", &apr_os2_ioctl); + rc = DosQueryProcAddr(hSO32DLL, 0, "IOCTL", &fspr_os2_ioctl); if (!rc) - rc = DosQueryProcAddr(hSO32DLL, 0, "LISTEN", &apr_os2_listen); + rc = DosQueryProcAddr(hSO32DLL, 0, "LISTEN", &fspr_os2_listen); if (!rc) - rc = DosQueryProcAddr(hSO32DLL, 0, "RECV", &apr_os2_recv); + rc = DosQueryProcAddr(hSO32DLL, 0, "RECV", &fspr_os2_recv); if (!rc) - rc = DosQueryProcAddr(hSO32DLL, 0, "SEND", &apr_os2_send); + rc = DosQueryProcAddr(hSO32DLL, 0, "SEND", &fspr_os2_send); if (!rc) - rc = DosQueryProcAddr(hSO32DLL, 0, "SETSOCKOPT", &apr_os2_setsockopt); + rc = DosQueryProcAddr(hSO32DLL, 0, "SETSOCKOPT", &fspr_os2_setsockopt); if (!rc) - rc = DosQueryProcAddr(hSO32DLL, 0, "SHUTDOWN", &apr_os2_shutdown); + rc = DosQueryProcAddr(hSO32DLL, 0, "SHUTDOWN", &fspr_os2_shutdown); if (!rc) - rc = DosQueryProcAddr(hSO32DLL, 0, "SOCLOSE", &apr_os2_soclose); + rc = DosQueryProcAddr(hSO32DLL, 0, "SOCLOSE", &fspr_os2_soclose); if (!rc) - rc = DosQueryProcAddr(hSO32DLL, 0, "WRITEV", &apr_os2_writev); + rc = DosQueryProcAddr(hSO32DLL, 0, "WRITEV", &fspr_os2_writev); if (!rc) - rc = DosQueryProcAddr(hSO32DLL, 0, "SENDTO", &apr_os2_sendto); + rc = DosQueryProcAddr(hSO32DLL, 0, "SENDTO", &fspr_os2_sendto); if (!rc) - rc = DosQueryProcAddr(hSO32DLL, 0, "RECVFROM", &apr_os2_recvfrom); + rc = DosQueryProcAddr(hSO32DLL, 0, "RECVFROM", &fspr_os2_recvfrom); if (rc) return APR_OS2_STATUS(rc); @@ -127,6 +127,6 @@ static int os2_socket_init(int domain, int type, int protocol) { int rc = os2_fn_link(); if (rc == APR_SUCCESS) - return apr_os2_socket(domain, type, protocol); + return fspr_os2_socket(domain, type, protocol); return rc; } diff --git a/libs/apr/network_io/os2/sendrecv.c b/libs/apr/network_io/os2/sendrecv.c index 839ff3f831..8f0fbf805c 100644 --- a/libs/apr/network_io/os2/sendrecv.c +++ b/libs/apr/network_io/os2/sendrecv.c @@ -14,17 +14,17 @@ * limitations under the License. */ -#include "apr_arch_networkio.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_network_io.h" -#include "apr_lib.h" +#include "fspr_arch_networkio.h" +#include "fspr_errno.h" +#include "fspr_general.h" +#include "fspr_network_io.h" +#include "fspr_lib.h" #include -APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf, - apr_size_t *len) +APR_DECLARE(fspr_status_t) fspr_socket_send(fspr_socket_t *sock, const char *buf, + fspr_size_t *len) { - apr_ssize_t rv; + fspr_ssize_t rv; int fds, err = 0; if (*len > 65536) { @@ -65,10 +65,10 @@ APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf, -APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock, char *buf, - apr_size_t *len) +APR_DECLARE(fspr_status_t) fspr_socket_recv(fspr_socket_t *sock, char *buf, + fspr_size_t *len) { - apr_ssize_t rv; + fspr_ssize_t rv; int fds, err = 0; do { @@ -105,11 +105,11 @@ APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock, char *buf, -APR_DECLARE(apr_status_t) apr_socket_sendv(apr_socket_t *sock, +APR_DECLARE(fspr_status_t) fspr_socket_sendv(fspr_socket_t *sock, const struct iovec *vec, - apr_int32_t nvec, apr_size_t *len) + fspr_int32_t nvec, fspr_size_t *len) { - apr_status_t rv; + fspr_status_t rv; struct iovec *tmpvec; int fds, err = 0; int nv_tosend, total = 0; diff --git a/libs/apr/network_io/os2/sendrecv_udp.c b/libs/apr/network_io/os2/sendrecv_udp.c index c0dcd8562e..7a8d0c36db 100644 --- a/libs/apr/network_io/os2/sendrecv_udp.c +++ b/libs/apr/network_io/os2/sendrecv_udp.c @@ -14,21 +14,21 @@ * limitations under the License. */ -#include "apr_arch_networkio.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_network_io.h" -#include "apr_support.h" -#include "apr_lib.h" +#include "fspr_arch_networkio.h" +#include "fspr_errno.h" +#include "fspr_general.h" +#include "fspr_network_io.h" +#include "fspr_support.h" +#include "fspr_lib.h" #include -APR_DECLARE(apr_status_t) apr_socket_sendto(apr_socket_t *sock, - apr_sockaddr_t *where, - apr_int32_t flags, const char *buf, - apr_size_t *len) +APR_DECLARE(fspr_status_t) fspr_socket_sendto(fspr_socket_t *sock, + fspr_sockaddr_t *where, + fspr_int32_t flags, const char *buf, + fspr_size_t *len) { - apr_ssize_t rv; + fspr_ssize_t rv; int serrno; do { @@ -38,7 +38,7 @@ APR_DECLARE(apr_status_t) apr_socket_sendto(apr_socket_t *sock, } while (rv == -1 && (serrno = sock_errno()) == EINTR); if (rv == -1 && serrno == SOCEWOULDBLOCK && sock->timeout != 0) { - apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 0); + fspr_status_t arv = fspr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; @@ -63,12 +63,12 @@ APR_DECLARE(apr_status_t) apr_socket_sendto(apr_socket_t *sock, -APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from, - apr_socket_t *sock, - apr_int32_t flags, char *buf, - apr_size_t *len) +APR_DECLARE(fspr_status_t) fspr_socket_recvfrom(fspr_sockaddr_t *from, + fspr_socket_t *sock, + fspr_int32_t flags, char *buf, + fspr_size_t *len) { - apr_ssize_t rv; + fspr_ssize_t rv; int serrno; do { @@ -77,7 +77,7 @@ APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from, } while (rv == -1 && (serrno = sock_errno()) == EINTR); if (rv == -1 && serrno == SOCEWOULDBLOCK && sock->timeout != 0) { - apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 1); + fspr_status_t arv = fspr_wait_for_io_or_timeout(NULL, sock, 1); if (arv != APR_SUCCESS) { *len = 0; diff --git a/libs/apr/network_io/os2/sockets.c b/libs/apr/network_io/os2/sockets.c index bb951e4c86..1035889b4b 100644 --- a/libs/apr/network_io/os2/sockets.c +++ b/libs/apr/network_io/os2/sockets.c @@ -14,13 +14,13 @@ * limitations under the License. */ -#include "apr_arch_networkio.h" -#include "apr_arch_inherit.h" -#include "apr_network_io.h" -#include "apr_general.h" -#include "apr_portable.h" -#include "apr_lib.h" -#include "apr_strings.h" +#include "fspr_arch_networkio.h" +#include "fspr_arch_inherit.h" +#include "fspr_network_io.h" +#include "fspr_general.h" +#include "fspr_portable.h" +#include "fspr_lib.h" +#include "fspr_strings.h" #include #include #include @@ -28,11 +28,11 @@ #include #include #include -#include "apr_arch_os2calls.h" +#include "fspr_arch_os2calls.h" -static apr_status_t socket_cleanup(void *sock) +static fspr_status_t socket_cleanup(void *sock) { - apr_socket_t *thesocket = sock; + fspr_socket_t *thesocket = sock; if (thesocket->socketdes < 0) { return APR_EINVALSOCK; @@ -47,43 +47,43 @@ static apr_status_t socket_cleanup(void *sock) } } -static void set_socket_vars(apr_socket_t *sock, int family, int type, int protocol) +static void set_socket_vars(fspr_socket_t *sock, int family, int type, int protocol) { sock->type = type; sock->protocol = protocol; - apr_sockaddr_vars_set(sock->local_addr, family, 0); - apr_sockaddr_vars_set(sock->remote_addr, family, 0); + fspr_sockaddr_vars_set(sock->local_addr, family, 0); + fspr_sockaddr_vars_set(sock->remote_addr, family, 0); } -static void alloc_socket(apr_socket_t **new, apr_pool_t *p) +static void alloc_socket(fspr_socket_t **new, fspr_pool_t *p) { - *new = (apr_socket_t *)apr_pcalloc(p, sizeof(apr_socket_t)); + *new = (fspr_socket_t *)fspr_pcalloc(p, sizeof(fspr_socket_t)); (*new)->pool = p; - (*new)->local_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->pool, - sizeof(apr_sockaddr_t)); + (*new)->local_addr = (fspr_sockaddr_t *)fspr_pcalloc((*new)->pool, + sizeof(fspr_sockaddr_t)); (*new)->local_addr->pool = p; - (*new)->remote_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->pool, - sizeof(apr_sockaddr_t)); + (*new)->remote_addr = (fspr_sockaddr_t *)fspr_pcalloc((*new)->pool, + sizeof(fspr_sockaddr_t)); (*new)->remote_addr->pool = p; (*new)->remote_addr_unknown = 1; /* Create a pollset with room for one descriptor. */ /* ### check return codes */ - (void) apr_pollset_create(&(*new)->pollset, 1, p, 0); + (void) fspr_pollset_create(&(*new)->pollset, 1, p, 0); } -APR_DECLARE(apr_status_t) apr_socket_protocol_get(apr_socket_t *sock, int *protocol) +APR_DECLARE(fspr_status_t) fspr_socket_protocol_get(fspr_socket_t *sock, int *protocol) { *protocol = sock->protocol; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, int type, - int protocol, apr_pool_t *cont) +APR_DECLARE(fspr_status_t) fspr_socket_create(fspr_socket_t **new, int family, int type, + int protocol, fspr_pool_t *cont) { int downgrade = (family == AF_UNSPEC); - apr_pollfd_t pfd; + fspr_pollfd_t pfd; if (family == AF_UNSPEC) { #if APR_HAVE_IPV6 @@ -110,14 +110,14 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, int (*new)->timeout = -1; (*new)->nonblock = FALSE; - apr_pool_cleanup_register((*new)->pool, (void *)(*new), - socket_cleanup, apr_pool_cleanup_null); + fspr_pool_cleanup_register((*new)->pool, (void *)(*new), + socket_cleanup, fspr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_socket_shutdown(apr_socket_t *thesocket, - apr_shutdown_how_e how) +APR_DECLARE(fspr_status_t) fspr_socket_shutdown(fspr_socket_t *thesocket, + fspr_shutdown_how_e how) { if (shutdown(thesocket->socketdes, how) == 0) { return APR_SUCCESS; @@ -127,14 +127,14 @@ APR_DECLARE(apr_status_t) apr_socket_shutdown(apr_socket_t *thesocket, } } -APR_DECLARE(apr_status_t) apr_socket_close(apr_socket_t *thesocket) +APR_DECLARE(fspr_status_t) fspr_socket_close(fspr_socket_t *thesocket) { - apr_pool_cleanup_kill(thesocket->pool, thesocket, socket_cleanup); + fspr_pool_cleanup_kill(thesocket->pool, thesocket, socket_cleanup); return socket_cleanup(thesocket); } -APR_DECLARE(apr_status_t) apr_socket_bind(apr_socket_t *sock, - apr_sockaddr_t *sa) +APR_DECLARE(fspr_status_t) fspr_socket_bind(fspr_socket_t *sock, + fspr_sockaddr_t *sa) { if (bind(sock->socketdes, (struct sockaddr *)&sa->sa, @@ -150,8 +150,8 @@ APR_DECLARE(apr_status_t) apr_socket_bind(apr_socket_t *sock, } } -APR_DECLARE(apr_status_t) apr_socket_listen(apr_socket_t *sock, - apr_int32_t backlog) +APR_DECLARE(fspr_status_t) fspr_socket_listen(fspr_socket_t *sock, + fspr_int32_t backlog) { if (listen(sock->socketdes, backlog) == -1) return APR_OS2_STATUS(sock_errno()); @@ -159,9 +159,9 @@ APR_DECLARE(apr_status_t) apr_socket_listen(apr_socket_t *sock, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_socket_accept(apr_socket_t **new, - apr_socket_t *sock, - apr_pool_t *connection_context) +APR_DECLARE(fspr_status_t) fspr_socket_accept(fspr_socket_t **new, + fspr_socket_t *sock, + fspr_pool_t *connection_context) { alloc_socket(new, connection_context); set_socket_vars(*new, sock->local_addr->sa.sin.sin_family, SOCK_STREAM, sock->protocol); @@ -186,13 +186,13 @@ APR_DECLARE(apr_status_t) apr_socket_accept(apr_socket_t **new, (*new)->local_addr->ipaddr_ptr = &(*new)->local_addr->sa.sin.sin_addr; } - apr_pool_cleanup_register((*new)->pool, (void *)(*new), - socket_cleanup, apr_pool_cleanup_null); + fspr_pool_cleanup_register((*new)->pool, (void *)(*new), + socket_cleanup, fspr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, - apr_sockaddr_t *sa) +APR_DECLARE(fspr_status_t) fspr_socket_connect(fspr_socket_t *sock, + fspr_sockaddr_t *sa) { if ((connect(sock->socketdes, (struct sockaddr *)&sa->sa.sin, sa->salen) < 0) && @@ -208,14 +208,14 @@ APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, } } -APR_DECLARE(apr_status_t) apr_socket_type_get(apr_socket_t *sock, int *type) +APR_DECLARE(fspr_status_t) fspr_socket_type_get(fspr_socket_t *sock, int *type) { *type = sock->type; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_socket_data_get(void **data, const char *key, - apr_socket_t *sock) +APR_DECLARE(fspr_status_t) fspr_socket_data_get(void **data, const char *key, + fspr_socket_t *sock) { sock_userdata_t *cur = sock->userdata; @@ -234,65 +234,65 @@ APR_DECLARE(apr_status_t) apr_socket_data_get(void **data, const char *key, -APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *sock, void *data, const char *key, - apr_status_t (*cleanup) (void *)) +APR_DECLARE(fspr_status_t) fspr_socket_data_set(fspr_socket_t *sock, void *data, const char *key, + fspr_status_t (*cleanup) (void *)) { - sock_userdata_t *new = apr_palloc(sock->pool, sizeof(sock_userdata_t)); + sock_userdata_t *new = fspr_palloc(sock->pool, sizeof(sock_userdata_t)); - new->key = apr_pstrdup(sock->pool, key); + new->key = fspr_pstrdup(sock->pool, key); new->data = data; new->next = sock->userdata; sock->userdata = new; if (cleanup) { - apr_pool_cleanup_register(sock->pool, data, cleanup, cleanup); + fspr_pool_cleanup_register(sock->pool, data, cleanup, cleanup); } return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock) +APR_DECLARE(fspr_status_t) fspr_os_sock_get(fspr_os_sock_t *thesock, fspr_socket_t *sock) { *thesock = sock->socketdes; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, - apr_os_sock_info_t *os_sock_info, - apr_pool_t *cont) +APR_DECLARE(fspr_status_t) fspr_os_sock_make(fspr_socket_t **fspr_sock, + fspr_os_sock_info_t *os_sock_info, + fspr_pool_t *cont) { - alloc_socket(apr_sock, cont); - set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type, os_sock_info->protocol); - (*apr_sock)->timeout = -1; - (*apr_sock)->socketdes = *os_sock_info->os_sock; + alloc_socket(fspr_sock, cont); + set_socket_vars(*fspr_sock, os_sock_info->family, os_sock_info->type, os_sock_info->protocol); + (*fspr_sock)->timeout = -1; + (*fspr_sock)->socketdes = *os_sock_info->os_sock; if (os_sock_info->local) { - memcpy(&(*apr_sock)->local_addr->sa.sin, + memcpy(&(*fspr_sock)->local_addr->sa.sin, os_sock_info->local, - (*apr_sock)->local_addr->salen); + (*fspr_sock)->local_addr->salen); /* XXX IPv6 - this assumes sin_port and sin6_port at same offset */ - (*apr_sock)->local_addr->port = ntohs((*apr_sock)->local_addr->sa.sin.sin_port); + (*fspr_sock)->local_addr->port = ntohs((*fspr_sock)->local_addr->sa.sin.sin_port); } else { - (*apr_sock)->local_port_unknown = (*apr_sock)->local_interface_unknown = 1; + (*fspr_sock)->local_port_unknown = (*fspr_sock)->local_interface_unknown = 1; } if (os_sock_info->remote) { - memcpy(&(*apr_sock)->remote_addr->sa.sin, + memcpy(&(*fspr_sock)->remote_addr->sa.sin, os_sock_info->remote, - (*apr_sock)->remote_addr->salen); + (*fspr_sock)->remote_addr->salen); /* XXX IPv6 - this assumes sin_port and sin6_port at same offset */ - (*apr_sock)->remote_addr->port = ntohs((*apr_sock)->remote_addr->sa.sin.sin_port); + (*fspr_sock)->remote_addr->port = ntohs((*fspr_sock)->remote_addr->sa.sin.sin_port); } else { - (*apr_sock)->remote_addr_unknown = 1; + (*fspr_sock)->remote_addr_unknown = 1; } - apr_pool_cleanup_register((*apr_sock)->pool, (void *)(*apr_sock), - socket_cleanup, apr_pool_cleanup_null); + fspr_pool_cleanup_register((*fspr_sock)->pool, (void *)(*fspr_sock), + socket_cleanup, fspr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont) +APR_DECLARE(fspr_status_t) fspr_os_sock_put(fspr_socket_t **sock, fspr_os_sock_t *thesock, fspr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; diff --git a/libs/apr/network_io/os2/sockopt.c b/libs/apr/network_io/os2/sockopt.c index 85ff35331a..4123de5eca 100644 --- a/libs/apr/network_io/os2/sockopt.c +++ b/libs/apr/network_io/os2/sockopt.c @@ -14,11 +14,11 @@ * limitations under the License. */ -#include "apr_arch_networkio.h" -#include "apr_network_io.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_strings.h" +#include "fspr_arch_networkio.h" +#include "fspr_network_io.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_strings.h" #include #include #include @@ -29,16 +29,16 @@ #include -APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, - apr_interval_time_t t) +APR_DECLARE(fspr_status_t) fspr_socket_timeout_set(fspr_socket_t *sock, + fspr_interval_time_t t) { sock->timeout = t; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, - apr_int32_t opt, apr_int32_t on) +APR_DECLARE(fspr_status_t) fspr_socket_opt_set(fspr_socket_t *sock, + fspr_int32_t opt, fspr_int32_t on) { int one; struct linger li; @@ -91,16 +91,16 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, } -APR_DECLARE(apr_status_t) apr_socket_timeout_get(apr_socket_t *sock, - apr_interval_time_t *t) +APR_DECLARE(fspr_status_t) fspr_socket_timeout_get(fspr_socket_t *sock, + fspr_interval_time_t *t) { *t = sock->timeout; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock, - apr_int32_t opt, apr_int32_t *on) +APR_DECLARE(fspr_status_t) fspr_socket_opt_get(fspr_socket_t *sock, + fspr_int32_t opt, fspr_int32_t *on) { switch(opt) { default: @@ -110,7 +110,7 @@ APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock, } -APR_DECLARE(int) apr_socket_fd_get(apr_socket_t *sock) +APR_DECLARE(int) fspr_socket_fd_get(fspr_socket_t *sock) { if (sock) { return sock->socketdes; @@ -120,7 +120,7 @@ APR_DECLARE(int) apr_socket_fd_get(apr_socket_t *sock) } -APR_DECLARE(apr_status_t) apr_socket_atmark(apr_socket_t *sock, int *atmark) +APR_DECLARE(fspr_status_t) fspr_socket_atmark(fspr_socket_t *sock, int *atmark) { int oobmark; @@ -134,8 +134,8 @@ APR_DECLARE(apr_status_t) apr_socket_atmark(apr_socket_t *sock, int *atmark) } -APR_DECLARE(apr_status_t) apr_gethostname(char *buf, apr_int32_t len, - apr_pool_t *cont) +APR_DECLARE(fspr_status_t) fspr_gethostname(char *buf, fspr_int32_t len, + fspr_pool_t *cont) { if (gethostname(buf, len) == -1) { buf[0] = '\0'; diff --git a/libs/apr/network_io/unix/inet_ntop.c b/libs/apr/network_io/unix/inet_ntop.c index a96eb18f7a..cdf1d08176 100644 --- a/libs/apr/network_io/unix/inet_ntop.c +++ b/libs/apr/network_io/unix/inet_ntop.c @@ -14,9 +14,9 @@ * SOFTWARE. */ -#include "apr_private.h" -#include "apr_arch_networkio.h" -#include "apr_strings.h" +#include "fspr_private.h" +#include "fspr_arch_networkio.h" +#include "fspr_strings.h" #if APR_HAVE_SYS_TYPES_H #include @@ -41,7 +41,7 @@ #endif #ifndef INT16SZ -#define INT16SZ sizeof(apr_int16_t) +#define INT16SZ sizeof(fspr_int16_t) #endif #ifndef __P @@ -57,9 +57,9 @@ * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. */ -static const char *inet_ntop4 __P((const unsigned char *src, char *dst, apr_size_t size)); +static const char *inet_ntop4 __P((const unsigned char *src, char *dst, fspr_size_t size)); #if APR_HAVE_IPV6 -static const char *inet_ntop6 __P((const unsigned char *src, char *dst, apr_size_t size)); +static const char *inet_ntop6 __P((const unsigned char *src, char *dst, fspr_size_t size)); #endif /* char * @@ -71,7 +71,7 @@ static const char *inet_ntop6 __P((const unsigned char *src, char *dst, apr_size * Paul Vixie, 1996. */ const char * -apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size) +fspr_inet_ntop(int af, const void *src, char *dst, fspr_size_t size) { switch (af) { case AF_INET: @@ -99,9 +99,9 @@ apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size) * Paul Vixie, 1996. */ static const char * -inet_ntop4(const unsigned char *src, char *dst, apr_size_t size) +inet_ntop4(const unsigned char *src, char *dst, fspr_size_t size) { - const apr_size_t MIN_SIZE = 16; /* space for 255.255.255.255\0 */ + const fspr_size_t MIN_SIZE = 16; /* space for 255.255.255.255\0 */ int n = 0; char *next = dst; @@ -137,7 +137,7 @@ inet_ntop4(const unsigned char *src, char *dst, apr_size_t size) * Paul Vixie, 1996. */ static const char * -inet_ntop6(const unsigned char *src, char *dst, apr_size_t size) +inet_ntop6(const unsigned char *src, char *dst, fspr_size_t size) { /* * Note that int32_t and int16_t need only be "at least" large enough @@ -224,7 +224,7 @@ inet_ntop6(const unsigned char *src, char *dst, apr_size_t size) tp += strlen(tp); break; } - tp += apr_snprintf(tp, sizeof tmp - (tp - tmp), "%x", words[i]); + tp += fspr_snprintf(tp, sizeof tmp - (tp - tmp), "%x", words[i]); i++; } /* Was it a trailing run of 0x00's? */ @@ -236,7 +236,7 @@ inet_ntop6(const unsigned char *src, char *dst, apr_size_t size) /* * Check for overflow, copy, and we're done. */ - if ((apr_size_t)(tp - tmp) > size) { + if ((fspr_size_t)(tp - tmp) > size) { errno = ENOSPC; return (NULL); } diff --git a/libs/apr/network_io/unix/inet_pton.c b/libs/apr/network_io/unix/inet_pton.c index 22b15390fc..890691b533 100644 --- a/libs/apr/network_io/unix/inet_pton.c +++ b/libs/apr/network_io/unix/inet_pton.c @@ -14,8 +14,8 @@ * SOFTWARE. */ -#include "apr_private.h" -#include "apr_arch_networkio.h" +#include "fspr_private.h" +#include "fspr_arch_networkio.h" #if APR_HAVE_SYS_TYPES_H #include @@ -39,7 +39,7 @@ #endif #ifndef INT16SZ -#define INT16SZ sizeof(apr_int16_t) +#define INT16SZ sizeof(fspr_int16_t) #endif #ifndef INADDRSZ @@ -76,7 +76,7 @@ static int inet_pton6 __P((const char *src, unsigned char *dst)); * Paul Vixie, 1996. */ int -apr_inet_pton(int af, const char *src, void *dst) +fspr_inet_pton(int af, const char *src, void *dst) { switch (af) { case AF_INET: diff --git a/libs/apr/network_io/unix/multicast.c b/libs/apr/network_io/unix/multicast.c index 7f8f759dd7..5047e3b928 100644 --- a/libs/apr/network_io/unix/multicast.c +++ b/libs/apr/network_io/unix/multicast.c @@ -14,11 +14,11 @@ * limitations under the License. */ -#include "apr_arch_networkio.h" -#include "apr_network_io.h" -#include "apr_support.h" -#include "apr_portable.h" -#include "apr_arch_inherit.h" +#include "fspr_arch_networkio.h" +#include "fspr_network_io.h" +#include "fspr_support.h" +#include "fspr_portable.h" +#include "fspr_arch_inherit.h" #ifdef HAVE_GETIFADDRS #include @@ -27,12 +27,12 @@ #ifdef HAVE_STRUCT_IPMREQ /* Only UDP and Raw Sockets can be used for Multicast */ -static apr_status_t mcast_check_type(apr_socket_t *sock) +static fspr_status_t mcast_check_type(fspr_socket_t *sock) { int type; - apr_status_t rv; + fspr_status_t rv; - rv = apr_socket_type_get(sock, &type); + rv = fspr_socket_type_get(sock, &type); if (rv != APR_SUCCESS) { return rv; @@ -45,8 +45,8 @@ static apr_status_t mcast_check_type(apr_socket_t *sock) } } -static void fill_mip_v4(struct ip_mreq *mip, apr_sockaddr_t *mcast, - apr_sockaddr_t *iface) +static void fill_mip_v4(struct ip_mreq *mip, fspr_sockaddr_t *mcast, + fspr_sockaddr_t *iface) { mip->imr_multiaddr = mcast->sa.sin.sin_addr; if (iface == NULL) { @@ -57,7 +57,7 @@ static void fill_mip_v4(struct ip_mreq *mip, apr_sockaddr_t *mcast, } } -static unsigned int find_if_index(const apr_sockaddr_t *iface) +static unsigned int find_if_index(const fspr_sockaddr_t *iface) { unsigned int index = 0; #if defined(HAVE_GETIFADDRS) && APR_HAVE_IPV6 @@ -92,8 +92,8 @@ static unsigned int find_if_index(const apr_sockaddr_t *iface) } #if APR_HAVE_IPV6 -static void fill_mip_v6(struct ipv6_mreq *mip, const apr_sockaddr_t *mcast, - const apr_sockaddr_t *iface) +static void fill_mip_v6(struct ipv6_mreq *mip, const fspr_sockaddr_t *mcast, + const fspr_sockaddr_t *iface) { memcpy(&mip->ipv6mr_multiaddr, mcast->ipaddr_ptr, sizeof(mip->ipv6mr_multiaddr)); @@ -107,7 +107,7 @@ static void fill_mip_v6(struct ipv6_mreq *mip, const apr_sockaddr_t *mcast, } #endif -static int sock_is_ipv4(apr_socket_t *sock) +static int sock_is_ipv4(fspr_socket_t *sock) { if (sock->local_addr->family == APR_INET) return 1; @@ -115,7 +115,7 @@ static int sock_is_ipv4(apr_socket_t *sock) } #if APR_HAVE_IPV6 -static int sock_is_ipv6(apr_socket_t *sock) +static int sock_is_ipv6(fspr_socket_t *sock) { if (sock->local_addr->family == APR_INET6) return 1; @@ -123,12 +123,12 @@ static int sock_is_ipv6(apr_socket_t *sock) } #endif -static apr_status_t do_mcast(int type, apr_socket_t *sock, - apr_sockaddr_t *mcast, apr_sockaddr_t *iface, - apr_sockaddr_t *source) +static fspr_status_t do_mcast(int type, fspr_socket_t *sock, + fspr_sockaddr_t *mcast, fspr_sockaddr_t *iface, + fspr_sockaddr_t *source) { struct ip_mreq mip4; - apr_status_t rv = APR_SUCCESS; + fspr_status_t rv = APR_SUCCESS; #if APR_HAVE_IPV6 struct ipv6_mreq mip6; #endif @@ -214,10 +214,10 @@ static apr_status_t do_mcast(int type, apr_socket_t *sock, return rv; } -static apr_status_t do_mcast_opt(int type, apr_socket_t *sock, - apr_byte_t value) +static fspr_status_t do_mcast_opt(int type, fspr_socket_t *sock, + fspr_byte_t value) { - apr_status_t rv = APR_SUCCESS; + fspr_status_t rv = APR_SUCCESS; rv = mcast_check_type(sock); @@ -262,10 +262,10 @@ static apr_status_t do_mcast_opt(int type, apr_socket_t *sock, } #endif -APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock, - apr_sockaddr_t *join, - apr_sockaddr_t *iface, - apr_sockaddr_t *source) +APR_DECLARE(fspr_status_t) fspr_mcast_join(fspr_socket_t *sock, + fspr_sockaddr_t *join, + fspr_sockaddr_t *iface, + fspr_sockaddr_t *source) { #if defined(IP_ADD_MEMBERSHIP) && defined(HAVE_STRUCT_IPMREQ) return do_mcast(IP_ADD_MEMBERSHIP, sock, join, iface, source); @@ -274,10 +274,10 @@ APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock, #endif } -APR_DECLARE(apr_status_t) apr_mcast_leave(apr_socket_t *sock, - apr_sockaddr_t *addr, - apr_sockaddr_t *iface, - apr_sockaddr_t *source) +APR_DECLARE(fspr_status_t) fspr_mcast_leave(fspr_socket_t *sock, + fspr_sockaddr_t *addr, + fspr_sockaddr_t *iface, + fspr_sockaddr_t *source) { #if defined(IP_DROP_MEMBERSHIP) && defined(HAVE_STRUCT_IPMREQ) return do_mcast(IP_DROP_MEMBERSHIP, sock, addr, iface, source); @@ -286,7 +286,7 @@ APR_DECLARE(apr_status_t) apr_mcast_leave(apr_socket_t *sock, #endif } -APR_DECLARE(apr_status_t) apr_mcast_hops(apr_socket_t *sock, apr_byte_t ttl) +APR_DECLARE(fspr_status_t) fspr_mcast_hops(fspr_socket_t *sock, fspr_byte_t ttl) { #if defined(IP_MULTICAST_TTL) && defined(HAVE_STRUCT_IPMREQ) return do_mcast_opt(IP_MULTICAST_TTL, sock, ttl); @@ -295,8 +295,8 @@ APR_DECLARE(apr_status_t) apr_mcast_hops(apr_socket_t *sock, apr_byte_t ttl) #endif } -APR_DECLARE(apr_status_t) apr_mcast_loopback(apr_socket_t *sock, - apr_byte_t opt) +APR_DECLARE(fspr_status_t) fspr_mcast_loopback(fspr_socket_t *sock, + fspr_byte_t opt) { #if defined(IP_MULTICAST_LOOP) && defined(HAVE_STRUCT_IPMREQ) return do_mcast_opt(IP_MULTICAST_LOOP, sock, opt); @@ -305,11 +305,11 @@ APR_DECLARE(apr_status_t) apr_mcast_loopback(apr_socket_t *sock, #endif } -APR_DECLARE(apr_status_t) apr_mcast_interface(apr_socket_t *sock, - apr_sockaddr_t *iface) +APR_DECLARE(fspr_status_t) fspr_mcast_interface(fspr_socket_t *sock, + fspr_sockaddr_t *iface) { #if defined(IP_MULTICAST_IF) && defined(HAVE_STRUCT_IPMREQ) - apr_status_t rv = APR_SUCCESS; + fspr_status_t rv = APR_SUCCESS; if (sock_is_ipv4(sock)) { if (setsockopt(sock->socketdes, IPPROTO_IP, IP_MULTICAST_IF, diff --git a/libs/apr/network_io/unix/sendrecv.c b/libs/apr/network_io/unix/sendrecv.c index ca7230accc..2015bf0bfc 100644 --- a/libs/apr/network_io/unix/sendrecv.c +++ b/libs/apr/network_io/unix/sendrecv.c @@ -14,12 +14,12 @@ * limitations under the License. */ -#include "apr_arch_networkio.h" -#include "apr_support.h" +#include "fspr_arch_networkio.h" +#include "fspr_support.h" #if APR_HAS_SENDFILE -/* This file is needed to allow us access to the apr_file_t internals. */ -#include "apr_arch_file_io.h" +/* This file is needed to allow us access to the fspr_file_t internals. */ +#include "fspr_arch_file_io.h" #endif /* APR_HAS_SENDFILE */ /* osreldate.h is only needed on FreeBSD for sendfile detection */ @@ -29,10 +29,10 @@ #include /* assert() */ -apr_status_t apr_socket_send(apr_socket_t *sock, const char *buf, - apr_size_t *len) +fspr_status_t fspr_socket_send(fspr_socket_t *sock, const char *buf, + fspr_size_t *len) { - apr_ssize_t rv; + fspr_ssize_t rv; if (sock->options & APR_INCOMPLETE_WRITE) { sock->options &= ~APR_INCOMPLETE_WRITE; @@ -45,9 +45,9 @@ apr_status_t apr_socket_send(apr_socket_t *sock, const char *buf, while (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK) && (sock->timeout > 0)) { - apr_status_t arv; + fspr_status_t arv; do_select: - arv = apr_wait_for_io_or_timeout(NULL, sock, 0); + arv = fspr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -69,10 +69,10 @@ do_select: return APR_SUCCESS; } -apr_status_t apr_socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len) +fspr_status_t fspr_socket_recv(fspr_socket_t *sock, char *buf, fspr_size_t *len) { - apr_ssize_t rv; - apr_status_t arv; + fspr_ssize_t rv; + fspr_status_t arv; if (sock->options & APR_INCOMPLETE_READ) { sock->options &= ~APR_INCOMPLETE_READ; @@ -86,7 +86,7 @@ apr_status_t apr_socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len) while ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) && (sock->timeout > 0)) { do_select: - arv = apr_wait_for_io_or_timeout(NULL, sock, 1); + arv = fspr_wait_for_io_or_timeout(NULL, sock, 1); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -111,11 +111,11 @@ do_select: return APR_SUCCESS; } -apr_status_t apr_socket_sendto(apr_socket_t *sock, apr_sockaddr_t *where, - apr_int32_t flags, const char *buf, - apr_size_t *len) +fspr_status_t fspr_socket_sendto(fspr_socket_t *sock, fspr_sockaddr_t *where, + fspr_int32_t flags, const char *buf, + fspr_size_t *len) { - apr_ssize_t rv; + fspr_ssize_t rv; do { rv = sendto(sock->socketdes, buf, (*len), flags, @@ -125,7 +125,7 @@ apr_status_t apr_socket_sendto(apr_socket_t *sock, apr_sockaddr_t *where, while ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) && (sock->timeout > 0)) { - apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 0); + fspr_status_t arv = fspr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -145,11 +145,11 @@ apr_status_t apr_socket_sendto(apr_socket_t *sock, apr_sockaddr_t *where, return APR_SUCCESS; } -apr_status_t apr_socket_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, - apr_int32_t flags, char *buf, - apr_size_t *len) +fspr_status_t fspr_socket_recvfrom(fspr_sockaddr_t *from, fspr_socket_t *sock, + fspr_int32_t flags, char *buf, + fspr_size_t *len) { - apr_ssize_t rv; + fspr_ssize_t rv; from->salen = sizeof(from->sa); @@ -160,7 +160,7 @@ apr_status_t apr_socket_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, while ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) && (sock->timeout > 0)) { - apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 1); + fspr_status_t arv = fspr_wait_for_io_or_timeout(NULL, sock, 1); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -176,7 +176,7 @@ apr_status_t apr_socket_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, return errno; } - apr_sockaddr_vars_set(from, from->sa.sin.sin_family, ntohs(from->sa.sin.sin_port)); + fspr_sockaddr_vars_set(from, from->sa.sin.sin_family, ntohs(from->sa.sin.sin_port)); (*len) = rv; if (rv == 0 && sock->type == SOCK_STREAM) { @@ -186,13 +186,13 @@ apr_status_t apr_socket_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, return APR_SUCCESS; } -apr_status_t apr_socket_sendv(apr_socket_t * sock, const struct iovec *vec, - apr_int32_t nvec, apr_size_t *len) +fspr_status_t fspr_socket_sendv(fspr_socket_t * sock, const struct iovec *vec, + fspr_int32_t nvec, fspr_size_t *len) { #ifdef HAVE_WRITEV - apr_ssize_t rv; - apr_size_t requested_len = 0; - apr_int32_t i; + fspr_ssize_t rv; + fspr_size_t requested_len = 0; + fspr_int32_t i; for (i = 0; i < nvec; i++) { requested_len += vec[i].iov_len; @@ -209,9 +209,9 @@ apr_status_t apr_socket_sendv(apr_socket_t * sock, const struct iovec *vec, while ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) && (sock->timeout > 0)) { - apr_status_t arv; + fspr_status_t arv; do_select: - arv = apr_wait_for_io_or_timeout(NULL, sock, 0); + arv = fspr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -233,7 +233,7 @@ do_select: return APR_SUCCESS; #else *len = vec[0].iov_len; - return apr_socket_send(sock, vec[0].iov_base, len); + return fspr_socket_send(sock, vec[0].iov_base, len); #endif } @@ -245,27 +245,27 @@ do_select: /* TODO: what should flags be? int_32? */ /* Define a structure to pass in when we have a NULL header value */ -static apr_hdtr_t no_hdtr; +static fspr_hdtr_t no_hdtr; #if defined(__linux__) && defined(HAVE_WRITEV) -apr_status_t apr_socket_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) +fspr_status_t fspr_socket_sendfile(fspr_socket_t *sock, fspr_file_t *file, + fspr_hdtr_t *hdtr, fspr_off_t *offset, + fspr_size_t *len, fspr_int32_t flags) { int rv, nbytes = 0, total_hdrbytes, i; - apr_status_t arv; + fspr_status_t arv; #if APR_HAS_LARGE_FILES && defined(HAVE_SENDFILE64) - apr_off_t off = *offset; + fspr_off_t off = *offset; #define sendfile sendfile64 #elif APR_HAS_LARGE_FILES && SIZEOF_OFF_T == 4 - /* 64-bit apr_off_t but no sendfile64(): fail if trying to send + /* 64-bit fspr_off_t but no sendfile64(): fail if trying to send * past the 2Gb limit. */ off_t off; - if ((apr_int64_t)*offset + *len > INT_MAX) { + if ((fspr_int64_t)*offset + *len > INT_MAX) { return EINVAL; } @@ -292,16 +292,16 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, assert(flags==0); if (hdtr->numheaders > 0) { - apr_size_t hdrbytes; + fspr_size_t hdrbytes; /* cork before writing headers */ - rv = apr_socket_opt_set(sock, APR_TCP_NOPUSH, 1); + rv = fspr_socket_opt_set(sock, APR_TCP_NOPUSH, 1); if (rv != APR_SUCCESS) { return rv; } /* Now write the headers */ - arv = apr_socket_sendv(sock, hdtr->headers, hdtr->numheaders, + arv = fspr_socket_sendv(sock, hdtr->headers, hdtr->numheaders, &hdrbytes); if (arv != APR_SUCCESS) { *len = 0; @@ -319,7 +319,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, } if (hdrbytes < total_hdrbytes) { *len = hdrbytes; - return apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); + return fspr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); } } @@ -338,7 +338,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, while ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) && (sock->timeout > 0)) { do_select: - arv = apr_wait_for_io_or_timeout(NULL, sock, 0); + arv = fspr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -356,7 +356,7 @@ do_select: if (rv == -1) { *len = nbytes; rv = errno; - apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); + fspr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); return rv; } @@ -364,7 +364,7 @@ do_select: if (rv < *len) { *len = nbytes; - arv = apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); + arv = fspr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); if (rv > 0) { /* If this was a partial write, return now with the @@ -388,19 +388,19 @@ do_select: /* Now write the footers */ if (hdtr->numtrailers > 0) { - apr_size_t trbytes; - arv = apr_socket_sendv(sock, hdtr->trailers, hdtr->numtrailers, + fspr_size_t trbytes; + arv = fspr_socket_sendv(sock, hdtr->trailers, hdtr->numtrailers, &trbytes); nbytes += trbytes; if (arv != APR_SUCCESS) { *len = nbytes; rv = errno; - apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); + fspr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); return rv; } } - apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); + fspr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); (*len) = nbytes; return rv < 0 ? errno : APR_SUCCESS; @@ -409,11 +409,11 @@ do_select: #elif defined(DARWIN) /* OS/X Release 10.5 or greater */ -apr_status_t apr_socket_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) +fspr_status_t fspr_socket_sendfile(fspr_socket_t * sock, fspr_file_t * file, + fspr_hdtr_t * hdtr, fspr_off_t * offset, + fspr_size_t * len, fspr_int32_t flags) { - apr_off_t nbytes = *len; + fspr_off_t nbytes = *len; int rv; struct sf_hdtr headerstruct; @@ -432,9 +432,9 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, /* BSD can send the headers/footers as part of the system call */ do { if (sock->options & APR_INCOMPLETE_WRITE) { - apr_status_t arv; + fspr_status_t arv; sock->options &= ~APR_INCOMPLETE_WRITE; - arv = apr_wait_for_io_or_timeout(NULL, sock, 0); + arv = fspr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -494,7 +494,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, } if ((rv == -1) && (errno == EAGAIN) && (sock->timeout > 0)) { - apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 0); + fspr_status_t arv = fspr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -512,9 +512,9 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, #elif defined(__FreeBSD__) || defined(__DragonFly__) /* Release 3.1 or greater */ -apr_status_t apr_socket_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) +fspr_status_t fspr_socket_sendfile(fspr_socket_t * sock, fspr_file_t * file, + fspr_hdtr_t * hdtr, fspr_off_t * offset, + fspr_size_t * len, fspr_int32_t flags) { off_t nbytes = 0; int rv; @@ -522,7 +522,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, int i; #endif struct sf_hdtr headerstruct; - apr_size_t bytes_to_send = *len; + fspr_size_t bytes_to_send = *len; /* Ignore flags for now. */ flags = 0; @@ -555,9 +555,9 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, /* FreeBSD can send the headers/footers as part of the system call */ do { if (sock->options & APR_INCOMPLETE_WRITE) { - apr_status_t arv; + fspr_status_t arv; sock->options &= ~APR_INCOMPLETE_WRITE; - arv = apr_wait_for_io_or_timeout(NULL, sock, 0); + arv = fspr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -618,7 +618,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, } if ((rv == -1) && (errno == EAGAIN) && (sock->timeout > 0)) { - apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 0); + fspr_status_t arv = fspr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -639,13 +639,13 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, sendfile(int fd, int s, off_t offset, off_t *len, struct sf_hdtr *hdtr, int flags); */ -apr_status_t apr_socket_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) +fspr_status_t fspr_socket_sendfile(fspr_socket_t * sock, fspr_file_t * file, + fspr_hdtr_t * hdtr, fspr_off_t * offset, + fspr_size_t * len, fspr_int32_t flags) { int rv, i; struct sf_hdtr headerstruct; - apr_off_t bytes_to_send = *len; + fspr_off_t bytes_to_send = *len; /* Ignore flags for now. */ flags = 0; @@ -670,9 +670,9 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, do { if (sock->options & APR_INCOMPLETE_WRITE) { - apr_status_t arv; + fspr_status_t arv; sock->options &= ~APR_INCOMPLETE_WRITE; - arv = apr_wait_for_io_or_timeout(NULL, sock, 0); + arv = fspr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -736,7 +736,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, } if ((rv == -1) && (errno == EAGAIN) && (sock->timeout > 0)) { - apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 0); + fspr_status_t arv = fspr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -767,32 +767,32 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, * if nbytes == 0, the rest of the file (from offset) is sent */ -apr_status_t apr_socket_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) +fspr_status_t fspr_socket_sendfile(fspr_socket_t *sock, fspr_file_t *file, + fspr_hdtr_t *hdtr, fspr_off_t *offset, + fspr_size_t *len, fspr_int32_t flags) { int i; - apr_ssize_t rc; - apr_size_t nbytes = *len, headerlen, trailerlen; + fspr_ssize_t rc; + fspr_size_t nbytes = *len, headerlen, trailerlen; struct iovec hdtrarray[2]; char *headerbuf, *trailerbuf; #if APR_HAS_LARGE_FILES && defined(HAVE_SENDFILE64) /* later HP-UXes have a sendfile64() */ #define sendfile sendfile64 - apr_off_t off = *offset; + fspr_off_t off = *offset; #elif APR_HAS_LARGE_FILES && SIZEOF_OFF_T == 4 /* HP-UX 11.00 doesn't have a sendfile64(): fail if trying to send * past the 2Gb limit */ off_t off; - if ((apr_int64_t)*offset + *len > INT_MAX) { + if ((fspr_int64_t)*offset + *len > INT_MAX) { return EINVAL; } off = *offset; #else - apr_off_t off = *offset; + fspr_off_t off = *offset; #endif if (!hdtr) { @@ -821,7 +821,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, } /* XXX: BUHHH? wow, what a memory leak! */ - headerbuf = hdtrarray[0].iov_base = apr_palloc(sock->pool, headerlen); + headerbuf = hdtrarray[0].iov_base = fspr_palloc(sock->pool, headerlen); hdtrarray[0].iov_len = headerlen; for (i = 0; i < hdtr->numheaders; i++) { @@ -846,7 +846,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, } /* XXX: BUHHH? wow, what a memory leak! */ - trailerbuf = hdtrarray[1].iov_base = apr_palloc(sock->pool, trailerlen); + trailerbuf = hdtrarray[1].iov_base = fspr_palloc(sock->pool, trailerlen); hdtrarray[1].iov_len = trailerlen; for (i = 0; i < hdtr->numtrailers; i++) { @@ -872,7 +872,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, while ((rc == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) && (sock->timeout > 0)) { - apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 0); + fspr_status_t arv = fspr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; @@ -915,13 +915,13 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, * AIX - version 4.3.2 with APAR IX85388, or version 4.3.3 and above * OS/390 - V2R7 and above */ -apr_status_t apr_socket_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) +fspr_status_t fspr_socket_sendfile(fspr_socket_t * sock, fspr_file_t * file, + fspr_hdtr_t * hdtr, fspr_off_t * offset, + fspr_size_t * len, fspr_int32_t flags) { int i, ptr, rv = 0; void * hbuf=NULL, * tbuf=NULL; - apr_status_t arv; + fspr_status_t arv; struct sf_parms parms; if (!hdtr) { @@ -951,13 +951,13 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, parms.header_length += hdtr->headers[i].iov_len; } #if 0 - /* Keepalives make apr_palloc a bad idea */ + /* Keepalives make fspr_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 = apr_palloc(sock->pool, parms.header_length); + hbuf = fspr_palloc(sock->pool, parms.header_length); #endif ptr = 0; for (i = 0; i < hdtr->numheaders; i++) { @@ -980,10 +980,10 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, parms.trailer_length += hdtr->trailers[i].iov_len; } #if 0 - /* Keepalives make apr_palloc a bad idea */ + /* Keepalives make fspr_palloc a bad idea */ tbuf = malloc(parms.trailer_length); #else - tbuf = apr_palloc(sock->pool, parms.trailer_length); + tbuf = fspr_palloc(sock->pool, parms.trailer_length); #endif ptr = 0; for (i = 0; i < hdtr->numtrailers; i++) { @@ -1020,7 +1020,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file, while ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) && (sock->timeout > 0)) { do_select: - arv = apr_wait_for_io_or_timeout(NULL, sock, 0); + arv = fspr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -1077,15 +1077,15 @@ do_select: #define sendfilev sendfilev64 #endif -apr_status_t apr_socket_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) +fspr_status_t fspr_socket_sendfile(fspr_socket_t *sock, fspr_file_t *file, + fspr_hdtr_t *hdtr, fspr_off_t *offset, + fspr_size_t *len, fspr_int32_t flags) { - apr_status_t rv, arv; - apr_size_t nbytes; + fspr_status_t rv, arv; + fspr_size_t nbytes; sendfilevec_t *sfv; int vecs, curvec, i, repeat; - apr_size_t requested_len = 0; + fspr_size_t requested_len = 0; if (!hdtr) { hdtr = &no_hdtr; @@ -1096,7 +1096,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, /* Calculate how much space we need. */ vecs = hdtr->numheaders + hdtr->numtrailers + 1; - sfv = apr_palloc(sock->pool, sizeof(sendfilevec_t) * vecs); + sfv = fspr_palloc(sock->pool, sizeof(sendfilevec_t) * vecs); curvec = 0; @@ -1140,7 +1140,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, */ if (sock->options & APR_INCOMPLETE_WRITE) { sock->options &= ~APR_INCOMPLETE_WRITE; - arv = apr_wait_for_io_or_timeout(NULL, sock, 0); + arv = fspr_wait_for_io_or_timeout(NULL, sock, 0); if (arv != APR_SUCCESS) { *len = 0; return arv; @@ -1170,7 +1170,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, rv = 0; } else if (!arv && (sock->timeout > 0)) { - apr_status_t t = apr_wait_for_io_or_timeout(NULL, sock, 0); + fspr_status_t t = fspr_wait_for_io_or_timeout(NULL, sock, 0); if (t != APR_SUCCESS) { *len = 0; @@ -1198,7 +1198,7 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, #else #error APR has detected sendfile on your system, but nobody has written a #error version of it for APR yet. To get past this, either write -#error apr_socket_sendfile or change APR_HAS_SENDFILE in apr.h to 0. +#error fspr_socket_sendfile or change APR_HAS_SENDFILE in apr.h to 0. #endif /* __linux__, __FreeBSD__, __DragonFly__, __HPUX__, _AIX, __MVS__, Tru64/OSF1 */ diff --git a/libs/apr/network_io/unix/sockaddr.c b/libs/apr/network_io/unix/sockaddr.c index 33d2400a74..fd9aae8108 100644 --- a/libs/apr/network_io/unix/sockaddr.c +++ b/libs/apr/network_io/unix/sockaddr.c @@ -14,28 +14,28 @@ * limitations under the License. */ -#include "apr_arch_networkio.h" -#include "apr_strings.h" -#include "apr.h" -#include "apr_lib.h" -#include "apr_strings.h" -#include "apr_private.h" +#include "fspr_arch_networkio.h" +#include "fspr_strings.h" +#include "fspr.h" +#include "fspr_lib.h" +#include "fspr_strings.h" +#include "fspr_private.h" #if APR_HAVE_STDLIB_H #include #endif #define APR_WANT_STRFUNC -#include "apr_want.h" +#include "fspr_want.h" -struct apr_ipsubnet_t { +struct fspr_ipsubnet_t { int family; #if APR_HAVE_IPV6 - apr_uint32_t sub[4]; /* big enough for IPv4 and IPv6 addresses */ - apr_uint32_t mask[4]; + fspr_uint32_t sub[4]; /* big enough for IPv4 and IPv6 addresses */ + fspr_uint32_t mask[4]; #else - apr_uint32_t sub[1]; - apr_uint32_t mask[1]; + fspr_uint32_t sub[1]; + fspr_uint32_t mask[1]; #endif }; @@ -68,12 +68,12 @@ static void *getservbyname(const char *name, const char *proto) } #endif -static apr_status_t get_local_addr(apr_socket_t *sock) +static fspr_status_t get_local_addr(fspr_socket_t *sock) { sock->local_addr->salen = sizeof(sock->local_addr->sa); if (getsockname(sock->socketdes, (struct sockaddr *)&sock->local_addr->sa, &sock->local_addr->salen) < 0) { - return apr_get_netos_error(); + return fspr_get_netos_error(); } else { sock->local_port_unknown = sock->local_interface_unknown = 0; @@ -83,12 +83,12 @@ static apr_status_t get_local_addr(apr_socket_t *sock) } } -static apr_status_t get_remote_addr(apr_socket_t *sock) +static fspr_status_t get_remote_addr(fspr_socket_t *sock) { sock->remote_addr->salen = sizeof(sock->remote_addr->sa); if (getpeername(sock->socketdes, (struct sockaddr *)&sock->remote_addr->sa, &sock->remote_addr->salen) < 0) { - return apr_get_netos_error(); + return fspr_get_netos_error(); } else { sock->remote_addr_unknown = 0; @@ -98,11 +98,11 @@ static apr_status_t get_remote_addr(apr_socket_t *sock) } } -APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr, - apr_sockaddr_t *sockaddr) +APR_DECLARE(fspr_status_t) fspr_sockaddr_ip_get(char **addr, + fspr_sockaddr_t *sockaddr) { - *addr = apr_palloc(sockaddr->pool, sockaddr->addr_str_len); - apr_inet_ntop(sockaddr->family, + *addr = fspr_palloc(sockaddr->pool, sockaddr->addr_str_len); + fspr_inet_ntop(sockaddr->family, sockaddr->ipaddr_ptr, *addr, sockaddr->addr_str_len); @@ -119,7 +119,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr, return APR_SUCCESS; } -void apr_sockaddr_vars_set(apr_sockaddr_t *addr, int family, apr_port_t port) +void fspr_sockaddr_vars_set(fspr_sockaddr_t *addr, int family, fspr_port_t port) { addr->family = family; addr->sa.sin.sin_family = family; @@ -145,13 +145,13 @@ void apr_sockaddr_vars_set(apr_sockaddr_t *addr, int family, apr_port_t port) #endif } -APR_DECLARE(apr_status_t) apr_socket_addr_get(apr_sockaddr_t **sa, - apr_interface_e which, - apr_socket_t *sock) +APR_DECLARE(fspr_status_t) fspr_socket_addr_get(fspr_sockaddr_t **sa, + fspr_interface_e which, + fspr_socket_t *sock) { if (which == APR_LOCAL) { if (sock->local_interface_unknown || sock->local_port_unknown) { - apr_status_t rv = get_local_addr(sock); + fspr_status_t rv = get_local_addr(sock); if (rv != APR_SUCCESS) { return rv; @@ -161,7 +161,7 @@ APR_DECLARE(apr_status_t) apr_socket_addr_get(apr_sockaddr_t **sa, } else if (which == APR_REMOTE) { if (sock->remote_addr_unknown) { - apr_status_t rv = get_remote_addr(sock); + fspr_status_t rv = get_remote_addr(sock); if (rv != APR_SUCCESS) { return rv; @@ -176,15 +176,15 @@ APR_DECLARE(apr_status_t) apr_socket_addr_get(apr_sockaddr_t **sa, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr, +APR_DECLARE(fspr_status_t) fspr_parse_addr_port(char **addr, char **scope_id, - apr_port_t *port, + fspr_port_t *port, const char *str, - apr_pool_t *p) + fspr_pool_t *p) { const char *ch, *lastchar; int big_port; - apr_size_t addrlen; + fspr_size_t addrlen; *addr = NULL; /* assume not specified */ *scope_id = NULL; /* assume not specified */ @@ -194,7 +194,7 @@ APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr, * is specified in the string. */ ch = lastchar = str + strlen(str) - 1; - while (ch >= str && apr_isdigit(*ch)) { + while (ch >= str && fspr_isdigit(*ch)) { --ch; } @@ -245,7 +245,7 @@ APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr, return APR_EINVAL; } addrlen = scope_delim - str - 1; - *scope_id = apr_palloc(p, end_bracket - scope_delim); + *scope_id = fspr_palloc(p, end_bracket - scope_delim); memcpy(*scope_id, scope_delim + 1, end_bracket - scope_delim - 1); (*scope_id)[end_bracket - scope_delim - 1] = '\0'; } @@ -253,12 +253,12 @@ APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr, addrlen = addrlen - 2; /* minus 2 for '[' and ']' */ } - *addr = apr_palloc(p, addrlen + 1); + *addr = fspr_palloc(p, addrlen + 1); memcpy(*addr, str + 1, addrlen); (*addr)[addrlen] = '\0'; - if (apr_inet_pton(AF_INET6, *addr, &ipaddr) != 1) { + if (fspr_inet_pton(AF_INET6, *addr, &ipaddr) != 1) { *addr = NULL; *scope_id = NULL; *port = 0; @@ -271,7 +271,7 @@ APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr, /* XXX If '%' is not a valid char in a DNS name, we *could* check * for bogus scope ids first. */ - *addr = apr_palloc(p, addrlen + 1); + *addr = fspr_palloc(p, addrlen + 1); memcpy(*addr, str, addrlen); (*addr)[addrlen] = '\0'; } @@ -280,13 +280,13 @@ APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr, #if defined(HAVE_GETADDRINFO) -static apr_status_t call_resolver(apr_sockaddr_t **sa, - const char *hostname, apr_int32_t family, - apr_port_t port, apr_int32_t flags, - apr_pool_t *p) +static fspr_status_t call_resolver(fspr_sockaddr_t **sa, + const char *hostname, fspr_int32_t family, + fspr_port_t port, fspr_int32_t flags, + fspr_pool_t *p) { struct addrinfo hints, *ai, *ai_list; - apr_sockaddr_t *prev_sa; + fspr_sockaddr_t *prev_sa; int error; char *servname = NULL; @@ -331,7 +331,7 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, } else #endif /* _AIX */ - servname = apr_itoa(p, port); + servname = fspr_itoa(p, port); #endif /* OSF1 */ } error = getaddrinfo(hostname, servname, &hints, &ai_list); @@ -365,7 +365,7 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, prev_sa = NULL; ai = ai_list; while (ai) { /* while more addresses to report */ - apr_sockaddr_t *new_sa; + fspr_sockaddr_t *new_sa; /* Ignore anything bogus: getaddrinfo in some old versions of * glibc will return AF_UNIX entries for APR_UNSPEC+AI_PASSIVE @@ -375,15 +375,15 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, continue; } - new_sa = apr_pcalloc(p, sizeof(apr_sockaddr_t)); + new_sa = fspr_pcalloc(p, sizeof(fspr_sockaddr_t)); new_sa->pool = p; memcpy(&new_sa->sa, ai->ai_addr, ai->ai_addrlen); - apr_sockaddr_vars_set(new_sa, ai->ai_family, port); + fspr_sockaddr_vars_set(new_sa, ai->ai_family, port); if (!prev_sa) { /* first element in new list */ if (hostname) { - new_sa->hostname = apr_pstrdup(p, hostname); + new_sa->hostname = fspr_pstrdup(p, hostname); } *sa = new_sa; } @@ -399,13 +399,13 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, return APR_SUCCESS; } -static apr_status_t find_addresses(apr_sockaddr_t **sa, - const char *hostname, apr_int32_t family, - apr_port_t port, apr_int32_t flags, - apr_pool_t *p) +static fspr_status_t find_addresses(fspr_sockaddr_t **sa, + const char *hostname, fspr_int32_t family, + fspr_port_t port, fspr_int32_t flags, + fspr_pool_t *p) { if (flags & APR_IPV4_ADDR_OK) { - apr_status_t error = call_resolver(sa, hostname, AF_INET, port, flags, p); + fspr_status_t error = call_resolver(sa, hostname, AF_INET, port, flags, p); #if APR_HAVE_IPV6 if (error) { @@ -417,7 +417,7 @@ static apr_status_t find_addresses(apr_sockaddr_t **sa, } #if APR_HAVE_IPV6 else if (flags & APR_IPV6_ADDR_OK) { - apr_status_t error = call_resolver(sa, hostname, AF_INET6, port, flags, p); + fspr_status_t error = call_resolver(sa, hostname, AF_INET6, port, flags, p); if (error) { family = AF_INET; /* try again */ @@ -433,13 +433,13 @@ static apr_status_t find_addresses(apr_sockaddr_t **sa, #else /* end of HAVE_GETADDRINFO code */ -static apr_status_t find_addresses(apr_sockaddr_t **sa, - const char *hostname, apr_int32_t family, - apr_port_t port, apr_int32_t flags, - apr_pool_t *p) +static fspr_status_t find_addresses(fspr_sockaddr_t **sa, + const char *hostname, fspr_int32_t family, + fspr_port_t port, fspr_int32_t flags, + fspr_pool_t *p) { struct hostent *hp; - apr_sockaddr_t *prev_sa; + fspr_sockaddr_t *prev_sa; int curaddr; #if APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \ defined(HAVE_GETHOSTBYNAME_R) && !defined(BEOS) @@ -498,7 +498,7 @@ static apr_status_t find_addresses(apr_sockaddr_t **sa, if (!hp) { #ifdef WIN32 - return apr_get_netos_error(); + return fspr_get_netos_error(); #else return (h_errno + APR_OS_START_SYSERR); #endif @@ -508,15 +508,15 @@ static apr_status_t find_addresses(apr_sockaddr_t **sa, prev_sa = NULL; curaddr = 0; while (hp->h_addr_list[curaddr]) { - apr_sockaddr_t *new_sa = apr_pcalloc(p, sizeof(apr_sockaddr_t)); + fspr_sockaddr_t *new_sa = fspr_pcalloc(p, sizeof(fspr_sockaddr_t)); new_sa->pool = p; new_sa->sa.sin.sin_addr = *(struct in_addr *)hp->h_addr_list[curaddr]; - apr_sockaddr_vars_set(new_sa, AF_INET, port); + fspr_sockaddr_vars_set(new_sa, AF_INET, port); if (!prev_sa) { /* first element in new list */ if (orig_hostname) { - new_sa->hostname = apr_pstrdup(p, orig_hostname); + new_sa->hostname = fspr_pstrdup(p, orig_hostname); } *sa = new_sa; } @@ -534,12 +534,12 @@ static apr_status_t find_addresses(apr_sockaddr_t **sa, #endif /* end of !HAVE_GETADDRINFO code */ -APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, +APR_DECLARE(fspr_status_t) fspr_sockaddr_info_get(fspr_sockaddr_t **sa, const char *hostname, - apr_int32_t family, apr_port_t port, - apr_int32_t flags, apr_pool_t *p) + fspr_int32_t family, fspr_port_t port, + fspr_int32_t flags, fspr_pool_t *p) { - apr_int32_t masked; + fspr_int32_t masked; *sa = NULL; if ((masked = flags & (APR_IPV4_ADDR_OK | APR_IPV6_ADDR_OK))) { @@ -568,9 +568,9 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, return find_addresses(sa, hostname, family, port, flags, p); } -APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, - apr_sockaddr_t *sockaddr, - apr_int32_t flags) +APR_DECLARE(fspr_status_t) fspr_getnameinfo(char **hostname, + fspr_sockaddr_t *sockaddr, + fspr_int32_t flags) { #if defined(HAVE_GETNAMEINFO) int rc; @@ -597,7 +597,7 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, struct sockaddr_in tmpsa; tmpsa.sin_family = AF_INET; tmpsa.sin_port = 0; - tmpsa.sin_addr.s_addr = ((apr_uint32_t *)sockaddr->ipaddr_ptr)[3]; + tmpsa.sin_addr.s_addr = ((fspr_uint32_t *)sockaddr->ipaddr_ptr)[3]; #ifdef SIN6_LEN tmpsa.sin_len = sizeof(tmpsa); #endif @@ -635,7 +635,7 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, return rc + APR_OS_START_EAIERR; /* return the EAI_ error */ } } - *hostname = sockaddr->hostname = apr_pstrdup(sockaddr->pool, + *hostname = sockaddr->hostname = fspr_pstrdup(sockaddr->pool, tmphostname); return APR_SUCCESS; #else @@ -678,12 +678,12 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, #endif if (hptr) { - *hostname = sockaddr->hostname = apr_pstrdup(sockaddr->pool, hptr->h_name); + *hostname = sockaddr->hostname = fspr_pstrdup(sockaddr->pool, hptr->h_name); return APR_SUCCESS; } *hostname = NULL; #if defined(WIN32) - return apr_get_netos_error(); + return fspr_get_netos_error(); #elif defined(OS2) return h_errno; #else @@ -692,7 +692,7 @@ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, #endif } -APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr, +APR_DECLARE(fspr_status_t) fspr_getservbyname(fspr_sockaddr_t *sockaddr, const char *servname) { struct servent *se; @@ -702,7 +702,7 @@ APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr, if ((se = getservbyname(servname, NULL)) != NULL){ sockaddr->port = htons(se->s_port); - sockaddr->servname = apr_pstrdup(sockaddr->pool, servname); + sockaddr->servname = fspr_pstrdup(sockaddr->pool, servname); sockaddr->sa.sin.sin_port = se->s_port; return APR_SUCCESS; } @@ -717,8 +717,8 @@ APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr, &((struct in6_addr *)(b)->ipaddr_ptr)->s6_addr[12], \ (a)->ipaddr_len)) -APR_DECLARE(int) apr_sockaddr_equal(const apr_sockaddr_t *addr1, - const apr_sockaddr_t *addr2) +APR_DECLARE(int) fspr_sockaddr_equal(const fspr_sockaddr_t *addr1, + const fspr_sockaddr_t *addr2) { if (addr1->ipaddr_len == addr2->ipaddr_len && !memcmp(addr1->ipaddr_ptr, addr2->ipaddr_ptr, addr1->ipaddr_len)) { @@ -735,7 +735,7 @@ APR_DECLARE(int) apr_sockaddr_equal(const apr_sockaddr_t *addr1, return 0; /* not equal */ } -static apr_status_t parse_network(apr_ipsubnet_t *ipsub, const char *network) +static fspr_status_t parse_network(fspr_ipsubnet_t *ipsub, const char *network) { /* legacy syntax for ip addrs: a.b.c. ==> a.b.c.0/24 for example */ int shift; @@ -757,10 +757,10 @@ static apr_status_t parse_network(apr_ipsubnet_t *ipsub, const char *network) shift = 24; while (*s) { t = s; - if (!apr_isdigit(*t)) { + if (!fspr_isdigit(*t)) { return APR_EBADIP; } - while (apr_isdigit(*t)) { + while (fspr_isdigit(*t)) { ++t; } if (*t == '.') { @@ -793,7 +793,7 @@ static apr_status_t parse_network(apr_ipsubnet_t *ipsub, const char *network) * APR_BADMASK mask portion is not valid */ -static apr_status_t parse_ip(apr_ipsubnet_t *ipsub, const char *ipstr, int network_allowed) +static fspr_status_t parse_ip(fspr_ipsubnet_t *ipsub, const char *ipstr, int network_allowed) { /* supported flavors of IP: * @@ -810,10 +810,10 @@ static apr_status_t parse_ip(apr_ipsubnet_t *ipsub, const char *ipstr, int netwo int rc; #if APR_HAVE_IPV6 - rc = apr_inet_pton(AF_INET6, ipstr, ipsub->sub); + rc = fspr_inet_pton(AF_INET6, ipstr, ipsub->sub); if (rc == 1) { if (IN6_IS_ADDR_V4MAPPED((struct in6_addr *)ipsub->sub)) { - /* apr_ipsubnet_test() assumes that we don't create IPv4-mapped IPv6 + /* fspr_ipsubnet_test() assumes that we don't create IPv4-mapped IPv6 * addresses; this of course forces the user to specify IPv4 addresses * in a.b.c.d style instead of ::ffff:a.b.c.d style. */ @@ -824,7 +824,7 @@ static apr_status_t parse_ip(apr_ipsubnet_t *ipsub, const char *ipstr, int netwo else #endif { - rc = apr_inet_pton(AF_INET, ipstr, ipsub->sub); + rc = fspr_inet_pton(AF_INET, ipstr, ipsub->sub); if (rc == 1) { ipsub->family = AF_INET; } @@ -848,28 +848,28 @@ static int looks_like_ip(const char *ipstr) } /* simple IPv4 address string check */ - while ((*ipstr == '.') || apr_isdigit(*ipstr)) + while ((*ipstr == '.') || fspr_isdigit(*ipstr)) ipstr++; return (*ipstr == '\0'); } -static void fix_subnet(apr_ipsubnet_t *ipsub) +static void fix_subnet(fspr_ipsubnet_t *ipsub) { /* in case caller specified more bits in network address than are * valid according to the mask, turn off the extra bits */ int i; - for (i = 0; i < sizeof ipsub->mask / sizeof(apr_int32_t); i++) { + for (i = 0; i < sizeof ipsub->mask / sizeof(fspr_int32_t); i++) { ipsub->sub[i] &= ipsub->mask[i]; } } /* be sure not to store any IPv4 address as a v4-mapped IPv6 address */ -APR_DECLARE(apr_status_t) apr_ipsubnet_create(apr_ipsubnet_t **ipsub, const char *ipstr, - const char *mask_or_numbits, apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_ipsubnet_create(fspr_ipsubnet_t **ipsub, const char *ipstr, + const char *mask_or_numbits, fspr_pool_t *p) { - apr_status_t rv; + fspr_status_t rv; char *endptr; long bits, maxbits = 32; @@ -882,7 +882,7 @@ APR_DECLARE(apr_status_t) apr_ipsubnet_create(apr_ipsubnet_t **ipsub, const char return APR_EINVAL; } - *ipsub = apr_pcalloc(p, sizeof(apr_ipsubnet_t)); + *ipsub = fspr_pcalloc(p, sizeof(fspr_ipsubnet_t)); /* assume ipstr is an individual IP address, not a subnet */ memset((*ipsub)->mask, 0xFF, sizeof (*ipsub)->mask); @@ -902,7 +902,7 @@ APR_DECLARE(apr_status_t) apr_ipsubnet_create(apr_ipsubnet_t **ipsub, const char if (*endptr == '\0' && bits > 0 && bits <= maxbits) { /* valid num-bits string; fill in mask appropriately */ int cur_entry = 0; - apr_int32_t cur_bit_value; + fspr_int32_t cur_bit_value; memset((*ipsub)->mask, 0, sizeof (*ipsub)->mask); while (bits > 32) { @@ -918,7 +918,7 @@ APR_DECLARE(apr_status_t) apr_ipsubnet_create(apr_ipsubnet_t **ipsub, const char } (*ipsub)->mask[cur_entry] = htonl((*ipsub)->mask[cur_entry]); } - else if (apr_inet_pton(AF_INET, mask_or_numbits, (*ipsub)->mask) == 1 && + else if (fspr_inet_pton(AF_INET, mask_or_numbits, (*ipsub)->mask) == 1 && (*ipsub)->family == AF_INET) { /* valid IPv4 netmask */ } @@ -932,7 +932,7 @@ APR_DECLARE(apr_status_t) apr_ipsubnet_create(apr_ipsubnet_t **ipsub, const char return APR_SUCCESS; } -APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa) +APR_DECLARE(int) fspr_ipsubnet_test(fspr_ipsubnet_t *ipsub, fspr_sockaddr_t *sa) { #if APR_HAVE_IPV6 /* XXX This line will segv on Win32 build with APR_HAVE_IPV6, @@ -946,12 +946,12 @@ APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa) } else if (IN6_IS_ADDR_V4MAPPED((struct in6_addr *)sa->ipaddr_ptr)) { if (ipsub->family == AF_INET && - (((apr_uint32_t *)sa->ipaddr_ptr)[3] & ipsub->mask[0]) == ipsub->sub[0]) { + (((fspr_uint32_t *)sa->ipaddr_ptr)[3] & ipsub->mask[0]) == ipsub->sub[0]) { return 1; } } else { - apr_uint32_t *addr = (apr_uint32_t *)sa->ipaddr_ptr; + fspr_uint32_t *addr = (fspr_uint32_t *)sa->ipaddr_ptr; if ((addr[0] & ipsub->mask[0]) == ipsub->sub[0] && (addr[1] & ipsub->mask[1]) == ipsub->sub[1] && diff --git a/libs/apr/network_io/unix/sockets.c b/libs/apr/network_io/unix/sockets.c index 72dab7b89c..6475599cfd 100644 --- a/libs/apr/network_io/unix/sockets.c +++ b/libs/apr/network_io/unix/sockets.c @@ -14,12 +14,12 @@ * limitations under the License. */ -#include "apr_arch_networkio.h" -#include "apr_network_io.h" -#include "apr_strings.h" -#include "apr_support.h" -#include "apr_portable.h" -#include "apr_arch_inherit.h" +#include "fspr_arch_networkio.h" +#include "fspr_network_io.h" +#include "fspr_strings.h" +#include "fspr_support.h" +#include "fspr_portable.h" +#include "fspr_arch_inherit.h" #ifdef BEOS_R5 #undef close @@ -28,9 +28,9 @@ static char generic_inaddr_any[16] = {0}; /* big enough for IPv4 or IPv6 */ -static apr_status_t socket_cleanup(void *sock) +static fspr_status_t socket_cleanup(void *sock) { - apr_socket_t *thesocket = sock; + fspr_socket_t *thesocket = sock; if (!thesocket) { return APR_ENOTSOCK; @@ -49,12 +49,12 @@ static apr_status_t socket_cleanup(void *sock) } } -static void set_socket_vars(apr_socket_t *sock, int family, int type, int protocol) +static void set_socket_vars(fspr_socket_t *sock, int family, int type, int protocol) { sock->type = type; sock->protocol = protocol; - apr_sockaddr_vars_set(sock->local_addr, family, 0); - apr_sockaddr_vars_set(sock->remote_addr, family, 0); + fspr_sockaddr_vars_set(sock->local_addr, family, 0); + fspr_sockaddr_vars_set(sock->remote_addr, family, 0); sock->options = 0; #if defined(BEOS) && !defined(BEOS_BONE) /* BeOS pre-BONE has TCP_NODELAY on by default and it can't be @@ -64,32 +64,32 @@ static void set_socket_vars(apr_socket_t *sock, int family, int type, int protoc #endif } -static void alloc_socket(apr_socket_t **new, apr_pool_t *p) +static void alloc_socket(fspr_socket_t **new, fspr_pool_t *p) { - *new = (apr_socket_t *)apr_pcalloc(p, sizeof(apr_socket_t)); + *new = (fspr_socket_t *)fspr_pcalloc(p, sizeof(fspr_socket_t)); (*new)->pool = p; - (*new)->local_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->pool, - sizeof(apr_sockaddr_t)); + (*new)->local_addr = (fspr_sockaddr_t *)fspr_pcalloc((*new)->pool, + sizeof(fspr_sockaddr_t)); (*new)->local_addr->pool = p; - (*new)->remote_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->pool, - sizeof(apr_sockaddr_t)); + (*new)->remote_addr = (fspr_sockaddr_t *)fspr_pcalloc((*new)->pool, + sizeof(fspr_sockaddr_t)); (*new)->remote_addr->pool = p; (*new)->remote_addr_unknown = 1; #ifndef WAITIO_USES_POLL /* Create a pollset with room for one descriptor. */ /* ### check return codes */ - (void) apr_pollset_create(&(*new)->pollset, 1, p, 0); + (void) fspr_pollset_create(&(*new)->pollset, 1, p, 0); #endif } -apr_status_t apr_socket_protocol_get(apr_socket_t *sock, int *protocol) +fspr_status_t fspr_socket_protocol_get(fspr_socket_t *sock, int *protocol) { *protocol = sock->protocol; return APR_SUCCESS; } -apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, - int protocol, apr_pool_t *cont) +fspr_status_t fspr_socket_create(fspr_socket_t **new, int ofamily, int type, + int protocol, fspr_pool_t *cont) { int family = ofamily; @@ -140,24 +140,24 @@ apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type, (*new)->timeout = -1; (*new)->inherit = 0; - apr_pool_cleanup_register((*new)->pool, (void *)(*new), socket_cleanup, + fspr_pool_cleanup_register((*new)->pool, (void *)(*new), socket_cleanup, socket_cleanup); return APR_SUCCESS; } -apr_status_t apr_socket_shutdown(apr_socket_t *thesocket, - apr_shutdown_how_e how) +fspr_status_t fspr_socket_shutdown(fspr_socket_t *thesocket, + fspr_shutdown_how_e how) { return (shutdown(thesocket->socketdes, how) == -1) ? errno : APR_SUCCESS; } -apr_status_t apr_socket_close(apr_socket_t *thesocket) +fspr_status_t fspr_socket_close(fspr_socket_t *thesocket) { - return apr_pool_cleanup_run(thesocket->pool, thesocket, socket_cleanup); + return fspr_pool_cleanup_run(thesocket->pool, thesocket, socket_cleanup); } -apr_status_t apr_socket_bind(apr_socket_t *sock, apr_sockaddr_t *sa) +fspr_status_t fspr_socket_bind(fspr_socket_t *sock, fspr_sockaddr_t *sa) { if (bind(sock->socketdes, (struct sockaddr *)&sa->sa, sa->salen) == -1) { @@ -173,7 +173,7 @@ apr_status_t apr_socket_bind(apr_socket_t *sock, apr_sockaddr_t *sa) } } -apr_status_t apr_socket_listen(apr_socket_t *sock, apr_int32_t backlog) +fspr_status_t fspr_socket_listen(fspr_socket_t *sock, fspr_int32_t backlog) { if (listen(sock->socketdes, backlog) == -1) return errno; @@ -181,8 +181,8 @@ apr_status_t apr_socket_listen(apr_socket_t *sock, apr_int32_t backlog) return APR_SUCCESS; } -apr_status_t apr_socket_accept(apr_socket_t **new, apr_socket_t *sock, - apr_pool_t *connection_context) +fspr_status_t fspr_socket_accept(fspr_socket_t **new, fspr_socket_t *sock, + fspr_pool_t *connection_context) { alloc_socket(new, connection_context); set_socket_vars(*new, sock->local_addr->sa.sin.sin_family, SOCK_STREAM, sock->protocol); @@ -232,13 +232,13 @@ apr_status_t apr_socket_accept(apr_socket_t **new, apr_socket_t *sock, } #if APR_TCP_NODELAY_INHERITED - if (apr_is_option_set(sock, APR_TCP_NODELAY) == 1) { - apr_set_option(*new, APR_TCP_NODELAY, 1); + if (fspr_is_option_set(sock, APR_TCP_NODELAY) == 1) { + fspr_set_option(*new, APR_TCP_NODELAY, 1); } #endif /* TCP_NODELAY_INHERITED */ #if APR_O_NONBLOCK_INHERITED - if (apr_is_option_set(sock, APR_SO_NONBLOCK) == 1) { - apr_set_option(*new, APR_SO_NONBLOCK, 1); + if (fspr_is_option_set(sock, APR_SO_NONBLOCK) == 1) { + fspr_set_option(*new, APR_SO_NONBLOCK, 1); } #endif /* APR_O_NONBLOCK_INHERITED */ @@ -256,12 +256,12 @@ apr_status_t apr_socket_accept(apr_socket_t **new, apr_socket_t *sock, } (*new)->inherit = 0; - apr_pool_cleanup_register((*new)->pool, (void *)(*new), socket_cleanup, + fspr_pool_cleanup_register((*new)->pool, (void *)(*new), socket_cleanup, socket_cleanup); return APR_SUCCESS; } -apr_status_t apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa) +fspr_status_t fspr_socket_connect(fspr_socket_t *sock, fspr_sockaddr_t *sa) { int rc; @@ -276,7 +276,7 @@ apr_status_t apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa) */ if ((rc == -1) && (errno == EINPROGRESS || errno == EALREADY) && (sock->timeout > 0)) { - rc = apr_wait_for_io_or_timeout(NULL, sock, 0); + rc = fspr_wait_for_io_or_timeout(NULL, sock, 0); if (rc != APR_SUCCESS) { return rc; } @@ -284,7 +284,7 @@ apr_status_t apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa) #ifdef SO_ERROR { int error; - apr_socklen_t len = sizeof(error); + fspr_socklen_t len = sizeof(error); if ((rc = getsockopt(sock->socketdes, SOL_SOCKET, SO_ERROR, (char *)&error, &len)) < 0) { return errno; @@ -328,13 +328,13 @@ apr_status_t apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa) return APR_SUCCESS; } -apr_status_t apr_socket_type_get(apr_socket_t *sock, int *type) +fspr_status_t fspr_socket_type_get(fspr_socket_t *sock, int *type) { *type = sock->type; return APR_SUCCESS; } -apr_status_t apr_socket_data_get(void **data, const char *key, apr_socket_t *sock) +fspr_status_t fspr_socket_data_get(void **data, const char *key, fspr_socket_t *sock) { sock_userdata_t *cur = sock->userdata; @@ -351,76 +351,76 @@ apr_status_t apr_socket_data_get(void **data, const char *key, apr_socket_t *soc return APR_SUCCESS; } -apr_status_t apr_socket_data_set(apr_socket_t *sock, void *data, const char *key, - apr_status_t (*cleanup) (void *)) +fspr_status_t fspr_socket_data_set(fspr_socket_t *sock, void *data, const char *key, + fspr_status_t (*cleanup) (void *)) { - sock_userdata_t *new = apr_palloc(sock->pool, sizeof(sock_userdata_t)); + sock_userdata_t *new = fspr_palloc(sock->pool, sizeof(sock_userdata_t)); - new->key = apr_pstrdup(sock->pool, key); + new->key = fspr_pstrdup(sock->pool, key); new->data = data; new->next = sock->userdata; sock->userdata = new; if (cleanup) { - apr_pool_cleanup_register(sock->pool, data, cleanup, cleanup); + fspr_pool_cleanup_register(sock->pool, data, cleanup, cleanup); } return APR_SUCCESS; } -apr_status_t apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock) +fspr_status_t fspr_os_sock_get(fspr_os_sock_t *thesock, fspr_socket_t *sock) { *thesock = sock->socketdes; return APR_SUCCESS; } -apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, - apr_os_sock_info_t *os_sock_info, - apr_pool_t *cont) +fspr_status_t fspr_os_sock_make(fspr_socket_t **fspr_sock, + fspr_os_sock_info_t *os_sock_info, + fspr_pool_t *cont) { - alloc_socket(apr_sock, cont); - set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type, os_sock_info->protocol); - (*apr_sock)->timeout = -1; - (*apr_sock)->socketdes = *os_sock_info->os_sock; + alloc_socket(fspr_sock, cont); + set_socket_vars(*fspr_sock, os_sock_info->family, os_sock_info->type, os_sock_info->protocol); + (*fspr_sock)->timeout = -1; + (*fspr_sock)->socketdes = *os_sock_info->os_sock; if (os_sock_info->local) { - memcpy(&(*apr_sock)->local_addr->sa.sin, + memcpy(&(*fspr_sock)->local_addr->sa.sin, os_sock_info->local, - (*apr_sock)->local_addr->salen); + (*fspr_sock)->local_addr->salen); /* XXX IPv6 - this assumes sin_port and sin6_port at same offset */ - (*apr_sock)->local_addr->port = ntohs((*apr_sock)->local_addr->sa.sin.sin_port); + (*fspr_sock)->local_addr->port = ntohs((*fspr_sock)->local_addr->sa.sin.sin_port); } else { - (*apr_sock)->local_port_unknown = (*apr_sock)->local_interface_unknown = 1; + (*fspr_sock)->local_port_unknown = (*fspr_sock)->local_interface_unknown = 1; } if (os_sock_info->remote) { #ifndef HAVE_POLL - (*apr_sock)->connected = 1; + (*fspr_sock)->connected = 1; #endif - memcpy(&(*apr_sock)->remote_addr->sa.sin, + memcpy(&(*fspr_sock)->remote_addr->sa.sin, os_sock_info->remote, - (*apr_sock)->remote_addr->salen); + (*fspr_sock)->remote_addr->salen); /* XXX IPv6 - this assumes sin_port and sin6_port at same offset */ - (*apr_sock)->remote_addr->port = ntohs((*apr_sock)->remote_addr->sa.sin.sin_port); + (*fspr_sock)->remote_addr->port = ntohs((*fspr_sock)->remote_addr->sa.sin.sin_port); } else { - (*apr_sock)->remote_addr_unknown = 1; + (*fspr_sock)->remote_addr_unknown = 1; } - (*apr_sock)->inherit = 0; - apr_pool_cleanup_register((*apr_sock)->pool, (void *)(*apr_sock), + (*fspr_sock)->inherit = 0; + fspr_pool_cleanup_register((*fspr_sock)->pool, (void *)(*fspr_sock), socket_cleanup, socket_cleanup); return APR_SUCCESS; } -apr_status_t apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, - apr_pool_t *cont) +fspr_status_t fspr_os_sock_put(fspr_socket_t **sock, fspr_os_sock_t *thesock, + fspr_pool_t *cont) { /* XXX Bogus assumption that *sock points at anything legit */ if ((*sock) == NULL) { alloc_socket(sock, cont); /* XXX IPv6 figure out the family here! */ /* XXX figure out the actual socket type here */ - /* *or* just decide that apr_os_sock_put() has to be told the family and type */ + /* *or* just decide that fspr_os_sock_put() has to be told the family and type */ set_socket_vars(*sock, APR_INET, SOCK_STREAM, 0); (*sock)->timeout = -1; } diff --git a/libs/apr/network_io/unix/sockopt.c b/libs/apr/network_io/unix/sockopt.c index 344b0484b4..87f27f7014 100644 --- a/libs/apr/network_io/unix/sockopt.c +++ b/libs/apr/network_io/unix/sockopt.c @@ -14,11 +14,11 @@ * limitations under the License. */ -#include "apr_arch_networkio.h" -#include "apr_strings.h" +#include "fspr_arch_networkio.h" +#include "fspr_strings.h" -static apr_status_t soblock(int sd) +static fspr_status_t soblock(int sd) { /* BeOS uses setsockopt at present for non blocking... */ #ifndef BEOS @@ -45,7 +45,7 @@ static apr_status_t soblock(int sd) return APR_SUCCESS; } -static apr_status_t sononblock(int sd) +static fspr_status_t sononblock(int sd) { #ifndef BEOS int fd_flags; @@ -72,9 +72,9 @@ static apr_status_t sononblock(int sd) } -apr_status_t apr_socket_timeout_set(apr_socket_t *sock, apr_interval_time_t t) +fspr_status_t fspr_socket_timeout_set(fspr_socket_t *sock, fspr_interval_time_t t) { - apr_status_t stat; + fspr_status_t stat; /* If our new timeout is non-negative and our old timeout was * negative, then we need to ensure that we are non-blocking. @@ -84,19 +84,19 @@ apr_status_t apr_socket_timeout_set(apr_socket_t *sock, apr_interval_time_t t) * socket. */ if (t >= 0 && sock->timeout < 0) { - if (apr_is_option_set(sock, APR_SO_NONBLOCK) != 1) { + if (fspr_is_option_set(sock, APR_SO_NONBLOCK) != 1) { if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS) { return stat; } - apr_set_option(sock, APR_SO_NONBLOCK, 1); + fspr_set_option(sock, APR_SO_NONBLOCK, 1); } } else if (t < 0 && sock->timeout >= 0) { - if (apr_is_option_set(sock, APR_SO_NONBLOCK) != 0) { + if (fspr_is_option_set(sock, APR_SO_NONBLOCK) != 0) { if ((stat = soblock(sock->socketdes)) != APR_SUCCESS) { return stat; } - apr_set_option(sock, APR_SO_NONBLOCK, 0); + fspr_set_option(sock, APR_SO_NONBLOCK, 0); } } /* must disable the incomplete read support if we disable @@ -110,11 +110,11 @@ apr_status_t apr_socket_timeout_set(apr_socket_t *sock, apr_interval_time_t t) } -apr_status_t apr_socket_opt_set(apr_socket_t *sock, - apr_int32_t opt, apr_int32_t on) +fspr_status_t fspr_socket_opt_set(fspr_socket_t *sock, + fspr_int32_t opt, fspr_int32_t on) { int one; - apr_status_t rv; + fspr_status_t rv; if (on) one = 1; @@ -123,30 +123,30 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, switch(opt) { case APR_SO_KEEPALIVE: #ifdef SO_KEEPALIVE - if (on != apr_is_option_set(sock, APR_SO_KEEPALIVE)) { + if (on != fspr_is_option_set(sock, APR_SO_KEEPALIVE)) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_KEEPALIVE, (void *)&one, sizeof(int)) == -1) { return errno; } - apr_set_option(sock, APR_SO_KEEPALIVE, on); + fspr_set_option(sock, APR_SO_KEEPALIVE, on); } #else return APR_ENOTIMPL; #endif break; case APR_SO_DEBUG: - if (on != apr_is_option_set(sock, APR_SO_DEBUG)) { + if (on != fspr_is_option_set(sock, APR_SO_DEBUG)) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_DEBUG, (void *)&one, sizeof(int)) == -1) { return errno; } - apr_set_option(sock, APR_SO_DEBUG, on); + fspr_set_option(sock, APR_SO_DEBUG, on); } break; case APR_SO_REUSEADDR: - if (on != apr_is_option_set(sock, APR_SO_REUSEADDR)) { + if (on != fspr_is_option_set(sock, APR_SO_REUSEADDR)) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof(int)) == -1) { return errno; } - apr_set_option(sock, APR_SO_REUSEADDR, on); + fspr_set_option(sock, APR_SO_REUSEADDR, on); } break; case APR_SO_SNDBUF: @@ -168,7 +168,7 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, #endif break; case APR_SO_NONBLOCK: - if (apr_is_option_set(sock, APR_SO_NONBLOCK) != on) { + if (fspr_is_option_set(sock, APR_SO_NONBLOCK) != on) { if (on) { if ((rv = sononblock(sock->socketdes)) != APR_SUCCESS) return rv; @@ -177,19 +177,19 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, if ((rv = soblock(sock->socketdes)) != APR_SUCCESS) return rv; } - apr_set_option(sock, APR_SO_NONBLOCK, on); + fspr_set_option(sock, APR_SO_NONBLOCK, on); } break; case APR_SO_LINGER: #ifdef SO_LINGER - if (apr_is_option_set(sock, APR_SO_LINGER) != on) { + if (fspr_is_option_set(sock, APR_SO_LINGER) != on) { struct linger li; li.l_onoff = on; li.l_linger = APR_MAX_SECS_TO_LINGER; if (setsockopt(sock->socketdes, SOL_SOCKET, SO_LINGER, (char *) &li, sizeof(struct linger)) == -1) { return errno; } - apr_set_option(sock, APR_SO_LINGER, on); + fspr_set_option(sock, APR_SO_LINGER, on); } #else return APR_ENOTIMPL; @@ -197,7 +197,7 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, break; case APR_TCP_DEFER_ACCEPT: #if defined(TCP_DEFER_ACCEPT) - if (apr_is_option_set(sock, APR_TCP_DEFER_ACCEPT) != on) { + if (fspr_is_option_set(sock, APR_TCP_DEFER_ACCEPT) != on) { int optlevel = IPPROTO_TCP; int optname = TCP_DEFER_ACCEPT; @@ -205,7 +205,7 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, (void *)&on, sizeof(int)) == -1) { return errno; } - apr_set_option(sock, APR_TCP_DEFER_ACCEPT, on); + fspr_set_option(sock, APR_TCP_DEFER_ACCEPT, on); } #else return APR_ENOTIMPL; @@ -213,7 +213,7 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, break; case APR_TCP_NODELAY: #if defined(TCP_NODELAY) - if (apr_is_option_set(sock, APR_TCP_NODELAY) != on) { + if (fspr_is_option_set(sock, APR_TCP_NODELAY) != on) { int optlevel = IPPROTO_TCP; int optname = TCP_NODELAY; @@ -226,7 +226,7 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, if (setsockopt(sock->socketdes, optlevel, optname, (void *)&on, sizeof(int)) == -1) { return errno; } - apr_set_option(sock, APR_TCP_NODELAY, on); + fspr_set_option(sock, APR_TCP_NODELAY, on); } #else /* BeOS pre-BONE has TCP_NODELAY set by default. @@ -248,7 +248,7 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, * and TCP_CORK takes preference, which is the desired * behaviour. On older kernels, TCP_NODELAY must be toggled * to "off" whilst TCP_CORK is in effect. */ - if (apr_is_option_set(sock, APR_TCP_NOPUSH) != on) { + if (fspr_is_option_set(sock, APR_TCP_NOPUSH) != on) { #ifndef HAVE_TCP_NODELAY_WITH_CORK int optlevel = IPPROTO_TCP; int optname = TCP_NODELAY; @@ -260,7 +260,7 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, } #endif /* OK we're going to change some settings here... */ - if (apr_is_option_set(sock, APR_TCP_NODELAY) == 1 && on) { + if (fspr_is_option_set(sock, APR_TCP_NODELAY) == 1 && on) { /* Now toggle TCP_NODELAY to off, if TCP_CORK is being * turned on: */ int tmpflag = 0; @@ -268,10 +268,10 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, (void*)&tmpflag, sizeof(int)) == -1) { return errno; } - apr_set_option(sock, APR_RESET_NODELAY, 1); - apr_set_option(sock, APR_TCP_NODELAY, 0); + fspr_set_option(sock, APR_RESET_NODELAY, 1); + fspr_set_option(sock, APR_TCP_NODELAY, 0); } else if (on) { - apr_set_option(sock, APR_RESET_NODELAY, 0); + fspr_set_option(sock, APR_RESET_NODELAY, 0); } #endif /* HAVE_TCP_NODELAY_WITH_CORK */ @@ -280,9 +280,9 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, (void*)&on, sizeof(int)) == -1) { return errno; } - apr_set_option(sock, APR_TCP_NOPUSH, on); + fspr_set_option(sock, APR_TCP_NOPUSH, on); #ifndef HAVE_TCP_NODELAY_WITH_CORK - if (!on && apr_is_option_set(sock, APR_RESET_NODELAY)) { + if (!on && fspr_is_option_set(sock, APR_RESET_NODELAY)) { /* Now, if TCP_CORK was just turned off, turn * TCP_NODELAY back on again if it was earlier toggled * to off: */ @@ -291,8 +291,8 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, (void*)&tmpflag, sizeof(int)) == -1) { return errno; } - apr_set_option(sock, APR_RESET_NODELAY,0); - apr_set_option(sock, APR_TCP_NODELAY, 1); + fspr_set_option(sock, APR_RESET_NODELAY,0); + fspr_set_option(sock, APR_TCP_NODELAY, 1); } #endif /* HAVE_TCP_NODELAY_WITH_CORK */ } @@ -301,7 +301,7 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, #endif break; case APR_INCOMPLETE_READ: - apr_set_option(sock, APR_INCOMPLETE_READ, on); + fspr_set_option(sock, APR_INCOMPLETE_READ, on); break; case APR_IPV6_V6ONLY: #if APR_HAVE_IPV6 && defined(IPV6_V6ONLY) @@ -313,7 +313,7 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, (void *)&on, sizeof(int)) == -1) { return errno; } - apr_set_option(sock, APR_IPV6_V6ONLY, on); + fspr_set_option(sock, APR_IPV6_V6ONLY, on); #else return APR_ENOTIMPL; #endif @@ -326,25 +326,25 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock, } -apr_status_t apr_socket_timeout_get(apr_socket_t *sock, apr_interval_time_t *t) +fspr_status_t fspr_socket_timeout_get(fspr_socket_t *sock, fspr_interval_time_t *t) { *t = sock->timeout; return APR_SUCCESS; } -apr_status_t apr_socket_opt_get(apr_socket_t *sock, - apr_int32_t opt, apr_int32_t *on) +fspr_status_t fspr_socket_opt_get(fspr_socket_t *sock, + fspr_int32_t opt, fspr_int32_t *on) { switch(opt) { default: - *on = apr_is_option_set(sock, opt); + *on = fspr_is_option_set(sock, opt); } return APR_SUCCESS; } -int apr_socket_fd_get(apr_socket_t *sock) +int fspr_socket_fd_get(fspr_socket_t *sock) { if (sock) { return sock->socketdes; @@ -354,13 +354,13 @@ int apr_socket_fd_get(apr_socket_t *sock) } -apr_status_t apr_socket_atmark(apr_socket_t *sock, int *atmark) +fspr_status_t fspr_socket_atmark(fspr_socket_t *sock, int *atmark) { #ifndef BEOS_R5 int oobmark; if (ioctl(sock->socketdes, SIOCATMARK, (void*) &oobmark) < 0) - return apr_get_netos_error(); + return fspr_get_netos_error(); *atmark = (oobmark != 0); @@ -370,7 +370,7 @@ apr_status_t apr_socket_atmark(apr_socket_t *sock, int *atmark) #endif } -apr_status_t apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) +fspr_status_t fspr_gethostname(char *buf, fspr_int32_t len, fspr_pool_t *cont) { #ifdef BEOS_R5 if (gethostname(buf, len) == 0) { @@ -391,7 +391,7 @@ apr_status_t apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) } #if APR_HAS_SO_ACCEPTFILTER -apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name, +fspr_status_t fspr_socket_accept_filter(fspr_socket_t *sock, char *name, char *args) { struct accept_filter_arg af; diff --git a/libs/apr/network_io/win32/sendrecv.c b/libs/apr/network_io/win32/sendrecv.c index faab51d492..63891a50c6 100644 --- a/libs/apr/network_io/win32/sendrecv.c +++ b/libs/apr/network_io/win32/sendrecv.c @@ -14,12 +14,12 @@ * limitations under the License. */ -#include "apr_arch_networkio.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_network_io.h" -#include "apr_lib.h" -#include "apr_arch_file_io.h" +#include "fspr_arch_networkio.h" +#include "fspr_errno.h" +#include "fspr_general.h" +#include "fspr_network_io.h" +#include "fspr_lib.h" +#include "fspr_arch_file_io.h" #if APR_HAVE_TIME_H #include #endif @@ -27,19 +27,19 @@ /* MAX_SEGMENT_SIZE is the maximum amount of data that will be sent to a client * in one call of TransmitFile. This number must be small enough to give the * slowest client time to receive the data before the socket timeout triggers. - * The same problem can exist with apr_socket_send(). In that case, we rely on + * The same problem can exist with fspr_socket_send(). In that case, we rely on * the application to adjust socket timeouts and max send segment * sizes appropriately. - * For example, Apache will in most cases call apr_socket_send() with less + * For example, Apache will in most cases call fspr_socket_send() with less * than 8193 bytes. */ #define MAX_SEGMENT_SIZE 65536 #define WSABUF_ON_STACK 50 -APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf, - apr_size_t *len) +APR_DECLARE(fspr_status_t) fspr_socket_send(fspr_socket_t *sock, const char *buf, + fspr_size_t *len) { - apr_ssize_t rv; + fspr_ssize_t rv; WSABUF wsaData; int lasterror; DWORD dwBytes = 0; @@ -54,7 +54,7 @@ APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf, dwBytes = rv; #endif if (rv == SOCKET_ERROR) { - lasterror = apr_get_netos_error(); + lasterror = fspr_get_netos_error(); *len = 0; return lasterror; } @@ -65,10 +65,10 @@ APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf, } -APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock, char *buf, - apr_size_t *len) +APR_DECLARE(fspr_status_t) fspr_socket_recv(fspr_socket_t *sock, char *buf, + fspr_size_t *len) { - apr_ssize_t rv; + fspr_ssize_t rv; WSABUF wsaData; int lasterror; DWORD dwBytes = 0; @@ -84,7 +84,7 @@ APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock, char *buf, dwBytes = rv; #endif if (rv == SOCKET_ERROR) { - lasterror = apr_get_netos_error(); + lasterror = fspr_get_netos_error(); *len = 0; return lasterror; } @@ -94,14 +94,14 @@ APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock, char *buf, } -APR_DECLARE(apr_status_t) apr_socket_sendv(apr_socket_t *sock, +APR_DECLARE(fspr_status_t) fspr_socket_sendv(fspr_socket_t *sock, const struct iovec *vec, - apr_int32_t in_vec, apr_size_t *nbytes) + fspr_int32_t in_vec, fspr_size_t *nbytes) { - apr_status_t rc = APR_SUCCESS; - apr_ssize_t rv; - apr_size_t cur_len; - apr_int32_t nvec = 0; + fspr_status_t rc = APR_SUCCESS; + fspr_ssize_t rv; + fspr_size_t cur_len; + fspr_int32_t nvec = 0; int i, j = 0; DWORD dwBytes = 0; WSABUF *pWsaBuf; @@ -143,13 +143,13 @@ APR_DECLARE(apr_status_t) apr_socket_sendv(apr_socket_t *sock, #ifndef _WIN32_WCE rv = WSASend(sock->socketdes, pWsaBuf, nvec, &dwBytes, 0, NULL, NULL); if (rv == SOCKET_ERROR) { - rc = apr_get_netos_error(); + rc = fspr_get_netos_error(); } #else for (i = 0; i < nvec; i++) { rv = send(sock->socketdes, pWsaBuf[i].buf, pWsaBuf[i].len, 0); if (rv == SOCKET_ERROR) { - rc = apr_get_netos_error(); + rc = fspr_get_netos_error(); break; } dwBytes += rv; @@ -163,19 +163,19 @@ APR_DECLARE(apr_status_t) apr_socket_sendv(apr_socket_t *sock, } -APR_DECLARE(apr_status_t) apr_socket_sendto(apr_socket_t *sock, - apr_sockaddr_t *where, - apr_int32_t flags, const char *buf, - apr_size_t *len) +APR_DECLARE(fspr_status_t) fspr_socket_sendto(fspr_socket_t *sock, + fspr_sockaddr_t *where, + fspr_int32_t flags, const char *buf, + fspr_size_t *len) { - apr_ssize_t rv; + fspr_ssize_t rv; rv = sendto(sock->socketdes, buf, (int)*len, flags, (const struct sockaddr*)&where->sa, where->salen); if (rv == SOCKET_ERROR) { *len = 0; - return apr_get_netos_error(); + return fspr_get_netos_error(); } *len = rv; @@ -183,18 +183,18 @@ APR_DECLARE(apr_status_t) apr_socket_sendto(apr_socket_t *sock, } -APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from, - apr_socket_t *sock, - apr_int32_t flags, - char *buf, apr_size_t *len) +APR_DECLARE(fspr_status_t) fspr_socket_recvfrom(fspr_sockaddr_t *from, + fspr_socket_t *sock, + fspr_int32_t flags, + char *buf, fspr_size_t *len) { - apr_ssize_t rv; + fspr_ssize_t rv; rv = recvfrom(sock->socketdes, buf, (int)*len, flags, (struct sockaddr*)&from->sa, &from->salen); if (rv == SOCKET_ERROR) { (*len) = 0; - return apr_get_netos_error(); + return fspr_get_netos_error(); } (*len) = rv; if (rv == 0 && sock->type == SOCK_STREAM) @@ -204,9 +204,9 @@ APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from, } -static apr_status_t collapse_iovec(char **off, apr_size_t *len, +static fspr_status_t collapse_iovec(char **off, fspr_size_t *len, struct iovec *iovec, int numvec, - char *buf, apr_size_t buflen) + char *buf, fspr_size_t buflen) { if (numvec == 1) { *off = iovec[0].iov_base; @@ -236,8 +236,8 @@ static apr_status_t collapse_iovec(char **off, apr_size_t *len, #if APR_HAS_SENDFILE /* - * apr_status_t apr_socket_sendfile(apr_socket_t *, apr_file_t *, apr_hdtr_t *, - * apr_off_t *, apr_size_t *, apr_int32_t flags) + * fspr_status_t fspr_socket_sendfile(fspr_socket_t *, fspr_file_t *, fspr_hdtr_t *, + * fspr_off_t *, fspr_size_t *, fspr_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 @@ -247,26 +247,26 @@ static apr_status_t collapse_iovec(char **off, apr_size_t *len, * arg 5) Number of bytes to send out of the file * arg 6) APR flags that are mapped to OS specific flags */ -APR_DECLARE(apr_status_t) apr_socket_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) +APR_DECLARE(fspr_status_t) fspr_socket_sendfile(fspr_socket_t *sock, + fspr_file_t *file, + fspr_hdtr_t *hdtr, + fspr_off_t *offset, + fspr_size_t *len, + fspr_int32_t flags) { - apr_status_t status = APR_SUCCESS; - apr_status_t rv; - apr_off_t curoff = *offset; + fspr_status_t status = APR_SUCCESS; + fspr_status_t rv; + fspr_off_t curoff = *offset; DWORD dwFlags = 0; - apr_size_t nbytes; + fspr_size_t nbytes; TRANSMIT_FILE_BUFFERS tfb, *ptfb = NULL; int ptr = 0; - apr_size_t bytes_to_send; /* Bytes to send out of the file (not including headers) */ + fspr_size_t bytes_to_send; /* Bytes to send out of the file (not including headers) */ int disconnected = 0; int sendv_trailers = 0; char hdtrbuf[4096]; - if (apr_os_level < APR_WIN_NT) { + if (fspr_os_level < APR_WIN_NT) { return APR_ENOTIMPL; } @@ -277,14 +277,14 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, /* Handle the goofy case of sending headers/trailers and a zero byte file */ if (!bytes_to_send && hdtr) { if (hdtr->numheaders) { - rv = apr_socket_sendv(sock, hdtr->headers, hdtr->numheaders, + rv = fspr_socket_sendv(sock, hdtr->headers, hdtr->numheaders, &nbytes); if (rv != APR_SUCCESS) return rv; *len += nbytes; } if (hdtr->numtrailers) { - rv = apr_socket_sendv(sock, hdtr->trailers, hdtr->numtrailers, + rv = fspr_socket_sendv(sock, hdtr->trailers, hdtr->numtrailers, &nbytes); if (rv != APR_SUCCESS) return rv; @@ -297,7 +297,7 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, /* Collapse the headers into a single buffer */ if (hdtr && hdtr->numheaders) { - apr_size_t head_length = tfb.HeadLength; + fspr_size_t head_length = tfb.HeadLength; ptfb = &tfb; nbytes = 0; rv = collapse_iovec((char **)&ptfb->Head, &head_length, @@ -308,7 +308,7 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, /* If not enough buffer, punt to sendv */ if (rv == APR_INCOMPLETE) { - rv = apr_socket_sendv(sock, hdtr->headers, hdtr->numheaders, &nbytes); + rv = fspr_socket_sendv(sock, hdtr->headers, hdtr->numheaders, &nbytes); if (rv != APR_SUCCESS) return rv; *len += nbytes; @@ -319,7 +319,7 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, /* Initialize the overlapped structure used on TransmitFile */ if (!sock->overlapped) { - sock->overlapped = apr_pcalloc(sock->pool, sizeof(OVERLAPPED)); + sock->overlapped = fspr_pcalloc(sock->pool, sizeof(OVERLAPPED)); sock->overlapped->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); } while (bytes_to_send) { @@ -333,7 +333,7 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, xmitbytes = (DWORD)bytes_to_send; /* Collapse the trailers into a single buffer */ if (hdtr && hdtr->numtrailers) { - apr_size_t tail_length = tfb.TailLength; + fspr_size_t tail_length = tfb.TailLength; ptfb = &tfb; rv = collapse_iovec((char**) &ptfb->Tail, &tail_length, hdtr->trailers, hdtr->numtrailers, @@ -369,7 +369,7 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, ptfb, /* header and trailer buffers */ dwFlags); /* flags to control various aspects of TransmitFile */ if (!rv) { - status = apr_get_netos_error(); + status = fspr_get_netos_error(); if ((status == APR_FROM_OS_ERROR(ERROR_IO_PENDING)) || (status == APR_FROM_OS_ERROR(WSA_IO_PENDING))) { @@ -384,7 +384,7 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, &xmitbytes, FALSE, &dwFlags)) { - status = apr_get_netos_error(); + status = fspr_get_netos_error(); } /* Ugly code alert: WSAGetOverlappedResult returns * a count of all bytes sent. This loop only @@ -408,7 +408,7 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, status = APR_FROM_OS_ERROR(WAIT_TIMEOUT); } else - status = apr_get_os_error(); + status = fspr_get_os_error(); } } if (status != APR_SUCCESS) @@ -427,7 +427,7 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, if (status == APR_SUCCESS) { if (sendv_trailers) { - rv = apr_socket_sendv(sock, hdtr->trailers, hdtr->numtrailers, &nbytes); + rv = fspr_socket_sendv(sock, hdtr->trailers, hdtr->numtrailers, &nbytes); if (rv != APR_SUCCESS) return rv; *len += nbytes; @@ -436,7 +436,7 @@ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, /* Mark the socket as disconnected, but do not close it. * Note: The application must have stored the socket prior to making - * the call to apr_socket_sendfile in order to either reuse it + * the call to fspr_socket_sendfile in order to either reuse it * or close it. */ if (disconnected) { diff --git a/libs/apr/network_io/win32/sockets.c b/libs/apr/network_io/win32/sockets.c index eed351b04a..0a649c6f2d 100644 --- a/libs/apr/network_io/win32/sockets.c +++ b/libs/apr/network_io/win32/sockets.c @@ -14,25 +14,25 @@ * limitations under the License. */ -#include "apr_arch_networkio.h" -#include "apr_network_io.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_portable.h" -#include "apr_strings.h" +#include "fspr_arch_networkio.h" +#include "fspr_network_io.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_portable.h" +#include "fspr_strings.h" #include -#include "apr_arch_inherit.h" -#include "apr_arch_misc.h" +#include "fspr_arch_inherit.h" +#include "fspr_arch_misc.h" static char generic_inaddr_any[16] = {0}; /* big enough for IPv4 or IPv6 */ -static apr_status_t socket_cleanup(void *sock) +static fspr_status_t socket_cleanup(void *sock) { - apr_socket_t *thesocket = sock; + fspr_socket_t *thesocket = sock; if (thesocket->socketdes != INVALID_SOCKET) { if (closesocket(thesocket->socketdes) == SOCKET_ERROR) { - return apr_get_netos_error(); + return fspr_get_netos_error(); } thesocket->socketdes = INVALID_SOCKET; } @@ -45,41 +45,41 @@ static apr_status_t socket_cleanup(void *sock) return APR_SUCCESS; } -static void set_socket_vars(apr_socket_t *sock, int family, int type, int protocol) +static void set_socket_vars(fspr_socket_t *sock, int family, int type, int protocol) { sock->type = type; sock->protocol = protocol; - apr_sockaddr_vars_set(sock->local_addr, family, 0); - apr_sockaddr_vars_set(sock->remote_addr, family, 0); + fspr_sockaddr_vars_set(sock->local_addr, family, 0); + fspr_sockaddr_vars_set(sock->remote_addr, family, 0); } -static void alloc_socket(apr_socket_t **new, apr_pool_t *p) +static void alloc_socket(fspr_socket_t **new, fspr_pool_t *p) { - *new = (apr_socket_t *)apr_pcalloc(p, sizeof(apr_socket_t)); + *new = (fspr_socket_t *)fspr_pcalloc(p, sizeof(fspr_socket_t)); (*new)->pool = p; - (*new)->local_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->pool, - sizeof(apr_sockaddr_t)); + (*new)->local_addr = (fspr_sockaddr_t *)fspr_pcalloc((*new)->pool, + sizeof(fspr_sockaddr_t)); (*new)->local_addr->pool = p; - (*new)->remote_addr = (apr_sockaddr_t *)apr_pcalloc((*new)->pool, - sizeof(apr_sockaddr_t)); + (*new)->remote_addr = (fspr_sockaddr_t *)fspr_pcalloc((*new)->pool, + sizeof(fspr_sockaddr_t)); (*new)->remote_addr->pool = p; (*new)->remote_addr_unknown = 1; /* Create a pollset with room for one descriptor. */ /* ### check return codes */ - (void) apr_pollset_create(&(*new)->pollset, 1, p, 0); + (void) fspr_pollset_create(&(*new)->pollset, 1, p, 0); } -APR_DECLARE(apr_status_t) apr_socket_protocol_get(apr_socket_t *sock, +APR_DECLARE(fspr_status_t) fspr_socket_protocol_get(fspr_socket_t *sock, int *protocol) { *protocol = sock->protocol; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, +APR_DECLARE(fspr_status_t) fspr_socket_create(fspr_socket_t **new, int family, int type, int protocol, - apr_pool_t *cont) + fspr_pool_t *cont) { int downgrade = (family == AF_UNSPEC); @@ -105,7 +105,7 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, #endif if ((*new)->socketdes == INVALID_SOCKET) { - return apr_get_netos_error(); + return fspr_get_netos_error(); } #ifdef WIN32 @@ -148,14 +148,14 @@ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, (*new)->timeout = -1; (*new)->disconnected = 0; - apr_pool_cleanup_register((*new)->pool, (void *)(*new), - socket_cleanup, apr_pool_cleanup_null); + fspr_pool_cleanup_register((*new)->pool, (void *)(*new), + socket_cleanup, fspr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_socket_shutdown(apr_socket_t *thesocket, - apr_shutdown_how_e how) +APR_DECLARE(fspr_status_t) fspr_socket_shutdown(fspr_socket_t *thesocket, + fspr_shutdown_how_e how) { int winhow = 0; @@ -181,23 +181,23 @@ APR_DECLARE(apr_status_t) apr_socket_shutdown(apr_socket_t *thesocket, return APR_SUCCESS; } else { - return apr_get_netos_error(); + return fspr_get_netos_error(); } } -APR_DECLARE(apr_status_t) apr_socket_close(apr_socket_t *thesocket) +APR_DECLARE(fspr_status_t) fspr_socket_close(fspr_socket_t *thesocket) { - apr_pool_cleanup_kill(thesocket->pool, thesocket, socket_cleanup); + fspr_pool_cleanup_kill(thesocket->pool, thesocket, socket_cleanup); return socket_cleanup(thesocket); } -APR_DECLARE(apr_status_t) apr_socket_bind(apr_socket_t *sock, - apr_sockaddr_t *sa) +APR_DECLARE(fspr_status_t) fspr_socket_bind(fspr_socket_t *sock, + fspr_sockaddr_t *sa) { if (bind(sock->socketdes, (struct sockaddr *)&sa->sa, sa->salen) == -1) { - return apr_get_netos_error(); + return fspr_get_netos_error(); } else { sock->local_addr = sa; @@ -208,17 +208,17 @@ APR_DECLARE(apr_status_t) apr_socket_bind(apr_socket_t *sock, } } -APR_DECLARE(apr_status_t) apr_socket_listen(apr_socket_t *sock, - apr_int32_t backlog) +APR_DECLARE(fspr_status_t) fspr_socket_listen(fspr_socket_t *sock, + fspr_int32_t backlog) { if (listen(sock->socketdes, backlog) == SOCKET_ERROR) - return apr_get_netos_error(); + return fspr_get_netos_error(); else return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_socket_accept(apr_socket_t **new, - apr_socket_t *sock, apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_socket_accept(fspr_socket_t **new, + fspr_socket_t *sock, fspr_pool_t *p) { SOCKET s; #if APR_HAVE_IPV6 @@ -232,7 +232,7 @@ APR_DECLARE(apr_status_t) apr_socket_accept(apr_socket_t **new, us to work with nonblocking sockets. */ s = accept(sock->socketdes, (struct sockaddr *)&sa, &salen); if (s == INVALID_SOCKET) { - return apr_get_netos_error(); + return fspr_get_netos_error(); } alloc_socket(new, p); @@ -270,13 +270,13 @@ APR_DECLARE(apr_status_t) apr_socket_accept(apr_socket_t **new, } #if APR_TCP_NODELAY_INHERITED - if (apr_is_option_set(sock, APR_TCP_NODELAY) == 1) { - apr_set_option(*new, APR_TCP_NODELAY, 1); + if (fspr_is_option_set(sock, APR_TCP_NODELAY) == 1) { + fspr_set_option(*new, APR_TCP_NODELAY, 1); } #endif /* TCP_NODELAY_INHERITED */ #if APR_O_NONBLOCK_INHERITED - if (apr_is_option_set(sock, APR_SO_NONBLOCK) == 1) { - apr_set_option(*new, APR_SO_NONBLOCK, 1); + if (fspr_is_option_set(sock, APR_SO_NONBLOCK) == 1) { + fspr_set_option(*new, APR_SO_NONBLOCK, 1); } #endif /* APR_O_NONBLOCK_INHERITED */ @@ -293,15 +293,15 @@ APR_DECLARE(apr_status_t) apr_socket_accept(apr_socket_t **new, (*new)->local_interface_unknown = 1; } - apr_pool_cleanup_register((*new)->pool, (void *)(*new), - socket_cleanup, apr_pool_cleanup_null); + fspr_pool_cleanup_register((*new)->pool, (void *)(*new), + socket_cleanup, fspr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, - apr_sockaddr_t *sa) +APR_DECLARE(fspr_status_t) fspr_socket_connect(fspr_socket_t *sock, + fspr_sockaddr_t *sa) { - apr_status_t rv; + fspr_status_t rv; if ((sock->socketdes == INVALID_SOCKET) || (!sock->local_addr)) { return APR_ENOTSOCK; @@ -313,7 +313,7 @@ APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, struct timeval tv, *tvptr; fd_set wfdset, efdset; - rv = apr_get_netos_error(); + rv = fspr_get_netos_error(); if (rv != APR_FROM_OS_ERROR(WSAEWOULDBLOCK)) { return rv; } @@ -338,13 +338,13 @@ APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, } else { /* casts for winsock/timeval definition */ - tv.tv_sec = (long)apr_time_sec(sock->timeout); - tv.tv_usec = (int)apr_time_usec(sock->timeout); + tv.tv_sec = (long)fspr_time_sec(sock->timeout); + tv.tv_usec = (int)fspr_time_usec(sock->timeout); tvptr = &tv; } rc = select(FD_SETSIZE+1, NULL, &wfdset, &efdset, tvptr); if (rc == SOCKET_ERROR) { - return apr_get_netos_error(); + return fspr_get_netos_error(); } else if (!rc) { return APR_FROM_OS_ERROR(WSAETIMEDOUT); @@ -354,7 +354,7 @@ APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, /* The connect failed. */ int rclen = sizeof(rc); if (getsockopt(sock->socketdes, SOL_SOCKET, SO_ERROR, (char*) &rc, &rclen)) { - return apr_get_netos_error(); + return fspr_get_netos_error(); } return APR_FROM_OS_ERROR(rc); } @@ -375,14 +375,14 @@ APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_socket_type_get(apr_socket_t *sock, int *type) +APR_DECLARE(fspr_status_t) fspr_socket_type_get(fspr_socket_t *sock, int *type) { *type = sock->type; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_socket_data_get(void **data, const char *key, - apr_socket_t *sock) +APR_DECLARE(fspr_status_t) fspr_socket_data_get(void **data, const char *key, + fspr_socket_t *sock) { sock_userdata_t *cur = sock->userdata; @@ -399,77 +399,77 @@ APR_DECLARE(apr_status_t) apr_socket_data_get(void **data, const char *key, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *sock, void *data, +APR_DECLARE(fspr_status_t) fspr_socket_data_set(fspr_socket_t *sock, void *data, const char *key, - apr_status_t (*cleanup)(void *)) + fspr_status_t (*cleanup)(void *)) { - sock_userdata_t *new = apr_palloc(sock->pool, sizeof(sock_userdata_t)); + sock_userdata_t *new = fspr_palloc(sock->pool, sizeof(sock_userdata_t)); - new->key = apr_pstrdup(sock->pool, key); + new->key = fspr_pstrdup(sock->pool, key); new->data = data; new->next = sock->userdata; sock->userdata = new; if (cleanup) { - apr_pool_cleanup_register(sock->pool, data, cleanup, cleanup); + fspr_pool_cleanup_register(sock->pool, data, cleanup, cleanup); } return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_sock_get(apr_os_sock_t *thesock, - apr_socket_t *sock) +APR_DECLARE(fspr_status_t) fspr_os_sock_get(fspr_os_sock_t *thesock, + fspr_socket_t *sock) { *thesock = sock->socketdes; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, - apr_os_sock_info_t *os_sock_info, - apr_pool_t *cont) +APR_DECLARE(fspr_status_t) fspr_os_sock_make(fspr_socket_t **fspr_sock, + fspr_os_sock_info_t *os_sock_info, + fspr_pool_t *cont) { - alloc_socket(apr_sock, cont); - set_socket_vars(*apr_sock, os_sock_info->family, os_sock_info->type, os_sock_info->protocol); - (*apr_sock)->timeout = -1; - (*apr_sock)->disconnected = 0; - (*apr_sock)->socketdes = *os_sock_info->os_sock; + alloc_socket(fspr_sock, cont); + set_socket_vars(*fspr_sock, os_sock_info->family, os_sock_info->type, os_sock_info->protocol); + (*fspr_sock)->timeout = -1; + (*fspr_sock)->disconnected = 0; + (*fspr_sock)->socketdes = *os_sock_info->os_sock; if (os_sock_info->local) { - memcpy(&(*apr_sock)->local_addr->sa.sin, + memcpy(&(*fspr_sock)->local_addr->sa.sin, os_sock_info->local, - (*apr_sock)->local_addr->salen); - (*apr_sock)->local_addr->pool = cont; + (*fspr_sock)->local_addr->salen); + (*fspr_sock)->local_addr->pool = cont; /* XXX IPv6 - this assumes sin_port and sin6_port at same offset */ - (*apr_sock)->local_addr->port = ntohs((*apr_sock)->local_addr->sa.sin.sin_port); + (*fspr_sock)->local_addr->port = ntohs((*fspr_sock)->local_addr->sa.sin.sin_port); } else { - (*apr_sock)->local_port_unknown = (*apr_sock)->local_interface_unknown = 1; + (*fspr_sock)->local_port_unknown = (*fspr_sock)->local_interface_unknown = 1; } if (os_sock_info->remote) { - memcpy(&(*apr_sock)->remote_addr->sa.sin, + memcpy(&(*fspr_sock)->remote_addr->sa.sin, os_sock_info->remote, - (*apr_sock)->remote_addr->salen); - (*apr_sock)->remote_addr->pool = cont; + (*fspr_sock)->remote_addr->salen); + (*fspr_sock)->remote_addr->pool = cont; /* XXX IPv6 - this assumes sin_port and sin6_port at same offset */ - (*apr_sock)->remote_addr->port = ntohs((*apr_sock)->remote_addr->sa.sin.sin_port); + (*fspr_sock)->remote_addr->port = ntohs((*fspr_sock)->remote_addr->sa.sin.sin_port); } else { - (*apr_sock)->remote_addr_unknown = 1; + (*fspr_sock)->remote_addr_unknown = 1; } - apr_pool_cleanup_register((*apr_sock)->pool, (void *)(*apr_sock), - socket_cleanup, apr_pool_cleanup_null); + fspr_pool_cleanup_register((*fspr_sock)->pool, (void *)(*fspr_sock), + socket_cleanup, fspr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, - apr_os_sock_t *thesock, - apr_pool_t *cont) +APR_DECLARE(fspr_status_t) fspr_os_sock_put(fspr_socket_t **sock, + fspr_os_sock_t *thesock, + fspr_pool_t *cont) { if ((*sock) == NULL) { alloc_socket(sock, cont); /* XXX figure out the actual socket type here */ - /* *or* just decide that apr_os_sock_put() has to be told the family and type */ + /* *or* just decide that fspr_os_sock_put() has to be told the family and type */ set_socket_vars(*sock, AF_INET, SOCK_STREAM, 0); (*sock)->timeout = -1; (*sock)->disconnected = 0; @@ -486,12 +486,12 @@ APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, * This is not trivial to implement. */ -APR_DECLARE(apr_status_t) apr_socket_inherit_set(apr_socket_t *socket) +APR_DECLARE(fspr_status_t) fspr_socket_inherit_set(fspr_socket_t *socket) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_socket_inherit_unset(apr_socket_t *socket) +APR_DECLARE(fspr_status_t) fspr_socket_inherit_unset(fspr_socket_t *socket) { return APR_ENOTIMPL; } diff --git a/libs/apr/network_io/win32/sockopt.c b/libs/apr/network_io/win32/sockopt.c index 05ba19c9b8..ee92233836 100644 --- a/libs/apr/network_io/win32/sockopt.c +++ b/libs/apr/network_io/win32/sockopt.c @@ -14,36 +14,36 @@ * limitations under the License. */ -#include "apr_arch_networkio.h" -#include "apr_network_io.h" -#include "apr_general.h" -#include "apr_strings.h" +#include "fspr_arch_networkio.h" +#include "fspr_network_io.h" +#include "fspr_general.h" +#include "fspr_strings.h" #include -apr_status_t soblock(SOCKET sd) +fspr_status_t soblock(SOCKET sd) { u_long zero = 0; if (ioctlsocket(sd, FIONBIO, &zero) == SOCKET_ERROR) { - return apr_get_netos_error(); + return fspr_get_netos_error(); } return APR_SUCCESS; } -apr_status_t sononblock(SOCKET sd) +fspr_status_t sononblock(SOCKET sd) { u_long one = 1; if (ioctlsocket(sd, FIONBIO, &one) == SOCKET_ERROR) { - return apr_get_netos_error(); + return fspr_get_netos_error(); } return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, apr_interval_time_t t) +APR_DECLARE(fspr_status_t) fspr_socket_timeout_set(fspr_socket_t *sock, fspr_interval_time_t t) { - apr_status_t stat; + fspr_status_t stat; if (t == 0) { /* Set the socket non-blocking if it was previously blocking */ @@ -62,7 +62,7 @@ APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, apr_interva if (sock->timeout != t) { /* Win32 timeouts are in msec, represented as int */ - sock->timeout_ms = (int)apr_time_as_msec(t); + sock->timeout_ms = (int)fspr_time_as_msec(t); setsockopt(sock->socketdes, SOL_SOCKET, SO_RCVTIMEO, (char *) &sock->timeout_ms, sizeof(sock->timeout_ms)); @@ -86,56 +86,56 @@ APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, apr_interva } -APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, - apr_int32_t opt, apr_int32_t on) +APR_DECLARE(fspr_status_t) fspr_socket_opt_set(fspr_socket_t *sock, + fspr_int32_t opt, fspr_int32_t on) { int one; - apr_status_t stat; + fspr_status_t stat; one = on ? 1 : 0; switch (opt) { case APR_SO_KEEPALIVE: - if (on != apr_is_option_set(sock, APR_SO_KEEPALIVE)) { + if (on != fspr_is_option_set(sock, APR_SO_KEEPALIVE)) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_KEEPALIVE, (void *)&one, sizeof(int)) == -1) { - return apr_get_netos_error(); + return fspr_get_netos_error(); } - apr_set_option(sock, APR_SO_KEEPALIVE, on); + fspr_set_option(sock, APR_SO_KEEPALIVE, on); } break; case APR_SO_DEBUG: - if (on != apr_is_option_set(sock, APR_SO_DEBUG)) { + if (on != fspr_is_option_set(sock, APR_SO_DEBUG)) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_DEBUG, (void *)&one, sizeof(int)) == -1) { - return apr_get_netos_error(); + return fspr_get_netos_error(); } - apr_set_option(sock, APR_SO_DEBUG, on); + fspr_set_option(sock, APR_SO_DEBUG, on); } break; case APR_SO_SNDBUF: if (setsockopt(sock->socketdes, SOL_SOCKET, SO_SNDBUF, (void *)&on, sizeof(int)) == -1) { - return apr_get_netos_error(); + return fspr_get_netos_error(); } break; case APR_SO_RCVBUF: if (setsockopt(sock->socketdes, SOL_SOCKET, SO_RCVBUF, (void *)&on, sizeof(int)) == -1) { - return apr_get_netos_error(); + return fspr_get_netos_error(); } break; case APR_SO_REUSEADDR: - if (on != apr_is_option_set(sock, APR_SO_REUSEADDR)) { + if (on != fspr_is_option_set(sock, APR_SO_REUSEADDR)) { if (setsockopt(sock->socketdes, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof(int)) == -1) { - return apr_get_netos_error(); + return fspr_get_netos_error(); } - apr_set_option(sock, APR_SO_REUSEADDR, on); + fspr_set_option(sock, APR_SO_REUSEADDR, on); } break; case APR_SO_NONBLOCK: - if (apr_is_option_set(sock, APR_SO_NONBLOCK) != on) { + if (fspr_is_option_set(sock, APR_SO_NONBLOCK) != on) { if (on) { if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS) return stat; @@ -144,26 +144,26 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, if ((stat = soblock(sock->socketdes)) != APR_SUCCESS) return stat; } - apr_set_option(sock, APR_SO_NONBLOCK, on); + fspr_set_option(sock, APR_SO_NONBLOCK, on); } break; case APR_SO_LINGER: { - if (apr_is_option_set(sock, APR_SO_LINGER) != on) { + if (fspr_is_option_set(sock, APR_SO_LINGER) != on) { struct linger li; li.l_onoff = on; li.l_linger = APR_MAX_SECS_TO_LINGER; if (setsockopt(sock->socketdes, SOL_SOCKET, SO_LINGER, (char *) &li, sizeof(struct linger)) == -1) { - return apr_get_netos_error(); + return fspr_get_netos_error(); } - apr_set_option(sock, APR_SO_LINGER, on); + fspr_set_option(sock, APR_SO_LINGER, on); } break; } case APR_TCP_DEFER_ACCEPT: #if defined(TCP_DEFER_ACCEPT) - if (apr_is_option_set(sock, APR_TCP_DEFER_ACCEPT) != on) { + if (fspr_is_option_set(sock, APR_TCP_DEFER_ACCEPT) != on) { int optlevel = IPPROTO_TCP; int optname = TCP_DEFER_ACCEPT; @@ -171,13 +171,13 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, (void *)&on, sizeof(int)) == -1) { return errno; } - apr_set_option(sock, APR_TCP_DEFER_ACCEPT, on); + fspr_set_option(sock, APR_TCP_DEFER_ACCEPT, on); } #else return APR_ENOTIMPL; #endif case APR_TCP_NODELAY: - if (apr_is_option_set(sock, APR_TCP_NODELAY) != on) { + if (fspr_is_option_set(sock, APR_TCP_NODELAY) != on) { int optlevel = IPPROTO_TCP; int optname = TCP_NODELAY; @@ -189,9 +189,9 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, #endif if (setsockopt(sock->socketdes, optlevel, optname, (void *)&on, sizeof(int)) == -1) { - return apr_get_netos_error(); + return fspr_get_netos_error(); } - apr_set_option(sock, APR_TCP_NODELAY, on); + fspr_set_option(sock, APR_TCP_NODELAY, on); } break; case APR_IPV6_V6ONLY: @@ -202,9 +202,9 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, */ if (setsockopt(sock->socketdes, IPPROTO_IPV6, IPV6_V6ONLY, (void *)&on, sizeof(int)) == -1) { - return apr_get_netos_error(); + return fspr_get_netos_error(); } - apr_set_option(sock, APR_IPV6_V6ONLY, on); + fspr_set_option(sock, APR_IPV6_V6ONLY, on); #else return APR_ENOTIMPL; #endif @@ -217,15 +217,15 @@ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, } -APR_DECLARE(apr_status_t) apr_socket_timeout_get(apr_socket_t *sock, apr_interval_time_t *t) +APR_DECLARE(fspr_status_t) fspr_socket_timeout_get(fspr_socket_t *sock, fspr_interval_time_t *t) { *t = sock->timeout; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock, - apr_int32_t opt, apr_int32_t *on) +APR_DECLARE(fspr_status_t) fspr_socket_opt_get(fspr_socket_t *sock, + fspr_int32_t opt, fspr_int32_t *on) { switch (opt) { case APR_SO_DISCONNECTED: @@ -237,14 +237,14 @@ APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock, case APR_SO_NONBLOCK: case APR_SO_LINGER: default: - *on = apr_is_option_set(sock, opt); + *on = fspr_is_option_set(sock, opt); break; } return APR_SUCCESS; } -APR_DECLARE(int) apr_socket_fd_get(apr_socket_t *sock) +APR_DECLARE(int) fspr_socket_fd_get(fspr_socket_t *sock) { if (sock) { return sock->socketdes; @@ -254,12 +254,12 @@ APR_DECLARE(int) apr_socket_fd_get(apr_socket_t *sock) } -APR_DECLARE(apr_status_t) apr_socket_atmark(apr_socket_t *sock, int *atmark) +APR_DECLARE(fspr_status_t) fspr_socket_atmark(fspr_socket_t *sock, int *atmark) { u_long oobmark; if (ioctlsocket(sock->socketdes, SIOCATMARK, (void*) &oobmark) < 0) - return apr_get_netos_error(); + return fspr_get_netos_error(); *atmark = (oobmark != 0); @@ -267,12 +267,12 @@ APR_DECLARE(apr_status_t) apr_socket_atmark(apr_socket_t *sock, int *atmark) } -APR_DECLARE(apr_status_t) apr_gethostname(char *buf, int len, - apr_pool_t *cont) +APR_DECLARE(fspr_status_t) fspr_gethostname(char *buf, int len, + fspr_pool_t *cont) { if (gethostname(buf, len) == -1) { buf[0] = '\0'; - return apr_get_netos_error(); + return fspr_get_netos_error(); } else if (!memchr(buf, '\0', len)) { /* buffer too small */ buf[0] = '\0'; diff --git a/libs/apr/passwd/apr_getpass.c b/libs/apr/passwd/fspr_getpass.c similarity index 93% rename from libs/apr/passwd/apr_getpass.c rename to libs/apr/passwd/fspr_getpass.c index 7e89774948..c03087f027 100644 --- a/libs/apr/passwd/apr_getpass.c +++ b/libs/apr/passwd/fspr_getpass.c @@ -14,15 +14,15 @@ * limitations under the License. */ -/* apr_password_get.c: abstraction to provide for obtaining a password from the +/* fspr_password_get.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. */ -#include "apr_private.h" -#include "apr_strings.h" -#include "apr_lib.h" -#include "apr_errno.h" +#include "fspr_private.h" +#include "fspr_strings.h" +#include "fspr_lib.h" +#include "fspr_errno.h" #if APR_HAVE_SYS_TYPES_H #include #endif @@ -179,7 +179,7 @@ static char *getpass(const char *prompt) fputs(prompt, stderr); n = 0; } - else if ((n < sizeof(password) - 1) && !apr_iscntrl(ch)) { + else if ((n < sizeof(password) - 1) && !fspr_iscntrl(ch)) { password[n++] = ch; fputc('*', stderr); } @@ -213,21 +213,21 @@ static char *getpass(const char *prompt) * smaller than our own. */ -APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, apr_size_t *bufsiz) +APR_DECLARE(fspr_status_t) fspr_password_get(const char *prompt, char *pwbuf, fspr_size_t *bufsiz) { #ifdef HAVE_GETPASSPHRASE char *pw_got = getpassphrase(prompt); #else char *pw_got = getpass(prompt); #endif - apr_status_t rv = APR_SUCCESS; + fspr_status_t rv = APR_SUCCESS; if (!pw_got) return APR_EINVAL; if (strlen(pw_got) >= *bufsiz) { rv = APR_ENAMETOOLONG; } - apr_cpystrn(pwbuf, pw_got, *bufsiz); + fspr_cpystrn(pwbuf, pw_got, *bufsiz); memset(pw_got, 0, strlen(pw_got)); return rv; } diff --git a/libs/apr/poll/os2/poll.c b/libs/apr/poll/os2/poll.c index 3c36e5e688..f27b17e975 100644 --- a/libs/apr/poll/os2/poll.c +++ b/libs/apr/poll/os2/poll.c @@ -14,12 +14,12 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_poll.h" -#include "apr_arch_networkio.h" +#include "fspr.h" +#include "fspr_poll.h" +#include "fspr_arch_networkio.h" -APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, - apr_int32_t *nsds, apr_interval_time_t timeout) +APR_DECLARE(fspr_status_t) fspr_poll(fspr_pollfd_t *aprset, fspr_int32_t num, + fspr_int32_t *nsds, fspr_interval_time_t timeout) { int *pollset; int i; diff --git a/libs/apr/poll/os2/pollset.c b/libs/apr/poll/os2/pollset.c index 0680c29c09..69f5f10cae 100644 --- a/libs/apr/poll/os2/pollset.c +++ b/libs/apr/poll/os2/pollset.c @@ -14,46 +14,46 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_poll.h" -#include "apr_arch_networkio.h" +#include "fspr.h" +#include "fspr_poll.h" +#include "fspr_arch_networkio.h" -struct apr_pollset_t { - apr_pool_t *pool; - apr_uint32_t nelts; - apr_uint32_t nalloc; +struct fspr_pollset_t { + fspr_pool_t *pool; + fspr_uint32_t nelts; + fspr_uint32_t nalloc; int *pollset; int num_read; int num_write; int num_except; int num_total; - apr_pollfd_t *query_set; - apr_pollfd_t *result_set; + fspr_pollfd_t *query_set; + fspr_pollfd_t *result_set; }; -APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, - apr_uint32_t size, - apr_pool_t *p, - apr_uint32_t flags) +APR_DECLARE(fspr_status_t) fspr_pollset_create(fspr_pollset_t **pollset, + fspr_uint32_t size, + fspr_pool_t *p, + fspr_uint32_t flags) { - *pollset = apr_palloc(p, sizeof(**pollset)); + *pollset = fspr_palloc(p, sizeof(**pollset)); (*pollset)->pool = p; (*pollset)->nelts = 0; (*pollset)->nalloc = size; - (*pollset)->pollset = apr_palloc(p, size * sizeof(int) * 3); - (*pollset)->query_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); - (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); + (*pollset)->pollset = fspr_palloc(p, size * sizeof(int) * 3); + (*pollset)->query_set = fspr_palloc(p, size * sizeof(fspr_pollfd_t)); + (*pollset)->result_set = fspr_palloc(p, size * sizeof(fspr_pollfd_t)); (*pollset)->num_read = -1; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset) +APR_DECLARE(fspr_status_t) fspr_pollset_destroy(fspr_pollset_t *pollset) { /* A no-op function for now. If we later implement /dev/poll * support, we'll need to close the /dev/poll fd here @@ -63,8 +63,8 @@ APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset) -APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, - const apr_pollfd_t *descriptor) +APR_DECLARE(fspr_status_t) fspr_pollset_add(fspr_pollset_t *pollset, + const fspr_pollfd_t *descriptor) { if (pollset->nelts == pollset->nalloc) { return APR_ENOMEM; @@ -83,16 +83,16 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, -APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, - const apr_pollfd_t *descriptor) +APR_DECLARE(fspr_status_t) fspr_pollset_remove(fspr_pollset_t *pollset, + const fspr_pollfd_t *descriptor) { - apr_uint32_t i; + fspr_uint32_t i; for (i = 0; i < pollset->nelts; i++) { if (descriptor->desc.s == pollset->query_set[i].desc.s) { /* Found an instance of the fd: remove this and any other copies */ - apr_uint32_t dst = i; - apr_uint32_t old_nelts = pollset->nelts; + fspr_uint32_t dst = i; + fspr_uint32_t old_nelts = pollset->nelts; pollset->nelts--; for (i++; i < old_nelts; i++) { @@ -116,7 +116,7 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, -static void make_pollset(apr_pollset_t *pollset) +static void make_pollset(fspr_pollset_t *pollset) { int i; int pos = 0; @@ -151,13 +151,13 @@ static void make_pollset(apr_pollset_t *pollset) -APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, - apr_interval_time_t timeout, - apr_int32_t *num, - const apr_pollfd_t **descriptors) +APR_DECLARE(fspr_status_t) fspr_pollset_poll(fspr_pollset_t *pollset, + fspr_interval_time_t timeout, + fspr_int32_t *num, + const fspr_pollfd_t **descriptors) { int rv; - apr_uint32_t i; + fspr_uint32_t i; int *pollresult; int read_pos, write_pos, except_pos; diff --git a/libs/apr/poll/unix/epoll.c b/libs/apr/poll/unix/epoll.c index 388c67c041..cf9e47392b 100644 --- a/libs/apr/poll/unix/epoll.c +++ b/libs/apr/poll/unix/epoll.c @@ -14,13 +14,13 @@ * limitations under the License. */ -#include "apr_arch_poll_private.h" +#include "fspr_arch_poll_private.h" #ifdef POLLSET_USES_EPOLL -static apr_int16_t get_epoll_event(apr_int16_t event) +static fspr_int16_t get_epoll_event(fspr_int16_t event) { - apr_int16_t rv = 0; + fspr_int16_t rv = 0; if (event & APR_POLLIN) rv |= EPOLLIN; @@ -37,9 +37,9 @@ static apr_int16_t get_epoll_event(apr_int16_t event) return rv; } -static apr_int16_t get_epoll_revent(apr_int16_t event) +static fspr_int16_t get_epoll_revent(fspr_int16_t event) { - apr_int16_t rv = 0; + fspr_int16_t rv = 0; if (event & EPOLLIN) rv |= APR_POLLIN; @@ -56,18 +56,18 @@ static apr_int16_t get_epoll_revent(apr_int16_t event) return rv; } -struct apr_pollset_t +struct fspr_pollset_t { - apr_pool_t *pool; - apr_uint32_t nelts; - apr_uint32_t nalloc; + fspr_pool_t *pool; + fspr_uint32_t nelts; + fspr_uint32_t nalloc; int epoll_fd; struct epoll_event *pollset; - apr_pollfd_t *result_set; - apr_uint32_t flags; + fspr_pollfd_t *result_set; + fspr_uint32_t flags; #if APR_HAS_THREADS /* A thread mutex to protect operations on the rings */ - apr_thread_mutex_t *ring_lock; + fspr_thread_mutex_t *ring_lock; #endif /* A ring containing all of the pollfd_t that are active */ APR_RING_HEAD(pfd_query_ring_t, pfd_elem_t) query_ring; @@ -78,19 +78,19 @@ struct apr_pollset_t APR_RING_HEAD(pfd_dead_ring_t, pfd_elem_t) dead_ring; }; -static apr_status_t backend_cleanup(void *p_) +static fspr_status_t backend_cleanup(void *p_) { - apr_pollset_t *pollset = (apr_pollset_t *) p_; + fspr_pollset_t *pollset = (fspr_pollset_t *) p_; close(pollset->epoll_fd); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, - apr_uint32_t size, - apr_pool_t *p, - apr_uint32_t flags) +APR_DECLARE(fspr_status_t) fspr_pollset_create(fspr_pollset_t **pollset, + fspr_uint32_t size, + fspr_pool_t *p, + fspr_uint32_t flags) { - apr_status_t rv; + fspr_status_t rv; int fd; fd = epoll_create(size); @@ -99,10 +99,10 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, return errno; } - *pollset = apr_palloc(p, sizeof(**pollset)); + *pollset = fspr_palloc(p, sizeof(**pollset)); #if APR_HAS_THREADS if (flags & APR_POLLSET_THREADSAFE && - ((rv = apr_thread_mutex_create(&(*pollset)->ring_lock, + ((rv = fspr_thread_mutex_create(&(*pollset)->ring_lock, APR_THREAD_MUTEX_DEFAULT, p) != APR_SUCCESS))) { *pollset = NULL; @@ -119,9 +119,9 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, (*pollset)->flags = flags; (*pollset)->pool = p; (*pollset)->epoll_fd = fd; - (*pollset)->pollset = apr_palloc(p, size * sizeof(struct epoll_event)); - apr_pool_cleanup_register(p, *pollset, backend_cleanup, backend_cleanup); - (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); + (*pollset)->pollset = fspr_palloc(p, size * sizeof(struct epoll_event)); + fspr_pool_cleanup_register(p, *pollset, backend_cleanup, backend_cleanup); + (*pollset)->result_set = fspr_palloc(p, size * sizeof(fspr_pollfd_t)); APR_RING_INIT(&(*pollset)->query_ring, pfd_elem_t, link); APR_RING_INIT(&(*pollset)->free_ring, pfd_elem_t, link); @@ -130,18 +130,18 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset) +APR_DECLARE(fspr_status_t) fspr_pollset_destroy(fspr_pollset_t *pollset) { - return apr_pool_cleanup_run(pollset->pool, pollset, backend_cleanup); + return fspr_pool_cleanup_run(pollset->pool, pollset, backend_cleanup); } -APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, - const apr_pollfd_t *descriptor) +APR_DECLARE(fspr_status_t) fspr_pollset_add(fspr_pollset_t *pollset, + const fspr_pollfd_t *descriptor) { struct epoll_event ev; int ret = -1; pfd_elem_t *elem; - apr_status_t rv = APR_SUCCESS; + fspr_status_t rv = APR_SUCCESS; pollset_lock_rings(); @@ -150,7 +150,7 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, APR_RING_REMOVE(elem, link); } else { - elem = (pfd_elem_t *) apr_palloc(pollset->pool, sizeof(pfd_elem_t)); + elem = (pfd_elem_t *) fspr_palloc(pollset->pool, sizeof(pfd_elem_t)); APR_RING_ELEM_INIT(elem, link); } elem->pfd = *descriptor; @@ -180,11 +180,11 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, return rv; } -APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, - const apr_pollfd_t *descriptor) +APR_DECLARE(fspr_status_t) fspr_pollset_remove(fspr_pollset_t *pollset, + const fspr_pollfd_t *descriptor) { pfd_elem_t *ep; - apr_status_t rv = APR_SUCCESS; + fspr_status_t rv = APR_SUCCESS; struct epoll_event ev; int ret = -1; @@ -224,13 +224,13 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, return rv; } -APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, - apr_interval_time_t timeout, - apr_int32_t *num, - const apr_pollfd_t **descriptors) +APR_DECLARE(fspr_status_t) fspr_pollset_poll(fspr_pollset_t *pollset, + fspr_interval_time_t timeout, + fspr_int32_t *num, + const fspr_pollfd_t **descriptors) { int ret, i; - apr_status_t rv = APR_SUCCESS; + fspr_status_t rv = APR_SUCCESS; if (timeout > 0) { timeout /= 1000; @@ -241,7 +241,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, (*num) = ret; if (ret < 0) { - rv = apr_get_netos_error(); + rv = fspr_get_netos_error(); } else if (ret == 0) { rv = APR_TIMEUP; diff --git a/libs/apr/poll/unix/kqueue.c b/libs/apr/poll/unix/kqueue.c index a8bea919c3..2938791007 100644 --- a/libs/apr/poll/unix/kqueue.c +++ b/libs/apr/poll/unix/kqueue.c @@ -14,13 +14,13 @@ * limitations under the License. */ -#include "apr_arch_poll_private.h" +#include "fspr_arch_poll_private.h" #ifdef POLLSET_USES_KQUEUE -static apr_int16_t get_kqueue_revent(apr_int16_t event, apr_int16_t flags) +static fspr_int16_t get_kqueue_revent(fspr_int16_t event, fspr_int16_t flags) { - apr_int16_t rv = 0; + fspr_int16_t rv = 0; if (event == EVFILT_READ) rv |= APR_POLLIN; @@ -34,19 +34,19 @@ static apr_int16_t get_kqueue_revent(apr_int16_t event, apr_int16_t flags) return rv; } -struct apr_pollset_t +struct fspr_pollset_t { - apr_pool_t *pool; - apr_uint32_t nelts; - apr_uint32_t nalloc; + fspr_pool_t *pool; + fspr_uint32_t nelts; + fspr_uint32_t nalloc; int kqueue_fd; struct kevent kevent; struct kevent *ke_set; - apr_pollfd_t *result_set; - apr_uint32_t flags; + fspr_pollfd_t *result_set; + fspr_uint32_t flags; #if APR_HAS_THREADS /* A thread mutex to protect operations on the rings */ - apr_thread_mutex_t *ring_lock; + fspr_thread_mutex_t *ring_lock; #endif /* A ring containing all of the pollfd_t that are active */ APR_RING_HEAD(pfd_query_ring_t, pfd_elem_t) query_ring; @@ -57,23 +57,23 @@ struct apr_pollset_t APR_RING_HEAD(pfd_dead_ring_t, pfd_elem_t) dead_ring; }; -static apr_status_t backend_cleanup(void *p_) +static fspr_status_t backend_cleanup(void *p_) { - apr_pollset_t *pollset = (apr_pollset_t *) p_; + fspr_pollset_t *pollset = (fspr_pollset_t *) p_; close(pollset->kqueue_fd); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, - apr_uint32_t size, - apr_pool_t *p, - apr_uint32_t flags) +APR_DECLARE(fspr_status_t) fspr_pollset_create(fspr_pollset_t **pollset, + fspr_uint32_t size, + fspr_pool_t *p, + fspr_uint32_t flags) { - apr_status_t rv = APR_SUCCESS; - *pollset = apr_palloc(p, sizeof(**pollset)); + fspr_status_t rv = APR_SUCCESS; + *pollset = fspr_palloc(p, sizeof(**pollset)); #if APR_HAS_THREADS if (flags & APR_POLLSET_THREADSAFE && - ((rv = apr_thread_mutex_create(&(*pollset)->ring_lock, + ((rv = fspr_thread_mutex_create(&(*pollset)->ring_lock, APR_THREAD_MUTEX_DEFAULT, p) != APR_SUCCESS))) { *pollset = NULL; @@ -91,7 +91,7 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, (*pollset)->pool = p; (*pollset)->ke_set = - (struct kevent *) apr_palloc(p, size * sizeof(struct kevent)); + (struct kevent *) fspr_palloc(p, size * sizeof(struct kevent)); memset((*pollset)->ke_set, 0, size * sizeof(struct kevent)); @@ -101,10 +101,10 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, return APR_ENOMEM; } - apr_pool_cleanup_register(p, (void *) (*pollset), backend_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register(p, (void *) (*pollset), backend_cleanup, + fspr_pool_cleanup_null); - (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); + (*pollset)->result_set = fspr_palloc(p, size * sizeof(fspr_pollfd_t)); APR_RING_INIT(&(*pollset)->query_ring, pfd_elem_t, link); APR_RING_INIT(&(*pollset)->free_ring, pfd_elem_t, link); @@ -113,17 +113,17 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, return rv; } -APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t * pollset) +APR_DECLARE(fspr_status_t) fspr_pollset_destroy(fspr_pollset_t * pollset) { - return apr_pool_cleanup_run(pollset->pool, pollset, backend_cleanup); + return fspr_pool_cleanup_run(pollset->pool, pollset, backend_cleanup); } -APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, - const apr_pollfd_t *descriptor) +APR_DECLARE(fspr_status_t) fspr_pollset_add(fspr_pollset_t *pollset, + const fspr_pollfd_t *descriptor) { - apr_os_sock_t fd; + fspr_os_sock_t fd; pfd_elem_t *elem; - apr_status_t rv = APR_SUCCESS; + fspr_status_t rv = APR_SUCCESS; pollset_lock_rings(); @@ -132,7 +132,7 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, APR_RING_REMOVE(elem, link); } else { - elem = (pfd_elem_t *) apr_palloc(pollset->pool, sizeof(pfd_elem_t)); + elem = (pfd_elem_t *) fspr_palloc(pollset->pool, sizeof(pfd_elem_t)); APR_RING_ELEM_INIT(elem, link); } elem->pfd = *descriptor; @@ -175,12 +175,12 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, return rv; } -APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, - const apr_pollfd_t *descriptor) +APR_DECLARE(fspr_status_t) fspr_pollset_remove(fspr_pollset_t *pollset, + const fspr_pollfd_t *descriptor) { pfd_elem_t *ep; - apr_status_t rv = APR_SUCCESS; - apr_os_sock_t fd; + fspr_status_t rv = APR_SUCCESS; + fspr_os_sock_t fd; pollset_lock_rings(); @@ -229,21 +229,21 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, return rv; } -APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, - apr_interval_time_t timeout, - apr_int32_t *num, - const apr_pollfd_t **descriptors) +APR_DECLARE(fspr_status_t) fspr_pollset_poll(fspr_pollset_t *pollset, + fspr_interval_time_t timeout, + fspr_int32_t *num, + const fspr_pollfd_t **descriptors) { int ret, i; struct timespec tv, *tvptr; - apr_status_t rv = APR_SUCCESS; + fspr_status_t rv = APR_SUCCESS; if (timeout < 0) { tvptr = NULL; } else { - tv.tv_sec = (long) apr_time_sec(timeout); - tv.tv_nsec = (long) apr_time_msec(timeout); + tv.tv_sec = (long) fspr_time_sec(timeout); + tv.tv_nsec = (long) fspr_time_msec(timeout); tvptr = &tv; } @@ -251,7 +251,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, tvptr); (*num) = ret; if (ret < 0) { - rv = apr_get_netos_error(); + rv = fspr_get_netos_error(); } else if (ret == 0) { rv = APR_TIMEUP; diff --git a/libs/apr/poll/unix/poll.c b/libs/apr/poll/unix/poll.c index d27a9998d4..6b2a3c9fc0 100644 --- a/libs/apr/poll/unix/poll.c +++ b/libs/apr/poll/unix/poll.c @@ -14,13 +14,13 @@ * limitations under the License. */ -#include "apr_arch_poll_private.h" +#include "fspr_arch_poll_private.h" #if defined(POLL_USES_POLL) || defined(POLLSET_USES_POLL) -static apr_int16_t get_event(apr_int16_t event) +static fspr_int16_t get_event(fspr_int16_t event) { - apr_int16_t rv = 0; + fspr_int16_t rv = 0; if (event & APR_POLLIN) rv |= POLLIN; @@ -38,9 +38,9 @@ static apr_int16_t get_event(apr_int16_t event) return rv; } -static apr_int16_t get_revent(apr_int16_t event) +static fspr_int16_t get_revent(fspr_int16_t event) { - apr_int16_t rv = 0; + fspr_int16_t rv = 0; if (event & POLLIN) rv |= APR_POLLIN; @@ -65,9 +65,9 @@ static apr_int16_t get_revent(apr_int16_t event) #define SMALL_POLLSET_LIMIT 8 -APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, - apr_int32_t *nsds, - apr_interval_time_t timeout) +APR_DECLARE(fspr_status_t) fspr_poll(fspr_pollfd_t *aprset, fspr_int32_t num, + fspr_int32_t *nsds, + fspr_interval_time_t timeout) { int i, num_to_poll; #ifdef HAVE_VLA @@ -89,7 +89,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, * mapping. */ pollset = malloc(sizeof(struct pollfd) * num); - /* The other option is adding an apr_pool_abort() fn to invoke + /* The other option is adding an fspr_pool_abort() fn to invoke * the pool's out of memory handler */ if (!pollset) @@ -133,7 +133,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, #endif if ((*nsds) < 0) { - return apr_get_netos_error(); + return fspr_get_netos_error(); } if ((*nsds) == 0) { return APR_TIMEUP; @@ -147,43 +147,43 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, #ifdef POLLSET_USES_POLL -struct apr_pollset_t +struct fspr_pollset_t { - apr_pool_t *pool; - apr_uint32_t nelts; - apr_uint32_t nalloc; + fspr_pool_t *pool; + fspr_uint32_t nelts; + fspr_uint32_t nalloc; struct pollfd *pollset; - apr_pollfd_t *query_set; - apr_pollfd_t *result_set; + fspr_pollfd_t *query_set; + fspr_pollfd_t *result_set; }; -APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, - apr_uint32_t size, - apr_pool_t *p, - apr_uint32_t flags) +APR_DECLARE(fspr_status_t) fspr_pollset_create(fspr_pollset_t **pollset, + fspr_uint32_t size, + fspr_pool_t *p, + fspr_uint32_t flags) { if (flags & APR_POLLSET_THREADSAFE) { *pollset = NULL; return APR_ENOTIMPL; } - *pollset = apr_palloc(p, sizeof(**pollset)); + *pollset = fspr_palloc(p, sizeof(**pollset)); (*pollset)->nelts = 0; (*pollset)->nalloc = size; (*pollset)->pool = p; - (*pollset)->pollset = apr_palloc(p, size * sizeof(struct pollfd)); - (*pollset)->query_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); - (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); + (*pollset)->pollset = fspr_palloc(p, size * sizeof(struct pollfd)); + (*pollset)->query_set = fspr_palloc(p, size * sizeof(fspr_pollfd_t)); + (*pollset)->result_set = fspr_palloc(p, size * sizeof(fspr_pollfd_t)); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset) +APR_DECLARE(fspr_status_t) fspr_pollset_destroy(fspr_pollset_t *pollset) { return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, - const apr_pollfd_t *descriptor) +APR_DECLARE(fspr_status_t) fspr_pollset_add(fspr_pollset_t *pollset, + const fspr_pollfd_t *descriptor) { if (pollset->nelts == pollset->nalloc) { return APR_ENOMEM; @@ -205,16 +205,16 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, - const apr_pollfd_t *descriptor) +APR_DECLARE(fspr_status_t) fspr_pollset_remove(fspr_pollset_t *pollset, + const fspr_pollfd_t *descriptor) { - apr_uint32_t i; + fspr_uint32_t i; for (i = 0; i < pollset->nelts; i++) { if (descriptor->desc.s == pollset->query_set[i].desc.s) { /* Found an instance of the fd: remove this and any other copies */ - apr_uint32_t dst = i; - apr_uint32_t old_nelts = pollset->nelts; + fspr_uint32_t dst = i; + fspr_uint32_t old_nelts = pollset->nelts; pollset->nelts--; for (i++; i < old_nelts; i++) { if (descriptor->desc.s == pollset->query_set[i].desc.s) { @@ -233,13 +233,13 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, return APR_NOTFOUND; } -APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, - apr_interval_time_t timeout, - apr_int32_t *num, - const apr_pollfd_t **descriptors) +APR_DECLARE(fspr_status_t) fspr_pollset_poll(fspr_pollset_t *pollset, + fspr_interval_time_t timeout, + fspr_int32_t *num, + const fspr_pollfd_t **descriptors) { int rv; - apr_uint32_t i, j; + fspr_uint32_t i, j; if (timeout > 0) { timeout /= 1000; @@ -247,7 +247,7 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, rv = poll(pollset->pollset, pollset->nelts, timeout); (*num) = rv; if (rv < 0) { - return apr_get_netos_error(); + return fspr_get_netos_error(); } if (rv == 0) { return APR_TIMEUP; diff --git a/libs/apr/poll/unix/port.c b/libs/apr/poll/unix/port.c index f668912b3f..626a690d40 100644 --- a/libs/apr/poll/unix/port.c +++ b/libs/apr/poll/unix/port.c @@ -14,13 +14,13 @@ * limitations under the License. */ -#include "apr_arch_poll_private.h" +#include "fspr_arch_poll_private.h" #ifdef POLLSET_USES_PORT -static apr_int16_t get_event(apr_int16_t event) +static fspr_int16_t get_event(fspr_int16_t event) { - apr_int16_t rv = 0; + fspr_int16_t rv = 0; if (event & APR_POLLIN) rv |= POLLIN; @@ -38,9 +38,9 @@ static apr_int16_t get_event(apr_int16_t event) return rv; } -static apr_int16_t get_revent(apr_int16_t event) +static fspr_int16_t get_revent(fspr_int16_t event) { - apr_int16_t rv = 0; + fspr_int16_t rv = 0; if (event & POLLIN) rv |= APR_POLLIN; @@ -59,18 +59,18 @@ static apr_int16_t get_revent(apr_int16_t event) } -struct apr_pollset_t +struct fspr_pollset_t { - apr_pool_t *pool; - apr_uint32_t nelts; - apr_uint32_t nalloc; + fspr_pool_t *pool; + fspr_uint32_t nelts; + fspr_uint32_t nalloc; int port_fd; port_event_t *port_set; - apr_pollfd_t *result_set; - apr_uint32_t flags; + fspr_pollfd_t *result_set; + fspr_uint32_t flags; #if APR_HAS_THREADS /* A thread mutex to protect operations on the rings */ - apr_thread_mutex_t *ring_lock; + fspr_thread_mutex_t *ring_lock; #endif /* A ring containing all of the pollfd_t that are active */ APR_RING_HEAD(pfd_query_ring_t, pfd_elem_t) query_ring; @@ -82,23 +82,23 @@ struct apr_pollset_t APR_RING_HEAD(pfd_dead_ring_t, pfd_elem_t) dead_ring; }; -static apr_status_t backend_cleanup(void *p_) +static fspr_status_t backend_cleanup(void *p_) { - apr_pollset_t *pollset = (apr_pollset_t *) p_; + fspr_pollset_t *pollset = (fspr_pollset_t *) p_; close(pollset->port_fd); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, - apr_uint32_t size, - apr_pool_t *p, - apr_uint32_t flags) +APR_DECLARE(fspr_status_t) fspr_pollset_create(fspr_pollset_t **pollset, + fspr_uint32_t size, + fspr_pool_t *p, + fspr_uint32_t flags) { - apr_status_t rv = APR_SUCCESS; - *pollset = apr_palloc(p, sizeof(**pollset)); + fspr_status_t rv = APR_SUCCESS; + *pollset = fspr_palloc(p, sizeof(**pollset)); #if APR_HAS_THREADS if (flags & APR_POLLSET_THREADSAFE && - ((rv = apr_thread_mutex_create(&(*pollset)->ring_lock, + ((rv = fspr_thread_mutex_create(&(*pollset)->ring_lock, APR_THREAD_MUTEX_DEFAULT, p) != APR_SUCCESS))) { *pollset = NULL; @@ -115,7 +115,7 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, (*pollset)->flags = flags; (*pollset)->pool = p; - (*pollset)->port_set = apr_palloc(p, size * sizeof(port_event_t)); + (*pollset)->port_set = fspr_palloc(p, size * sizeof(port_event_t)); (*pollset)->port_fd = port_create(); @@ -123,10 +123,10 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, return APR_ENOMEM; } - apr_pool_cleanup_register(p, (void *) (*pollset), backend_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register(p, (void *) (*pollset), backend_cleanup, + fspr_pool_cleanup_null); - (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); + (*pollset)->result_set = fspr_palloc(p, size * sizeof(fspr_pollfd_t)); APR_RING_INIT(&(*pollset)->query_ring, pfd_elem_t, link); APR_RING_INIT(&(*pollset)->add_ring, pfd_elem_t, link); @@ -136,18 +136,18 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, return rv; } -APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset) +APR_DECLARE(fspr_status_t) fspr_pollset_destroy(fspr_pollset_t *pollset) { - return apr_pool_cleanup_run(pollset->pool, pollset, backend_cleanup); + return fspr_pool_cleanup_run(pollset->pool, pollset, backend_cleanup); } -APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, - const apr_pollfd_t *descriptor) +APR_DECLARE(fspr_status_t) fspr_pollset_add(fspr_pollset_t *pollset, + const fspr_pollfd_t *descriptor) { - apr_os_sock_t fd; + fspr_os_sock_t fd; pfd_elem_t *elem; int res; - apr_status_t rv = APR_SUCCESS; + fspr_status_t rv = APR_SUCCESS; pollset_lock_rings(); @@ -156,7 +156,7 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, APR_RING_REMOVE(elem, link); } else { - elem = (pfd_elem_t *) apr_palloc(pollset->pool, sizeof(pfd_elem_t)); + elem = (pfd_elem_t *) fspr_palloc(pollset->pool, sizeof(pfd_elem_t)); APR_RING_ELEM_INIT(elem, link); } elem->pfd = *descriptor; @@ -185,12 +185,12 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, return rv; } -APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, - const apr_pollfd_t *descriptor) +APR_DECLARE(fspr_status_t) fspr_pollset_remove(fspr_pollset_t *pollset, + const fspr_pollfd_t *descriptor) { - apr_os_sock_t fd; + fspr_os_sock_t fd; pfd_elem_t *ep; - apr_status_t rv = APR_SUCCESS; + fspr_status_t rv = APR_SUCCESS; int res; pollset_lock_rings(); @@ -243,24 +243,24 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, return rv; } -APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, - apr_interval_time_t timeout, - apr_int32_t *num, - const apr_pollfd_t **descriptors) +APR_DECLARE(fspr_status_t) fspr_pollset_poll(fspr_pollset_t *pollset, + fspr_interval_time_t timeout, + fspr_int32_t *num, + const fspr_pollfd_t **descriptors) { - apr_os_sock_t fd; + fspr_os_sock_t fd; int ret, i; unsigned int nget; pfd_elem_t *ep; struct timespec tv, *tvptr; - apr_status_t rv = APR_SUCCESS; + fspr_status_t rv = APR_SUCCESS; if (timeout < 0) { tvptr = NULL; } else { - tv.tv_sec = (long) apr_time_sec(timeout); - tv.tv_nsec = (long) apr_time_msec(timeout); + tv.tv_sec = (long) fspr_time_sec(timeout); + tv.tv_nsec = (long) fspr_time_msec(timeout); tvptr = &tv; } diff --git a/libs/apr/poll/unix/select.c b/libs/apr/poll/unix/select.c index ca35b77db9..fecdaf845a 100644 --- a/libs/apr/poll/unix/select.c +++ b/libs/apr/poll/unix/select.c @@ -19,34 +19,34 @@ #define FD_SETSIZE 1024 #endif -#include "apr.h" -#include "apr_poll.h" -#include "apr_time.h" -#include "apr_portable.h" -#include "apr_arch_networkio.h" -#include "apr_arch_file_io.h" -#include "apr_arch_poll_private.h" +#include "fspr.h" +#include "fspr_poll.h" +#include "fspr_time.h" +#include "fspr_portable.h" +#include "fspr_arch_networkio.h" +#include "fspr_arch_file_io.h" +#include "fspr_arch_poll_private.h" #ifdef POLL_USES_SELECT -APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, - apr_int32_t *nsds, - apr_interval_time_t timeout) +APR_DECLARE(fspr_status_t) fspr_poll(fspr_pollfd_t *aprset, int num, + fspr_int32_t *nsds, + fspr_interval_time_t timeout) { fd_set readset, writeset, exceptset; int rv, i; int maxfd = -1; struct timeval tv, *tvptr; #ifdef NETWARE - apr_datatype_e set_type = APR_NO_DESC; + fspr_datatype_e set_type = APR_NO_DESC; #endif if (timeout < 0) { tvptr = NULL; } else { - tv.tv_sec = (long) apr_time_sec(timeout); - tv.tv_usec = (long) apr_time_usec(timeout); + tv.tv_sec = (long) fspr_time_sec(timeout); + tv.tv_usec = (long) fspr_time_usec(timeout); tvptr = &tv; } @@ -55,7 +55,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, FD_ZERO(&exceptset); for (i = 0; i < num; i++) { - apr_os_sock_t fd; + fspr_os_sock_t fd; aprset[i].rtnevents = 0; @@ -128,12 +128,12 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, return APR_TIMEUP; } if ((*nsds) < 0) { - return apr_get_netos_error(); + return fspr_get_netos_error(); } (*nsds) = 0; for (i = 0; i < num; i++) { - apr_os_sock_t fd; + fspr_os_sock_t fd; if (aprset[i].desc_type == APR_POLL_SOCKET) { fd = aprset[i].desc.s->socketdes; @@ -169,25 +169,25 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num, #ifdef POLLSET_USES_SELECT -struct apr_pollset_t +struct fspr_pollset_t { - apr_pool_t *pool; + fspr_pool_t *pool; - apr_uint32_t nelts; - apr_uint32_t nalloc; + fspr_uint32_t nelts; + fspr_uint32_t nalloc; fd_set readset, writeset, exceptset; int maxfd; - apr_pollfd_t *query_set; - apr_pollfd_t *result_set; + fspr_pollfd_t *query_set; + fspr_pollfd_t *result_set; #ifdef NETWARE int set_type; #endif }; -APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, - apr_uint32_t size, - apr_pool_t *p, - apr_uint32_t flags) +APR_DECLARE(fspr_status_t) fspr_pollset_create(fspr_pollset_t **pollset, + fspr_uint32_t size, + fspr_pool_t *p, + fspr_uint32_t flags) { if (flags & APR_POLLSET_THREADSAFE) { *pollset = NULL; @@ -199,7 +199,7 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, return APR_EINVAL; } #endif - *pollset = apr_palloc(p, sizeof(**pollset)); + *pollset = fspr_palloc(p, sizeof(**pollset)); (*pollset)->nelts = 0; (*pollset)->nalloc = size; (*pollset)->pool = p; @@ -210,21 +210,21 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, #ifdef NETWARE (*pollset)->set_type = APR_NO_DESC; #endif - (*pollset)->query_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); - (*pollset)->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t)); + (*pollset)->query_set = fspr_palloc(p, size * sizeof(fspr_pollfd_t)); + (*pollset)->result_set = fspr_palloc(p, size * sizeof(fspr_pollfd_t)); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t * pollset) +APR_DECLARE(fspr_status_t) fspr_pollset_destroy(fspr_pollset_t * pollset) { return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, - const apr_pollfd_t *descriptor) +APR_DECLARE(fspr_status_t) fspr_pollset_add(fspr_pollset_t *pollset, + const fspr_pollfd_t *descriptor) { - apr_os_sock_t fd; + fspr_os_sock_t fd; if (pollset->nelts == pollset->nalloc) { return APR_ENOMEM; @@ -285,11 +285,11 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t * pollset, - const apr_pollfd_t * descriptor) +APR_DECLARE(fspr_status_t) fspr_pollset_remove(fspr_pollset_t * pollset, + const fspr_pollfd_t * descriptor) { - apr_uint32_t i; - apr_os_sock_t fd; + fspr_uint32_t i; + fspr_os_sock_t fd; if (descriptor->desc_type == APR_POLL_SOCKET) { fd = descriptor->desc.s->socketdes; @@ -305,8 +305,8 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t * pollset, for (i = 0; i < pollset->nelts; i++) { if (descriptor->desc.s == pollset->query_set[i].desc.s) { /* Found an instance of the fd: remove this and any other copies */ - apr_uint32_t dst = i; - apr_uint32_t old_nelts = pollset->nelts; + fspr_uint32_t dst = i; + fspr_uint32_t old_nelts = pollset->nelts; pollset->nelts--; for (i++; i < old_nelts; i++) { if (descriptor->desc.s == pollset->query_set[i].desc.s) { @@ -330,13 +330,13 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t * pollset, return APR_NOTFOUND; } -APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, - apr_interval_time_t timeout, - apr_int32_t *num, - const apr_pollfd_t **descriptors) +APR_DECLARE(fspr_status_t) fspr_pollset_poll(fspr_pollset_t *pollset, + fspr_interval_time_t timeout, + fspr_int32_t *num, + const fspr_pollfd_t **descriptors) { int rv; - apr_uint32_t i, j; + fspr_uint32_t i, j; struct timeval tv, *tvptr; fd_set readset, writeset, exceptset; @@ -344,8 +344,8 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, tvptr = NULL; } else { - tv.tv_sec = (long) apr_time_sec(timeout); - tv.tv_usec = (long) apr_time_usec(timeout); + tv.tv_sec = (long) fspr_time_sec(timeout); + tv.tv_usec = (long) fspr_time_usec(timeout); tvptr = &tv; } @@ -365,14 +365,14 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, (*num) = rv; if (rv < 0) { - return apr_get_netos_error(); + return fspr_get_netos_error(); } if (rv == 0) { return APR_TIMEUP; } j = 0; for (i = 0; i < pollset->nelts; i++) { - apr_os_sock_t fd; + fspr_os_sock_t fd; if (pollset->query_set[i].desc_type == APR_POLL_SOCKET) { fd = pollset->query_set[i].desc.s->socketdes; } diff --git a/libs/apr/random/unix/apr_random.c b/libs/apr/random/unix/fspr_random.c similarity index 71% rename from libs/apr/random/unix/apr_random.c rename to libs/apr/random/unix/fspr_random.c index f574b590d4..5657624512 100644 --- a/libs/apr/random/unix/apr_random.c +++ b/libs/apr/random/unix/fspr_random.c @@ -17,10 +17,10 @@ * See the paper "???" by Ben Laurie for an explanation of this PRNG. */ -#include "apr.h" -#include "apr_pools.h" -#include "apr_random.h" -#include "apr_thread_proc.h" +#include "fspr.h" +#include "fspr_pools.h" +#include "fspr_random.h" +#include "fspr_thread_proc.h" #include #ifdef min @@ -35,11 +35,11 @@ #define APR_RANDOM_DEFAULT_G_FOR_INSECURE 32 #define APR_RANDOM_DEFAULT_G_FOR_SECURE 320 -typedef struct apr_random_pool_t { +typedef struct fspr_random_pool_t { unsigned char *pool; unsigned int bytes; unsigned int pool_size; -} apr_random_pool_t; +} fspr_random_pool_t; #define hash_init(h) (h)->init(h) #define hash_add(h,b,n) (h)->add(h,b,n) @@ -50,18 +50,18 @@ typedef struct apr_random_pool_t { #define crypt_setkey(c,k) (c)->set_key((c)->data,k) #define crypt_crypt(c,out,in) (c)->crypt((c)->date,out,in) -struct apr_random_t { - apr_pool_t *apr_pool; - apr_crypto_hash_t *pool_hash; +struct fspr_random_t { + fspr_pool_t *fspr_pool; + fspr_crypto_hash_t *pool_hash; unsigned int npools; - apr_random_pool_t *pools; + fspr_random_pool_t *pools; unsigned int next_pool; unsigned int generation; - apr_size_t rehash_size; - apr_size_t reseed_size; - apr_crypto_hash_t *key_hash; + fspr_size_t rehash_size; + fspr_size_t reseed_size; + fspr_crypto_hash_t *key_hash; #define K_size(g) ((g)->key_hash->size) - apr_crypto_hash_t *prng_hash; + fspr_crypto_hash_t *prng_hash; #define B_size(g) ((g)->prng_hash->size) unsigned char *H; @@ -71,33 +71,33 @@ struct apr_random_t { ? (g)->H_waiting : (g)->H) unsigned char *randomness; - apr_size_t random_bytes; + fspr_size_t random_bytes; unsigned int g_for_insecure; unsigned int g_for_secure; unsigned int secure_base; unsigned int insecure_started:1; unsigned int secure_started:1; - apr_random_t *next; + fspr_random_t *next; }; -static apr_random_t *all_random; +static fspr_random_t *all_random; -APR_DECLARE(void) apr_random_init(apr_random_t *g,apr_pool_t *p, - apr_crypto_hash_t *pool_hash, - apr_crypto_hash_t *key_hash, - apr_crypto_hash_t *prng_hash) +APR_DECLARE(void) fspr_random_init(fspr_random_t *g,fspr_pool_t *p, + fspr_crypto_hash_t *pool_hash, + fspr_crypto_hash_t *key_hash, + fspr_crypto_hash_t *prng_hash) { unsigned int n; - g->apr_pool = p; + g->fspr_pool = p; g->pool_hash = pool_hash; g->key_hash = key_hash; g->prng_hash = prng_hash; g->npools = APR_RANDOM_DEFAULT_POOLS; - g->pools = apr_palloc(p,g->npools*sizeof *g->pools); + g->pools = fspr_palloc(p,g->npools*sizeof *g->pools); for (n = 0; n < g->npools; ++n) { g->pools[n].bytes = g->pools[n].pool_size = 0; g->pools[n].pool = NULL; @@ -112,10 +112,10 @@ APR_DECLARE(void) apr_random_init(apr_random_t *g,apr_pool_t *p, /2)*g->pool_hash->size*2; g->reseed_size = APR_RANDOM_DEFAULT_RESEED_SIZE; - g->H = apr_pcalloc(p,H_size(g)); - g->H_waiting = apr_pcalloc(p,H_size(g)); + g->H = fspr_pcalloc(p,H_size(g)); + g->H_waiting = fspr_pcalloc(p,H_size(g)); - g->randomness = apr_palloc(p,B_size(g)); + g->randomness = fspr_palloc(p,B_size(g)); g->random_bytes = 0; g->g_for_insecure = APR_RANDOM_DEFAULT_G_FOR_INSECURE; @@ -127,7 +127,7 @@ APR_DECLARE(void) apr_random_init(apr_random_t *g,apr_pool_t *p, all_random = g; } -static void mix_pid(apr_random_t *g,unsigned char *H,pid_t pid) +static void mix_pid(fspr_random_t *g,unsigned char *H,pid_t pid) { hash_init(g->key_hash); hash_add(g->key_hash,H,H_size(g)); @@ -135,7 +135,7 @@ static void mix_pid(apr_random_t *g,unsigned char *H,pid_t pid) hash_finish(g->key_hash,H); } -static void mixer(apr_random_t *g,pid_t pid) +static void mixer(fspr_random_t *g,pid_t pid) { unsigned char *H = H_current(g); @@ -151,24 +151,24 @@ static void mixer(apr_random_t *g,pid_t pid) g->random_bytes = 0; } -APR_DECLARE(void) apr_random_after_fork(apr_proc_t *proc) +APR_DECLARE(void) fspr_random_after_fork(fspr_proc_t *proc) { - apr_random_t *r; + fspr_random_t *r; for (r = all_random; r; r = r->next) mixer(r,proc->pid); } -APR_DECLARE(apr_random_t *) apr_random_standard_new(apr_pool_t *p) +APR_DECLARE(fspr_random_t *) fspr_random_standard_new(fspr_pool_t *p) { - apr_random_t *r = apr_palloc(p,sizeof *r); + fspr_random_t *r = fspr_palloc(p,sizeof *r); - apr_random_init(r,p,apr_crypto_sha256_new(p),apr_crypto_sha256_new(p), - apr_crypto_sha256_new(p)); + fspr_random_init(r,p,fspr_crypto_sha256_new(p),fspr_crypto_sha256_new(p), + fspr_crypto_sha256_new(p)); return r; } -static void rekey(apr_random_t *g) +static void rekey(fspr_random_t *g) { unsigned int n; unsigned char *H = H_current(g); @@ -197,20 +197,20 @@ static void rekey(apr_random_t *g) } } -APR_DECLARE(void) apr_random_add_entropy(apr_random_t *g,const void *entropy_, - apr_size_t bytes) +APR_DECLARE(void) fspr_random_add_entropy(fspr_random_t *g,const void *entropy_, + fspr_size_t bytes) { unsigned int n; const unsigned char *entropy = entropy_; for (n = 0; n < bytes; ++n) { - apr_random_pool_t *p = &g->pools[g->next_pool]; + fspr_random_pool_t *p = &g->pools[g->next_pool]; if (++g->next_pool == g->npools) g->next_pool = 0; if (p->pool_size < p->bytes+1) { - unsigned char *np = apr_palloc(g->apr_pool,(p->bytes+1)*2); + unsigned char *np = fspr_palloc(g->fspr_pool,(p->bytes+1)*2); memcpy(np,p->pool,p->bytes); p->pool = np; @@ -233,23 +233,23 @@ APR_DECLARE(void) apr_random_add_entropy(apr_random_t *g,const void *entropy_, } /* This will give g->B_size bytes of randomness */ -static void apr_random_block(apr_random_t *g,unsigned char *random) +static void fspr_random_block(fspr_random_t *g,unsigned char *random) { /* FIXME: in principle, these are different hashes */ hash(g->prng_hash,g->H,g->H,H_size(g)); hash(g->prng_hash,random,g->H,B_size(g)); } -static void apr_random_bytes(apr_random_t *g,unsigned char *random, - apr_size_t bytes) +static void fspr_random_bytes(fspr_random_t *g,unsigned char *random, + fspr_size_t bytes) { - apr_size_t n; + fspr_size_t n; for (n = 0; n < bytes; ) { int l; if (g->random_bytes == 0) { - apr_random_block(g,g->randomness); + fspr_random_block(g,g->randomness); g->random_bytes = B_size(g); } l = min(bytes-n,g->random_bytes); @@ -259,40 +259,40 @@ static void apr_random_bytes(apr_random_t *g,unsigned char *random, } } -APR_DECLARE(apr_status_t) apr_random_secure_bytes(apr_random_t *g, +APR_DECLARE(fspr_status_t) fspr_random_secure_bytes(fspr_random_t *g, void *random, - apr_size_t bytes) + fspr_size_t bytes) { if (!g->secure_started) return APR_ENOTENOUGHENTROPY; - apr_random_bytes(g,random,bytes); + fspr_random_bytes(g,random,bytes); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_random_insecure_bytes(apr_random_t *g, +APR_DECLARE(fspr_status_t) fspr_random_insecure_bytes(fspr_random_t *g, void *random, - apr_size_t bytes) + fspr_size_t bytes) { if (!g->insecure_started) return APR_ENOTENOUGHENTROPY; - apr_random_bytes(g,random,bytes); + fspr_random_bytes(g,random,bytes); return APR_SUCCESS; } -APR_DECLARE(void) apr_random_barrier(apr_random_t *g) +APR_DECLARE(void) fspr_random_barrier(fspr_random_t *g) { g->secure_started = 0; g->secure_base = g->generation; } -APR_DECLARE(apr_status_t) apr_random_secure_ready(apr_random_t *r) +APR_DECLARE(fspr_status_t) fspr_random_secure_ready(fspr_random_t *r) { if (!r->secure_started) return APR_ENOTENOUGHENTROPY; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_random_insecure_ready(apr_random_t *r) +APR_DECLARE(fspr_status_t) fspr_random_insecure_ready(fspr_random_t *r) { if (!r->insecure_started) return APR_ENOTENOUGHENTROPY; diff --git a/libs/apr/random/unix/sha2.c b/libs/apr/random/unix/sha2.c index b8bd241d85..5a3f217822 100644 --- a/libs/apr/random/unix/sha2.c +++ b/libs/apr/random/unix/sha2.c @@ -45,9 +45,9 @@ */ /*** SHA-256/384/512 Machine Architecture Definitions *****************/ -typedef apr_byte_t sha2_byte; /* Exactly 1 byte */ -typedef apr_uint32_t sha2_word32; /* Exactly 4 bytes */ -typedef apr_uint64_t sha2_word64; /* Exactly 8 bytes */ +typedef fspr_byte_t sha2_byte; /* Exactly 1 byte */ +typedef fspr_uint32_t sha2_word32; /* Exactly 4 bytes */ +typedef fspr_uint64_t sha2_word64; /* Exactly 8 bytes */ /*** SHA-256/384/512 Various Length Definitions ***********************/ /* NOTE: Most of these are in sha2.h */ @@ -150,9 +150,9 @@ typedef apr_uint64_t sha2_word64; /* Exactly 8 bytes */ * library -- they are intended for private internal visibility/use * only. */ -void apr__SHA512_Last(SHA512_CTX*); -void apr__SHA256_Transform(SHA256_CTX*, const sha2_word32*); -void apr__SHA512_Transform(SHA512_CTX*, const sha2_word64*); +void fspr__SHA512_Last(SHA512_CTX*); +void fspr__SHA256_Transform(SHA256_CTX*, const sha2_word32*); +void fspr__SHA512_Transform(SHA512_CTX*, const sha2_word64*); /*** SHA-XYZ INITIAL HASH VALUES AND CONSTANTS ************************/ @@ -264,7 +264,7 @@ static const char *sha2_hex_digits = "0123456789abcdef"; /*** SHA-256: *********************************************************/ -void apr__SHA256_Init(SHA256_CTX* context) { +void fspr__SHA256_Init(SHA256_CTX* context) { if (context == (SHA256_CTX*)0) { return; } @@ -310,7 +310,7 @@ void apr__SHA256_Init(SHA256_CTX* context) { (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ j++ -void apr__SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { +void fspr__SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { sha2_word32 a, b, c, d, e, f, g, h, s0, s1; sha2_word32 T1, *W256; int j; @@ -368,7 +368,7 @@ void apr__SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { #else /* SHA2_UNROLL_TRANSFORM */ -void apr__SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { +void fspr__SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { sha2_word32 a, b, c, d, e, f, g, h, s0, s1; sha2_word32 T1, T2, *W256; int j; @@ -458,7 +458,7 @@ void apr__SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { #endif /* SHA2_UNROLL_TRANSFORM */ -void apr__SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) { +void fspr__SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) { unsigned int freespace, usedspace; if (len == 0) { @@ -481,7 +481,7 @@ void apr__SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) context->bitcount += freespace << 3; len -= freespace; data += freespace; - apr__SHA256_Transform(context, (sha2_word32*)context->buffer); + fspr__SHA256_Transform(context, (sha2_word32*)context->buffer); } else { /* The buffer is not yet full */ MEMCPY_BCOPY(&context->buffer[usedspace], data, len); @@ -495,7 +495,7 @@ void apr__SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) } while (len >= SHA256_BLOCK_LENGTH) { /* Process as many complete blocks as we can */ - apr__SHA256_Transform(context, (sha2_word32*)data); + fspr__SHA256_Transform(context, (sha2_word32*)data); context->bitcount += SHA256_BLOCK_LENGTH << 3; len -= SHA256_BLOCK_LENGTH; data += SHA256_BLOCK_LENGTH; @@ -511,7 +511,7 @@ void apr__SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) assert(freespace==0); } -void apr__SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { +void fspr__SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { sha2_word32 *d = (sha2_word32*)digest; unsigned int usedspace; @@ -538,7 +538,7 @@ void apr__SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { MEMSET_BZERO(&context->buffer[usedspace], SHA256_BLOCK_LENGTH - usedspace); } /* Do second-to-last transform: */ - apr__SHA256_Transform(context, (sha2_word32*)context->buffer); + fspr__SHA256_Transform(context, (sha2_word32*)context->buffer); /* And set-up for the last transform: */ MEMSET_BZERO(context->buffer, SHA256_SHORT_BLOCK_LENGTH); @@ -554,7 +554,7 @@ void apr__SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { *(sha2_word64*)&context->buffer[SHA256_SHORT_BLOCK_LENGTH] = context->bitcount; /* Final transform: */ - apr__SHA256_Transform(context, (sha2_word32*)context->buffer); + fspr__SHA256_Transform(context, (sha2_word32*)context->buffer); #if !APR_IS_BIGENDIAN { @@ -576,7 +576,7 @@ void apr__SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { assert(usedspace==0); } -char *apr__SHA256_End(SHA256_CTX* context, char buffer[]) { +char *fspr__SHA256_End(SHA256_CTX* context, char buffer[]) { sha2_byte digest[SHA256_DIGEST_LENGTH], *d = digest; int i; @@ -584,7 +584,7 @@ char *apr__SHA256_End(SHA256_CTX* context, char buffer[]) { assert(context != (SHA256_CTX*)0); if (buffer != (char*)0) { - apr__SHA256_Final(digest, context); + fspr__SHA256_Final(digest, context); for (i = 0; i < SHA256_DIGEST_LENGTH; i++) { *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; @@ -599,17 +599,17 @@ char *apr__SHA256_End(SHA256_CTX* context, char buffer[]) { return buffer; } -char* apr__SHA256_Data(const sha2_byte* data, size_t len, char digest[SHA256_DIGEST_STRING_LENGTH]) { +char* fspr__SHA256_Data(const sha2_byte* data, size_t len, char digest[SHA256_DIGEST_STRING_LENGTH]) { SHA256_CTX context; - apr__SHA256_Init(&context); - apr__SHA256_Update(&context, data, len); - return apr__SHA256_End(&context, digest); + fspr__SHA256_Init(&context); + fspr__SHA256_Update(&context, data, len); + return fspr__SHA256_End(&context, digest); } /*** SHA-512: *********************************************************/ -void apr__SHA512_Init(SHA512_CTX* context) { +void fspr__SHA512_Init(SHA512_CTX* context) { if (context == (SHA512_CTX*)0) { return; } @@ -654,7 +654,7 @@ void apr__SHA512_Init(SHA512_CTX* context) { (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \ j++ -void apr__SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { +void fspr__SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { sha2_word64 a, b, c, d, e, f, g, h, s0, s1; sha2_word64 T1, *W512 = (sha2_word64*)context->buffer; int j; @@ -709,7 +709,7 @@ void apr__SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { #else /* SHA2_UNROLL_TRANSFORM */ -void apr__SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { +void fspr__SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { sha2_word64 a, b, c, d, e, f, g, h, s0, s1; sha2_word64 T1, T2, *W512 = (sha2_word64*)context->buffer; int j; @@ -797,7 +797,7 @@ void apr__SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { #endif /* SHA2_UNROLL_TRANSFORM */ -void apr__SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) { +void fspr__SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) { unsigned int freespace, usedspace; if (len == 0) { @@ -820,7 +820,7 @@ void apr__SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) ADDINC128(context->bitcount, freespace << 3); len -= freespace; data += freespace; - apr__SHA512_Transform(context, (sha2_word64*)context->buffer); + fspr__SHA512_Transform(context, (sha2_word64*)context->buffer); } else { /* The buffer is not yet full */ MEMCPY_BCOPY(&context->buffer[usedspace], data, len); @@ -834,7 +834,7 @@ void apr__SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) } while (len >= SHA512_BLOCK_LENGTH) { /* Process as many complete blocks as we can */ - apr__SHA512_Transform(context, (sha2_word64*)data); + fspr__SHA512_Transform(context, (sha2_word64*)data); ADDINC128(context->bitcount, SHA512_BLOCK_LENGTH << 3); len -= SHA512_BLOCK_LENGTH; data += SHA512_BLOCK_LENGTH; @@ -850,7 +850,7 @@ void apr__SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) assert(freespace==0); } -void apr__SHA512_Last(SHA512_CTX* context) { +void fspr__SHA512_Last(SHA512_CTX* context) { unsigned int usedspace; usedspace = (unsigned int)((context->bitcount[0] >> 3) @@ -872,7 +872,7 @@ void apr__SHA512_Last(SHA512_CTX* context) { MEMSET_BZERO(&context->buffer[usedspace], SHA512_BLOCK_LENGTH - usedspace); } /* Do second-to-last transform: */ - apr__SHA512_Transform(context, (sha2_word64*)context->buffer); + fspr__SHA512_Transform(context, (sha2_word64*)context->buffer); /* And set-up for the last transform: */ MEMSET_BZERO(context->buffer, SHA512_BLOCK_LENGTH - 2); @@ -889,10 +889,10 @@ void apr__SHA512_Last(SHA512_CTX* context) { *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH+8] = context->bitcount[0]; /* Final transform: */ - apr__SHA512_Transform(context, (sha2_word64*)context->buffer); + fspr__SHA512_Transform(context, (sha2_word64*)context->buffer); } -void apr__SHA512_Final(sha2_byte digest[], SHA512_CTX* context) { +void fspr__SHA512_Final(sha2_byte digest[], SHA512_CTX* context) { sha2_word64 *d = (sha2_word64*)digest; /* Sanity check: */ @@ -900,7 +900,7 @@ void apr__SHA512_Final(sha2_byte digest[], SHA512_CTX* context) { /* If no digest buffer is passed, we don't bother doing this: */ if (digest != (sha2_byte*)0) { - apr__SHA512_Last(context); + fspr__SHA512_Last(context); /* Save the hash data for output: */ #if !APR_IS_BIGENDIAN @@ -921,7 +921,7 @@ void apr__SHA512_Final(sha2_byte digest[], SHA512_CTX* context) { MEMSET_BZERO(context, sizeof(*context)); } -char *apr__SHA512_End(SHA512_CTX* context, char buffer[]) { +char *fspr__SHA512_End(SHA512_CTX* context, char buffer[]) { sha2_byte digest[SHA512_DIGEST_LENGTH], *d = digest; int i; @@ -929,7 +929,7 @@ char *apr__SHA512_End(SHA512_CTX* context, char buffer[]) { assert(context != (SHA512_CTX*)0); if (buffer != (char*)0) { - apr__SHA512_Final(digest, context); + fspr__SHA512_Final(digest, context); for (i = 0; i < SHA512_DIGEST_LENGTH; i++) { *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; @@ -944,17 +944,17 @@ char *apr__SHA512_End(SHA512_CTX* context, char buffer[]) { return buffer; } -char* apr__SHA512_Data(const sha2_byte* data, size_t len, char digest[SHA512_DIGEST_STRING_LENGTH]) { +char* fspr__SHA512_Data(const sha2_byte* data, size_t len, char digest[SHA512_DIGEST_STRING_LENGTH]) { SHA512_CTX context; - apr__SHA512_Init(&context); - apr__SHA512_Update(&context, data, len); - return apr__SHA512_End(&context, digest); + fspr__SHA512_Init(&context); + fspr__SHA512_Update(&context, data, len); + return fspr__SHA512_End(&context, digest); } /*** SHA-384: *********************************************************/ -void apr__SHA384_Init(SHA384_CTX* context) { +void fspr__SHA384_Init(SHA384_CTX* context) { if (context == (SHA384_CTX*)0) { return; } @@ -963,11 +963,11 @@ void apr__SHA384_Init(SHA384_CTX* context) { context->bitcount[0] = context->bitcount[1] = 0; } -void apr__SHA384_Update(SHA384_CTX* context, const sha2_byte* data, size_t len) { - apr__SHA512_Update((SHA512_CTX*)context, data, len); +void fspr__SHA384_Update(SHA384_CTX* context, const sha2_byte* data, size_t len) { + fspr__SHA512_Update((SHA512_CTX*)context, data, len); } -void apr__SHA384_Final(sha2_byte digest[], SHA384_CTX* context) { +void fspr__SHA384_Final(sha2_byte digest[], SHA384_CTX* context) { sha2_word64 *d = (sha2_word64*)digest; /* Sanity check: */ @@ -975,7 +975,7 @@ void apr__SHA384_Final(sha2_byte digest[], SHA384_CTX* context) { /* If no digest buffer is passed, we don't bother doing this: */ if (digest != (sha2_byte*)0) { - apr__SHA512_Last((SHA512_CTX*)context); + fspr__SHA512_Last((SHA512_CTX*)context); /* Save the hash data for output: */ #if !APR_IS_BIGENDIAN @@ -996,7 +996,7 @@ void apr__SHA384_Final(sha2_byte digest[], SHA384_CTX* context) { MEMSET_BZERO(context, sizeof(*context)); } -char *apr__SHA384_End(SHA384_CTX* context, char buffer[]) { +char *fspr__SHA384_End(SHA384_CTX* context, char buffer[]) { sha2_byte digest[SHA384_DIGEST_LENGTH], *d = digest; int i; @@ -1004,7 +1004,7 @@ char *apr__SHA384_End(SHA384_CTX* context, char buffer[]) { assert(context != (SHA384_CTX*)0); if (buffer != (char*)0) { - apr__SHA384_Final(digest, context); + fspr__SHA384_Final(digest, context); for (i = 0; i < SHA384_DIGEST_LENGTH; i++) { *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; @@ -1019,11 +1019,11 @@ char *apr__SHA384_End(SHA384_CTX* context, char buffer[]) { return buffer; } -char* apr__SHA384_Data(const sha2_byte* data, size_t len, char digest[SHA384_DIGEST_STRING_LENGTH]) { +char* fspr__SHA384_Data(const sha2_byte* data, size_t len, char digest[SHA384_DIGEST_STRING_LENGTH]) { SHA384_CTX context; - apr__SHA384_Init(&context); - apr__SHA384_Update(&context, data, len); - return apr__SHA384_End(&context, digest); + fspr__SHA384_Init(&context); + fspr__SHA384_Update(&context, data, len); + return fspr__SHA384_End(&context, digest); } diff --git a/libs/apr/random/unix/sha2.h b/libs/apr/random/unix/sha2.h index 9f0d93e1e0..0696d4e0b1 100644 --- a/libs/apr/random/unix/sha2.h +++ b/libs/apr/random/unix/sha2.h @@ -27,7 +27,7 @@ extern "C" { #endif -#include "apr.h" +#include "fspr.h" /*** SHA-256/384/512 Various Length Definitions ***********************/ #define SHA256_BLOCK_LENGTH 64 @@ -43,39 +43,39 @@ extern "C" { /*** SHA-256/384/512 Context Structures *******************************/ typedef struct _SHA256_CTX { - apr_uint32_t state[8]; - apr_uint64_t bitcount; - apr_byte_t buffer[SHA256_BLOCK_LENGTH]; + fspr_uint32_t state[8]; + fspr_uint64_t bitcount; + fspr_byte_t buffer[SHA256_BLOCK_LENGTH]; } SHA256_CTX; typedef struct _SHA512_CTX { - apr_uint64_t state[8]; - apr_uint64_t bitcount[2]; - apr_byte_t buffer[SHA512_BLOCK_LENGTH]; + fspr_uint64_t state[8]; + fspr_uint64_t bitcount[2]; + fspr_byte_t buffer[SHA512_BLOCK_LENGTH]; } SHA512_CTX; typedef SHA512_CTX SHA384_CTX; /*** SHA-256/384/512 Function Prototypes ******************************/ -void apr__SHA256_Init(SHA256_CTX *); -void apr__SHA256_Update(SHA256_CTX *, const apr_byte_t *, size_t); -void apr__SHA256_Final(apr_byte_t [SHA256_DIGEST_LENGTH], SHA256_CTX *); -char* apr__SHA256_End(SHA256_CTX *, char [SHA256_DIGEST_STRING_LENGTH]); -char* apr__SHA256_Data(const apr_byte_t *, size_t, +void fspr__SHA256_Init(SHA256_CTX *); +void fspr__SHA256_Update(SHA256_CTX *, const fspr_byte_t *, size_t); +void fspr__SHA256_Final(fspr_byte_t [SHA256_DIGEST_LENGTH], SHA256_CTX *); +char* fspr__SHA256_End(SHA256_CTX *, char [SHA256_DIGEST_STRING_LENGTH]); +char* fspr__SHA256_Data(const fspr_byte_t *, size_t, char [SHA256_DIGEST_STRING_LENGTH]); -void apr__SHA384_Init(SHA384_CTX *); -void apr__SHA384_Update(SHA384_CTX *, const apr_byte_t *, size_t); -void apr__SHA384_Final(apr_byte_t [SHA384_DIGEST_LENGTH], SHA384_CTX *); -char* apr__SHA384_End(SHA384_CTX *, char [SHA384_DIGEST_STRING_LENGTH]); -char* apr__SHA384_Data(const apr_byte_t *, size_t, +void fspr__SHA384_Init(SHA384_CTX *); +void fspr__SHA384_Update(SHA384_CTX *, const fspr_byte_t *, size_t); +void fspr__SHA384_Final(fspr_byte_t [SHA384_DIGEST_LENGTH], SHA384_CTX *); +char* fspr__SHA384_End(SHA384_CTX *, char [SHA384_DIGEST_STRING_LENGTH]); +char* fspr__SHA384_Data(const fspr_byte_t *, size_t, char [SHA384_DIGEST_STRING_LENGTH]); -void apr__SHA512_Init(SHA512_CTX *); -void apr__SHA512_Update(SHA512_CTX *, const apr_byte_t *, size_t); -void apr__SHA512_Final(apr_byte_t [SHA512_DIGEST_LENGTH], SHA512_CTX *); -char* apr__SHA512_End(SHA512_CTX *, char [SHA512_DIGEST_STRING_LENGTH]); -char* apr__SHA512_Data(const apr_byte_t *, size_t, +void fspr__SHA512_Init(SHA512_CTX *); +void fspr__SHA512_Update(SHA512_CTX *, const fspr_byte_t *, size_t); +void fspr__SHA512_Final(fspr_byte_t [SHA512_DIGEST_LENGTH], SHA512_CTX *); +char* fspr__SHA512_End(SHA512_CTX *, char [SHA512_DIGEST_STRING_LENGTH]); +char* fspr__SHA512_Data(const fspr_byte_t *, size_t, char [SHA512_DIGEST_STRING_LENGTH]); #ifdef __cplusplus diff --git a/libs/apr/random/unix/sha2_glue.c b/libs/apr/random/unix/sha2_glue.c index 4909a8fe1f..17bc4bd356 100644 --- a/libs/apr/random/unix/sha2_glue.c +++ b/libs/apr/random/unix/sha2_glue.c @@ -1,29 +1,29 @@ -#include -#include -#include +#include +#include +#include #include "sha2.h" -static void sha256_init(apr_crypto_hash_t *h) +static void sha256_init(fspr_crypto_hash_t *h) { - apr__SHA256_Init(h->data); + fspr__SHA256_Init(h->data); } -static void sha256_add(apr_crypto_hash_t *h,const void *data, - apr_size_t bytes) +static void sha256_add(fspr_crypto_hash_t *h,const void *data, + fspr_size_t bytes) { - apr__SHA256_Update(h->data,data,bytes); + fspr__SHA256_Update(h->data,data,bytes); } -static void sha256_finish(apr_crypto_hash_t *h,unsigned char *result) +static void sha256_finish(fspr_crypto_hash_t *h,unsigned char *result) { - apr__SHA256_Final(result,h->data); + fspr__SHA256_Final(result,h->data); } -APR_DECLARE(apr_crypto_hash_t *) apr_crypto_sha256_new(apr_pool_t *p) +APR_DECLARE(fspr_crypto_hash_t *) fspr_crypto_sha256_new(fspr_pool_t *p) { - apr_crypto_hash_t *h=apr_palloc(p,sizeof *h); + fspr_crypto_hash_t *h=fspr_palloc(p,sizeof *h); - h->data=apr_palloc(p,sizeof(SHA256_CTX)); + h->data=fspr_palloc(p,sizeof(SHA256_CTX)); h->init=sha256_init; h->add=sha256_add; h->finish=sha256_finish; diff --git a/libs/apr/renames_pending b/libs/apr/renames_pending index ca007a729c..58757f69b2 100644 --- a/libs/apr/renames_pending +++ b/libs/apr/renames_pending @@ -1,39 +1,39 @@ Pending symbol renames for APR [for some discussion yet] -apr_file_info_t from apr_finfo_t -apr_file_attrs_t from apr_fileattrs_t -apr_file_seek_where_t from apr_seek_where_t +fspr_file_info_t from fspr_finfo_t +fspr_file_attrs_t from fspr_fileattrs_t +fspr_file_seek_where_t from fspr_seek_where_t -#apr_filepath_name_get from apr_filename_of_pathname +#fspr_filepath_name_get from fspr_filename_of_pathname -apr_lock_mech_e from apr_lockmech_e +fspr_lock_mech_e from fspr_lockmech_e -#apr_gid_get from apr_get_groupid -#apr_gid_name_get from apr_get_groupname -#apr_gid_name_get from apr_group_name_get -#apr_gid_compare from apr_compare_groups +#fspr_gid_get from fspr_get_groupid +#fspr_gid_name_get from fspr_get_groupname +#fspr_gid_name_get from fspr_group_name_get +#fspr_gid_compare from fspr_compare_groups -#apr_socket_shutdown from apr_shutdown -#apr_socket_bind from apr_bind -#apr_socket_listen from apr_listen -#apr_socket_accept from apr_accept -#apr_socket_connect from apr_connect -#apr_socket_send from apr_send -#apr_socket_sendv from apr_sendv -#apr_socket_sendto from apr_sendto -#apr_socket_recvfrom from apr_recvfrom -#apr_socket_sendfile from apr_sendfile -#apr_socket_recv from apr_recv -#apr_socket_inherit_set from apr_socket_set_inherit -#apr_socket_inherit_unset from apr_socket_unset_inherit +#fspr_socket_shutdown from fspr_shutdown +#fspr_socket_bind from fspr_bind +#fspr_socket_listen from fspr_listen +#fspr_socket_accept from fspr_accept +#fspr_socket_connect from fspr_connect +#fspr_socket_send from fspr_send +#fspr_socket_sendv from fspr_sendv +#fspr_socket_sendto from fspr_sendto +#fspr_socket_recvfrom from fspr_recvfrom +#fspr_socket_sendfile from fspr_sendfile +#fspr_socket_recv from fspr_recv +#fspr_socket_inherit_set from fspr_socket_set_inherit +#fspr_socket_inherit_unset from fspr_socket_unset_inherit -#apr_time_exp_gmt_get from apr_implode_gmt -apr_time_interval_t from apr_interval_time_t -apr_time_interval_short_t from apr_short_interval_time_t +#fspr_time_exp_gmt_get from fspr_implode_gmt +fspr_time_interval_t from fspr_interval_time_t +fspr_time_interval_short_t from fspr_short_interval_time_t -#apr_uid_homepath_get from apr_get_home_directory -#apr_uid_get from apr_get_userid -#apr_uid_current from apr_current_userid -#apr_uid_compare from apr_compare_users -#apr_uid_name_get from apr_get_username +#fspr_uid_homepath_get from fspr_get_home_directory +#fspr_uid_get from fspr_get_userid +#fspr_uid_current from fspr_current_userid +#fspr_uid_compare from fspr_compare_users +#fspr_uid_name_get from fspr_get_username diff --git a/libs/apr/shmem/beos/shm.c b/libs/apr/shmem/beos/shm.c index 1f06f78acd..f8cb22db29 100644 --- a/libs/apr/shmem/beos/shm.c +++ b/libs/apr/shmem/beos/shm.c @@ -14,44 +14,44 @@ * limitations under the License. */ -#include "apr_general.h" -#include "apr_shm.h" -#include "apr_errno.h" -#include "apr_lib.h" -#include "apr_strings.h" +#include "fspr_general.h" +#include "fspr_shm.h" +#include "fspr_errno.h" +#include "fspr_lib.h" +#include "fspr_strings.h" #include #include #include -#include "apr_portable.h" +#include "fspr_portable.h" -struct apr_shm_t { - apr_pool_t *pool; +struct fspr_shm_t { + fspr_pool_t *pool; void *memblock; void *ptr; - apr_size_t reqsize; - apr_size_t avail; + fspr_size_t reqsize; + fspr_size_t avail; area_id aid; }; -APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, - apr_size_t reqsize, +APR_DECLARE(fspr_status_t) fspr_shm_create(fspr_shm_t **m, + fspr_size_t reqsize, const char *filename, - apr_pool_t *p) + fspr_pool_t *p) { - apr_size_t pagesize; + fspr_size_t pagesize; area_id newid; char *addr; char shname[B_OS_NAME_LENGTH]; - (*m) = (apr_shm_t *)apr_pcalloc(p, sizeof(apr_shm_t)); + (*m) = (fspr_shm_t *)fspr_pcalloc(p, sizeof(fspr_shm_t)); /* we MUST allocate in pages, so calculate how big an area we need... */ pagesize = ((reqsize + B_PAGE_SIZE - 1) / B_PAGE_SIZE) * B_PAGE_SIZE; if (!filename) { int num = 0; - snprintf(shname, B_OS_NAME_LENGTH, "apr_shmem_%ld", find_thread(NULL)); + snprintf(shname, B_OS_NAME_LENGTH, "fspr_shmem_%ld", find_thread(NULL)); while (find_area(shname) >= 0) - snprintf(shname, B_OS_NAME_LENGTH, "apr_shmem_%ld_%d", + snprintf(shname, B_OS_NAME_LENGTH, "fspr_shmem_%ld_%d", find_thread(NULL), num++); } newid = create_area(filename ? filename : shname, @@ -71,7 +71,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m) +APR_DECLARE(fspr_status_t) fspr_shm_destroy(fspr_shm_t *m) { delete_area(m->aid); m->avail = 0; @@ -79,8 +79,8 @@ APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_shm_remove(const char *filename, + fspr_pool_t *pool) { area_id deleteme = find_area(filename); @@ -91,19 +91,19 @@ APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, +APR_DECLARE(fspr_status_t) fspr_shm_attach(fspr_shm_t **m, const char *filename, - apr_pool_t *pool) + fspr_pool_t *pool) { area_info ai; thread_info ti; - apr_shm_t *new_m; + fspr_shm_t *new_m; area_id deleteme = find_area(filename); if (deleteme == B_NAME_NOT_FOUND) return APR_EINVAL; - new_m = (apr_shm_t*)apr_palloc(pool, sizeof(apr_shm_t*)); + new_m = (fspr_shm_t*)fspr_palloc(pool, sizeof(fspr_shm_t*)); if (new_m == NULL) return APR_ENOMEM; new_m->pool = pool; @@ -133,33 +133,33 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m) +APR_DECLARE(fspr_status_t) fspr_shm_detach(fspr_shm_t *m) { delete_area(m->aid); return APR_SUCCESS; } -APR_DECLARE(void *) apr_shm_baseaddr_get(const apr_shm_t *m) +APR_DECLARE(void *) fspr_shm_baseaddr_get(const fspr_shm_t *m) { return m->memblock; } -APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m) +APR_DECLARE(fspr_size_t) fspr_shm_size_get(const fspr_shm_t *m) { return m->reqsize; } APR_POOL_IMPLEMENT_ACCESSOR(shm) -APR_DECLARE(apr_status_t) apr_os_shm_get(apr_os_shm_t *osshm, - apr_shm_t *shm) +APR_DECLARE(fspr_status_t) fspr_os_shm_get(fspr_os_shm_t *osshm, + fspr_shm_t *shm) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_os_shm_put(apr_shm_t **m, - apr_os_shm_t *osshm, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_shm_put(fspr_shm_t **m, + fspr_os_shm_t *osshm, + fspr_pool_t *pool) { return APR_ENOTIMPL; } diff --git a/libs/apr/shmem/os2/shm.c b/libs/apr/shmem/os2/shm.c index 340cae4074..c08f517818 100644 --- a/libs/apr/shmem/os2/shm.c +++ b/libs/apr/shmem/os2/shm.c @@ -14,32 +14,32 @@ * limitations under the License. */ -#include "apr_general.h" -#include "apr_shm.h" -#include "apr_errno.h" -#include "apr_lib.h" -#include "apr_strings.h" -#include "apr_portable.h" +#include "fspr_general.h" +#include "fspr_shm.h" +#include "fspr_errno.h" +#include "fspr_lib.h" +#include "fspr_strings.h" +#include "fspr_portable.h" -struct apr_shm_t { - apr_pool_t *pool; +struct fspr_shm_t { + fspr_pool_t *pool; void *memblock; }; -APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, - apr_size_t reqsize, +APR_DECLARE(fspr_status_t) fspr_shm_create(fspr_shm_t **m, + fspr_size_t reqsize, const char *filename, - apr_pool_t *pool) + fspr_pool_t *pool) { int rc; - apr_shm_t *newm = (apr_shm_t *)apr_palloc(pool, sizeof(apr_shm_t)); + fspr_shm_t *newm = (fspr_shm_t *)fspr_palloc(pool, sizeof(fspr_shm_t)); char *name = NULL; ULONG flags = PAG_COMMIT|PAG_READ|PAG_WRITE; newm->pool = pool; if (filename) { - name = apr_pstrcat(pool, "\\SHAREMEM\\", filename, NULL); + name = fspr_pstrcat(pool, "\\SHAREMEM\\", filename, NULL); } if (name == NULL) { @@ -56,29 +56,29 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m) +APR_DECLARE(fspr_status_t) fspr_shm_destroy(fspr_shm_t *m) { DosFreeMem(m->memblock); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_shm_remove(const char *filename, + fspr_pool_t *pool) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, +APR_DECLARE(fspr_status_t) fspr_shm_attach(fspr_shm_t **m, const char *filename, - apr_pool_t *pool) + fspr_pool_t *pool) { int rc; - apr_shm_t *newm = (apr_shm_t *)apr_palloc(pool, sizeof(apr_shm_t)); + fspr_shm_t *newm = (fspr_shm_t *)fspr_palloc(pool, sizeof(fspr_shm_t)); char *name = NULL; ULONG flags = PAG_READ|PAG_WRITE; newm->pool = pool; - name = apr_pstrcat(pool, "\\SHAREMEM\\", filename, NULL); + name = fspr_pstrcat(pool, "\\SHAREMEM\\", filename, NULL); rc = DosGetNamedSharedMem(&(newm->memblock), name, flags); @@ -90,7 +90,7 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m) +APR_DECLARE(fspr_status_t) fspr_shm_detach(fspr_shm_t *m) { int rc = 0; @@ -101,12 +101,12 @@ APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m) return APR_FROM_OS_ERROR(rc); } -APR_DECLARE(void *) apr_shm_baseaddr_get(const apr_shm_t *m) +APR_DECLARE(void *) fspr_shm_baseaddr_get(const fspr_shm_t *m) { return m->memblock; } -APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m) +APR_DECLARE(fspr_size_t) fspr_shm_size_get(const fspr_shm_t *m) { ULONG flags, size = 0x1000000; DosQueryMem(m->memblock, &size, &flags); @@ -115,19 +115,19 @@ APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m) APR_POOL_IMPLEMENT_ACCESSOR(shm) -APR_DECLARE(apr_status_t) apr_os_shm_get(apr_os_shm_t *osshm, - apr_shm_t *shm) +APR_DECLARE(fspr_status_t) fspr_os_shm_get(fspr_os_shm_t *osshm, + fspr_shm_t *shm) { *osshm = shm->memblock; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_shm_put(apr_shm_t **m, - apr_os_shm_t *osshm, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_shm_put(fspr_shm_t **m, + fspr_os_shm_t *osshm, + fspr_pool_t *pool) { int rc; - apr_shm_t *newm = (apr_shm_t *)apr_palloc(pool, sizeof(apr_shm_t)); + fspr_shm_t *newm = (fspr_shm_t *)fspr_palloc(pool, sizeof(fspr_shm_t)); ULONG flags = PAG_COMMIT|PAG_READ|PAG_WRITE; newm->pool = pool; diff --git a/libs/apr/shmem/unix/shm.c b/libs/apr/shmem/unix/shm.c index 95d1c053f0..36b16d91cc 100644 --- a/libs/apr/shmem/unix/shm.c +++ b/libs/apr/shmem/unix/shm.c @@ -14,16 +14,16 @@ * limitations under the License. */ -#include "apr_arch_shm.h" +#include "fspr_arch_shm.h" -#include "apr_general.h" -#include "apr_errno.h" -#include "apr_user.h" -#include "apr_strings.h" +#include "fspr_general.h" +#include "fspr_errno.h" +#include "fspr_user.h" +#include "fspr_strings.h" -static apr_status_t shm_cleanup_owner(void *m_) +static fspr_status_t shm_cleanup_owner(void *m_) { - apr_shm_t *m = (apr_shm_t *)m_; + fspr_shm_t *m = (fspr_shm_t *)m_; /* anonymous shared memory */ if (m->filename == NULL) { @@ -49,7 +49,7 @@ static apr_status_t shm_cleanup_owner(void *m_) if (munmap(m->base, m->realsize) == -1) { return errno; } - return apr_file_remove(m->filename, m->pool); + return fspr_file_remove(m->filename, m->pool); #endif #if APR_USE_SHMEM_MMAP_SHM if (munmap(m->base, m->realsize) == -1) { @@ -70,55 +70,55 @@ static apr_status_t shm_cleanup_owner(void *m_) if (shmdt(m->base) == -1) { return errno; } - return apr_file_remove(m->filename, m->pool); + return fspr_file_remove(m->filename, m->pool); #endif } return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, - apr_size_t reqsize, +APR_DECLARE(fspr_status_t) fspr_shm_create(fspr_shm_t **m, + fspr_size_t reqsize, const char *filename, - apr_pool_t *pool) + fspr_pool_t *pool) { - apr_shm_t *new_m; - apr_status_t status; + fspr_shm_t *new_m; + fspr_status_t status; #if APR_USE_SHMEM_SHMGET || APR_USE_SHMEM_SHMGET_ANON struct shmid_ds shmbuf; - apr_uid_t uid; - apr_gid_t gid; + fspr_uid_t uid; + fspr_gid_t gid; #endif #if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM || \ APR_USE_SHMEM_MMAP_ZERO int tmpfd; #endif #if APR_USE_SHMEM_SHMGET - apr_size_t nbytes; + fspr_size_t nbytes; key_t shmkey; #endif #if APR_USE_SHMEM_MMAP_ZERO || APR_USE_SHMEM_SHMGET || \ APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM - apr_file_t *file; /* file where metadata is stored */ + fspr_file_t *file; /* file where metadata is stored */ #endif /* Check if they want anonymous or name-based shared memory */ if (filename == NULL) { #if APR_USE_SHMEM_MMAP_ZERO || APR_USE_SHMEM_MMAP_ANON - new_m = apr_palloc(pool, sizeof(apr_shm_t)); + new_m = fspr_palloc(pool, sizeof(fspr_shm_t)); new_m->pool = pool; new_m->reqsize = reqsize; new_m->realsize = reqsize + - APR_ALIGN_DEFAULT(sizeof(apr_size_t)); /* room for metadata */ + APR_ALIGN_DEFAULT(sizeof(fspr_size_t)); /* room for metadata */ new_m->filename = NULL; #if APR_USE_SHMEM_MMAP_ZERO - status = apr_file_open(&file, "/dev/zero", APR_READ | APR_WRITE, + status = fspr_file_open(&file, "/dev/zero", APR_READ | APR_WRITE, APR_OS_DEFAULT, pool); if (status != APR_SUCCESS) { return status; } - status = apr_os_file_get(&tmpfd, file); + status = fspr_os_file_get(&tmpfd, file); if (status != APR_SUCCESS) { return status; } @@ -129,18 +129,18 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, return errno; } - status = apr_file_close(file); + status = fspr_file_close(file); if (status != APR_SUCCESS) { return status; } /* store the real size in the metadata */ - *(apr_size_t*)(new_m->base) = new_m->realsize; + *(fspr_size_t*)(new_m->base) = new_m->realsize; /* metadata isn't usable */ - new_m->usable = (char *)new_m->base + APR_ALIGN_DEFAULT(sizeof(apr_size_t)); + new_m->usable = (char *)new_m->base + APR_ALIGN_DEFAULT(sizeof(fspr_size_t)); - apr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_owner, - apr_pool_cleanup_null); + fspr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_owner, + fspr_pool_cleanup_null); *m = new_m; return APR_SUCCESS; @@ -152,12 +152,12 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, } /* store the real size in the metadata */ - *(apr_size_t*)(new_m->base) = new_m->realsize; + *(fspr_size_t*)(new_m->base) = new_m->realsize; /* metadata isn't usable */ - new_m->usable = (char *)new_m->base + APR_ALIGN_DEFAULT(sizeof(apr_size_t)); + new_m->usable = (char *)new_m->base + APR_ALIGN_DEFAULT(sizeof(fspr_size_t)); - apr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_owner, - apr_pool_cleanup_null); + fspr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_owner, + fspr_pool_cleanup_null); *m = new_m; return APR_SUCCESS; @@ -165,7 +165,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, #endif /* APR_USE_SHMEM_MMAP_ZERO || APR_USE_SHMEM_MMAP_ANON */ #if APR_USE_SHMEM_SHMGET_ANON - new_m = apr_palloc(pool, sizeof(apr_shm_t)); + new_m = fspr_palloc(pool, sizeof(fspr_shm_t)); new_m->pool = pool; new_m->reqsize = reqsize; new_m->realsize = reqsize; @@ -184,7 +184,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, if (shmctl(new_m->shmid, IPC_STAT, &shmbuf) == -1) { return errno; } - apr_uid_current(&uid, &gid, pool); + fspr_uid_current(&uid, &gid, pool); shmbuf.shm_perm.uid = uid; shmbuf.shm_perm.gid = gid; if (shmctl(new_m->shmid, IPC_SET, &shmbuf) == -1) { @@ -199,8 +199,8 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, return errno; } - apr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_owner, - apr_pool_cleanup_null); + fspr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_owner, + fspr_pool_cleanup_null); *m = new_m; return APR_SUCCESS; #endif /* APR_USE_SHMEM_SHMGET_ANON */ @@ -210,38 +210,38 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, /* Name-based shared memory */ else { - new_m = apr_palloc(pool, sizeof(apr_shm_t)); + new_m = fspr_palloc(pool, sizeof(fspr_shm_t)); new_m->pool = pool; new_m->reqsize = reqsize; - new_m->filename = apr_pstrdup(pool, filename); + new_m->filename = fspr_pstrdup(pool, filename); #if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM new_m->realsize = reqsize + - APR_ALIGN_DEFAULT(sizeof(apr_size_t)); /* room for metadata */ + APR_ALIGN_DEFAULT(sizeof(fspr_size_t)); /* room for metadata */ /* FIXME: Ignore error for now. * - * status = apr_file_remove(file, pool);*/ + * status = fspr_file_remove(file, pool);*/ status = APR_SUCCESS; #if APR_USE_SHMEM_MMAP_TMP /* FIXME: Is APR_OS_DEFAULT sufficient? */ - status = apr_file_open(&file, filename, + status = fspr_file_open(&file, filename, APR_READ | APR_WRITE | APR_CREATE | APR_EXCL, APR_OS_DEFAULT, pool); if (status != APR_SUCCESS) { return status; } - status = apr_os_file_get(&tmpfd, file); + status = fspr_os_file_get(&tmpfd, file); if (status != APR_SUCCESS) { - apr_file_close(file); /* ignore errors, we're failing */ - apr_file_remove(new_m->filename, new_m->pool); + fspr_file_close(file); /* ignore errors, we're failing */ + fspr_file_remove(new_m->filename, new_m->pool); return status; } - status = apr_file_trunc(file, new_m->realsize); + status = fspr_file_trunc(file, new_m->realsize); if (status != APR_SUCCESS) { - apr_file_close(file); /* ignore errors, we're failing */ - apr_file_remove(new_m->filename, new_m->pool); + fspr_file_close(file); /* ignore errors, we're failing */ + fspr_file_remove(new_m->filename, new_m->pool); return status; } @@ -249,7 +249,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, MAP_SHARED, tmpfd, 0); /* FIXME: check for errors */ - status = apr_file_close(file); + status = fspr_file_close(file); if (status != APR_SUCCESS) { return status; } @@ -260,14 +260,14 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, return errno; } - status = apr_os_file_put(&file, &tmpfd, + status = fspr_os_file_put(&file, &tmpfd, APR_READ | APR_WRITE | APR_CREATE | APR_EXCL, pool); if (status != APR_SUCCESS) { return status; } - status = apr_file_trunc(file, new_m->realsize); + status = fspr_file_trunc(file, new_m->realsize); if (status != APR_SUCCESS) { shm_unlink(filename); /* we're failing, remove the object */ return status; @@ -277,19 +277,19 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, /* FIXME: check for errors */ - status = apr_file_close(file); + status = fspr_file_close(file); if (status != APR_SUCCESS) { return status; } #endif /* APR_USE_SHMEM_MMAP_SHM */ /* store the real size in the metadata */ - *(apr_size_t*)(new_m->base) = new_m->realsize; + *(fspr_size_t*)(new_m->base) = new_m->realsize; /* metadata isn't usable */ - new_m->usable = (char *)new_m->base + APR_ALIGN_DEFAULT(sizeof(apr_size_t)); + new_m->usable = (char *)new_m->base + APR_ALIGN_DEFAULT(sizeof(fspr_size_t)); - apr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_owner, - apr_pool_cleanup_null); + fspr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_owner, + fspr_pool_cleanup_null); *m = new_m; return APR_SUCCESS; @@ -299,7 +299,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, new_m->realsize = reqsize; /* FIXME: APR_OS_DEFAULT is too permissive, switch to 600 I think. */ - status = apr_file_open(&file, filename, + status = fspr_file_open(&file, filename, APR_WRITE | APR_CREATE | APR_EXCL, APR_OS_DEFAULT, pool); if (status != APR_SUCCESS) { @@ -326,7 +326,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, if (shmctl(new_m->shmid, IPC_STAT, &shmbuf) == -1) { return errno; } - apr_uid_current(&uid, &gid, pool); + fspr_uid_current(&uid, &gid, pool); shmbuf.shm_perm.uid = uid; shmbuf.shm_perm.gid = gid; if (shmctl(new_m->shmid, IPC_SET, &shmbuf) == -1) { @@ -334,18 +334,18 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, } nbytes = sizeof(reqsize); - status = apr_file_write(file, (const void *)&reqsize, + status = fspr_file_write(file, (const void *)&reqsize, &nbytes); if (status != APR_SUCCESS) { return status; } - status = apr_file_close(file); + status = fspr_file_close(file); if (status != APR_SUCCESS) { return status; } - apr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_owner, - apr_pool_cleanup_null); + fspr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_owner, + fspr_pool_cleanup_null); *m = new_m; return APR_SUCCESS; @@ -355,18 +355,18 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_shm_remove(const char *filename, + fspr_pool_t *pool) { #if APR_USE_SHMEM_SHMGET - apr_status_t status; - apr_file_t *file; + fspr_status_t status; + fspr_file_t *file; key_t shmkey; int shmid; #endif #if APR_USE_SHMEM_MMAP_TMP - return apr_file_remove(filename, pool); + return fspr_file_remove(filename, pool); #endif #if APR_USE_SHMEM_MMAP_SHM if (shm_unlink(filename) == -1) { @@ -376,7 +376,7 @@ APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, #endif #if APR_USE_SHMEM_SHMGET /* Presume that the file already exists; just open for writing */ - status = apr_file_open(&file, filename, APR_WRITE, + status = fspr_file_open(&file, filename, APR_WRITE, APR_OS_DEFAULT, pool); if (status) { return status; @@ -389,7 +389,7 @@ APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, goto shm_remove_failed; } - apr_file_close(file); + fspr_file_close(file); if ((shmid = shmget(shmkey, 0, SHM_R | SHM_W)) < 0) { goto shm_remove_failed; @@ -401,12 +401,12 @@ APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, if (shmctl(shmid, IPC_RMID, NULL) == -1) { goto shm_remove_failed; } - return apr_file_remove(filename, pool); + return fspr_file_remove(filename, pool); shm_remove_failed: status = errno; /* ensure the file has been removed anyway. */ - apr_file_remove(filename, pool); + fspr_file_remove(filename, pool); return status; #endif @@ -414,14 +414,14 @@ shm_remove_failed: return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m) +APR_DECLARE(fspr_status_t) fspr_shm_destroy(fspr_shm_t *m) { - return apr_pool_cleanup_run(m->pool, m, shm_cleanup_owner); + return fspr_pool_cleanup_run(m->pool, m, shm_cleanup_owner); } -static apr_status_t shm_cleanup_attach(void *m_) +static fspr_status_t shm_cleanup_attach(void *m_) { - apr_shm_t *m = (apr_shm_t *)m_; + fspr_shm_t *m = (fspr_shm_t *)m_; if (m->filename == NULL) { /* It doesn't make sense to detach from an anonymous memory segment. */ @@ -445,9 +445,9 @@ static apr_status_t shm_cleanup_attach(void *m_) return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, +APR_DECLARE(fspr_status_t) fspr_shm_attach(fspr_shm_t **m, const char *filename, - apr_pool_t *pool) + fspr_pool_t *pool) { if (filename == NULL) { /* It doesn't make sense to attach to a segment if you don't know @@ -456,88 +456,88 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, } else { #if APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM - apr_shm_t *new_m; - apr_status_t status; + fspr_shm_t *new_m; + fspr_status_t status; int tmpfd; - apr_file_t *file; /* file where metadata is stored */ - apr_size_t nbytes; + fspr_file_t *file; /* file where metadata is stored */ + fspr_size_t nbytes; - new_m = apr_palloc(pool, sizeof(apr_shm_t)); + new_m = fspr_palloc(pool, sizeof(fspr_shm_t)); new_m->pool = pool; - new_m->filename = apr_pstrdup(pool, filename); + new_m->filename = fspr_pstrdup(pool, filename); - status = apr_file_open(&file, filename, + status = fspr_file_open(&file, filename, APR_READ | APR_WRITE, APR_OS_DEFAULT, pool); if (status != APR_SUCCESS) { return status; } - status = apr_os_file_get(&tmpfd, file); + status = fspr_os_file_get(&tmpfd, file); if (status != APR_SUCCESS) { return status; } nbytes = sizeof(new_m->realsize); - status = apr_file_read(file, (void *)&(new_m->realsize), + status = fspr_file_read(file, (void *)&(new_m->realsize), &nbytes); if (status != APR_SUCCESS) { return status; } - status = apr_os_file_get(&tmpfd, file); + status = fspr_os_file_get(&tmpfd, file); if (status != APR_SUCCESS) { - apr_file_close(file); /* ignore errors, we're failing */ - apr_file_remove(new_m->filename, new_m->pool); + fspr_file_close(file); /* ignore errors, we're failing */ + fspr_file_remove(new_m->filename, new_m->pool); return status; } - new_m->reqsize = new_m->realsize - sizeof(apr_size_t); + new_m->reqsize = new_m->realsize - sizeof(fspr_size_t); new_m->base = mmap(NULL, new_m->realsize, PROT_READ | PROT_WRITE, MAP_SHARED, tmpfd, 0); /* FIXME: check for errors */ - status = apr_file_close(file); + status = fspr_file_close(file); if (status != APR_SUCCESS) { return status; } /* metadata isn't part of the usable segment */ - new_m->usable = (char *)new_m->base + APR_ALIGN_DEFAULT(sizeof(apr_size_t)); + new_m->usable = (char *)new_m->base + APR_ALIGN_DEFAULT(sizeof(fspr_size_t)); - apr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_attach, - apr_pool_cleanup_null); + fspr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_attach, + fspr_pool_cleanup_null); *m = new_m; return APR_SUCCESS; #endif /* APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM */ #if APR_USE_SHMEM_SHMGET - apr_shm_t *new_m; - apr_status_t status; - apr_file_t *file; /* file where metadata is stored */ - apr_size_t nbytes; + fspr_shm_t *new_m; + fspr_status_t status; + fspr_file_t *file; /* file where metadata is stored */ + fspr_size_t nbytes; key_t shmkey; - new_m = apr_palloc(pool, sizeof(apr_shm_t)); + new_m = fspr_palloc(pool, sizeof(fspr_shm_t)); - status = apr_file_open(&file, filename, + status = fspr_file_open(&file, filename, APR_READ, APR_OS_DEFAULT, pool); if (status != APR_SUCCESS) { return status; } nbytes = sizeof(new_m->reqsize); - status = apr_file_read(file, (void *)&(new_m->reqsize), + status = fspr_file_read(file, (void *)&(new_m->reqsize), &nbytes); if (status != APR_SUCCESS) { return status; } - status = apr_file_close(file); + status = fspr_file_close(file); if (status != APR_SUCCESS) { return status; } - new_m->filename = apr_pstrdup(pool, filename); + new_m->filename = fspr_pstrdup(pool, filename); new_m->pool = pool; shmkey = ftok(filename, 1); if (shmkey == (key_t)-1) { @@ -552,8 +552,8 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, new_m->usable = new_m->base; new_m->realsize = new_m->reqsize; - apr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_attach, - apr_pool_cleanup_null); + fspr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_attach, + fspr_pool_cleanup_null); *m = new_m; return APR_SUCCESS; @@ -563,34 +563,34 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m) +APR_DECLARE(fspr_status_t) fspr_shm_detach(fspr_shm_t *m) { - apr_status_t rv = shm_cleanup_attach(m); - apr_pool_cleanup_kill(m->pool, m, shm_cleanup_attach); + fspr_status_t rv = shm_cleanup_attach(m); + fspr_pool_cleanup_kill(m->pool, m, shm_cleanup_attach); return rv; } -APR_DECLARE(void *) apr_shm_baseaddr_get(const apr_shm_t *m) +APR_DECLARE(void *) fspr_shm_baseaddr_get(const fspr_shm_t *m) { return m->usable; } -APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m) +APR_DECLARE(fspr_size_t) fspr_shm_size_get(const fspr_shm_t *m) { return m->reqsize; } APR_POOL_IMPLEMENT_ACCESSOR(shm) -APR_DECLARE(apr_status_t) apr_os_shm_get(apr_os_shm_t *osshm, - apr_shm_t *shm) +APR_DECLARE(fspr_status_t) fspr_os_shm_get(fspr_os_shm_t *osshm, + fspr_shm_t *shm) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_os_shm_put(apr_shm_t **m, - apr_os_shm_t *osshm, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_shm_put(fspr_shm_t **m, + fspr_os_shm_t *osshm, + fspr_pool_t *pool) { return APR_ENOTIMPL; } diff --git a/libs/apr/shmem/win32/shm.c b/libs/apr/shmem/win32/shm.c index 36af743964..15578f553e 100644 --- a/libs/apr/shmem/win32/shm.c +++ b/libs/apr/shmem/win32/shm.c @@ -14,54 +14,54 @@ * limitations under the License. */ -#include "apr_general.h" -#include "apr_errno.h" -#include "apr_file_io.h" -#include "apr_shm.h" -#include "apr_arch_file_io.h" +#include "fspr_general.h" +#include "fspr_errno.h" +#include "fspr_file_io.h" +#include "fspr_shm.h" +#include "fspr_arch_file_io.h" #include "limits.h" typedef struct memblock_t { - apr_size_t size; - apr_size_t length; + fspr_size_t size; + fspr_size_t length; } memblock_t; -struct apr_shm_t { - apr_pool_t *pool; +struct fspr_shm_t { + fspr_pool_t *pool; memblock_t *memblk; void *usrmem; - apr_size_t size; - apr_size_t length; + fspr_size_t size; + fspr_size_t length; HANDLE hMap; }; -static apr_status_t shm_cleanup(void* shm) +static fspr_status_t shm_cleanup(void* shm) { - apr_status_t rv = APR_SUCCESS; - apr_shm_t *m = shm; + fspr_status_t rv = APR_SUCCESS; + fspr_shm_t *m = shm; if (UnmapViewOfFile(m->memblk)) { - rv = apr_get_os_error(); + rv = fspr_get_os_error(); } if (CloseHandle(m->hMap)) { - return (rv != APR_SUCCESS) ? rv : apr_get_os_error(); + return (rv != APR_SUCCESS) ? rv : fspr_get_os_error(); } /* ### Do we want to make a point of unlinking m->file here? - * Need to add the fname to the apr_shm_t, in that case. + * Need to add the fname to the fspr_shm_t, in that case. */ return rv; } -APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, - apr_size_t reqsize, +APR_DECLARE(fspr_status_t) fspr_shm_create(fspr_shm_t **m, + fspr_size_t reqsize, const char *file, - apr_pool_t *pool) + fspr_pool_t *pool) { - static apr_size_t memblock = 0; + static fspr_size_t memblock = 0; HANDLE hMap, hFile; - apr_status_t rv; - apr_size_t size; - apr_file_t *f; + fspr_status_t rv; + fspr_size_t size; + fspr_file_t *f; void *base; void *mapkey; DWORD err, sizelo, sizehi; @@ -97,14 +97,14 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, * ever did. Ignore that error here, but fail later when * we discover we aren't the creator of the file map object. */ - rv = apr_file_open(&f, file, + rv = fspr_file_open(&f, file, APR_READ | APR_WRITE | APR_BINARY | APR_CREATE, APR_UREAD | APR_UWRITE, pool); if ((rv != APR_SUCCESS) - || ((rv = apr_os_file_get(&hFile, f)) != APR_SUCCESS)) { + || ((rv = fspr_os_file_get(&hFile, f)) != APR_SUCCESS)) { return rv; } - rv = apr_file_trunc(f, size); + rv = fspr_file_trunc(f, size); /* res_name_from_filename turns file into a pseudo-name * without slashes or backslashes, and prepends the \global @@ -127,10 +127,10 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, sizehi, sizelo, mapkey); } #endif - err = apr_get_os_error(); + err = fspr_get_os_error(); if (file) { - apr_file_close(f); + fspr_file_close(f); } if (hMap && err == ERROR_ALREADY_EXISTS) { @@ -145,10 +145,10 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, 0, 0, size); if (!base) { CloseHandle(hMap); - return apr_get_os_error(); + return fspr_get_os_error(); } - *m = (apr_shm_t *) apr_palloc(pool, sizeof(apr_shm_t)); + *m = (fspr_shm_t *) fspr_palloc(pool, sizeof(fspr_shm_t)); (*m)->pool = pool; (*m)->hMap = hMap; (*m)->memblk = base; @@ -160,27 +160,27 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, (*m)->memblk->length = (*m)->length; (*m)->memblk->size = (*m)->size; - apr_pool_cleanup_register((*m)->pool, *m, - shm_cleanup, apr_pool_cleanup_null); + fspr_pool_cleanup_register((*m)->pool, *m, + shm_cleanup, fspr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m) +APR_DECLARE(fspr_status_t) fspr_shm_destroy(fspr_shm_t *m) { - apr_status_t rv = shm_cleanup(m); - apr_pool_cleanup_kill(m->pool, m, shm_cleanup); + fspr_status_t rv = shm_cleanup(m); + fspr_pool_cleanup_kill(m->pool, m, shm_cleanup); return rv; } -APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_shm_remove(const char *filename, + fspr_pool_t *pool) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, +APR_DECLARE(fspr_status_t) fspr_shm_attach(fspr_shm_t **m, const char *file, - apr_pool_t *pool) + fspr_pool_t *pool) { HANDLE hMap; void *mapkey; @@ -207,7 +207,7 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, * opening the existing shmem and reading its size from the header */ hMap = CreateFileMappingW(INVALID_HANDLE_VALUE, NULL, - PAGE_READWRITE, 0, sizeof(apr_shm_t), mapkey); + PAGE_READWRITE, 0, sizeof(fspr_shm_t), mapkey); #endif } #endif @@ -219,16 +219,16 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, #endif if (!hMap) { - return apr_get_os_error(); + return fspr_get_os_error(); } base = MapViewOfFile(hMap, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, 0); if (!base) { CloseHandle(hMap); - return apr_get_os_error(); + return fspr_get_os_error(); } - *m = (apr_shm_t *) apr_palloc(pool, sizeof(apr_shm_t)); + *m = (fspr_shm_t *) fspr_palloc(pool, sizeof(fspr_shm_t)); (*m)->pool = pool; (*m)->memblk = base; /* Real (*m)->mem->size could be recovered with VirtualQuery */ @@ -241,59 +241,59 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, hMap = CreateFileMappingW(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, (*m)->size, mapkey); if (!hMap) { - return apr_get_os_error(); + return fspr_get_os_error(); } base = MapViewOfFile(hMap, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, 0); if (!base) { CloseHandle(hMap); - return apr_get_os_error(); + return fspr_get_os_error(); } #endif (*m)->hMap = hMap; (*m)->length = (*m)->memblk->length; (*m)->usrmem = (char*)base + sizeof(memblock_t); - apr_pool_cleanup_register((*m)->pool, *m, - shm_cleanup, apr_pool_cleanup_null); + fspr_pool_cleanup_register((*m)->pool, *m, + shm_cleanup, fspr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m) +APR_DECLARE(fspr_status_t) fspr_shm_detach(fspr_shm_t *m) { - apr_status_t rv = shm_cleanup(m); - apr_pool_cleanup_kill(m->pool, m, shm_cleanup); + fspr_status_t rv = shm_cleanup(m); + fspr_pool_cleanup_kill(m->pool, m, shm_cleanup); return rv; } -APR_DECLARE(void *) apr_shm_baseaddr_get(const apr_shm_t *m) +APR_DECLARE(void *) fspr_shm_baseaddr_get(const fspr_shm_t *m) { return m->usrmem; } -APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m) +APR_DECLARE(fspr_size_t) fspr_shm_size_get(const fspr_shm_t *m) { return m->length; } APR_POOL_IMPLEMENT_ACCESSOR(shm) -APR_DECLARE(apr_status_t) apr_os_shm_get(apr_os_shm_t *osshm, - apr_shm_t *shm) +APR_DECLARE(fspr_status_t) fspr_os_shm_get(fspr_os_shm_t *osshm, + fspr_shm_t *shm) { *osshm = shm->hMap; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_shm_put(apr_shm_t **m, - apr_os_shm_t *osshm, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_shm_put(fspr_shm_t **m, + fspr_os_shm_t *osshm, + fspr_pool_t *pool) { void* base; base = MapViewOfFile(*osshm, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, 0); if (!base) { - return apr_get_os_error(); + return fspr_get_os_error(); } - *m = (apr_shm_t *) apr_palloc(pool, sizeof(apr_shm_t)); + *m = (fspr_shm_t *) fspr_palloc(pool, sizeof(fspr_shm_t)); (*m)->pool = pool; (*m)->hMap = *osshm; (*m)->memblk = base; @@ -302,8 +302,8 @@ APR_DECLARE(apr_status_t) apr_os_shm_put(apr_shm_t **m, (*m)->size = (*m)->memblk->size; (*m)->length = (*m)->memblk->length; - apr_pool_cleanup_register((*m)->pool, *m, - shm_cleanup, apr_pool_cleanup_null); + fspr_pool_cleanup_register((*m)->pool, *m, + shm_cleanup, fspr_pool_cleanup_null); return APR_SUCCESS; } diff --git a/libs/apr/strings/apr_cpystrn.c b/libs/apr/strings/fspr_cpystrn.c similarity index 89% rename from libs/apr/strings/apr_cpystrn.c rename to libs/apr/strings/fspr_cpystrn.c index 888b2e5db6..704ebca623 100644 --- a/libs/apr/strings/apr_cpystrn.c +++ b/libs/apr/strings/fspr_cpystrn.c @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_strings.h" -#include "apr_private.h" -#include "apr_lib.h" +#include "fspr.h" +#include "fspr_strings.h" +#include "fspr_private.h" +#include "fspr_lib.h" #if APR_HAVE_SYS_TYPES_H #include @@ -39,10 +39,10 @@ * the destination string, we return a pointer to the * terminating '\0' to allow us to "check" for truncation * - * apr_cpystrn() follows the same call structure as strncpy(). + * fspr_cpystrn() follows the same call structure as strncpy(). */ -APR_DECLARE(char *) apr_cpystrn(char *dst, const char *src, apr_size_t dst_size) +APR_DECLARE(char *) fspr_cpystrn(char *dst, const char *src, fspr_size_t dst_size) { char *d, *end; @@ -70,7 +70,7 @@ APR_DECLARE(char *) apr_cpystrn(char *dst, const char *src, apr_size_t dst_size) * This function provides a way to parse a generic argument string * into a standard argv[] form of argument list. It respects the * usual "whitespace" and quoteing rules. In the future this could - * be expanded to include support for the apr_call_exec command line + * be expanded to include support for the fspr_call_exec command line * string processing (including converting '+' to ' ' and doing the * url processing. It does not currently support this function. * @@ -82,9 +82,9 @@ APR_DECLARE(char *) apr_cpystrn(char *dst, const char *src, apr_size_t dst_size) * pool and filled in with copies of the tokens * found during parsing of the arg_str. */ -APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str, +APR_DECLARE(fspr_status_t) fspr_tokenize_to_argv(const char *arg_str, char ***argv_out, - apr_pool_t *token_context) + fspr_pool_t *token_context) { const char *cp; const char *ct; @@ -165,7 +165,7 @@ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str, numargs++; SKIP_WHITESPACE(ct); } - *argv_out = apr_palloc(token_context, numargs * sizeof(char*)); + *argv_out = fspr_palloc(token_context, numargs * sizeof(char*)); /* determine first argument */ for (argnum = 0; argnum < (numargs-1); argnum++) { @@ -174,8 +174,8 @@ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str, ct = cp; DETERMINE_NEXTSTRING(cp, isquoted); cp++; - (*argv_out)[argnum] = apr_palloc(token_context, cp - ct); - apr_cpystrn((*argv_out)[argnum], ct, cp - ct); + (*argv_out)[argnum] = fspr_palloc(token_context, cp - ct); + fspr_cpystrn((*argv_out)[argnum], ct, cp - ct); cleaned = dirty = (*argv_out)[argnum]; REMOVE_ESCAPE_CHARS(cleaned, dirty, escaped); } @@ -194,7 +194,7 @@ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str, * Corrected Win32 to accept "a/b\\stuff", "a:stuff" */ -APR_DECLARE(const char *) apr_filepath_name_get(const char *pathname) +APR_DECLARE(const char *) fspr_filepath_name_get(const char *pathname) { const char path_separator = '/'; const char *s = strrchr(pathname, path_separator); @@ -216,10 +216,10 @@ APR_DECLARE(const char *) apr_filepath_name_get(const char *pathname) * collapse in place (src == dest) is legal. * returns terminating null ptr to dest string. */ -APR_DECLARE(char *) apr_collapse_spaces(char *dest, const char *src) +APR_DECLARE(char *) fspr_collapse_spaces(char *dest, const char *src) { while (*src) { - if (!apr_isspace(*src)) + if (!fspr_isspace(*src)) *dest++ = *src; ++src; } @@ -247,7 +247,7 @@ int strcasecmp(const char *a, const char *b) const char *p = a; const char *q = b; for (p = a, q = b; *p && *q; p++, q++) { - int diff = apr_tolower(*p) - apr_tolower(*q); + int diff = fspr_tolower(*p) - fspr_tolower(*q); if (diff) return diff; } @@ -272,7 +272,7 @@ int strncasecmp(const char *a, const char *b, size_t n) return 0; /* Match up to n characters */ if (!(*p && *q)) return *p - *q; - diff = apr_tolower(*p) - apr_tolower(*q); + diff = fspr_tolower(*p) - fspr_tolower(*q); if (diff) return diff; } diff --git a/libs/apr/strings/apr_fnmatch.c b/libs/apr/strings/fspr_fnmatch.c similarity index 84% rename from libs/apr/strings/apr_fnmatch.c rename to libs/apr/strings/fspr_fnmatch.c index 7c41ea6585..d65570cf67 100644 --- a/libs/apr/strings/apr_fnmatch.c +++ b/libs/apr/strings/fspr_fnmatch.c @@ -43,13 +43,13 @@ static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94"; * Compares a filename or pathname to a pattern. */ #ifndef WIN32 -#include "apr_private.h" +#include "fspr_private.h" #endif -#include "apr_file_info.h" -#include "apr_fnmatch.h" -#include "apr_tables.h" -#include "apr_lib.h" -#include "apr_strings.h" +#include "fspr_file_info.h" +#include "fspr_fnmatch.h" +#include "fspr_tables.h" +#include "fspr_lib.h" +#include "fspr_strings.h" #include #if APR_HAVE_CTYPE_H # include @@ -59,7 +59,7 @@ static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94"; static const char *rangematch(const char *, int, int); -APR_DECLARE(apr_status_t) apr_fnmatch(const char *pattern, const char *string, int flags) +APR_DECLARE(fspr_status_t) fspr_fnmatch(const char *pattern, const char *string, int flags) { const char *stringstart; char c, test; @@ -113,7 +113,7 @@ APR_DECLARE(apr_status_t) apr_fnmatch(const char *pattern, const char *string, i /* General case, use recursion. */ while ((test = *string) != EOS) { - if (!apr_fnmatch(pattern, string, flags & ~APR_FNM_PERIOD)) { + if (!fspr_fnmatch(pattern, string, flags & ~APR_FNM_PERIOD)) { return (APR_SUCCESS); } if (test == '/' && flags & APR_FNM_PATHNAME) { @@ -149,7 +149,7 @@ APR_DECLARE(apr_status_t) apr_fnmatch(const char *pattern, const char *string, i /* FALLTHROUGH */ default: if (flags & APR_FNM_CASE_BLIND) { - if (apr_tolower(c) != apr_tolower(*string)) { + if (fspr_tolower(c) != fspr_tolower(*string)) { return (APR_FNM_NOMATCH); } } @@ -196,14 +196,14 @@ static const char *rangematch(const char *pattern, int test, int flags) } if ((c <= test && test <= c2) || ((flags & APR_FNM_CASE_BLIND) - && ((apr_tolower(c) <= apr_tolower(test)) - && (apr_tolower(test) <= apr_tolower(c2))))) { + && ((fspr_tolower(c) <= fspr_tolower(test)) + && (fspr_tolower(test) <= fspr_tolower(c2))))) { ok = 1; } } else if ((c == test) || ((flags & APR_FNM_CASE_BLIND) - && (apr_tolower(c) == apr_tolower(test)))) { + && (fspr_tolower(c) == fspr_tolower(test)))) { ok = 1; } } @@ -213,7 +213,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_DECLARE(int) apr_fnmatch_test(const char *pattern) +APR_DECLARE(int) fspr_fnmatch_test(const char *pattern) { int nesting; @@ -246,13 +246,13 @@ APR_DECLARE(int) apr_fnmatch_test(const char *pattern) } /* Find all files matching the specified pattern */ -APR_DECLARE(apr_status_t) apr_match_glob(const char *pattern, - apr_array_header_t **result, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_match_glob(const char *pattern, + fspr_array_header_t **result, + fspr_pool_t *p) { - apr_dir_t *dir; - apr_finfo_t finfo; - apr_status_t rv; + fspr_dir_t *dir; + fspr_finfo_t finfo; + fspr_status_t rv; char *path; /* XXX So, this is kind of bogus. Basically, I need to strip any leading @@ -261,7 +261,7 @@ APR_DECLARE(apr_status_t) apr_match_glob(const char *pattern, * return anything, then we look for '\'. This means that we could * screw up on unix if the pattern is something like "foo\.*" That '\' * isn't a directory delimiter, it is a part of the filename. To fix this, - * we really need apr_filepath_basename, which will be coming as soon as + * we really need fspr_filepath_basename, which will be coming as soon as * I get to it. rbb */ char *idx = strrchr(pattern, '/'); @@ -273,21 +273,21 @@ APR_DECLARE(apr_status_t) apr_match_glob(const char *pattern, path = "."; } else { - path = apr_pstrndup(p, pattern, idx - pattern); + path = fspr_pstrndup(p, pattern, idx - pattern); pattern = idx + 1; } - *result = apr_array_make(p, 0, sizeof(char *)); - rv = apr_dir_open(&dir, path, p); + *result = fspr_array_make(p, 0, sizeof(char *)); + rv = fspr_dir_open(&dir, path, p); if (rv != APR_SUCCESS) { return rv; } - while (apr_dir_read(&finfo, APR_FINFO_NAME, dir) == APR_SUCCESS) { - if (apr_fnmatch(pattern, finfo.name, 0) == APR_SUCCESS) { - *(const char **)apr_array_push(*result) = apr_pstrdup(p, finfo.name); + while (fspr_dir_read(&finfo, APR_FINFO_NAME, dir) == APR_SUCCESS) { + if (fspr_fnmatch(pattern, finfo.name, 0) == APR_SUCCESS) { + *(const char **)fspr_array_push(*result) = fspr_pstrdup(p, finfo.name); } } - apr_dir_close(dir); + fspr_dir_close(dir); return APR_SUCCESS; } diff --git a/libs/apr/strings/apr_snprintf.c b/libs/apr/strings/fspr_snprintf.c similarity index 90% rename from libs/apr/strings/apr_snprintf.c rename to libs/apr/strings/fspr_snprintf.c index 8c5030d725..cc7d2faf67 100644 --- a/libs/apr/strings/apr_snprintf.c +++ b/libs/apr/strings/fspr_snprintf.c @@ -14,13 +14,13 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_private.h" +#include "fspr.h" +#include "fspr_private.h" -#include "apr_lib.h" -#include "apr_strings.h" -#include "apr_network_io.h" -#include "apr_portable.h" +#include "fspr_lib.h" +#include "fspr_strings.h" +#include "fspr_network_io.h" +#include "fspr_portable.h" #include #if APR_HAVE_CTYPE_H #include @@ -56,12 +56,12 @@ typedef enum { typedef WIDE_INT wide_int; typedef unsigned WIDE_INT u_wide_int; -typedef apr_int64_t widest_int; +typedef fspr_int64_t widest_int; #ifdef __TANDEM /* Although Tandem supports "long long" there is no unsigned variant. */ typedef unsigned long u_widest_int; #else -typedef apr_uint64_t u_widest_int; +typedef fspr_uint64_t u_widest_int; #endif typedef int bool_int; @@ -84,7 +84,7 @@ typedef int bool_int; */ /* - * apr_ecvt converts to decimal + * fspr_ecvt converts to decimal * the number of digits is specified by ndigit * decpt is set to the position of the decimal point * sign is set to 0 for positive, 1 for negative @@ -93,7 +93,7 @@ typedef int bool_int; #define NDIG 80 /* buf must have at least NDIG bytes */ -static char *apr_cvt(double arg, int ndigits, int *decpt, int *sign, +static char *fspr_cvt(double arg, int ndigits, int *decpt, int *sign, int eflag, char *buf) { register int r2; @@ -167,29 +167,29 @@ static char *apr_cvt(double arg, int ndigits, int *decpt, int *sign, return (buf); } -static char *apr_ecvt(double arg, int ndigits, int *decpt, int *sign, char *buf) +static char *fspr_ecvt(double arg, int ndigits, int *decpt, int *sign, char *buf) { - return (apr_cvt(arg, ndigits, decpt, sign, 1, buf)); + return (fspr_cvt(arg, ndigits, decpt, sign, 1, buf)); } -static char *apr_fcvt(double arg, int ndigits, int *decpt, int *sign, char *buf) +static char *fspr_fcvt(double arg, int ndigits, int *decpt, int *sign, char *buf) { - return (apr_cvt(arg, ndigits, decpt, sign, 0, buf)); + return (fspr_cvt(arg, ndigits, decpt, sign, 0, buf)); } /* - * apr_gcvt - Floating output conversion to + * fspr_gcvt - Floating output conversion to * minimal length string */ -static char *apr_gcvt(double number, int ndigit, char *buf, boolean_e altform) +static char *fspr_gcvt(double number, int ndigit, char *buf, boolean_e altform) { int sign, decpt; register char *p1, *p2; register int i; char buf1[NDIG]; - p1 = apr_ecvt(number, ndigit, &decpt, &sign, buf1); + p1 = fspr_ecvt(number, ndigit, &decpt, &sign, buf1); p2 = buf; if (sign) *p2++ = '-'; @@ -270,7 +270,7 @@ static char *apr_gcvt(double number, int ndigit, char *buf, boolean_e altform) #define STR_TO_DEC(str, num) \ num = NUM(*str++); \ - while (apr_isdigit(*str)) \ + while (fspr_isdigit(*str)) \ { \ num *= 10 ; \ num += NUM(*str++); \ @@ -288,7 +288,7 @@ static char *apr_gcvt(double number, int ndigit, char *buf, boolean_e altform) */ #define FIX_PRECISION(adjust, precision, s, s_len) \ if (adjust) { \ - apr_size_t p = (precision + 1 < NUM_BUF_SIZE) \ + fspr_size_t p = (precision + 1 < NUM_BUF_SIZE) \ ? precision : NUM_BUF_SIZE - 1; \ while (s_len < p) \ { \ @@ -338,7 +338,7 @@ while (width > len) */ static char *conv_10(register wide_int num, register bool_int is_unsigned, register bool_int *is_negative, char *buf_end, - register apr_size_t *len) + register fspr_size_t *len) { register char *p = buf_end; register u_wide_int magnitude; @@ -385,7 +385,7 @@ static char *conv_10(register wide_int num, register bool_int is_unsigned, static char *conv_10_quad(widest_int num, register bool_int is_unsigned, register bool_int *is_negative, char *buf_end, - register apr_size_t *len) + register fspr_size_t *len) { register char *p = buf_end; u_widest_int magnitude; @@ -442,12 +442,12 @@ static char *conv_10_quad(widest_int num, register bool_int is_unsigned, -static char *conv_in_addr(struct in_addr *ia, char *buf_end, apr_size_t *len) +static char *conv_in_addr(struct in_addr *ia, char *buf_end, fspr_size_t *len) { unsigned addr = ntohl(ia->s_addr); char *p = buf_end; bool_int is_negative; - apr_size_t sub_len; + fspr_size_t sub_len; p = conv_10((addr & 0x000000FF) , TRUE, &is_negative, p, &sub_len); *--p = '.'; @@ -463,16 +463,16 @@ static char *conv_in_addr(struct in_addr *ia, char *buf_end, apr_size_t *len) -static char *conv_apr_sockaddr(apr_sockaddr_t *sa, char *buf_end, apr_size_t *len) +static char *conv_fspr_sockaddr(fspr_sockaddr_t *sa, char *buf_end, fspr_size_t *len) { char *p = buf_end; bool_int is_negative; - apr_size_t sub_len; + fspr_size_t sub_len; char *ipaddr_str; p = conv_10(sa->port, TRUE, &is_negative, p, &sub_len); *--p = ':'; - apr_sockaddr_ip_get(&ipaddr_str, sa); + fspr_sockaddr_ip_get(&ipaddr_str, sa); sub_len = strlen(ipaddr_str); #if APR_HAVE_IPV6 if (sa->family == APR_INET6 && @@ -496,20 +496,20 @@ static char *conv_apr_sockaddr(apr_sockaddr_t *sa, char *buf_end, apr_size_t *le #if APR_HAS_THREADS -static char *conv_os_thread_t(apr_os_thread_t *tid, char *buf_end, apr_size_t *len) +static char *conv_os_thread_t(fspr_os_thread_t *tid, char *buf_end, fspr_size_t *len) { union { - apr_os_thread_t tid; - apr_uint64_t alignme; + fspr_os_thread_t tid; + fspr_uint64_t alignme; } u; int is_negative; u.tid = *tid; switch(sizeof(u.tid)) { - case sizeof(apr_int32_t): - return conv_10(*(apr_uint32_t *)&u.tid, TRUE, &is_negative, buf_end, len); - case sizeof(apr_int64_t): - return conv_10_quad(*(apr_uint64_t *)&u.tid, TRUE, &is_negative, buf_end, len); + case sizeof(fspr_int32_t): + return conv_10(*(fspr_uint32_t *)&u.tid, TRUE, &is_negative, buf_end, len); + case sizeof(fspr_int64_t): + return conv_10_quad(*(fspr_uint64_t *)&u.tid, TRUE, &is_negative, buf_end, len); default: /* not implemented; stick 0 in the buffer */ return conv_10(0, TRUE, &is_negative, buf_end, len); @@ -527,7 +527,7 @@ static char *conv_os_thread_t(apr_os_thread_t *tid, char *buf_end, apr_size_t *l */ static char *conv_fp(register char format, register double num, boolean_e add_dp, int precision, bool_int *is_negative, - char *buf, apr_size_t *len) + char *buf, fspr_size_t *len) { register char *s = buf; register char *p; @@ -535,14 +535,14 @@ static char *conv_fp(register char format, register double num, char buf1[NDIG]; if (format == 'f') - p = apr_fcvt(num, precision, &decimal_point, is_negative, buf1); + p = fspr_fcvt(num, precision, &decimal_point, is_negative, buf1); else /* either e or E format */ - p = apr_ecvt(num, precision + 1, &decimal_point, is_negative, buf1); + p = fspr_ecvt(num, precision + 1, &decimal_point, is_negative, buf1); /* * Check for Infinity and NaN */ - if (apr_isalpha(*p)) { + if (fspr_isalpha(*p)) { *len = strlen(p); memcpy(buf, p, *len + 1); *is_negative = FALSE; @@ -581,7 +581,7 @@ static char *conv_fp(register char format, register double num, if (format != 'f') { char temp[EXPONENT_LENGTH]; /* for exponent conversion */ - apr_size_t t_len; + fspr_size_t t_len; bool_int exponent_is_negative; *s++ = format; /* either e or E */ @@ -625,7 +625,7 @@ static char *conv_fp(register char format, register double num, * the number isn't quad size. */ static char *conv_p2(register u_wide_int num, register int nbits, - char format, char *buf_end, register apr_size_t *len) + char format, char *buf_end, register fspr_size_t *len) { register int mask = (1 << nbits) - 1; register char *p = buf_end; @@ -644,7 +644,7 @@ static char *conv_p2(register u_wide_int num, register int nbits, } static char *conv_p2_quad(u_widest_int num, register int nbits, - char format, char *buf_end, register apr_size_t *len) + char format, char *buf_end, register fspr_size_t *len) { register int mask = (1 << nbits) - 1; register char *p = buf_end; @@ -666,20 +666,20 @@ static char *conv_p2_quad(u_widest_int num, register int nbits, } #if APR_HAS_THREADS -static char *conv_os_thread_t_hex(apr_os_thread_t *tid, char *buf_end, apr_size_t *len) +static char *conv_os_thread_t_hex(fspr_os_thread_t *tid, char *buf_end, fspr_size_t *len) { union { - apr_os_thread_t tid; - apr_uint64_t alignme; + fspr_os_thread_t tid; + fspr_uint64_t alignme; } u; int is_negative; u.tid = *tid; switch(sizeof(u.tid)) { - case sizeof(apr_int32_t): - return conv_p2(*(apr_uint32_t *)&u.tid, 4, 'x', buf_end, len); - case sizeof(apr_int64_t): - return conv_p2_quad(*(apr_uint64_t *)&u.tid, 4, 'x', buf_end, len); + case sizeof(fspr_int32_t): + return conv_p2(*(fspr_uint32_t *)&u.tid, 4, 'x', buf_end, len); + case sizeof(fspr_int64_t): + return conv_p2_quad(*(fspr_uint64_t *)&u.tid, 4, 'x', buf_end, len); default: /* not implemented; stick 0 in the buffer */ return conv_10(0, TRUE, &is_negative, buf_end, len); @@ -690,20 +690,20 @@ static char *conv_os_thread_t_hex(apr_os_thread_t *tid, char *buf_end, apr_size_ /* * Do format conversion placing the output in buffer */ -APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), - apr_vformatter_buff_t *vbuff, const char *fmt, va_list ap) +APR_DECLARE(int) fspr_vformatter(int (*flush_func)(fspr_vformatter_buff_t *), + fspr_vformatter_buff_t *vbuff, const char *fmt, va_list ap) { register char *sp; register char *bep; register int cc = 0; - register apr_size_t i; + register fspr_size_t i; register char *s = NULL; char *q; - apr_size_t s_len; + fspr_size_t s_len; - register apr_size_t min_width = 0; - apr_size_t precision = 0; + register fspr_size_t min_width = 0; + fspr_size_t precision = 0; enum { LEFT, RIGHT } adjust; @@ -756,7 +756,7 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), /* * Try to avoid checking for flags, width or precision */ - if (!apr_islower(*fmt)) { + if (!fspr_islower(*fmt)) { /* * Recognize flags: -, #, BLANK, + */ @@ -778,7 +778,7 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), /* * Check if a width was specified */ - if (apr_isdigit(*fmt)) { + if (fspr_isdigit(*fmt)) { STR_TO_DEC(fmt, min_width); adjust_width = YES; } @@ -788,10 +788,10 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), adjust_width = YES; if (v < 0) { adjust = LEFT; - min_width = (apr_size_t)(-v); + min_width = (fspr_size_t)(-v); } else - min_width = (apr_size_t)v; + min_width = (fspr_size_t)v; } else adjust_width = NO; @@ -802,13 +802,13 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), if (*fmt == '.') { adjust_precision = YES; fmt++; - if (apr_isdigit(*fmt)) { + if (fspr_isdigit(*fmt)) { STR_TO_DEC(fmt, precision); } else if (*fmt == '*') { int v = va_arg(ap, int); fmt++; - precision = (v < 0) ? 0 : (apr_size_t)v; + precision = (v < 0) ? 0 : (fspr_size_t)v; } else precision = 0; @@ -1058,7 +1058,7 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), /* * * We use &num_buf[ 1 ], so that we have room for the sign */ - s = apr_gcvt(va_arg(ap, double), precision, &num_buf[1], + s = fspr_gcvt(va_arg(ap, double), precision, &num_buf[1], alternate_form); if (*s == '-') prefix_char = *s++; @@ -1140,14 +1140,14 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), pad_char = ' '; break; - /* print an apr_sockaddr_t as a.b.c.d:port */ + /* print an fspr_sockaddr_t as a.b.c.d:port */ case 'I': { - apr_sockaddr_t *sa; + fspr_sockaddr_t *sa; - sa = va_arg(ap, apr_sockaddr_t *); + sa = va_arg(ap, fspr_sockaddr_t *); if (sa != NULL) { - s = conv_apr_sockaddr(sa, &num_buf[NUM_BUF_SIZE], &s_len); + s = conv_fspr_sockaddr(sa, &num_buf[NUM_BUF_SIZE], &s_len); if (adjust_precision && precision < s_len) s_len = precision; } @@ -1181,9 +1181,9 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), case 'T': #if APR_HAS_THREADS { - apr_os_thread_t *tid; + fspr_os_thread_t *tid; - tid = va_arg(ap, apr_os_thread_t *); + tid = va_arg(ap, fspr_os_thread_t *); if (tid != NULL) { s = conv_os_thread_t(tid, &num_buf[NUM_BUF_SIZE], &s_len); if (adjust_precision && precision < s_len) @@ -1206,9 +1206,9 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), case 't': #if APR_HAS_THREADS { - apr_os_thread_t *tid; + fspr_os_thread_t *tid; - tid = va_arg(ap, apr_os_thread_t *); + tid = va_arg(ap, fspr_os_thread_t *); if (tid != NULL) { s = conv_os_thread_t_hex(tid, &num_buf[NUM_BUF_SIZE], &s_len); if (adjust_precision && precision < s_len) @@ -1304,21 +1304,21 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *), } -static int snprintf_flush(apr_vformatter_buff_t *vbuff) +static int snprintf_flush(fspr_vformatter_buff_t *vbuff) { /* if the buffer fills we have to abort immediately, there is no way - * to "flush" an apr_snprintf... there's nowhere to flush it to. + * to "flush" an fspr_snprintf... there's nowhere to flush it to. */ return -1; } -APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, apr_size_t len, +APR_DECLARE_NONSTD(int) fspr_snprintf(char *buf, fspr_size_t len, const char *format, ...) { int cc; va_list ap; - apr_vformatter_buff_t vbuff; + fspr_vformatter_buff_t vbuff; if (len == 0) { /* NOTE: This is a special case; we just want to return the number @@ -1336,7 +1336,7 @@ APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, apr_size_t len, vbuff.endpos = buf + len - 1; } va_start(ap, format); - cc = apr_vformatter(snprintf_flush, &vbuff, format, ap); + cc = fspr_vformatter(snprintf_flush, &vbuff, format, ap); va_end(ap); if (len != 0) { *vbuff.curpos = '\0'; @@ -1345,11 +1345,11 @@ APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, apr_size_t len, } -APR_DECLARE(int) apr_vsnprintf(char *buf, apr_size_t len, const char *format, +APR_DECLARE(int) fspr_vsnprintf(char *buf, fspr_size_t len, const char *format, va_list ap) { int cc; - apr_vformatter_buff_t vbuff; + fspr_vformatter_buff_t vbuff; if (len == 0) { /* See above note */ @@ -1360,7 +1360,7 @@ APR_DECLARE(int) apr_vsnprintf(char *buf, apr_size_t len, const char *format, vbuff.curpos = buf; vbuff.endpos = buf + len - 1; } - cc = apr_vformatter(snprintf_flush, &vbuff, format, ap); + cc = fspr_vformatter(snprintf_flush, &vbuff, format, ap); if (len != 0) { *vbuff.curpos = '\0'; } diff --git a/libs/apr/strings/apr_strings.c b/libs/apr/strings/fspr_strings.c similarity index 82% rename from libs/apr/strings/apr_strings.c rename to libs/apr/strings/fspr_strings.c index 771d351f19..48dd08b953 100644 --- a/libs/apr/strings/apr_strings.c +++ b/libs/apr/strings/fspr_strings.c @@ -46,14 +46,14 @@ * SUCH DAMAGE. */ -#include "apr.h" -#include "apr_strings.h" -#include "apr_general.h" -#include "apr_private.h" -#include "apr_lib.h" +#include "fspr.h" +#include "fspr_strings.h" +#include "fspr_general.h" +#include "fspr_private.h" +#include "fspr_lib.h" #define APR_WANT_STDIO #define APR_WANT_STRFUNC -#include "apr_want.h" +#include "fspr_want.h" #ifdef HAVE_STDDEF_H #include /* NULL */ @@ -63,24 +63,24 @@ #include /* strtol and strtoll */ #endif -/** this is used to cache lengths in apr_pstrcat */ +/** this is used to cache lengths in fspr_pstrcat */ #define MAX_SAVED_LENGTHS 6 -APR_DECLARE(char *) apr_pstrdup(apr_pool_t *a, const char *s) +APR_DECLARE(char *) fspr_pstrdup(fspr_pool_t *a, const char *s) { char *res; - apr_size_t len; + fspr_size_t len; if (s == NULL) { return NULL; } len = strlen(s) + 1; - res = apr_palloc(a, len); + res = fspr_palloc(a, len); memcpy(res, s, len); return res; } -APR_DECLARE(char *) apr_pstrndup(apr_pool_t *a, const char *s, apr_size_t n) +APR_DECLARE(char *) fspr_pstrndup(fspr_pool_t *a, const char *s, fspr_size_t n) { char *res; const char *end; @@ -91,51 +91,51 @@ APR_DECLARE(char *) apr_pstrndup(apr_pool_t *a, const char *s, apr_size_t n) end = memchr(s, '\0', n); if (end != NULL) n = end - s; - res = apr_palloc(a, n + 1); + res = fspr_palloc(a, n + 1); memcpy(res, s, n); res[n] = '\0'; return res; } -APR_DECLARE(char *) apr_pstrmemdup(apr_pool_t *a, const char *s, apr_size_t n) +APR_DECLARE(char *) fspr_pstrmemdup(fspr_pool_t *a, const char *s, fspr_size_t n) { char *res; if (s == NULL) { return NULL; } - res = apr_palloc(a, n + 1); + res = fspr_palloc(a, n + 1); memcpy(res, s, n); res[n] = '\0'; return res; } -APR_DECLARE(void *) apr_pmemdup(apr_pool_t *a, const void *m, apr_size_t n) +APR_DECLARE(void *) fspr_pmemdup(fspr_pool_t *a, const void *m, fspr_size_t n) { void *res; if (m == NULL) return NULL; - res = apr_palloc(a, n); + res = fspr_palloc(a, n); memcpy(res, m, n); return res; } -APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *a, ...) +APR_DECLARE_NONSTD(char *) fspr_pstrcat(fspr_pool_t *a, ...) { char *cp, *argp, *res; - apr_size_t saved_lengths[MAX_SAVED_LENGTHS] = { 0 }; + fspr_size_t saved_lengths[MAX_SAVED_LENGTHS] = { 0 }; int nargs = 0; /* Pass one --- find length of required string */ - apr_size_t len = 0; + fspr_size_t len = 0; va_list adummy; va_start(adummy, a); while ((cp = va_arg(adummy, char *)) != NULL) { - apr_size_t cplen = strlen(cp); + fspr_size_t cplen = strlen(cp); if (nargs < MAX_SAVED_LENGTHS) { saved_lengths[nargs++] = cplen; } @@ -146,7 +146,7 @@ APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *a, ...) /* Allocate the required string */ - res = (char *) apr_palloc(a, len + 1); + res = (char *) fspr_palloc(a, len + 1); cp = res; /* Pass two --- copy the argument strings into the result space */ @@ -175,11 +175,11 @@ APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *a, ...) return res; } -APR_DECLARE(char *) apr_pstrcatv(apr_pool_t *a, const struct iovec *vec, - apr_size_t nvec, apr_size_t *nbytes) +APR_DECLARE(char *) fspr_pstrcatv(fspr_pool_t *a, const struct iovec *vec, + fspr_size_t nvec, fspr_size_t *nbytes) { - apr_size_t i; - apr_size_t len; + fspr_size_t i; + fspr_size_t len; const struct iovec *src; char *res; char *dst; @@ -196,7 +196,7 @@ APR_DECLARE(char *) apr_pstrcatv(apr_pool_t *a, const struct iovec *vec, } /* Allocate the required string */ - res = (char *) apr_palloc(a, len + 1); + res = (char *) fspr_palloc(a, len + 1); /* Pass two --- copy the argument strings into the result space */ src = vec; @@ -234,7 +234,7 @@ void *memchr(const void *s, int c, size_t n) #define INT64_MIN (-APR_INT64_C(0x7fffffffffffffff) - APR_INT64_C(1)) #endif -APR_DECLARE(apr_status_t) apr_strtoff(apr_off_t *offset, const char *nptr, +APR_DECLARE(fspr_status_t) fspr_strtoff(fspr_off_t *offset, const char *nptr, char **endptr, int base) { errno = 0; @@ -242,14 +242,14 @@ APR_DECLARE(apr_status_t) apr_strtoff(apr_off_t *offset, const char *nptr, return APR_FROM_OS_ERROR(errno); } -APR_DECLARE(apr_int64_t) apr_strtoi64(const char *nptr, char **endptr, int base) +APR_DECLARE(fspr_int64_t) fspr_strtoi64(const char *nptr, char **endptr, int base) { #ifdef APR_INT64_STRFN return APR_INT64_STRFN(nptr, endptr, base); #else const char *s; - apr_int64_t acc; - apr_int64_t val; + fspr_int64_t acc; + fspr_int64_t val; int neg, any; char c; @@ -261,7 +261,7 @@ APR_DECLARE(apr_int64_t) apr_strtoi64(const char *nptr, char **endptr, int base) s = nptr; do { c = *s++; - } while (apr_isspace(c)); + } while (fspr_isspace(c)); if (c == '-') { neg = 1; c = *s++; @@ -319,7 +319,7 @@ APR_DECLARE(apr_int64_t) apr_strtoi64(const char *nptr, char **endptr, int base) else if (c >= 's' && c <= 'z') c -= 'z' - 28; #else -#error "CANNOT COMPILE apr_strtoi64(), only ASCII and EBCDIC supported" +#error "CANNOT COMPILE fspr_strtoi64(), only ASCII and EBCDIC supported" #endif else break; @@ -351,15 +351,15 @@ APR_DECLARE(apr_int64_t) apr_strtoi64(const char *nptr, char **endptr, int base) #endif } -APR_DECLARE(apr_int64_t) apr_atoi64(const char *buf) +APR_DECLARE(fspr_int64_t) fspr_atoi64(const char *buf) { - return apr_strtoi64(buf, NULL, 10); + return fspr_strtoi64(buf, NULL, 10); } -APR_DECLARE(char *) apr_itoa(apr_pool_t *p, int n) +APR_DECLARE(char *) fspr_itoa(fspr_pool_t *p, int n) { const int BUFFER_SIZE = sizeof(int) * 3 + 2; - char *buf = apr_palloc(p, BUFFER_SIZE); + char *buf = fspr_palloc(p, BUFFER_SIZE); char *start = buf + BUFFER_SIZE - 1; int negative; if (n < 0) { @@ -380,10 +380,10 @@ APR_DECLARE(char *) apr_itoa(apr_pool_t *p, int n) return start; } -APR_DECLARE(char *) apr_ltoa(apr_pool_t *p, long n) +APR_DECLARE(char *) fspr_ltoa(fspr_pool_t *p, long n) { const int BUFFER_SIZE = sizeof(long) * 3 + 2; - char *buf = apr_palloc(p, BUFFER_SIZE); + char *buf = fspr_palloc(p, BUFFER_SIZE); char *start = buf + BUFFER_SIZE - 1; int negative; if (n < 0) { @@ -404,10 +404,10 @@ APR_DECLARE(char *) apr_ltoa(apr_pool_t *p, long n) return start; } -APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, apr_off_t n) +APR_DECLARE(char *) fspr_off_t_toa(fspr_pool_t *p, fspr_off_t n) { - const int BUFFER_SIZE = sizeof(apr_off_t) * 3 + 2; - char *buf = apr_palloc(p, BUFFER_SIZE); + const int BUFFER_SIZE = sizeof(fspr_off_t) * 3 + 2; + char *buf = fspr_palloc(p, BUFFER_SIZE); char *start = buf + BUFFER_SIZE - 1; int negative; if (n < 0) { @@ -428,7 +428,7 @@ APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, apr_off_t n) return start; } -APR_DECLARE(char *) apr_strfsize(apr_off_t size, char *buf) +APR_DECLARE(char *) fspr_strfsize(fspr_off_t size, char *buf) { const char ord[] = "KMGTPE"; const char *o = ord; @@ -438,7 +438,7 @@ APR_DECLARE(char *) apr_strfsize(apr_off_t size, char *buf) return strcpy(buf, " - "); } if (size < 973) { - if (apr_snprintf(buf, 5, "%3d ", (int) size) < 0) + if (fspr_snprintf(buf, 5, "%3d ", (int) size) < 0) return strcpy(buf, "****"); return buf; } @@ -452,13 +452,13 @@ APR_DECLARE(char *) apr_strfsize(apr_off_t size, char *buf) if (size < 9 || (size == 9 && remain < 973)) { if ((remain = ((remain * 5) + 256) / 512) >= 10) ++size, remain = 0; - if (apr_snprintf(buf, 5, "%d.%d%c", (int) size, remain, *o) < 0) + if (fspr_snprintf(buf, 5, "%d.%d%c", (int) size, remain, *o) < 0) return strcpy(buf, "****"); return buf; } if (remain >= 512) ++size; - if (apr_snprintf(buf, 5, "%3d%c", (int) size, *o) < 0) + if (fspr_snprintf(buf, 5, "%3d%c", (int) size, *o) < 0) return strcpy(buf, "****"); return buf; } while (1); diff --git a/libs/apr/strings/apr_strnatcmp.c b/libs/apr/strings/fspr_strnatcmp.c similarity index 84% rename from libs/apr/strings/apr_strnatcmp.c rename to libs/apr/strings/fspr_strnatcmp.c index 0e960e8a90..f80b8e4aec 100644 --- a/libs/apr/strings/apr_strnatcmp.c +++ b/libs/apr/strings/fspr_strnatcmp.c @@ -22,8 +22,8 @@ #include #include -#include "apr_strings.h" -#include "apr_lib.h" /* for apr_is*() */ +#include "fspr_strings.h" +#include "fspr_lib.h" /* for fspr_is*() */ #if defined(__GNUC__) # define UNUSED __attribute__((__unused__)) @@ -43,11 +43,11 @@ compare_right(char const *a, char const *b) both numbers to know that they have the same magnitude, so we remember it in BIAS. */ for (;; a++, b++) { - if (!apr_isdigit(*a) && !apr_isdigit(*b)) + if (!fspr_isdigit(*a) && !fspr_isdigit(*b)) break; - else if (!apr_isdigit(*a)) + else if (!fspr_isdigit(*a)) return -1; - else if (!apr_isdigit(*b)) + else if (!fspr_isdigit(*b)) return +1; else if (*a < *b) { if (!bias) @@ -69,11 +69,11 @@ compare_left(char const *a, char const *b) /* Compare two left-aligned numbers: the first to have a different value wins. */ for (;; a++, b++) { - if (!apr_isdigit(*a) && !apr_isdigit(*b)) + if (!fspr_isdigit(*a) && !fspr_isdigit(*b)) break; - else if (!apr_isdigit(*a)) + else if (!fspr_isdigit(*a)) return -1; - else if (!apr_isdigit(*b)) + else if (!fspr_isdigit(*b)) return +1; else if (*a < *b) return -1; @@ -95,14 +95,14 @@ static int strnatcmp0(char const *a, char const *b, int fold_case) ca = a[ai]; cb = b[bi]; /* skip over leading spaces or zeros */ - while (apr_isspace(ca)) + while (fspr_isspace(ca)) ca = a[++ai]; - while (apr_isspace(cb)) + while (fspr_isspace(cb)) cb = b[++bi]; /* process run of digits */ - if (apr_isdigit(ca) && apr_isdigit(cb)) { + if (fspr_isdigit(ca) && fspr_isdigit(cb)) { fractional = (ca == '0' || cb == '0'); if (fractional) { @@ -121,8 +121,8 @@ static int strnatcmp0(char const *a, char const *b, int fold_case) } if (fold_case) { - ca = apr_toupper(ca); - cb = apr_toupper(cb); + ca = fspr_toupper(ca); + cb = fspr_toupper(cb); } if (ca < cb) @@ -136,14 +136,14 @@ static int strnatcmp0(char const *a, char const *b, int fold_case) -APR_DECLARE(int) apr_strnatcmp(char const *a, char const *b) +APR_DECLARE(int) fspr_strnatcmp(char const *a, char const *b) { return strnatcmp0(a, b, 0); } /* Compare, recognizing numeric string and ignoring case. */ -APR_DECLARE(int) apr_strnatcasecmp(char const *a, char const *b) +APR_DECLARE(int) fspr_strnatcasecmp(char const *a, char const *b) { return strnatcmp0(a, b, 1); } diff --git a/libs/apr/strings/apr_strtok.c b/libs/apr/strings/fspr_strtok.c similarity index 91% rename from libs/apr/strings/apr_strtok.c rename to libs/apr/strings/fspr_strtok.c index 517b319d47..eb7d5687bc 100644 --- a/libs/apr/strings/apr_strtok.c +++ b/libs/apr/strings/fspr_strtok.c @@ -18,13 +18,13 @@ #include /* for NULL */ #endif -#include "apr.h" -#include "apr_strings.h" +#include "fspr.h" +#include "fspr_strings.h" #define APR_WANT_STRFUNC /* for strchr() */ -#include "apr_want.h" +#include "fspr_want.h" -APR_DECLARE(char *) apr_strtok(char *str, const char *sep, char **last) +APR_DECLARE(char *) fspr_strtok(char *str, const char *sep, char **last) { char *token; diff --git a/libs/apr/support/unix/waitio.c b/libs/apr/support/unix/waitio.c index 7232cdd9ce..70594824aa 100644 --- a/libs/apr/support/unix/waitio.c +++ b/libs/apr/support/unix/waitio.c @@ -14,11 +14,11 @@ * limitations under the License. */ -#include "apr_arch_file_io.h" -#include "apr_arch_networkio.h" -#include "apr_poll.h" -#include "apr_errno.h" -#include "apr_support.h" +#include "fspr_arch_file_io.h" +#include "fspr_arch_networkio.h" +#include "fspr_poll.h" +#include "fspr_errno.h" +#include "fspr_support.h" /* The only case where we don't use wait_for_io_or_timeout is on * pre-BONE BeOS, so this check should be sufficient and simpler */ @@ -37,7 +37,7 @@ #include #endif -apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, +fspr_status_t fspr_wait_for_io_or_timeout(fspr_file_t *f, fspr_socket_t *s, int for_read) { struct pollfd pfd; @@ -63,14 +63,14 @@ apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, #else /* !WAITIO_USES_POLL */ -apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, +fspr_status_t fspr_wait_for_io_or_timeout(fspr_file_t *f, fspr_socket_t *s, int for_read) { - apr_interval_time_t timeout; - apr_pollfd_t pfd; + fspr_interval_time_t timeout; + fspr_pollfd_t pfd; int type = for_read ? APR_POLLIN : APR_POLLOUT; - apr_pollset_t *pollset; - apr_status_t status; + fspr_pollset_t *pollset; + fspr_status_t status; /* TODO - timeout should be less each time through this loop */ if (f) { @@ -79,7 +79,7 @@ apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, pollset = f->pollset; if (pollset == NULL) { - status = apr_pollset_create(&(f->pollset), 1, f->pool, 0); + status = fspr_pollset_create(&(f->pollset), 1, f->pool, 0); if (status != APR_SUCCESS) { return status; } @@ -100,16 +100,16 @@ apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, * object with the correct reqevents value. Ignore the status result * on the remove, because it might not be in there (yet). */ - (void) apr_pollset_remove(pollset, &pfd); + (void) fspr_pollset_remove(pollset, &pfd); /* ### check status code */ - (void) apr_pollset_add(pollset, &pfd); + (void) fspr_pollset_add(pollset, &pfd); do { int numdesc; - const apr_pollfd_t *pdesc; + const fspr_pollfd_t *pdesc; - status = apr_pollset_poll(pollset, timeout, &numdesc, &pdesc); + status = fspr_pollset_poll(pollset, timeout, &numdesc, &pdesc); if (numdesc == 1 && (pdesc[0].rtnevents & type) != 0) { return APR_SUCCESS; diff --git a/libs/apr/tables/apr_hash.c b/libs/apr/tables/fspr_hash.c similarity index 72% rename from libs/apr/tables/apr_hash.c rename to libs/apr/tables/fspr_hash.c index 0e707601f5..259d66562b 100644 --- a/libs/apr/tables/apr_hash.c +++ b/libs/apr/tables/fspr_hash.c @@ -14,12 +14,12 @@ * limitations under the License. */ -#include "apr_private.h" +#include "fspr_private.h" -#include "apr_general.h" -#include "apr_pools.h" +#include "fspr_general.h" +#include "fspr_pools.h" -#include "apr_hash.h" +#include "fspr_hash.h" #if APR_HAVE_STDLIB_H #include @@ -43,13 +43,13 @@ * isn't too bad given that pools have a low allocation overhead. */ -typedef struct apr_hash_entry_t apr_hash_entry_t; +typedef struct fspr_hash_entry_t fspr_hash_entry_t; -struct apr_hash_entry_t { - apr_hash_entry_t *next; +struct fspr_hash_entry_t { + fspr_hash_entry_t *next; unsigned int hash; const void *key; - apr_ssize_t klen; + fspr_ssize_t klen; const void *val; }; @@ -58,11 +58,11 @@ struct apr_hash_entry_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 - * apr_hash_next(). + * fspr_hash_next(). */ -struct apr_hash_index_t { - apr_hash_t *ht; - apr_hash_entry_t *this, *next; +struct fspr_hash_index_t { + fspr_hash_t *ht; + fspr_hash_entry_t *this, *next; unsigned int index; }; @@ -73,13 +73,13 @@ struct apr_hash_index_t { * The count of hash entries may be greater depending on the chosen * collision rate. */ -struct apr_hash_t { - apr_pool_t *pool; - apr_hash_entry_t **array; - apr_hash_index_t iterator; /* For apr_hash_first(NULL, ...) */ +struct fspr_hash_t { + fspr_pool_t *pool; + fspr_hash_entry_t **array; + fspr_hash_index_t iterator; /* For fspr_hash_first(NULL, ...) */ unsigned int count, max; - apr_hashfunc_t hash_func; - apr_hash_entry_t *free; /* List of recycled entries */ + fspr_hashfunc_t hash_func; + fspr_hash_entry_t *free; /* List of recycled entries */ }; #define INITIAL_MAX 15 /* tunable == 2^n - 1 */ @@ -89,28 +89,28 @@ struct apr_hash_t { * Hash creation functions. */ -static apr_hash_entry_t **alloc_array(apr_hash_t *ht, unsigned int max) +static fspr_hash_entry_t **alloc_array(fspr_hash_t *ht, unsigned int max) { - return apr_pcalloc(ht->pool, sizeof(*ht->array) * (max + 1)); + return fspr_pcalloc(ht->pool, sizeof(*ht->array) * (max + 1)); } -APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool) +APR_DECLARE(fspr_hash_t *) fspr_hash_make(fspr_pool_t *pool) { - apr_hash_t *ht; - ht = apr_palloc(pool, sizeof(apr_hash_t)); + fspr_hash_t *ht; + ht = fspr_palloc(pool, sizeof(fspr_hash_t)); ht->pool = pool; ht->free = NULL; ht->count = 0; ht->max = INITIAL_MAX; ht->array = alloc_array(ht, ht->max); - ht->hash_func = apr_hashfunc_default; + ht->hash_func = fspr_hashfunc_default; return ht; } -APR_DECLARE(apr_hash_t *) apr_hash_make_custom(apr_pool_t *pool, - apr_hashfunc_t hash_func) +APR_DECLARE(fspr_hash_t *) fspr_hash_make_custom(fspr_pool_t *pool, + fspr_hashfunc_t hash_func) { - apr_hash_t *ht = apr_hash_make(pool); + fspr_hash_t *ht = fspr_hash_make(pool); ht->hash_func = hash_func; return ht; } @@ -120,7 +120,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_make_custom(apr_pool_t *pool, * Hash iteration functions. */ -APR_DECLARE(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi) +APR_DECLARE(fspr_hash_index_t *) fspr_hash_next(fspr_hash_index_t *hi) { hi->this = hi->next; while (!hi->this) { @@ -133,11 +133,11 @@ APR_DECLARE(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi) return hi; } -APR_DECLARE(apr_hash_index_t *) apr_hash_first(apr_pool_t *p, apr_hash_t *ht) +APR_DECLARE(fspr_hash_index_t *) fspr_hash_first(fspr_pool_t *p, fspr_hash_t *ht) { - apr_hash_index_t *hi; + fspr_hash_index_t *hi; if (p) - hi = apr_palloc(p, sizeof(*hi)); + hi = fspr_palloc(p, sizeof(*hi)); else hi = &ht->iterator; @@ -145,12 +145,12 @@ APR_DECLARE(apr_hash_index_t *) apr_hash_first(apr_pool_t *p, apr_hash_t *ht) hi->index = 0; hi->this = NULL; hi->next = NULL; - return apr_hash_next(hi); + return fspr_hash_next(hi); } -APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, +APR_DECLARE(void) fspr_hash_this(fspr_hash_index_t *hi, const void **key, - apr_ssize_t *klen, + fspr_ssize_t *klen, void **val) { if (key) *key = hi->this->key; @@ -163,15 +163,15 @@ APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, * Expanding a hash table */ -static void expand_array(apr_hash_t *ht) +static void expand_array(fspr_hash_t *ht) { - apr_hash_index_t *hi; - apr_hash_entry_t **new_array; + fspr_hash_index_t *hi; + fspr_hash_entry_t **new_array; unsigned int new_max; new_max = ht->max * 2 + 1; new_array = alloc_array(ht, new_max); - for (hi = apr_hash_first(NULL, ht); hi; hi = apr_hash_next(hi)) { + for (hi = fspr_hash_first(NULL, ht); hi; hi = fspr_hash_next(hi)) { unsigned int i = hi->this->hash & new_max; hi->this->next = new_array[i]; new_array[i] = hi->this; @@ -180,13 +180,13 @@ static void expand_array(apr_hash_t *ht) ht->max = new_max; } -APR_DECLARE_NONSTD(unsigned int) apr_hashfunc_default(const char *char_key, - apr_ssize_t *klen) +APR_DECLARE_NONSTD(unsigned int) fspr_hashfunc_default(const char *char_key, + fspr_ssize_t *klen) { unsigned int hash = 0; const unsigned char *key = (const unsigned char *)char_key; const unsigned char *p; - apr_ssize_t i; + fspr_ssize_t i; /* * This is the popular `times 33' hash algorithm which is used by @@ -251,12 +251,12 @@ APR_DECLARE_NONSTD(unsigned int) apr_hashfunc_default(const char *char_key, * that hash entries can be removed. */ -static apr_hash_entry_t **find_entry(apr_hash_t *ht, +static fspr_hash_entry_t **find_entry(fspr_hash_t *ht, const void *key, - apr_ssize_t klen, + fspr_ssize_t klen, const void *val) { - apr_hash_entry_t **hep, *he; + fspr_hash_entry_t **hep, *he; unsigned int hash; hash = ht->hash_func(key, &klen); @@ -276,7 +276,7 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht, if ((he = ht->free) != NULL) ht->free = he->next; else - he = apr_palloc(ht->pool, sizeof(*he)); + he = fspr_palloc(ht->pool, sizeof(*he)); he->next = NULL; he->hash = hash; he->key = key; @@ -287,29 +287,29 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht, return hep; } -APR_DECLARE(apr_hash_t *) apr_hash_copy(apr_pool_t *pool, - const apr_hash_t *orig) +APR_DECLARE(fspr_hash_t *) fspr_hash_copy(fspr_pool_t *pool, + const fspr_hash_t *orig) { - apr_hash_t *ht; - apr_hash_entry_t *new_vals; + fspr_hash_t *ht; + fspr_hash_entry_t *new_vals; unsigned int i, j; - ht = apr_palloc(pool, sizeof(apr_hash_t) + + ht = fspr_palloc(pool, sizeof(fspr_hash_t) + sizeof(*ht->array) * (orig->max + 1) + - sizeof(apr_hash_entry_t) * orig->count); + sizeof(fspr_hash_entry_t) * orig->count); ht->pool = pool; ht->free = NULL; ht->count = orig->count; ht->max = orig->max; ht->hash_func = orig->hash_func; - ht->array = (apr_hash_entry_t **)((char *)ht + sizeof(apr_hash_t)); + ht->array = (fspr_hash_entry_t **)((char *)ht + sizeof(fspr_hash_t)); - new_vals = (apr_hash_entry_t *)((char *)(ht) + sizeof(apr_hash_t) + + new_vals = (fspr_hash_entry_t *)((char *)(ht) + sizeof(fspr_hash_t) + sizeof(*ht->array) * (orig->max + 1)); j = 0; for (i = 0; i <= ht->max; i++) { - apr_hash_entry_t **new_entry = &(ht->array[i]); - apr_hash_entry_t *orig_entry = orig->array[i]; + fspr_hash_entry_t **new_entry = &(ht->array[i]); + fspr_hash_entry_t *orig_entry = orig->array[i]; while (orig_entry) { *new_entry = &new_vals[j++]; (*new_entry)->hash = orig_entry->hash; @@ -324,11 +324,11 @@ APR_DECLARE(apr_hash_t *) apr_hash_copy(apr_pool_t *pool, return ht; } -APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, +APR_DECLARE(void *) fspr_hash_get(fspr_hash_t *ht, const void *key, - apr_ssize_t klen) + fspr_ssize_t klen) { - apr_hash_entry_t *he; + fspr_hash_entry_t *he; he = *find_entry(ht, key, klen, NULL); if (he) return (void *)he->val; @@ -336,17 +336,17 @@ APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, return NULL; } -APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, +APR_DECLARE(void) fspr_hash_set(fspr_hash_t *ht, const void *key, - apr_ssize_t klen, + fspr_ssize_t klen, const void *val) { - apr_hash_entry_t **hep; + fspr_hash_entry_t **hep; hep = find_entry(ht, key, klen, val); if (*hep) { if (!val) { /* delete entry */ - apr_hash_entry_t *old = *hep; + fspr_hash_entry_t *old = *hep; *hep = (*hep)->next; old->next = ht->free; ht->free = old; @@ -364,40 +364,40 @@ APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, /* else key not present and val==NULL */ } -APR_DECLARE(unsigned int) apr_hash_count(apr_hash_t *ht) +APR_DECLARE(unsigned int) fspr_hash_count(fspr_hash_t *ht) { return ht->count; } -APR_DECLARE(void) apr_hash_clear(apr_hash_t *ht) +APR_DECLARE(void) fspr_hash_clear(fspr_hash_t *ht) { - apr_hash_index_t *hi; - for (hi = apr_hash_first(NULL, ht); hi; hi = apr_hash_next(hi)) - apr_hash_set(ht, hi->this->key, hi->this->klen, NULL); + fspr_hash_index_t *hi; + for (hi = fspr_hash_first(NULL, ht); hi; hi = fspr_hash_next(hi)) + fspr_hash_set(ht, hi->this->key, hi->this->klen, NULL); } -APR_DECLARE(apr_hash_t*) apr_hash_overlay(apr_pool_t *p, - const apr_hash_t *overlay, - const apr_hash_t *base) +APR_DECLARE(fspr_hash_t*) fspr_hash_overlay(fspr_pool_t *p, + const fspr_hash_t *overlay, + const fspr_hash_t *base) { - return apr_hash_merge(p, overlay, base, NULL, NULL); + return fspr_hash_merge(p, overlay, base, NULL, NULL); } -APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, - const apr_hash_t *overlay, - const apr_hash_t *base, - void * (*merger)(apr_pool_t *p, +APR_DECLARE(fspr_hash_t *) fspr_hash_merge(fspr_pool_t *p, + const fspr_hash_t *overlay, + const fspr_hash_t *base, + void * (*merger)(fspr_pool_t *p, const void *key, - apr_ssize_t klen, + fspr_ssize_t klen, const void *h1_val, const void *h2_val, const void *data), const void *data) { - apr_hash_t *res; - apr_hash_entry_t *new_vals = NULL; - apr_hash_entry_t *iter; - apr_hash_entry_t *ent; + fspr_hash_t *res; + fspr_hash_entry_t *new_vals = NULL; + fspr_hash_entry_t *iter; + fspr_hash_entry_t *ent; unsigned int i,j,k; #if APR_POOL_DEBUG @@ -405,19 +405,19 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, * overlay->a.pool and base->a.pool have a life span at least * as long as p */ - if (!apr_pool_is_ancestor(overlay->pool, p)) { + if (!fspr_pool_is_ancestor(overlay->pool, p)) { fprintf(stderr, - "apr_hash_merge: overlay's pool is not an ancestor of p\n"); + "fspr_hash_merge: overlay's pool is not an ancestor of p\n"); abort(); } - if (!apr_pool_is_ancestor(base->pool, p)) { + if (!fspr_pool_is_ancestor(base->pool, p)) { fprintf(stderr, - "apr_hash_merge: base's pool is not an ancestor of p\n"); + "fspr_hash_merge: base's pool is not an ancestor of p\n"); abort(); } #endif - res = apr_palloc(p, sizeof(apr_hash_t)); + res = fspr_palloc(p, sizeof(fspr_hash_t)); res->pool = p; res->free = NULL; res->hash_func = base->hash_func; @@ -428,7 +428,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, } res->array = alloc_array(res, res->max); if (base->count + overlay->count) { - new_vals = apr_palloc(p, sizeof(apr_hash_entry_t) * + new_vals = fspr_palloc(p, sizeof(fspr_hash_entry_t) * (base->count + overlay->count)); } j = 0; diff --git a/libs/apr/tables/apr_tables.c b/libs/apr/tables/fspr_tables.c similarity index 71% rename from libs/apr/tables/apr_tables.c rename to libs/apr/tables/fspr_tables.c index 5a1dfa2619..46153d8c38 100644 --- a/libs/apr/tables/apr_tables.c +++ b/libs/apr/tables/fspr_tables.c @@ -21,13 +21,13 @@ * rst --- 4/95 --- 6/95 */ -#include "apr_private.h" +#include "fspr_private.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_tables.h" -#include "apr_strings.h" -#include "apr_lib.h" +#include "fspr_general.h" +#include "fspr_pools.h" +#include "fspr_tables.h" +#include "fspr_strings.h" +#include "fspr_lib.h" #if APR_HAVE_STDLIB_H #include #endif @@ -43,7 +43,7 @@ #endif /***************************************************************** - * This file contains array and apr_table_t functions only. + * This file contains array and fspr_table_t functions only. */ /***************************************************************** @@ -51,7 +51,7 @@ * The 'array' functions... */ -static void make_array_core(apr_array_header_t *res, apr_pool_t *p, +static void make_array_core(fspr_array_header_t *res, fspr_pool_t *p, int nelts, int elt_size, int clear) { /* @@ -63,10 +63,10 @@ static void make_array_core(apr_array_header_t *res, apr_pool_t *p, } if (clear) { - res->elts = apr_pcalloc(p, nelts * elt_size); + res->elts = fspr_pcalloc(p, nelts * elt_size); } else { - res->elts = apr_palloc(p, nelts * elt_size); + res->elts = fspr_palloc(p, nelts * elt_size); } res->pool = p; @@ -75,42 +75,42 @@ static void make_array_core(apr_array_header_t *res, apr_pool_t *p, res->nalloc = nelts; /* ...but this many allocated */ } -APR_DECLARE(int) apr_is_empty_array(const apr_array_header_t *a) +APR_DECLARE(int) fspr_is_empty_array(const fspr_array_header_t *a) { return ((a == NULL) || (a->nelts == 0)); } -APR_DECLARE(apr_array_header_t *) apr_array_make(apr_pool_t *p, +APR_DECLARE(fspr_array_header_t *) fspr_array_make(fspr_pool_t *p, int nelts, int elt_size) { - apr_array_header_t *res; + fspr_array_header_t *res; - res = (apr_array_header_t *) apr_palloc(p, sizeof(apr_array_header_t)); + res = (fspr_array_header_t *) fspr_palloc(p, sizeof(fspr_array_header_t)); make_array_core(res, p, nelts, elt_size, 1); return res; } -APR_DECLARE(void) apr_array_clear(apr_array_header_t *arr) +APR_DECLARE(void) fspr_array_clear(fspr_array_header_t *arr) { arr->nelts = 0; } -APR_DECLARE(void *) apr_array_pop(apr_array_header_t *arr) +APR_DECLARE(void *) fspr_array_pop(fspr_array_header_t *arr) { - if (apr_is_empty_array(arr)) { + if (fspr_is_empty_array(arr)) { return NULL; } return arr->elts + (arr->elt_size * (--arr->nelts)); } -APR_DECLARE(void *) apr_array_push(apr_array_header_t *arr) +APR_DECLARE(void *) fspr_array_push(fspr_array_header_t *arr) { if (arr->nelts == arr->nalloc) { int new_size = (arr->nalloc <= 0) ? 1 : arr->nalloc * 2; char *new_data; - new_data = apr_palloc(arr->pool, arr->elt_size * new_size); + new_data = fspr_palloc(arr->pool, arr->elt_size * new_size); memcpy(new_data, arr->elts, arr->nalloc * arr->elt_size); memset(new_data + arr->nalloc * arr->elt_size, 0, @@ -123,13 +123,13 @@ APR_DECLARE(void *) apr_array_push(apr_array_header_t *arr) return arr->elts + (arr->elt_size * (arr->nelts - 1)); } -static void *apr_array_push_noclear(apr_array_header_t *arr) +static void *fspr_array_push_noclear(fspr_array_header_t *arr) { if (arr->nelts == arr->nalloc) { int new_size = (arr->nalloc <= 0) ? 1 : arr->nalloc * 2; char *new_data; - new_data = apr_palloc(arr->pool, arr->elt_size * new_size); + new_data = fspr_palloc(arr->pool, arr->elt_size * new_size); memcpy(new_data, arr->elts, arr->nalloc * arr->elt_size); arr->elts = new_data; @@ -140,8 +140,8 @@ static void *apr_array_push_noclear(apr_array_header_t *arr) return arr->elts + (arr->elt_size * (arr->nelts - 1)); } -APR_DECLARE(void) apr_array_cat(apr_array_header_t *dst, - const apr_array_header_t *src) +APR_DECLARE(void) fspr_array_cat(fspr_array_header_t *dst, + const fspr_array_header_t *src) { int elt_size = dst->elt_size; @@ -153,7 +153,7 @@ APR_DECLARE(void) apr_array_cat(apr_array_header_t *dst, new_size *= 2; } - new_data = apr_pcalloc(dst->pool, elt_size * new_size); + new_data = fspr_pcalloc(dst->pool, elt_size * new_size); memcpy(new_data, dst->elts, dst->nalloc * elt_size); dst->elts = new_data; @@ -165,11 +165,11 @@ APR_DECLARE(void) apr_array_cat(apr_array_header_t *dst, dst->nelts += src->nelts; } -APR_DECLARE(apr_array_header_t *) apr_array_copy(apr_pool_t *p, - const apr_array_header_t *arr) +APR_DECLARE(fspr_array_header_t *) fspr_array_copy(fspr_pool_t *p, + const fspr_array_header_t *arr) { - apr_array_header_t *res = - (apr_array_header_t *) apr_palloc(p, sizeof(apr_array_header_t)); + fspr_array_header_t *res = + (fspr_array_header_t *) fspr_palloc(p, sizeof(fspr_array_header_t)); make_array_core(res, p, arr->nalloc, arr->elt_size, 0); memcpy(res->elts, arr->elts, arr->elt_size * arr->nelts); @@ -186,8 +186,8 @@ APR_DECLARE(apr_array_header_t *) apr_array_copy(apr_pool_t *p, * overhead of the full copy only where it is really needed. */ -static APR_INLINE void copy_array_hdr_core(apr_array_header_t *res, - const apr_array_header_t *arr) +static APR_INLINE void copy_array_hdr_core(fspr_array_header_t *res, + const fspr_array_header_t *arr) { res->elts = arr->elts; res->elt_size = arr->elt_size; @@ -195,13 +195,13 @@ static APR_INLINE void copy_array_hdr_core(apr_array_header_t *res, res->nalloc = arr->nelts; /* Force overflow on push */ } -APR_DECLARE(apr_array_header_t *) - apr_array_copy_hdr(apr_pool_t *p, - const apr_array_header_t *arr) +APR_DECLARE(fspr_array_header_t *) + fspr_array_copy_hdr(fspr_pool_t *p, + const fspr_array_header_t *arr) { - apr_array_header_t *res; + fspr_array_header_t *res; - res = (apr_array_header_t *) apr_palloc(p, sizeof(apr_array_header_t)); + res = (fspr_array_header_t *) fspr_palloc(p, sizeof(fspr_array_header_t)); res->pool = p; copy_array_hdr_core(res, arr); return res; @@ -209,33 +209,33 @@ APR_DECLARE(apr_array_header_t *) /* The above is used here to avoid consing multiple new array bodies... */ -APR_DECLARE(apr_array_header_t *) - apr_array_append(apr_pool_t *p, - const apr_array_header_t *first, - const apr_array_header_t *second) +APR_DECLARE(fspr_array_header_t *) + fspr_array_append(fspr_pool_t *p, + const fspr_array_header_t *first, + const fspr_array_header_t *second) { - apr_array_header_t *res = apr_array_copy_hdr(p, first); + fspr_array_header_t *res = fspr_array_copy_hdr(p, first); - apr_array_cat(res, second); + fspr_array_cat(res, second); return res; } -/* apr_array_pstrcat generates a new string from the apr_pool_t containing +/* fspr_array_pstrcat generates a new string from the fspr_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_DECLARE(char *) apr_array_pstrcat(apr_pool_t *p, - const apr_array_header_t *arr, +APR_DECLARE(char *) fspr_array_pstrcat(fspr_pool_t *p, + const fspr_array_header_t *arr, const char sep) { char *cp, *res, **strpp; - apr_size_t len; + fspr_size_t len; int i; if (arr->nelts <= 0 || arr->elts == NULL) { /* Empty table? */ - return (char *) apr_pcalloc(p, 1); + return (char *) fspr_pcalloc(p, 1); } /* Pass one --- find length of required string */ @@ -255,7 +255,7 @@ APR_DECLARE(char *) apr_array_pstrcat(apr_pool_t *p, /* Allocate the required string */ - res = (char *) apr_palloc(p, len + 1); + res = (char *) fspr_palloc(p, len + 1); cp = res; /* Pass two --- copy the argument strings into the result space */ @@ -308,35 +308,35 @@ APR_DECLARE(char *) apr_array_pstrcat(apr_pool_t *p, #define COMPUTE_KEY_CHECKSUM(key, checksum) \ { \ const char *k = (key); \ - apr_uint32_t c = (apr_uint32_t)*k; \ + fspr_uint32_t c = (fspr_uint32_t)*k; \ (checksum) = c; \ (checksum) <<= 8; \ if (c) { \ - c = (apr_uint32_t)*++k; \ + c = (fspr_uint32_t)*++k; \ checksum |= c; \ } \ (checksum) <<= 8; \ if (c) { \ - c = (apr_uint32_t)*++k; \ + c = (fspr_uint32_t)*++k; \ checksum |= c; \ } \ (checksum) <<= 8; \ if (c) { \ - c = (apr_uint32_t)*++k; \ + c = (fspr_uint32_t)*++k; \ checksum |= c; \ } \ checksum &= CASE_MASK; \ } /** The opaque string-content table type */ -struct apr_table_t { +struct fspr_table_t { /* This has to be first to promote backwards compatibility with - * older modules which cast a apr_table_t * to an apr_array_header_t *... - * they should use the apr_table_elts() function for most of the + * older modules which cast a fspr_table_t * to an fspr_array_header_t *... + * they should use the fspr_table_elts() function for most of the * cases they do this for. */ /** The underlying array for the table */ - apr_array_header_t a; + fspr_array_header_t a; #ifdef MAKE_TABLE_PROFILE /** Who created the array. */ void *creator; @@ -352,7 +352,7 @@ struct apr_table_t { * of index_initialized will be zero. (Check this before * trying to use index_first[i] or index_last[i]!) */ - apr_uint32_t index_initialized; + fspr_uint32_t index_initialized; int index_first[TABLE_HASH_SIZE]; int index_last[TABLE_HASH_SIZE]; }; @@ -362,32 +362,32 @@ struct apr_table_t { * and table_elts() in alloc.h */ #ifdef MAKE_TABLE_PROFILE -static apr_table_entry_t *table_push(apr_table_t *t) +static fspr_table_entry_t *table_push(fspr_table_t *t) { if (t->a.nelts == t->a.nalloc) { return NULL; } - return (apr_table_entry_t *) apr_array_push_noclear(&t->a); + return (fspr_table_entry_t *) fspr_array_push_noclear(&t->a); } #else /* MAKE_TABLE_PROFILE */ -#define table_push(t) ((apr_table_entry_t *) apr_array_push_noclear(&(t)->a)) +#define table_push(t) ((fspr_table_entry_t *) fspr_array_push_noclear(&(t)->a)) #endif /* MAKE_TABLE_PROFILE */ -APR_DECLARE(const apr_array_header_t *) apr_table_elts(const apr_table_t *t) +APR_DECLARE(const fspr_array_header_t *) fspr_table_elts(const fspr_table_t *t) { - return (const apr_array_header_t *)t; + return (const fspr_array_header_t *)t; } -APR_DECLARE(int) apr_is_empty_table(const apr_table_t *t) +APR_DECLARE(int) fspr_is_empty_table(const fspr_table_t *t) { return ((t == NULL) || (t->a.nelts == 0)); } -APR_DECLARE(apr_table_t *) apr_table_make(apr_pool_t *p, int nelts) +APR_DECLARE(fspr_table_t *) fspr_table_make(fspr_pool_t *p, int nelts) { - apr_table_t *t = apr_palloc(p, sizeof(apr_table_t)); + fspr_table_t *t = fspr_palloc(p, sizeof(fspr_table_t)); - make_array_core(&t->a, p, nelts, sizeof(apr_table_entry_t), 0); + make_array_core(&t->a, p, nelts, sizeof(fspr_table_entry_t), 0); #ifdef MAKE_TABLE_PROFILE t->creator = __builtin_return_address(0); #endif @@ -395,21 +395,21 @@ APR_DECLARE(apr_table_t *) apr_table_make(apr_pool_t *p, int nelts) return t; } -APR_DECLARE(apr_table_t *) apr_table_copy(apr_pool_t *p, const apr_table_t *t) +APR_DECLARE(fspr_table_t *) fspr_table_copy(fspr_pool_t *p, const fspr_table_t *t) { - apr_table_t *new = apr_palloc(p, sizeof(apr_table_t)); + fspr_table_t *new = fspr_palloc(p, sizeof(fspr_table_t)); #if APR_POOL_DEBUG /* we don't copy keys and values, so it's necessary that t->a.pool * have a life span at least as long as p */ - if (!apr_pool_is_ancestor(t->a.pool, p)) { - fprintf(stderr, "apr_table_copy: t's pool is not an ancestor of p\n"); + if (!fspr_pool_is_ancestor(t->a.pool, p)) { + fprintf(stderr, "fspr_table_copy: t's pool is not an ancestor of p\n"); abort(); } #endif - make_array_core(&new->a, p, t->a.nalloc, sizeof(apr_table_entry_t), 0); - memcpy(new->a.elts, t->a.elts, t->a.nelts * sizeof(apr_table_entry_t)); + make_array_core(&new->a, p, t->a.nalloc, sizeof(fspr_table_entry_t), 0); + memcpy(new->a.elts, t->a.elts, t->a.nelts * sizeof(fspr_table_entry_t)); new->a.nelts = t->a.nelts; memcpy(new->index_first, t->index_first, sizeof(int) * TABLE_HASH_SIZE); memcpy(new->index_last, t->index_last, sizeof(int) * TABLE_HASH_SIZE); @@ -417,11 +417,11 @@ APR_DECLARE(apr_table_t *) apr_table_copy(apr_pool_t *p, const apr_table_t *t) return new; } -static void table_reindex(apr_table_t *t) +static void table_reindex(fspr_table_t *t) { int i; int hash; - apr_table_entry_t *next_elt = (apr_table_entry_t *) t->a.elts; + fspr_table_entry_t *next_elt = (fspr_table_entry_t *) t->a.elts; t->index_initialized = 0; for (i = 0; i < t->a.nelts; i++, next_elt++) { @@ -434,17 +434,17 @@ static void table_reindex(apr_table_t *t) } } -APR_DECLARE(void) apr_table_clear(apr_table_t *t) +APR_DECLARE(void) fspr_table_clear(fspr_table_t *t) { t->a.nelts = 0; t->index_initialized = 0; } -APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key) +APR_DECLARE(const char *) fspr_table_get(const fspr_table_t *t, const char *key) { - apr_table_entry_t *next_elt; - apr_table_entry_t *end_elt; - apr_uint32_t checksum; + fspr_table_entry_t *next_elt; + fspr_table_entry_t *end_elt; + fspr_uint32_t checksum; int hash; if (key == NULL) { @@ -456,8 +456,8 @@ APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key) return NULL; } COMPUTE_KEY_CHECKSUM(key, checksum); - next_elt = ((apr_table_entry_t *) t->a.elts) + t->index_first[hash];; - end_elt = ((apr_table_entry_t *) t->a.elts) + t->index_last[hash]; + next_elt = ((fspr_table_entry_t *) t->a.elts) + t->index_first[hash];; + end_elt = ((fspr_table_entry_t *) t->a.elts) + t->index_last[hash]; for (; next_elt <= end_elt; next_elt++) { if ((checksum == next_elt->key_checksum) && @@ -469,13 +469,13 @@ APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key) return NULL; } -APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, +APR_DECLARE(void) fspr_table_set(fspr_table_t *t, const char *key, const char *val) { - apr_table_entry_t *next_elt; - apr_table_entry_t *end_elt; - apr_table_entry_t *table_end; - apr_uint32_t checksum; + fspr_table_entry_t *next_elt; + fspr_table_entry_t *end_elt; + fspr_table_entry_t *table_end; + fspr_uint32_t checksum; int hash; COMPUTE_KEY_CHECKSUM(key, checksum); @@ -485,9 +485,9 @@ APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, TABLE_SET_INDEX_INITIALIZED(t, hash); goto add_new_elt; } - next_elt = ((apr_table_entry_t *) t->a.elts) + t->index_first[hash];; - end_elt = ((apr_table_entry_t *) t->a.elts) + t->index_last[hash]; - table_end =((apr_table_entry_t *) t->a.elts) + t->a.nelts; + next_elt = ((fspr_table_entry_t *) t->a.elts) + t->index_first[hash];; + end_elt = ((fspr_table_entry_t *) t->a.elts) + t->index_last[hash]; + table_end =((fspr_table_entry_t *) t->a.elts) + t->a.nelts; for (; next_elt <= end_elt; next_elt++) { if ((checksum == next_elt->key_checksum) && @@ -496,9 +496,9 @@ APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, /* Found an existing entry with the same key, so overwrite it */ int must_reindex = 0; - apr_table_entry_t *dst_elt = NULL; + fspr_table_entry_t *dst_elt = NULL; - next_elt->val = apr_pstrdup(t->a.pool, val); + next_elt->val = fspr_pstrdup(t->a.pool, val); /* Remove any other instances of this key */ for (next_elt++; next_elt <= end_elt; next_elt++) { @@ -535,19 +535,19 @@ APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, add_new_elt: t->index_last[hash] = t->a.nelts; - next_elt = (apr_table_entry_t *) table_push(t); - next_elt->key = apr_pstrdup(t->a.pool, key); - next_elt->val = apr_pstrdup(t->a.pool, val); + next_elt = (fspr_table_entry_t *) table_push(t); + next_elt->key = fspr_pstrdup(t->a.pool, key); + next_elt->val = fspr_pstrdup(t->a.pool, val); next_elt->key_checksum = checksum; } -APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, +APR_DECLARE(void) fspr_table_setn(fspr_table_t *t, const char *key, const char *val) { - apr_table_entry_t *next_elt; - apr_table_entry_t *end_elt; - apr_table_entry_t *table_end; - apr_uint32_t checksum; + fspr_table_entry_t *next_elt; + fspr_table_entry_t *end_elt; + fspr_table_entry_t *table_end; + fspr_uint32_t checksum; int hash; COMPUTE_KEY_CHECKSUM(key, checksum); @@ -557,9 +557,9 @@ APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, TABLE_SET_INDEX_INITIALIZED(t, hash); goto add_new_elt; } - next_elt = ((apr_table_entry_t *) t->a.elts) + t->index_first[hash];; - end_elt = ((apr_table_entry_t *) t->a.elts) + t->index_last[hash]; - table_end =((apr_table_entry_t *) t->a.elts) + t->a.nelts; + next_elt = ((fspr_table_entry_t *) t->a.elts) + t->index_first[hash];; + end_elt = ((fspr_table_entry_t *) t->a.elts) + t->index_last[hash]; + table_end =((fspr_table_entry_t *) t->a.elts) + t->a.nelts; for (; next_elt <= end_elt; next_elt++) { if ((checksum == next_elt->key_checksum) && @@ -568,7 +568,7 @@ APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, /* Found an existing entry with the same key, so overwrite it */ int must_reindex = 0; - apr_table_entry_t *dst_elt = NULL; + fspr_table_entry_t *dst_elt = NULL; next_elt->val = (char *)val; @@ -607,18 +607,18 @@ APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, add_new_elt: t->index_last[hash] = t->a.nelts; - next_elt = (apr_table_entry_t *) table_push(t); + next_elt = (fspr_table_entry_t *) table_push(t); next_elt->key = (char *)key; next_elt->val = (char *)val; next_elt->key_checksum = checksum; } -APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key) +APR_DECLARE(void) fspr_table_unset(fspr_table_t *t, const char *key) { - apr_table_entry_t *next_elt; - apr_table_entry_t *end_elt; - apr_table_entry_t *dst_elt; - apr_uint32_t checksum; + fspr_table_entry_t *next_elt; + fspr_table_entry_t *end_elt; + fspr_table_entry_t *dst_elt; + fspr_uint32_t checksum; int hash; int must_reindex; @@ -627,8 +627,8 @@ APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key) return; } COMPUTE_KEY_CHECKSUM(key, checksum); - next_elt = ((apr_table_entry_t *) t->a.elts) + t->index_first[hash]; - end_elt = ((apr_table_entry_t *) t->a.elts) + t->index_last[hash]; + next_elt = ((fspr_table_entry_t *) t->a.elts) + t->index_first[hash]; + end_elt = ((fspr_table_entry_t *) t->a.elts) + t->index_last[hash]; must_reindex = 0; for (; next_elt <= end_elt; next_elt++) { if ((checksum == next_elt->key_checksum) && @@ -637,7 +637,7 @@ APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key) /* Found a match: remove this entry, plus any additional * matches for the same key that might follow */ - apr_table_entry_t *table_end = ((apr_table_entry_t *) t->a.elts) + + fspr_table_entry_t *table_end = ((fspr_table_entry_t *) t->a.elts) + t->a.nelts; t->a.nelts--; dst_elt = next_elt; @@ -667,12 +667,12 @@ APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key) } } -APR_DECLARE(void) apr_table_merge(apr_table_t *t, const char *key, +APR_DECLARE(void) fspr_table_merge(fspr_table_t *t, const char *key, const char *val) { - apr_table_entry_t *next_elt; - apr_table_entry_t *end_elt; - apr_uint32_t checksum; + fspr_table_entry_t *next_elt; + fspr_table_entry_t *end_elt; + fspr_uint32_t checksum; int hash; COMPUTE_KEY_CHECKSUM(key, checksum); @@ -682,15 +682,15 @@ APR_DECLARE(void) apr_table_merge(apr_table_t *t, const char *key, TABLE_SET_INDEX_INITIALIZED(t, hash); goto add_new_elt; } - next_elt = ((apr_table_entry_t *) t->a.elts) + t->index_first[hash]; - end_elt = ((apr_table_entry_t *) t->a.elts) + t->index_last[hash]; + next_elt = ((fspr_table_entry_t *) t->a.elts) + t->index_first[hash]; + end_elt = ((fspr_table_entry_t *) t->a.elts) + t->index_last[hash]; for (; next_elt <= end_elt; next_elt++) { if ((checksum == next_elt->key_checksum) && !strcasecmp(next_elt->key, key)) { /* Found an existing entry with the same key, so merge with it */ - next_elt->val = apr_pstrcat(t->a.pool, next_elt->val, ", ", + next_elt->val = fspr_pstrcat(t->a.pool, next_elt->val, ", ", val, NULL); return; } @@ -698,28 +698,28 @@ APR_DECLARE(void) apr_table_merge(apr_table_t *t, const char *key, add_new_elt: t->index_last[hash] = t->a.nelts; - next_elt = (apr_table_entry_t *) table_push(t); - next_elt->key = apr_pstrdup(t->a.pool, key); - next_elt->val = apr_pstrdup(t->a.pool, val); + next_elt = (fspr_table_entry_t *) table_push(t); + next_elt->key = fspr_pstrdup(t->a.pool, key); + next_elt->val = fspr_pstrdup(t->a.pool, val); next_elt->key_checksum = checksum; } -APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, +APR_DECLARE(void) fspr_table_mergen(fspr_table_t *t, const char *key, const char *val) { - apr_table_entry_t *next_elt; - apr_table_entry_t *end_elt; - apr_uint32_t checksum; + fspr_table_entry_t *next_elt; + fspr_table_entry_t *end_elt; + fspr_uint32_t checksum; int hash; #if APR_POOL_DEBUG { - if (!apr_pool_is_ancestor(apr_pool_find(key), t->a.pool)) { - fprintf(stderr, "apr_table_mergen: key not in ancestor pool of t\n"); + if (!fspr_pool_is_ancestor(fspr_pool_find(key), t->a.pool)) { + fprintf(stderr, "fspr_table_mergen: key not in ancestor pool of t\n"); abort(); } - if (!apr_pool_is_ancestor(apr_pool_find(val), t->a.pool)) { - fprintf(stderr, "apr_table_mergen: key not in ancestor pool of t\n"); + if (!fspr_pool_is_ancestor(fspr_pool_find(val), t->a.pool)) { + fprintf(stderr, "fspr_table_mergen: key not in ancestor pool of t\n"); abort(); } } @@ -732,15 +732,15 @@ APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, TABLE_SET_INDEX_INITIALIZED(t, hash); goto add_new_elt; } - next_elt = ((apr_table_entry_t *) t->a.elts) + t->index_first[hash];; - end_elt = ((apr_table_entry_t *) t->a.elts) + t->index_last[hash]; + next_elt = ((fspr_table_entry_t *) t->a.elts) + t->index_first[hash];; + end_elt = ((fspr_table_entry_t *) t->a.elts) + t->index_last[hash]; for (; next_elt <= end_elt; next_elt++) { if ((checksum == next_elt->key_checksum) && !strcasecmp(next_elt->key, key)) { /* Found an existing entry with the same key, so merge with it */ - next_elt->val = apr_pstrcat(t->a.pool, next_elt->val, ", ", + next_elt->val = fspr_pstrcat(t->a.pool, next_elt->val, ", ", val, NULL); return; } @@ -748,17 +748,17 @@ APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, add_new_elt: t->index_last[hash] = t->a.nelts; - next_elt = (apr_table_entry_t *) table_push(t); + next_elt = (fspr_table_entry_t *) table_push(t); next_elt->key = (char *)key; next_elt->val = (char *)val; next_elt->key_checksum = checksum; } -APR_DECLARE(void) apr_table_add(apr_table_t *t, const char *key, +APR_DECLARE(void) fspr_table_add(fspr_table_t *t, const char *key, const char *val) { - apr_table_entry_t *elts; - apr_uint32_t checksum; + fspr_table_entry_t *elts; + fspr_uint32_t checksum; int hash; hash = TABLE_HASH(key); @@ -768,27 +768,27 @@ APR_DECLARE(void) apr_table_add(apr_table_t *t, const char *key, TABLE_SET_INDEX_INITIALIZED(t, hash); } COMPUTE_KEY_CHECKSUM(key, checksum); - elts = (apr_table_entry_t *) table_push(t); - elts->key = apr_pstrdup(t->a.pool, key); - elts->val = apr_pstrdup(t->a.pool, val); + elts = (fspr_table_entry_t *) table_push(t); + elts->key = fspr_pstrdup(t->a.pool, key); + elts->val = fspr_pstrdup(t->a.pool, val); elts->key_checksum = checksum; } -APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, +APR_DECLARE(void) fspr_table_addn(fspr_table_t *t, const char *key, const char *val) { - apr_table_entry_t *elts; - apr_uint32_t checksum; + fspr_table_entry_t *elts; + fspr_uint32_t checksum; int hash; #if APR_POOL_DEBUG { - if (!apr_pool_is_ancestor(apr_pool_find(key), t->a.pool)) { - fprintf(stderr, "apr_table_addn: key not in ancestor pool of t\n"); + if (!fspr_pool_is_ancestor(fspr_pool_find(key), t->a.pool)) { + fprintf(stderr, "fspr_table_addn: key not in ancestor pool of t\n"); abort(); } - if (!apr_pool_is_ancestor(apr_pool_find(val), t->a.pool)) { - fprintf(stderr, "apr_table_addn: key not in ancestor pool of t\n"); + if (!fspr_pool_is_ancestor(fspr_pool_find(val), t->a.pool)) { + fprintf(stderr, "fspr_table_addn: key not in ancestor pool of t\n"); abort(); } } @@ -801,40 +801,40 @@ APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, TABLE_SET_INDEX_INITIALIZED(t, hash); } COMPUTE_KEY_CHECKSUM(key, checksum); - elts = (apr_table_entry_t *) table_push(t); + elts = (fspr_table_entry_t *) table_push(t); elts->key = (char *)key; elts->val = (char *)val; elts->key_checksum = checksum; } -APR_DECLARE(apr_table_t *) apr_table_overlay(apr_pool_t *p, - const apr_table_t *overlay, - const apr_table_t *base) +APR_DECLARE(fspr_table_t *) fspr_table_overlay(fspr_pool_t *p, + const fspr_table_t *overlay, + const fspr_table_t *base) { - apr_table_t *res; + fspr_table_t *res; #if APR_POOL_DEBUG /* we don't copy keys and values, so it's necessary that * overlay->a.pool and base->a.pool have a life span at least * as long as p */ - if (!apr_pool_is_ancestor(overlay->a.pool, p)) { + if (!fspr_pool_is_ancestor(overlay->a.pool, p)) { fprintf(stderr, - "apr_table_overlay: overlay's pool is not an ancestor of p\n"); + "fspr_table_overlay: overlay's pool is not an ancestor of p\n"); abort(); } - if (!apr_pool_is_ancestor(base->a.pool, p)) { + if (!fspr_pool_is_ancestor(base->a.pool, p)) { fprintf(stderr, - "apr_table_overlay: base's pool is not an ancestor of p\n"); + "fspr_table_overlay: base's pool is not an ancestor of p\n"); abort(); } #endif - res = apr_palloc(p, sizeof(apr_table_t)); + res = fspr_palloc(p, sizeof(fspr_table_t)); /* behave like append_arrays */ res->a.pool = p; copy_array_hdr_core(&res->a, &overlay->a); - apr_array_cat(&res->a, &base->a); + fspr_array_cat(&res->a, &base->a); table_reindex(res); return res; } @@ -844,7 +844,7 @@ APR_DECLARE(apr_table_t *) apr_table_overlay(apr_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 apr_table_t t that matches the vararg key, + * on each valid key-value pair in the fspr_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. * @@ -854,42 +854,42 @@ APR_DECLARE(apr_table_t *) apr_table_overlay(apr_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 apr_table_t is unique (i.e., no multiple entries with the same key). This + * the fspr_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 apr_table_vdo(): + * ADDENDUM for fspr_table_vdo(): * * The caching api will allow a user to walk the header values: * - * apr_status_t apr_cache_el_header_walk(apr_cache_el *el, + * fspr_status_t fspr_cache_el_header_walk(fspr_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: * - * apr_status_t (*cache_el_header_walk)(apr_cache_el *el, + * fspr_status_t (*cache_el_header_walk)(fspr_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 apr_table - and - * rather than reimplementing apr_table_do (which IMHO would be bad) I just + * their headers, in the file case this is actually just an fspr_table - and + * rather than reimplementing fspr_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 apr_table's, but mod_file_cache should (though a good hash would + * can't use fspr_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_DECLARE_NONSTD(int) apr_table_do(apr_table_do_callback_fn_t *comp, - void *rec, const apr_table_t *t, ...) +APR_DECLARE_NONSTD(int) fspr_table_do(fspr_table_do_callback_fn_t *comp, + void *rec, const fspr_table_t *t, ...) { int rv; va_list vp; va_start(vp, t); - rv = apr_table_vdo(comp, rec, t, vp); + rv = fspr_table_vdo(comp, rec, t, vp); va_end(vp); return rv; @@ -905,12 +905,12 @@ APR_DECLARE_NONSTD(int) apr_table_do(apr_table_do_callback_fn_t *comp, * * Note also that this behavior is at odds with the behavior seen if an * empty va_list is passed in -- in that case, a zero return value terminates - * the entire apr_table_vdo (which is what I think should happen in + * the entire fspr_table_vdo (which is what I think should happen in * both cases). * * If nobody objects soon, I'm going to change the order of the nested * loops in this function so that any zero return value from the (*comp) - * function will cause a full termination of apr_table_vdo. I'm hesitant + * function will cause a full termination of fspr_table_vdo. I'm hesitant * at the moment because these (funky) semantics have been around for a * very long time, and although Apache doesn't seem to use them at all, * some third-party vendor might. I can only think of one possible reason @@ -925,11 +925,11 @@ APR_DECLARE_NONSTD(int) apr_table_do(apr_table_do_callback_fn_t *comp, * * Sigh. --JCW, 06/28/02 */ -APR_DECLARE(int) apr_table_vdo(apr_table_do_callback_fn_t *comp, - void *rec, const apr_table_t *t, va_list vp) +APR_DECLARE(int) fspr_table_vdo(fspr_table_do_callback_fn_t *comp, + void *rec, const fspr_table_t *t, va_list vp) { char *argp; - apr_table_entry_t *elts = (apr_table_entry_t *) t->a.elts; + fspr_table_entry_t *elts = (fspr_table_entry_t *) t->a.elts; int vdorv = 1; argp = va_arg(vp, char *); @@ -939,7 +939,7 @@ APR_DECLARE(int) apr_table_vdo(apr_table_do_callback_fn_t *comp, /* Scan for entries that match the next key */ int hash = TABLE_HASH(argp); if (TABLE_INDEX_IS_INITIALIZED(t, hash)) { - apr_uint32_t checksum; + fspr_uint32_t checksum; COMPUTE_KEY_CHECKSUM(argp, checksum); for (i = t->index_first[hash]; rv && (i <= t->index_last[hash]); ++i) { @@ -966,22 +966,22 @@ APR_DECLARE(int) apr_table_vdo(apr_table_do_callback_fn_t *comp, return vdorv; } -static apr_table_entry_t **table_mergesort(apr_pool_t *pool, - apr_table_entry_t **values, - apr_size_t n) +static fspr_table_entry_t **table_mergesort(fspr_pool_t *pool, + fspr_table_entry_t **values, + fspr_size_t n) { /* Bottom-up mergesort, based on design in Sedgewick's "Algorithms * in C," chapter 8 */ - apr_table_entry_t **values_tmp = - (apr_table_entry_t **)apr_palloc(pool, n * sizeof(apr_table_entry_t*)); - apr_size_t i; - apr_size_t blocksize; + fspr_table_entry_t **values_tmp = + (fspr_table_entry_t **)fspr_palloc(pool, n * sizeof(fspr_table_entry_t*)); + fspr_size_t i; + fspr_size_t blocksize; /* First pass: sort pairs of elements (blocksize=1) */ for (i = 0; i + 1 < n; i += 2) { if (strcasecmp(values[i]->key, values[i + 1]->key) > 0) { - apr_table_entry_t *swap = values[i]; + fspr_table_entry_t *swap = values[i]; values[i] = values[i + 1]; values[i + 1] = swap; } @@ -990,9 +990,9 @@ static apr_table_entry_t **table_mergesort(apr_pool_t *pool, /* Merge successively larger blocks */ blocksize = 2; while (blocksize < n) { - apr_table_entry_t **dst = values_tmp; - apr_size_t next_start; - apr_table_entry_t **swap; + fspr_table_entry_t **dst = values_tmp; + fspr_size_t next_start; + fspr_table_entry_t **swap; /* Merge consecutive pairs blocks of the next blocksize. * Within a block, elements are in sorted order due to @@ -1001,10 +1001,10 @@ static apr_table_entry_t **table_mergesort(apr_pool_t *pool, for (next_start = 0; next_start + blocksize < n; next_start += (blocksize + blocksize)) { - apr_size_t block1_start = next_start; - apr_size_t block2_start = block1_start + blocksize; - apr_size_t block1_end = block2_start; - apr_size_t block2_end = block2_start + blocksize; + fspr_size_t block1_start = next_start; + fspr_size_t block2_start = block1_start + blocksize; + fspr_size_t block1_end = block2_start; + fspr_size_t block2_end = block2_start + blocksize; if (block2_end > n) { /* The last block may be smaller than blocksize */ block2_end = n; @@ -1060,13 +1060,13 @@ static apr_table_entry_t **table_mergesort(apr_pool_t *pool, return values; } -APR_DECLARE(void) apr_table_compress(apr_table_t *t, unsigned flags) +APR_DECLARE(void) fspr_table_compress(fspr_table_t *t, unsigned flags) { - apr_table_entry_t **sort_array; - apr_table_entry_t **sort_next; - apr_table_entry_t **sort_end; - apr_table_entry_t *table_next; - apr_table_entry_t **last; + fspr_table_entry_t **sort_array; + fspr_table_entry_t **sort_next; + fspr_table_entry_t **sort_end; + fspr_table_entry_t *table_next; + fspr_table_entry_t **last; int i; int dups_found; @@ -1078,10 +1078,10 @@ APR_DECLARE(void) apr_table_compress(apr_table_t *t, unsigned flags) * array and sort to allow for easy detection of * duplicate keys */ - sort_array = (apr_table_entry_t **) - apr_palloc(t->a.pool, t->a.nelts * sizeof(apr_table_entry_t*)); + sort_array = (fspr_table_entry_t **) + fspr_palloc(t->a.pool, t->a.nelts * sizeof(fspr_table_entry_t*)); sort_next = sort_array; - table_next = (apr_table_entry_t *)t->a.elts; + table_next = (fspr_table_entry_t *)t->a.elts; i = t->a.nelts; do { *sort_next++ = table_next++; @@ -1102,7 +1102,7 @@ APR_DECLARE(void) apr_table_compress(apr_table_t *t, unsigned flags) while (sort_next < sort_end) { if (((*sort_next)->key_checksum == (*last)->key_checksum) && !strcasecmp((*sort_next)->key, (*last)->key)) { - apr_table_entry_t **dup_last = sort_next + 1; + fspr_table_entry_t **dup_last = sort_next + 1; dups_found = 1; while ((dup_last < sort_end) && ((*dup_last)->key_checksum == (*last)->key_checksum) && @@ -1113,15 +1113,15 @@ APR_DECLARE(void) apr_table_compress(apr_table_t *t, unsigned flags) * all have the same key */ if (flags == APR_OVERLAP_TABLES_MERGE) { - apr_size_t len = 0; - apr_table_entry_t **next = last; + fspr_size_t len = 0; + fspr_table_entry_t **next = last; char *new_val; char *val_dst; do { len += strlen((*next)->val); len += 2; /* for ", " or trailing null */ } while (++next <= dup_last); - new_val = (char *)apr_palloc(t->a.pool, len); + new_val = (char *)fspr_palloc(t->a.pool, len); val_dst = new_val; next = last; for (;;) { @@ -1153,9 +1153,9 @@ APR_DECLARE(void) apr_table_compress(apr_table_t *t, unsigned flags) /* Shift elements to the left to fill holes left by removing duplicates */ if (dups_found) { - apr_table_entry_t *src = (apr_table_entry_t *)t->a.elts; - apr_table_entry_t *dst = (apr_table_entry_t *)t->a.elts; - apr_table_entry_t *last_elt = src + t->a.nelts; + fspr_table_entry_t *src = (fspr_table_entry_t *)t->a.elts; + fspr_table_entry_t *dst = (fspr_table_entry_t *)t->a.elts; + fspr_table_entry_t *last_elt = src + t->a.nelts; do { if (src->key) { *dst++ = *src; @@ -1167,12 +1167,12 @@ APR_DECLARE(void) apr_table_compress(apr_table_t *t, unsigned flags) table_reindex(t); } -static void apr_table_cat(apr_table_t *t, const apr_table_t *s) +static void fspr_table_cat(fspr_table_t *t, const fspr_table_t *s) { const int n = t->a.nelts; register int idx; - apr_array_cat(&t->a,&s->a); + fspr_array_cat(&t->a,&s->a); if (n == 0) { memcpy(t->index_first,s->index_first,sizeof(int) * TABLE_HASH_SIZE); @@ -1193,7 +1193,7 @@ static void apr_table_cat(apr_table_t *t, const apr_table_t *s) t->index_initialized |= s->index_initialized; } -APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, +APR_DECLARE(void) fspr_table_overlap(fspr_table_t *a, const fspr_table_t *b, unsigned flags) { if (a->a.nelts + b->a.nelts == 0) { @@ -1203,13 +1203,13 @@ APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, #if APR_POOL_DEBUG /* Since the keys and values are not copied, it's required that * b->a.pool has a lifetime at least as long as a->a.pool. */ - if (!apr_pool_is_ancestor(b->a.pool, a->a.pool)) { - fprintf(stderr, "apr_table_overlap: b's pool is not an ancestor of a's\n"); + if (!fspr_pool_is_ancestor(b->a.pool, a->a.pool)) { + fprintf(stderr, "fspr_table_overlap: b's pool is not an ancestor of a's\n"); abort(); } #endif - apr_table_cat(a, b); + fspr_table_cat(a, b); - apr_table_compress(a, flags); + fspr_table_compress(a, flags); } diff --git a/libs/apr/test/globalmutexchild.c b/libs/apr/test/globalmutexchild.c index 4b8737b02b..194cfb54ad 100644 --- a/libs/apr/test/globalmutexchild.c +++ b/libs/apr/test/globalmutexchild.c @@ -15,12 +15,12 @@ */ #include "testglobalmutex.h" -#include "apr_pools.h" -#include "apr_file_io.h" -#include "apr_general.h" -#include "apr_global_mutex.h" -#include "apr_strings.h" -#include "apr.h" +#include "fspr_pools.h" +#include "fspr_file_io.h" +#include "fspr_general.h" +#include "fspr_global_mutex.h" +#include "fspr_strings.h" +#include "fspr.h" #if APR_HAVE_STDLIB_H #include @@ -29,36 +29,36 @@ int main(int argc, const char * const argv[]) { - apr_pool_t *p; + fspr_pool_t *p; int i = 0; - apr_lockmech_e mech; - apr_global_mutex_t *global_lock; - apr_status_t rv; + fspr_lockmech_e mech; + fspr_global_mutex_t *global_lock; + fspr_status_t rv; - apr_initialize(); - atexit(apr_terminate); + fspr_initialize(); + atexit(fspr_terminate); - apr_pool_create(&p, NULL); + fspr_pool_create(&p, NULL); if (argc >= 2) { - mech = (apr_lockmech_e)apr_strtoi64(argv[1], NULL, 0); + mech = (fspr_lockmech_e)fspr_strtoi64(argv[1], NULL, 0); } else { mech = APR_LOCK_DEFAULT; } - rv = apr_global_mutex_create(&global_lock, LOCKNAME, mech, p); + rv = fspr_global_mutex_create(&global_lock, LOCKNAME, mech, p); if (rv != APR_SUCCESS) { exit(-rv); } - apr_global_mutex_child_init(&global_lock, LOCKNAME, p); + fspr_global_mutex_child_init(&global_lock, LOCKNAME, p); while (1) { - apr_global_mutex_lock(global_lock); + fspr_global_mutex_lock(global_lock); if (i == MAX_ITER) { - apr_global_mutex_unlock(global_lock); + fspr_global_mutex_unlock(global_lock); exit(i); } i++; - apr_global_mutex_unlock(global_lock); + fspr_global_mutex_unlock(global_lock); } exit(0); } diff --git a/libs/apr/test/internal/testregex.c b/libs/apr/test/internal/testregex.c index 20dcfdebe7..7a46b78364 100644 --- a/libs/apr/test/internal/testregex.c +++ b/libs/apr/test/internal/testregex.c @@ -15,25 +15,25 @@ */ -#include "apr_strings.h" -#include "apr_pools.h" -#include "apr_general.h" -#include "apr_hash.h" -#include "apr_lib.h" -#include "apr_time.h" +#include "fspr_strings.h" +#include "fspr_pools.h" +#include "fspr_general.h" +#include "fspr_hash.h" +#include "fspr_lib.h" +#include "fspr_time.h" #include #include #include int main( int argc, char** argv) { - apr_pool_t *context; + fspr_pool_t *context; regex_t regex; int rc; int i; int iters; - apr_time_t now; - apr_time_t end; - apr_hash_t *h; + fspr_time_t now; + fspr_time_t end; + fspr_hash_t *h; if (argc !=4 ) { @@ -42,9 +42,9 @@ int main( int argc, char** argv) { } iters = atoi( argv[3]); - apr_initialize() ; - atexit(apr_terminate); - if (apr_pool_create(&context, NULL) != APR_SUCCESS) { + fspr_initialize() ; + atexit(fspr_terminate); + if (fspr_pool_create(&context, NULL) != APR_SUCCESS) { fprintf(stderr, "Something went wrong\n"); exit(-1); } @@ -63,29 +63,29 @@ int main( int argc, char** argv) { else { fprintf(stderr,"No Match\n"); } - now = apr_time_now(); + now = fspr_time_now(); for (i=0;i #include @@ -54,15 +54,15 @@ void displaynw(struct testval *f, struct testval *l) void test_nrange(struct testval *p) { struct testval f, l, s; - apr_status_t rc; + fspr_status_t rc; int success = 0; memcpy (&s, p, sizeof(s)); ++s.nl; do { - apr_size_t nl = s.nl, wl = sizeof(s.w) / 2; - rc = apr_conv_utf8_to_ucs2(s.n, &nl, s.w, &wl); + fspr_size_t nl = s.nl, wl = sizeof(s.w) / 2; + rc = fspr_conv_utf8_to_ucs2(s.n, &nl, s.w, &wl); s.wl = (sizeof(s.w) / 2) - wl; if (!nl && rc == APR_SUCCESS) { if (!success) { @@ -106,15 +106,15 @@ void test_nrange(struct testval *p) void test_wrange(struct testval *p) { struct testval f, l, s; - apr_status_t rc; + fspr_status_t rc; int success = 0; memcpy (&s, p, sizeof(s)); ++s.wl; do { - apr_size_t nl = sizeof(s.n), wl = s.wl; - rc = apr_conv_ucs2_to_utf8(s.w, &wl, s.n, &nl); + fspr_size_t nl = sizeof(s.n), wl = s.wl; + rc = fspr_conv_ucs2_to_utf8(s.w, &wl, s.n, &nl); s.nl = sizeof(s.n) - nl; if (!wl && rc == APR_SUCCESS) { if (!success) { @@ -146,7 +146,7 @@ void test_wrange(struct testval *p) do { int wl = s.wl, nl = sizeof(s.n); - rc = apr_conv_ucs2_to_utf8(s.w, &wl, s.n, &nl); + rc = fspr_conv_ucs2_to_utf8(s.w, &wl, s.n, &nl); s.nl = sizeof(s.n) - s.nl; if (rc == APR_INCOMPLETE) { test_wrange(&s); @@ -164,11 +164,11 @@ int main(int argc, char **argv) struct testval s; memset (&s, 0, sizeof(s)); - if (argc < 2 || apr_tolower(*argv[1]) != 'w') { + if (argc < 2 || fspr_tolower(*argv[1]) != 'w') { printf ("\n\nTesting Narrow Char Ranges\n"); test_nrange(&s); } - if (argc < 2 || apr_tolower(*argv[1]) != 'n') { + if (argc < 2 || fspr_tolower(*argv[1]) != 'n') { printf ("\n\nTesting Wide Char Ranges\n"); test_wrange(&s); } diff --git a/libs/apr/test/mod_test.c b/libs/apr/test/mod_test.c index 2178e94059..ecae249f9f 100644 --- a/libs/apr/test/mod_test.c +++ b/libs/apr/test/mod_test.c @@ -14,14 +14,14 @@ * limitations under the License. */ -#include "apr_strings.h" +#include "fspr_strings.h" void print_hello(char str[256]); int count_reps(int reps); void print_hello(char str[256]) { - apr_cpystrn(str, "Hello - I'm a DSO!\n", strlen("Hello - I'm a DSO!\n") + 1); + fspr_cpystrn(str, "Hello - I'm a DSO!\n", strlen("Hello - I'm a DSO!\n") + 1); } int count_reps(int reps) diff --git a/libs/apr/test/occhild.c b/libs/apr/test/occhild.c index a96885d827..09954d1ac5 100644 --- a/libs/apr/test/occhild.c +++ b/libs/apr/test/occhild.c @@ -1,6 +1,6 @@ -#include "apr.h" -#include "apr_file_io.h" -#include "apr.h" +#include "fspr.h" +#include "fspr_file_io.h" +#include "fspr.h" #if APR_HAVE_STDLIB_H #include @@ -9,18 +9,18 @@ int main(void) { char buf[256]; - apr_file_t *err; - apr_pool_t *p; + fspr_file_t *err; + fspr_pool_t *p; - apr_initialize(); - atexit(apr_terminate); + fspr_initialize(); + atexit(fspr_terminate); - apr_pool_create(&p, NULL); - apr_file_open_stdin(&err, p); + fspr_pool_create(&p, NULL); + fspr_file_open_stdin(&err, p); while (1) { - apr_size_t length = 256; - apr_file_read(err, buf, &length); + fspr_size_t length = 256; + fspr_file_read(err, buf, &length); } exit(0); /* just to keep the compiler happy */ } diff --git a/libs/apr/test/proc_child.c b/libs/apr/test/proc_child.c index 405bb7f5b6..b712dddcee 100644 --- a/libs/apr/test/proc_child.c +++ b/libs/apr/test/proc_child.c @@ -1,4 +1,4 @@ -#include "apr.h" +#include "fspr.h" #include #if APR_HAVE_UNISTD_H #include @@ -11,7 +11,7 @@ int main(void) { char buf[256]; - apr_ssize_t bytes; + fspr_ssize_t bytes; bytes = read(STDIN_FILENO, buf, 256); if (bytes > 0) diff --git a/libs/apr/test/readchild.c b/libs/apr/test/readchild.c index f8443cceb8..92eb1af06c 100644 --- a/libs/apr/test/readchild.c +++ b/libs/apr/test/readchild.c @@ -16,31 +16,31 @@ #include -#include "apr_file_io.h" +#include "fspr_file_io.h" int main(int argc, char *argv[]) { - apr_file_t *in, *out; - apr_size_t nbytes, total_bytes; - apr_pool_t *p; + fspr_file_t *in, *out; + fspr_size_t nbytes, total_bytes; + fspr_pool_t *p; char buf[128]; - apr_status_t rv; + fspr_status_t rv; - apr_initialize(); - atexit(apr_terminate); - apr_pool_create(&p, NULL); + fspr_initialize(); + atexit(fspr_terminate); + fspr_pool_create(&p, NULL); - apr_file_open_stdin(&in, p); - apr_file_open_stdout(&out, p); + fspr_file_open_stdin(&in, p); + fspr_file_open_stdout(&out, p); total_bytes = 0; nbytes = sizeof(buf); - while ((rv = apr_file_read(in, buf, &nbytes)) == APR_SUCCESS) { + while ((rv = fspr_file_read(in, buf, &nbytes)) == APR_SUCCESS) { total_bytes += nbytes; nbytes = sizeof(buf); } - apr_file_printf(out, "%" APR_SIZE_T_FMT " bytes were read\n", + fspr_file_printf(out, "%" APR_SIZE_T_FMT " bytes were read\n", total_bytes); return 0; } diff --git a/libs/apr/test/sendfile.c b/libs/apr/test/sendfile.c index cfa1fb8a76..a788ba98b9 100644 --- a/libs/apr/test/sendfile.c +++ b/libs/apr/test/sendfile.c @@ -19,10 +19,10 @@ #include #include #include -#include "apr_network_io.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_poll.h" +#include "fspr_network_io.h" +#include "fspr_errno.h" +#include "fspr_general.h" +#include "fspr_poll.h" #if !APR_HAS_SENDFILE int main(void) @@ -53,103 +53,103 @@ int main(void) typedef enum {BLK, NONBLK, TIMEOUT} client_socket_mode_t; -static void apr_setup(apr_pool_t **p, apr_socket_t **sock, int *family) +static void fspr_setup(fspr_pool_t **p, fspr_socket_t **sock, int *family) { char buf[120]; - apr_status_t rv; + fspr_status_t rv; - rv = apr_initialize(); + rv = fspr_initialize(); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_initialize()->%d/%s\n", + fprintf(stderr, "fspr_initialize()->%d/%s\n", rv, - apr_strerror(rv, buf, sizeof buf)); + fspr_strerror(rv, buf, sizeof buf)); exit(1); } - atexit(apr_terminate); + atexit(fspr_terminate); - rv = apr_pool_create(p, NULL); + rv = fspr_pool_create(p, NULL); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_pool_create()->%d/%s\n", + fprintf(stderr, "fspr_pool_create()->%d/%s\n", rv, - apr_strerror(rv, buf, sizeof buf)); + fspr_strerror(rv, buf, sizeof buf)); exit(1); } *sock = NULL; - rv = apr_socket_create(sock, *family, SOCK_STREAM, 0, *p); + rv = fspr_socket_create(sock, *family, SOCK_STREAM, 0, *p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_create()->%d/%s\n", + fprintf(stderr, "fspr_socket_create()->%d/%s\n", rv, - apr_strerror(rv, buf, sizeof buf)); + fspr_strerror(rv, buf, sizeof buf)); exit(1); } if (*family == APR_UNSPEC) { - apr_sockaddr_t *localsa; + fspr_sockaddr_t *localsa; - rv = apr_socket_addr_get(&localsa, APR_LOCAL, *sock); + rv = fspr_socket_addr_get(&localsa, APR_LOCAL, *sock); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_addr_get()->%d/%s\n", + fprintf(stderr, "fspr_socket_addr_get()->%d/%s\n", rv, - apr_strerror(rv, buf, sizeof buf)); + fspr_strerror(rv, buf, sizeof buf)); exit(1); } *family = localsa->family; } } -static void create_testfile(apr_pool_t *p, const char *fname) +static void create_testfile(fspr_pool_t *p, const char *fname) { - apr_file_t *f = NULL; - apr_status_t rv; + fspr_file_t *f = NULL; + fspr_status_t rv; char buf[120]; int i; - apr_finfo_t finfo; + fspr_finfo_t finfo; printf("Creating a test file...\n"); - rv = apr_file_open(&f, fname, + rv = fspr_file_open(&f, fname, APR_CREATE | APR_WRITE | APR_TRUNCATE | APR_BUFFERED, APR_UREAD | APR_UWRITE, p); if (rv) { - fprintf(stderr, "apr_file_open()->%d/%s\n", - rv, apr_strerror(rv, buf, sizeof buf)); + fprintf(stderr, "fspr_file_open()->%d/%s\n", + rv, fspr_strerror(rv, buf, sizeof buf)); exit(1); } buf[0] = FILE_DATA_CHAR; buf[1] = '\0'; for (i = 0; i < FILE_LENGTH; i++) { - /* exercise apr_file_putc() and apr_file_puts() on buffered files */ + /* exercise fspr_file_putc() and fspr_file_puts() on buffered files */ if ((i % 2) == 0) { - rv = apr_file_putc(buf[0], f); + rv = fspr_file_putc(buf[0], f); if (rv) { - fprintf(stderr, "apr_file_putc()->%d/%s\n", - rv, apr_strerror(rv, buf, sizeof buf)); + fprintf(stderr, "fspr_file_putc()->%d/%s\n", + rv, fspr_strerror(rv, buf, sizeof buf)); exit(1); } } else { - rv = apr_file_puts(buf, f); + rv = fspr_file_puts(buf, f); if (rv) { - fprintf(stderr, "apr_file_puts()->%d/%s\n", - rv, apr_strerror(rv, buf, sizeof buf)); + fprintf(stderr, "fspr_file_puts()->%d/%s\n", + rv, fspr_strerror(rv, buf, sizeof buf)); exit(1); } } } - rv = apr_file_close(f); + rv = fspr_file_close(f); if (rv) { - fprintf(stderr, "apr_file_close()->%d/%s\n", - rv, apr_strerror(rv, buf, sizeof buf)); + fprintf(stderr, "fspr_file_close()->%d/%s\n", + rv, fspr_strerror(rv, buf, sizeof buf)); exit(1); } - rv = apr_stat(&finfo, fname, APR_FINFO_NORM, p); + rv = fspr_stat(&finfo, fname, APR_FINFO_NORM, p); if (rv != APR_SUCCESS && rv != APR_INCOMPLETE) { - fprintf(stderr, "apr_stat()->%d/%s\n", - rv, apr_strerror(rv, buf, sizeof buf)); + fprintf(stderr, "fspr_stat()->%d/%s\n", + rv, fspr_strerror(rv, buf, sizeof buf)); exit(1); } @@ -166,52 +166,52 @@ static void create_testfile(apr_pool_t *p, const char *fname) static int client(client_socket_mode_t socket_mode, char *host) { - apr_status_t rv, tmprv; - apr_socket_t *sock; - apr_pool_t *p; + fspr_status_t rv, tmprv; + fspr_socket_t *sock; + fspr_pool_t *p; char buf[120]; - apr_file_t *f = NULL; - apr_size_t len; - apr_size_t expected_len; - apr_off_t current_file_offset; - apr_hdtr_t hdtr; + fspr_file_t *f = NULL; + fspr_size_t len; + fspr_size_t expected_len; + fspr_off_t current_file_offset; + fspr_hdtr_t hdtr; struct iovec headers[3]; struct iovec trailers[3]; - apr_size_t bytes_read; - apr_pollset_t *pset; - apr_int32_t nsocks; + fspr_size_t bytes_read; + fspr_pollset_t *pset; + fspr_int32_t nsocks; int i; int family; - apr_sockaddr_t *destsa; + fspr_sockaddr_t *destsa; family = APR_INET; - apr_setup(&p, &sock, &family); + fspr_setup(&p, &sock, &family); create_testfile(p, TESTFILE); - rv = apr_file_open(&f, TESTFILE, APR_READ, 0, p); + rv = fspr_file_open(&f, TESTFILE, APR_READ, 0, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_file_open()->%d/%s\n", + fprintf(stderr, "fspr_file_open()->%d/%s\n", rv, - apr_strerror(rv, buf, sizeof buf)); + fspr_strerror(rv, buf, sizeof buf)); exit(1); } if (!host) { host = "127.0.0.1"; } - rv = apr_sockaddr_info_get(&destsa, host, family, TESTSF_PORT, 0, p); + rv = fspr_sockaddr_info_get(&destsa, host, family, TESTSF_PORT, 0, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_sockaddr_info_get()->%d/%s\n", + fprintf(stderr, "fspr_sockaddr_info_get()->%d/%s\n", rv, - apr_strerror(rv, buf, sizeof buf)); + fspr_strerror(rv, buf, sizeof buf)); exit(1); } - rv = apr_socket_connect(sock, destsa); + rv = fspr_socket_connect(sock, destsa); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_connect()->%d/%s\n", + fprintf(stderr, "fspr_socket_connect()->%d/%s\n", rv, - apr_strerror(rv, buf, sizeof buf)); + fspr_strerror(rv, buf, sizeof buf)); exit(1); } @@ -221,21 +221,21 @@ static int client(client_socket_mode_t socket_mode, char *host) break; case NONBLK: /* set it non-blocking */ - rv = apr_socket_opt_set(sock, APR_SO_NONBLOCK, 1); + rv = fspr_socket_opt_set(sock, APR_SO_NONBLOCK, 1); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_opt_set(APR_SO_NONBLOCK)->%d/%s\n", + fprintf(stderr, "fspr_socket_opt_set(APR_SO_NONBLOCK)->%d/%s\n", rv, - apr_strerror(rv, buf, sizeof buf)); + fspr_strerror(rv, buf, sizeof buf)); exit(1); } break; case TIMEOUT: /* set a timeout */ - rv = apr_socket_timeout_set(sock, 100 * APR_USEC_PER_SEC); + rv = fspr_socket_timeout_set(sock, 100 * APR_USEC_PER_SEC); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_opt_set(APR_SO_NONBLOCK)->%d/%s\n", + fprintf(stderr, "fspr_socket_opt_set(APR_SO_NONBLOCK)->%d/%s\n", rv, - apr_strerror(rv, buf, sizeof buf)); + fspr_strerror(rv, buf, sizeof buf)); exit(1); } break; @@ -275,36 +275,36 @@ static int client(client_socket_mode_t socket_mode, char *host) if (socket_mode == BLK) { current_file_offset = 0; len = FILE_LENGTH; - rv = apr_socket_sendfile(sock, f, &hdtr, ¤t_file_offset, &len, 0); + rv = fspr_socket_sendfile(sock, f, &hdtr, ¤t_file_offset, &len, 0); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_sendfile()->%d/%s\n", + fprintf(stderr, "fspr_socket_sendfile()->%d/%s\n", rv, - apr_strerror(rv, buf, sizeof buf)); + fspr_strerror(rv, buf, sizeof buf)); exit(1); } - printf("apr_socket_sendfile() updated offset with %ld\n", + printf("fspr_socket_sendfile() updated offset with %ld\n", (long int)current_file_offset); - printf("apr_socket_sendfile() updated len with %ld\n", + printf("fspr_socket_sendfile() updated len with %ld\n", (long int)len); printf("bytes really sent: %" APR_SIZE_T_FMT "\n", expected_len); if (len != expected_len) { - fprintf(stderr, "apr_socket_sendfile() didn't report the correct " + fprintf(stderr, "fspr_socket_sendfile() didn't report the correct " "number of bytes sent!\n"); exit(1); } } else { /* non-blocking... wooooooo */ - apr_size_t total_bytes_sent; - apr_pollfd_t pfd; + fspr_size_t total_bytes_sent; + fspr_pollfd_t pfd; pset = NULL; - rv = apr_pollset_create(&pset, 1, p, 0); + rv = fspr_pollset_create(&pset, 1, p, 0); assert(!rv); pfd.p = p; pfd.desc_type = APR_POLL_SOCKET; @@ -313,17 +313,17 @@ static int client(client_socket_mode_t socket_mode, char *host) pfd.desc.s = sock; pfd.client_data = NULL; - rv = apr_pollset_add(pset, &pfd); + rv = fspr_pollset_add(pset, &pfd); assert(!rv); total_bytes_sent = 0; current_file_offset = 0; len = FILE_LENGTH; do { - apr_size_t tmplen; + fspr_size_t tmplen; tmplen = len; /* bytes remaining to send from the file */ - printf("Calling apr_socket_sendfile()...\n"); + printf("Calling fspr_socket_sendfile()...\n"); printf("Headers (%d):\n", hdtr.numheaders); for (i = 0; i < hdtr.numheaders; i++) { printf("\t%ld bytes (%c)\n", @@ -338,13 +338,13 @@ static int client(client_socket_mode_t socket_mode, char *host) (long)hdtr.trailers[i].iov_len); } - rv = apr_socket_sendfile(sock, f, &hdtr, ¤t_file_offset, &tmplen, 0); - printf("apr_socket_sendfile()->%d, sent %ld bytes\n", rv, (long)tmplen); + rv = fspr_socket_sendfile(sock, f, &hdtr, ¤t_file_offset, &tmplen, 0); + printf("fspr_socket_sendfile()->%d, sent %ld bytes\n", rv, (long)tmplen); if (rv) { if (APR_STATUS_IS_EAGAIN(rv)) { assert(tmplen == 0); nsocks = 1; - tmprv = apr_pollset_poll(pset, -1, &nsocks, NULL); + tmprv = fspr_pollset_poll(pset, -1, &nsocks, NULL); assert(!tmprv); assert(nsocks == 1); /* continue; */ @@ -426,43 +426,43 @@ static int client(client_socket_mode_t socket_mode, char *host) } current_file_offset = 0; - rv = apr_file_seek(f, APR_CUR, ¤t_file_offset); + rv = fspr_file_seek(f, APR_CUR, ¤t_file_offset); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_file_seek()->%d/%s\n", + fprintf(stderr, "fspr_file_seek()->%d/%s\n", rv, - apr_strerror(rv, buf, sizeof buf)); + fspr_strerror(rv, buf, sizeof buf)); exit(1); } - printf("After apr_socket_sendfile(), the kernel file pointer is " + printf("After fspr_socket_sendfile(), the kernel file pointer is " "at offset %ld.\n", (long int)current_file_offset); - rv = apr_socket_shutdown(sock, APR_SHUTDOWN_WRITE); + rv = fspr_socket_shutdown(sock, APR_SHUTDOWN_WRITE); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_shutdown()->%d/%s\n", + fprintf(stderr, "fspr_socket_shutdown()->%d/%s\n", rv, - apr_strerror(rv, buf, sizeof buf)); + fspr_strerror(rv, buf, sizeof buf)); exit(1); } /* in case this is the non-blocking test, set socket timeout; * we're just waiting for EOF */ - rv = apr_socket_timeout_set(sock, apr_time_from_sec(3)); + rv = fspr_socket_timeout_set(sock, fspr_time_from_sec(3)); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_timeout_set()->%d/%s\n", + fprintf(stderr, "fspr_socket_timeout_set()->%d/%s\n", rv, - apr_strerror(rv, buf, sizeof buf)); + fspr_strerror(rv, buf, sizeof buf)); exit(1); } bytes_read = 1; - rv = apr_socket_recv(sock, buf, &bytes_read); + rv = fspr_socket_recv(sock, buf, &bytes_read); if (rv != APR_EOF) { - fprintf(stderr, "apr_socket_recv()->%d/%s (expected APR_EOF)\n", + fprintf(stderr, "fspr_socket_recv()->%d/%s (expected APR_EOF)\n", rv, - apr_strerror(rv, buf, sizeof buf)); + fspr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != 0) { @@ -472,13 +472,13 @@ static int client(client_socket_mode_t socket_mode, char *host) exit(1); } - printf("client: apr_socket_sendfile() worked as expected!\n"); + printf("client: fspr_socket_sendfile() worked as expected!\n"); - rv = apr_file_remove(TESTFILE, p); + rv = fspr_file_remove(TESTFILE, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_file_remove()->%d/%s\n", + fprintf(stderr, "fspr_file_remove()->%d/%s\n", rv, - apr_strerror(rv, buf, sizeof buf)); + fspr_strerror(rv, buf, sizeof buf)); exit(1); } @@ -487,58 +487,58 @@ static int client(client_socket_mode_t socket_mode, char *host) static int server(void) { - apr_status_t rv; - apr_socket_t *sock; - apr_pool_t *p; + fspr_status_t rv; + fspr_socket_t *sock; + fspr_pool_t *p; char buf[120]; int i; - apr_socket_t *newsock = NULL; - apr_size_t bytes_read; - apr_sockaddr_t *localsa; + fspr_socket_t *newsock = NULL; + fspr_size_t bytes_read; + fspr_sockaddr_t *localsa; int family; family = APR_UNSPEC; - apr_setup(&p, &sock, &family); + fspr_setup(&p, &sock, &family); - rv = apr_socket_opt_set(sock, APR_SO_REUSEADDR, 1); + rv = fspr_socket_opt_set(sock, APR_SO_REUSEADDR, 1); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_opt_set()->%d/%s\n", + fprintf(stderr, "fspr_socket_opt_set()->%d/%s\n", rv, - apr_strerror(rv, buf, sizeof buf)); + fspr_strerror(rv, buf, sizeof buf)); exit(1); } - rv = apr_sockaddr_info_get(&localsa, NULL, family, TESTSF_PORT, 0, p); + rv = fspr_sockaddr_info_get(&localsa, NULL, family, TESTSF_PORT, 0, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_sockaddr_info_get()->%d/%s\n", + fprintf(stderr, "fspr_sockaddr_info_get()->%d/%s\n", rv, - apr_strerror(rv, buf, sizeof buf)); + fspr_strerror(rv, buf, sizeof buf)); exit(1); } - rv = apr_socket_bind(sock, localsa); + rv = fspr_socket_bind(sock, localsa); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_bind()->%d/%s\n", + fprintf(stderr, "fspr_socket_bind()->%d/%s\n", rv, - apr_strerror(rv, buf, sizeof buf)); + fspr_strerror(rv, buf, sizeof buf)); exit(1); } - rv = apr_socket_listen(sock, 5); + rv = fspr_socket_listen(sock, 5); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_listen()->%d/%s\n", + fprintf(stderr, "fspr_socket_listen()->%d/%s\n", rv, - apr_strerror(rv, buf, sizeof buf)); + fspr_strerror(rv, buf, sizeof buf)); exit(1); } printf("Waiting for a client to connect...\n"); - rv = apr_socket_accept(&newsock, sock, p); + rv = fspr_socket_accept(&newsock, sock, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_accept()->%d/%s\n", + fprintf(stderr, "fspr_socket_accept()->%d/%s\n", rv, - apr_strerror(rv, buf, sizeof buf)); + fspr_strerror(rv, buf, sizeof buf)); exit(1); } @@ -546,11 +546,11 @@ static int server(void) assert(sizeof buf > strlen(HDR1)); bytes_read = strlen(HDR1); - rv = apr_socket_recv(newsock, buf, &bytes_read); + rv = fspr_socket_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_recv()->%d/%s\n", + fprintf(stderr, "fspr_socket_recv()->%d/%s\n", rv, - apr_strerror(rv, buf, sizeof buf)); + fspr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != strlen(HDR1)) { @@ -566,11 +566,11 @@ static int server(void) assert(sizeof buf > strlen(HDR2)); bytes_read = strlen(HDR2); - rv = apr_socket_recv(newsock, buf, &bytes_read); + rv = fspr_socket_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_recv()->%d/%s\n", + fprintf(stderr, "fspr_socket_recv()->%d/%s\n", rv, - apr_strerror(rv, buf, sizeof buf)); + fspr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != strlen(HDR2)) { @@ -586,15 +586,15 @@ static int server(void) for (i = 0; i < HDR3_LEN; i++) { bytes_read = 1; - rv = apr_socket_recv(newsock, buf, &bytes_read); + rv = fspr_socket_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_recv()->%d/%s\n", + fprintf(stderr, "fspr_socket_recv()->%d/%s\n", rv, - apr_strerror(rv, buf, sizeof buf)); + fspr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != 1) { - fprintf(stderr, "apr_socket_recv()->%ld bytes instead of 1\n", + fprintf(stderr, "fspr_socket_recv()->%ld bytes instead of 1\n", (long int)bytes_read); exit(1); } @@ -611,15 +611,15 @@ static int server(void) for (i = 0; i < FILE_LENGTH; i++) { bytes_read = 1; - rv = apr_socket_recv(newsock, buf, &bytes_read); + rv = fspr_socket_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_recv()->%d/%s\n", + fprintf(stderr, "fspr_socket_recv()->%d/%s\n", rv, - apr_strerror(rv, buf, sizeof buf)); + fspr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != 1) { - fprintf(stderr, "apr_socket_recv()->%ld bytes instead of 1\n", + fprintf(stderr, "fspr_socket_recv()->%ld bytes instead of 1\n", (long int)bytes_read); exit(1); } @@ -636,11 +636,11 @@ static int server(void) assert(sizeof buf > strlen(TRL1)); bytes_read = strlen(TRL1); - rv = apr_socket_recv(newsock, buf, &bytes_read); + rv = fspr_socket_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_recv()->%d/%s\n", + fprintf(stderr, "fspr_socket_recv()->%d/%s\n", rv, - apr_strerror(rv, buf, sizeof buf)); + fspr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != strlen(TRL1)) { @@ -656,11 +656,11 @@ static int server(void) assert(sizeof buf > strlen(TRL2)); bytes_read = strlen(TRL2); - rv = apr_socket_recv(newsock, buf, &bytes_read); + rv = fspr_socket_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_recv()->%d/%s\n", + fprintf(stderr, "fspr_socket_recv()->%d/%s\n", rv, - apr_strerror(rv, buf, sizeof buf)); + fspr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != strlen(TRL2)) { @@ -676,15 +676,15 @@ static int server(void) for (i = 0; i < TRL3_LEN; i++) { bytes_read = 1; - rv = apr_socket_recv(newsock, buf, &bytes_read); + rv = fspr_socket_recv(newsock, buf, &bytes_read); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_socket_recv()->%d/%s\n", + fprintf(stderr, "fspr_socket_recv()->%d/%s\n", rv, - apr_strerror(rv, buf, sizeof buf)); + fspr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != 1) { - fprintf(stderr, "apr_socket_recv()->%ld bytes instead of 1\n", + fprintf(stderr, "fspr_socket_recv()->%ld bytes instead of 1\n", (long int)bytes_read); exit(1); } @@ -700,11 +700,11 @@ static int server(void) } bytes_read = 1; - rv = apr_socket_recv(newsock, buf, &bytes_read); + rv = fspr_socket_recv(newsock, buf, &bytes_read); if (rv != APR_EOF) { - fprintf(stderr, "apr_socket_recv()->%d/%s (expected APR_EOF)\n", + fprintf(stderr, "fspr_socket_recv()->%d/%s (expected APR_EOF)\n", rv, - apr_strerror(rv, buf, sizeof buf)); + fspr_strerror(rv, buf, sizeof buf)); exit(1); } if (bytes_read != 0) { @@ -714,7 +714,7 @@ static int server(void) exit(1); } - printf("server: apr_socket_sendfile() worked as expected!\n"); + printf("server: fspr_socket_sendfile() worked as expected!\n"); return 0; } diff --git a/libs/apr/test/sockchild.c b/libs/apr/test/sockchild.c index 5c15d113fb..d1d5e3a8b4 100644 --- a/libs/apr/test/sockchild.c +++ b/libs/apr/test/sockchild.c @@ -16,49 +16,49 @@ #include #include "testsock.h" -#include "apr_network_io.h" -#include "apr_pools.h" +#include "fspr_network_io.h" +#include "fspr_pools.h" int main(int argc, char *argv[]) { - apr_pool_t *p; - apr_socket_t *sock; - apr_status_t rv; - apr_sockaddr_t *remote_sa; + fspr_pool_t *p; + fspr_socket_t *sock; + fspr_status_t rv; + fspr_sockaddr_t *remote_sa; - apr_initialize(); - atexit(apr_terminate); - apr_pool_create(&p, NULL); + fspr_initialize(); + atexit(fspr_terminate); + fspr_pool_create(&p, NULL); if (argc < 2) { exit(-1); } - rv = apr_sockaddr_info_get(&remote_sa, "127.0.0.1", APR_UNSPEC, 8021, 0, p); + rv = fspr_sockaddr_info_get(&remote_sa, "127.0.0.1", APR_UNSPEC, 8021, 0, p); if (rv != APR_SUCCESS) { exit(-1); } - if (apr_socket_create(&sock, remote_sa->family, SOCK_STREAM, 0, + if (fspr_socket_create(&sock, remote_sa->family, SOCK_STREAM, 0, p) != APR_SUCCESS) { exit(-1); } - rv = apr_socket_timeout_set(sock, apr_time_from_sec(3)); + rv = fspr_socket_timeout_set(sock, fspr_time_from_sec(3)); if (rv) { exit(-1); } - apr_socket_connect(sock, remote_sa); + fspr_socket_connect(sock, remote_sa); if (!strcmp("read", argv[1])) { char datarecv[STRLEN]; - apr_size_t length = STRLEN; - apr_status_t rv; + fspr_size_t length = STRLEN; + fspr_status_t rv; memset(datarecv, 0, STRLEN); - rv = apr_socket_recv(sock, datarecv, &length); - apr_socket_close(sock); + rv = fspr_socket_recv(sock, datarecv, &length); + fspr_socket_close(sock); if (APR_STATUS_IS_TIMEUP(rv)) { exit(SOCKET_TIMEOUT); } @@ -70,10 +70,10 @@ int main(int argc, char *argv[]) exit(length); } else if (!strcmp("write", argv[1])) { - apr_size_t length = strlen(DATASTR); - apr_socket_send(sock, DATASTR, &length); + fspr_size_t length = strlen(DATASTR); + fspr_socket_send(sock, DATASTR, &length); - apr_socket_close(sock); + fspr_socket_close(sock); exit(length); } exit(-1); diff --git a/libs/apr/test/testapp.c b/libs/apr/test/testapp.c index 77607aa388..53b3dfedb3 100644 --- a/libs/apr/test/testapp.c +++ b/libs/apr/test/testapp.c @@ -1,10 +1,10 @@ -#include -#include +#include +#include int main(int argc, const char * const * argv, const char * const *env) { - apr_app_initialize(&argc, &argv, &env); + fspr_app_initialize(&argc, &argv, &env); - apr_terminate(); + fspr_terminate(); } diff --git a/libs/apr/test/testargs.c b/libs/apr/test/testargs.c index cb501924f1..9aab69e4f2 100644 --- a/libs/apr/test/testargs.c +++ b/libs/apr/test/testargs.c @@ -14,19 +14,19 @@ * limitations under the License. */ -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_getopt.h" -#include "apr_strings.h" +#include "fspr_errno.h" +#include "fspr_general.h" +#include "fspr_getopt.h" +#include "fspr_strings.h" #include "testutil.h" static void format_arg(char *str, char option, const char *arg) { if (arg) { - apr_snprintf(str, 8196, "%soption: %c with %s\n", str, option, arg); + fspr_snprintf(str, 8196, "%soption: %c with %s\n", str, option, arg); } else { - apr_snprintf(str, 8196, "%soption: %c\n", str, option); + fspr_snprintf(str, 8196, "%soption: %c\n", str, option); } } @@ -35,7 +35,7 @@ static void unknown_arg(void *str, const char *err, ...) va_list va; va_start(va, err); - apr_vsnprintf(str, 8196, err, va); + fspr_vsnprintf(str, 8196, err, va); va_end(va); } @@ -43,17 +43,17 @@ static void no_options_found(abts_case *tc, void *data) { int largc = 5; const char * const largv[] = {"testprog", "-a", "-b", "-c", "-d"}; - apr_getopt_t *opt; - apr_status_t rv; + fspr_getopt_t *opt; + fspr_status_t rv; char ch; const char *optarg; char str[8196]; str[0] = '\0'; - rv = apr_getopt_init(&opt, p, largc, largv); + rv = fspr_getopt_init(&opt, p, largc, largv); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - while (apr_getopt(opt, "abcd", &ch, &optarg) == APR_SUCCESS) { + while (fspr_getopt(opt, "abcd", &ch, &optarg) == APR_SUCCESS) { switch (ch) { case 'a': case 'b': @@ -73,20 +73,20 @@ static void no_options(abts_case *tc, void *data) { int largc = 5; const char * const largv[] = {"testprog", "-a", "-b", "-c", "-d"}; - apr_getopt_t *opt; - apr_status_t rv; + fspr_getopt_t *opt; + fspr_status_t rv; char ch; const char *optarg; char str[8196]; str[0] = '\0'; - rv = apr_getopt_init(&opt, p, largc, largv); + rv = fspr_getopt_init(&opt, p, largc, largv); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); opt->errfn = unknown_arg; opt->errarg = str; - while (apr_getopt(opt, "efgh", &ch, &optarg) == APR_SUCCESS) { + while (fspr_getopt(opt, "efgh", &ch, &optarg) == APR_SUCCESS) { switch (ch) { case 'a': case 'b': @@ -105,20 +105,20 @@ static void required_option(abts_case *tc, void *data) { int largc = 3; const char * const largv[] = {"testprog", "-a", "foo"}; - apr_getopt_t *opt; - apr_status_t rv; + fspr_getopt_t *opt; + fspr_status_t rv; char ch; const char *optarg; char str[8196]; str[0] = '\0'; - rv = apr_getopt_init(&opt, p, largc, largv); + rv = fspr_getopt_init(&opt, p, largc, largv); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); opt->errfn = unknown_arg; opt->errarg = str; - while (apr_getopt(opt, "a:", &ch, &optarg) == APR_SUCCESS) { + while (fspr_getopt(opt, "a:", &ch, &optarg) == APR_SUCCESS) { switch (ch) { case 'a': format_arg(str, ch, optarg); @@ -134,20 +134,20 @@ static void required_option_notgiven(abts_case *tc, void *data) { int largc = 2; const char * const largv[] = {"testprog", "-a"}; - apr_getopt_t *opt; - apr_status_t rv; + fspr_getopt_t *opt; + fspr_status_t rv; char ch; const char *optarg; char str[8196]; str[0] = '\0'; - rv = apr_getopt_init(&opt, p, largc, largv); + rv = fspr_getopt_init(&opt, p, largc, largv); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); opt->errfn = unknown_arg; opt->errarg = str; - while (apr_getopt(opt, "a:", &ch, &optarg) == APR_SUCCESS) { + while (fspr_getopt(opt, "a:", &ch, &optarg) == APR_SUCCESS) { switch (ch) { case 'a': format_arg(str, ch, optarg); @@ -163,20 +163,20 @@ static void optional_option(abts_case *tc, void *data) { int largc = 3; const char * const largv[] = {"testprog", "-a", "foo"}; - apr_getopt_t *opt; - apr_status_t rv; + fspr_getopt_t *opt; + fspr_status_t rv; char ch; const char *optarg; char str[8196]; str[0] = '\0'; - rv = apr_getopt_init(&opt, p, largc, largv); + rv = fspr_getopt_init(&opt, p, largc, largv); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); opt->errfn = unknown_arg; opt->errarg = str; - while (apr_getopt(opt, "a::", &ch, &optarg) == APR_SUCCESS) { + while (fspr_getopt(opt, "a::", &ch, &optarg) == APR_SUCCESS) { switch (ch) { case 'a': format_arg(str, ch, optarg); @@ -192,20 +192,20 @@ static void optional_option_notgiven(abts_case *tc, void *data) { int largc = 2; const char * const largv[] = {"testprog", "-a"}; - apr_getopt_t *opt; - apr_status_t rv; + fspr_getopt_t *opt; + fspr_status_t rv; char ch; const char *optarg; char str[8196]; str[0] = '\0'; - rv = apr_getopt_init(&opt, p, largc, largv); + rv = fspr_getopt_init(&opt, p, largc, largv); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); opt->errfn = unknown_arg; opt->errarg = str; - while (apr_getopt(opt, "a::", &ch, &optarg) == APR_SUCCESS) { + while (fspr_getopt(opt, "a::", &ch, &optarg) == APR_SUCCESS) { switch (ch) { case 'a': format_arg(str, ch, optarg); diff --git a/libs/apr/test/testatomic.c b/libs/apr/test/testatomic.c index 7fae5c759f..c3ae095798 100644 --- a/libs/apr/test/testatomic.c +++ b/libs/apr/test/testatomic.c @@ -15,12 +15,12 @@ */ #include "testutil.h" -#include "apr_strings.h" -#include "apr_thread_proc.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_atomic.h" -#include "apr_time.h" +#include "fspr_strings.h" +#include "fspr_thread_proc.h" +#include "fspr_errno.h" +#include "fspr_general.h" +#include "fspr_atomic.h" +#include "fspr_time.h" /* Use pthread_setconcurrency where it is available and not a nullop, * i.e. platforms using M:N or M:1 thread models: */ @@ -36,46 +36,46 @@ static void test_init(abts_case *tc, void *data) { - APR_ASSERT_SUCCESS(tc, "Could not initliaze atomics", apr_atomic_init(p)); + APR_ASSERT_SUCCESS(tc, "Could not initliaze atomics", fspr_atomic_init(p)); } static void test_set32(abts_case *tc, void *data) { - apr_uint32_t y32; - apr_atomic_set32(&y32, 2); + fspr_uint32_t y32; + fspr_atomic_set32(&y32, 2); ABTS_INT_EQUAL(tc, 2, y32); } static void test_read32(abts_case *tc, void *data) { - apr_uint32_t y32; - apr_atomic_set32(&y32, 2); - ABTS_INT_EQUAL(tc, 2, apr_atomic_read32(&y32)); + fspr_uint32_t y32; + fspr_atomic_set32(&y32, 2); + ABTS_INT_EQUAL(tc, 2, fspr_atomic_read32(&y32)); } static void test_dec32(abts_case *tc, void *data) { - apr_uint32_t y32; + fspr_uint32_t y32; int rv; - apr_atomic_set32(&y32, 2); + fspr_atomic_set32(&y32, 2); - rv = apr_atomic_dec32(&y32); + rv = fspr_atomic_dec32(&y32); ABTS_INT_EQUAL(tc, 1, y32); ABTS_ASSERT(tc, "atomic_dec returned zero when it shouldn't", rv != 0); - rv = apr_atomic_dec32(&y32); + rv = fspr_atomic_dec32(&y32); ABTS_INT_EQUAL(tc, 0, y32); ABTS_ASSERT(tc, "atomic_dec didn't returned zero when it should", rv == 0); } static void test_xchg32(abts_case *tc, void *data) { - apr_uint32_t oldval; - apr_uint32_t y32; + fspr_uint32_t oldval; + fspr_uint32_t y32; - apr_atomic_set32(&y32, 100); - oldval = apr_atomic_xchg32(&y32, 50); + fspr_atomic_set32(&y32, 100); + oldval = fspr_atomic_xchg32(&y32, 50); ABTS_INT_EQUAL(tc, 100, oldval); ABTS_INT_EQUAL(tc, 50, y32); @@ -83,182 +83,182 @@ static void test_xchg32(abts_case *tc, void *data) static void test_cas_equal(abts_case *tc, void *data) { - apr_uint32_t casval = 0; - apr_uint32_t oldval; + fspr_uint32_t casval = 0; + fspr_uint32_t oldval; - oldval = apr_atomic_cas32(&casval, 12, 0); + oldval = fspr_atomic_cas32(&casval, 12, 0); ABTS_INT_EQUAL(tc, 0, oldval); ABTS_INT_EQUAL(tc, 12, casval); } static void test_cas_equal_nonnull(abts_case *tc, void *data) { - apr_uint32_t casval = 12; - apr_uint32_t oldval; + fspr_uint32_t casval = 12; + fspr_uint32_t oldval; - oldval = apr_atomic_cas32(&casval, 23, 12); + oldval = fspr_atomic_cas32(&casval, 23, 12); ABTS_INT_EQUAL(tc, 12, oldval); ABTS_INT_EQUAL(tc, 23, casval); } static void test_cas_notequal(abts_case *tc, void *data) { - apr_uint32_t casval = 12; - apr_uint32_t oldval; + fspr_uint32_t casval = 12; + fspr_uint32_t oldval; - oldval = apr_atomic_cas32(&casval, 23, 2); + oldval = fspr_atomic_cas32(&casval, 23, 2); ABTS_INT_EQUAL(tc, 12, oldval); ABTS_INT_EQUAL(tc, 12, casval); } static void test_add32(abts_case *tc, void *data) { - apr_uint32_t oldval; - apr_uint32_t y32; + fspr_uint32_t oldval; + fspr_uint32_t y32; - apr_atomic_set32(&y32, 23); - oldval = apr_atomic_add32(&y32, 4); + fspr_atomic_set32(&y32, 23); + oldval = fspr_atomic_add32(&y32, 4); ABTS_INT_EQUAL(tc, 23, oldval); ABTS_INT_EQUAL(tc, 27, y32); } static void test_inc32(abts_case *tc, void *data) { - apr_uint32_t oldval; - apr_uint32_t y32; + fspr_uint32_t oldval; + fspr_uint32_t y32; - apr_atomic_set32(&y32, 23); - oldval = apr_atomic_inc32(&y32); + fspr_atomic_set32(&y32, 23); + oldval = fspr_atomic_inc32(&y32); ABTS_INT_EQUAL(tc, 23, oldval); ABTS_INT_EQUAL(tc, 24, y32); } static void test_set_add_inc_sub(abts_case *tc, void *data) { - apr_uint32_t y32; + fspr_uint32_t y32; - apr_atomic_set32(&y32, 0); - apr_atomic_add32(&y32, 20); - apr_atomic_inc32(&y32); - apr_atomic_sub32(&y32, 10); + fspr_atomic_set32(&y32, 0); + fspr_atomic_add32(&y32, 20); + fspr_atomic_inc32(&y32); + fspr_atomic_sub32(&y32, 10); ABTS_INT_EQUAL(tc, 11, y32); } static void test_wrap_zero(abts_case *tc, void *data) { - apr_uint32_t y32; - apr_uint32_t rv; - apr_uint32_t minus1 = -1; + fspr_uint32_t y32; + fspr_uint32_t rv; + fspr_uint32_t minus1 = -1; char *str; - apr_atomic_set32(&y32, 0); - rv = apr_atomic_dec32(&y32); + fspr_atomic_set32(&y32, 0); + rv = fspr_atomic_dec32(&y32); - ABTS_ASSERT(tc, "apr_atomic_dec32 on zero returned zero.", rv != 0); - str = apr_psprintf(p, "zero wrap failed: 0 - 1 = %d", y32); + ABTS_ASSERT(tc, "fspr_atomic_dec32 on zero returned zero.", rv != 0); + str = fspr_psprintf(p, "zero wrap failed: 0 - 1 = %d", y32); ABTS_ASSERT(tc, str, y32 == minus1); } static void test_inc_neg1(abts_case *tc, void *data) { - apr_uint32_t y32 = -1; - apr_uint32_t minus1 = -1; - apr_uint32_t rv; + fspr_uint32_t y32 = -1; + fspr_uint32_t minus1 = -1; + fspr_uint32_t rv; char *str; - rv = apr_atomic_inc32(&y32); + rv = fspr_atomic_inc32(&y32); - ABTS_ASSERT(tc, "apr_atomic_dec32 on zero returned zero.", rv == minus1); - str = apr_psprintf(p, "zero wrap failed: -1 + 1 = %d", y32); + ABTS_ASSERT(tc, "fspr_atomic_dec32 on zero returned zero.", rv == minus1); + str = fspr_psprintf(p, "zero wrap failed: -1 + 1 = %d", y32); ABTS_ASSERT(tc, str, y32 == 0); } #if APR_HAS_THREADS -void * APR_THREAD_FUNC thread_func_mutex(apr_thread_t *thd, void *data); -void * APR_THREAD_FUNC thread_func_atomic(apr_thread_t *thd, void *data); -void * APR_THREAD_FUNC thread_func_none(apr_thread_t *thd, void *data); +void * APR_THREAD_FUNC thread_func_mutex(fspr_thread_t *thd, void *data); +void * APR_THREAD_FUNC thread_func_atomic(fspr_thread_t *thd, void *data); +void * APR_THREAD_FUNC thread_func_none(fspr_thread_t *thd, void *data); -apr_thread_mutex_t *thread_lock; -volatile apr_uint32_t x = 0; /* mutex locks */ -volatile apr_uint32_t y = 0; /* atomic operations */ -volatile apr_uint32_t z = 0; /* no locks */ -apr_status_t exit_ret_val = 123; /* just some made up number to check on later */ +fspr_thread_mutex_t *thread_lock; +volatile fspr_uint32_t x = 0; /* mutex locks */ +volatile fspr_uint32_t y = 0; /* atomic operations */ +volatile fspr_uint32_t z = 0; /* no locks */ +fspr_status_t exit_ret_val = 123; /* just some made up number to check on later */ #define NUM_THREADS 40 #define NUM_ITERATIONS 20000 -void * APR_THREAD_FUNC thread_func_mutex(apr_thread_t *thd, void *data) +void * APR_THREAD_FUNC thread_func_mutex(fspr_thread_t *thd, void *data) { int i; for (i = 0; i < NUM_ITERATIONS; i++) { - apr_thread_mutex_lock(thread_lock); + fspr_thread_mutex_lock(thread_lock); x++; - apr_thread_mutex_unlock(thread_lock); + fspr_thread_mutex_unlock(thread_lock); } - apr_thread_exit(thd, exit_ret_val); + fspr_thread_exit(thd, exit_ret_val); return NULL; } -void * APR_THREAD_FUNC thread_func_atomic(apr_thread_t *thd, void *data) +void * APR_THREAD_FUNC thread_func_atomic(fspr_thread_t *thd, void *data) { int i; for (i = 0; i < NUM_ITERATIONS ; i++) { - apr_atomic_inc32(&y); - apr_atomic_add32(&y, 2); - apr_atomic_dec32(&y); - apr_atomic_dec32(&y); + fspr_atomic_inc32(&y); + fspr_atomic_add32(&y, 2); + fspr_atomic_dec32(&y); + fspr_atomic_dec32(&y); } - apr_thread_exit(thd, exit_ret_val); + fspr_thread_exit(thd, exit_ret_val); return NULL; } -void * APR_THREAD_FUNC thread_func_none(apr_thread_t *thd, void *data) +void * APR_THREAD_FUNC thread_func_none(fspr_thread_t *thd, void *data) { int i; for (i = 0; i < NUM_ITERATIONS ; i++) { z++; } - apr_thread_exit(thd, exit_ret_val); + fspr_thread_exit(thd, exit_ret_val); return NULL; } static void test_atomics_threaded(abts_case *tc, void *data) { - apr_thread_t *t1[NUM_THREADS]; - apr_thread_t *t2[NUM_THREADS]; - apr_thread_t *t3[NUM_THREADS]; - apr_status_t s1[NUM_THREADS]; - apr_status_t s2[NUM_THREADS]; - apr_status_t s3[NUM_THREADS]; - apr_status_t rv; + fspr_thread_t *t1[NUM_THREADS]; + fspr_thread_t *t2[NUM_THREADS]; + fspr_thread_t *t3[NUM_THREADS]; + fspr_status_t s1[NUM_THREADS]; + fspr_status_t s2[NUM_THREADS]; + fspr_status_t s3[NUM_THREADS]; + fspr_status_t rv; int i; #ifdef HAVE_PTHREAD_SETCONCURRENCY pthread_setconcurrency(8); #endif - rv = apr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_DEFAULT, p); + rv = fspr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_DEFAULT, p); APR_ASSERT_SUCCESS(tc, "Could not create lock", rv); for (i = 0; i < NUM_THREADS; i++) { - apr_status_t r1, r2, r3; - r1 = apr_thread_create(&t1[i], NULL, thread_func_mutex, NULL, p); - r2 = apr_thread_create(&t2[i], NULL, thread_func_atomic, NULL, p); - r3 = apr_thread_create(&t3[i], NULL, thread_func_none, NULL, p); + fspr_status_t r1, r2, r3; + r1 = fspr_thread_create(&t1[i], NULL, thread_func_mutex, NULL, p); + r2 = fspr_thread_create(&t2[i], NULL, thread_func_atomic, NULL, p); + r3 = fspr_thread_create(&t3[i], NULL, thread_func_none, NULL, p); ABTS_ASSERT(tc, "Failed creating threads", r1 == APR_SUCCESS && r2 == APR_SUCCESS && r3 == APR_SUCCESS); } for (i = 0; i < NUM_THREADS; i++) { - apr_thread_join(&s1[i], t1[i]); - apr_thread_join(&s2[i], t2[i]); - apr_thread_join(&s3[i], t3[i]); + fspr_thread_join(&s1[i], t1[i]); + fspr_thread_join(&s2[i], t2[i]); + fspr_thread_join(&s3[i], t3[i]); ABTS_ASSERT(tc, "Invalid return value from thread_join", s1[i] == exit_ret_val && s2[i] == exit_ret_val && @@ -266,7 +266,7 @@ static void test_atomics_threaded(abts_case *tc, void *data) } ABTS_INT_EQUAL(tc, x, NUM_THREADS * NUM_ITERATIONS); - ABTS_INT_EQUAL(tc, apr_atomic_read32(&y), NUM_THREADS * NUM_ITERATIONS); + ABTS_INT_EQUAL(tc, fspr_atomic_read32(&y), NUM_THREADS * NUM_ITERATIONS); /* Comment out this test, because I have no clue what this test is * actually telling us. We are checking something that may or may not * be true, and it isn't really testing APR at all. diff --git a/libs/apr/test/testdir.c b/libs/apr/test/testdir.c index 82f145d6f1..97c21cc365 100644 --- a/libs/apr/test/testdir.c +++ b/libs/apr/test/testdir.c @@ -17,204 +17,204 @@ #include #include #include -#include "apr_file_io.h" -#include "apr_file_info.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_lib.h" +#include "fspr_file_io.h" +#include "fspr_file_info.h" +#include "fspr_errno.h" +#include "fspr_general.h" +#include "fspr_lib.h" #include "testutil.h" static void test_mkdir(abts_case *tc, void *data) { - apr_status_t rv; - apr_finfo_t finfo; + fspr_status_t rv; + fspr_finfo_t finfo; - rv = apr_dir_make("data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p); + rv = fspr_dir_make("data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_stat(&finfo, "data/testdir", APR_FINFO_TYPE, p); + rv = fspr_stat(&finfo, "data/testdir", APR_FINFO_TYPE, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, APR_DIR, finfo.filetype); } static void test_mkdir_recurs(abts_case *tc, void *data) { - apr_status_t rv; - apr_finfo_t finfo; + fspr_status_t rv; + fspr_finfo_t finfo; - rv = apr_dir_make_recursive("data/one/two/three", + rv = fspr_dir_make_recursive("data/one/two/three", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_stat(&finfo, "data/one", APR_FINFO_TYPE, p); + rv = fspr_stat(&finfo, "data/one", APR_FINFO_TYPE, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, APR_DIR, finfo.filetype); - rv = apr_stat(&finfo, "data/one/two", APR_FINFO_TYPE, p); + rv = fspr_stat(&finfo, "data/one/two", APR_FINFO_TYPE, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, APR_DIR, finfo.filetype); - rv = apr_stat(&finfo, "data/one/two/three", APR_FINFO_TYPE, p); + rv = fspr_stat(&finfo, "data/one/two/three", APR_FINFO_TYPE, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, APR_DIR, finfo.filetype); } static void test_remove(abts_case *tc, void *data) { - apr_status_t rv; - apr_finfo_t finfo; + fspr_status_t rv; + fspr_finfo_t finfo; - rv = apr_dir_remove("data/testdir", p); + rv = fspr_dir_remove("data/testdir", p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_stat(&finfo, "data/testdir", APR_FINFO_TYPE, p); + rv = fspr_stat(&finfo, "data/testdir", APR_FINFO_TYPE, p); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv)); } static void test_removeall_fail(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; - rv = apr_dir_remove("data/one", p); + rv = fspr_dir_remove("data/one", p); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOTEMPTY(rv)); } static void test_removeall(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; - rv = apr_dir_remove("data/one/two/three", p); + rv = fspr_dir_remove("data/one/two/three", p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_dir_remove("data/one/two", p); + rv = fspr_dir_remove("data/one/two", p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_dir_remove("data/one", p); + rv = fspr_dir_remove("data/one", p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } static void test_remove_notthere(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; - rv = apr_dir_remove("data/notthere", p); + rv = fspr_dir_remove("data/notthere", p); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv)); } static void test_mkdir_twice(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; - rv = apr_dir_make("data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p); + rv = fspr_dir_make("data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_dir_make("data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p); + rv = fspr_dir_make("data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EEXIST(rv)); - rv = apr_dir_remove("data/testdir", p); + rv = fspr_dir_remove("data/testdir", p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } static void test_opendir(abts_case *tc, void *data) { - apr_status_t rv; - apr_dir_t *dir; + fspr_status_t rv; + fspr_dir_t *dir; - rv = apr_dir_open(&dir, "data", p); + rv = fspr_dir_open(&dir, "data", p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - apr_dir_close(dir); + fspr_dir_close(dir); } static void test_opendir_notthere(abts_case *tc, void *data) { - apr_status_t rv; - apr_dir_t *dir; + fspr_status_t rv; + fspr_dir_t *dir; - rv = apr_dir_open(&dir, "notthere", p); + rv = fspr_dir_open(&dir, "notthere", p); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv)); } static void test_closedir(abts_case *tc, void *data) { - apr_status_t rv; - apr_dir_t *dir; + fspr_status_t rv; + fspr_dir_t *dir; - rv = apr_dir_open(&dir, "data", p); + rv = fspr_dir_open(&dir, "data", p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_dir_close(dir); + rv = fspr_dir_close(dir); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } static void test_rewind(abts_case *tc, void *data) { - apr_dir_t *dir; - apr_finfo_t first, second; + fspr_dir_t *dir; + fspr_finfo_t first, second; - APR_ASSERT_SUCCESS(tc, "apr_dir_open failed", apr_dir_open(&dir, "data", p)); + APR_ASSERT_SUCCESS(tc, "fspr_dir_open failed", fspr_dir_open(&dir, "data", p)); - APR_ASSERT_SUCCESS(tc, "apr_dir_read failed", - apr_dir_read(&first, APR_FINFO_DIRENT, dir)); + APR_ASSERT_SUCCESS(tc, "fspr_dir_read failed", + fspr_dir_read(&first, APR_FINFO_DIRENT, dir)); - APR_ASSERT_SUCCESS(tc, "apr_dir_rewind failed", apr_dir_rewind(dir)); + APR_ASSERT_SUCCESS(tc, "fspr_dir_rewind failed", fspr_dir_rewind(dir)); - APR_ASSERT_SUCCESS(tc, "second apr_dir_read failed", - apr_dir_read(&second, APR_FINFO_DIRENT, dir)); + APR_ASSERT_SUCCESS(tc, "second fspr_dir_read failed", + fspr_dir_read(&second, APR_FINFO_DIRENT, dir)); - APR_ASSERT_SUCCESS(tc, "apr_dir_close failed", apr_dir_close(dir)); + APR_ASSERT_SUCCESS(tc, "fspr_dir_close failed", fspr_dir_close(dir)); ABTS_STR_EQUAL(tc, first.name, second.name); } -/* Test for a (fixed) bug in apr_dir_read(). This bug only happened +/* Test for a (fixed) bug in fspr_dir_read(). This bug only happened in threadless cases. */ static void test_uncleared_errno(abts_case *tc, void *data) { - apr_file_t *thefile = NULL; - apr_finfo_t finfo; - apr_int32_t finfo_flags = APR_FINFO_TYPE | APR_FINFO_NAME; - apr_dir_t *this_dir; - apr_status_t rv; + fspr_file_t *thefile = NULL; + fspr_finfo_t finfo; + fspr_int32_t finfo_flags = APR_FINFO_TYPE | APR_FINFO_NAME; + fspr_dir_t *this_dir; + fspr_status_t rv; - rv = apr_dir_make("dir1", APR_OS_DEFAULT, p); + rv = fspr_dir_make("dir1", APR_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_dir_make("dir2", APR_OS_DEFAULT, p); + rv = fspr_dir_make("dir2", APR_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_open(&thefile, "dir1/file1", + rv = fspr_file_open(&thefile, "dir1/file1", APR_READ | APR_WRITE | APR_CREATE, APR_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_close(thefile); + rv = fspr_file_close(thefile); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); /* Try to remove dir1. This should fail because it's not empty. However, on a platform with threads disabled (such as FreeBSD), `errno' will be set as a result. */ - rv = apr_dir_remove("dir1", p); + rv = fspr_dir_remove("dir1", p); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOTEMPTY(rv)); /* Read `.' and `..' out of dir2. */ - rv = apr_dir_open(&this_dir, "dir2", p); + rv = fspr_dir_open(&this_dir, "dir2", p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_dir_read(&finfo, finfo_flags, this_dir); + rv = fspr_dir_read(&finfo, finfo_flags, this_dir); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_dir_read(&finfo, finfo_flags, this_dir); + rv = fspr_dir_read(&finfo, finfo_flags, this_dir); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); /* Now, when we attempt to do a third read of empty dir2, and the underlying system readdir() returns NULL, the old value of errno shouldn't cause a false alarm. We should get an ENOENT - back from apr_dir_read, and *not* the old errno. */ - rv = apr_dir_read(&finfo, finfo_flags, this_dir); + back from fspr_dir_read, and *not* the old errno. */ + rv = fspr_dir_read(&finfo, finfo_flags, this_dir); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv)); - rv = apr_dir_close(this_dir); + rv = fspr_dir_close(this_dir); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); /* Cleanup */ - rv = apr_file_remove("dir1/file1", p); + rv = fspr_file_remove("dir1/file1", p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_dir_remove("dir1", p); + rv = fspr_dir_remove("dir1", p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_dir_remove("dir2", p); + rv = fspr_dir_remove("dir2", p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } @@ -222,30 +222,30 @@ static void test_uncleared_errno(abts_case *tc, void *data) static void test_rmkdir_nocwd(abts_case *tc, void *data) { char *cwd, *path; - apr_status_t rv; + fspr_status_t rv; APR_ASSERT_SUCCESS(tc, "make temp dir", - apr_dir_make("dir3", APR_OS_DEFAULT, p)); + fspr_dir_make("dir3", APR_OS_DEFAULT, p)); - APR_ASSERT_SUCCESS(tc, "obtain cwd", apr_filepath_get(&cwd, 0, p)); + APR_ASSERT_SUCCESS(tc, "obtain cwd", fspr_filepath_get(&cwd, 0, p)); APR_ASSERT_SUCCESS(tc, "determine path to temp dir", - apr_filepath_merge(&path, cwd, "dir3", 0, p)); + fspr_filepath_merge(&path, cwd, "dir3", 0, p)); - APR_ASSERT_SUCCESS(tc, "change to temp dir", apr_filepath_set(path, p)); + APR_ASSERT_SUCCESS(tc, "change to temp dir", fspr_filepath_set(path, p)); - rv = apr_dir_remove(path, p); + rv = fspr_dir_remove(path, p); /* Some platforms cannot remove a directory which is in use. */ if (rv == APR_SUCCESS) { ABTS_ASSERT(tc, "fail to create dir", - apr_dir_make_recursive("foobar", APR_OS_DEFAULT, + fspr_dir_make_recursive("foobar", APR_OS_DEFAULT, p) != APR_SUCCESS); } - APR_ASSERT_SUCCESS(tc, "restore cwd", apr_filepath_set(cwd, p)); + APR_ASSERT_SUCCESS(tc, "restore cwd", fspr_filepath_set(cwd, p)); if (rv) { - apr_dir_remove(path, p); + fspr_dir_remove(path, p); ABTS_NOT_IMPL(tc, "cannot remove in-use directory"); } } diff --git a/libs/apr/test/testdso.c b/libs/apr/test/testdso.c index b87bdf70e1..aaeffcfee0 100644 --- a/libs/apr/test/testdso.c +++ b/libs/apr/test/testdso.c @@ -16,13 +16,13 @@ #include "testutil.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_errno.h" -#include "apr_dso.h" -#include "apr_strings.h" -#include "apr_file_info.h" -#include "apr.h" +#include "fspr_general.h" +#include "fspr_pools.h" +#include "fspr_errno.h" +#include "fspr_dso.h" +#include "fspr_strings.h" +#include "fspr_file_info.h" +#include "fspr.h" #if APR_HAVE_UNISTD_H #include #endif @@ -53,32 +53,32 @@ static char *modname; static void test_load_module(abts_case *tc, void *data) { - apr_dso_handle_t *h = NULL; - apr_status_t status; + fspr_dso_handle_t *h = NULL; + fspr_status_t status; char errstr[256]; - status = apr_dso_load(&h, modname, p); - ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + status = fspr_dso_load(&h, modname, p); + ABTS_ASSERT(tc, fspr_dso_error(h, errstr, 256), APR_SUCCESS == status); ABTS_PTR_NOTNULL(tc, h); - apr_dso_unload(h); + fspr_dso_unload(h); } static void test_dso_sym(abts_case *tc, void *data) { - apr_dso_handle_t *h = NULL; - apr_dso_handle_sym_t func1 = NULL; - apr_status_t status; + fspr_dso_handle_t *h = NULL; + fspr_dso_handle_sym_t func1 = NULL; + fspr_status_t status; void (*function)(char str[256]); char teststr[256]; char errstr[256]; - status = apr_dso_load(&h, modname, p); - ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + status = fspr_dso_load(&h, modname, p); + ABTS_ASSERT(tc, fspr_dso_error(h, errstr, 256), APR_SUCCESS == status); ABTS_PTR_NOTNULL(tc, h); - status = apr_dso_sym(&func1, h, "print_hello"); - ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + status = fspr_dso_sym(&func1, h, "print_hello"); + ABTS_ASSERT(tc, fspr_dso_error(h, errstr, 256), APR_SUCCESS == status); ABTS_PTR_NOTNULL(tc, func1); if (!tc->failed) { @@ -87,23 +87,23 @@ static void test_dso_sym(abts_case *tc, void *data) ABTS_STR_EQUAL(tc, "Hello - I'm a DSO!\n", teststr); } - apr_dso_unload(h); + fspr_dso_unload(h); } static void test_dso_sym_return_value(abts_case *tc, void *data) { - apr_dso_handle_t *h = NULL; - apr_dso_handle_sym_t func1 = NULL; - apr_status_t status; + fspr_dso_handle_t *h = NULL; + fspr_dso_handle_sym_t func1 = NULL; + fspr_status_t status; int (*function)(int); char errstr[256]; - status = apr_dso_load(&h, modname, p); - ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + status = fspr_dso_load(&h, modname, p); + ABTS_ASSERT(tc, fspr_dso_error(h, errstr, 256), APR_SUCCESS == status); ABTS_PTR_NOTNULL(tc, h); - status = apr_dso_sym(&func1, h, "count_reps"); - ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + status = fspr_dso_sym(&func1, h, "count_reps"); + ABTS_ASSERT(tc, fspr_dso_error(h, errstr, 256), APR_SUCCESS == status); ABTS_PTR_NOTNULL(tc, func1); if (!tc->failed) { @@ -112,24 +112,24 @@ static void test_dso_sym_return_value(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, 5, status); } - apr_dso_unload(h); + fspr_dso_unload(h); } static void test_unload_module(abts_case *tc, void *data) { - apr_dso_handle_t *h = NULL; - apr_status_t status; + fspr_dso_handle_t *h = NULL; + fspr_status_t status; char errstr[256]; - apr_dso_handle_sym_t func1 = NULL; + fspr_dso_handle_sym_t func1 = NULL; - status = apr_dso_load(&h, modname, p); - ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + status = fspr_dso_load(&h, modname, p); + ABTS_ASSERT(tc, fspr_dso_error(h, errstr, 256), APR_SUCCESS == status); ABTS_PTR_NOTNULL(tc, h); - status = apr_dso_unload(h); - ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + status = fspr_dso_unload(h); + ABTS_ASSERT(tc, fspr_dso_error(h, errstr, 256), APR_SUCCESS == status); - status = apr_dso_sym(&func1, h, "print_hello"); + status = fspr_dso_sym(&func1, h, "print_hello"); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ESYMNOTFOUND(status)); } @@ -139,32 +139,32 @@ static char *libname; static void test_load_library(abts_case *tc, void *data) { - apr_dso_handle_t *h = NULL; - apr_status_t status; + fspr_dso_handle_t *h = NULL; + fspr_status_t status; char errstr[256]; - status = apr_dso_load(&h, libname, p); - ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + status = fspr_dso_load(&h, libname, p); + ABTS_ASSERT(tc, fspr_dso_error(h, errstr, 256), APR_SUCCESS == status); ABTS_PTR_NOTNULL(tc, h); - apr_dso_unload(h); + fspr_dso_unload(h); } static void test_dso_sym_library(abts_case *tc, void *data) { - apr_dso_handle_t *h = NULL; - apr_dso_handle_sym_t func1 = NULL; - apr_status_t status; + fspr_dso_handle_t *h = NULL; + fspr_dso_handle_sym_t func1 = NULL; + fspr_status_t status; void (*function)(char str[256]); char teststr[256]; char errstr[256]; - status = apr_dso_load(&h, libname, p); - ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + status = fspr_dso_load(&h, libname, p); + ABTS_ASSERT(tc, fspr_dso_error(h, errstr, 256), APR_SUCCESS == status); ABTS_PTR_NOTNULL(tc, h); - status = apr_dso_sym(&func1, h, "print_hello"); - ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + status = fspr_dso_sym(&func1, h, "print_hello"); + ABTS_ASSERT(tc, fspr_dso_error(h, errstr, 256), APR_SUCCESS == status); ABTS_PTR_NOTNULL(tc, func1); if (!tc->failed) { @@ -173,23 +173,23 @@ static void test_dso_sym_library(abts_case *tc, void *data) ABTS_STR_EQUAL(tc, "Hello - I'm a DSO!\n", teststr); } - apr_dso_unload(h); + fspr_dso_unload(h); } static void test_dso_sym_return_value_library(abts_case *tc, void *data) { - apr_dso_handle_t *h = NULL; - apr_dso_handle_sym_t func1 = NULL; - apr_status_t status; + fspr_dso_handle_t *h = NULL; + fspr_dso_handle_sym_t func1 = NULL; + fspr_status_t status; int (*function)(int); char errstr[256]; - status = apr_dso_load(&h, libname, p); - ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + status = fspr_dso_load(&h, libname, p); + ABTS_ASSERT(tc, fspr_dso_error(h, errstr, 256), APR_SUCCESS == status); ABTS_PTR_NOTNULL(tc, h); - status = apr_dso_sym(&func1, h, "count_reps"); - ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + status = fspr_dso_sym(&func1, h, "count_reps"); + ABTS_ASSERT(tc, fspr_dso_error(h, errstr, 256), APR_SUCCESS == status); ABTS_PTR_NOTNULL(tc, func1); if (!tc->failed) { @@ -198,24 +198,24 @@ static void test_dso_sym_return_value_library(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, 5, status); } - apr_dso_unload(h); + fspr_dso_unload(h); } static void test_unload_library(abts_case *tc, void *data) { - apr_dso_handle_t *h = NULL; - apr_status_t status; + fspr_dso_handle_t *h = NULL; + fspr_status_t status; char errstr[256]; - apr_dso_handle_sym_t func1 = NULL; + fspr_dso_handle_sym_t func1 = NULL; - status = apr_dso_load(&h, libname, p); - ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + status = fspr_dso_load(&h, libname, p); + ABTS_ASSERT(tc, fspr_dso_error(h, errstr, 256), APR_SUCCESS == status); ABTS_PTR_NOTNULL(tc, h); - status = apr_dso_unload(h); - ABTS_ASSERT(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status); + status = fspr_dso_unload(h); + ABTS_ASSERT(tc, fspr_dso_error(h, errstr, 256), APR_SUCCESS == status); - status = apr_dso_sym(&func1, h, "print_hello"); + status = fspr_dso_sym(&func1, h, "print_hello"); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ESYMNOTFOUND(status)); } @@ -223,10 +223,10 @@ static void test_unload_library(abts_case *tc, void *data) static void test_load_notthere(abts_case *tc, void *data) { - apr_dso_handle_t *h = NULL; - apr_status_t status; + fspr_dso_handle_t *h = NULL; + fspr_status_t status; - status = apr_dso_load(&h, "No_File.so", p); + status = fspr_dso_load(&h, "No_File.so", p); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EDSOOPEN(status)); ABTS_PTR_NOTNULL(tc, h); @@ -239,7 +239,7 @@ abts_suite *testdso(abts_suite *suite) suite = ADD_SUITE(suite) #if APR_HAS_DSO - apr_filepath_merge(&modname, NULL, MOD_NAME, 0, p); + fspr_filepath_merge(&modname, NULL, MOD_NAME, 0, p); abts_run_test(suite, test_load_module, NULL); abts_run_test(suite, test_dso_sym, NULL); @@ -247,7 +247,7 @@ abts_suite *testdso(abts_suite *suite) abts_run_test(suite, test_unload_module, NULL); #ifdef LIB_NAME - apr_filepath_merge(&libname, NULL, LIB_NAME, 0, p); + fspr_filepath_merge(&libname, NULL, LIB_NAME, 0, p); abts_run_test(suite, test_load_library, NULL); abts_run_test(suite, test_dso_sym_library, NULL); diff --git a/libs/apr/test/testdup.c b/libs/apr/test/testdup.c index 9d064ec0d8..a6fd1c8e83 100644 --- a/libs/apr/test/testdup.c +++ b/libs/apr/test/testdup.c @@ -15,10 +15,10 @@ */ -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_errno.h" -#include "apr_file_io.h" +#include "fspr_general.h" +#include "fspr_pools.h" +#include "fspr_errno.h" +#include "fspr_file_io.h" #include "testutil.h" #define TEST "Testing\n" @@ -27,155 +27,155 @@ static void test_file_dup(abts_case *tc, void *data) { - apr_file_t *file1 = NULL; - apr_file_t *file3 = NULL; - apr_status_t rv; - apr_finfo_t finfo; + fspr_file_t *file1 = NULL; + fspr_file_t *file3 = NULL; + fspr_status_t rv; + fspr_finfo_t finfo; /* First, create a new file, empty... */ - rv = apr_file_open(&file1, FILEPATH "testdup.file", + rv = fspr_file_open(&file1, FILEPATH "testdup.file", APR_READ | APR_WRITE | APR_CREATE | APR_DELONCLOSE, APR_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, file1); - rv = apr_file_dup(&file3, file1, p); + rv = fspr_file_dup(&file3, file1, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, file3); - rv = apr_file_close(file1); + rv = fspr_file_close(file1); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); /* cleanup after ourselves */ - rv = apr_file_close(file3); + rv = fspr_file_close(file3); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_stat(&finfo, FILEPATH "testdup.file", APR_FINFO_NORM, p); + rv = fspr_stat(&finfo, FILEPATH "testdup.file", APR_FINFO_NORM, p); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv)); } static void test_file_readwrite(abts_case *tc, void *data) { - apr_file_t *file1 = NULL; - apr_file_t *file3 = NULL; - apr_status_t rv; - apr_finfo_t finfo; - apr_size_t txtlen = sizeof(TEST); + fspr_file_t *file1 = NULL; + fspr_file_t *file3 = NULL; + fspr_status_t rv; + fspr_finfo_t finfo; + fspr_size_t txtlen = sizeof(TEST); char buff[50]; - apr_off_t fpos; + fspr_off_t fpos; /* First, create a new file, empty... */ - rv = apr_file_open(&file1, FILEPATH "testdup.readwrite.file", + rv = fspr_file_open(&file1, FILEPATH "testdup.readwrite.file", APR_READ | APR_WRITE | APR_CREATE | APR_DELONCLOSE, APR_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, file1); - rv = apr_file_dup(&file3, file1, p); + rv = fspr_file_dup(&file3, file1, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, file3); - rv = apr_file_write(file3, TEST, &txtlen); + rv = fspr_file_write(file3, TEST, &txtlen); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, sizeof(TEST), txtlen); fpos = 0; - rv = apr_file_seek(file1, APR_SET, &fpos); + rv = fspr_file_seek(file1, APR_SET, &fpos); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_ASSERT(tc, "File position mismatch, expected 0", fpos == 0); txtlen = 50; - rv = apr_file_read(file1, buff, &txtlen); + rv = fspr_file_read(file1, buff, &txtlen); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_STR_EQUAL(tc, TEST, buff); /* cleanup after ourselves */ - rv = apr_file_close(file1); + rv = fspr_file_close(file1); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_close(file3); + rv = fspr_file_close(file3); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_stat(&finfo, FILEPATH "testdup.readwrite.file", APR_FINFO_NORM, p); + rv = fspr_stat(&finfo, FILEPATH "testdup.readwrite.file", APR_FINFO_NORM, p); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv)); } static void test_dup2(abts_case *tc, void *data) { - apr_file_t *testfile = NULL; - apr_file_t *errfile = NULL; - apr_file_t *saveerr = NULL; - apr_status_t rv; + fspr_file_t *testfile = NULL; + fspr_file_t *errfile = NULL; + fspr_file_t *saveerr = NULL; + fspr_status_t rv; - rv = apr_file_open(&testfile, FILEPATH "testdup2.file", + rv = fspr_file_open(&testfile, FILEPATH "testdup2.file", APR_READ | APR_WRITE | APR_CREATE | APR_DELONCLOSE, APR_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, testfile); - rv = apr_file_open_stderr(&errfile, p); + rv = fspr_file_open_stderr(&errfile, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); /* Set aside the real errfile */ - rv = apr_file_dup(&saveerr, errfile, p); + rv = fspr_file_dup(&saveerr, errfile, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, saveerr); - rv = apr_file_dup2(errfile, testfile, p); + rv = fspr_file_dup2(errfile, testfile, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, errfile); - apr_file_close(testfile); + fspr_file_close(testfile); - rv = apr_file_dup2(errfile, saveerr, p); + rv = fspr_file_dup2(errfile, saveerr, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, errfile); } static void test_dup2_readwrite(abts_case *tc, void *data) { - apr_file_t *errfile = NULL; - apr_file_t *testfile = NULL; - apr_file_t *saveerr = NULL; - apr_status_t rv; - apr_size_t txtlen = sizeof(TEST); + fspr_file_t *errfile = NULL; + fspr_file_t *testfile = NULL; + fspr_file_t *saveerr = NULL; + fspr_status_t rv; + fspr_size_t txtlen = sizeof(TEST); char buff[50]; - apr_off_t fpos; + fspr_off_t fpos; - rv = apr_file_open(&testfile, FILEPATH "testdup2.readwrite.file", + rv = fspr_file_open(&testfile, FILEPATH "testdup2.readwrite.file", APR_READ | APR_WRITE | APR_CREATE | APR_DELONCLOSE, APR_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, testfile); - rv = apr_file_open_stderr(&errfile, p); + rv = fspr_file_open_stderr(&errfile, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); /* Set aside the real errfile */ - rv = apr_file_dup(&saveerr, errfile, p); + rv = fspr_file_dup(&saveerr, errfile, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, saveerr); - rv = apr_file_dup2(errfile, testfile, p); + rv = fspr_file_dup2(errfile, testfile, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, errfile); txtlen = sizeof(TEST2); - rv = apr_file_write(errfile, TEST2, &txtlen); + rv = fspr_file_write(errfile, TEST2, &txtlen); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, sizeof(TEST2), txtlen); fpos = 0; - rv = apr_file_seek(testfile, APR_SET, &fpos); + rv = fspr_file_seek(testfile, APR_SET, &fpos); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_ASSERT(tc, "File position mismatch, expected 0", fpos == 0); txtlen = 50; - rv = apr_file_read(testfile, buff, &txtlen); + rv = fspr_file_read(testfile, buff, &txtlen); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_STR_EQUAL(tc, TEST2, buff); - apr_file_close(testfile); + fspr_file_close(testfile); - rv = apr_file_dup2(errfile, saveerr, p); + rv = fspr_file_dup2(errfile, saveerr, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, errfile); } diff --git a/libs/apr/test/testenv.c b/libs/apr/test/testenv.c index d292c26e7d..91aa889e43 100644 --- a/libs/apr/test/testenv.c +++ b/libs/apr/test/testenv.c @@ -14,12 +14,12 @@ * limitations under the License. */ -#include "apr_env.h" -#include "apr_errno.h" +#include "fspr_env.h" +#include "fspr_errno.h" #include "testutil.h" -#define TEST_ENVVAR_NAME "apr_test_envvar" -#define TEST_ENVVAR2_NAME "apr_test_envvar2" +#define TEST_ENVVAR_NAME "fspr_test_envvar" +#define TEST_ENVVAR2_NAME "fspr_test_envvar2" #define TEST_ENVVAR_VALUE "Just a value that we'll check" static int have_env_set; @@ -28,12 +28,12 @@ static int have_env_del; static void test_setenv(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; - rv = apr_env_set(TEST_ENVVAR_NAME, TEST_ENVVAR_VALUE, p); + rv = fspr_env_set(TEST_ENVVAR_NAME, TEST_ENVVAR_VALUE, p); have_env_set = (rv != APR_ENOTIMPL); if (!have_env_set) { - ABTS_NOT_IMPL(tc, "apr_env_set"); + ABTS_NOT_IMPL(tc, "fspr_env_set"); } else { APR_ASSERT_SUCCESS(tc, "set environment variable", rv); } @@ -42,17 +42,17 @@ static void test_setenv(abts_case *tc, void *data) static void test_getenv(abts_case *tc, void *data) { char *value; - apr_status_t rv; + fspr_status_t rv; if (!have_env_set) { - ABTS_NOT_IMPL(tc, "apr_env_set (skip test for apr_env_get)"); + ABTS_NOT_IMPL(tc, "fspr_env_set (skip test for fspr_env_get)"); return; } - rv = apr_env_get(&value, TEST_ENVVAR_NAME, p); + rv = fspr_env_get(&value, TEST_ENVVAR_NAME, p); have_env_get = (rv != APR_ENOTIMPL); if (!have_env_get) { - ABTS_NOT_IMPL(tc, "apr_env_get"); + ABTS_NOT_IMPL(tc, "fspr_env_get"); return; } APR_ASSERT_SUCCESS(tc, "get environment variable", rv); @@ -62,26 +62,26 @@ static void test_getenv(abts_case *tc, void *data) static void test_delenv(abts_case *tc, void *data) { char *value; - apr_status_t rv; + fspr_status_t rv; if (!have_env_set) { - ABTS_NOT_IMPL(tc, "apr_env_set (skip test for apr_env_delete)"); + ABTS_NOT_IMPL(tc, "fspr_env_set (skip test for fspr_env_delete)"); return; } - rv = apr_env_delete(TEST_ENVVAR_NAME, p); + rv = fspr_env_delete(TEST_ENVVAR_NAME, p); have_env_del = (rv != APR_ENOTIMPL); if (!have_env_del) { - ABTS_NOT_IMPL(tc, "apr_env_delete"); + ABTS_NOT_IMPL(tc, "fspr_env_delete"); return; } APR_ASSERT_SUCCESS(tc, "delete environment variable", rv); if (!have_env_get) { - ABTS_NOT_IMPL(tc, "apr_env_get (skip sanity check for apr_env_delete)"); + ABTS_NOT_IMPL(tc, "fspr_env_get (skip sanity check for fspr_env_delete)"); return; } - rv = apr_env_get(&value, TEST_ENVVAR_NAME, p); + rv = fspr_env_get(&value, TEST_ENVVAR_NAME, p); ABTS_INT_EQUAL(tc, APR_ENOENT, rv); } @@ -89,45 +89,45 @@ static void test_delenv(abts_case *tc, void *data) static void test_emptyenv(abts_case *tc, void *data) { char *value; - apr_status_t rv; + fspr_status_t rv; if (!(have_env_set && have_env_get)) { - ABTS_NOT_IMPL(tc, "apr_env_set (skip test_emptyenv)"); + ABTS_NOT_IMPL(tc, "fspr_env_set (skip test_emptyenv)"); return; } /** Set empty string and test that rv != ENOENT) */ - rv = apr_env_set(TEST_ENVVAR_NAME, "", p); + rv = fspr_env_set(TEST_ENVVAR_NAME, "", p); APR_ASSERT_SUCCESS(tc, "set environment variable", rv); - rv = apr_env_get(&value, TEST_ENVVAR_NAME, p); + rv = fspr_env_get(&value, TEST_ENVVAR_NAME, p); APR_ASSERT_SUCCESS(tc, "get environment variable", rv); ABTS_STR_EQUAL(tc, "", value); if (!have_env_del) { - ABTS_NOT_IMPL(tc, "apr_env_del (skip recycle test_emptyenv)"); + ABTS_NOT_IMPL(tc, "fspr_env_del (skip recycle test_emptyenv)"); return; } /** Delete and retest */ - rv = apr_env_delete(TEST_ENVVAR_NAME, p); + rv = fspr_env_delete(TEST_ENVVAR_NAME, p); APR_ASSERT_SUCCESS(tc, "delete environment variable", rv); - rv = apr_env_get(&value, TEST_ENVVAR_NAME, p); + rv = fspr_env_get(&value, TEST_ENVVAR_NAME, p); ABTS_INT_EQUAL(tc, APR_ENOENT, rv); /** Set second variable + test*/ - rv = apr_env_set(TEST_ENVVAR2_NAME, TEST_ENVVAR_VALUE, p); + rv = fspr_env_set(TEST_ENVVAR2_NAME, TEST_ENVVAR_VALUE, p); APR_ASSERT_SUCCESS(tc, "set second environment variable", rv); - rv = apr_env_get(&value, TEST_ENVVAR2_NAME, p); + rv = fspr_env_get(&value, TEST_ENVVAR2_NAME, p); APR_ASSERT_SUCCESS(tc, "get second environment variable", rv); ABTS_STR_EQUAL(tc, TEST_ENVVAR_VALUE, value); /** Finally, test ENOENT (first variable) followed by second != ENOENT) */ - rv = apr_env_get(&value, TEST_ENVVAR_NAME, p); + rv = fspr_env_get(&value, TEST_ENVVAR_NAME, p); ABTS_INT_EQUAL(tc, APR_ENOENT, rv); - rv = apr_env_get(&value, TEST_ENVVAR2_NAME, p); + rv = fspr_env_get(&value, TEST_ENVVAR2_NAME, p); APR_ASSERT_SUCCESS(tc, "verify second environment variable", rv); ABTS_STR_EQUAL(tc, TEST_ENVVAR_VALUE, value); /** Cleanup */ - apr_env_delete(TEST_ENVVAR2_NAME, p); + fspr_env_delete(TEST_ENVVAR2_NAME, p); } abts_suite *testenv(abts_suite *suite) diff --git a/libs/apr/test/testfile.c b/libs/apr/test/testfile.c index 2ffc82643d..7e2be1204c 100644 --- a/libs/apr/test/testfile.c +++ b/libs/apr/test/testfile.c @@ -14,13 +14,13 @@ * limitations under the License. */ -#include "apr_file_io.h" -#include "apr_file_info.h" -#include "apr_network_io.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_poll.h" -#include "apr_lib.h" +#include "fspr_file_io.h" +#include "fspr_file_info.h" +#include "fspr_network_io.h" +#include "fspr_errno.h" +#include "fspr_general.h" +#include "fspr_poll.h" +#include "fspr_lib.h" #include "testutil.h" #define DIRNAME "data" @@ -34,10 +34,10 @@ static void test_open_noreadwrite(abts_case *tc, void *data) { - apr_status_t rv; - apr_file_t *thefile = NULL; + fspr_status_t rv; + fspr_file_t *thefile = NULL; - rv = apr_file_open(&thefile, FILENAME, + rv = fspr_file_open(&thefile, FILENAME, APR_CREATE | APR_EXCL, APR_UREAD | APR_UWRITE | APR_GREAD, p); ABTS_TRUE(tc, rv != APR_SUCCESS); @@ -47,10 +47,10 @@ static void test_open_noreadwrite(abts_case *tc, void *data) static void test_open_excl(abts_case *tc, void *data) { - apr_status_t rv; - apr_file_t *thefile = NULL; + fspr_status_t rv; + fspr_file_t *thefile = NULL; - rv = apr_file_open(&thefile, FILENAME, + rv = fspr_file_open(&thefile, FILENAME, APR_CREATE | APR_EXCL | APR_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); ABTS_TRUE(tc, rv != APR_SUCCESS); @@ -60,111 +60,111 @@ static void test_open_excl(abts_case *tc, void *data) static void test_open_read(abts_case *tc, void *data) { - apr_status_t rv; - apr_file_t *filetest = NULL; + fspr_status_t rv; + fspr_file_t *filetest = NULL; - rv = apr_file_open(&filetest, FILENAME, + rv = fspr_file_open(&filetest, FILENAME, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, filetest); - apr_file_close(filetest); + fspr_file_close(filetest); } static void test_read(abts_case *tc, void *data) { - apr_status_t rv; - apr_size_t nbytes = 256; - char *str = apr_pcalloc(p, nbytes + 1); - apr_file_t *filetest = NULL; + fspr_status_t rv; + fspr_size_t nbytes = 256; + char *str = fspr_pcalloc(p, nbytes + 1); + fspr_file_t *filetest = NULL; - rv = apr_file_open(&filetest, FILENAME, + rv = fspr_file_open(&filetest, FILENAME, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); APR_ASSERT_SUCCESS(tc, "Opening test file " FILENAME, rv); - rv = apr_file_read(filetest, str, &nbytes); + rv = fspr_file_read(filetest, str, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, strlen(TESTSTR), nbytes); ABTS_STR_EQUAL(tc, TESTSTR, str); - apr_file_close(filetest); + fspr_file_close(filetest); } static void test_readzero(abts_case *tc, void *data) { - apr_status_t rv; - apr_size_t nbytes = 0; + fspr_status_t rv; + fspr_size_t nbytes = 0; char *str = NULL; - apr_file_t *filetest; + fspr_file_t *filetest; - rv = apr_file_open(&filetest, FILENAME, APR_READ, APR_OS_DEFAULT, p); + rv = fspr_file_open(&filetest, FILENAME, APR_READ, APR_OS_DEFAULT, p); APR_ASSERT_SUCCESS(tc, "Opening test file " FILENAME, rv); - rv = apr_file_read(filetest, str, &nbytes); + rv = fspr_file_read(filetest, str, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, 0, nbytes); - apr_file_close(filetest); + fspr_file_close(filetest); } static void test_filename(abts_case *tc, void *data) { const char *str; - apr_status_t rv; - apr_file_t *filetest = NULL; + fspr_status_t rv; + fspr_file_t *filetest = NULL; - rv = apr_file_open(&filetest, FILENAME, + rv = fspr_file_open(&filetest, FILENAME, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); APR_ASSERT_SUCCESS(tc, "Opening test file " FILENAME, rv); - rv = apr_file_name_get(&str, filetest); + rv = fspr_file_name_get(&str, filetest); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_STR_EQUAL(tc, FILENAME, str); - apr_file_close(filetest); + fspr_file_close(filetest); } static void test_fileclose(abts_case *tc, void *data) { char str; - apr_status_t rv; - apr_size_t one = 1; - apr_file_t *filetest = NULL; + fspr_status_t rv; + fspr_size_t one = 1; + fspr_file_t *filetest = NULL; - rv = apr_file_open(&filetest, FILENAME, + rv = fspr_file_open(&filetest, FILENAME, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); APR_ASSERT_SUCCESS(tc, "Opening test file " FILENAME, rv); - rv = apr_file_close(filetest); + rv = fspr_file_close(filetest); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); /* We just closed the file, so this should fail */ - rv = apr_file_read(filetest, &str, &one); + rv = fspr_file_read(filetest, &str, &one); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EBADF(rv)); } static void test_file_remove(abts_case *tc, void *data) { - apr_status_t rv; - apr_file_t *filetest = NULL; + fspr_status_t rv; + fspr_file_t *filetest = NULL; - rv = apr_file_remove(FILENAME, p); + rv = fspr_file_remove(FILENAME, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_open(&filetest, FILENAME, APR_READ, + rv = fspr_file_open(&filetest, FILENAME, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv)); } static void test_open_write(abts_case *tc, void *data) { - apr_status_t rv; - apr_file_t *filetest = NULL; + fspr_status_t rv; + fspr_file_t *filetest = NULL; filetest = NULL; - rv = apr_file_open(&filetest, FILENAME, + rv = fspr_file_open(&filetest, FILENAME, APR_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv)); @@ -173,229 +173,229 @@ static void test_open_write(abts_case *tc, void *data) static void test_open_writecreate(abts_case *tc, void *data) { - apr_status_t rv; - apr_file_t *filetest = NULL; + fspr_status_t rv; + fspr_file_t *filetest = NULL; filetest = NULL; - rv = apr_file_open(&filetest, FILENAME, + rv = fspr_file_open(&filetest, FILENAME, APR_WRITE | APR_CREATE, APR_UREAD | APR_UWRITE | APR_GREAD, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - apr_file_close(filetest); + fspr_file_close(filetest); } static void test_write(abts_case *tc, void *data) { - apr_status_t rv; - apr_size_t bytes = strlen(TESTSTR); - apr_file_t *filetest = NULL; + fspr_status_t rv; + fspr_size_t bytes = strlen(TESTSTR); + fspr_file_t *filetest = NULL; - rv = apr_file_open(&filetest, FILENAME, + rv = fspr_file_open(&filetest, FILENAME, APR_WRITE | APR_CREATE, APR_UREAD | APR_UWRITE | APR_GREAD, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_write(filetest, TESTSTR, &bytes); + rv = fspr_file_write(filetest, TESTSTR, &bytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - apr_file_close(filetest); + fspr_file_close(filetest); } static void test_open_readwrite(abts_case *tc, void *data) { - apr_status_t rv; - apr_file_t *filetest = NULL; + fspr_status_t rv; + fspr_file_t *filetest = NULL; filetest = NULL; - rv = apr_file_open(&filetest, FILENAME, + rv = fspr_file_open(&filetest, FILENAME, APR_READ | APR_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, filetest); - apr_file_close(filetest); + fspr_file_close(filetest); } static void test_seek(abts_case *tc, void *data) { - apr_status_t rv; - apr_off_t offset = 5; - apr_size_t nbytes = 256; - char *str = apr_pcalloc(p, nbytes + 1); - apr_file_t *filetest = NULL; + fspr_status_t rv; + fspr_off_t offset = 5; + fspr_size_t nbytes = 256; + char *str = fspr_pcalloc(p, nbytes + 1); + fspr_file_t *filetest = NULL; - rv = apr_file_open(&filetest, FILENAME, + rv = fspr_file_open(&filetest, FILENAME, APR_READ, APR_UREAD | APR_UWRITE | APR_GREAD, p); APR_ASSERT_SUCCESS(tc, "Open test file " FILENAME, rv); - rv = apr_file_read(filetest, str, &nbytes); + rv = fspr_file_read(filetest, str, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, strlen(TESTSTR), nbytes); ABTS_STR_EQUAL(tc, TESTSTR, str); memset(str, 0, nbytes + 1); - rv = apr_file_seek(filetest, SEEK_SET, &offset); + rv = fspr_file_seek(filetest, SEEK_SET, &offset); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_read(filetest, str, &nbytes); + rv = fspr_file_read(filetest, str, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, strlen(TESTSTR) - 5, nbytes); ABTS_STR_EQUAL(tc, TESTSTR + 5, str); - apr_file_close(filetest); + fspr_file_close(filetest); /* Test for regression of sign error bug with SEEK_END and buffered files. */ - rv = apr_file_open(&filetest, FILENAME, + rv = fspr_file_open(&filetest, FILENAME, APR_READ | APR_BUFFERED, APR_UREAD | APR_UWRITE | APR_GREAD, p); APR_ASSERT_SUCCESS(tc, "Open test file " FILENAME, rv); offset = -5; - rv = apr_file_seek(filetest, SEEK_END, &offset); + rv = fspr_file_seek(filetest, SEEK_END, &offset); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, strlen(TESTSTR) - 5, nbytes); memset(str, 0, nbytes + 1); nbytes = 256; - rv = apr_file_read(filetest, str, &nbytes); + rv = fspr_file_read(filetest, str, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, 5, nbytes); ABTS_STR_EQUAL(tc, TESTSTR + strlen(TESTSTR) - 5, str); - apr_file_close(filetest); + fspr_file_close(filetest); } static void test_userdata_set(abts_case *tc, void *data) { - apr_status_t rv; - apr_file_t *filetest = NULL; + fspr_status_t rv; + fspr_file_t *filetest = NULL; - rv = apr_file_open(&filetest, FILENAME, + rv = fspr_file_open(&filetest, FILENAME, APR_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_data_set(filetest, "This is a test", - "test", apr_pool_cleanup_null); + rv = fspr_file_data_set(filetest, "This is a test", + "test", fspr_pool_cleanup_null); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - apr_file_close(filetest); + fspr_file_close(filetest); } static void test_userdata_get(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; void *udata; char *teststr; - apr_file_t *filetest = NULL; + fspr_file_t *filetest = NULL; - rv = apr_file_open(&filetest, FILENAME, + rv = fspr_file_open(&filetest, FILENAME, APR_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_data_set(filetest, "This is a test", - "test", apr_pool_cleanup_null); + rv = fspr_file_data_set(filetest, "This is a test", + "test", fspr_pool_cleanup_null); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_data_get(&udata, "test", filetest); + rv = fspr_file_data_get(&udata, "test", filetest); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); teststr = udata; ABTS_STR_EQUAL(tc, "This is a test", teststr); - apr_file_close(filetest); + fspr_file_close(filetest); } static void test_userdata_getnokey(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; void *teststr; - apr_file_t *filetest = NULL; + fspr_file_t *filetest = NULL; - rv = apr_file_open(&filetest, FILENAME, + rv = fspr_file_open(&filetest, FILENAME, APR_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_data_get(&teststr, "nokey", filetest); + rv = fspr_file_data_get(&teststr, "nokey", filetest); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_EQUAL(tc, NULL, teststr); - apr_file_close(filetest); + fspr_file_close(filetest); } static void test_getc(abts_case *tc, void *data) { - apr_file_t *f = NULL; - apr_status_t rv; + fspr_file_t *f = NULL; + fspr_status_t rv; char ch; - rv = apr_file_open(&f, FILENAME, APR_READ, 0, p); + rv = fspr_file_open(&f, FILENAME, APR_READ, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - apr_file_getc(&ch, f); + fspr_file_getc(&ch, f); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, (int)TESTSTR[0], (int)ch); - apr_file_close(f); + fspr_file_close(f); } static void test_ungetc(abts_case *tc, void *data) { - apr_file_t *f = NULL; - apr_status_t rv; + fspr_file_t *f = NULL; + fspr_status_t rv; char ch; - rv = apr_file_open(&f, FILENAME, APR_READ, 0, p); + rv = fspr_file_open(&f, FILENAME, APR_READ, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - apr_file_getc(&ch, f); + fspr_file_getc(&ch, f); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, (int)TESTSTR[0], (int)ch); - apr_file_ungetc('X', f); + fspr_file_ungetc('X', f); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - apr_file_getc(&ch, f); + fspr_file_getc(&ch, f); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, 'X', (int)ch); - apr_file_close(f); + fspr_file_close(f); } static void test_gets(abts_case *tc, void *data) { - apr_file_t *f = NULL; - apr_status_t rv; - char *str = apr_palloc(p, 256); + fspr_file_t *f = NULL; + fspr_status_t rv; + char *str = fspr_palloc(p, 256); - rv = apr_file_open(&f, FILENAME, APR_READ, 0, p); + rv = fspr_file_open(&f, FILENAME, APR_READ, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_gets(str, 256, f); + rv = fspr_file_gets(str, 256, f); /* Only one line in the test file, so APR will encounter EOF on the first * call to gets, but we should get APR_SUCCESS on this call and * APR_EOF on the next. */ ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_STR_EQUAL(tc, TESTSTR, str); - rv = apr_file_gets(str, 256, f); + rv = fspr_file_gets(str, 256, f); ABTS_INT_EQUAL(tc, APR_EOF, rv); ABTS_STR_EQUAL(tc, "", str); - apr_file_close(f); + fspr_file_close(f); } static void test_bigread(abts_case *tc, void *data) { - apr_file_t *f = NULL; - apr_status_t rv; + fspr_file_t *f = NULL; + fspr_status_t rv; char buf[APR_BUFFERSIZE * 2]; - apr_size_t nbytes; + fspr_size_t nbytes; /* Create a test file with known content. */ - rv = apr_file_open(&f, "data/created_file", + rv = fspr_file_open(&f, "data/created_file", APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -403,26 +403,26 @@ static void test_bigread(abts_case *tc, void *data) nbytes = APR_BUFFERSIZE; memset(buf, 0xFE, nbytes); - rv = apr_file_write(f, buf, &nbytes); + rv = fspr_file_write(f, buf, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, APR_BUFFERSIZE, nbytes); - rv = apr_file_close(f); + rv = fspr_file_close(f); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); f = NULL; - rv = apr_file_open(&f, "data/created_file", APR_READ, 0, p); + rv = fspr_file_open(&f, "data/created_file", APR_READ, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); nbytes = sizeof buf; - rv = apr_file_read(f, buf, &nbytes); + rv = fspr_file_read(f, buf, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, APR_BUFFERSIZE, nbytes); - rv = apr_file_close(f); + rv = fspr_file_close(f); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_remove("data/created_file", p); + rv = fspr_file_remove("data/created_file", p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } @@ -431,80 +431,80 @@ static void test_bigread(abts_case *tc, void *data) */ static void test_mod_neg(abts_case *tc, void *data) { - apr_status_t rv; - apr_file_t *f; + fspr_status_t rv; + fspr_file_t *f; const char *s; int i; - apr_size_t nbytes; + fspr_size_t nbytes; char buf[8192]; - apr_off_t cur; + fspr_off_t cur; const char *fname = "data/modneg.dat"; - rv = apr_file_open(&f, fname, + rv = fspr_file_open(&f, fname, APR_CREATE | APR_WRITE, APR_UREAD | APR_UWRITE, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); s = "body56789\n"; nbytes = strlen(s); - rv = apr_file_write(f, s, &nbytes); + rv = fspr_file_write(f, s, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, strlen(s), nbytes); for (i = 0; i < 7980; i++) { s = "0"; nbytes = strlen(s); - rv = apr_file_write(f, s, &nbytes); + rv = fspr_file_write(f, s, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, strlen(s), nbytes); } s = "end456789\n"; nbytes = strlen(s); - rv = apr_file_write(f, s, &nbytes); + rv = fspr_file_write(f, s, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, strlen(s), nbytes); for (i = 0; i < 10000; i++) { s = "1"; nbytes = strlen(s); - rv = apr_file_write(f, s, &nbytes); + rv = fspr_file_write(f, s, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, strlen(s), nbytes); } - rv = apr_file_close(f); + rv = fspr_file_close(f); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_open(&f, fname, APR_READ, 0, p); + rv = fspr_file_open(&f, fname, APR_READ, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_gets(buf, 11, f); + rv = fspr_file_gets(buf, 11, f); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_STR_EQUAL(tc, "body56789\n", buf); cur = 0; - rv = apr_file_seek(f, APR_CUR, &cur); + rv = fspr_file_seek(f, APR_CUR, &cur); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_ASSERT(tc, "File Pointer Mismatch, expected 10", cur == 10); nbytes = sizeof(buf); - rv = apr_file_read(f, buf, &nbytes); + rv = fspr_file_read(f, buf, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, nbytes, sizeof(buf)); - cur = -((apr_off_t)nbytes - 7980); - rv = apr_file_seek(f, APR_CUR, &cur); + cur = -((fspr_off_t)nbytes - 7980); + rv = fspr_file_seek(f, APR_CUR, &cur); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_ASSERT(tc, "File Pointer Mismatch, expected 7990", cur == 7990); - rv = apr_file_gets(buf, 11, f); + rv = fspr_file_gets(buf, 11, f); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_STR_EQUAL(tc, "end456789\n", buf); - rv = apr_file_close(f); + rv = fspr_file_close(f); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_remove(fname, p); + rv = fspr_file_remove(fname, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } @@ -513,21 +513,21 @@ static void test_mod_neg(abts_case *tc, void *data) static void file_contents_equal(abts_case *tc, const char *fname, const void *expect, - apr_size_t expectlen) + fspr_size_t expectlen) { - void *actual = apr_palloc(p, expectlen); - apr_file_t *f; + void *actual = fspr_palloc(p, expectlen); + fspr_file_t *f; APR_ASSERT_SUCCESS(tc, "open file", - apr_file_open(&f, fname, APR_READ|APR_BUFFERED, + fspr_file_open(&f, fname, APR_READ|APR_BUFFERED, 0, p)); APR_ASSERT_SUCCESS(tc, "read from file", - apr_file_read_full(f, actual, expectlen, NULL)); + fspr_file_read_full(f, actual, expectlen, NULL)); ABTS_ASSERT(tc, "matched expected file contents", memcmp(expect, actual, expectlen) == 0); - APR_ASSERT_SUCCESS(tc, "close file", apr_file_close(f)); + APR_ASSERT_SUCCESS(tc, "close file", fspr_file_close(f)); } #define LINE1 "this is a line of text\n" @@ -535,34 +535,34 @@ static void file_contents_equal(abts_case *tc, static void test_puts(abts_case *tc, void *data) { - apr_file_t *f; + fspr_file_t *f; const char *fname = "data/testputs.txt"; APR_ASSERT_SUCCESS(tc, "open file for writing", - apr_file_open(&f, fname, + fspr_file_open(&f, fname, APR_WRITE|APR_CREATE|APR_TRUNCATE, APR_OS_DEFAULT, p)); APR_ASSERT_SUCCESS(tc, "write line to file", - apr_file_puts(LINE1, f)); + fspr_file_puts(LINE1, f)); APR_ASSERT_SUCCESS(tc, "write second line to file", - apr_file_puts(LINE2, f)); + fspr_file_puts(LINE2, f)); APR_ASSERT_SUCCESS(tc, "close for writing", - apr_file_close(f)); + fspr_file_close(f)); file_contents_equal(tc, fname, LINE1 LINE2, strlen(LINE1 LINE2)); } static void test_writev(abts_case *tc, void *data) { - apr_file_t *f; - apr_size_t nbytes; + fspr_file_t *f; + fspr_size_t nbytes; struct iovec vec[5]; const char *fname = "data/testwritev.txt"; APR_ASSERT_SUCCESS(tc, "open file for writing", - apr_file_open(&f, fname, + fspr_file_open(&f, fname, APR_WRITE|APR_CREATE|APR_TRUNCATE, APR_OS_DEFAULT, p)); @@ -570,7 +570,7 @@ static void test_writev(abts_case *tc, void *data) vec[0].iov_len = strlen(LINE1); APR_ASSERT_SUCCESS(tc, "writev of size 1 to file", - apr_file_writev(f, vec, 1, &nbytes)); + fspr_file_writev(f, vec, 1, &nbytes)); file_contents_equal(tc, fname, LINE1, strlen(LINE1)); @@ -586,10 +586,10 @@ static void test_writev(abts_case *tc, void *data) vec[4].iov_len = strlen(LINE2); APR_ASSERT_SUCCESS(tc, "writev of size 5 to file", - apr_file_writev(f, vec, 5, &nbytes)); + fspr_file_writev(f, vec, 5, &nbytes)); APR_ASSERT_SUCCESS(tc, "close for writing", - apr_file_close(f)); + fspr_file_close(f)); file_contents_equal(tc, fname, LINE1 LINE1 LINE2 LINE1 LINE1 LINE2, strlen(LINE1)*4 + strlen(LINE2)*2); @@ -598,13 +598,13 @@ static void test_writev(abts_case *tc, void *data) static void test_writev_full(abts_case *tc, void *data) { - apr_file_t *f; - apr_size_t nbytes; + fspr_file_t *f; + fspr_size_t nbytes; struct iovec vec[5]; const char *fname = "data/testwritev_full.txt"; APR_ASSERT_SUCCESS(tc, "open file for writing", - apr_file_open(&f, fname, + fspr_file_open(&f, fname, APR_WRITE|APR_CREATE|APR_TRUNCATE, APR_OS_DEFAULT, p)); @@ -620,12 +620,12 @@ static void test_writev_full(abts_case *tc, void *data) vec[4].iov_len = strlen(LINE2); APR_ASSERT_SUCCESS(tc, "writev_full of size 5 to file", - apr_file_writev_full(f, vec, 5, &nbytes)); + fspr_file_writev_full(f, vec, 5, &nbytes)); ABTS_INT_EQUAL(tc, strlen(LINE1)*3 + strlen(LINE2)*2, nbytes); APR_ASSERT_SUCCESS(tc, "close for writing", - apr_file_close(f)); + fspr_file_close(f)); file_contents_equal(tc, fname, LINE1 LINE2 LINE1 LINE1 LINE2, strlen(LINE1)*3 + strlen(LINE2)*2); @@ -634,54 +634,54 @@ static void test_writev_full(abts_case *tc, void *data) static void test_truncate(abts_case *tc, void *data) { - apr_status_t rv; - apr_file_t *f; + fspr_status_t rv; + fspr_file_t *f; const char *fname = "data/testtruncate.dat"; const char *s; - apr_size_t nbytes; - apr_finfo_t finfo; + fspr_size_t nbytes; + fspr_finfo_t finfo; - apr_file_remove(fname, p); + fspr_file_remove(fname, p); - rv = apr_file_open(&f, fname, + rv = fspr_file_open(&f, fname, APR_CREATE | APR_WRITE, APR_UREAD | APR_UWRITE, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); s = "some data"; nbytes = strlen(s); - rv = apr_file_write(f, s, &nbytes); + rv = fspr_file_write(f, s, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, strlen(s), nbytes); - rv = apr_file_close(f); + rv = fspr_file_close(f); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_open(&f, fname, + rv = fspr_file_open(&f, fname, APR_TRUNCATE | APR_WRITE, APR_UREAD | APR_UWRITE, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_close(f); + rv = fspr_file_close(f); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_stat(&finfo, fname, APR_FINFO_SIZE, p); + rv = fspr_stat(&finfo, fname, APR_FINFO_SIZE, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_ASSERT(tc, "File size mismatch, expected 0 (empty)", finfo.size == 0); - rv = apr_file_remove(fname, p); + rv = fspr_file_remove(fname, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } static void test_bigfprintf(abts_case *tc, void *data) { - apr_file_t *f; + fspr_file_t *f; const char *fname = "data/testbigfprintf.dat"; char *to_write; int i; - apr_file_remove(fname, p); + fspr_file_remove(fname, p); APR_ASSERT_SUCCESS(tc, "open test file", - apr_file_open(&f, fname, + fspr_file_open(&f, fname, APR_CREATE|APR_WRITE, APR_UREAD|APR_UWRITE, p)); @@ -693,10 +693,10 @@ static void test_bigfprintf(abts_case *tc, void *data) strcpy(to_write + HUGE_STRING_LEN, "42"); - i = apr_file_printf(f, "%s", to_write); + i = fspr_file_printf(f, "%s", to_write); ABTS_INT_EQUAL(tc, HUGE_STRING_LEN + 2, i); - apr_file_close(f); + fspr_file_close(f); file_contents_equal(tc, fname, to_write, HUGE_STRING_LEN + 2); @@ -705,16 +705,16 @@ static void test_bigfprintf(abts_case *tc, void *data) static void test_fail_write_flush(abts_case *tc, void *data) { - apr_file_t *f; + fspr_file_t *f; const char *fname = "data/testflush.dat"; - apr_status_t rv; + fspr_status_t rv; char buf[APR_BUFFERSIZE]; int n; - apr_file_remove(fname, p); + fspr_file_remove(fname, p); APR_ASSERT_SUCCESS(tc, "open test file", - apr_file_open(&f, fname, + fspr_file_open(&f, fname, APR_CREATE|APR_READ|APR_BUFFERED, APR_UREAD|APR_UWRITE, p)); @@ -724,110 +724,110 @@ static void test_fail_write_flush(abts_case *tc, void *data) * internal buffer and actually tries to write to the file, which * was opened read-only and hence should be unwritable. */ for (n = 0, rv = APR_SUCCESS; n < 4 && rv == APR_SUCCESS; n++) { - apr_size_t bytes = sizeof buf; - rv = apr_file_write(f, buf, &bytes); + fspr_size_t bytes = sizeof buf; + rv = fspr_file_write(f, buf, &bytes); } ABTS_ASSERT(tc, "failed to write to read-only buffered fd", rv != APR_SUCCESS); - apr_file_close(f); + fspr_file_close(f); } static void test_fail_read_flush(abts_case *tc, void *data) { - apr_file_t *f; + fspr_file_t *f; const char *fname = "data/testflush.dat"; - apr_status_t rv; + fspr_status_t rv; char buf[2]; - apr_file_remove(fname, p); + fspr_file_remove(fname, p); APR_ASSERT_SUCCESS(tc, "open test file", - apr_file_open(&f, fname, + fspr_file_open(&f, fname, APR_CREATE|APR_READ|APR_BUFFERED, APR_UREAD|APR_UWRITE, p)); /* this write should be buffered. */ APR_ASSERT_SUCCESS(tc, "buffered write should succeed", - apr_file_puts("hello", f)); + fspr_file_puts("hello", f)); /* Now, trying a read should fail since the write must be flushed, * and should fail with something other than EOF since the file is * opened read-only. */ - rv = apr_file_read_full(f, buf, 2, NULL); + rv = fspr_file_read_full(f, buf, 2, NULL); ABTS_ASSERT(tc, "read should flush buffered write and fail", rv != APR_SUCCESS && rv != APR_EOF); /* Likewise for gets */ - rv = apr_file_gets(buf, 2, f); + rv = fspr_file_gets(buf, 2, f); ABTS_ASSERT(tc, "gets should flush buffered write and fail", rv != APR_SUCCESS && rv != APR_EOF); /* Likewise for seek. */ { - apr_off_t offset = 0; + fspr_off_t offset = 0; - rv = apr_file_seek(f, APR_SET, &offset); + rv = fspr_file_seek(f, APR_SET, &offset); } ABTS_ASSERT(tc, "seek should flush buffered write and fail", rv != APR_SUCCESS && rv != APR_EOF); - apr_file_close(f); + fspr_file_close(f); } static void test_xthread(abts_case *tc, void *data) { - apr_file_t *f; + fspr_file_t *f; const char *fname = "data/testxthread.dat"; - apr_status_t rv; - apr_int32_t flags = APR_CREATE|APR_READ|APR_WRITE|APR_APPEND|APR_XTHREAD; + fspr_status_t rv; + fspr_int32_t flags = APR_CREATE|APR_READ|APR_WRITE|APR_APPEND|APR_XTHREAD; char buf[128] = { 0 }; /* Test for bug 38438, opening file with append + xthread and seeking to the end of the file resulted in writes going to the beginning not the end. */ - apr_file_remove(fname, p); + fspr_file_remove(fname, p); APR_ASSERT_SUCCESS(tc, "open test file", - apr_file_open(&f, fname, flags, + fspr_file_open(&f, fname, flags, APR_UREAD|APR_UWRITE, p)); APR_ASSERT_SUCCESS(tc, "write should succeed", - apr_file_puts("hello", f)); + fspr_file_puts("hello", f)); - apr_file_close(f); + fspr_file_close(f); APR_ASSERT_SUCCESS(tc, "open test file", - apr_file_open(&f, fname, flags, + fspr_file_open(&f, fname, flags, APR_UREAD|APR_UWRITE, p)); /* Seek to the end. */ { - apr_off_t offset = 0; + fspr_off_t offset = 0; - rv = apr_file_seek(f, APR_END, &offset); + rv = fspr_file_seek(f, APR_END, &offset); } APR_ASSERT_SUCCESS(tc, "more writes should succeed", - apr_file_puts("world", f)); + fspr_file_puts("world", f)); /* Back to the beginning. */ { - apr_off_t offset = 0; + fspr_off_t offset = 0; - rv = apr_file_seek(f, APR_SET, &offset); + rv = fspr_file_seek(f, APR_SET, &offset); } - apr_file_read_full(f, buf, sizeof(buf), NULL); + fspr_file_read_full(f, buf, sizeof(buf), NULL); ABTS_STR_EQUAL(tc, "helloworld", buf); - apr_file_close(f); + fspr_file_close(f); } abts_suite *testfile(abts_suite *suite) diff --git a/libs/apr/test/testfilecopy.c b/libs/apr/test/testfilecopy.c index 730b1f0195..17d9fdda6b 100644 --- a/libs/apr/test/testfilecopy.c +++ b/libs/apr/test/testfilecopy.c @@ -15,34 +15,34 @@ */ #include "testutil.h" -#include "apr_file_io.h" -#include "apr_file_info.h" -#include "apr_errno.h" -#include "apr_pools.h" +#include "fspr_file_io.h" +#include "fspr_file_info.h" +#include "fspr_errno.h" +#include "fspr_pools.h" static void copy_helper(abts_case *tc, const char *from, const char * to, - apr_fileperms_t perms, int append, apr_pool_t *p) + fspr_fileperms_t perms, int append, fspr_pool_t *p) { - apr_status_t rv; - apr_status_t dest_rv; - apr_finfo_t copy; - apr_finfo_t orig; - apr_finfo_t dest; + fspr_status_t rv; + fspr_status_t dest_rv; + fspr_finfo_t copy; + fspr_finfo_t orig; + fspr_finfo_t dest; - dest_rv = apr_stat(&dest, to, APR_FINFO_SIZE, p); + dest_rv = fspr_stat(&dest, to, APR_FINFO_SIZE, p); if (!append) { - rv = apr_file_copy(from, to, perms, p); + rv = fspr_file_copy(from, to, perms, p); } else { - rv = apr_file_append(from, to, perms, p); + rv = fspr_file_append(from, to, perms, p); } APR_ASSERT_SUCCESS(tc, "Error copying file", rv); - rv = apr_stat(&orig, from, APR_FINFO_SIZE, p); + rv = fspr_stat(&orig, from, APR_FINFO_SIZE, p); APR_ASSERT_SUCCESS(tc, "Couldn't stat original file", rv); - rv = apr_stat(©, to, APR_FINFO_SIZE, p); + rv = fspr_stat(©, to, APR_FINFO_SIZE, p); APR_ASSERT_SUCCESS(tc, "Couldn't stat copy file", rv); if (!append) { @@ -57,23 +57,23 @@ static void copy_helper(abts_case *tc, const char *from, const char * to, static void copy_short_file(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; /* make absolutely sure that the dest file doesn't exist. */ - apr_file_remove("data/file_copy.txt", p); + fspr_file_remove("data/file_copy.txt", p); copy_helper(tc, "data/file_datafile.txt", "data/file_copy.txt", APR_FILE_SOURCE_PERMS, 0, p); - rv = apr_file_remove("data/file_copy.txt", p); + rv = fspr_file_remove("data/file_copy.txt", p); APR_ASSERT_SUCCESS(tc, "Couldn't remove copy file", rv); } static void copy_over_existing(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; /* make absolutely sure that the dest file doesn't exist. */ - apr_file_remove("data/file_copy.txt", p); + fspr_file_remove("data/file_copy.txt", p); /* This is a cheat. I don't want to create a new file, so I just copy * one file, then I copy another. If the second copy succeeds, then @@ -85,29 +85,29 @@ static void copy_over_existing(abts_case *tc, void *data) copy_helper(tc, "data/mmap_datafile.txt", "data/file_copy.txt", APR_FILE_SOURCE_PERMS, 0, p); - rv = apr_file_remove("data/file_copy.txt", p); + rv = fspr_file_remove("data/file_copy.txt", p); APR_ASSERT_SUCCESS(tc, "Couldn't remove copy file", rv); } static void append_nonexist(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; /* make absolutely sure that the dest file doesn't exist. */ - apr_file_remove("data/file_copy.txt", p); + fspr_file_remove("data/file_copy.txt", p); copy_helper(tc, "data/file_datafile.txt", "data/file_copy.txt", APR_FILE_SOURCE_PERMS, 0, p); - rv = apr_file_remove("data/file_copy.txt", p); + rv = fspr_file_remove("data/file_copy.txt", p); APR_ASSERT_SUCCESS(tc, "Couldn't remove copy file", rv); } static void append_exist(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; /* make absolutely sure that the dest file doesn't exist. */ - apr_file_remove("data/file_copy.txt", p); + fspr_file_remove("data/file_copy.txt", p); /* This is a cheat. I don't want to create a new file, so I just copy * one file, then I copy another. If the second copy succeeds, then @@ -119,7 +119,7 @@ static void append_exist(abts_case *tc, void *data) copy_helper(tc, "data/mmap_datafile.txt", "data/file_copy.txt", APR_FILE_SOURCE_PERMS, 1, p); - rv = apr_file_remove("data/file_copy.txt", p); + rv = fspr_file_remove("data/file_copy.txt", p); APR_ASSERT_SUCCESS(tc, "Couldn't remove copy file", rv); } diff --git a/libs/apr/test/testfileinfo.c b/libs/apr/test/testfileinfo.c index f437d7dddc..0fb02b991d 100644 --- a/libs/apr/test/testfileinfo.c +++ b/libs/apr/test/testfileinfo.c @@ -14,13 +14,13 @@ * limitations under the License. */ -#include "apr_file_io.h" -#include "apr_file_info.h" -#include "apr_strings.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_poll.h" -#include "apr_lib.h" +#include "fspr_file_io.h" +#include "fspr_file_info.h" +#include "fspr_strings.h" +#include "fspr_errno.h" +#include "fspr_general.h" +#include "fspr_poll.h" +#include "fspr_lib.h" #include "testutil.h" #define FILENAME "data/file_datafile.txt" @@ -29,7 +29,7 @@ static const struct view_fileinfo { - apr_int32_t bits; + fspr_int32_t bits; char *description; } vfi[] = { {APR_FINFO_MTIME, "MTIME"}, @@ -48,99 +48,99 @@ static const struct view_fileinfo {0, NULL} }; -static void finfo_equal(abts_case *tc, apr_finfo_t *f1, apr_finfo_t *f2) +static void finfo_equal(abts_case *tc, fspr_finfo_t *f1, fspr_finfo_t *f2) { /* Minimum supported flags across all platforms (APR_FINFO_MIN) */ - ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_TYPE", + ABTS_ASSERT(tc, "fspr_stat and fspr_getfileinfo must return APR_FINFO_TYPE", (f1->valid & f2->valid & APR_FINFO_TYPE)); - ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in filetype", + ABTS_ASSERT(tc, "fspr_stat and fspr_getfileinfo differ in filetype", f1->filetype == f2->filetype); - ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_SIZE", + ABTS_ASSERT(tc, "fspr_stat and fspr_getfileinfo must return APR_FINFO_SIZE", (f1->valid & f2->valid & APR_FINFO_SIZE)); - ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in size", + ABTS_ASSERT(tc, "fspr_stat and fspr_getfileinfo differ in size", f1->size == f2->size); - ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_ATIME", + ABTS_ASSERT(tc, "fspr_stat and fspr_getfileinfo must return APR_FINFO_ATIME", (f1->valid & f2->valid & APR_FINFO_ATIME)); - ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in atime", + ABTS_ASSERT(tc, "fspr_stat and fspr_getfileinfo differ in atime", f1->atime == f2->atime); - ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_MTIME", + ABTS_ASSERT(tc, "fspr_stat and fspr_getfileinfo must return APR_FINFO_MTIME", (f1->valid & f2->valid & APR_FINFO_MTIME)); - ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in mtime", + ABTS_ASSERT(tc, "fspr_stat and fspr_getfileinfo differ in mtime", f1->mtime == f2->mtime); - ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo must return APR_FINFO_CTIME", + ABTS_ASSERT(tc, "fspr_stat and fspr_getfileinfo must return APR_FINFO_CTIME", (f1->valid & f2->valid & APR_FINFO_CTIME)); - ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in ctime", + ABTS_ASSERT(tc, "fspr_stat and fspr_getfileinfo differ in ctime", f1->ctime == f2->ctime); if (f1->valid & f2->valid & APR_FINFO_NAME) - ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in name", + ABTS_ASSERT(tc, "fspr_stat and fspr_getfileinfo differ in name", !strcmp(f1->name, f2->name)); if (f1->fname && f2->fname) - ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in fname", + ABTS_ASSERT(tc, "fspr_stat and fspr_getfileinfo differ in fname", !strcmp(f1->fname, f2->fname)); /* Additional supported flags not supported on all platforms */ if (f1->valid & f2->valid & APR_FINFO_USER) - ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in user", - !apr_uid_compare(f1->user, f2->user)); + ABTS_ASSERT(tc, "fspr_stat and fspr_getfileinfo differ in user", + !fspr_uid_compare(f1->user, f2->user)); if (f1->valid & f2->valid & APR_FINFO_GROUP) - ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in group", - !apr_gid_compare(f1->group, f2->group)); + ABTS_ASSERT(tc, "fspr_stat and fspr_getfileinfo differ in group", + !fspr_gid_compare(f1->group, f2->group)); if (f1->valid & f2->valid & APR_FINFO_INODE) - ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in inode", + ABTS_ASSERT(tc, "fspr_stat and fspr_getfileinfo differ in inode", f1->inode == f2->inode); if (f1->valid & f2->valid & APR_FINFO_DEV) - ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in device", + ABTS_ASSERT(tc, "fspr_stat and fspr_getfileinfo differ in device", f1->device == f2->device); if (f1->valid & f2->valid & APR_FINFO_NLINK) - ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in nlink", + ABTS_ASSERT(tc, "fspr_stat and fspr_getfileinfo differ in nlink", f1->nlink == f2->nlink); if (f1->valid & f2->valid & APR_FINFO_CSIZE) - ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in csize", + ABTS_ASSERT(tc, "fspr_stat and fspr_getfileinfo differ in csize", f1->csize == f2->csize); if (f1->valid & f2->valid & APR_FINFO_PROT) - ABTS_ASSERT(tc, "apr_stat and apr_getfileinfo differ in protection", + ABTS_ASSERT(tc, "fspr_stat and fspr_getfileinfo differ in protection", f1->protection == f2->protection); } static void test_info_get(abts_case *tc, void *data) { - apr_file_t *thefile; - apr_finfo_t finfo; - apr_status_t rv; + fspr_file_t *thefile; + fspr_finfo_t finfo; + fspr_status_t rv; - rv = apr_file_open(&thefile, FILENAME, APR_READ, APR_OS_DEFAULT, p); + rv = fspr_file_open(&thefile, FILENAME, APR_READ, APR_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); + rv = fspr_file_info_get(&finfo, APR_FINFO_NORM, thefile); if (rv == APR_INCOMPLETE) { char *str; int i; - str = apr_pstrdup(p, "APR_INCOMPLETE: Missing "); + str = fspr_pstrdup(p, "APR_INCOMPLETE: Missing "); for (i = 0; vfi[i].bits; ++i) { if (vfi[i].bits & ~finfo.valid) { - str = apr_pstrcat(p, str, vfi[i].description, " ", NULL); + str = fspr_pstrcat(p, str, vfi[i].description, " ", NULL); } } ABTS_FAIL(tc, str); } ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - apr_file_close(thefile); + fspr_file_close(thefile); } static void test_stat(abts_case *tc, void *data) { - apr_finfo_t finfo; - apr_status_t rv; + fspr_finfo_t finfo; + fspr_status_t rv; - rv = apr_stat(&finfo, FILENAME, APR_FINFO_NORM, p); + rv = fspr_stat(&finfo, FILENAME, APR_FINFO_NORM, p); if (rv == APR_INCOMPLETE) { char *str; int i; - str = apr_pstrdup(p, "APR_INCOMPLETE: Missing "); + str = fspr_pstrdup(p, "APR_INCOMPLETE: Missing "); for (i = 0; vfi[i].bits; ++i) { if (vfi[i].bits & ~finfo.valid) { - str = apr_pstrcat(p, str, vfi[i].description, " ", NULL); + str = fspr_pstrcat(p, str, vfi[i].description, " ", NULL); } } ABTS_FAIL(tc, str); @@ -150,36 +150,36 @@ static void test_stat(abts_case *tc, void *data) static void test_stat_eq_finfo(abts_case *tc, void *data) { - apr_file_t *thefile; - apr_finfo_t finfo; - apr_finfo_t stat_finfo; - apr_status_t rv; + fspr_file_t *thefile; + fspr_finfo_t finfo; + fspr_finfo_t stat_finfo; + fspr_status_t rv; - rv = apr_file_open(&thefile, FILENAME, APR_READ, APR_OS_DEFAULT, p); + rv = fspr_file_open(&thefile, FILENAME, APR_READ, APR_OS_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); + rv = fspr_file_info_get(&finfo, APR_FINFO_NORM, thefile); /* Opening the file may have toggled the atime member (time last - * accessed), so fetch our apr_stat() after getting the fileinfo + * accessed), so fetch our fspr_stat() after getting the fileinfo * of the open file... */ - rv = apr_stat(&stat_finfo, FILENAME, APR_FINFO_NORM, p); + rv = fspr_stat(&stat_finfo, FILENAME, APR_FINFO_NORM, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - apr_file_close(thefile); + fspr_file_close(thefile); finfo_equal(tc, &stat_finfo, &finfo); } static void test_buffered_write_size(abts_case *tc, void *data) { - const apr_size_t data_len = strlen(NEWFILEDATA); - apr_file_t *thefile; - apr_finfo_t finfo; - apr_status_t rv; - apr_size_t bytes; + const fspr_size_t data_len = strlen(NEWFILEDATA); + fspr_file_t *thefile; + fspr_finfo_t finfo; + fspr_status_t rv; + fspr_size_t bytes; - rv = apr_file_open(&thefile, NEWFILENAME, + rv = fspr_file_open(&thefile, NEWFILENAME, APR_READ | APR_WRITE | APR_CREATE | APR_TRUNCATE | APR_BUFFERED | APR_DELONCLOSE, APR_OS_DEFAULT, p); @@ -187,46 +187,46 @@ static void test_buffered_write_size(abts_case *tc, void *data) /* A funny thing happened to me the other day: I wrote something * into a buffered file, then asked for its size using - * apr_file_info_get; and guess what? The size was 0! That's not a + * fspr_file_info_get; and guess what? The size was 0! That's not a * nice way to behave. */ bytes = data_len; - rv = apr_file_write(thefile, NEWFILEDATA, &bytes); + rv = fspr_file_write(thefile, NEWFILEDATA, &bytes); APR_ASSERT_SUCCESS(tc, "write file contents", rv); ABTS_TRUE(tc, data_len == bytes); - rv = apr_file_info_get(&finfo, APR_FINFO_SIZE, thefile); + rv = fspr_file_info_get(&finfo, APR_FINFO_SIZE, thefile); APR_ASSERT_SUCCESS(tc, "get file size", rv); - ABTS_TRUE(tc, bytes == (apr_size_t) finfo.size); - apr_file_close(thefile); + ABTS_TRUE(tc, bytes == (fspr_size_t) finfo.size); + fspr_file_close(thefile); } static void test_mtime_set(abts_case *tc, void *data) { - apr_file_t *thefile; - apr_finfo_t finfo; - apr_time_t epoch = 0; - apr_status_t rv; + fspr_file_t *thefile; + fspr_finfo_t finfo; + fspr_time_t epoch = 0; + fspr_status_t rv; /* This test sort of depends on the system clock being at least * marginally ccorrect; We'll be setting the modification time to * the epoch. */ - rv = apr_file_open(&thefile, NEWFILENAME, + rv = fspr_file_open(&thefile, NEWFILENAME, APR_READ | APR_WRITE | APR_CREATE | APR_TRUNCATE | APR_BUFFERED | APR_DELONCLOSE, APR_OS_DEFAULT, p); APR_ASSERT_SUCCESS(tc, "open file", rv); /* Check that the current mtime is not the epoch */ - rv = apr_stat(&finfo, NEWFILENAME, APR_FINFO_MTIME, p); + rv = fspr_stat(&finfo, NEWFILENAME, APR_FINFO_MTIME, p); if (rv == APR_INCOMPLETE) { char *str; int i; - str = apr_pstrdup(p, "APR_INCOMPLETE: Missing "); + str = fspr_pstrdup(p, "APR_INCOMPLETE: Missing "); for (i = 0; vfi[i].bits; ++i) { if (vfi[i].bits & ~finfo.valid) { - str = apr_pstrcat(p, str, vfi[i].description, " ", NULL); + str = fspr_pstrcat(p, str, vfi[i].description, " ", NULL); } } ABTS_FAIL(tc, str); @@ -235,17 +235,17 @@ static void test_mtime_set(abts_case *tc, void *data) ABTS_TRUE(tc, finfo.mtime != epoch); /* Reset the mtime to the epoch and verify the result. - * Note: we blindly assume that if the first apr_stat succeeded, + * Note: we blindly assume that if the first fspr_stat succeeded, * the second one will, too. */ - rv = apr_file_mtime_set(NEWFILENAME, epoch, p); + rv = fspr_file_mtime_set(NEWFILENAME, epoch, p); APR_ASSERT_SUCCESS(tc, "set mtime", rv); - rv = apr_stat(&finfo, NEWFILENAME, APR_FINFO_MTIME, p); + rv = fspr_stat(&finfo, NEWFILENAME, APR_FINFO_MTIME, p); APR_ASSERT_SUCCESS(tc, "get modified mtime", rv); ABTS_TRUE(tc, finfo.mtime == epoch); - apr_file_close(thefile); + fspr_file_close(thefile); } abts_suite *testfileinfo(abts_suite *suite) diff --git a/libs/apr/test/testflock.c b/libs/apr/test/testflock.c index 6eac94a7a0..545ba300ce 100644 --- a/libs/apr/test/testflock.c +++ b/libs/apr/test/testflock.c @@ -16,39 +16,39 @@ #include "testflock.h" #include "testutil.h" -#include "apr_pools.h" -#include "apr_thread_proc.h" -#include "apr_file_io.h" -#include "apr_file_info.h" -#include "apr_general.h" -#include "apr_strings.h" +#include "fspr_pools.h" +#include "fspr_thread_proc.h" +#include "fspr_file_io.h" +#include "fspr_file_info.h" +#include "fspr_general.h" +#include "fspr_strings.h" static int launch_reader(abts_case *tc) { - apr_proc_t proc = {0}; - apr_procattr_t *procattr; + fspr_proc_t proc = {0}; + fspr_procattr_t *procattr; const char *args[2]; - apr_status_t rv; - apr_exit_why_e why; + fspr_status_t rv; + fspr_exit_why_e why; int exitcode; - rv = apr_procattr_create(&procattr, p); + rv = fspr_procattr_create(&procattr, p); APR_ASSERT_SUCCESS(tc, "Couldn't create procattr", rv); - rv = apr_procattr_io_set(procattr, APR_NO_PIPE, APR_NO_PIPE, + rv = fspr_procattr_io_set(procattr, APR_NO_PIPE, APR_NO_PIPE, APR_NO_PIPE); APR_ASSERT_SUCCESS(tc, "Couldn't set io in procattr", rv); - rv = apr_procattr_error_check_set(procattr, 1); + rv = fspr_procattr_error_check_set(procattr, 1); APR_ASSERT_SUCCESS(tc, "Couldn't set error check in procattr", rv); args[0] = "tryread" EXTENSION; args[1] = NULL; - rv = apr_proc_create(&proc, "./tryread" EXTENSION, args, NULL, procattr, p); + rv = fspr_proc_create(&proc, "./tryread" EXTENSION, args, NULL, procattr, p); APR_ASSERT_SUCCESS(tc, "Couldn't launch program", rv); ABTS_ASSERT(tc, "wait for child process", - apr_proc_wait(&proc, &exitcode, &why, APR_WAIT) == APR_CHILD_DONE); + fspr_proc_wait(&proc, &exitcode, &why, APR_WAIT) == APR_CHILD_DONE); ABTS_ASSERT(tc, "child terminated normally", why == APR_PROC_EXIT); return exitcode; @@ -56,23 +56,23 @@ static int launch_reader(abts_case *tc) static void test_withlock(abts_case *tc, void *data) { - apr_file_t *file; - apr_status_t rv; + fspr_file_t *file; + fspr_status_t rv; int code; - rv = apr_file_open(&file, TESTFILE, APR_WRITE|APR_CREATE, + rv = fspr_file_open(&file, TESTFILE, APR_WRITE|APR_CREATE, APR_OS_DEFAULT, p); APR_ASSERT_SUCCESS(tc, "Could not create file.", rv); ABTS_PTR_NOTNULL(tc, file); - rv = apr_file_lock(file, APR_FLOCK_EXCLUSIVE); + rv = fspr_file_lock(file, APR_FLOCK_EXCLUSIVE); APR_ASSERT_SUCCESS(tc, "Could not lock the file.", rv); ABTS_PTR_NOTNULL(tc, file); code = launch_reader(tc); ABTS_INT_EQUAL(tc, FAILED_READ, code); - (void) apr_file_close(file); + (void) fspr_file_close(file); } static void test_withoutlock(abts_case *tc, void *data) @@ -86,7 +86,7 @@ static void test_withoutlock(abts_case *tc, void *data) static void remove_lockfile(abts_case *tc, void *data) { APR_ASSERT_SUCCESS(tc, "Couldn't remove lock file.", - apr_file_remove(TESTFILE, p)); + fspr_file_remove(TESTFILE, p)); } abts_suite *testflock(abts_suite *suite) diff --git a/libs/apr/test/testfmt.c b/libs/apr/test/testfmt.c index 9ddb639f0f..5e345c45e8 100644 --- a/libs/apr/test/testfmt.c +++ b/libs/apr/test/testfmt.c @@ -15,40 +15,40 @@ */ #include "testutil.h" -#include "apr.h" -#include "apr_portable.h" -#include "apr_strings.h" +#include "fspr.h" +#include "fspr_portable.h" +#include "fspr_strings.h" static void ssize_t_fmt(abts_case *tc, void *data) { char buf[100]; - apr_ssize_t var = 0; + fspr_ssize_t var = 0; sprintf(buf, "%" APR_SSIZE_T_FMT, var); ABTS_STR_EQUAL(tc, "0", buf); - apr_snprintf(buf, sizeof(buf), "%" APR_SSIZE_T_FMT, var); + fspr_snprintf(buf, sizeof(buf), "%" APR_SSIZE_T_FMT, var); ABTS_STR_EQUAL(tc, "0", buf); } static void size_t_fmt(abts_case *tc, void *data) { char buf[100]; - apr_size_t var = 0; + fspr_size_t var = 0; sprintf(buf, "%" APR_SIZE_T_FMT, var); ABTS_STR_EQUAL(tc, "0", buf); - apr_snprintf(buf, sizeof(buf), "%" APR_SIZE_T_FMT, var); + fspr_snprintf(buf, sizeof(buf), "%" APR_SIZE_T_FMT, var); ABTS_STR_EQUAL(tc, "0", buf); } static void off_t_fmt(abts_case *tc, void *data) { char buf[100]; - apr_off_t var = 0; + fspr_off_t var = 0; sprintf(buf, "%" APR_OFF_T_FMT, var); ABTS_STR_EQUAL(tc, "0", buf); - apr_snprintf(buf, sizeof(buf), "%" APR_OFF_T_FMT, var); + fspr_snprintf(buf, sizeof(buf), "%" APR_OFF_T_FMT, var); ABTS_STR_EQUAL(tc, "0", buf); } @@ -59,61 +59,61 @@ static void pid_t_fmt(abts_case *tc, void *data) sprintf(buf, "%" APR_PID_T_FMT, var); ABTS_STR_EQUAL(tc, "0", buf); - apr_snprintf(buf, sizeof(buf), "%" APR_PID_T_FMT, var); + fspr_snprintf(buf, sizeof(buf), "%" APR_PID_T_FMT, var); ABTS_STR_EQUAL(tc, "0", buf); } static void int64_t_fmt(abts_case *tc, void *data) { char buf[100]; - apr_int64_t var = 0; + fspr_int64_t var = 0; sprintf(buf, "%" APR_INT64_T_FMT, var); ABTS_STR_EQUAL(tc, "0", buf); - apr_snprintf(buf, sizeof(buf), "%" APR_INT64_T_FMT, var); + fspr_snprintf(buf, sizeof(buf), "%" APR_INT64_T_FMT, var); ABTS_STR_EQUAL(tc, "0", buf); } static void uint64_t_fmt(abts_case *tc, void *data) { char buf[100]; - apr_uint64_t var = APR_UINT64_C(14000000); + fspr_uint64_t var = APR_UINT64_C(14000000); sprintf(buf, "%" APR_UINT64_T_FMT, var); ABTS_STR_EQUAL(tc, "14000000", buf); - apr_snprintf(buf, sizeof(buf), "%" APR_UINT64_T_FMT, var); + fspr_snprintf(buf, sizeof(buf), "%" APR_UINT64_T_FMT, var); ABTS_STR_EQUAL(tc, "14000000", buf); } static void uint64_t_hex_fmt(abts_case *tc, void *data) { char buf[100]; - apr_uint64_t var = APR_UINT64_C(14000000); + fspr_uint64_t var = APR_UINT64_C(14000000); sprintf(buf, "%" APR_UINT64_T_HEX_FMT, var); ABTS_STR_EQUAL(tc, "d59f80", buf); - apr_snprintf(buf, sizeof(buf), "%" APR_UINT64_T_HEX_FMT, var); + fspr_snprintf(buf, sizeof(buf), "%" APR_UINT64_T_HEX_FMT, var); ABTS_STR_EQUAL(tc, "d59f80", buf); } static void more_int64_fmts(abts_case *tc, void *data) { char buf[100]; - apr_int64_t i = APR_INT64_C(-42); - apr_int64_t ibig = APR_INT64_C(-314159265358979323); - apr_uint64_t ui = APR_UINT64_C(42); - apr_uint64_t big = APR_UINT64_C(3141592653589793238); + fspr_int64_t i = APR_INT64_C(-42); + fspr_int64_t ibig = APR_INT64_C(-314159265358979323); + fspr_uint64_t ui = APR_UINT64_C(42); + fspr_uint64_t big = APR_UINT64_C(3141592653589793238); - apr_snprintf(buf, sizeof buf, "%" APR_INT64_T_FMT, i); + fspr_snprintf(buf, sizeof buf, "%" APR_INT64_T_FMT, i); ABTS_STR_EQUAL(tc, buf, "-42"); - apr_snprintf(buf, sizeof buf, "%" APR_UINT64_T_FMT, ui); + fspr_snprintf(buf, sizeof buf, "%" APR_UINT64_T_FMT, ui); ABTS_STR_EQUAL(tc, buf, "42"); - apr_snprintf(buf, sizeof buf, "%" APR_UINT64_T_FMT, big); + fspr_snprintf(buf, sizeof buf, "%" APR_UINT64_T_FMT, big); ABTS_STR_EQUAL(tc, buf, "3141592653589793238"); - apr_snprintf(buf, sizeof buf, "%" APR_INT64_T_FMT, ibig); + fspr_snprintf(buf, sizeof buf, "%" APR_INT64_T_FMT, ibig); ABTS_STR_EQUAL(tc, buf, "-314159265358979323"); } diff --git a/libs/apr/test/testfnmatch.c b/libs/apr/test/testfnmatch.c index b54502fd29..41f8bb34b2 100644 --- a/libs/apr/test/testfnmatch.c +++ b/libs/apr/test/testfnmatch.c @@ -15,9 +15,9 @@ */ #include "testutil.h" -#include "apr_file_info.h" -#include "apr_fnmatch.h" -#include "apr_tables.h" +#include "fspr_file_info.h" +#include "fspr_fnmatch.h" +#include "fspr_tables.h" /* XXX NUM_FILES must be equal to the nummber of expected files with a * .txt extension in the data directory at the time testfnmatch @@ -29,10 +29,10 @@ static void test_glob(abts_case *tc, void *data) { int i; char **list; - apr_array_header_t *result; + fspr_array_header_t *result; APR_ASSERT_SUCCESS(tc, "glob match against data/*.txt", - apr_match_glob("data\\*.txt", &result, p)); + fspr_match_glob("data\\*.txt", &result, p)); ABTS_INT_EQUAL(tc, NUM_FILES, result->nelts); @@ -47,11 +47,11 @@ static void test_glob_currdir(abts_case *tc, void *data) { int i; char **list; - apr_array_header_t *result; - apr_filepath_set("data", p); + fspr_array_header_t *result; + fspr_filepath_set("data", p); APR_ASSERT_SUCCESS(tc, "glob match against *.txt with data as current", - apr_match_glob("*.txt", &result, p)); + fspr_match_glob("*.txt", &result, p)); ABTS_INT_EQUAL(tc, NUM_FILES, result->nelts); @@ -61,7 +61,7 @@ static void test_glob_currdir(abts_case *tc, void *data) char *dot = strrchr(list[i], '.'); ABTS_STR_EQUAL(tc, dot, ".txt"); } - apr_filepath_set("..", p); + fspr_filepath_set("..", p); } abts_suite *testfnmatch(abts_suite *suite) diff --git a/libs/apr/test/testglobalmutex.c b/libs/apr/test/testglobalmutex.c index a10742d92f..b0d2f50976 100644 --- a/libs/apr/test/testglobalmutex.c +++ b/libs/apr/test/testglobalmutex.c @@ -15,51 +15,51 @@ */ #include "testglobalmutex.h" -#include "apr_thread_proc.h" -#include "apr_global_mutex.h" -#include "apr_strings.h" -#include "apr_errno.h" +#include "fspr_thread_proc.h" +#include "fspr_global_mutex.h" +#include "fspr_strings.h" +#include "fspr_errno.h" #include "testutil.h" -static void launch_child(abts_case *tc, apr_lockmech_e mech, - apr_proc_t *proc, apr_pool_t *p) +static void launch_child(abts_case *tc, fspr_lockmech_e mech, + fspr_proc_t *proc, fspr_pool_t *p) { - apr_procattr_t *procattr; + fspr_procattr_t *procattr; const char *args[3]; - apr_status_t rv; + fspr_status_t rv; - rv = apr_procattr_create(&procattr, p); + rv = fspr_procattr_create(&procattr, p); APR_ASSERT_SUCCESS(tc, "Couldn't create procattr", rv); - rv = apr_procattr_io_set(procattr, APR_NO_PIPE, APR_NO_PIPE, + rv = fspr_procattr_io_set(procattr, APR_NO_PIPE, APR_NO_PIPE, APR_NO_PIPE); APR_ASSERT_SUCCESS(tc, "Couldn't set io in procattr", rv); - rv = apr_procattr_error_check_set(procattr, 1); + rv = fspr_procattr_error_check_set(procattr, 1); APR_ASSERT_SUCCESS(tc, "Couldn't set error check in procattr", rv); args[0] = "globalmutexchild" EXTENSION; - args[1] = (const char*)apr_itoa(p, (int)mech); + args[1] = (const char*)fspr_itoa(p, (int)mech); args[2] = NULL; - rv = apr_proc_create(proc, "./globalmutexchild" EXTENSION, args, NULL, + rv = fspr_proc_create(proc, "./globalmutexchild" EXTENSION, args, NULL, procattr, p); APR_ASSERT_SUCCESS(tc, "Couldn't launch program", rv); } -static int wait_child(abts_case *tc, apr_proc_t *proc) +static int wait_child(abts_case *tc, fspr_proc_t *proc) { int exitcode; - apr_exit_why_e why; + fspr_exit_why_e why; ABTS_ASSERT(tc, "Error waiting for child process", - apr_proc_wait(proc, &exitcode, &why, APR_WAIT) == APR_CHILD_DONE); + fspr_proc_wait(proc, &exitcode, &why, APR_WAIT) == APR_CHILD_DONE); ABTS_ASSERT(tc, "child didn't terminate normally", why == APR_PROC_EXIT); return exitcode; } /* return symbolic name for a locking meechanism */ -static const char *mutexname(apr_lockmech_e mech) +static const char *mutexname(fspr_lockmech_e mech) { switch (mech) { case APR_LOCK_FCNTL: return "fcntl"; @@ -74,15 +74,15 @@ static const char *mutexname(apr_lockmech_e mech) static void test_exclusive(abts_case *tc, void *data) { - apr_lockmech_e mech = *(apr_lockmech_e *)data; - apr_proc_t p1, p2, p3, p4; - apr_status_t rv; - apr_global_mutex_t *global_lock; + fspr_lockmech_e mech = *(fspr_lockmech_e *)data; + fspr_proc_t p1, p2, p3, p4; + fspr_status_t rv; + fspr_global_mutex_t *global_lock; int x = 0; abts_log_message("lock mechanism is: "); abts_log_message(mutexname(mech)); - rv = apr_global_mutex_create(&global_lock, LOCKNAME, mech, p); + rv = fspr_global_mutex_create(&global_lock, LOCKNAME, mech, p); APR_ASSERT_SUCCESS(tc, "Error creating mutex", rv); launch_child(tc, mech, &p1, p); @@ -105,7 +105,7 @@ static void test_exclusive(abts_case *tc, void *data) abts_suite *testglobalmutex(abts_suite *suite) { - apr_lockmech_e mech = APR_LOCK_DEFAULT; + fspr_lockmech_e mech = APR_LOCK_DEFAULT; suite = ADD_SUITE(suite) abts_run_test(suite, test_exclusive, &mech); diff --git a/libs/apr/test/testglobalmutex.h b/libs/apr/test/testglobalmutex.h index 027062843d..a23df50fe4 100644 --- a/libs/apr/test/testglobalmutex.h +++ b/libs/apr/test/testglobalmutex.h @@ -21,7 +21,7 @@ #define MAX_ITER 255 #define MAX_COUNTER (MAX_ITER * 4) -#define LOCKNAME "data/apr_globalmutex.lock" +#define LOCKNAME "data/fspr_globalmutex.lock" #endif diff --git a/libs/apr/test/testhash.c b/libs/apr/test/testhash.c index c9b1cdb07c..924d722e6e 100644 --- a/libs/apr/test/testhash.c +++ b/libs/apr/test/testhash.c @@ -15,41 +15,41 @@ */ #include "testutil.h" -#include "apr.h" -#include "apr_strings.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_hash.h" +#include "fspr.h" +#include "fspr_strings.h" +#include "fspr_general.h" +#include "fspr_pools.h" +#include "fspr_hash.h" -static void dump_hash(apr_pool_t *p, apr_hash_t *h, char *str) +static void dump_hash(fspr_pool_t *p, fspr_hash_t *h, char *str) { - apr_hash_index_t *hi; + fspr_hash_index_t *hi; char *val, *key; - apr_ssize_t len; + fspr_ssize_t len; int i = 0; str[0] = '\0'; - for (hi = apr_hash_first(p, h); hi; hi = apr_hash_next(hi)) { - apr_hash_this(hi,(void*) &key, &len, (void*) &val); - apr_snprintf(str, 8196, "%sKey %s (%" APR_SSIZE_T_FMT ") Value %s\n", + for (hi = fspr_hash_first(p, h); hi; hi = fspr_hash_next(hi)) { + fspr_hash_this(hi,(void*) &key, &len, (void*) &val); + fspr_snprintf(str, 8196, "%sKey %s (%" APR_SSIZE_T_FMT ") Value %s\n", str, key, len, val); i++; } - apr_snprintf(str, 8196, "%s#entries %d\n", str, i); + fspr_snprintf(str, 8196, "%s#entries %d\n", str, i); } -static void sum_hash(apr_pool_t *p, apr_hash_t *h, int *pcount, int *keySum, int *valSum) +static void sum_hash(fspr_pool_t *p, fspr_hash_t *h, int *pcount, int *keySum, int *valSum) { - apr_hash_index_t *hi; + fspr_hash_index_t *hi; void *val, *key; int count = 0; *keySum = 0; *valSum = 0; *pcount = 0; - for (hi = apr_hash_first(p, h); hi; hi = apr_hash_next(hi)) { - apr_hash_this(hi, (void*)&key, NULL, &val); + for (hi = fspr_hash_first(p, h); hi; hi = fspr_hash_next(hi)) { + fspr_hash_this(hi, (void*)&key, NULL, &val); *valSum += *(int *)val; *keySum += *(int *)key; count++; @@ -59,60 +59,60 @@ static void sum_hash(apr_pool_t *p, apr_hash_t *h, int *pcount, int *keySum, int static void hash_make(abts_case *tc, void *data) { - apr_hash_t *h = NULL; + fspr_hash_t *h = NULL; - h = apr_hash_make(p); + h = fspr_hash_make(p); ABTS_PTR_NOTNULL(tc, h); } static void hash_set(abts_case *tc, void *data) { - apr_hash_t *h = NULL; + fspr_hash_t *h = NULL; char *result = NULL; - h = apr_hash_make(p); + h = fspr_hash_make(p); ABTS_PTR_NOTNULL(tc, h); - apr_hash_set(h, "key", APR_HASH_KEY_STRING, "value"); - result = apr_hash_get(h, "key", APR_HASH_KEY_STRING); + fspr_hash_set(h, "key", APR_HASH_KEY_STRING, "value"); + result = fspr_hash_get(h, "key", APR_HASH_KEY_STRING); ABTS_STR_EQUAL(tc, "value", result); } static void hash_reset(abts_case *tc, void *data) { - apr_hash_t *h = NULL; + fspr_hash_t *h = NULL; char *result = NULL; - h = apr_hash_make(p); + h = fspr_hash_make(p); ABTS_PTR_NOTNULL(tc, h); - apr_hash_set(h, "key", APR_HASH_KEY_STRING, "value"); - result = apr_hash_get(h, "key", APR_HASH_KEY_STRING); + fspr_hash_set(h, "key", APR_HASH_KEY_STRING, "value"); + result = fspr_hash_get(h, "key", APR_HASH_KEY_STRING); ABTS_STR_EQUAL(tc, "value", result); - apr_hash_set(h, "key", APR_HASH_KEY_STRING, "new"); - result = apr_hash_get(h, "key", APR_HASH_KEY_STRING); + fspr_hash_set(h, "key", APR_HASH_KEY_STRING, "new"); + result = fspr_hash_get(h, "key", APR_HASH_KEY_STRING); ABTS_STR_EQUAL(tc, "new", result); } static void same_value(abts_case *tc, void *data) { - apr_hash_t *h = NULL; + fspr_hash_t *h = NULL; char *result = NULL; - h = apr_hash_make(p); + h = fspr_hash_make(p); ABTS_PTR_NOTNULL(tc, h); - apr_hash_set(h, "same1", APR_HASH_KEY_STRING, "same"); - result = apr_hash_get(h, "same1", APR_HASH_KEY_STRING); + fspr_hash_set(h, "same1", APR_HASH_KEY_STRING, "same"); + result = fspr_hash_get(h, "same1", APR_HASH_KEY_STRING); ABTS_STR_EQUAL(tc, "same", result); - apr_hash_set(h, "same2", APR_HASH_KEY_STRING, "same"); - result = apr_hash_get(h, "same2", APR_HASH_KEY_STRING); + fspr_hash_set(h, "same2", APR_HASH_KEY_STRING, "same"); + result = fspr_hash_get(h, "same2", APR_HASH_KEY_STRING); ABTS_STR_EQUAL(tc, "same", result); } -static unsigned int hash_custom( const char *key, apr_ssize_t *klen) +static unsigned int hash_custom( const char *key, fspr_ssize_t *klen) { unsigned int hash = 0; while( *klen ) { @@ -124,55 +124,55 @@ static unsigned int hash_custom( const char *key, apr_ssize_t *klen) static void same_value_custom(abts_case *tc, void *data) { - apr_hash_t *h = NULL; + fspr_hash_t *h = NULL; char *result = NULL; - h = apr_hash_make_custom(p, hash_custom); + h = fspr_hash_make_custom(p, hash_custom); ABTS_PTR_NOTNULL(tc, h); - apr_hash_set(h, "same1", 5, "same"); - result = apr_hash_get(h, "same1", 5); + fspr_hash_set(h, "same1", 5, "same"); + result = fspr_hash_get(h, "same1", 5); ABTS_STR_EQUAL(tc, "same", result); - apr_hash_set(h, "same2", 5, "same"); - result = apr_hash_get(h, "same2", 5); + fspr_hash_set(h, "same2", 5, "same"); + result = fspr_hash_get(h, "same2", 5); ABTS_STR_EQUAL(tc, "same", result); } static void key_space(abts_case *tc, void *data) { - apr_hash_t *h = NULL; + fspr_hash_t *h = NULL; char *result = NULL; - h = apr_hash_make(p); + h = fspr_hash_make(p); ABTS_PTR_NOTNULL(tc, h); - apr_hash_set(h, "key with space", APR_HASH_KEY_STRING, "value"); - result = apr_hash_get(h, "key with space", APR_HASH_KEY_STRING); + fspr_hash_set(h, "key with space", APR_HASH_KEY_STRING, "value"); + result = fspr_hash_get(h, "key with space", APR_HASH_KEY_STRING); ABTS_STR_EQUAL(tc, "value", result); } /* This is kind of a hack, but I am just keeping an existing test. This is - * really testing apr_hash_first, apr_hash_next, and apr_hash_this which + * really testing fspr_hash_first, fspr_hash_next, and fspr_hash_this which * should be tested in three separate tests, but this will do for now. */ static void hash_traverse(abts_case *tc, void *data) { - apr_hash_t *h; + fspr_hash_t *h; char str[8196]; - h = apr_hash_make(p); + h = fspr_hash_make(p); ABTS_PTR_NOTNULL(tc, h); - apr_hash_set(h, "OVERWRITE", APR_HASH_KEY_STRING, "should not see this"); - apr_hash_set(h, "FOO3", APR_HASH_KEY_STRING, "bar3"); - apr_hash_set(h, "FOO3", APR_HASH_KEY_STRING, "bar3"); - apr_hash_set(h, "FOO1", APR_HASH_KEY_STRING, "bar1"); - apr_hash_set(h, "FOO2", APR_HASH_KEY_STRING, "bar2"); - apr_hash_set(h, "FOO4", APR_HASH_KEY_STRING, "bar4"); - apr_hash_set(h, "SAME1", APR_HASH_KEY_STRING, "same"); - apr_hash_set(h, "SAME2", APR_HASH_KEY_STRING, "same"); - apr_hash_set(h, "OVERWRITE", APR_HASH_KEY_STRING, "Overwrite key"); + fspr_hash_set(h, "OVERWRITE", APR_HASH_KEY_STRING, "should not see this"); + fspr_hash_set(h, "FOO3", APR_HASH_KEY_STRING, "bar3"); + fspr_hash_set(h, "FOO3", APR_HASH_KEY_STRING, "bar3"); + fspr_hash_set(h, "FOO1", APR_HASH_KEY_STRING, "bar1"); + fspr_hash_set(h, "FOO2", APR_HASH_KEY_STRING, "bar2"); + fspr_hash_set(h, "FOO4", APR_HASH_KEY_STRING, "bar4"); + fspr_hash_set(h, "SAME1", APR_HASH_KEY_STRING, "same"); + fspr_hash_set(h, "SAME2", APR_HASH_KEY_STRING, "same"); + fspr_hash_set(h, "OVERWRITE", APR_HASH_KEY_STRING, "Overwrite key"); dump_hash(p, h, str); ABTS_STR_EQUAL(tc, "Key FOO1 (4) Value bar1\n" @@ -186,16 +186,16 @@ static void hash_traverse(abts_case *tc, void *data) } /* This is kind of a hack, but I am just keeping an existing test. This is - * really testing apr_hash_first, apr_hash_next, and apr_hash_this which + * really testing fspr_hash_first, fspr_hash_next, and fspr_hash_this which * should be tested in three separate tests, but this will do for now. */ static void summation_test(abts_case *tc, void *data) { - apr_hash_t *h; + fspr_hash_t *h; int sumKeys, sumVal, trySumKey, trySumVal; int i, j, *val, *key; - h =apr_hash_make(p); + h =fspr_hash_make(p); ABTS_PTR_NOTNULL(tc, h); sumKeys = 0; @@ -207,11 +207,11 @@ static void summation_test(abts_case *tc, void *data) j = i * 10 + 1; sumKeys += j; sumVal += i; - key = apr_palloc(p, sizeof(int)); + key = fspr_palloc(p, sizeof(int)); *key = j; - val = apr_palloc(p, sizeof(int)); + val = fspr_palloc(p, sizeof(int)); *val = i; - apr_hash_set(h, key, sizeof(int), val); + fspr_hash_set(h, key, sizeof(int), val); } sum_hash(p, h, &i, &trySumKey, &trySumVal); @@ -222,96 +222,96 @@ static void summation_test(abts_case *tc, void *data) static void delete_key(abts_case *tc, void *data) { - apr_hash_t *h = NULL; + fspr_hash_t *h = NULL; char *result = NULL; - h = apr_hash_make(p); + h = fspr_hash_make(p); ABTS_PTR_NOTNULL(tc, h); - apr_hash_set(h, "key", APR_HASH_KEY_STRING, "value"); - apr_hash_set(h, "key2", APR_HASH_KEY_STRING, "value2"); + fspr_hash_set(h, "key", APR_HASH_KEY_STRING, "value"); + fspr_hash_set(h, "key2", APR_HASH_KEY_STRING, "value2"); - result = apr_hash_get(h, "key", APR_HASH_KEY_STRING); + result = fspr_hash_get(h, "key", APR_HASH_KEY_STRING); ABTS_STR_EQUAL(tc, "value", result); - result = apr_hash_get(h, "key2", APR_HASH_KEY_STRING); + result = fspr_hash_get(h, "key2", APR_HASH_KEY_STRING); ABTS_STR_EQUAL(tc, "value2", result); - apr_hash_set(h, "key", APR_HASH_KEY_STRING, NULL); + fspr_hash_set(h, "key", APR_HASH_KEY_STRING, NULL); - result = apr_hash_get(h, "key", APR_HASH_KEY_STRING); + result = fspr_hash_get(h, "key", APR_HASH_KEY_STRING); ABTS_PTR_EQUAL(tc, NULL, result); - result = apr_hash_get(h, "key2", APR_HASH_KEY_STRING); + result = fspr_hash_get(h, "key2", APR_HASH_KEY_STRING); ABTS_STR_EQUAL(tc, "value2", result); } static void hash_count_0(abts_case *tc, void *data) { - apr_hash_t *h = NULL; + fspr_hash_t *h = NULL; int count; - h = apr_hash_make(p); + h = fspr_hash_make(p); ABTS_PTR_NOTNULL(tc, h); - count = apr_hash_count(h); + count = fspr_hash_count(h); ABTS_INT_EQUAL(tc, 0, count); } static void hash_count_1(abts_case *tc, void *data) { - apr_hash_t *h = NULL; + fspr_hash_t *h = NULL; int count; - h = apr_hash_make(p); + h = fspr_hash_make(p); ABTS_PTR_NOTNULL(tc, h); - apr_hash_set(h, "key", APR_HASH_KEY_STRING, "value"); + fspr_hash_set(h, "key", APR_HASH_KEY_STRING, "value"); - count = apr_hash_count(h); + count = fspr_hash_count(h); ABTS_INT_EQUAL(tc, 1, count); } static void hash_count_5(abts_case *tc, void *data) { - apr_hash_t *h = NULL; + fspr_hash_t *h = NULL; int count; - h = apr_hash_make(p); + h = fspr_hash_make(p); ABTS_PTR_NOTNULL(tc, h); - apr_hash_set(h, "key1", APR_HASH_KEY_STRING, "value1"); - apr_hash_set(h, "key2", APR_HASH_KEY_STRING, "value2"); - apr_hash_set(h, "key3", APR_HASH_KEY_STRING, "value3"); - apr_hash_set(h, "key4", APR_HASH_KEY_STRING, "value4"); - apr_hash_set(h, "key5", APR_HASH_KEY_STRING, "value5"); + fspr_hash_set(h, "key1", APR_HASH_KEY_STRING, "value1"); + fspr_hash_set(h, "key2", APR_HASH_KEY_STRING, "value2"); + fspr_hash_set(h, "key3", APR_HASH_KEY_STRING, "value3"); + fspr_hash_set(h, "key4", APR_HASH_KEY_STRING, "value4"); + fspr_hash_set(h, "key5", APR_HASH_KEY_STRING, "value5"); - count = apr_hash_count(h); + count = fspr_hash_count(h); ABTS_INT_EQUAL(tc, 5, count); } static void overlay_empty(abts_case *tc, void *data) { - apr_hash_t *base = NULL; - apr_hash_t *overlay = NULL; - apr_hash_t *result = NULL; + fspr_hash_t *base = NULL; + fspr_hash_t *overlay = NULL; + fspr_hash_t *result = NULL; int count; char str[8196]; - base = apr_hash_make(p); - overlay = apr_hash_make(p); + base = fspr_hash_make(p); + overlay = fspr_hash_make(p); ABTS_PTR_NOTNULL(tc, base); ABTS_PTR_NOTNULL(tc, overlay); - apr_hash_set(base, "key1", APR_HASH_KEY_STRING, "value1"); - apr_hash_set(base, "key2", APR_HASH_KEY_STRING, "value2"); - apr_hash_set(base, "key3", APR_HASH_KEY_STRING, "value3"); - apr_hash_set(base, "key4", APR_HASH_KEY_STRING, "value4"); - apr_hash_set(base, "key5", APR_HASH_KEY_STRING, "value5"); + fspr_hash_set(base, "key1", APR_HASH_KEY_STRING, "value1"); + fspr_hash_set(base, "key2", APR_HASH_KEY_STRING, "value2"); + fspr_hash_set(base, "key3", APR_HASH_KEY_STRING, "value3"); + fspr_hash_set(base, "key4", APR_HASH_KEY_STRING, "value4"); + fspr_hash_set(base, "key5", APR_HASH_KEY_STRING, "value5"); - result = apr_hash_overlay(p, overlay, base); + result = fspr_hash_overlay(p, overlay, base); - count = apr_hash_count(result); + count = fspr_hash_count(result); ABTS_INT_EQUAL(tc, 5, count); dump_hash(p, result, str); @@ -325,32 +325,32 @@ static void overlay_empty(abts_case *tc, void *data) static void overlay_2unique(abts_case *tc, void *data) { - apr_hash_t *base = NULL; - apr_hash_t *overlay = NULL; - apr_hash_t *result = NULL; + fspr_hash_t *base = NULL; + fspr_hash_t *overlay = NULL; + fspr_hash_t *result = NULL; int count; char str[8196]; - base = apr_hash_make(p); - overlay = apr_hash_make(p); + base = fspr_hash_make(p); + overlay = fspr_hash_make(p); ABTS_PTR_NOTNULL(tc, base); ABTS_PTR_NOTNULL(tc, overlay); - apr_hash_set(base, "base1", APR_HASH_KEY_STRING, "value1"); - apr_hash_set(base, "base2", APR_HASH_KEY_STRING, "value2"); - apr_hash_set(base, "base3", APR_HASH_KEY_STRING, "value3"); - apr_hash_set(base, "base4", APR_HASH_KEY_STRING, "value4"); - apr_hash_set(base, "base5", APR_HASH_KEY_STRING, "value5"); + fspr_hash_set(base, "base1", APR_HASH_KEY_STRING, "value1"); + fspr_hash_set(base, "base2", APR_HASH_KEY_STRING, "value2"); + fspr_hash_set(base, "base3", APR_HASH_KEY_STRING, "value3"); + fspr_hash_set(base, "base4", APR_HASH_KEY_STRING, "value4"); + fspr_hash_set(base, "base5", APR_HASH_KEY_STRING, "value5"); - apr_hash_set(overlay, "overlay1", APR_HASH_KEY_STRING, "value1"); - apr_hash_set(overlay, "overlay2", APR_HASH_KEY_STRING, "value2"); - apr_hash_set(overlay, "overlay3", APR_HASH_KEY_STRING, "value3"); - apr_hash_set(overlay, "overlay4", APR_HASH_KEY_STRING, "value4"); - apr_hash_set(overlay, "overlay5", APR_HASH_KEY_STRING, "value5"); + fspr_hash_set(overlay, "overlay1", APR_HASH_KEY_STRING, "value1"); + fspr_hash_set(overlay, "overlay2", APR_HASH_KEY_STRING, "value2"); + fspr_hash_set(overlay, "overlay3", APR_HASH_KEY_STRING, "value3"); + fspr_hash_set(overlay, "overlay4", APR_HASH_KEY_STRING, "value4"); + fspr_hash_set(overlay, "overlay5", APR_HASH_KEY_STRING, "value5"); - result = apr_hash_overlay(p, overlay, base); + result = fspr_hash_overlay(p, overlay, base); - count = apr_hash_count(result); + count = fspr_hash_count(result); ABTS_INT_EQUAL(tc, 10, count); dump_hash(p, result, str); @@ -372,23 +372,23 @@ static void overlay_2unique(abts_case *tc, void *data) static void overlay_same(abts_case *tc, void *data) { - apr_hash_t *base = NULL; - apr_hash_t *result = NULL; + fspr_hash_t *base = NULL; + fspr_hash_t *result = NULL; int count; char str[8196]; - base = apr_hash_make(p); + base = fspr_hash_make(p); ABTS_PTR_NOTNULL(tc, base); - apr_hash_set(base, "base1", APR_HASH_KEY_STRING, "value1"); - apr_hash_set(base, "base2", APR_HASH_KEY_STRING, "value2"); - apr_hash_set(base, "base3", APR_HASH_KEY_STRING, "value3"); - apr_hash_set(base, "base4", APR_HASH_KEY_STRING, "value4"); - apr_hash_set(base, "base5", APR_HASH_KEY_STRING, "value5"); + fspr_hash_set(base, "base1", APR_HASH_KEY_STRING, "value1"); + fspr_hash_set(base, "base2", APR_HASH_KEY_STRING, "value2"); + fspr_hash_set(base, "base3", APR_HASH_KEY_STRING, "value3"); + fspr_hash_set(base, "base4", APR_HASH_KEY_STRING, "value4"); + fspr_hash_set(base, "base5", APR_HASH_KEY_STRING, "value5"); - result = apr_hash_overlay(p, base, base); + result = fspr_hash_overlay(p, base, base); - count = apr_hash_count(result); + count = fspr_hash_count(result); ABTS_INT_EQUAL(tc, 5, count); dump_hash(p, result, str); diff --git a/libs/apr/test/testipsub.c b/libs/apr/test/testipsub.c index 1411cd05a7..bdf5b78a64 100644 --- a/libs/apr/test/testipsub.c +++ b/libs/apr/test/testipsub.c @@ -15,16 +15,16 @@ */ #include "testutil.h" -#include "apr_general.h" -#include "apr_network_io.h" -#include "apr_errno.h" +#include "fspr_general.h" +#include "fspr_network_io.h" +#include "fspr_errno.h" static void test_bad_input(abts_case *tc, void *data) { struct { const char *ipstr; const char *mask; - apr_status_t expected_rv; + fspr_status_t expected_rv; } testcases[] = { /* so we have a few good inputs in here; sue me */ @@ -63,11 +63,11 @@ static void test_bad_input(abts_case *tc, void *data) #endif }; int i; - apr_ipsubnet_t *ipsub; - apr_status_t rv; + fspr_ipsubnet_t *ipsub; + fspr_status_t rv; for (i = 0; i < (sizeof testcases / sizeof testcases[0]); i++) { - rv = apr_ipsubnet_create(&ipsub, testcases[i].ipstr, testcases[i].mask, p); + rv = fspr_ipsubnet_create(&ipsub, testcases[i].ipstr, testcases[i].mask, p); ABTS_INT_EQUAL(tc, rv, testcases[i].expected_rv); } } @@ -79,18 +79,18 @@ static void test_singleton_subnets(abts_case *tc, void *data) "198.144.203.195", "192.18.97.241", "198.137.240.91", "62.156.179.119", "204.177.92.181" }; - apr_ipsubnet_t *ipsub; - apr_sockaddr_t *sa; - apr_status_t rv; + fspr_ipsubnet_t *ipsub; + fspr_sockaddr_t *sa; + fspr_status_t rv; int i, j, rc; for (i = 0; i < sizeof v4addrs / sizeof v4addrs[0]; i++) { - rv = apr_ipsubnet_create(&ipsub, v4addrs[i], NULL, p); + rv = fspr_ipsubnet_create(&ipsub, v4addrs[i], NULL, p); ABTS_TRUE(tc, rv == APR_SUCCESS); for (j = 0; j < sizeof v4addrs / sizeof v4addrs[0]; j++) { - rv = apr_sockaddr_info_get(&sa, v4addrs[j], APR_INET, 0, 0, p); + rv = fspr_sockaddr_info_get(&sa, v4addrs[j], APR_INET, 0, 0, p); ABTS_TRUE(tc, rv == APR_SUCCESS); - rc = apr_ipsubnet_test(ipsub, sa); + rc = fspr_ipsubnet_test(ipsub, sa); if (!strcmp(v4addrs[i], v4addrs[j])) { ABTS_TRUE(tc, rc != 0); } @@ -124,21 +124,21 @@ static void test_interesting_subnets(abts_case *tc, void *data) ,{"127.0.0.1", "8", APR_INET6, "::ffff:127.0.0.1", "fe80::1"} #endif }; - apr_ipsubnet_t *ipsub; - apr_sockaddr_t *sa; - apr_status_t rv; + fspr_ipsubnet_t *ipsub; + fspr_sockaddr_t *sa; + fspr_status_t rv; int i, rc; for (i = 0; i < sizeof testcases / sizeof testcases[0]; i++) { - rv = apr_ipsubnet_create(&ipsub, testcases[i].ipstr, testcases[i].mask, p); + rv = fspr_ipsubnet_create(&ipsub, testcases[i].ipstr, testcases[i].mask, p); ABTS_TRUE(tc, rv == APR_SUCCESS); - rv = apr_sockaddr_info_get(&sa, testcases[i].in_subnet, testcases[i].family, 0, 0, p); + rv = fspr_sockaddr_info_get(&sa, testcases[i].in_subnet, testcases[i].family, 0, 0, p); ABTS_TRUE(tc, rv == APR_SUCCESS); - rc = apr_ipsubnet_test(ipsub, sa); + rc = fspr_ipsubnet_test(ipsub, sa); ABTS_TRUE(tc, rc != 0); - rv = apr_sockaddr_info_get(&sa, testcases[i].not_in_subnet, testcases[i].family, 0, 0, p); + rv = fspr_sockaddr_info_get(&sa, testcases[i].not_in_subnet, testcases[i].family, 0, 0, p); ABTS_TRUE(tc, rv == APR_SUCCESS); - rc = apr_ipsubnet_test(ipsub, sa); + rc = fspr_ipsubnet_test(ipsub, sa); ABTS_TRUE(tc, rc == 0); } } @@ -147,7 +147,7 @@ static void test_badmask_str(abts_case *tc, void *data) { char buf[128]; - ABTS_STR_EQUAL(tc, apr_strerror(APR_EBADMASK, buf, sizeof buf), + ABTS_STR_EQUAL(tc, fspr_strerror(APR_EBADMASK, buf, sizeof buf), "The specified network mask is invalid."); } @@ -155,7 +155,7 @@ static void test_badip_str(abts_case *tc, void *data) { char buf[128]; - ABTS_STR_EQUAL(tc, apr_strerror(APR_EBADIP, buf, sizeof buf), + ABTS_STR_EQUAL(tc, fspr_strerror(APR_EBADIP, buf, sizeof buf), "The specified IP address is invalid."); } diff --git a/libs/apr/test/testlfs.c b/libs/apr/test/testlfs.c index c502400eef..08b0521584 100644 --- a/libs/apr/test/testlfs.c +++ b/libs/apr/test/testlfs.c @@ -14,14 +14,14 @@ * limitations under the License. */ -#include "apr_file_io.h" -#include "apr_file_info.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_poll.h" -#include "apr_strings.h" -#include "apr_lib.h" -#include "apr_mmap.h" +#include "fspr_file_io.h" +#include "fspr_file_info.h" +#include "fspr_errno.h" +#include "fspr_general.h" +#include "fspr_poll.h" +#include "fspr_strings.h" +#include "fspr_lib.h" +#include "fspr_mmap.h" #include "testutil.h" /* Only enable these tests by default on platforms which support sparse @@ -37,7 +37,7 @@ static void test_nolfs(abts_case *tc, void *data) /* Tests which create an 8Gb sparse file and then check it can be used * as normal. */ -static apr_off_t eightGb = APR_INT64_C(2) << 32; +static fspr_off_t eightGb = APR_INT64_C(2) << 32; static int madefile = 0; @@ -49,22 +49,22 @@ static int madefile = 0; static void test_open(abts_case *tc, void *data) { - apr_file_t *f; - apr_status_t rv; + fspr_file_t *f; + fspr_status_t rv; - rv = apr_dir_make(TESTDIR, APR_OS_DEFAULT, p); + rv = fspr_dir_make(TESTDIR, APR_OS_DEFAULT, p); if (rv && !APR_STATUS_IS_EEXIST(rv)) { APR_ASSERT_SUCCESS(tc, "make test directory", rv); } APR_ASSERT_SUCCESS(tc, "open file", - apr_file_open(&f, TESTFN, + fspr_file_open(&f, TESTFN, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_OS_DEFAULT, p)); - rv = apr_file_trunc(f, eightGb); + rv = fspr_file_trunc(f, eightGb); - APR_ASSERT_SUCCESS(tc, "close large file", apr_file_close(f)); + APR_ASSERT_SUCCESS(tc, "close large file", fspr_file_close(f)); /* 8Gb may pass rlimits or filesystem limits */ @@ -84,178 +84,178 @@ static void test_open(abts_case *tc, void *data) static void test_reopen(abts_case *tc, void *data) { - apr_file_t *fh; - apr_finfo_t finfo; + fspr_file_t *fh; + fspr_finfo_t finfo; PRECOND; APR_ASSERT_SUCCESS(tc, "re-open 8Gb file", - apr_file_open(&fh, TESTFN, APR_READ, APR_OS_DEFAULT, p)); + fspr_file_open(&fh, TESTFN, APR_READ, APR_OS_DEFAULT, p)); APR_ASSERT_SUCCESS(tc, "file_info_get failed", - apr_file_info_get(&finfo, APR_FINFO_NORM, fh)); + fspr_file_info_get(&finfo, APR_FINFO_NORM, fh)); ABTS_ASSERT(tc, "file_info_get gave incorrect size", finfo.size == eightGb); - APR_ASSERT_SUCCESS(tc, "re-close large file", apr_file_close(fh)); + APR_ASSERT_SUCCESS(tc, "re-close large file", fspr_file_close(fh)); } static void test_stat(abts_case *tc, void *data) { - apr_finfo_t finfo; + fspr_finfo_t finfo; PRECOND; APR_ASSERT_SUCCESS(tc, "stat large file", - apr_stat(&finfo, TESTFN, APR_FINFO_NORM, p)); + fspr_stat(&finfo, TESTFN, APR_FINFO_NORM, p)); ABTS_ASSERT(tc, "stat gave incorrect size", finfo.size == eightGb); } static void test_readdir(abts_case *tc, void *data) { - apr_dir_t *dh; - apr_status_t rv; + fspr_dir_t *dh; + fspr_status_t rv; PRECOND; APR_ASSERT_SUCCESS(tc, "open test directory", - apr_dir_open(&dh, TESTDIR, p)); + fspr_dir_open(&dh, TESTDIR, p)); do { - apr_finfo_t finfo; + fspr_finfo_t finfo; - rv = apr_dir_read(&finfo, APR_FINFO_NORM, dh); + rv = fspr_dir_read(&finfo, APR_FINFO_NORM, dh); if (rv == APR_SUCCESS && strcmp(finfo.name, TESTFILE) == 0) { - ABTS_ASSERT(tc, "apr_dir_read gave incorrect size for large file", + ABTS_ASSERT(tc, "fspr_dir_read gave incorrect size for large file", finfo.size == eightGb); } } while (rv == APR_SUCCESS); if (!APR_STATUS_IS_ENOENT(rv)) { - APR_ASSERT_SUCCESS(tc, "apr_dir_read failed", rv); + APR_ASSERT_SUCCESS(tc, "fspr_dir_read failed", rv); } APR_ASSERT_SUCCESS(tc, "close test directory", - apr_dir_close(dh)); + fspr_dir_close(dh)); } #define TESTSTR "Hello, world." static void test_append(abts_case *tc, void *data) { - apr_file_t *fh; - apr_finfo_t finfo; + fspr_file_t *fh; + fspr_finfo_t finfo; PRECOND; APR_ASSERT_SUCCESS(tc, "open 8Gb file for append", - apr_file_open(&fh, TESTFN, APR_WRITE | APR_APPEND, + fspr_file_open(&fh, TESTFN, APR_WRITE | APR_APPEND, APR_OS_DEFAULT, p)); APR_ASSERT_SUCCESS(tc, "append to 8Gb file", - apr_file_write_full(fh, TESTSTR, strlen(TESTSTR), NULL)); + fspr_file_write_full(fh, TESTSTR, strlen(TESTSTR), NULL)); APR_ASSERT_SUCCESS(tc, "file_info_get failed", - apr_file_info_get(&finfo, APR_FINFO_NORM, fh)); + fspr_file_info_get(&finfo, APR_FINFO_NORM, fh)); ABTS_ASSERT(tc, "file_info_get gave incorrect size", finfo.size == eightGb + strlen(TESTSTR)); - APR_ASSERT_SUCCESS(tc, "close 8Gb file", apr_file_close(fh)); + APR_ASSERT_SUCCESS(tc, "close 8Gb file", fspr_file_close(fh)); } static void test_seek(abts_case *tc, void *data) { - apr_file_t *fh; - apr_off_t pos; + fspr_file_t *fh; + fspr_off_t pos; PRECOND; APR_ASSERT_SUCCESS(tc, "open 8Gb file for writing", - apr_file_open(&fh, TESTFN, APR_WRITE, + fspr_file_open(&fh, TESTFN, APR_WRITE, APR_OS_DEFAULT, p)); pos = 0; APR_ASSERT_SUCCESS(tc, "relative seek to end", - apr_file_seek(fh, APR_END, &pos)); + fspr_file_seek(fh, APR_END, &pos)); ABTS_ASSERT(tc, "seek to END gave 8Gb", pos == eightGb); pos = eightGb; - APR_ASSERT_SUCCESS(tc, "seek to 8Gb", apr_file_seek(fh, APR_SET, &pos)); + APR_ASSERT_SUCCESS(tc, "seek to 8Gb", fspr_file_seek(fh, APR_SET, &pos)); ABTS_ASSERT(tc, "seek gave 8Gb offset", pos == eightGb); pos = 0; - APR_ASSERT_SUCCESS(tc, "relative seek to 0", apr_file_seek(fh, APR_CUR, &pos)); + APR_ASSERT_SUCCESS(tc, "relative seek to 0", fspr_file_seek(fh, APR_CUR, &pos)); ABTS_ASSERT(tc, "relative seek gave 8Gb offset", pos == eightGb); - apr_file_close(fh); + fspr_file_close(fh); } static void test_write(abts_case *tc, void *data) { - apr_file_t *fh; - apr_off_t pos = eightGb - 4; + fspr_file_t *fh; + fspr_off_t pos = eightGb - 4; PRECOND; APR_ASSERT_SUCCESS(tc, "re-open 8Gb file", - apr_file_open(&fh, TESTFN, APR_WRITE, APR_OS_DEFAULT, p)); + fspr_file_open(&fh, TESTFN, APR_WRITE, APR_OS_DEFAULT, p)); APR_ASSERT_SUCCESS(tc, "seek to 8Gb - 4", - apr_file_seek(fh, APR_SET, &pos)); + fspr_file_seek(fh, APR_SET, &pos)); ABTS_ASSERT(tc, "seek gave 8Gb-4 offset", pos == eightGb - 4); APR_ASSERT_SUCCESS(tc, "write magic string to 8Gb-4", - apr_file_write_full(fh, "FISH", 4, NULL)); + fspr_file_write_full(fh, "FISH", 4, NULL)); - APR_ASSERT_SUCCESS(tc, "close 8Gb file", apr_file_close(fh)); + APR_ASSERT_SUCCESS(tc, "close 8Gb file", fspr_file_close(fh)); } #if APR_HAS_MMAP static void test_mmap(abts_case *tc, void *data) { - apr_mmap_t *map; - apr_file_t *fh; - apr_size_t len = 16384; /* hopefully a multiple of the page size */ - apr_off_t off = eightGb - len; + fspr_mmap_t *map; + fspr_file_t *fh; + fspr_size_t len = 16384; /* hopefully a multiple of the page size */ + fspr_off_t off = eightGb - len; void *ptr; PRECOND; APR_ASSERT_SUCCESS(tc, "open 8gb file for mmap", - apr_file_open(&fh, TESTFN, APR_READ, APR_OS_DEFAULT, p)); + fspr_file_open(&fh, TESTFN, APR_READ, APR_OS_DEFAULT, p)); APR_ASSERT_SUCCESS(tc, "mmap 8Gb file", - apr_mmap_create(&map, fh, off, len, APR_MMAP_READ, p)); + fspr_mmap_create(&map, fh, off, len, APR_MMAP_READ, p)); - APR_ASSERT_SUCCESS(tc, "close file", apr_file_close(fh)); + APR_ASSERT_SUCCESS(tc, "close file", fspr_file_close(fh)); ABTS_ASSERT(tc, "mapped a 16K block", map->size == len); APR_ASSERT_SUCCESS(tc, "get pointer into mmaped region", - apr_mmap_offset(&ptr, map, len - 4)); + fspr_mmap_offset(&ptr, map, len - 4)); ABTS_ASSERT(tc, "pointer was not NULL", ptr != NULL); ABTS_ASSERT(tc, "found the magic string", memcmp(ptr, "FISH", 4) == 0); - APR_ASSERT_SUCCESS(tc, "delete mmap handle", apr_mmap_delete(map)); + APR_ASSERT_SUCCESS(tc, "delete mmap handle", fspr_mmap_delete(map)); } #endif /* APR_HAS_MMAP */ static void test_format(abts_case *tc, void *data) { - apr_off_t off; + fspr_off_t off; PRECOND; - off = apr_atoi64(apr_off_t_toa(p, eightGb)); + off = fspr_atoi64(fspr_off_t_toa(p, eightGb)); - ABTS_ASSERT(tc, "apr_atoi64 parsed apr_off_t_toa result incorrectly", + ABTS_ASSERT(tc, "fspr_atoi64 parsed fspr_off_t_toa result incorrectly", off == eightGb); } diff --git a/libs/apr/test/testlock.c b/libs/apr/test/testlock.c index dddb52f76a..51dfc5602c 100644 --- a/libs/apr/test/testlock.c +++ b/libs/apr/test/testlock.c @@ -14,14 +14,14 @@ * limitations under the License. */ -#include "apr_thread_proc.h" -#include "apr_file_io.h" -#include "apr_thread_mutex.h" -#include "apr_thread_rwlock.h" -#include "apr_thread_cond.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_getopt.h" +#include "fspr_thread_proc.h" +#include "fspr_file_io.h" +#include "fspr_thread_mutex.h" +#include "fspr_thread_rwlock.h" +#include "fspr_thread_cond.h" +#include "fspr_errno.h" +#include "fspr_general.h" +#include "fspr_getopt.h" #include "testutil.h" #if APR_HAS_THREADS @@ -30,67 +30,67 @@ #define MAX_COUNTER 100000 #define MAX_RETRY 5 -static void *APR_THREAD_FUNC thread_rwlock_func(apr_thread_t *thd, void *data); -static void *APR_THREAD_FUNC thread_mutex_function(apr_thread_t *thd, void *data); -static void *APR_THREAD_FUNC thread_cond_producer(apr_thread_t *thd, void *data); -static void *APR_THREAD_FUNC thread_cond_consumer(apr_thread_t *thd, void *data); +static void *APR_THREAD_FUNC thread_rwlock_func(fspr_thread_t *thd, void *data); +static void *APR_THREAD_FUNC thread_mutex_function(fspr_thread_t *thd, void *data); +static void *APR_THREAD_FUNC thread_cond_producer(fspr_thread_t *thd, void *data); +static void *APR_THREAD_FUNC thread_cond_consumer(fspr_thread_t *thd, void *data); -static apr_thread_mutex_t *thread_mutex; -static apr_thread_rwlock_t *rwlock; +static fspr_thread_mutex_t *thread_mutex; +static fspr_thread_rwlock_t *rwlock; static int i = 0, x = 0; static int buff[MAX_COUNTER]; struct { - apr_thread_mutex_t *mutex; + fspr_thread_mutex_t *mutex; int nput; int nval; } put; struct { - apr_thread_mutex_t *mutex; - apr_thread_cond_t *cond; + fspr_thread_mutex_t *mutex; + fspr_thread_cond_t *cond; int nready; } nready; -static apr_thread_mutex_t *timeout_mutex; -static apr_thread_cond_t *timeout_cond; +static fspr_thread_mutex_t *timeout_mutex; +static fspr_thread_cond_t *timeout_cond; -static void *APR_THREAD_FUNC thread_rwlock_func(apr_thread_t *thd, void *data) +static void *APR_THREAD_FUNC thread_rwlock_func(fspr_thread_t *thd, void *data) { int exitLoop = 1; while (1) { - apr_thread_rwlock_rdlock(rwlock); + fspr_thread_rwlock_rdlock(rwlock); if (i == MAX_ITER) exitLoop = 0; - apr_thread_rwlock_unlock(rwlock); + fspr_thread_rwlock_unlock(rwlock); if (!exitLoop) break; - apr_thread_rwlock_wrlock(rwlock); + fspr_thread_rwlock_wrlock(rwlock); if (i != MAX_ITER) { i++; x++; } - apr_thread_rwlock_unlock(rwlock); + fspr_thread_rwlock_unlock(rwlock); } return NULL; } -static void *APR_THREAD_FUNC thread_mutex_function(apr_thread_t *thd, void *data) +static void *APR_THREAD_FUNC thread_mutex_function(fspr_thread_t *thd, void *data) { int exitLoop = 1; /* slight delay to allow things to settle */ - apr_sleep (1); + fspr_sleep (1); while (1) { - apr_thread_mutex_lock(thread_mutex); + fspr_thread_mutex_lock(thread_mutex); if (i == MAX_ITER) exitLoop = 0; else @@ -98,7 +98,7 @@ static void *APR_THREAD_FUNC thread_mutex_function(apr_thread_t *thd, void *data i++; x++; } - apr_thread_mutex_unlock(thread_mutex); + fspr_thread_mutex_unlock(thread_mutex); if (!exitLoop) break; @@ -106,24 +106,24 @@ static void *APR_THREAD_FUNC thread_mutex_function(apr_thread_t *thd, void *data return NULL; } -static void *APR_THREAD_FUNC thread_cond_producer(apr_thread_t *thd, void *data) +static void *APR_THREAD_FUNC thread_cond_producer(fspr_thread_t *thd, void *data) { for (;;) { - apr_thread_mutex_lock(put.mutex); + fspr_thread_mutex_lock(put.mutex); if (put.nput >= MAX_COUNTER) { - apr_thread_mutex_unlock(put.mutex); + fspr_thread_mutex_unlock(put.mutex); return NULL; } buff[put.nput] = put.nval; put.nput++; put.nval++; - apr_thread_mutex_unlock(put.mutex); + fspr_thread_mutex_unlock(put.mutex); - apr_thread_mutex_lock(nready.mutex); + fspr_thread_mutex_lock(nready.mutex); if (nready.nready == 0) - apr_thread_cond_signal(nready.cond); + fspr_thread_cond_signal(nready.cond); nready.nready++; - apr_thread_mutex_unlock(nready.mutex); + fspr_thread_mutex_unlock(nready.mutex); *((int *) data) += 1; } @@ -131,16 +131,16 @@ static void *APR_THREAD_FUNC thread_cond_producer(apr_thread_t *thd, void *data) return NULL; } -static void *APR_THREAD_FUNC thread_cond_consumer(apr_thread_t *thd, void *data) +static void *APR_THREAD_FUNC thread_cond_consumer(fspr_thread_t *thd, void *data) { int i; for (i = 0; i < MAX_COUNTER; i++) { - apr_thread_mutex_lock(nready.mutex); + fspr_thread_mutex_lock(nready.mutex); while (nready.nready == 0) - apr_thread_cond_wait(nready.cond, nready.mutex); + fspr_thread_cond_wait(nready.cond, nready.mutex); nready.nready--; - apr_thread_mutex_unlock(nready.mutex); + fspr_thread_mutex_unlock(nready.mutex); if (buff[i] != i) printf("buff[%d] = %d\n", i, buff[i]); @@ -151,39 +151,39 @@ static void *APR_THREAD_FUNC thread_cond_consumer(apr_thread_t *thd, void *data) static void test_thread_mutex(abts_case *tc, void *data) { - apr_thread_t *t1, *t2, *t3, *t4; - apr_status_t s1, s2, s3, s4; + fspr_thread_t *t1, *t2, *t3, *t4; + fspr_status_t s1, s2, s3, s4; - s1 = apr_thread_mutex_create(&thread_mutex, APR_THREAD_MUTEX_DEFAULT, p); + s1 = fspr_thread_mutex_create(&thread_mutex, APR_THREAD_MUTEX_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, s1); ABTS_PTR_NOTNULL(tc, thread_mutex); i = 0; x = 0; - s1 = apr_thread_create(&t1, NULL, thread_mutex_function, NULL, p); + s1 = fspr_thread_create(&t1, NULL, thread_mutex_function, NULL, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, s1); - s2 = apr_thread_create(&t2, NULL, thread_mutex_function, NULL, p); + s2 = fspr_thread_create(&t2, NULL, thread_mutex_function, NULL, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, s2); - s3 = apr_thread_create(&t3, NULL, thread_mutex_function, NULL, p); + s3 = fspr_thread_create(&t3, NULL, thread_mutex_function, NULL, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, s3); - s4 = apr_thread_create(&t4, NULL, thread_mutex_function, NULL, p); + s4 = fspr_thread_create(&t4, NULL, thread_mutex_function, NULL, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, s4); - apr_thread_join(&s1, t1); - apr_thread_join(&s2, t2); - apr_thread_join(&s3, t3); - apr_thread_join(&s4, t4); + fspr_thread_join(&s1, t1); + fspr_thread_join(&s2, t2); + fspr_thread_join(&s3, t3); + fspr_thread_join(&s4, t4); ABTS_INT_EQUAL(tc, MAX_ITER, x); } static void test_thread_rwlock(abts_case *tc, void *data) { - apr_thread_t *t1, *t2, *t3, *t4; - apr_status_t s1, s2, s3, s4; + fspr_thread_t *t1, *t2, *t3, *t4; + fspr_status_t s1, s2, s3, s4; - s1 = apr_thread_rwlock_create(&rwlock, p); + s1 = fspr_thread_rwlock_create(&rwlock, p); if (s1 == APR_ENOTIMPL) { ABTS_NOT_IMPL(tc, "rwlocks not implemented"); return; @@ -194,44 +194,44 @@ static void test_thread_rwlock(abts_case *tc, void *data) i = 0; x = 0; - s1 = apr_thread_create(&t1, NULL, thread_rwlock_func, NULL, p); + s1 = fspr_thread_create(&t1, NULL, thread_rwlock_func, NULL, p); APR_ASSERT_SUCCESS(tc, "create thread 1", s1); - s2 = apr_thread_create(&t2, NULL, thread_rwlock_func, NULL, p); + s2 = fspr_thread_create(&t2, NULL, thread_rwlock_func, NULL, p); APR_ASSERT_SUCCESS(tc, "create thread 2", s2); - s3 = apr_thread_create(&t3, NULL, thread_rwlock_func, NULL, p); + s3 = fspr_thread_create(&t3, NULL, thread_rwlock_func, NULL, p); APR_ASSERT_SUCCESS(tc, "create thread 3", s3); - s4 = apr_thread_create(&t4, NULL, thread_rwlock_func, NULL, p); + s4 = fspr_thread_create(&t4, NULL, thread_rwlock_func, NULL, p); APR_ASSERT_SUCCESS(tc, "create thread 4", s4); - apr_thread_join(&s1, t1); - apr_thread_join(&s2, t2); - apr_thread_join(&s3, t3); - apr_thread_join(&s4, t4); + fspr_thread_join(&s1, t1); + fspr_thread_join(&s2, t2); + fspr_thread_join(&s3, t3); + fspr_thread_join(&s4, t4); ABTS_INT_EQUAL(tc, MAX_ITER, x); - apr_thread_rwlock_destroy(rwlock); + fspr_thread_rwlock_destroy(rwlock); } static void test_cond(abts_case *tc, void *data) { - apr_thread_t *p1, *p2, *p3, *p4, *c1; - apr_status_t s0, s1, s2, s3, s4; + fspr_thread_t *p1, *p2, *p3, *p4, *c1; + fspr_status_t s0, s1, s2, s3, s4; int count1, count2, count3, count4; int sum; APR_ASSERT_SUCCESS(tc, "create put mutex", - apr_thread_mutex_create(&put.mutex, + fspr_thread_mutex_create(&put.mutex, APR_THREAD_MUTEX_DEFAULT, p)); ABTS_PTR_NOTNULL(tc, put.mutex); APR_ASSERT_SUCCESS(tc, "create nready mutex", - apr_thread_mutex_create(&nready.mutex, + fspr_thread_mutex_create(&nready.mutex, APR_THREAD_MUTEX_DEFAULT, p)); ABTS_PTR_NOTNULL(tc, nready.mutex); APR_ASSERT_SUCCESS(tc, "create condvar", - apr_thread_cond_create(&nready.cond, p)); + fspr_thread_cond_create(&nready.cond, p)); ABTS_PTR_NOTNULL(tc, nready.cond); count1 = count2 = count3 = count4 = 0; @@ -240,25 +240,25 @@ static void test_cond(abts_case *tc, void *data) i = 0; x = 0; - s0 = apr_thread_create(&p1, NULL, thread_cond_producer, &count1, p); + s0 = fspr_thread_create(&p1, NULL, thread_cond_producer, &count1, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, s0); - s1 = apr_thread_create(&p2, NULL, thread_cond_producer, &count2, p); + s1 = fspr_thread_create(&p2, NULL, thread_cond_producer, &count2, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, s1); - s2 = apr_thread_create(&p3, NULL, thread_cond_producer, &count3, p); + s2 = fspr_thread_create(&p3, NULL, thread_cond_producer, &count3, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, s2); - s3 = apr_thread_create(&p4, NULL, thread_cond_producer, &count4, p); + s3 = fspr_thread_create(&p4, NULL, thread_cond_producer, &count4, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, s3); - s4 = apr_thread_create(&c1, NULL, thread_cond_consumer, NULL, p); + s4 = fspr_thread_create(&c1, NULL, thread_cond_consumer, NULL, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, s4); - apr_thread_join(&s0, p1); - apr_thread_join(&s1, p2); - apr_thread_join(&s2, p3); - apr_thread_join(&s3, p4); - apr_thread_join(&s4, c1); + fspr_thread_join(&s0, p1); + fspr_thread_join(&s1, p2); + fspr_thread_join(&s2, p3); + fspr_thread_join(&s3, p4); + fspr_thread_join(&s4, c1); APR_ASSERT_SUCCESS(tc, "destroy condvar", - apr_thread_cond_destroy(nready.cond)); + fspr_thread_cond_destroy(nready.cond)); sum = count1 + count2 + count3 + count4; /* @@ -270,28 +270,28 @@ static void test_cond(abts_case *tc, void *data) static void test_timeoutcond(abts_case *tc, void *data) { - apr_status_t s; - apr_interval_time_t timeout; - apr_time_t begin, end; + fspr_status_t s; + fspr_interval_time_t timeout; + fspr_time_t begin, end; int i; - s = apr_thread_mutex_create(&timeout_mutex, APR_THREAD_MUTEX_DEFAULT, p); + s = fspr_thread_mutex_create(&timeout_mutex, APR_THREAD_MUTEX_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, s); ABTS_PTR_NOTNULL(tc, timeout_mutex); - s = apr_thread_cond_create(&timeout_cond, p); + s = fspr_thread_cond_create(&timeout_cond, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, s); ABTS_PTR_NOTNULL(tc, timeout_cond); - timeout = apr_time_from_sec(5); + timeout = fspr_time_from_sec(5); for (i = 0; i < MAX_RETRY; i++) { - apr_thread_mutex_lock(timeout_mutex); + fspr_thread_mutex_lock(timeout_mutex); - begin = apr_time_now(); - s = apr_thread_cond_timedwait(timeout_cond, timeout_mutex, timeout); - end = apr_time_now(); - apr_thread_mutex_unlock(timeout_mutex); + begin = fspr_time_now(); + s = fspr_thread_cond_timedwait(timeout_cond, timeout_mutex, timeout); + end = fspr_time_now(); + fspr_thread_mutex_unlock(timeout_mutex); if (s != APR_SUCCESS && !APR_STATUS_IS_TIMEUP(s)) { continue; @@ -302,7 +302,7 @@ static void test_timeoutcond(abts_case *tc, void *data) } ABTS_ASSERT(tc, "Too many retries", i < MAX_RETRY); APR_ASSERT_SUCCESS(tc, "Unable to destroy the conditional", - apr_thread_cond_destroy(timeout_cond)); + fspr_thread_cond_destroy(timeout_cond)); } #endif /* !APR_HAS_THREADS */ diff --git a/libs/apr/test/testlockperf.c b/libs/apr/test/testlockperf.c index e0bf75ae83..afee9c3db6 100644 --- a/libs/apr/test/testlockperf.c +++ b/libs/apr/test/testlockperf.c @@ -14,13 +14,13 @@ * limitations under the License. */ -#include "apr_thread_proc.h" -#include "apr_thread_mutex.h" -#include "apr_thread_rwlock.h" -#include "apr_file_io.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_getopt.h" +#include "fspr_thread_proc.h" +#include "fspr_thread_mutex.h" +#include "fspr_thread_rwlock.h" +#include "fspr_file_io.h" +#include "fspr_errno.h" +#include "fspr_general.h" +#include "fspr_getopt.h" #include "errno.h" #include #include @@ -40,66 +40,66 @@ int main(void) static long mutex_counter; -static apr_thread_mutex_t *thread_lock; -void * APR_THREAD_FUNC thread_mutex_func(apr_thread_t *thd, void *data); -apr_status_t test_thread_mutex(int num_threads); /* apr_thread_mutex_t */ +static fspr_thread_mutex_t *thread_lock; +void * APR_THREAD_FUNC thread_mutex_func(fspr_thread_t *thd, void *data); +fspr_status_t test_thread_mutex(int num_threads); /* fspr_thread_mutex_t */ -static apr_thread_rwlock_t *thread_rwlock; -void * APR_THREAD_FUNC thread_rwlock_func(apr_thread_t *thd, void *data); -apr_status_t test_thread_rwlock(int num_threads); /* apr_thread_rwlock_t */ +static fspr_thread_rwlock_t *thread_rwlock; +void * APR_THREAD_FUNC thread_rwlock_func(fspr_thread_t *thd, void *data); +fspr_status_t test_thread_rwlock(int num_threads); /* fspr_thread_rwlock_t */ int test_thread_mutex_nested(int num_threads); -apr_pool_t *pool; +fspr_pool_t *pool; int i = 0, x = 0; -void * APR_THREAD_FUNC thread_mutex_func(apr_thread_t *thd, void *data) +void * APR_THREAD_FUNC thread_mutex_func(fspr_thread_t *thd, void *data) { int i; for (i = 0; i < MAX_COUNTER; i++) { - apr_thread_mutex_lock(thread_lock); + fspr_thread_mutex_lock(thread_lock); mutex_counter++; - apr_thread_mutex_unlock(thread_lock); + fspr_thread_mutex_unlock(thread_lock); } return NULL; } -void * APR_THREAD_FUNC thread_rwlock_func(apr_thread_t *thd, void *data) +void * APR_THREAD_FUNC thread_rwlock_func(fspr_thread_t *thd, void *data) { int i; for (i = 0; i < MAX_COUNTER; i++) { - apr_thread_rwlock_wrlock(thread_rwlock); + fspr_thread_rwlock_wrlock(thread_rwlock); mutex_counter++; - apr_thread_rwlock_unlock(thread_rwlock); + fspr_thread_rwlock_unlock(thread_rwlock); } return NULL; } int test_thread_mutex(int num_threads) { - apr_thread_t *t[MAX_THREADS]; - apr_status_t s[MAX_THREADS]; - apr_time_t time_start, time_stop; + fspr_thread_t *t[MAX_THREADS]; + fspr_status_t s[MAX_THREADS]; + fspr_time_t time_start, time_stop; int i; mutex_counter = 0; - printf("apr_thread_mutex_t Tests\n"); - printf("%-60s", " Initializing the apr_thread_mutex_t (UNNESTED)"); - s[0] = apr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_UNNESTED, pool); + printf("fspr_thread_mutex_t Tests\n"); + printf("%-60s", " Initializing the fspr_thread_mutex_t (UNNESTED)"); + s[0] = fspr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_UNNESTED, pool); if (s[0] != APR_SUCCESS) { printf("Failed!\n"); return s[0]; } printf("OK\n"); - apr_thread_mutex_lock(thread_lock); + fspr_thread_mutex_lock(thread_lock); /* set_concurrency(4)? -aaron */ printf(" Starting %d threads ", num_threads); for (i = 0; i < num_threads; ++i) { - s[i] = apr_thread_create(&t[i], NULL, thread_mutex_func, NULL, pool); + s[i] = fspr_thread_create(&t[i], NULL, thread_mutex_func, NULL, pool); if (s[i] != APR_SUCCESS) { printf("Failed!\n"); return s[i]; @@ -107,16 +107,16 @@ int test_thread_mutex(int num_threads) } printf("OK\n"); - time_start = apr_time_now(); - apr_thread_mutex_unlock(thread_lock); + time_start = fspr_time_now(); + fspr_thread_mutex_unlock(thread_lock); /* printf("%-60s", " Waiting for threads to exit"); */ for (i = 0; i < num_threads; ++i) { - apr_thread_join(&s[i], t[i]); + fspr_thread_join(&s[i], t[i]); } /* printf("OK\n"); */ - time_stop = apr_time_now(); + time_stop = fspr_time_now(); printf("microseconds: %" APR_INT64_T_FMT " usec\n", (time_stop - time_start)); if (mutex_counter != MAX_COUNTER * num_threads) @@ -127,27 +127,27 @@ int test_thread_mutex(int num_threads) int test_thread_mutex_nested(int num_threads) { - apr_thread_t *t[MAX_THREADS]; - apr_status_t s[MAX_THREADS]; - apr_time_t time_start, time_stop; + fspr_thread_t *t[MAX_THREADS]; + fspr_status_t s[MAX_THREADS]; + fspr_time_t time_start, time_stop; int i; mutex_counter = 0; - printf("apr_thread_mutex_t Tests\n"); - printf("%-60s", " Initializing the apr_thread_mutex_t (NESTED)"); - s[0] = apr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_NESTED, pool); + printf("fspr_thread_mutex_t Tests\n"); + printf("%-60s", " Initializing the fspr_thread_mutex_t (NESTED)"); + s[0] = fspr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_NESTED, pool); if (s[0] != APR_SUCCESS) { printf("Failed!\n"); return s[0]; } printf("OK\n"); - apr_thread_mutex_lock(thread_lock); + fspr_thread_mutex_lock(thread_lock); /* set_concurrency(4)? -aaron */ printf(" Starting %d threads ", num_threads); for (i = 0; i < num_threads; ++i) { - s[i] = apr_thread_create(&t[i], NULL, thread_mutex_func, NULL, pool); + s[i] = fspr_thread_create(&t[i], NULL, thread_mutex_func, NULL, pool); if (s[i] != APR_SUCCESS) { printf("Failed!\n"); return s[i]; @@ -155,16 +155,16 @@ int test_thread_mutex_nested(int num_threads) } printf("OK\n"); - time_start = apr_time_now(); - apr_thread_mutex_unlock(thread_lock); + time_start = fspr_time_now(); + fspr_thread_mutex_unlock(thread_lock); /* printf("%-60s", " Waiting for threads to exit"); */ for (i = 0; i < num_threads; ++i) { - apr_thread_join(&s[i], t[i]); + fspr_thread_join(&s[i], t[i]); } /* printf("OK\n"); */ - time_stop = apr_time_now(); + time_stop = fspr_time_now(); printf("microseconds: %" APR_INT64_T_FMT " usec\n", (time_stop - time_start)); if (mutex_counter != MAX_COUNTER * num_threads) @@ -175,27 +175,27 @@ int test_thread_mutex_nested(int num_threads) int test_thread_rwlock(int num_threads) { - apr_thread_t *t[MAX_THREADS]; - apr_status_t s[MAX_THREADS]; - apr_time_t time_start, time_stop; + fspr_thread_t *t[MAX_THREADS]; + fspr_status_t s[MAX_THREADS]; + fspr_time_t time_start, time_stop; int i; mutex_counter = 0; - printf("apr_thread_rwlock_t Tests\n"); - printf("%-60s", " Initializing the apr_thread_rwlock_t"); - s[0] = apr_thread_rwlock_create(&thread_rwlock, pool); + printf("fspr_thread_rwlock_t Tests\n"); + printf("%-60s", " Initializing the fspr_thread_rwlock_t"); + s[0] = fspr_thread_rwlock_create(&thread_rwlock, pool); if (s[0] != APR_SUCCESS) { printf("Failed!\n"); return s[0]; } printf("OK\n"); - apr_thread_rwlock_wrlock(thread_rwlock); + fspr_thread_rwlock_wrlock(thread_rwlock); /* set_concurrency(4)? -aaron */ printf(" Starting %d threads ", num_threads); for (i = 0; i < num_threads; ++i) { - s[i] = apr_thread_create(&t[i], NULL, thread_rwlock_func, NULL, pool); + s[i] = fspr_thread_create(&t[i], NULL, thread_rwlock_func, NULL, pool); if (s[i] != APR_SUCCESS) { printf("Failed!\n"); return s[i]; @@ -203,16 +203,16 @@ int test_thread_rwlock(int num_threads) } printf("OK\n"); - time_start = apr_time_now(); - apr_thread_rwlock_unlock(thread_rwlock); + time_start = fspr_time_now(); + fspr_thread_rwlock_unlock(thread_rwlock); /* printf("%-60s", " Waiting for threads to exit"); */ for (i = 0; i < num_threads; ++i) { - apr_thread_join(&s[i], t[i]); + fspr_thread_join(&s[i], t[i]); } /* printf("OK\n"); */ - time_stop = apr_time_now(); + time_stop = fspr_time_now(); printf("microseconds: %" APR_INT64_T_FMT " usec\n", (time_stop - time_start)); if (mutex_counter != MAX_COUNTER * num_threads) @@ -223,28 +223,28 @@ int test_thread_rwlock(int num_threads) int main(int argc, const char * const *argv) { - apr_status_t rv; + fspr_status_t rv; char errmsg[200]; const char *lockname = "multi.lock"; - apr_getopt_t *opt; + fspr_getopt_t *opt; char optchar; const char *optarg; printf("APR Lock Performance Test\n==============\n\n"); - apr_initialize(); - atexit(apr_terminate); + fspr_initialize(); + atexit(fspr_terminate); - if (apr_pool_create(&pool, NULL) != APR_SUCCESS) + if (fspr_pool_create(&pool, NULL) != APR_SUCCESS) exit(-1); - if ((rv = apr_getopt_init(&opt, pool, argc, argv)) != APR_SUCCESS) { + if ((rv = fspr_getopt_init(&opt, pool, argc, argv)) != APR_SUCCESS) { fprintf(stderr, "Could not set up to parse options: [%d] %s\n", - rv, apr_strerror(rv, errmsg, sizeof errmsg)); + rv, fspr_strerror(rv, errmsg, sizeof errmsg)); exit(-1); } - while ((rv = apr_getopt(opt, "f:", &optchar, &optarg)) == APR_SUCCESS) { + while ((rv = fspr_getopt(opt, "f:", &optchar, &optarg)) == APR_SUCCESS) { if (optchar == 'f') { lockname = optarg; } @@ -252,26 +252,26 @@ int main(int argc, const char * const *argv) if (rv != APR_SUCCESS && rv != APR_EOF) { fprintf(stderr, "Could not parse options: [%d] %s\n", - rv, apr_strerror(rv, errmsg, sizeof errmsg)); + rv, fspr_strerror(rv, errmsg, sizeof errmsg)); exit(-1); } for (i = 1; i <= MAX_THREADS; ++i) { if ((rv = test_thread_mutex(i)) != APR_SUCCESS) { fprintf(stderr,"thread_mutex test failed : [%d] %s\n", - rv, apr_strerror(rv, (char*)errmsg, 200)); + rv, fspr_strerror(rv, (char*)errmsg, 200)); exit(-3); } if ((rv = test_thread_mutex_nested(i)) != APR_SUCCESS) { fprintf(stderr,"thread_mutex (NESTED) test failed : [%d] %s\n", - rv, apr_strerror(rv, (char*)errmsg, 200)); + rv, fspr_strerror(rv, (char*)errmsg, 200)); exit(-4); } if ((rv = test_thread_rwlock(i)) != APR_SUCCESS) { fprintf(stderr,"thread_rwlock test failed : [%d] %s\n", - rv, apr_strerror(rv, (char*)errmsg, 200)); + rv, fspr_strerror(rv, (char*)errmsg, 200)); exit(-6); } } diff --git a/libs/apr/test/testmmap.c b/libs/apr/test/testmmap.c index 61b7481e5a..1e42d5e073 100644 --- a/libs/apr/test/testmmap.c +++ b/libs/apr/test/testmmap.c @@ -15,12 +15,12 @@ */ #include "testutil.h" -#include "apr_mmap.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_file_io.h" -#include "apr_strings.h" +#include "fspr_mmap.h" +#include "fspr_errno.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_file_io.h" +#include "fspr_strings.h" /* hmmm, what is a truly portable define for the max path * length on a platform? @@ -36,17 +36,17 @@ static void not_implemented(abts_case *tc, void *data) #else -static apr_mmap_t *themmap = NULL; -static apr_file_t *thefile = NULL; +static fspr_mmap_t *themmap = NULL; +static fspr_file_t *thefile = NULL; static char *file1; -static apr_finfo_t finfo; +static fspr_finfo_t finfo; static int fsize; static void create_filename(abts_case *tc, void *data) { char *oldfileptr; - apr_filepath_get(&file1, 0, p); + fspr_filepath_get(&file1, 0, p); #ifndef NETWARE #ifdef WIN32 ABTS_TRUE(tc, file1[1] == ':'); @@ -57,41 +57,41 @@ static void create_filename(abts_case *tc, void *data) ABTS_TRUE(tc, file1[strlen(file1) - 1] != '/'); oldfileptr = file1; - file1 = apr_pstrcat(p, file1,"/data/mmap_datafile.txt" ,NULL); + file1 = fspr_pstrcat(p, file1,"/data/mmap_datafile.txt" ,NULL); ABTS_TRUE(tc, oldfileptr != file1); } static void test_file_close(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; - rv = apr_file_close(thefile); + rv = fspr_file_close(thefile); ABTS_INT_EQUAL(tc, rv, APR_SUCCESS); } static void test_file_open(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; - rv = apr_file_open(&thefile, file1, APR_READ, APR_UREAD | APR_GREAD, p); + rv = fspr_file_open(&thefile, file1, APR_READ, APR_UREAD | APR_GREAD, p); ABTS_INT_EQUAL(tc, rv, APR_SUCCESS); ABTS_PTR_NOTNULL(tc, thefile); } static void test_get_filesize(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; - rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile); + rv = fspr_file_info_get(&finfo, APR_FINFO_NORM, thefile); ABTS_INT_EQUAL(tc, rv, APR_SUCCESS); ABTS_ASSERT(tc, "File size mismatch", fsize == finfo.size); } static void test_mmap_create(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; - rv = apr_mmap_create(&themmap, thefile, 0, (apr_size_t) finfo.size, + rv = fspr_mmap_create(&themmap, thefile, 0, (fspr_size_t) finfo.size, APR_MMAP_READ, p); ABTS_PTR_NOTNULL(tc, themmap); ABTS_INT_EQUAL(tc, rv, APR_SUCCESS); @@ -110,20 +110,20 @@ static void test_mmap_contents(abts_case *tc, void *data) static void test_mmap_delete(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; ABTS_PTR_NOTNULL(tc, themmap); - rv = apr_mmap_delete(themmap); + rv = fspr_mmap_delete(themmap); ABTS_INT_EQUAL(tc, rv, APR_SUCCESS); } static void test_mmap_offset(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; void *addr; ABTS_PTR_NOTNULL(tc, themmap); - rv = apr_mmap_offset(&addr, themmap, 5); + rv = fspr_mmap_offset(&addr, themmap, 5); /* Must use nEquals since the string is not guaranteed to be NULL terminated */ ABTS_STR_NEQUAL(tc, addr, TEST_STRING + 5, fsize-5); diff --git a/libs/apr/test/testmutexscope.c b/libs/apr/test/testmutexscope.c index 0ea08cc634..0d8cb30d6c 100644 --- a/libs/apr/test/testmutexscope.c +++ b/libs/apr/test/testmutexscope.c @@ -19,11 +19,11 @@ #include #include -#include "apr.h" -#include "apr_general.h" -#include "apr_proc_mutex.h" -#include "apr_global_mutex.h" -#include "apr_thread_proc.h" +#include "fspr.h" +#include "fspr_general.h" +#include "fspr_proc_mutex.h" +#include "fspr_global_mutex.h" +#include "fspr_thread_proc.h" #if !APR_HAS_THREADS int main(void) @@ -34,23 +34,23 @@ int main(void) #else /* APR_HAS_THREADS */ -static apr_thread_mutex_t *thread_mutex; -static apr_proc_mutex_t *proc_mutex; -static apr_global_mutex_t *global_mutex; -static apr_pool_t *p; +static fspr_thread_mutex_t *thread_mutex; +static fspr_proc_mutex_t *proc_mutex; +static fspr_global_mutex_t *global_mutex; +static fspr_pool_t *p; static volatile int counter; typedef enum {TEST_GLOBAL, TEST_PROC} test_mode_e; -static void lock_init(apr_lockmech_e mech, test_mode_e test_mode) +static void lock_init(fspr_lockmech_e mech, test_mode_e test_mode) { if (test_mode == TEST_PROC) { - assert(apr_proc_mutex_create(&proc_mutex, + assert(fspr_proc_mutex_create(&proc_mutex, NULL, mech, p) == APR_SUCCESS); } else { - assert(apr_global_mutex_create(&global_mutex, + assert(fspr_global_mutex_create(&global_mutex, NULL, mech, p) == APR_SUCCESS); @@ -60,62 +60,62 @@ static void lock_init(apr_lockmech_e mech, test_mode_e test_mode) static void lock_destroy(test_mode_e test_mode) { if (test_mode == TEST_PROC) { - assert(apr_proc_mutex_destroy(proc_mutex) == APR_SUCCESS); + assert(fspr_proc_mutex_destroy(proc_mutex) == APR_SUCCESS); } else { - assert(apr_global_mutex_destroy(global_mutex) == APR_SUCCESS); + assert(fspr_global_mutex_destroy(global_mutex) == APR_SUCCESS); } } static void lock_grab(test_mode_e test_mode) { if (test_mode == TEST_PROC) { - assert(apr_proc_mutex_lock(proc_mutex) == APR_SUCCESS); + assert(fspr_proc_mutex_lock(proc_mutex) == APR_SUCCESS); } else { - assert(apr_global_mutex_lock(global_mutex) == APR_SUCCESS); + assert(fspr_global_mutex_lock(global_mutex) == APR_SUCCESS); } } static void lock_release(test_mode_e test_mode) { if (test_mode == TEST_PROC) { - assert(apr_proc_mutex_unlock(proc_mutex) == APR_SUCCESS); + assert(fspr_proc_mutex_unlock(proc_mutex) == APR_SUCCESS); } else { - assert(apr_global_mutex_unlock(global_mutex) == APR_SUCCESS); + assert(fspr_global_mutex_unlock(global_mutex) == APR_SUCCESS); } } -static void * APR_THREAD_FUNC eachThread(apr_thread_t *id, void *p) +static void * APR_THREAD_FUNC eachThread(fspr_thread_t *id, void *p) { test_mode_e test_mode = (test_mode_e)p; lock_grab(test_mode); ++counter; - assert(apr_thread_mutex_lock(thread_mutex) == APR_SUCCESS); - assert(apr_thread_mutex_unlock(thread_mutex) == APR_SUCCESS); + assert(fspr_thread_mutex_lock(thread_mutex) == APR_SUCCESS); + assert(fspr_thread_mutex_unlock(thread_mutex) == APR_SUCCESS); lock_release(test_mode); return NULL; } -static void test_mech_mode(apr_lockmech_e mech, const char *mech_name, +static void test_mech_mode(fspr_lockmech_e mech, const char *mech_name, test_mode_e test_mode) { - apr_thread_t *threads[20]; + fspr_thread_t *threads[20]; int numThreads = 5; int i; - apr_status_t rv; + fspr_status_t rv; printf("Trying %s mutexes with mechanism `%s'...\n", test_mode == TEST_GLOBAL ? "global" : "proc", mech_name); assert(numThreads <= sizeof(threads) / sizeof(threads[0])); - assert(apr_pool_create(&p, NULL) == APR_SUCCESS); + assert(fspr_pool_create(&p, NULL) == APR_SUCCESS); - assert(apr_thread_mutex_create(&thread_mutex, 0, p) == APR_SUCCESS); - assert(apr_thread_mutex_lock(thread_mutex) == APR_SUCCESS); + assert(fspr_thread_mutex_create(&thread_mutex, 0, p) == APR_SUCCESS); + assert(fspr_thread_mutex_lock(thread_mutex) == APR_SUCCESS); lock_init(mech, test_mode); @@ -124,19 +124,19 @@ static void test_mech_mode(apr_lockmech_e mech, const char *mech_name, i = 0; while (i < numThreads) { - rv = apr_thread_create(&threads[i], + rv = fspr_thread_create(&threads[i], NULL, eachThread, (void *)test_mode, p); if (rv != APR_SUCCESS) { - fprintf(stderr, "apr_thread_create->%d\n", rv); + fprintf(stderr, "fspr_thread_create->%d\n", rv); exit(1); } ++i; } - apr_sleep(apr_time_from_sec(5)); + fspr_sleep(fspr_time_from_sec(5)); if (test_mode == TEST_PROC) { printf(" Mutex mechanism `%s' is %sglobal in scope on this platform.\n", @@ -144,7 +144,7 @@ static void test_mech_mode(apr_lockmech_e mech, const char *mech_name, } else { if (counter != 1) { - fprintf(stderr, "\n!!!apr_global_mutex operations are broken on this " + fprintf(stderr, "\n!!!fspr_global_mutex operations are broken on this " "platform for mutex mechanism `%s'!\n" "They don't block out threads within the same process.\n", mech_name); @@ -156,25 +156,25 @@ static void test_mech_mode(apr_lockmech_e mech, const char *mech_name, } } - assert(apr_thread_mutex_unlock(thread_mutex) == APR_SUCCESS); + assert(fspr_thread_mutex_unlock(thread_mutex) == APR_SUCCESS); i = 0; while (i < numThreads) { - apr_status_t ignored; + fspr_status_t ignored; - rv = apr_thread_join(&ignored, + rv = fspr_thread_join(&ignored, threads[i]); assert(rv == APR_SUCCESS); ++i; } lock_destroy(test_mode); - apr_thread_mutex_destroy(thread_mutex); - apr_pool_destroy(p); + fspr_thread_mutex_destroy(thread_mutex); + fspr_pool_destroy(p); } -static void test_mech(apr_lockmech_e mech, const char *mech_name) +static void test_mech(fspr_lockmech_e mech, const char *mech_name) { test_mech_mode(mech, mech_name, TEST_PROC); test_mech_mode(mech, mech_name, TEST_GLOBAL); @@ -183,7 +183,7 @@ static void test_mech(apr_lockmech_e mech, const char *mech_name) int main(void) { struct { - apr_lockmech_e mech; + fspr_lockmech_e mech; const char *mech_name; } lockmechs[] = { {APR_LOCK_DEFAULT, "default"} @@ -205,13 +205,13 @@ int main(void) }; int i; - assert(apr_initialize() == APR_SUCCESS); + assert(fspr_initialize() == APR_SUCCESS); for (i = 0; i < sizeof(lockmechs) / sizeof(lockmechs[0]); i++) { test_mech(lockmechs[i].mech, lockmechs[i].mech_name); } - apr_terminate(); + fspr_terminate(); return 0; } diff --git a/libs/apr/test/testnames.c b/libs/apr/test/testnames.c index fca79f3ee8..e35e4d7bf4 100644 --- a/libs/apr/test/testnames.c +++ b/libs/apr/test/testnames.c @@ -15,12 +15,12 @@ */ #include "testutil.h" -#include "apr_file_io.h" -#include "apr_file_info.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_lib.h" +#include "fspr_file_io.h" +#include "fspr_file_info.h" +#include "fspr_errno.h" +#include "fspr_general.h" +#include "fspr_pools.h" +#include "fspr_lib.h" #if WIN32 #define ABS_ROOT "C:/" @@ -32,13 +32,13 @@ static void merge_aboveroot(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; char *dstpath = NULL; char errmsg[256]; - rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo", ABS_ROOT"bar", APR_FILEPATH_NOTABOVEROOT, + rv = fspr_filepath_merge(&dstpath, ABS_ROOT"foo", ABS_ROOT"bar", APR_FILEPATH_NOTABOVEROOT, p); - apr_strerror(rv, errmsg, sizeof(errmsg)); + fspr_strerror(rv, errmsg, sizeof(errmsg)); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EABOVEROOT(rv)); ABTS_PTR_EQUAL(tc, NULL, dstpath); ABTS_STR_EQUAL(tc, "The given path was above the root path", errmsg); @@ -46,10 +46,10 @@ static void merge_aboveroot(abts_case *tc, void *data) static void merge_belowroot(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; char *dstpath = NULL; - rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo", ABS_ROOT"foo/bar", + rv = fspr_filepath_merge(&dstpath, ABS_ROOT"foo", ABS_ROOT"foo/bar", APR_FILEPATH_NOTABOVEROOT, p); ABTS_PTR_NOTNULL(tc, dstpath); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -58,10 +58,10 @@ static void merge_belowroot(abts_case *tc, void *data) static void merge_noflag(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; char *dstpath = NULL; - rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo", ABS_ROOT"foo/bar", 0, p); + rv = fspr_filepath_merge(&dstpath, ABS_ROOT"foo", ABS_ROOT"foo/bar", 0, p); ABTS_PTR_NOTNULL(tc, dstpath); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_STR_EQUAL(tc, ABS_ROOT"foo/bar", dstpath); @@ -69,15 +69,15 @@ static void merge_noflag(abts_case *tc, void *data) static void merge_dotdot(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; char *dstpath = NULL; - rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo/bar", "../baz", 0, p); + rv = fspr_filepath_merge(&dstpath, ABS_ROOT"foo/bar", "../baz", 0, p); ABTS_PTR_NOTNULL(tc, dstpath); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_STR_EQUAL(tc, ABS_ROOT"foo/baz", dstpath); - rv = apr_filepath_merge(&dstpath, "", "../test", 0, p); + rv = fspr_filepath_merge(&dstpath, "", "../test", 0, p); ABTS_INT_EQUAL(tc, 0, APR_SUCCESS); ABTS_STR_EQUAL(tc, "../test", dstpath); @@ -86,23 +86,23 @@ static void merge_dotdot(abts_case *tc, void *data) * return ../test unless a previously fixed bug remains or the developer changes * the case of the test directory: */ - rv = apr_filepath_merge(&dstpath, "", "../test", APR_FILEPATH_TRUENAME, p); + rv = fspr_filepath_merge(&dstpath, "", "../test", APR_FILEPATH_TRUENAME, p); ABTS_INT_EQUAL(tc, 0, APR_SUCCESS); ABTS_STR_EQUAL(tc, "../test", dstpath); } static void merge_dotdot_dotdot_dotdot(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; char *dstpath = NULL; - rv = apr_filepath_merge(&dstpath, "", + rv = fspr_filepath_merge(&dstpath, "", "../../..", APR_FILEPATH_TRUENAME, p); ABTS_PTR_NOTNULL(tc, dstpath); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_STR_EQUAL(tc, "../../..", dstpath); - rv = apr_filepath_merge(&dstpath, "", + rv = fspr_filepath_merge(&dstpath, "", "../../../", APR_FILEPATH_TRUENAME, p); ABTS_PTR_NOTNULL(tc, dstpath); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -111,10 +111,10 @@ static void merge_dotdot_dotdot_dotdot(abts_case *tc, void *data) static void merge_secure(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; char *dstpath = NULL; - rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo/bar", "../bar/baz", 0, p); + rv = fspr_filepath_merge(&dstpath, ABS_ROOT"foo/bar", "../bar/baz", 0, p); ABTS_PTR_NOTNULL(tc, dstpath); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_STR_EQUAL(tc, ABS_ROOT"foo/bar/baz", dstpath); @@ -122,10 +122,10 @@ static void merge_secure(abts_case *tc, void *data) static void merge_notrel(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; char *dstpath = NULL; - rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo/bar", "../baz", + rv = fspr_filepath_merge(&dstpath, ABS_ROOT"foo/bar", "../baz", APR_FILEPATH_NOTRELATIVE, p); ABTS_PTR_NOTNULL(tc, dstpath); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -134,13 +134,13 @@ static void merge_notrel(abts_case *tc, void *data) static void merge_notrelfail(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; char *dstpath = NULL; char errmsg[256]; - rv = apr_filepath_merge(&dstpath, "foo/bar", "../baz", + rv = fspr_filepath_merge(&dstpath, "foo/bar", "../baz", APR_FILEPATH_NOTRELATIVE, p); - apr_strerror(rv, errmsg, sizeof(errmsg)); + fspr_strerror(rv, errmsg, sizeof(errmsg)); ABTS_PTR_EQUAL(tc, NULL, dstpath); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ERELATIVE(rv)); @@ -149,13 +149,13 @@ static void merge_notrelfail(abts_case *tc, void *data) static void merge_notabsfail(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; char *dstpath = NULL; char errmsg[256]; - rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo/bar", "../baz", + rv = fspr_filepath_merge(&dstpath, ABS_ROOT"foo/bar", "../baz", APR_FILEPATH_NOTABSOLUTE, p); - apr_strerror(rv, errmsg, sizeof(errmsg)); + fspr_strerror(rv, errmsg, sizeof(errmsg)); ABTS_PTR_EQUAL(tc, NULL, dstpath); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EABSOLUTE(rv)); @@ -164,10 +164,10 @@ static void merge_notabsfail(abts_case *tc, void *data) static void merge_notabs(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; char *dstpath = NULL; - rv = apr_filepath_merge(&dstpath, "foo/bar", "../baz", + rv = fspr_filepath_merge(&dstpath, "foo/bar", "../baz", APR_FILEPATH_NOTABSOLUTE, p); ABTS_PTR_NOTNULL(tc, dstpath); @@ -177,11 +177,11 @@ static void merge_notabs(abts_case *tc, void *data) static void root_absolute(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; const char *root = NULL; const char *path = ABS_ROOT"foo/bar"; - rv = apr_filepath_root(&root, &path, 0, p); + rv = fspr_filepath_root(&root, &path, 0, p); ABTS_PTR_NOTNULL(tc, root); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -190,13 +190,13 @@ static void root_absolute(abts_case *tc, void *data) static void root_relative(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; const char *root = NULL; const char *path = "foo/bar"; char errmsg[256]; - rv = apr_filepath_root(&root, &path, 0, p); - apr_strerror(rv, errmsg, sizeof(errmsg)); + rv = fspr_filepath_root(&root, &path, 0, p); + fspr_strerror(rv, errmsg, sizeof(errmsg)); ABTS_PTR_EQUAL(tc, NULL, root); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ERELATIVE(rv)); @@ -205,11 +205,11 @@ static void root_relative(abts_case *tc, void *data) static void root_from_slash(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; const char *root = NULL; const char *path = "//"; - rv = apr_filepath_root(&root, &path, APR_FILEPATH_TRUENAME, p); + rv = fspr_filepath_root(&root, &path, APR_FILEPATH_TRUENAME, p); #if defined(WIN32) || defined(OS2) ABTS_INT_EQUAL(tc, APR_EINCOMPLETE, rv); @@ -223,15 +223,15 @@ static void root_from_slash(abts_case *tc, void *data) static void root_from_cwd_and_back(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; const char *root = NULL; const char *path = "//"; char *origpath; char *testpath; - ABTS_INT_EQUAL(tc, APR_SUCCESS, apr_filepath_get(&origpath, 0, p)); + ABTS_INT_EQUAL(tc, APR_SUCCESS, fspr_filepath_get(&origpath, 0, p)); path = origpath; - rv = apr_filepath_root(&root, &path, APR_FILEPATH_TRUENAME, p); + rv = fspr_filepath_root(&root, &path, APR_FILEPATH_TRUENAME, p); #if defined(WIN32) || defined(OS2) ABTS_INT_EQUAL(tc, origpath[0], root[0]); @@ -257,7 +257,7 @@ static void root_from_cwd_and_back(abts_case *tc, void *data) ABTS_STR_EQUAL(tc, origpath + 1, path); #endif - rv = apr_filepath_merge(&testpath, root, path, + rv = fspr_filepath_merge(&testpath, root, path, APR_FILEPATH_TRUENAME | APR_FILEPATH_NOTABOVEROOT | APR_FILEPATH_NOTRELATIVE, p); diff --git a/libs/apr/test/testoc.c b/libs/apr/test/testoc.c index 9dbaff8c37..c067f78f83 100644 --- a/libs/apr/test/testoc.c +++ b/libs/apr/test/testoc.c @@ -15,11 +15,11 @@ */ #include "testutil.h" -#include "apr_thread_proc.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_strings.h" +#include "fspr_thread_proc.h" +#include "fspr_errno.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_strings.h" #if APR_HAS_OTHER_CHILD @@ -29,19 +29,19 @@ static void ocmaint(int reason, void *data, int status) { switch (reason) { case APR_OC_REASON_DEATH: - apr_cpystrn(reasonstr, "APR_OC_REASON_DEATH", + fspr_cpystrn(reasonstr, "APR_OC_REASON_DEATH", strlen("APR_OC_REASON_DEATH") + 1); break; case APR_OC_REASON_LOST: - apr_cpystrn(reasonstr, "APR_OC_REASON_LOST", + fspr_cpystrn(reasonstr, "APR_OC_REASON_LOST", strlen("APR_OC_REASON_LOST") + 1); break; case APR_OC_REASON_UNWRITABLE: - apr_cpystrn(reasonstr, "APR_OC_REASON_UNWRITEABLE", + fspr_cpystrn(reasonstr, "APR_OC_REASON_UNWRITEABLE", strlen("APR_OC_REASON_UNWRITEABLE") + 1); break; case APR_OC_REASON_RESTART: - apr_cpystrn(reasonstr, "APR_OC_REASON_RESTART", + fspr_cpystrn(reasonstr, "APR_OC_REASON_RESTART", strlen("APR_OC_REASON_RESTART") + 1); break; } @@ -56,24 +56,24 @@ static void ocmaint(int reason, void *data, int status) */ static void test_child_kill(abts_case *tc, void *data) { - apr_file_t *std = NULL; - apr_proc_t newproc; - apr_procattr_t *procattr = NULL; + fspr_file_t *std = NULL; + fspr_proc_t newproc; + fspr_procattr_t *procattr = NULL; const char *args[3]; - apr_status_t rv; + fspr_status_t rv; - args[0] = apr_pstrdup(p, "occhild" EXTENSION); - args[1] = apr_pstrdup(p, "-X"); + args[0] = fspr_pstrdup(p, "occhild" EXTENSION); + args[1] = fspr_pstrdup(p, "-X"); args[2] = NULL; - rv = apr_procattr_create(&procattr, p); + rv = fspr_procattr_create(&procattr, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_procattr_io_set(procattr, APR_FULL_BLOCK, APR_NO_PIPE, + rv = fspr_procattr_io_set(procattr, APR_FULL_BLOCK, APR_NO_PIPE, APR_NO_PIPE); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_proc_create(&newproc, "./occhild" EXTENSION, args, NULL, procattr, p); + rv = fspr_proc_create(&newproc, "./occhild" EXTENSION, args, NULL, procattr, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, newproc.in); ABTS_PTR_EQUAL(tc, NULL, newproc.out); @@ -81,16 +81,16 @@ static void test_child_kill(abts_case *tc, void *data) std = newproc.in; - apr_proc_other_child_register(&newproc, ocmaint, NULL, std, p); + fspr_proc_other_child_register(&newproc, ocmaint, NULL, std, p); - apr_sleep(apr_time_from_sec(1)); - rv = apr_proc_kill(&newproc, SIGKILL); + fspr_sleep(fspr_time_from_sec(1)); + rv = fspr_proc_kill(&newproc, SIGKILL); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); /* allow time for things to settle... */ - apr_sleep(apr_time_from_sec(3)); + fspr_sleep(fspr_time_from_sec(3)); - apr_proc_other_child_refresh_all(APR_OC_REASON_RUNNING); + fspr_proc_other_child_refresh_all(APR_OC_REASON_RUNNING); ABTS_STR_EQUAL(tc, "APR_OC_REASON_DEATH", reasonstr); } #else diff --git a/libs/apr/test/testpath.c b/libs/apr/test/testpath.c index b05ae9917e..6de85b8400 100644 --- a/libs/apr/test/testpath.c +++ b/libs/apr/test/testpath.c @@ -15,10 +15,10 @@ */ #include "testutil.h" -#include "apr_file_info.h" -#include "apr_errno.h" -#include "apr_pools.h" -#include "apr_tables.h" +#include "fspr_file_info.h" +#include "fspr_errno.h" +#include "fspr_pools.h" +#include "fspr_tables.h" #if defined(WIN32) || defined(NETWARE) || defined(OS2) #define PSEP ";" @@ -46,11 +46,11 @@ static const int parts_out_count = sizeof(parts_out)/sizeof(*parts_out); static void list_split_multi(abts_case *tc, void *data) { int i; - apr_status_t rv; - apr_array_header_t *pathelts; + fspr_status_t rv; + fspr_array_header_t *pathelts; pathelts = NULL; - rv = apr_filepath_list_split(&pathelts, path_in, p); + rv = fspr_filepath_list_split(&pathelts, path_in, p); ABTS_PTR_NOTNULL(tc, pathelts); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, parts_out_count, pathelts->nelts); @@ -61,13 +61,13 @@ static void list_split_multi(abts_case *tc, void *data) static void list_split_single(abts_case *tc, void *data) { int i; - apr_status_t rv; - apr_array_header_t *pathelts; + fspr_status_t rv; + fspr_array_header_t *pathelts; for (i = 0; i < parts_in_count; ++i) { pathelts = NULL; - rv = apr_filepath_list_split(&pathelts, parts_in[i], p); + rv = fspr_filepath_list_split(&pathelts, parts_in[i], p); ABTS_PTR_NOTNULL(tc, pathelts); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); if (parts_in[i][0] == '\0') @@ -84,15 +84,15 @@ static void list_merge_multi(abts_case *tc, void *data) { int i; char *liststr; - apr_status_t rv; - apr_array_header_t *pathelts; + fspr_status_t rv; + fspr_array_header_t *pathelts; - pathelts = apr_array_make(p, parts_in_count, sizeof(const char*)); + pathelts = fspr_array_make(p, parts_in_count, sizeof(const char*)); for (i = 0; i < parts_in_count; ++i) - *(const char**)apr_array_push(pathelts) = parts_in[i]; + *(const char**)fspr_array_push(pathelts) = parts_in[i]; liststr = NULL; - rv = apr_filepath_list_merge(&liststr, pathelts, p); + rv = fspr_filepath_list_merge(&liststr, pathelts, p); ABTS_PTR_NOTNULL(tc, liststr); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_STR_EQUAL(tc, liststr, path_out); @@ -102,16 +102,16 @@ static void list_merge_single(abts_case *tc, void *data) { int i; char *liststr; - apr_status_t rv; - apr_array_header_t *pathelts; + fspr_status_t rv; + fspr_array_header_t *pathelts; - pathelts = apr_array_make(p, 1, sizeof(const char*)); - apr_array_push(pathelts); + pathelts = fspr_array_make(p, 1, sizeof(const char*)); + fspr_array_push(pathelts); for (i = 0; i < parts_in_count; ++i) { *(const char**)pathelts->elts = parts_in[i]; liststr = NULL; - rv = apr_filepath_list_merge(&liststr, pathelts, p); + rv = fspr_filepath_list_merge(&liststr, pathelts, p); if (parts_in[i][0] == '\0') ABTS_PTR_EQUAL(tc, NULL, liststr); else diff --git a/libs/apr/test/testpipe.c b/libs/apr/test/testpipe.c index db3c77ffc3..add6c384a7 100644 --- a/libs/apr/test/testpipe.c +++ b/libs/apr/test/testpipe.c @@ -17,21 +17,21 @@ #include #include "testutil.h" -#include "apr_file_io.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_thread_proc.h" -#include "apr_strings.h" +#include "fspr_file_io.h" +#include "fspr_errno.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_thread_proc.h" +#include "fspr_strings.h" -static apr_file_t *readp = NULL; -static apr_file_t *writep = NULL; +static fspr_file_t *readp = NULL; +static fspr_file_t *writep = NULL; static void create_pipe(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; - rv = apr_file_pipe_create(&readp, &writep, p); + rv = fspr_file_pipe_create(&readp, &writep, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, readp); ABTS_PTR_NOTNULL(tc, writep); @@ -39,60 +39,60 @@ static void create_pipe(abts_case *tc, void *data) static void close_pipe(abts_case *tc, void *data) { - apr_status_t rv; - apr_size_t nbytes = 256; + fspr_status_t rv; + fspr_size_t nbytes = 256; char buf[256]; - rv = apr_file_close(readp); - rv = apr_file_close(writep); + rv = fspr_file_close(readp); + rv = fspr_file_close(writep); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_read(readp, buf, &nbytes); + rv = fspr_file_read(readp, buf, &nbytes); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EBADF(rv)); } static void set_timeout(abts_case *tc, void *data) { - apr_status_t rv; - apr_interval_time_t timeout; + fspr_status_t rv; + fspr_interval_time_t timeout; - rv = apr_file_pipe_create(&readp, &writep, p); + rv = fspr_file_pipe_create(&readp, &writep, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, readp); ABTS_PTR_NOTNULL(tc, writep); - rv = apr_file_pipe_timeout_get(readp, &timeout); + rv = fspr_file_pipe_timeout_get(readp, &timeout); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_ASSERT(tc, "Timeout mismatch, expected -1", timeout == -1); - rv = apr_file_pipe_timeout_set(readp, apr_time_from_sec(1)); + rv = fspr_file_pipe_timeout_set(readp, fspr_time_from_sec(1)); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_pipe_timeout_get(readp, &timeout); + rv = fspr_file_pipe_timeout_get(readp, &timeout); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_ASSERT(tc, "Timeout mismatch, expected 1 second", - timeout == apr_time_from_sec(1)); + timeout == fspr_time_from_sec(1)); } static void read_write(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; char *buf; - apr_size_t nbytes; + fspr_size_t nbytes; nbytes = strlen("this is a test"); - buf = (char *)apr_palloc(p, nbytes + 1); + buf = (char *)fspr_palloc(p, nbytes + 1); - rv = apr_file_pipe_create(&readp, &writep, p); + rv = fspr_file_pipe_create(&readp, &writep, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, readp); ABTS_PTR_NOTNULL(tc, writep); - rv = apr_file_pipe_timeout_set(readp, apr_time_from_sec(1)); + rv = fspr_file_pipe_timeout_set(readp, fspr_time_from_sec(1)); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); if (!rv) { - rv = apr_file_read(readp, buf, &nbytes); + rv = fspr_file_read(readp, buf, &nbytes); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); ABTS_INT_EQUAL(tc, 0, nbytes); } @@ -100,25 +100,25 @@ static void read_write(abts_case *tc, void *data) static void read_write_notimeout(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; char *buf = "this is a test"; char *input; - apr_size_t nbytes; + fspr_size_t nbytes; nbytes = strlen("this is a test"); - rv = apr_file_pipe_create(&readp, &writep, p); + rv = fspr_file_pipe_create(&readp, &writep, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, readp); ABTS_PTR_NOTNULL(tc, writep); - rv = apr_file_write(writep, buf, &nbytes); + rv = fspr_file_write(writep, buf, &nbytes); ABTS_INT_EQUAL(tc, strlen("this is a test"), nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); nbytes = 256; - input = apr_pcalloc(p, nbytes + 1); - rv = apr_file_read(readp, input, &nbytes); + input = fspr_pcalloc(p, nbytes + 1); + rv = fspr_file_read(readp, input, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, strlen("this is a test"), nbytes); ABTS_STR_EQUAL(tc, "this is a test", input); @@ -131,54 +131,54 @@ static void test_pipe_writefull(abts_case *tc, void *data) int bytes_per_iteration = 8000; char *buf = (char *)malloc(bytes_per_iteration); char responsebuf[128]; - apr_size_t nbytes; + fspr_size_t nbytes; int bytes_processed; - apr_proc_t proc = {0}; - apr_procattr_t *procattr; + fspr_proc_t proc = {0}; + fspr_procattr_t *procattr; const char *args[2]; - apr_status_t rv; - apr_exit_why_e why; + fspr_status_t rv; + fspr_exit_why_e why; - rv = apr_procattr_create(&procattr, p); + rv = fspr_procattr_create(&procattr, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_procattr_io_set(procattr, APR_CHILD_BLOCK, APR_CHILD_BLOCK, + rv = fspr_procattr_io_set(procattr, APR_CHILD_BLOCK, APR_CHILD_BLOCK, APR_CHILD_BLOCK); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_procattr_error_check_set(procattr, 1); + rv = fspr_procattr_error_check_set(procattr, 1); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); args[0] = "readchild" EXTENSION; args[1] = NULL; - rv = apr_proc_create(&proc, "./readchild" EXTENSION, args, NULL, procattr, p); + rv = fspr_proc_create(&proc, "./readchild" EXTENSION, args, NULL, procattr, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_pipe_timeout_set(proc.in, apr_time_from_sec(10)); + rv = fspr_file_pipe_timeout_set(proc.in, fspr_time_from_sec(10)); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_pipe_timeout_set(proc.out, apr_time_from_sec(10)); + rv = fspr_file_pipe_timeout_set(proc.out, fspr_time_from_sec(10)); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); i = iterations; do { - rv = apr_file_write_full(proc.in, buf, bytes_per_iteration, NULL); + rv = fspr_file_write_full(proc.in, buf, bytes_per_iteration, NULL); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } while (--i); free(buf); - rv = apr_file_close(proc.in); + rv = fspr_file_close(proc.in); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); nbytes = sizeof(responsebuf); - rv = apr_file_read(proc.out, responsebuf, &nbytes); + rv = fspr_file_read(proc.out, responsebuf, &nbytes); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - bytes_processed = (int)apr_strtoi64(responsebuf, NULL, 10); + bytes_processed = (int)fspr_strtoi64(responsebuf, NULL, 10); ABTS_INT_EQUAL(tc, iterations * bytes_per_iteration, bytes_processed); ABTS_ASSERT(tc, "wait for child process", - apr_proc_wait(&proc, NULL, &why, APR_WAIT) == APR_CHILD_DONE); + fspr_proc_wait(&proc, NULL, &why, APR_WAIT) == APR_CHILD_DONE); ABTS_ASSERT(tc, "child terminated normally", why == APR_PROC_EXIT); } diff --git a/libs/apr/test/testpoll.c b/libs/apr/test/testpoll.c index 36dd8a06bf..1b1424614a 100644 --- a/libs/apr/test/testpoll.c +++ b/libs/apr/test/testpoll.c @@ -15,12 +15,12 @@ */ #include "testutil.h" -#include "apr_strings.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_network_io.h" -#include "apr_poll.h" +#include "fspr_strings.h" +#include "fspr_errno.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_network_io.h" +#include "fspr_poll.h" #define SMALL_NUM_SOCKETS 3 /* We can't use 64 here, because some platforms *ahem* Solaris *ahem* have @@ -29,83 +29,83 @@ */ #define LARGE_NUM_SOCKETS 50 -static apr_socket_t *s[LARGE_NUM_SOCKETS]; -static apr_sockaddr_t *sa[LARGE_NUM_SOCKETS]; -static apr_pollset_t *pollset; +static fspr_socket_t *s[LARGE_NUM_SOCKETS]; +static fspr_sockaddr_t *sa[LARGE_NUM_SOCKETS]; +static fspr_pollset_t *pollset; /* ###: tests surrounded by ifdef OLD_POLL_INTERFACE either need to be * converted to use the pollset interface or removed. */ #ifdef OLD_POLL_INTERFACE -static apr_pollfd_t *pollarray; -static apr_pollfd_t *pollarray_large; +static fspr_pollfd_t *pollarray; +static fspr_pollfd_t *pollarray_large; #endif -static void make_socket(apr_socket_t **sock, apr_sockaddr_t **sa, - apr_port_t port, apr_pool_t *p, abts_case *tc) +static void make_socket(fspr_socket_t **sock, fspr_sockaddr_t **sa, + fspr_port_t port, fspr_pool_t *p, abts_case *tc) { - apr_status_t rv; + fspr_status_t rv; - rv = apr_sockaddr_info_get(sa, "127.0.0.1", APR_UNSPEC, port, 0, p); + rv = fspr_sockaddr_info_get(sa, "127.0.0.1", APR_UNSPEC, port, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_socket_create(sock, (*sa)->family, SOCK_DGRAM, 0, p); + rv = fspr_socket_create(sock, (*sa)->family, SOCK_DGRAM, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv =apr_socket_bind((*sock), (*sa)); + rv =fspr_socket_bind((*sock), (*sa)); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } #ifdef OLD_POLL_INTERFACE -static void check_sockets(const apr_pollfd_t *pollarray, - apr_socket_t **sockarray, int which, int pollin, +static void check_sockets(const fspr_pollfd_t *pollarray, + fspr_socket_t **sockarray, int which, int pollin, abts_case *tc) { - apr_status_t rv; - apr_int16_t event; + fspr_status_t rv; + fspr_int16_t event; char *str; - rv = apr_poll_revents_get(&event, sockarray[which], - (apr_pollfd_t *)pollarray); + rv = fspr_poll_revents_get(&event, sockarray[which], + (fspr_pollfd_t *)pollarray); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); if (pollin) { - str = apr_psprintf(p, "Socket %d not signalled when it should be", + str = fspr_psprintf(p, "Socket %d not signalled when it should be", which); ABTS_ASSERT(tc, str, event & APR_POLLIN); } else { - str = apr_psprintf(p, "Socket %d signalled when it should not be", + str = fspr_psprintf(p, "Socket %d signalled when it should not be", which); ABTS_ASSERT(tc, str, !(event & APR_POLLIN)); } } #endif -static void send_msg(apr_socket_t **sockarray, apr_sockaddr_t **sas, int which, +static void send_msg(fspr_socket_t **sockarray, fspr_sockaddr_t **sas, int which, abts_case *tc) { - apr_size_t len = 5; - apr_status_t rv; + fspr_size_t len = 5; + fspr_status_t rv; ABTS_PTR_NOTNULL(tc, sockarray[which]); - rv = apr_socket_sendto(sockarray[which], sas[which], 0, "hello", &len); + rv = fspr_socket_sendto(sockarray[which], sas[which], 0, "hello", &len); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, strlen("hello"), len); } -static void recv_msg(apr_socket_t **sockarray, int which, apr_pool_t *p, +static void recv_msg(fspr_socket_t **sockarray, int which, fspr_pool_t *p, abts_case *tc) { - apr_size_t buflen = 5; - char *buffer = apr_pcalloc(p, sizeof(char) * (buflen + 1)); - apr_sockaddr_t *recsa; - apr_status_t rv; + fspr_size_t buflen = 5; + char *buffer = fspr_pcalloc(p, sizeof(char) * (buflen + 1)); + fspr_sockaddr_t *recsa; + fspr_status_t rv; ABTS_PTR_NOTNULL(tc, sockarray[which]); - apr_sockaddr_info_get(&recsa, "127.0.0.1", APR_UNSPEC, 7770, 0, p); + fspr_sockaddr_info_get(&recsa, "127.0.0.1", APR_UNSPEC, 7770, 0, p); - rv = apr_socket_recvfrom(recsa, sockarray[which], 0, buffer, &buflen); + rv = fspr_socket_recvfrom(recsa, sockarray[which], 0, buffer, &buflen); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, strlen("hello"), buflen); ABTS_STR_EQUAL(tc, "hello", buffer); @@ -124,17 +124,17 @@ static void create_all_sockets(abts_case *tc, void *data) #ifdef OLD_POLL_INTERFACE static void setup_small_poll(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; int i; - rv = apr_poll_setup(&pollarray, SMALL_NUM_SOCKETS, p); + rv = fspr_poll_setup(&pollarray, SMALL_NUM_SOCKETS, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); for (i = 0; i < SMALL_NUM_SOCKETS;i++){ ABTS_INT_EQUAL(tc, 0, pollarray[i].reqevents); ABTS_INT_EQUAL(tc, 0, pollarray[i].rtnevents); - rv = apr_poll_socket_add(pollarray, s[i], APR_POLLIN); + rv = fspr_poll_socket_add(pollarray, s[i], APR_POLLIN); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_EQUAL(tc, s[i], pollarray[i].desc.s); } @@ -142,17 +142,17 @@ static void setup_small_poll(abts_case *tc, void *data) static void setup_large_poll(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; int i; - rv = apr_poll_setup(&pollarray_large, LARGE_NUM_SOCKETS, p); + rv = fspr_poll_setup(&pollarray_large, LARGE_NUM_SOCKETS, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); for (i = 0; i < LARGE_NUM_SOCKETS;i++){ ABTS_INT_EQUAL(tc, 0, pollarray_large[i].reqevents); ABTS_INT_EQUAL(tc, 0, pollarray_large[i].rtnevents); - rv = apr_poll_socket_add(pollarray_large, s[i], APR_POLLIN); + rv = fspr_poll_socket_add(pollarray_large, s[i], APR_POLLIN); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_EQUAL(tc, s[i], pollarray_large[i].desc.s); } @@ -160,10 +160,10 @@ static void setup_large_poll(abts_case *tc, void *data) static void nomessage(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; int srv = SMALL_NUM_SOCKETS; - rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); + rv = fspr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); check_sockets(pollarray, s, 0, 0, tc); check_sockets(pollarray, s, 1, 0, tc); @@ -172,12 +172,12 @@ static void nomessage(abts_case *tc, void *data) static void send_2(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; int srv = SMALL_NUM_SOCKETS; send_msg(s, sa, 2, tc); - rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); + rv = fspr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); check_sockets(pollarray, s, 0, 0, tc); check_sockets(pollarray, s, 1, 0, tc); @@ -186,13 +186,13 @@ static void send_2(abts_case *tc, void *data) static void recv_2_send_1(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; int srv = SMALL_NUM_SOCKETS; recv_msg(s, 2, p, tc); send_msg(s, sa, 1, tc); - rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); + rv = fspr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); check_sockets(pollarray, s, 0, 0, tc); check_sockets(pollarray, s, 1, 1, tc); @@ -201,12 +201,12 @@ static void recv_2_send_1(abts_case *tc, void *data) static void send_2_signaled_1(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; int srv = SMALL_NUM_SOCKETS; send_msg(s, sa, 2, tc); - rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); + rv = fspr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); check_sockets(pollarray, s, 0, 0, tc); check_sockets(pollarray, s, 1, 1, tc); @@ -215,13 +215,13 @@ static void send_2_signaled_1(abts_case *tc, void *data) static void recv_1_send_0(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; int srv = SMALL_NUM_SOCKETS; recv_msg(s, 1, p, tc); send_msg(s, sa, 0, tc); - rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); + rv = fspr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); check_sockets(pollarray, s, 0, 1, tc); check_sockets(pollarray, s, 1, 0, tc); @@ -230,13 +230,13 @@ static void recv_1_send_0(abts_case *tc, void *data) static void clear_all_signalled(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; int srv = SMALL_NUM_SOCKETS; recv_msg(s, 0, p, tc); recv_msg(s, 2, p, tc); - rv = apr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); + rv = fspr_poll(pollarray, SMALL_NUM_SOCKETS, &srv, 2 * APR_USEC_PER_SEC); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); check_sockets(pollarray, s, 0, 0, tc); check_sockets(pollarray, s, 1, 0, tc); @@ -245,13 +245,13 @@ static void clear_all_signalled(abts_case *tc, void *data) static void send_large_pollarray(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; int lrv = LARGE_NUM_SOCKETS; int i; send_msg(s, sa, LARGE_NUM_SOCKETS - 1, tc); - rv = apr_poll(pollarray_large, LARGE_NUM_SOCKETS, &lrv, + rv = fspr_poll(pollarray_large, LARGE_NUM_SOCKETS, &lrv, 2 * APR_USEC_PER_SEC); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -267,13 +267,13 @@ static void send_large_pollarray(abts_case *tc, void *data) static void recv_large_pollarray(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; int lrv = LARGE_NUM_SOCKETS; int i; recv_msg(s, LARGE_NUM_SOCKETS - 1, p, tc); - rv = apr_poll(pollarray_large, LARGE_NUM_SOCKETS, &lrv, + rv = fspr_poll(pollarray_large, LARGE_NUM_SOCKETS, &lrv, 2 * APR_USEC_PER_SEC); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); @@ -285,29 +285,29 @@ static void recv_large_pollarray(abts_case *tc, void *data) static void setup_pollset(abts_case *tc, void *data) { - apr_status_t rv; - rv = apr_pollset_create(&pollset, LARGE_NUM_SOCKETS, p, 0); + fspr_status_t rv; + rv = fspr_pollset_create(&pollset, LARGE_NUM_SOCKETS, p, 0); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } static void multi_event_pollset(abts_case *tc, void *data) { - apr_status_t rv; - apr_pollfd_t socket_pollfd; + fspr_status_t rv; + fspr_pollfd_t socket_pollfd; int lrv; - const apr_pollfd_t *descs = NULL; + const fspr_pollfd_t *descs = NULL; ABTS_PTR_NOTNULL(tc, s[0]); socket_pollfd.desc_type = APR_POLL_SOCKET; socket_pollfd.reqevents = APR_POLLIN | APR_POLLOUT; socket_pollfd.desc.s = s[0]; socket_pollfd.client_data = s[0]; - rv = apr_pollset_add(pollset, &socket_pollfd); + rv = fspr_pollset_add(pollset, &socket_pollfd); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); send_msg(s, sa, 0, tc); - rv = apr_pollset_poll(pollset, 0, &lrv, &descs); + rv = fspr_pollset_poll(pollset, 0, &lrv, &descs); ABTS_INT_EQUAL(tc, 0, APR_STATUS_IS_TIMEUP(rv)); if (lrv == 1) { ABTS_PTR_EQUAL(tc, s[0], descs[0].desc.s); @@ -331,24 +331,24 @@ static void multi_event_pollset(abts_case *tc, void *data) recv_msg(s, 0, p, tc); - rv = apr_pollset_poll(pollset, 0, &lrv, &descs); + rv = fspr_pollset_poll(pollset, 0, &lrv, &descs); ABTS_INT_EQUAL(tc, 0, APR_STATUS_IS_TIMEUP(rv)); ABTS_INT_EQUAL(tc, 1, lrv); ABTS_PTR_EQUAL(tc, s[0], descs[0].desc.s); ABTS_INT_EQUAL(tc, APR_POLLOUT, descs[0].rtnevents); ABTS_PTR_EQUAL(tc, s[0], descs[0].client_data); - rv = apr_pollset_remove(pollset, &socket_pollfd); + rv = fspr_pollset_remove(pollset, &socket_pollfd); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } static void add_sockets_pollset(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; int i; for (i = 0; i < LARGE_NUM_SOCKETS;i++){ - apr_pollfd_t socket_pollfd; + fspr_pollfd_t socket_pollfd; ABTS_PTR_NOTNULL(tc, s[i]); @@ -356,18 +356,18 @@ static void add_sockets_pollset(abts_case *tc, void *data) socket_pollfd.reqevents = APR_POLLIN; socket_pollfd.desc.s = s[i]; socket_pollfd.client_data = s[i]; - rv = apr_pollset_add(pollset, &socket_pollfd); + rv = fspr_pollset_add(pollset, &socket_pollfd); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } } static void nomessage_pollset(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; int lrv; - const apr_pollfd_t *descs = NULL; + const fspr_pollfd_t *descs = NULL; - rv = apr_pollset_poll(pollset, 0, &lrv, &descs); + rv = fspr_pollset_poll(pollset, 0, &lrv, &descs); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); ABTS_INT_EQUAL(tc, 0, lrv); ABTS_PTR_EQUAL(tc, NULL, descs); @@ -375,12 +375,12 @@ static void nomessage_pollset(abts_case *tc, void *data) static void send0_pollset(abts_case *tc, void *data) { - apr_status_t rv; - const apr_pollfd_t *descs = NULL; + fspr_status_t rv; + const fspr_pollfd_t *descs = NULL; int num; send_msg(s, sa, 0, tc); - rv = apr_pollset_poll(pollset, 0, &num, &descs); + rv = fspr_pollset_poll(pollset, 0, &num, &descs); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, 1, num); ABTS_PTR_NOTNULL(tc, descs); @@ -391,12 +391,12 @@ static void send0_pollset(abts_case *tc, void *data) static void recv0_pollset(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; int lrv; - const apr_pollfd_t *descs = NULL; + const fspr_pollfd_t *descs = NULL; recv_msg(s, 0, p, tc); - rv = apr_pollset_poll(pollset, 0, &lrv, &descs); + rv = fspr_pollset_poll(pollset, 0, &lrv, &descs); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); ABTS_INT_EQUAL(tc, 0, lrv); ABTS_PTR_EQUAL(tc, NULL, descs); @@ -404,13 +404,13 @@ static void recv0_pollset(abts_case *tc, void *data) static void send_middle_pollset(abts_case *tc, void *data) { - apr_status_t rv; - const apr_pollfd_t *descs = NULL; + fspr_status_t rv; + const fspr_pollfd_t *descs = NULL; int num; send_msg(s, sa, 2, tc); send_msg(s, sa, 5, tc); - rv = apr_pollset_poll(pollset, 0, &num, &descs); + rv = fspr_pollset_poll(pollset, 0, &num, &descs); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, 2, num); ABTS_PTR_NOTNULL(tc, descs); @@ -422,14 +422,14 @@ static void send_middle_pollset(abts_case *tc, void *data) static void clear_middle_pollset(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; int lrv; - const apr_pollfd_t *descs = NULL; + const fspr_pollfd_t *descs = NULL; recv_msg(s, 2, p, tc); recv_msg(s, 5, p, tc); - rv = apr_pollset_poll(pollset, 0, &lrv, &descs); + rv = fspr_pollset_poll(pollset, 0, &lrv, &descs); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); ABTS_INT_EQUAL(tc, 0, lrv); ABTS_PTR_EQUAL(tc, NULL, descs); @@ -437,12 +437,12 @@ static void clear_middle_pollset(abts_case *tc, void *data) static void send_last_pollset(abts_case *tc, void *data) { - apr_status_t rv; - const apr_pollfd_t *descs = NULL; + fspr_status_t rv; + const fspr_pollfd_t *descs = NULL; int num; send_msg(s, sa, LARGE_NUM_SOCKETS - 1, tc); - rv = apr_pollset_poll(pollset, 0, &num, &descs); + rv = fspr_pollset_poll(pollset, 0, &num, &descs); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, 1, num); ABTS_PTR_NOTNULL(tc, descs); @@ -453,13 +453,13 @@ static void send_last_pollset(abts_case *tc, void *data) static void clear_last_pollset(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; int lrv; - const apr_pollfd_t *descs = NULL; + const fspr_pollfd_t *descs = NULL; recv_msg(s, LARGE_NUM_SOCKETS - 1, p, tc); - rv = apr_pollset_poll(pollset, 0, &lrv, &descs); + rv = fspr_pollset_poll(pollset, 0, &lrv, &descs); ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); ABTS_INT_EQUAL(tc, 0, lrv); ABTS_PTR_EQUAL(tc, NULL, descs); @@ -467,24 +467,24 @@ static void clear_last_pollset(abts_case *tc, void *data) static void close_all_sockets(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; int i; for (i = 0; i < LARGE_NUM_SOCKETS; i++){ - rv = apr_socket_close(s[i]); + rv = fspr_socket_close(s[i]); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } } static void pollset_remove(abts_case *tc, void *data) { - apr_status_t rv; - apr_pollset_t *pollset; - const apr_pollfd_t *hot_files; - apr_pollfd_t pfd; - apr_int32_t num; + fspr_status_t rv; + fspr_pollset_t *pollset; + const fspr_pollfd_t *hot_files; + fspr_pollfd_t pfd; + fspr_int32_t num; - rv = apr_pollset_create(&pollset, 5, p, 0); + rv = fspr_pollset_create(&pollset, 5, p, 0); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); pfd.p = p; @@ -493,36 +493,36 @@ static void pollset_remove(abts_case *tc, void *data) pfd.desc.s = s[0]; pfd.client_data = (void *)1; - rv = apr_pollset_add(pollset, &pfd); + rv = fspr_pollset_add(pollset, &pfd); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); pfd.desc.s = s[1]; pfd.client_data = (void *)2; - rv = apr_pollset_add(pollset, &pfd); + rv = fspr_pollset_add(pollset, &pfd); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); pfd.desc.s = s[2]; pfd.client_data = (void *)3; - rv = apr_pollset_add(pollset, &pfd); + rv = fspr_pollset_add(pollset, &pfd); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); pfd.desc.s = s[3]; pfd.client_data = (void *)4; - rv = apr_pollset_add(pollset, &pfd); + rv = fspr_pollset_add(pollset, &pfd); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_pollset_poll(pollset, 1000, &num, &hot_files); + rv = fspr_pollset_poll(pollset, 1000, &num, &hot_files); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, 4, num); /* now remove the pollset element referring to desc s[1] */ pfd.desc.s = s[1]; pfd.client_data = (void *)999; /* not used on this call */ - rv = apr_pollset_remove(pollset, &pfd); + rv = fspr_pollset_remove(pollset, &pfd); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); /* this time only three should match */ - rv = apr_pollset_poll(pollset, 1000, &num, &hot_files); + rv = fspr_pollset_poll(pollset, 1000, &num, &hot_files); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, 3, num); ABTS_PTR_EQUAL(tc, (void *)1, hot_files[0].client_data); @@ -535,11 +535,11 @@ static void pollset_remove(abts_case *tc, void *data) /* now remove the pollset elements referring to desc s[2] */ pfd.desc.s = s[2]; pfd.client_data = (void *)999; /* not used on this call */ - rv = apr_pollset_remove(pollset, &pfd); + rv = fspr_pollset_remove(pollset, &pfd); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); /* this time only two should match */ - rv = apr_pollset_poll(pollset, 1000, &num, &hot_files); + rv = fspr_pollset_poll(pollset, 1000, &num, &hot_files); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, 2, num); ABTS_ASSERT(tc, "Incorrect socket in result set", diff --git a/libs/apr/test/testpools.c b/libs/apr/test/testpools.c index cb45552e77..9354dd44f8 100644 --- a/libs/apr/test/testpools.c +++ b/libs/apr/test/testpools.c @@ -15,10 +15,10 @@ */ -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_errno.h" -#include "apr_file_io.h" +#include "fspr_general.h" +#include "fspr_pools.h" +#include "fspr_errno.h" +#include "fspr_file_io.h" #include #include #include @@ -29,15 +29,15 @@ #define ALLOC_BYTES 1024 -static apr_pool_t *pmain = NULL; -static apr_pool_t *pchild = NULL; +static fspr_pool_t *pmain = NULL; +static fspr_pool_t *pchild = NULL; static void alloc_bytes(abts_case *tc, void *data) { int i; char *alloc; - alloc = apr_palloc(pmain, ALLOC_BYTES); + alloc = fspr_palloc(pmain, ALLOC_BYTES); ABTS_PTR_NOTNULL(tc, alloc); for (i=0;i #include @@ -32,47 +32,47 @@ #define CHILDREN 6 #define MAX_COUNTER (MAX_ITER * CHILDREN) -static apr_proc_mutex_t *proc_lock; +static fspr_proc_mutex_t *proc_lock; static volatile int *x; /* a slower more racy way to implement (*x)++ */ static int increment(int n) { - apr_sleep(1); + fspr_sleep(1); return n+1; } -static void make_child(abts_case *tc, apr_proc_t **proc, apr_pool_t *p) +static void make_child(abts_case *tc, fspr_proc_t **proc, fspr_pool_t *p) { - apr_status_t rv; + fspr_status_t rv; - *proc = apr_pcalloc(p, sizeof(**proc)); + *proc = fspr_pcalloc(p, sizeof(**proc)); /* slight delay to allow things to settle */ - apr_sleep (1); + fspr_sleep (1); - rv = apr_proc_fork(*proc, p); + rv = fspr_proc_fork(*proc, p); if (rv == APR_INCHILD) { int i = 0; - /* The parent process has setup all processes to call apr_terminate + /* The parent process has setup all processes to call fspr_terminate * at exit. But, that means that all processes must also call - * apr_initialize at startup. You cannot have an unequal number - * of apr_terminate and apr_initialize calls. If you do, bad things + * fspr_initialize at startup. You cannot have an unequal number + * of fspr_terminate and fspr_initialize calls. If you do, bad things * will happen. In this case, the bad thing is that if the mutex * is a semaphore, it will be destroyed before all of the processes * die. That means that the test will most likely fail. */ - apr_initialize(); + fspr_initialize(); - if (apr_proc_mutex_child_init(&proc_lock, NULL, p)) + if (fspr_proc_mutex_child_init(&proc_lock, NULL, p)) exit(1); do { - if (apr_proc_mutex_lock(proc_lock)) + if (fspr_proc_mutex_lock(proc_lock)) exit(1); i++; *x = increment(*x); - if (apr_proc_mutex_unlock(proc_lock)) + if (fspr_proc_mutex_unlock(proc_lock)) exit(1); } while (i < MAX_ITER); exit(0); @@ -82,25 +82,25 @@ static void make_child(abts_case *tc, apr_proc_t **proc, apr_pool_t *p) } /* Wait for a child process and check it terminated with success. */ -static void await_child(abts_case *tc, apr_proc_t *proc) +static void await_child(abts_case *tc, fspr_proc_t *proc) { int code; - apr_exit_why_e why; - apr_status_t rv; + fspr_exit_why_e why; + fspr_status_t rv; - rv = apr_proc_wait(proc, &code, &why, APR_WAIT); + rv = fspr_proc_wait(proc, &code, &why, APR_WAIT); ABTS_ASSERT(tc, "child did not terminate with success", rv == APR_CHILD_DONE && why == APR_PROC_EXIT && code == 0); } static void test_exclusive(abts_case *tc, const char *lockname, - apr_lockmech_e mech) + fspr_lockmech_e mech) { - apr_proc_t *child[CHILDREN]; - apr_status_t rv; + fspr_proc_t *child[CHILDREN]; + fspr_status_t rv; int n; - rv = apr_proc_mutex_create(&proc_lock, lockname, mech, p); + rv = fspr_proc_mutex_create(&proc_lock, lockname, mech, p); APR_ASSERT_SUCCESS(tc, "create the mutex", rv); if (rv != APR_SUCCESS) return; @@ -118,25 +118,25 @@ static void test_exclusive(abts_case *tc, const char *lockname, static void proc_mutex(abts_case *tc, void *data) { #if APR_HAS_FORK - apr_status_t rv; + fspr_status_t rv; const char *shmname = "tpm.shm"; - apr_shm_t *shm; - apr_lockmech_e *mech = data; + fspr_shm_t *shm; + fspr_lockmech_e *mech = data; /* Use anonymous shm if available. */ - rv = apr_shm_create(&shm, sizeof(int), NULL, p); + rv = fspr_shm_create(&shm, sizeof(int), NULL, p); if (rv == APR_ENOTIMPL) { - apr_file_remove(shmname, p); - rv = apr_shm_create(&shm, sizeof(int), shmname, p); + fspr_file_remove(shmname, p); + rv = fspr_shm_create(&shm, sizeof(int), shmname, p); } APR_ASSERT_SUCCESS(tc, "create shm segment", rv); if (rv != APR_SUCCESS) return; - x = apr_shm_baseaddr_get(shm); + x = fspr_shm_baseaddr_get(shm); test_exclusive(tc, NULL, *mech); - rv = apr_shm_destroy(shm); + rv = fspr_shm_destroy(shm); APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv); #else ABTS_NOT_IMPL(tc, "APR lacks fork() support"); @@ -146,7 +146,7 @@ static void proc_mutex(abts_case *tc, void *data) abts_suite *testprocmutex(abts_suite *suite) { - apr_lockmech_e mech = APR_LOCK_DEFAULT; + fspr_lockmech_e mech = APR_LOCK_DEFAULT; suite = ADD_SUITE(suite) abts_run_test(suite, proc_mutex, &mech); diff --git a/libs/apr/test/testrand.c b/libs/apr/test/testrand.c index befed08745..346d8fb3a9 100644 --- a/libs/apr/test/testrand.c +++ b/libs/apr/test/testrand.c @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "apr_general.h" +#include "fspr_general.h" #include #include #include @@ -23,15 +23,15 @@ static void rand_exists(abts_case *tc, void *data) { #if !APR_HAS_RANDOM - ABTS_NOT_IMPL(tc, "apr_generate_random_bytes"); + ABTS_NOT_IMPL(tc, "fspr_generate_random_bytes"); #else unsigned char c[42]; /* There must be a better way to test random-ness, but I don't know * what it is right now. */ - APR_ASSERT_SUCCESS(tc, "apr_generate_random_bytes failed", - apr_generate_random_bytes(c, sizeof c)); + APR_ASSERT_SUCCESS(tc, "fspr_generate_random_bytes failed", + fspr_generate_random_bytes(c, sizeof c)); #endif } diff --git a/libs/apr/test/testrand2.c b/libs/apr/test/testrand2.c index f9f8286400..e233d18b6b 100644 --- a/libs/apr/test/testrand2.c +++ b/libs/apr/test/testrand2.c @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "apr_general.h" -#include "apr_random.h" -#include "apr_thread_proc.h" +#include "fspr_general.h" +#include "fspr_random.h" +#include "fspr_thread_proc.h" #include #include #include @@ -43,15 +43,15 @@ static void hexdump(const unsigned char *b,int n) printf("\n"); } -static apr_random_t *r; +static fspr_random_t *r; -typedef apr_status_t APR_THREAD_FUNC rnd_fn(apr_random_t *r,void *b,apr_size_t n); +typedef fspr_status_t APR_THREAD_FUNC rnd_fn(fspr_random_t *r,void *b,fspr_size_t n); -static void rand_run_kat(abts_case *tc,rnd_fn *f,apr_random_t *r, +static void rand_run_kat(abts_case *tc,rnd_fn *f,fspr_random_t *r, const unsigned char expected[128]) { unsigned char c[128]; - apr_status_t rv; + fspr_status_t rv; rv=f(r,c,128); ABTS_INT_EQUAL(tc,0,rv); @@ -65,11 +65,11 @@ static void rand_run_kat(abts_case *tc,rnd_fn *f,apr_random_t *r, } } -static int rand_check_kat(rnd_fn *f,apr_random_t *r, +static int rand_check_kat(rnd_fn *f,fspr_random_t *r, const unsigned char expected[128]) { unsigned char c[128]; - apr_status_t rv; + fspr_status_t rv; rv=f(r,c,128); if(rv) @@ -79,18 +79,18 @@ static int rand_check_kat(rnd_fn *f,apr_random_t *r, return 0; } -static void rand_add_zeroes(apr_random_t *r) +static void rand_add_zeroes(fspr_random_t *r) { static unsigned char c[2048]; - apr_random_add_entropy(r,c,sizeof c); + fspr_random_add_entropy(r,c,sizeof c); } -static void rand_run_seed_short(abts_case *tc,rnd_fn *f,apr_random_t *r, +static void rand_run_seed_short(abts_case *tc,rnd_fn *f,fspr_random_t *r, int count) { int i; - apr_status_t rv; + fspr_status_t rv; char c[1]; for(i=0 ; i < count ; ++i) @@ -101,8 +101,8 @@ static void rand_run_seed_short(abts_case *tc,rnd_fn *f,apr_random_t *r, static void rand_seed_short(abts_case *tc, void *data) { - r=apr_random_standard_new(p); - rand_run_seed_short(tc,apr_random_insecure_bytes,r,32); + r=fspr_random_standard_new(p); + rand_run_seed_short(tc,fspr_random_insecure_bytes,r,32); } static void rand_kat(abts_case *tc, void *data) @@ -126,12 +126,12 @@ static void rand_kat(abts_case *tc, void *data) 0x87,0xec,0x2e,0xb1,0x2d,0x6a,0xbd,0x46 }; rand_add_zeroes(r); - rand_run_kat(tc,apr_random_insecure_bytes,r,expected); + rand_run_kat(tc,fspr_random_insecure_bytes,r,expected); } static void rand_seed_short2(abts_case *tc, void *data) { - rand_run_seed_short(tc,apr_random_secure_bytes,r,320); + rand_run_seed_short(tc,fspr_random_secure_bytes,r,320); } static void rand_kat2(abts_case *tc, void *data) @@ -155,13 +155,13 @@ static void rand_kat2(abts_case *tc, void *data) 0xed,0xd2,0xde,0xce,0x18,0x70,0x57,0x12 }; rand_add_zeroes(r); - rand_run_kat(tc,apr_random_secure_bytes,r,expected); + rand_run_kat(tc,fspr_random_secure_bytes,r,expected); } static void rand_barrier(abts_case *tc, void *data) { - apr_random_barrier(r); - rand_run_seed_short(tc,apr_random_secure_bytes,r,320); + fspr_random_barrier(r); + rand_run_seed_short(tc,fspr_random_secure_bytes,r,320); } static void rand_kat3(abts_case *tc, void *data) @@ -184,7 +184,7 @@ static void rand_kat3(abts_case *tc, void *data) 0x04,0xbf,0x32,0xd6,0xdc,0xb7,0x31,0x01, 0x29,0x51,0x51,0xb3,0x19,0x6e,0xe4,0xf8 }; - rand_run_kat(tc,apr_random_insecure_bytes,r,expected); + rand_run_kat(tc,fspr_random_insecure_bytes,r,expected); } static void rand_kat4(abts_case *tc, void *data) @@ -208,14 +208,14 @@ static void rand_kat4(abts_case *tc, void *data) 0x17,0x35,0x5f,0x35,0x8d,0x55,0x0c,0x07 }; rand_add_zeroes(r); - rand_run_kat(tc,apr_random_secure_bytes,r,expected); + rand_run_kat(tc,fspr_random_secure_bytes,r,expected); } #if APR_HAS_FORK static void rand_fork(abts_case *tc, void *data) { - apr_proc_t proc; - apr_status_t rv; + fspr_proc_t proc; + fspr_status_t rv; unsigned char expected[128]= { 0xac,0x93,0xd2,0x5c,0xc7,0xf5,0x8d,0xc2, 0xd8,0x8d,0xb6,0x7a,0x94,0xe1,0x83,0x4c, @@ -234,22 +234,22 @@ static void rand_fork(abts_case *tc, void *data) 0x32,0x8a,0x54,0x01,0xd0,0xaf,0x3f,0x13, 0xc1,0x7f,0x10,0x2e,0x08,0x1c,0x28,0x4b, }; - rv=apr_proc_fork(&proc,p); + rv=fspr_proc_fork(&proc,p); if(rv == APR_INCHILD) { int n; - n=rand_check_kat(apr_random_secure_bytes,r,expected); + n=rand_check_kat(fspr_random_secure_bytes,r,expected); exit(n); } else if(rv == APR_INPARENT) { int exitcode; - apr_exit_why_e why; + fspr_exit_why_e why; - rand_run_kat(tc,apr_random_secure_bytes,r,expected); - apr_proc_wait(&proc,&exitcode,&why,APR_WAIT); + rand_run_kat(tc,fspr_random_secure_bytes,r,expected); + fspr_proc_wait(&proc,&exitcode,&why,APR_WAIT); if(why != APR_PROC_EXIT) { ABTS_FAIL(tc,"Child terminated abnormally"); diff --git a/libs/apr/test/testshm.c b/libs/apr/test/testshm.c index 3691dd52ce..7839156583 100644 --- a/libs/apr/test/testshm.c +++ b/libs/apr/test/testshm.c @@ -15,15 +15,15 @@ */ #include "testutil.h" -#include "apr_shm.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_strings.h" -#include "apr_thread_proc.h" -#include "apr_time.h" +#include "fspr_shm.h" +#include "fspr_errno.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_strings.h" +#include "fspr_thread_proc.h" +#include "fspr_time.h" #include "testshm.h" -#include "apr.h" +#include "fspr.h" #if APR_HAVE_STDLIB_H #include @@ -35,9 +35,9 @@ static int msgwait(int sleep_sec, int first_box, int last_box) { int i; int recvd = 0; - apr_time_t start = apr_time_now(); - apr_interval_time_t sleep_duration = apr_time_from_sec(sleep_sec); - while (apr_time_now() - start < sleep_duration) { + fspr_time_t start = fspr_time_now(); + fspr_interval_time_t sleep_duration = fspr_time_from_sec(sleep_sec); + while (fspr_time_now() - start < sleep_duration) { for (i = first_box; i < last_box; i++) { if (boxes[i].msgavail && !strcmp(boxes[i].msg, MSG)) { recvd++; @@ -48,84 +48,84 @@ static int msgwait(int sleep_sec, int first_box, int last_box) memset(boxes[i].msg, 0, 1024); } } - apr_sleep(apr_time_make(0, 10000)); /* 10ms */ + fspr_sleep(fspr_time_make(0, 10000)); /* 10ms */ } return recvd; } static void msgput(int boxnum, char *msg) { - apr_cpystrn(boxes[boxnum].msg, msg, strlen(msg) + 1); + fspr_cpystrn(boxes[boxnum].msg, msg, strlen(msg) + 1); boxes[boxnum].msgavail = 1; } static void test_anon_create(abts_case *tc, void *data) { - apr_status_t rv; - apr_shm_t *shm = NULL; + fspr_status_t rv; + fspr_shm_t *shm = NULL; - rv = apr_shm_create(&shm, SHARED_SIZE, NULL, p); + rv = fspr_shm_create(&shm, SHARED_SIZE, NULL, p); APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv); ABTS_PTR_NOTNULL(tc, shm); - rv = apr_shm_destroy(shm); + rv = fspr_shm_destroy(shm); APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv); } static void test_check_size(abts_case *tc, void *data) { - apr_status_t rv; - apr_shm_t *shm = NULL; - apr_size_t retsize; + fspr_status_t rv; + fspr_shm_t *shm = NULL; + fspr_size_t retsize; - rv = apr_shm_create(&shm, SHARED_SIZE, NULL, p); + rv = fspr_shm_create(&shm, SHARED_SIZE, NULL, p); APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv); ABTS_PTR_NOTNULL(tc, shm); - retsize = apr_shm_size_get(shm); + retsize = fspr_shm_size_get(shm); ABTS_INT_EQUAL(tc, SHARED_SIZE, retsize); - rv = apr_shm_destroy(shm); + rv = fspr_shm_destroy(shm); APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv); } static void test_shm_allocate(abts_case *tc, void *data) { - apr_status_t rv; - apr_shm_t *shm = NULL; + fspr_status_t rv; + fspr_shm_t *shm = NULL; - rv = apr_shm_create(&shm, SHARED_SIZE, NULL, p); + rv = fspr_shm_create(&shm, SHARED_SIZE, NULL, p); APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv); ABTS_PTR_NOTNULL(tc, shm); - boxes = apr_shm_baseaddr_get(shm); + boxes = fspr_shm_baseaddr_get(shm); ABTS_PTR_NOTNULL(tc, boxes); - rv = apr_shm_destroy(shm); + rv = fspr_shm_destroy(shm); APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv); } #if APR_HAS_FORK static void test_anon(abts_case *tc, void *data) { - apr_proc_t proc; - apr_status_t rv; - apr_shm_t *shm; - apr_size_t retsize; + fspr_proc_t proc; + fspr_status_t rv; + fspr_shm_t *shm; + fspr_size_t retsize; int cnt, i; int recvd; - rv = apr_shm_create(&shm, SHARED_SIZE, NULL, p); + rv = fspr_shm_create(&shm, SHARED_SIZE, NULL, p); APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv); ABTS_PTR_NOTNULL(tc, shm); - retsize = apr_shm_size_get(shm); + retsize = fspr_shm_size_get(shm); ABTS_INT_EQUAL(tc, SHARED_SIZE, retsize); - boxes = apr_shm_baseaddr_get(shm); + boxes = fspr_shm_baseaddr_get(shm); ABTS_PTR_NOTNULL(tc, boxes); - rv = apr_proc_fork(&proc, p); + rv = fspr_proc_fork(&proc, p); if (rv == APR_INCHILD) { /* child */ int num = msgwait(5, 0, N_BOXES); /* exit with the number of messages received so that the parent @@ -141,69 +141,69 @@ static void test_anon(abts_case *tc, void *data) i += N_BOXES; /* start over at the top */ } msgput(i, MSG); - apr_sleep(apr_time_make(0, 10000)); + fspr_sleep(fspr_time_make(0, 10000)); } } else { - ABTS_FAIL(tc, "apr_proc_fork failed"); + ABTS_FAIL(tc, "fspr_proc_fork failed"); } /* wait for the child */ - rv = apr_proc_wait(&proc, &recvd, NULL, APR_WAIT); + rv = fspr_proc_wait(&proc, &recvd, NULL, APR_WAIT); ABTS_INT_EQUAL(tc, N_MESSAGES, recvd); - rv = apr_shm_destroy(shm); + rv = fspr_shm_destroy(shm); APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv); } #endif static void test_named(abts_case *tc, void *data) { - apr_status_t rv; - apr_shm_t *shm = NULL; - apr_size_t retsize; - apr_proc_t pidproducer, pidconsumer; - apr_procattr_t *attr1 = NULL, *attr2 = NULL; + fspr_status_t rv; + fspr_shm_t *shm = NULL; + fspr_size_t retsize; + fspr_proc_t pidproducer, pidconsumer; + fspr_procattr_t *attr1 = NULL, *attr2 = NULL; int sent, received; - apr_exit_why_e why; + fspr_exit_why_e why; const char *args[4]; - apr_shm_remove(SHARED_FILENAME, p); + fspr_shm_remove(SHARED_FILENAME, p); - rv = apr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, p); + rv = fspr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, p); APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv); if (rv != APR_SUCCESS) { return; } ABTS_PTR_NOTNULL(tc, shm); - retsize = apr_shm_size_get(shm); + retsize = fspr_shm_size_get(shm); ABTS_INT_EQUAL(tc, SHARED_SIZE, retsize); - boxes = apr_shm_baseaddr_get(shm); + boxes = fspr_shm_baseaddr_get(shm); ABTS_PTR_NOTNULL(tc, boxes); - rv = apr_procattr_create(&attr1, p); + rv = fspr_procattr_create(&attr1, p); ABTS_PTR_NOTNULL(tc, attr1); APR_ASSERT_SUCCESS(tc, "Couldn't create attr1", rv); - args[0] = apr_pstrdup(p, "testshmproducer" EXTENSION); + args[0] = fspr_pstrdup(p, "testshmproducer" EXTENSION); args[1] = NULL; - rv = apr_proc_create(&pidproducer, "./testshmproducer" EXTENSION, args, + rv = fspr_proc_create(&pidproducer, "./testshmproducer" EXTENSION, args, NULL, attr1, p); APR_ASSERT_SUCCESS(tc, "Couldn't launch producer", rv); - rv = apr_procattr_create(&attr2, p); + rv = fspr_procattr_create(&attr2, p); ABTS_PTR_NOTNULL(tc, attr2); APR_ASSERT_SUCCESS(tc, "Couldn't create attr2", rv); - args[0] = apr_pstrdup(p, "testshmconsumer" EXTENSION); - rv = apr_proc_create(&pidconsumer, "./testshmconsumer" EXTENSION, args, + args[0] = fspr_pstrdup(p, "testshmconsumer" EXTENSION); + rv = fspr_proc_create(&pidconsumer, "./testshmconsumer" EXTENSION, args, NULL, attr2, p); APR_ASSERT_SUCCESS(tc, "Couldn't launch consumer", rv); - rv = apr_proc_wait(&pidconsumer, &received, &why, APR_WAIT); + rv = fspr_proc_wait(&pidconsumer, &received, &why, APR_WAIT); ABTS_INT_EQUAL(tc, APR_CHILD_DONE, rv); ABTS_INT_EQUAL(tc, APR_PROC_EXIT, why); - rv = apr_proc_wait(&pidproducer, &sent, &why, APR_WAIT); + rv = fspr_proc_wait(&pidproducer, &sent, &why, APR_WAIT); ABTS_INT_EQUAL(tc, APR_CHILD_DONE, rv); ABTS_INT_EQUAL(tc, APR_PROC_EXIT, why); @@ -212,7 +212,7 @@ static void test_named(abts_case *tc, void *data) * without having to cleanup manually. */ APR_ASSERT_SUCCESS(tc, "Error destroying shared memory", - apr_shm_destroy(shm)); + fspr_shm_destroy(shm)); ABTS_INT_EQUAL(tc, sent, received); @@ -220,32 +220,32 @@ static void test_named(abts_case *tc, void *data) static void test_named_remove(abts_case *tc, void *data) { - apr_status_t rv; - apr_shm_t *shm; + fspr_status_t rv; + fspr_shm_t *shm; - apr_shm_remove(SHARED_FILENAME, p); + fspr_shm_remove(SHARED_FILENAME, p); - rv = apr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, p); + rv = fspr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, p); APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv); if (rv != APR_SUCCESS) { return; } ABTS_PTR_NOTNULL(tc, shm); - rv = apr_shm_remove(SHARED_FILENAME, p); + rv = fspr_shm_remove(SHARED_FILENAME, p); APR_ASSERT_SUCCESS(tc, "Error removing shared memory block", rv); if (rv != APR_SUCCESS) { return ; } - rv = apr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, p); + rv = fspr_shm_create(&shm, SHARED_SIZE, SHARED_FILENAME, p); APR_ASSERT_SUCCESS(tc, "Error allocating shared memory block", rv); if (rv != APR_SUCCESS) { return; } ABTS_PTR_NOTNULL(tc, shm); - rv = apr_shm_destroy(shm); + rv = fspr_shm_destroy(shm); APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv); } diff --git a/libs/apr/test/testshm.h b/libs/apr/test/testshm.h index 5b24a9d427..efcfc062de 100644 --- a/libs/apr/test/testshm.h +++ b/libs/apr/test/testshm.h @@ -24,7 +24,7 @@ typedef struct mbox { mbox *boxes; #define N_BOXES 10 -#define SHARED_SIZE (apr_size_t)(N_BOXES * sizeof(mbox)) +#define SHARED_SIZE (fspr_size_t)(N_BOXES * sizeof(mbox)) #define SHARED_FILENAME "data/apr.testshm.shm" #define N_MESSAGES 100 #define MSG "Sending a message" diff --git a/libs/apr/test/testshmconsumer.c b/libs/apr/test/testshmconsumer.c index 6a2a3c30d3..5e67e837b9 100644 --- a/libs/apr/test/testshmconsumer.c +++ b/libs/apr/test/testshmconsumer.c @@ -14,14 +14,14 @@ * limitations under the License. */ -#include "apr_shm.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_strings.h" -#include "apr_time.h" +#include "fspr_shm.h" +#include "fspr_errno.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_strings.h" +#include "fspr_time.h" #include "testshm.h" -#include "apr.h" +#include "fspr.h" #if APR_HAVE_STDLIB_H #include @@ -34,9 +34,9 @@ static int msgwait(int sleep_sec, int first_box, int last_box) { int i; int recvd = 0; - apr_time_t start = apr_time_now(); - apr_interval_time_t sleep_duration = apr_time_from_sec(sleep_sec); - while (apr_time_now() - start < sleep_duration) { + fspr_time_t start = fspr_time_now(); + fspr_interval_time_t sleep_duration = fspr_time_from_sec(sleep_sec); + while (fspr_time_now() - start < sleep_duration) { for (i = first_box; i < last_box; i++) { if (boxes[i].msgavail && !strcmp(boxes[i].msg, MSG)) { recvd++; @@ -44,35 +44,35 @@ static int msgwait(int sleep_sec, int first_box, int last_box) memset(boxes[i].msg, 0, 1024); } } - apr_sleep(apr_time_from_sec(1)); + fspr_sleep(fspr_time_from_sec(1)); } return recvd; } int main(void) { - apr_status_t rv; - apr_pool_t *pool; - apr_shm_t *shm; + fspr_status_t rv; + fspr_pool_t *pool; + fspr_shm_t *shm; int recvd; - apr_initialize(); + fspr_initialize(); - if (apr_pool_create(&pool, NULL) != APR_SUCCESS) { + if (fspr_pool_create(&pool, NULL) != APR_SUCCESS) { exit(-1); } - rv = apr_shm_attach(&shm, SHARED_FILENAME, pool); + rv = fspr_shm_attach(&shm, SHARED_FILENAME, pool); if (rv != APR_SUCCESS) { exit(-2); } - boxes = apr_shm_baseaddr_get(shm); + boxes = fspr_shm_baseaddr_get(shm); /* consume messages on all of the boxes */ recvd = msgwait(30, 0, N_BOXES); /* wait for 30 seconds for messages */ - rv = apr_shm_detach(shm); + rv = fspr_shm_detach(shm); if (rv != APR_SUCCESS) { exit(-3); } diff --git a/libs/apr/test/testshmproducer.c b/libs/apr/test/testshmproducer.c index 58eb94fcd3..70073db7bd 100644 --- a/libs/apr/test/testshmproducer.c +++ b/libs/apr/test/testshmproducer.c @@ -14,14 +14,14 @@ * limitations under the License. */ -#include "apr_shm.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_strings.h" -#include "apr_time.h" +#include "fspr_shm.h" +#include "fspr_errno.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_strings.h" +#include "fspr_time.h" #include "testshm.h" -#include "apr.h" +#include "fspr.h" #if APR_HAVE_STDLIB_H #include @@ -31,30 +31,30 @@ #if APR_HAS_SHARED_MEMORY static void msgput(int boxnum, char *msg) { - apr_cpystrn(boxes[boxnum].msg, msg, strlen(msg) + 1); + fspr_cpystrn(boxes[boxnum].msg, msg, strlen(msg) + 1); boxes[boxnum].msgavail = 1; } int main(void) { - apr_status_t rv; - apr_pool_t *pool; - apr_shm_t *shm; + fspr_status_t rv; + fspr_pool_t *pool; + fspr_shm_t *shm; int i; int sent = 0; - apr_initialize(); + fspr_initialize(); - if (apr_pool_create(&pool, NULL) != APR_SUCCESS) { + if (fspr_pool_create(&pool, NULL) != APR_SUCCESS) { exit(-1); } - rv = apr_shm_attach(&shm, SHARED_FILENAME, pool); + rv = fspr_shm_attach(&shm, SHARED_FILENAME, pool); if (rv != APR_SUCCESS) { exit(-2); } - boxes = apr_shm_baseaddr_get(shm); + boxes = fspr_shm_baseaddr_get(shm); /* produce messages on all of the boxes, in descending order, * Yes, we could just return N_BOXES, but I want to have a double-check @@ -64,10 +64,10 @@ int main(void) */ for (i = N_BOXES - 1, sent = 0; i >= 0; i--, sent++) { msgput(i, MSG); - apr_sleep(apr_time_from_sec(1)); + fspr_sleep(fspr_time_from_sec(1)); } - rv = apr_shm_detach(shm); + rv = fspr_shm_detach(shm); if (rv != APR_SUCCESS) { exit(-3); } diff --git a/libs/apr/test/testsleep.c b/libs/apr/test/testsleep.c index d50cc1b49d..6112a85907 100644 --- a/libs/apr/test/testsleep.c +++ b/libs/apr/test/testsleep.c @@ -15,10 +15,10 @@ */ #include "time.h" -#include "apr_thread_proc.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_lib.h" +#include "fspr_thread_proc.h" +#include "fspr_errno.h" +#include "fspr_general.h" +#include "fspr_lib.h" #include #include #include @@ -32,7 +32,7 @@ static void sleep_one(abts_case *tc, void *data) time_t posttime; time_t timediff; - apr_sleep(apr_time_from_sec(SLEEP_INTERVAL)); + fspr_sleep(fspr_time_from_sec(SLEEP_INTERVAL)); posttime = time(NULL); /* normalize the timediff. We should have slept for SLEEP_INTERVAL, so diff --git a/libs/apr/test/testsock.c b/libs/apr/test/testsock.c index 7c1759e924..f731630dc3 100644 --- a/libs/apr/test/testsock.c +++ b/libs/apr/test/testsock.c @@ -16,45 +16,45 @@ #include "testutil.h" #include "testsock.h" -#include "apr_thread_proc.h" -#include "apr_network_io.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_strings.h" -#include "apr_poll.h" +#include "fspr_thread_proc.h" +#include "fspr_network_io.h" +#include "fspr_errno.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_strings.h" +#include "fspr_poll.h" -static void launch_child(abts_case *tc, apr_proc_t *proc, const char *arg1, apr_pool_t *p) +static void launch_child(abts_case *tc, fspr_proc_t *proc, const char *arg1, fspr_pool_t *p) { - apr_procattr_t *procattr; + fspr_procattr_t *procattr; const char *args[3]; - apr_status_t rv; + fspr_status_t rv; - rv = apr_procattr_create(&procattr, p); + rv = fspr_procattr_create(&procattr, p); APR_ASSERT_SUCCESS(tc, "Couldn't create procattr", rv); - rv = apr_procattr_io_set(procattr, APR_NO_PIPE, APR_NO_PIPE, + rv = fspr_procattr_io_set(procattr, APR_NO_PIPE, APR_NO_PIPE, APR_NO_PIPE); APR_ASSERT_SUCCESS(tc, "Couldn't set io in procattr", rv); - rv = apr_procattr_error_check_set(procattr, 1); + rv = fspr_procattr_error_check_set(procattr, 1); APR_ASSERT_SUCCESS(tc, "Couldn't set error check in procattr", rv); args[0] = "sockchild" EXTENSION; args[1] = arg1; args[2] = NULL; - rv = apr_proc_create(proc, "./sockchild" EXTENSION, args, NULL, + rv = fspr_proc_create(proc, "./sockchild" EXTENSION, args, NULL, procattr, p); APR_ASSERT_SUCCESS(tc, "Couldn't launch program", rv); } -static int wait_child(abts_case *tc, apr_proc_t *proc) +static int wait_child(abts_case *tc, fspr_proc_t *proc) { int exitcode; - apr_exit_why_e why; + fspr_exit_why_e why; ABTS_ASSERT(tc, "Error waiting for child process", - apr_proc_wait(proc, &exitcode, &why, APR_WAIT) == APR_CHILD_DONE); + fspr_proc_wait(proc, &exitcode, &why, APR_WAIT) == APR_CHILD_DONE); ABTS_ASSERT(tc, "child terminated normally", why == APR_PROC_EXIT); return exitcode; @@ -62,37 +62,37 @@ static int wait_child(abts_case *tc, apr_proc_t *proc) static void test_addr_info(abts_case *tc, void *data) { - apr_status_t rv; - apr_sockaddr_t *sa; + fspr_status_t rv; + fspr_sockaddr_t *sa; - rv = apr_sockaddr_info_get(&sa, NULL, APR_UNSPEC, 80, 0, p); + rv = fspr_sockaddr_info_get(&sa, NULL, APR_UNSPEC, 80, 0, p); APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv); - rv = apr_sockaddr_info_get(&sa, "127.0.0.1", APR_UNSPEC, 80, 0, p); + rv = fspr_sockaddr_info_get(&sa, "127.0.0.1", APR_UNSPEC, 80, 0, p); APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv); ABTS_STR_EQUAL(tc, "127.0.0.1", sa->hostname); } -static apr_socket_t *setup_socket(abts_case *tc) +static fspr_socket_t *setup_socket(abts_case *tc) { - apr_status_t rv; - apr_sockaddr_t *sa; - apr_socket_t *sock; + fspr_status_t rv; + fspr_sockaddr_t *sa; + fspr_socket_t *sock; - rv = apr_sockaddr_info_get(&sa, "127.0.0.1", APR_INET, 8021, 0, p); + rv = fspr_sockaddr_info_get(&sa, "127.0.0.1", APR_INET, 8021, 0, p); APR_ASSERT_SUCCESS(tc, "Problem generating sockaddr", rv); - rv = apr_socket_create(&sock, sa->family, SOCK_STREAM, APR_PROTO_TCP, p); + rv = fspr_socket_create(&sock, sa->family, SOCK_STREAM, APR_PROTO_TCP, p); APR_ASSERT_SUCCESS(tc, "Problem creating socket", rv); - rv = apr_socket_opt_set(sock, APR_SO_REUSEADDR, 1); + rv = fspr_socket_opt_set(sock, APR_SO_REUSEADDR, 1); APR_ASSERT_SUCCESS(tc, "Could not set REUSEADDR on socket", rv); - rv = apr_socket_bind(sock, sa); + rv = fspr_socket_bind(sock, sa); APR_ASSERT_SUCCESS(tc, "Problem binding to port", rv); if (rv) return NULL; - rv = apr_socket_listen(sock, 5); + rv = fspr_socket_listen(sock, 5); APR_ASSERT_SUCCESS(tc, "Problem listening on socket", rv); return sock; @@ -100,55 +100,55 @@ static apr_socket_t *setup_socket(abts_case *tc) static void test_create_bind_listen(abts_case *tc, void *data) { - apr_status_t rv; - apr_socket_t *sock = setup_socket(tc); + fspr_status_t rv; + fspr_socket_t *sock = setup_socket(tc); if (!sock) return; - rv = apr_socket_close(sock); + rv = fspr_socket_close(sock); APR_ASSERT_SUCCESS(tc, "Problem closing socket", rv); } static void test_send(abts_case *tc, void *data) { - apr_status_t rv; - apr_socket_t *sock; - apr_socket_t *sock2; - apr_proc_t proc; + fspr_status_t rv; + fspr_socket_t *sock; + fspr_socket_t *sock2; + fspr_proc_t proc; int protocol; - apr_size_t length; + fspr_size_t length; sock = setup_socket(tc); if (!sock) return; launch_child(tc, &proc, "read", p); - rv = apr_socket_accept(&sock2, sock, p); + rv = fspr_socket_accept(&sock2, sock, p); APR_ASSERT_SUCCESS(tc, "Problem with receiving connection", rv); - apr_socket_protocol_get(sock2, &protocol); + fspr_socket_protocol_get(sock2, &protocol); ABTS_INT_EQUAL(tc, APR_PROTO_TCP, protocol); length = strlen(DATASTR); - apr_socket_send(sock2, DATASTR, &length); + fspr_socket_send(sock2, DATASTR, &length); /* Make sure that the client received the data we sent */ ABTS_INT_EQUAL(tc, strlen(DATASTR), wait_child(tc, &proc)); - rv = apr_socket_close(sock2); + rv = fspr_socket_close(sock2); APR_ASSERT_SUCCESS(tc, "Problem closing connected socket", rv); - rv = apr_socket_close(sock); + rv = fspr_socket_close(sock); APR_ASSERT_SUCCESS(tc, "Problem closing socket", rv); } static void test_recv(abts_case *tc, void *data) { - apr_status_t rv; - apr_socket_t *sock; - apr_socket_t *sock2; - apr_proc_t proc; + fspr_status_t rv; + fspr_socket_t *sock; + fspr_socket_t *sock2; + fspr_proc_t proc; int protocol; - apr_size_t length = STRLEN; + fspr_size_t length = STRLEN; char datastr[STRLEN]; sock = setup_socket(tc); @@ -156,31 +156,31 @@ static void test_recv(abts_case *tc, void *data) launch_child(tc, &proc, "write", p); - rv = apr_socket_accept(&sock2, sock, p); + rv = fspr_socket_accept(&sock2, sock, p); APR_ASSERT_SUCCESS(tc, "Problem with receiving connection", rv); - apr_socket_protocol_get(sock2, &protocol); + fspr_socket_protocol_get(sock2, &protocol); ABTS_INT_EQUAL(tc, APR_PROTO_TCP, protocol); memset(datastr, 0, STRLEN); - apr_socket_recv(sock2, datastr, &length); + fspr_socket_recv(sock2, datastr, &length); /* Make sure that the server received the data we sent */ ABTS_STR_EQUAL(tc, DATASTR, datastr); ABTS_INT_EQUAL(tc, strlen(datastr), wait_child(tc, &proc)); - rv = apr_socket_close(sock2); + rv = fspr_socket_close(sock2); APR_ASSERT_SUCCESS(tc, "Problem closing connected socket", rv); - rv = apr_socket_close(sock); + rv = fspr_socket_close(sock); APR_ASSERT_SUCCESS(tc, "Problem closing socket", rv); } static void test_timeout(abts_case *tc, void *data) { - apr_status_t rv; - apr_socket_t *sock; - apr_socket_t *sock2; - apr_proc_t proc; + fspr_status_t rv; + fspr_socket_t *sock; + fspr_socket_t *sock2; + fspr_proc_t proc; int protocol; int exit; @@ -189,10 +189,10 @@ static void test_timeout(abts_case *tc, void *data) launch_child(tc, &proc, "read", p); - rv = apr_socket_accept(&sock2, sock, p); + rv = fspr_socket_accept(&sock2, sock, p); APR_ASSERT_SUCCESS(tc, "Problem with receiving connection", rv); - apr_socket_protocol_get(sock2, &protocol); + fspr_socket_protocol_get(sock2, &protocol); ABTS_INT_EQUAL(tc, APR_PROTO_TCP, protocol); exit = wait_child(tc, &proc); @@ -201,57 +201,57 @@ static void test_timeout(abts_case *tc, void *data) /* We didn't write any data, so make sure the child program returns * an error. */ - rv = apr_socket_close(sock2); + rv = fspr_socket_close(sock2); APR_ASSERT_SUCCESS(tc, "Problem closing connected socket", rv); - rv = apr_socket_close(sock); + rv = fspr_socket_close(sock); APR_ASSERT_SUCCESS(tc, "Problem closing socket", rv); } static void test_get_addr(abts_case *tc, void *data) { - apr_status_t rv; - apr_socket_t *ld, *sd, *cd; - apr_sockaddr_t *sa, *ca; + fspr_status_t rv; + fspr_socket_t *ld, *sd, *cd; + fspr_sockaddr_t *sa, *ca; char a[128], b[128]; ld = setup_socket(tc); APR_ASSERT_SUCCESS(tc, "get local address of bound socket", - apr_socket_addr_get(&sa, APR_LOCAL, ld)); + fspr_socket_addr_get(&sa, APR_LOCAL, ld)); - rv = apr_socket_create(&cd, sa->family, SOCK_STREAM, + rv = fspr_socket_create(&cd, sa->family, SOCK_STREAM, APR_PROTO_TCP, p); APR_ASSERT_SUCCESS(tc, "create client socket", rv); APR_ASSERT_SUCCESS(tc, "enable non-block mode", - apr_socket_opt_set(cd, APR_SO_NONBLOCK, 1)); + fspr_socket_opt_set(cd, APR_SO_NONBLOCK, 1)); /* It is valid for a connect() on a socket with NONBLOCK set to * succeed (if the connection can be established synchronously), * but if it does, this test cannot proceed. */ - rv = apr_socket_connect(cd, sa); + rv = fspr_socket_connect(cd, sa); if (rv == APR_SUCCESS) { - apr_socket_close(ld); - apr_socket_close(cd); + fspr_socket_close(ld); + fspr_socket_close(cd); ABTS_NOT_IMPL(tc, "Cannot test if connect completes " "synchronously"); return; } if (!APR_STATUS_IS_EINPROGRESS(rv)) { - apr_socket_close(ld); - apr_socket_close(cd); + fspr_socket_close(ld); + fspr_socket_close(cd); APR_ASSERT_SUCCESS(tc, "connect to listener", rv); return; } APR_ASSERT_SUCCESS(tc, "accept connection", - apr_socket_accept(&sd, ld, p)); + fspr_socket_accept(&sd, ld, p)); { /* wait for writability */ - apr_pollfd_t pfd; + fspr_pollfd_t pfd; int n; pfd.p = p; @@ -261,24 +261,24 @@ static void test_get_addr(abts_case *tc, void *data) pfd.client_data = NULL; APR_ASSERT_SUCCESS(tc, "poll for connect completion", - apr_poll(&pfd, 1, &n, 5 * APR_USEC_PER_SEC)); + fspr_poll(&pfd, 1, &n, 5 * APR_USEC_PER_SEC)); } APR_ASSERT_SUCCESS(tc, "get local address of server socket", - apr_socket_addr_get(&sa, APR_LOCAL, sd)); + fspr_socket_addr_get(&sa, APR_LOCAL, sd)); APR_ASSERT_SUCCESS(tc, "get remote address of client socket", - apr_socket_addr_get(&ca, APR_REMOTE, cd)); + fspr_socket_addr_get(&ca, APR_REMOTE, cd)); - apr_snprintf(a, sizeof(a), "%pI", sa); - apr_snprintf(b, sizeof(b), "%pI", ca); + fspr_snprintf(a, sizeof(a), "%pI", sa); + fspr_snprintf(b, sizeof(b), "%pI", ca); ABTS_STR_EQUAL(tc, a, b); - apr_socket_close(cd); - apr_socket_close(sd); - apr_socket_close(ld); + fspr_socket_close(cd); + fspr_socket_close(sd); + fspr_socket_close(ld); } abts_suite *testsock(abts_suite *suite) diff --git a/libs/apr/test/testsockets.c b/libs/apr/test/testsockets.c index 6328af8d9b..9337886ab7 100644 --- a/libs/apr/test/testsockets.c +++ b/libs/apr/test/testsockets.c @@ -14,46 +14,46 @@ * limitations under the License. */ -#include "apr_network_io.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_lib.h" +#include "fspr_network_io.h" +#include "fspr_errno.h" +#include "fspr_general.h" +#include "fspr_lib.h" #include "testutil.h" #define STRLEN 21 static void tcp_socket(abts_case *tc, void *data) { - apr_status_t rv; - apr_socket_t *sock = NULL; + fspr_status_t rv; + fspr_socket_t *sock = NULL; int type; - rv = apr_socket_create(&sock, APR_INET, SOCK_STREAM, 0, p); + rv = fspr_socket_create(&sock, APR_INET, SOCK_STREAM, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, sock); - rv = apr_socket_type_get(sock, &type); + rv = fspr_socket_type_get(sock, &type); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, SOCK_STREAM, type); - apr_socket_close(sock); + fspr_socket_close(sock); } static void udp_socket(abts_case *tc, void *data) { - apr_status_t rv; - apr_socket_t *sock = NULL; + fspr_status_t rv; + fspr_socket_t *sock = NULL; int type; - rv = apr_socket_create(&sock, APR_INET, SOCK_DGRAM, 0, p); + rv = fspr_socket_create(&sock, APR_INET, SOCK_DGRAM, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, sock); - rv = apr_socket_type_get(sock, &type); + rv = fspr_socket_type_get(sock, &type); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, SOCK_DGRAM, type); - apr_socket_close(sock); + fspr_socket_close(sock); } /* On recent Linux systems, whilst IPv6 is always supported by glibc, @@ -68,17 +68,17 @@ static void udp_socket(abts_case *tc, void *data) static void tcp6_socket(abts_case *tc, void *data) { #if APR_HAVE_IPV6 - apr_status_t rv; - apr_socket_t *sock = NULL; + fspr_status_t rv; + fspr_socket_t *sock = NULL; - rv = apr_socket_create(&sock, APR_INET6, SOCK_STREAM, 0, p); + rv = fspr_socket_create(&sock, APR_INET6, SOCK_STREAM, 0, p); if (V6_NOT_ENABLED(rv)) { ABTS_NOT_IMPL(tc, "IPv6 not enabled"); return; } ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, sock); - apr_socket_close(sock); + fspr_socket_close(sock); #else ABTS_NOT_IMPL(tc, "IPv6"); #endif @@ -87,17 +87,17 @@ static void tcp6_socket(abts_case *tc, void *data) static void udp6_socket(abts_case *tc, void *data) { #if APR_HAVE_IPV6 - apr_status_t rv; - apr_socket_t *sock = NULL; + fspr_status_t rv; + fspr_socket_t *sock = NULL; - rv = apr_socket_create(&sock, APR_INET6, SOCK_DGRAM, 0, p); + rv = fspr_socket_create(&sock, APR_INET6, SOCK_DGRAM, 0, p); if (V6_NOT_ENABLED(rv)) { ABTS_NOT_IMPL(tc, "IPv6 not enabled"); return; } ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, sock); - apr_socket_close(sock); + fspr_socket_close(sock); #else ABTS_NOT_IMPL(tc, "IPv6"); #endif @@ -105,91 +105,91 @@ static void udp6_socket(abts_case *tc, void *data) static void sendto_receivefrom(abts_case *tc, void *data) { - apr_status_t rv; - apr_socket_t *sock = NULL; - apr_socket_t *sock2 = NULL; + fspr_status_t rv; + fspr_socket_t *sock = NULL; + fspr_socket_t *sock2 = NULL; char sendbuf[STRLEN] = "APR_INET, SOCK_DGRAM"; char recvbuf[80]; char *ip_addr; - apr_port_t fromport; - apr_sockaddr_t *from; - apr_sockaddr_t *to; - apr_size_t len = 30; + fspr_port_t fromport; + fspr_sockaddr_t *from; + fspr_sockaddr_t *to; + fspr_size_t len = 30; int family; const char *addr; #if APR_HAVE_IPV6 family = APR_INET6; addr = "::1"; - rv = apr_socket_create(&sock, family, SOCK_DGRAM, 0, p); + rv = fspr_socket_create(&sock, family, SOCK_DGRAM, 0, p); if (V6_NOT_ENABLED(rv)) { #endif family = APR_INET; addr = "127.0.0.1"; - rv = apr_socket_create(&sock, family, SOCK_DGRAM, 0, p); + rv = fspr_socket_create(&sock, family, SOCK_DGRAM, 0, p); #if APR_HAVE_IPV6 } #endif ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_socket_create(&sock2, family, SOCK_DGRAM, 0, p); + rv = fspr_socket_create(&sock2, family, SOCK_DGRAM, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_sockaddr_info_get(&to, addr, APR_UNSPEC, 7772, 0, p); + rv = fspr_sockaddr_info_get(&to, addr, APR_UNSPEC, 7772, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_sockaddr_info_get(&from, addr, APR_UNSPEC, 7771, 0, p); + rv = fspr_sockaddr_info_get(&from, addr, APR_UNSPEC, 7771, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_socket_opt_set(sock, APR_SO_REUSEADDR, 1); + rv = fspr_socket_opt_set(sock, APR_SO_REUSEADDR, 1); APR_ASSERT_SUCCESS(tc, "Could not set REUSEADDR on socket", rv); - rv = apr_socket_opt_set(sock2, APR_SO_REUSEADDR, 1); + rv = fspr_socket_opt_set(sock2, APR_SO_REUSEADDR, 1); APR_ASSERT_SUCCESS(tc, "Could not set REUSEADDR on socket2", rv); - rv = apr_socket_bind(sock, to); + rv = fspr_socket_bind(sock, to); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_socket_bind(sock2, from); + rv = fspr_socket_bind(sock2, from); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); len = STRLEN; - rv = apr_socket_sendto(sock2, to, 0, sendbuf, &len); + rv = fspr_socket_sendto(sock2, to, 0, sendbuf, &len); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, STRLEN, len); len = 80; - rv = apr_socket_recvfrom(from, sock, 0, recvbuf, &len); + rv = fspr_socket_recvfrom(from, sock, 0, recvbuf, &len); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, STRLEN, len); ABTS_STR_EQUAL(tc, "APR_INET, SOCK_DGRAM", recvbuf); - apr_sockaddr_ip_get(&ip_addr, from); + fspr_sockaddr_ip_get(&ip_addr, from); fromport = from->port; ABTS_STR_EQUAL(tc, addr, ip_addr); ABTS_INT_EQUAL(tc, 7771, fromport); - apr_socket_close(sock); - apr_socket_close(sock2); + fspr_socket_close(sock); + fspr_socket_close(sock2); } static void socket_userdata(abts_case *tc, void *data) { - apr_socket_t *sock1, *sock2; - apr_status_t rv; + fspr_socket_t *sock1, *sock2; + fspr_status_t rv; void *user; const char *key = "GENERICKEY"; - rv = apr_socket_create(&sock1, AF_INET, SOCK_STREAM, 0, p); + rv = fspr_socket_create(&sock1, AF_INET, SOCK_STREAM, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_socket_create(&sock2, AF_INET, SOCK_STREAM, 0, p); + rv = fspr_socket_create(&sock2, AF_INET, SOCK_STREAM, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_socket_data_set(sock1, "SOCK1", key, NULL); + rv = fspr_socket_data_set(sock1, "SOCK1", key, NULL); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_socket_data_set(sock2, "SOCK2", key, NULL); + rv = fspr_socket_data_set(sock2, "SOCK2", key, NULL); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_socket_data_get(&user, key, sock1); + rv = fspr_socket_data_get(&user, key, sock1); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_STR_EQUAL(tc, "SOCK1", user); - rv = apr_socket_data_get(&user, key, sock2); + rv = fspr_socket_data_get(&user, key, sock2); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_STR_EQUAL(tc, "SOCK2", user); } diff --git a/libs/apr/test/testsockopt.c b/libs/apr/test/testsockopt.c index 203e2c39ff..9328bfd340 100644 --- a/libs/apr/test/testsockopt.c +++ b/libs/apr/test/testsockopt.c @@ -14,45 +14,45 @@ * limitations under the License. */ -#include "apr_network_io.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_lib.h" +#include "fspr_network_io.h" +#include "fspr_errno.h" +#include "fspr_general.h" +#include "fspr_lib.h" #include "testutil.h" -static apr_socket_t *sock = NULL; +static fspr_socket_t *sock = NULL; static void create_socket(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; - rv = apr_socket_create(&sock, APR_INET, SOCK_STREAM, 0, p); + rv = fspr_socket_create(&sock, APR_INET, SOCK_STREAM, 0, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_PTR_NOTNULL(tc, sock); } static void set_keepalive(abts_case *tc, void *data) { - apr_status_t rv; - apr_int32_t ck; + fspr_status_t rv; + fspr_int32_t ck; - rv = apr_socket_opt_set(sock, APR_SO_KEEPALIVE, 1); + rv = fspr_socket_opt_set(sock, APR_SO_KEEPALIVE, 1); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_socket_opt_get(sock, APR_SO_KEEPALIVE, &ck); + rv = fspr_socket_opt_get(sock, APR_SO_KEEPALIVE, &ck); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, 1, ck); } static void set_debug(abts_case *tc, void *data) { - apr_status_t rv1, rv2; - apr_int32_t ck; + fspr_status_t rv1, rv2; + fspr_int32_t ck; /* On some platforms APR_SO_DEBUG can only be set as root; just test * for get/set consistency of this option. */ - rv1 = apr_socket_opt_set(sock, APR_SO_DEBUG, 1); - rv2 = apr_socket_opt_get(sock, APR_SO_DEBUG, &ck); + rv1 = fspr_socket_opt_set(sock, APR_SO_DEBUG, 1); + rv2 = fspr_socket_opt_get(sock, APR_SO_DEBUG, &ck); APR_ASSERT_SUCCESS(tc, "get SO_DEBUG option", rv2); if (rv1 == APR_SUCCESS) { ABTS_INT_EQUAL(tc, 1, ck); @@ -63,17 +63,17 @@ static void set_debug(abts_case *tc, void *data) static void remove_keepalive(abts_case *tc, void *data) { - apr_status_t rv; - apr_int32_t ck; + fspr_status_t rv; + fspr_int32_t ck; - rv = apr_socket_opt_get(sock, APR_SO_KEEPALIVE, &ck); + rv = fspr_socket_opt_get(sock, APR_SO_KEEPALIVE, &ck); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, 1, ck); - rv = apr_socket_opt_set(sock, APR_SO_KEEPALIVE, 0); + rv = fspr_socket_opt_set(sock, APR_SO_KEEPALIVE, 0); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_socket_opt_get(sock, APR_SO_KEEPALIVE, &ck); + rv = fspr_socket_opt_get(sock, APR_SO_KEEPALIVE, &ck); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, 0, ck); } @@ -83,33 +83,33 @@ static void corkable(abts_case *tc, void *data) #if !APR_HAVE_CORKABLE_TCP ABTS_NOT_IMPL(tc, "TCP isn't corkable"); #else - apr_status_t rv; - apr_int32_t ck; + fspr_status_t rv; + fspr_int32_t ck; - rv = apr_socket_opt_set(sock, APR_TCP_NODELAY, 1); + rv = fspr_socket_opt_set(sock, APR_TCP_NODELAY, 1); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_socket_opt_get(sock, APR_TCP_NODELAY, &ck); + rv = fspr_socket_opt_get(sock, APR_TCP_NODELAY, &ck); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, 1, ck); - rv = apr_socket_opt_set(sock, APR_TCP_NOPUSH, 1); + rv = fspr_socket_opt_set(sock, APR_TCP_NOPUSH, 1); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_socket_opt_get(sock, APR_TCP_NOPUSH, &ck); + rv = fspr_socket_opt_get(sock, APR_TCP_NOPUSH, &ck); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, 1, ck); - rv = apr_socket_opt_get(sock, APR_TCP_NODELAY, &ck); + rv = fspr_socket_opt_get(sock, APR_TCP_NODELAY, &ck); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); /* TCP_NODELAY is now in an unknown state; it may be zero if * TCP_NOPUSH and TCP_NODELAY are mutually exclusive on this * platform, e.g. Linux < 2.6. */ - rv = apr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); + rv = fspr_socket_opt_set(sock, APR_TCP_NOPUSH, 0); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_socket_opt_get(sock, APR_TCP_NODELAY, &ck); + rv = fspr_socket_opt_get(sock, APR_TCP_NODELAY, &ck); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); ABTS_INT_EQUAL(tc, 1, ck); #endif @@ -117,9 +117,9 @@ static void corkable(abts_case *tc, void *data) static void close_socket(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; - rv = apr_socket_close(sock); + rv = fspr_socket_close(sock); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } diff --git a/libs/apr/test/teststr.c b/libs/apr/test/teststr.c index ec382c343a..4ed57dec4f 100644 --- a/libs/apr/test/teststr.c +++ b/libs/apr/test/teststr.c @@ -25,9 +25,9 @@ #include #endif -#include "apr_general.h" -#include "apr_strings.h" -#include "apr_errno.h" +#include "fspr_general.h" +#include "fspr_strings.h" +#include "fspr_errno.h" /* I haven't bothered to check for APR_ENOTIMPL here, AFAIK, all string * functions exist on all platforms. @@ -49,7 +49,7 @@ static void test_strtok(abts_case *tc, void *data) " \r\n\3\2\1" }, { - NULL, /* but who cares if apr_strtok() segfaults? */ + NULL, /* but who cares if fspr_strtok() segfaults? */ " \t" }, #if 0 /* don't do this... you deserve to segfault */ @@ -74,11 +74,11 @@ static void test_strtok(abts_case *tc, void *data) char *str1, *str2; char *state; - str1 = apr_pstrdup(p, cases[curtc].input); - str2 = apr_pstrdup(p, cases[curtc].input); + str1 = fspr_pstrdup(p, cases[curtc].input); + str2 = fspr_pstrdup(p, cases[curtc].input); do { - retval1 = apr_strtok(str1, cases[curtc].sep, &state); + retval1 = fspr_strtok(str1, cases[curtc].sep, &state); retval2 = strtok(str2, cases[curtc].sep); if (!retval1) { @@ -97,7 +97,7 @@ static void test_strtok(abts_case *tc, void *data) static void snprintf_noNULL(abts_case *tc, void *data) { char buff[100]; - char *testing = apr_palloc(p, 10); + char *testing = fspr_palloc(p, 10); testing[0] = 't'; testing[1] = 'e'; @@ -108,7 +108,7 @@ static void snprintf_noNULL(abts_case *tc, void *data) testing[6] = 'g'; /* If this test fails, we are going to seg fault. */ - apr_snprintf(buff, sizeof(buff), "%.*s", 7, testing); + fspr_snprintf(buff, sizeof(buff), "%.*s", 7, testing); ABTS_STR_NEQUAL(tc, buff, testing, 7); } @@ -116,7 +116,7 @@ static void snprintf_0NULL(abts_case *tc, void *data) { int rv; - rv = apr_snprintf(NULL, 0, "%sBAR", "FOO"); + rv = fspr_snprintf(NULL, 0, "%sBAR", "FOO"); ABTS_INT_EQUAL(tc, 6, rv); } @@ -125,7 +125,7 @@ static void snprintf_0nonNULL(abts_case *tc, void *data) int rv; char *buff = "testing"; - rv = apr_snprintf(buff, 0, "%sBAR", "FOO"); + rv = fspr_snprintf(buff, 0, "%sBAR", "FOO"); ABTS_INT_EQUAL(tc, 6, rv); ABTS_ASSERT(tc, "buff unmangled", strcmp(buff, "FOOBAR") != 0); } @@ -135,15 +135,15 @@ static void snprintf_underflow(abts_case *tc, void *data) char buf[20]; int rv; - rv = apr_snprintf(buf, sizeof buf, "%.2f", (double)0.0001); + rv = fspr_snprintf(buf, sizeof buf, "%.2f", (double)0.0001); ABTS_INT_EQUAL(tc, 4, rv); ABTS_STR_EQUAL(tc, "0.00", buf); - rv = apr_snprintf(buf, sizeof buf, "%.2f", (double)0.001); + rv = fspr_snprintf(buf, sizeof buf, "%.2f", (double)0.001); ABTS_INT_EQUAL(tc, 4, rv); ABTS_STR_EQUAL(tc, "0.00", buf); - rv = apr_snprintf(buf, sizeof buf, "%.2f", (double)0.01); + rv = fspr_snprintf(buf, sizeof buf, "%.2f", (double)0.01); ABTS_INT_EQUAL(tc, 4, rv); ABTS_STR_EQUAL(tc, "0.01", buf); } @@ -151,20 +151,20 @@ static void snprintf_underflow(abts_case *tc, void *data) static void string_error(abts_case *tc, void *data) { char buf[128], *rv; - apr_status_t n; + fspr_status_t n; buf[0] = '\0'; - rv = apr_strerror(APR_ENOENT, buf, sizeof buf); + rv = fspr_strerror(APR_ENOENT, buf, sizeof buf); ABTS_PTR_EQUAL(tc, buf, rv); ABTS_TRUE(tc, strlen(buf) > 0); - rv = apr_strerror(APR_TIMEUP, buf, sizeof buf); + rv = fspr_strerror(APR_TIMEUP, buf, sizeof buf); ABTS_PTR_EQUAL(tc, buf, rv); ABTS_STR_EQUAL(tc, "The timeout specified has expired", buf); /* throw some randomish numbers at it to check for robustness */ for (n = 1; n < 1000000; n *= 2) { - apr_strerror(n, buf, sizeof buf); + fspr_strerror(n, buf, sizeof buf); } } @@ -176,10 +176,10 @@ static void string_long(abts_case *tc, void *data) memset(s, 'A', SIZE); s[SIZE] = '\0'; - apr_psprintf(p, "%s", s); + fspr_psprintf(p, "%s", s); } -/* ### FIXME: apr.h/apr_strings.h should provide these! */ +/* ### FIXME: apr.h/fspr_strings.h should provide these! */ #define MY_LLONG_MAX (APR_INT64_C(9223372036854775807)) #define MY_LLONG_MIN (-MY_LLONG_MAX - APR_INT64_C(1)) @@ -188,7 +188,7 @@ static void string_strtoi64(abts_case *tc, void *data) static const struct { int errnum, base; const char *in, *end; - apr_int64_t result; + fspr_int64_t result; } ts[] = { /* base 10 tests */ @@ -243,22 +243,22 @@ static void string_strtoi64(abts_case *tc, void *data) for (n = 0; n < sizeof(ts)/sizeof(ts[0]); n++) { char *end = "end ptr not changed"; - apr_int64_t result; + fspr_int64_t result; int errnum; errno = 0; - result = apr_strtoi64(ts[n].in, &end, ts[n].base); + result = fspr_strtoi64(ts[n].in, &end, ts[n].base); errnum = errno; ABTS_ASSERT(tc, - apr_psprintf(p, "for '%s': result was %" APR_INT64_T_FMT + fspr_psprintf(p, "for '%s': result was %" APR_INT64_T_FMT " not %" APR_INT64_T_FMT, ts[n].in, result, ts[n].result), result == ts[n].result); if (ts[n].errnum != -1) { ABTS_ASSERT(tc, - apr_psprintf(p, "for '%s': errno was %d not %d", ts[n].in, + fspr_psprintf(p, "for '%s': errno was %d not %d", ts[n].in, errnum, ts[n].errnum), ts[n].errnum == errnum); } @@ -268,7 +268,7 @@ static void string_strtoi64(abts_case *tc, void *data) ABTS_PTR_EQUAL(tc, ts[n].in + strlen(ts[n].in), end); } else if (ts[n].end != (void *)-1) { ABTS_ASSERT(tc, - apr_psprintf(p, "for '%s', end was '%s' not '%s'", + fspr_psprintf(p, "for '%s', end was '%s' not '%s'", ts[n].in, end, ts[n].end), strcmp(ts[n].end, end) == 0); } @@ -277,14 +277,14 @@ static void string_strtoi64(abts_case *tc, void *data) static void string_strtoff(abts_case *tc, void *data) { - apr_off_t off; + fspr_off_t off; ABTS_ASSERT(tc, "strtoff fails on out-of-range integer", - apr_strtoff(&off, "999999999999999999999999999999", + fspr_strtoff(&off, "999999999999999999999999999999", NULL, 10) != APR_SUCCESS); ABTS_ASSERT(tc, "strtoff failed for 1234", - apr_strtoff(&off, "1234", NULL, 10) == APR_SUCCESS); + fspr_strtoff(&off, "1234", NULL, 10) == APR_SUCCESS); ABTS_ASSERT(tc, "strtoff failed to parse 1234", off == 1234); } @@ -292,25 +292,25 @@ static void string_strtoff(abts_case *tc, void *data) /* random-ish checks for strfsize buffer overflows */ static void overflow_strfsize(abts_case *tc, void *data) { - apr_off_t off; + fspr_off_t off; char buf[7]; buf[5] = '$'; buf[6] = '@'; for (off = -9999; off < 20000; off++) { - apr_strfsize(off, buf); + fspr_strfsize(off, buf); } for (; off < 9999999; off += 9) { - apr_strfsize(off, buf); + fspr_strfsize(off, buf); } for (; off < 999999999; off += 999) { - apr_strfsize(off, buf); + fspr_strfsize(off, buf); } for (off = 1; off < LONG_MAX && off > 0; off *= 2) { - apr_strfsize(off, buf); - apr_strfsize(off + 1, buf); - apr_strfsize(off - 1, buf); + fspr_strfsize(off, buf); + fspr_strfsize(off + 1, buf); + fspr_strfsize(off - 1, buf); } ABTS_ASSERT(tc, "strfsize overflowed", buf[5] == '$'); @@ -320,7 +320,7 @@ static void overflow_strfsize(abts_case *tc, void *data) static void string_strfsize(abts_case *tc, void *data) { static const struct { - apr_off_t size; + fspr_off_t size; const char *buf; } ts[] = { { -1, " - " }, @@ -334,14 +334,14 @@ static void string_strfsize(abts_case *tc, void *data) { 103809024, " 99M" }, { 1047527424, "1.0G" } /* "999M" would be more correct */ }; - apr_size_t n; + fspr_size_t n; for (n = 0; n < sizeof(ts)/sizeof(ts[0]); n++) { char buf[6], *ret; buf[5] = '%'; - ret = apr_strfsize(ts[n].size, buf); + ret = fspr_strfsize(ts[n].size, buf); ABTS_ASSERT(tc, "strfsize returned wrong buffer", ret == buf); ABTS_ASSERT(tc, "strfsize overflowed", buf[5] == '%'); @@ -357,10 +357,10 @@ static void snprintf_overflow(abts_case *tc, void *data) buf[2] = '4'; buf[3] = '2'; - rv = apr_snprintf(buf, 2, "%s", "a"); + rv = fspr_snprintf(buf, 2, "%s", "a"); ABTS_INT_EQUAL(tc, 1, rv); - rv = apr_snprintf(buf, 2, "%s", "abcd"); + rv = fspr_snprintf(buf, 2, "%s", "abcd"); ABTS_INT_EQUAL(tc, 1, rv); ABTS_STR_EQUAL(tc, buf, "a"); diff --git a/libs/apr/test/teststrnatcmp.c b/libs/apr/test/teststrnatcmp.c index 3a5e4c67ba..7e62742a0c 100644 --- a/libs/apr/test/teststrnatcmp.c +++ b/libs/apr/test/teststrnatcmp.c @@ -14,50 +14,50 @@ * limitations under the License. */ -#include "apr_file_io.h" -#include "apr_errno.h" -#include "apr_strings.h" +#include "fspr_file_io.h" +#include "fspr_errno.h" +#include "fspr_strings.h" #include "testutil.h" static void less0(abts_case *tc, void *data) { - int rv = apr_strnatcmp("a", "b"); + int rv = fspr_strnatcmp("a", "b"); ABTS_ASSERT(tc, "didn't compare simple strings properly", rv < 0); } static void str_equal(abts_case *tc, void *data) { - int rv = apr_strnatcmp("a", "a"); + int rv = fspr_strnatcmp("a", "a"); ABTS_ASSERT(tc, "didn't compare simple strings properly", rv == 0); } static void more0(abts_case *tc, void *data) { - int rv = apr_strnatcmp("b", "a"); + int rv = fspr_strnatcmp("b", "a"); ABTS_ASSERT(tc, "didn't compare simple strings properly", rv > 0); } static void less_ignore_case(abts_case *tc, void *data) { - int rv = apr_strnatcasecmp("a", "B"); + int rv = fspr_strnatcasecmp("a", "B"); ABTS_ASSERT(tc, "didn't compare simple strings properly", rv < 0); } static void str_equal_ignore_case(abts_case *tc, void *data) { - int rv = apr_strnatcasecmp("a", "A"); + int rv = fspr_strnatcasecmp("a", "A"); ABTS_ASSERT(tc, "didn't compare simple strings properly", rv == 0); } static void more_ignore_case(abts_case *tc, void *data) { - int rv = apr_strnatcasecmp("b", "A"); + int rv = fspr_strnatcasecmp("b", "A"); ABTS_ASSERT(tc, "didn't compare simple strings properly", rv > 0); } static void natcmp(abts_case *tc, void *data) { - int rv = apr_strnatcasecmp("a2", "a10"); + int rv = fspr_strnatcasecmp("a2", "a10"); ABTS_ASSERT(tc, "didn't compare simple strings properly", rv < 0); } diff --git a/libs/apr/test/testtable.c b/libs/apr/test/testtable.c index d377eaf5a1..e9696d768d 100644 --- a/libs/apr/test/testtable.c +++ b/libs/apr/test/testtable.c @@ -15,11 +15,11 @@ */ #include "testutil.h" -#include "apr.h" -#include "apr_strings.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_tables.h" +#include "fspr.h" +#include "fspr_strings.h" +#include "fspr_general.h" +#include "fspr_pools.h" +#include "fspr_tables.h" #if APR_HAVE_STDIO_H #include #endif @@ -30,11 +30,11 @@ #include #endif -static apr_table_t *t1 = NULL; +static fspr_table_t *t1 = NULL; static void table_make(abts_case *tc, void *data) { - t1 = apr_table_make(p, 5); + t1 = fspr_table_make(p, 5); ABTS_PTR_NOTNULL(tc, t1); } @@ -42,8 +42,8 @@ static void table_get(abts_case *tc, void *data) { const char *val; - apr_table_set(t1, "foo", "bar"); - val = apr_table_get(t1, "foo"); + fspr_table_set(t1, "foo", "bar"); + val = fspr_table_get(t1, "foo"); ABTS_STR_EQUAL(tc, val, "bar"); } @@ -51,9 +51,9 @@ static void table_set(abts_case *tc, void *data) { const char *val; - apr_table_set(t1, "setkey", "bar"); - apr_table_set(t1, "setkey", "2ndtry"); - val = apr_table_get(t1, "setkey"); + fspr_table_set(t1, "setkey", "bar"); + fspr_table_set(t1, "setkey", "2ndtry"); + val = fspr_table_get(t1, "setkey"); ABTS_STR_EQUAL(tc, val, "2ndtry"); } @@ -61,7 +61,7 @@ static void table_getnotthere(abts_case *tc, void *data) { const char *val; - val = apr_table_get(t1, "keynotthere"); + val = fspr_table_get(t1, "keynotthere"); ABTS_PTR_EQUAL(tc, NULL, (void *)val); } @@ -69,9 +69,9 @@ static void table_add(abts_case *tc, void *data) { const char *val; - apr_table_add(t1, "addkey", "bar"); - apr_table_add(t1, "addkey", "foo"); - val = apr_table_get(t1, "addkey"); + fspr_table_add(t1, "addkey", "bar"); + fspr_table_add(t1, "addkey", "foo"); + val = fspr_table_get(t1, "addkey"); ABTS_STR_EQUAL(tc, val, "bar"); } @@ -79,94 +79,94 @@ static void table_add(abts_case *tc, void *data) static void table_nelts(abts_case *tc, void *data) { const char *val; - apr_table_t *t = apr_table_make(p, 1); + fspr_table_t *t = fspr_table_make(p, 1); - apr_table_set(t, "abc", "def"); - apr_table_set(t, "def", "abc"); - apr_table_set(t, "foo", "zzz"); - val = apr_table_get(t, "foo"); + fspr_table_set(t, "abc", "def"); + fspr_table_set(t, "def", "abc"); + fspr_table_set(t, "foo", "zzz"); + val = fspr_table_get(t, "foo"); ABTS_STR_EQUAL(tc, val, "zzz"); - val = apr_table_get(t, "abc"); + val = fspr_table_get(t, "abc"); ABTS_STR_EQUAL(tc, val, "def"); - val = apr_table_get(t, "def"); + val = fspr_table_get(t, "def"); ABTS_STR_EQUAL(tc, val, "abc"); - ABTS_INT_EQUAL(tc, 3, apr_table_elts(t)->nelts); + ABTS_INT_EQUAL(tc, 3, fspr_table_elts(t)->nelts); } static void table_clear(abts_case *tc, void *data) { - apr_table_clear(t1); - ABTS_INT_EQUAL(tc, 0, apr_table_elts(t1)->nelts); + fspr_table_clear(t1); + ABTS_INT_EQUAL(tc, 0, fspr_table_elts(t1)->nelts); } static void table_unset(abts_case *tc, void *data) { const char *val; - apr_table_t *t = apr_table_make(p, 1); + fspr_table_t *t = fspr_table_make(p, 1); - apr_table_set(t, "a", "1"); - apr_table_set(t, "b", "2"); - apr_table_unset(t, "b"); - ABTS_INT_EQUAL(tc, 1, apr_table_elts(t)->nelts); - val = apr_table_get(t, "a"); + fspr_table_set(t, "a", "1"); + fspr_table_set(t, "b", "2"); + fspr_table_unset(t, "b"); + ABTS_INT_EQUAL(tc, 1, fspr_table_elts(t)->nelts); + val = fspr_table_get(t, "a"); ABTS_STR_EQUAL(tc, val, "1"); - val = apr_table_get(t, "b"); + val = fspr_table_get(t, "b"); ABTS_PTR_EQUAL(tc, (void *)val, (void *)NULL); } static void table_overlap(abts_case *tc, void *data) { const char *val; - apr_table_t *t1 = apr_table_make(p, 1); - apr_table_t *t2 = apr_table_make(p, 1); + fspr_table_t *t1 = fspr_table_make(p, 1); + fspr_table_t *t2 = fspr_table_make(p, 1); - apr_table_addn(t1, "a", "0"); - apr_table_addn(t1, "g", "7"); - apr_table_addn(t2, "a", "1"); - apr_table_addn(t2, "b", "2"); - apr_table_addn(t2, "c", "3"); - apr_table_addn(t2, "b", "2.0"); - apr_table_addn(t2, "d", "4"); - apr_table_addn(t2, "e", "5"); - apr_table_addn(t2, "b", "2."); - apr_table_addn(t2, "f", "6"); - apr_table_overlap(t1, t2, APR_OVERLAP_TABLES_SET); + fspr_table_addn(t1, "a", "0"); + fspr_table_addn(t1, "g", "7"); + fspr_table_addn(t2, "a", "1"); + fspr_table_addn(t2, "b", "2"); + fspr_table_addn(t2, "c", "3"); + fspr_table_addn(t2, "b", "2.0"); + fspr_table_addn(t2, "d", "4"); + fspr_table_addn(t2, "e", "5"); + fspr_table_addn(t2, "b", "2."); + fspr_table_addn(t2, "f", "6"); + fspr_table_overlap(t1, t2, APR_OVERLAP_TABLES_SET); - ABTS_INT_EQUAL(tc, apr_table_elts(t1)->nelts, 7); - val = apr_table_get(t1, "a"); + ABTS_INT_EQUAL(tc, fspr_table_elts(t1)->nelts, 7); + val = fspr_table_get(t1, "a"); ABTS_STR_EQUAL(tc, val, "1"); - val = apr_table_get(t1, "b"); + val = fspr_table_get(t1, "b"); ABTS_STR_EQUAL(tc, val, "2."); - val = apr_table_get(t1, "c"); + val = fspr_table_get(t1, "c"); ABTS_STR_EQUAL(tc, val, "3"); - val = apr_table_get(t1, "d"); + val = fspr_table_get(t1, "d"); ABTS_STR_EQUAL(tc, val, "4"); - val = apr_table_get(t1, "e"); + val = fspr_table_get(t1, "e"); ABTS_STR_EQUAL(tc, val, "5"); - val = apr_table_get(t1, "f"); + val = fspr_table_get(t1, "f"); ABTS_STR_EQUAL(tc, val, "6"); - val = apr_table_get(t1, "g"); + val = fspr_table_get(t1, "g"); ABTS_STR_EQUAL(tc, val, "7"); } static void table_overlap2(abts_case *tc, void *data) { - apr_pool_t *subp; - apr_table_t *t1, *t2; + fspr_pool_t *subp; + fspr_table_t *t1, *t2; - apr_pool_create(&subp, p); + fspr_pool_create(&subp, p); - t1 = apr_table_make(subp, 1); - t2 = apr_table_make(p, 1); - apr_table_addn(t1, "t1", "one"); - apr_table_addn(t2, "t2", "two"); + t1 = fspr_table_make(subp, 1); + t2 = fspr_table_make(p, 1); + fspr_table_addn(t1, "t1", "one"); + fspr_table_addn(t2, "t2", "two"); - apr_table_overlap(t1, t2, APR_OVERLAP_TABLES_SET); + fspr_table_overlap(t1, t2, APR_OVERLAP_TABLES_SET); - ABTS_INT_EQUAL(tc, 2, apr_table_elts(t1)->nelts); + ABTS_INT_EQUAL(tc, 2, fspr_table_elts(t1)->nelts); - ABTS_STR_EQUAL(tc, apr_table_get(t1, "t1"), "one"); - ABTS_STR_EQUAL(tc, apr_table_get(t1, "t2"), "two"); + ABTS_STR_EQUAL(tc, fspr_table_get(t1, "t1"), "one"); + ABTS_STR_EQUAL(tc, fspr_table_get(t1, "t2"), "two"); } diff --git a/libs/apr/test/testtemp.c b/libs/apr/test/testtemp.c index 1f1143ee35..6d94c193e9 100644 --- a/libs/apr/test/testtemp.c +++ b/libs/apr/test/testtemp.c @@ -15,31 +15,31 @@ */ #include "testutil.h" -#include "apr_file_io.h" -#include "apr_strings.h" +#include "fspr_file_io.h" +#include "fspr_strings.h" static void test_temp_dir(abts_case *tc, void *data) { const char *tempdir = NULL; - apr_status_t rv; + fspr_status_t rv; - rv = apr_temp_dir_get(&tempdir, p); + rv = fspr_temp_dir_get(&tempdir, p); APR_ASSERT_SUCCESS(tc, "Error finding Temporary Directory", rv); ABTS_PTR_NOTNULL(tc, tempdir); } static void test_mktemp(abts_case *tc, void *data) { - apr_file_t *f = NULL; + fspr_file_t *f = NULL; const char *tempdir = NULL; char *filetemplate; - apr_status_t rv; + fspr_status_t rv; - rv = apr_temp_dir_get(&tempdir, p); + rv = fspr_temp_dir_get(&tempdir, p); APR_ASSERT_SUCCESS(tc, "Error finding Temporary Directory", rv); - filetemplate = apr_pstrcat(p, tempdir, "/tempfileXXXXXX", NULL); - rv = apr_file_mktemp(&f, filetemplate, 0, p); + filetemplate = fspr_pstrcat(p, tempdir, "/tempfileXXXXXX", NULL); + rv = fspr_file_mktemp(&f, filetemplate, 0, p); APR_ASSERT_SUCCESS(tc, "Error opening Temporary file", rv); } diff --git a/libs/apr/test/testthread.c b/libs/apr/test/testthread.c index 35ef293bec..a5709aac74 100644 --- a/libs/apr/test/testthread.c +++ b/libs/apr/test/testthread.c @@ -14,84 +14,84 @@ * limitations under the License. */ -#include "apr_thread_proc.h" -#include "apr_errno.h" -#include "apr_general.h" +#include "fspr_thread_proc.h" +#include "fspr_errno.h" +#include "fspr_general.h" #include "errno.h" -#include "apr_time.h" +#include "fspr_time.h" #include "testutil.h" #if APR_HAS_THREADS -static apr_thread_mutex_t *thread_lock; -static apr_thread_once_t *control = NULL; +static fspr_thread_mutex_t *thread_lock; +static fspr_thread_once_t *control = NULL; static int x = 0; static int value = 0; -static apr_thread_t *t1; -static apr_thread_t *t2; -static apr_thread_t *t3; -static apr_thread_t *t4; +static fspr_thread_t *t1; +static fspr_thread_t *t2; +static fspr_thread_t *t3; +static fspr_thread_t *t4; /* just some made up number to check on later */ -static apr_status_t exit_ret_val = 123; +static fspr_status_t exit_ret_val = 123; static void init_func(void) { value++; } -static void * APR_THREAD_FUNC thread_func1(apr_thread_t *thd, void *data) +static void * APR_THREAD_FUNC thread_func1(fspr_thread_t *thd, void *data) { int i; - apr_thread_once(control, init_func); + fspr_thread_once(control, init_func); for (i = 0; i < 10000; i++) { - apr_thread_mutex_lock(thread_lock); + fspr_thread_mutex_lock(thread_lock); x++; - apr_thread_mutex_unlock(thread_lock); + fspr_thread_mutex_unlock(thread_lock); } - apr_thread_exit(thd, exit_ret_val); + fspr_thread_exit(thd, exit_ret_val); return NULL; } static void thread_init(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; - rv = apr_thread_once_init(&control, p); + rv = fspr_thread_once_init(&control, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_DEFAULT, p); + rv = fspr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_DEFAULT, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } static void create_threads(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; - rv = apr_thread_create(&t1, NULL, thread_func1, NULL, p); + rv = fspr_thread_create(&t1, NULL, thread_func1, NULL, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_thread_create(&t2, NULL, thread_func1, NULL, p); + rv = fspr_thread_create(&t2, NULL, thread_func1, NULL, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_thread_create(&t3, NULL, thread_func1, NULL, p); + rv = fspr_thread_create(&t3, NULL, thread_func1, NULL, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_thread_create(&t4, NULL, thread_func1, NULL, p); + rv = fspr_thread_create(&t4, NULL, thread_func1, NULL, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); } static void join_threads(abts_case *tc, void *data) { - apr_status_t s; + fspr_status_t s; - apr_thread_join(&s, t1); + fspr_thread_join(&s, t1); ABTS_INT_EQUAL(tc, exit_ret_val, s); - apr_thread_join(&s, t2); + fspr_thread_join(&s, t2); ABTS_INT_EQUAL(tc, exit_ret_val, s); - apr_thread_join(&s, t3); + fspr_thread_join(&s, t3); ABTS_INT_EQUAL(tc, exit_ret_val, s); - apr_thread_join(&s, t4); + fspr_thread_join(&s, t4); ABTS_INT_EQUAL(tc, exit_ret_val, s); } diff --git a/libs/apr/test/testtime.c b/libs/apr/test/testtime.c index 84b4772695..2922d095d6 100644 --- a/libs/apr/test/testtime.c +++ b/libs/apr/test/testtime.c @@ -14,12 +14,12 @@ * limitations under the License. */ -#include "apr_time.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_lib.h" +#include "fspr_time.h" +#include "fspr_errno.h" +#include "fspr_general.h" +#include "fspr_lib.h" #include "testutil.h" -#include "apr_strings.h" +#include "fspr_strings.h" #include #define STR_SIZE 45 @@ -30,11 +30,11 @@ * 2002-08-14 12:05:36.186711 -25200 [257 Sat]. * Which happens to be when I wrote the new tests. */ -static apr_time_t now = APR_INT64_C(1032030336186711); +static fspr_time_t now = APR_INT64_C(1032030336186711); -static char* print_time (apr_pool_t *pool, const apr_time_exp_t *xt) +static char* print_time (fspr_pool_t *pool, const fspr_time_exp_t *xt) { - return apr_psprintf (pool, + return fspr_psprintf (pool, "%04d-%02d-%02d %02d:%02d:%02d.%06d %+05d [%d %s]%s", xt->tm_year + 1900, xt->tm_mon, @@ -45,18 +45,18 @@ static char* print_time (apr_pool_t *pool, const apr_time_exp_t *xt) xt->tm_usec, xt->tm_gmtoff, xt->tm_yday + 1, - apr_day_snames[xt->tm_wday], + fspr_day_snames[xt->tm_wday], (xt->tm_isdst ? " DST" : "")); } static void test_now(abts_case *tc, void *data) { - apr_time_t timediff; - apr_time_t current; + fspr_time_t timediff; + fspr_time_t current; time_t os_now; - current = apr_time_now(); + current = fspr_time_now(); time(&os_now); timediff = os_now - (current / APR_USEC_PER_SEC); @@ -64,18 +64,18 @@ static void test_now(abts_case *tc, void *data) * that the time will be slightly off, so accept anything between -1 and * 1 second. */ - ABTS_ASSERT(tc, "apr_time and OS time do not agree", + ABTS_ASSERT(tc, "fspr_time and OS time do not agree", (timediff > -2) && (timediff < 2)); } static void test_gmtstr(abts_case *tc, void *data) { - apr_status_t rv; - apr_time_exp_t xt; + fspr_status_t rv; + fspr_time_exp_t xt; - rv = apr_time_exp_gmt(&xt, now); + rv = fspr_time_exp_gmt(&xt, now); if (rv == APR_ENOTIMPL) { - ABTS_NOT_IMPL(tc, "apr_time_exp_gmt"); + ABTS_NOT_IMPL(tc, "fspr_time_exp_gmt"); } ABTS_TRUE(tc, rv == APR_SUCCESS); ABTS_STR_EQUAL(tc, "2002-08-14 19:05:36.186711 +0000 [257 Sat]", @@ -84,14 +84,14 @@ static void test_gmtstr(abts_case *tc, void *data) static void test_exp_lt(abts_case *tc, void *data) { - apr_status_t rv; - apr_time_exp_t xt; - time_t posix_secs = (time_t)apr_time_sec(now); + fspr_status_t rv; + fspr_time_exp_t xt; + time_t posix_secs = (time_t)fspr_time_sec(now); struct tm *posix_exp = localtime(&posix_secs); - rv = apr_time_exp_lt(&xt, now); + rv = fspr_time_exp_lt(&xt, now); if (rv == APR_ENOTIMPL) { - ABTS_NOT_IMPL(tc, "apr_time_exp_lt"); + ABTS_NOT_IMPL(tc, "fspr_time_exp_lt"); } ABTS_TRUE(tc, rv == APR_SUCCESS); @@ -112,51 +112,51 @@ static void test_exp_lt(abts_case *tc, void *data) static void test_exp_get_gmt(abts_case *tc, void *data) { - apr_status_t rv; - apr_time_exp_t xt; - apr_time_t imp; - apr_int64_t hr_off_64; + fspr_status_t rv; + fspr_time_exp_t xt; + fspr_time_t imp; + fspr_int64_t hr_off_64; - rv = apr_time_exp_gmt(&xt, now); + rv = fspr_time_exp_gmt(&xt, now); ABTS_TRUE(tc, rv == APR_SUCCESS); - rv = apr_time_exp_get(&imp, &xt); + rv = fspr_time_exp_get(&imp, &xt); if (rv == APR_ENOTIMPL) { - ABTS_NOT_IMPL(tc, "apr_time_exp_get"); + ABTS_NOT_IMPL(tc, "fspr_time_exp_get"); } ABTS_TRUE(tc, rv == APR_SUCCESS); - hr_off_64 = (apr_int64_t) xt.tm_gmtoff * APR_USEC_PER_SEC; + hr_off_64 = (fspr_int64_t) xt.tm_gmtoff * APR_USEC_PER_SEC; ABTS_TRUE(tc, now + hr_off_64 == imp); } static void test_exp_get_lt(abts_case *tc, void *data) { - apr_status_t rv; - apr_time_exp_t xt; - apr_time_t imp; - apr_int64_t hr_off_64; + fspr_status_t rv; + fspr_time_exp_t xt; + fspr_time_t imp; + fspr_int64_t hr_off_64; - rv = apr_time_exp_lt(&xt, now); + rv = fspr_time_exp_lt(&xt, now); ABTS_TRUE(tc, rv == APR_SUCCESS); - rv = apr_time_exp_get(&imp, &xt); + rv = fspr_time_exp_get(&imp, &xt); if (rv == APR_ENOTIMPL) { - ABTS_NOT_IMPL(tc, "apr_time_exp_get"); + ABTS_NOT_IMPL(tc, "fspr_time_exp_get"); } ABTS_TRUE(tc, rv == APR_SUCCESS); - hr_off_64 = (apr_int64_t) xt.tm_gmtoff * APR_USEC_PER_SEC; + hr_off_64 = (fspr_int64_t) xt.tm_gmtoff * APR_USEC_PER_SEC; ABTS_TRUE(tc, now + hr_off_64 == imp); } static void test_imp_gmt(abts_case *tc, void *data) { - apr_status_t rv; - apr_time_exp_t xt; - apr_time_t imp; + fspr_status_t rv; + fspr_time_exp_t xt; + fspr_time_t imp; - rv = apr_time_exp_gmt(&xt, now); + rv = fspr_time_exp_gmt(&xt, now); ABTS_TRUE(tc, rv == APR_SUCCESS); - rv = apr_time_exp_gmt_get(&imp, &xt); + rv = fspr_time_exp_gmt_get(&imp, &xt); if (rv == APR_ENOTIMPL) { - ABTS_NOT_IMPL(tc, "apr_time_exp_gmt_get"); + ABTS_NOT_IMPL(tc, "fspr_time_exp_gmt_get"); } ABTS_TRUE(tc, rv == APR_SUCCESS); ABTS_TRUE(tc, now == imp); @@ -164,12 +164,12 @@ static void test_imp_gmt(abts_case *tc, void *data) static void test_rfcstr(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; char str[STR_SIZE]; - rv = apr_rfc822_date(str, now); + rv = fspr_rfc822_date(str, now); if (rv == APR_ENOTIMPL) { - ABTS_NOT_IMPL(tc, "apr_rfc822_date"); + ABTS_NOT_IMPL(tc, "fspr_rfc822_date"); } ABTS_TRUE(tc, rv == APR_SUCCESS); ABTS_STR_EQUAL(tc, "Sat, 14 Sep 2002 19:05:36 GMT", str); @@ -177,35 +177,35 @@ static void test_rfcstr(abts_case *tc, void *data) static void test_ctime(abts_case *tc, void *data) { - apr_status_t rv; - char apr_str[STR_SIZE]; + fspr_status_t rv; + char fspr_str[STR_SIZE]; char libc_str[STR_SIZE]; - apr_time_t now_sec = apr_time_sec(now); + fspr_time_t now_sec = fspr_time_sec(now); time_t posix_sec = (time_t) now_sec; - rv = apr_ctime(apr_str, now); + rv = fspr_ctime(fspr_str, now); if (rv == APR_ENOTIMPL) { - ABTS_NOT_IMPL(tc, "apr_ctime"); + ABTS_NOT_IMPL(tc, "fspr_ctime"); } ABTS_TRUE(tc, rv == APR_SUCCESS); strcpy(libc_str, ctime(&posix_sec)); *strchr(libc_str, '\n') = '\0'; - ABTS_STR_EQUAL(tc, libc_str, apr_str); + ABTS_STR_EQUAL(tc, libc_str, fspr_str); } static void test_strftime(abts_case *tc, void *data) { - apr_status_t rv; - apr_time_exp_t xt; + fspr_status_t rv; + fspr_time_exp_t xt; char *str = NULL; - apr_size_t sz; + fspr_size_t sz; - rv = apr_time_exp_gmt(&xt, now); - str = apr_palloc(p, STR_SIZE + 1); - rv = apr_strftime(str, &sz, STR_SIZE, "%R %A %d %B %Y", &xt); + rv = fspr_time_exp_gmt(&xt, now); + str = fspr_palloc(p, STR_SIZE + 1); + rv = fspr_strftime(str, &sz, STR_SIZE, "%R %A %d %B %Y", &xt); if (rv == APR_ENOTIMPL) { - ABTS_NOT_IMPL(tc, "apr_strftime"); + ABTS_NOT_IMPL(tc, "fspr_strftime"); } ABTS_TRUE(tc, rv == APR_SUCCESS); ABTS_STR_EQUAL(tc, "19:05 Saturday 14 September 2002", str); @@ -213,15 +213,15 @@ static void test_strftime(abts_case *tc, void *data) static void test_strftimesmall(abts_case *tc, void *data) { - apr_status_t rv; - apr_time_exp_t xt; + fspr_status_t rv; + fspr_time_exp_t xt; char str[STR_SIZE]; - apr_size_t sz; + fspr_size_t sz; - rv = apr_time_exp_gmt(&xt, now); - rv = apr_strftime(str, &sz, STR_SIZE, "%T", &xt); + rv = fspr_time_exp_gmt(&xt, now); + rv = fspr_strftime(str, &sz, STR_SIZE, "%T", &xt); if (rv == APR_ENOTIMPL) { - ABTS_NOT_IMPL(tc, "apr_strftime"); + ABTS_NOT_IMPL(tc, "fspr_strftime"); } ABTS_TRUE(tc, rv == APR_SUCCESS); ABTS_STR_EQUAL(tc, "19:05:36", str); @@ -229,13 +229,13 @@ static void test_strftimesmall(abts_case *tc, void *data) static void test_exp_tz(abts_case *tc, void *data) { - apr_status_t rv; - apr_time_exp_t xt; - apr_int32_t hr_off = -5 * 3600; /* 5 hours in seconds */ + fspr_status_t rv; + fspr_time_exp_t xt; + fspr_int32_t hr_off = -5 * 3600; /* 5 hours in seconds */ - rv = apr_time_exp_tz(&xt, now, hr_off); + rv = fspr_time_exp_tz(&xt, now, hr_off); if (rv == APR_ENOTIMPL) { - ABTS_NOT_IMPL(tc, "apr_time_exp_tz"); + ABTS_NOT_IMPL(tc, "fspr_time_exp_tz"); } ABTS_TRUE(tc, rv == APR_SUCCESS); ABTS_TRUE(tc, (xt.tm_usec == 186711) && @@ -251,16 +251,16 @@ static void test_exp_tz(abts_case *tc, void *data) static void test_strftimeoffset(abts_case *tc, void *data) { - apr_status_t rv; - apr_time_exp_t xt; + fspr_status_t rv; + fspr_time_exp_t xt; char str[STR_SIZE]; - apr_size_t sz; - apr_int32_t hr_off = -5 * 3600; /* 5 hours in seconds */ + fspr_size_t sz; + fspr_int32_t hr_off = -5 * 3600; /* 5 hours in seconds */ - apr_time_exp_tz(&xt, now, hr_off); - rv = apr_strftime(str, &sz, STR_SIZE, "%T", &xt); + fspr_time_exp_tz(&xt, now, hr_off); + rv = fspr_strftime(str, &sz, STR_SIZE, "%T", &xt); if (rv == APR_ENOTIMPL) { - ABTS_NOT_IMPL(tc, "apr_strftime"); + ABTS_NOT_IMPL(tc, "fspr_strftime"); } ABTS_TRUE(tc, rv == APR_SUCCESS); } @@ -268,8 +268,8 @@ static void test_strftimeoffset(abts_case *tc, void *data) /* 0.9.4 and earlier rejected valid dates in 2038 */ static void test_2038(abts_case *tc, void *data) { - apr_time_exp_t xt; - apr_time_t t; + fspr_time_exp_t xt; + fspr_time_t t; /* 2038-01-19T03:14:07.000000Z */ xt.tm_year = 138; @@ -280,7 +280,7 @@ static void test_2038(abts_case *tc, void *data) xt.tm_sec = 7; APR_ASSERT_SUCCESS(tc, "explode January 19th, 2038", - apr_time_exp_get(&t, &xt)); + fspr_time_exp_get(&t, &xt)); } abts_suite *testtime(abts_suite *suite) diff --git a/libs/apr/test/testud.c b/libs/apr/test/testud.c index 77cd28faa9..22f30787cf 100644 --- a/libs/apr/test/testud.c +++ b/libs/apr/test/testud.c @@ -16,18 +16,18 @@ #include #include -#include "apr_file_io.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_strings.h" +#include "fspr_file_io.h" +#include "fspr_errno.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_strings.h" #include "testutil.h" -static apr_pool_t *pool; +static fspr_pool_t *pool; static char *testdata; static int cleanup_called = 0; -static apr_status_t string_cleanup(void *data) +static fspr_status_t string_cleanup(void *data) { cleanup_called = 1; return APR_SUCCESS; @@ -35,38 +35,38 @@ static apr_status_t string_cleanup(void *data) static void set_userdata(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; - rv = apr_pool_userdata_set(testdata, "TEST", string_cleanup, pool); + rv = fspr_pool_userdata_set(testdata, "TEST", string_cleanup, pool); ABTS_INT_EQUAL(tc, rv, APR_SUCCESS); } static void get_userdata(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; void *retdata; - rv = apr_pool_userdata_get(&retdata, "TEST", pool); + rv = fspr_pool_userdata_get(&retdata, "TEST", pool); ABTS_INT_EQUAL(tc, rv, APR_SUCCESS); ABTS_STR_EQUAL(tc, retdata, testdata); } static void get_nonexistkey(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; void *retdata; - rv = apr_pool_userdata_get(&retdata, "DOESNTEXIST", pool); + rv = fspr_pool_userdata_get(&retdata, "DOESNTEXIST", pool); ABTS_INT_EQUAL(tc, rv, APR_SUCCESS); ABTS_PTR_EQUAL(tc, retdata, NULL); } static void post_pool_clear(abts_case *tc, void *data) { - apr_status_t rv; + fspr_status_t rv; void *retdata; - rv = apr_pool_userdata_get(&retdata, "DOESNTEXIST", pool); + rv = fspr_pool_userdata_get(&retdata, "DOESNTEXIST", pool); ABTS_INT_EQUAL(tc, rv, APR_SUCCESS); ABTS_PTR_EQUAL(tc, retdata, NULL); } @@ -75,14 +75,14 @@ abts_suite *testud(abts_suite *suite) { suite = ADD_SUITE(suite) - apr_pool_create(&pool, p); - testdata = apr_pstrdup(pool, "This is a test\n"); + fspr_pool_create(&pool, p); + testdata = fspr_pstrdup(pool, "This is a test\n"); abts_run_test(suite, set_userdata, NULL); abts_run_test(suite, get_userdata, NULL); abts_run_test(suite, get_nonexistkey, NULL); - apr_pool_clear(pool); + fspr_pool_clear(pool); abts_run_test(suite, post_pool_clear, NULL); diff --git a/libs/apr/test/testuser.c b/libs/apr/test/testuser.c index 834abaf3a7..49f285b839 100644 --- a/libs/apr/test/testuser.c +++ b/libs/apr/test/testuser.c @@ -15,59 +15,59 @@ */ #include "testutil.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_user.h" +#include "fspr_errno.h" +#include "fspr_general.h" +#include "fspr_user.h" #if APR_HAS_USER static void uid_current(abts_case *tc, void *data) { - apr_uid_t uid; - apr_gid_t gid; + fspr_uid_t uid; + fspr_gid_t gid; - APR_ASSERT_SUCCESS(tc, "apr_uid_current failed", - apr_uid_current(&uid, &gid, p)); + APR_ASSERT_SUCCESS(tc, "fspr_uid_current failed", + fspr_uid_current(&uid, &gid, p)); } static void username(abts_case *tc, void *data) { - apr_uid_t uid; - apr_gid_t gid; - apr_uid_t retreived_uid; - apr_gid_t retreived_gid; + fspr_uid_t uid; + fspr_gid_t gid; + fspr_uid_t retreived_uid; + fspr_gid_t retreived_gid; char *uname = NULL; - APR_ASSERT_SUCCESS(tc, "apr_uid_current failed", - apr_uid_current(&uid, &gid, p)); + APR_ASSERT_SUCCESS(tc, "fspr_uid_current failed", + fspr_uid_current(&uid, &gid, p)); - APR_ASSERT_SUCCESS(tc, "apr_uid_name_get failed", - apr_uid_name_get(&uname, uid, p)); + APR_ASSERT_SUCCESS(tc, "fspr_uid_name_get failed", + fspr_uid_name_get(&uname, uid, p)); ABTS_PTR_NOTNULL(tc, uname); - APR_ASSERT_SUCCESS(tc, "apr_uid_get failed", - apr_uid_get(&retreived_uid, &retreived_gid, uname, p)); + APR_ASSERT_SUCCESS(tc, "fspr_uid_get failed", + fspr_uid_get(&retreived_uid, &retreived_gid, uname, p)); - APR_ASSERT_SUCCESS(tc, "apr_uid_compare failed", - apr_uid_compare(uid, retreived_uid)); + APR_ASSERT_SUCCESS(tc, "fspr_uid_compare failed", + fspr_uid_compare(uid, retreived_uid)); #ifdef WIN32 /* ### this fudge was added for Win32 but makes the test return NotImpl * on Unix if run as root, when !gid is also true. */ if (!gid || !retreived_gid) { /* The function had no way to recover the gid (this would have been - * an ENOTIMPL if apr_uid_ functions didn't try to double-up and - * also return apr_gid_t values, which was bogus. + * an ENOTIMPL if fspr_uid_ functions didn't try to double-up and + * also return fspr_gid_t values, which was bogus. */ if (!gid) { - ABTS_NOT_IMPL(tc, "Groups from apr_uid_current"); + ABTS_NOT_IMPL(tc, "Groups from fspr_uid_current"); } else { - ABTS_NOT_IMPL(tc, "Groups from apr_uid_get"); + ABTS_NOT_IMPL(tc, "Groups from fspr_uid_get"); } } else { #endif - APR_ASSERT_SUCCESS(tc, "apr_gid_compare failed", - apr_gid_compare(gid, retreived_gid)); + APR_ASSERT_SUCCESS(tc, "fspr_gid_compare failed", + fspr_gid_compare(gid, retreived_gid)); #ifdef WIN32 } #endif @@ -75,67 +75,67 @@ static void username(abts_case *tc, void *data) static void groupname(abts_case *tc, void *data) { - apr_uid_t uid; - apr_gid_t gid; - apr_gid_t retreived_gid; + fspr_uid_t uid; + fspr_gid_t gid; + fspr_gid_t retreived_gid; char *gname = NULL; - APR_ASSERT_SUCCESS(tc, "apr_uid_current failed", - apr_uid_current(&uid, &gid, p)); + APR_ASSERT_SUCCESS(tc, "fspr_uid_current failed", + fspr_uid_current(&uid, &gid, p)); - APR_ASSERT_SUCCESS(tc, "apr_gid_name_get failed", - apr_gid_name_get(&gname, gid, p)); + APR_ASSERT_SUCCESS(tc, "fspr_gid_name_get failed", + fspr_gid_name_get(&gname, gid, p)); ABTS_PTR_NOTNULL(tc, gname); - APR_ASSERT_SUCCESS(tc, "apr_gid_get failed", - apr_gid_get(&retreived_gid, gname, p)); + APR_ASSERT_SUCCESS(tc, "fspr_gid_get failed", + fspr_gid_get(&retreived_gid, gname, p)); - APR_ASSERT_SUCCESS(tc, "apr_gid_compare failed", - apr_gid_compare(gid, retreived_gid)); + APR_ASSERT_SUCCESS(tc, "fspr_gid_compare failed", + fspr_gid_compare(gid, retreived_gid)); } #ifndef WIN32 static void fail_userinfo(abts_case *tc, void *data) { - apr_uid_t uid; - apr_gid_t gid; - apr_status_t rv; + fspr_uid_t uid; + fspr_gid_t gid; + fspr_status_t rv; char *tmp; errno = 0; gid = uid = 9999999; tmp = NULL; - rv = apr_uid_name_get(&tmp, uid, p); - ABTS_ASSERT(tc, "apr_uid_name_get should fail or " + rv = fspr_uid_name_get(&tmp, uid, p); + ABTS_ASSERT(tc, "fspr_uid_name_get should fail or " "return a user name", rv != APR_SUCCESS || tmp != NULL); errno = 0; tmp = NULL; - rv = apr_gid_name_get(&tmp, gid, p); - ABTS_ASSERT(tc, "apr_gid_name_get should fail or " + rv = fspr_gid_name_get(&tmp, gid, p); + ABTS_ASSERT(tc, "fspr_gid_name_get should fail or " "return a group name", rv != APR_SUCCESS || tmp != NULL); gid = 424242; errno = 0; - rv = apr_gid_get(&gid, "I_AM_NOT_A_GROUP", p); - ABTS_ASSERT(tc, "apr_gid_get should fail or " + rv = fspr_gid_get(&gid, "I_AM_NOT_A_GROUP", p); + ABTS_ASSERT(tc, "fspr_gid_get should fail or " "set a group number", rv != APR_SUCCESS || gid == 424242); gid = uid = 424242; errno = 0; - rv = apr_uid_get(&uid, &gid, "I_AM_NOT_A_USER", p); - ABTS_ASSERT(tc, "apr_gid_get should fail or " + rv = fspr_uid_get(&uid, &gid, "I_AM_NOT_A_USER", p); + ABTS_ASSERT(tc, "fspr_gid_get should fail or " "set a user and group number", rv != APR_SUCCESS || uid == 424242 || gid == 4242442); errno = 0; tmp = NULL; - rv = apr_uid_homepath_get(&tmp, "I_AM_NOT_A_USER", p); - ABTS_ASSERT(tc, "apr_uid_homepath_get should fail or " + rv = fspr_uid_homepath_get(&tmp, "I_AM_NOT_A_USER", p); + ABTS_ASSERT(tc, "fspr_uid_homepath_get should fail or " "set a path name", rv != APR_SUCCESS || tmp != NULL); } diff --git a/libs/apr/test/testutil.c b/libs/apr/test/testutil.c index c433e92c39..2b094cc8ec 100644 --- a/libs/apr/test/testutil.c +++ b/libs/apr/test/testutil.c @@ -19,11 +19,11 @@ #include "abts.h" #include "testutil.h" -#include "apr_pools.h" +#include "fspr_pools.h" -apr_pool_t *p; +fspr_pool_t *p; -void apr_assert_success(abts_case* tc, const char* context, apr_status_t rv, +void fspr_assert_success(abts_case* tc, const char* context, fspr_status_t rv, int lineno) { if (rv == APR_ENOTIMPL) { @@ -31,14 +31,14 @@ void apr_assert_success(abts_case* tc, const char* context, apr_status_t rv, } else if (rv != APR_SUCCESS) { char buf[STRING_MAX], ebuf[128]; sprintf(buf, "%s (%d): %s\n", context, rv, - apr_strerror(rv, ebuf, sizeof ebuf)); + fspr_strerror(rv, ebuf, sizeof ebuf)); abts_fail(tc, buf, lineno); } } void initialize(void) { - apr_initialize(); - atexit(apr_terminate); + fspr_initialize(); + atexit(fspr_terminate); - apr_pool_create(&p, NULL); + fspr_pool_create(&p, NULL); } diff --git a/libs/apr/test/testutil.h b/libs/apr/test/testutil.h index 96394c5eb0..9ad9182445 100644 --- a/libs/apr/test/testutil.h +++ b/libs/apr/test/testutil.h @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "apr_pools.h" +#include "fspr_pools.h" #include "abts.h" #ifndef APR_TEST_UTIL @@ -35,14 +35,14 @@ * a bit more consistent... */ -extern apr_pool_t *p; +extern fspr_pool_t *p; /* Assert that RV is an APR_SUCCESS value; else fail giving strerror * for RV and CONTEXT message. */ -void apr_assert_success(abts_case* tc, const char *context, - apr_status_t rv, int lineno); +void fspr_assert_success(abts_case* tc, const char *context, + fspr_status_t rv, int lineno); #define APR_ASSERT_SUCCESS(tc, ctxt, rv) \ - apr_assert_success(tc, ctxt, rv, __LINE__) + fspr_assert_success(tc, ctxt, rv, __LINE__) void initialize(void); diff --git a/libs/apr/test/testvsn.c b/libs/apr/test/testvsn.c index dbc218a13f..32ffafc95e 100644 --- a/libs/apr/test/testvsn.c +++ b/libs/apr/test/testvsn.c @@ -17,13 +17,13 @@ #include #include "testutil.h" -#include "apr_version.h" -#include "apr_general.h" +#include "fspr_version.h" +#include "fspr_general.h" static void test_strings(abts_case *tc, void *data) { - ABTS_STR_EQUAL(tc, APR_VERSION_STRING, apr_version_string()); + ABTS_STR_EQUAL(tc, APR_VERSION_STRING, fspr_version_string()); } #ifdef APR_IS_DEV_VERSION @@ -34,9 +34,9 @@ static void test_strings(abts_case *tc, void *data) static void test_ints(abts_case *tc, void *data) { - apr_version_t vsn; + fspr_version_t vsn; - apr_version(&vsn); + fspr_version(&vsn); ABTS_INT_EQUAL(tc, APR_MAJOR_VERSION, vsn.major); ABTS_INT_EQUAL(tc, APR_MINOR_VERSION, vsn.minor); diff --git a/libs/apr/test/tryread.c b/libs/apr/test/tryread.c index 729f8e699b..6ff6ce0399 100644 --- a/libs/apr/test/tryread.c +++ b/libs/apr/test/tryread.c @@ -15,10 +15,10 @@ */ #include "testflock.h" -#include "apr_pools.h" -#include "apr_file_io.h" -#include "apr_general.h" -#include "apr.h" +#include "fspr_pools.h" +#include "fspr_file_io.h" +#include "fspr_general.h" +#include "fspr.h" #if APR_HAVE_STDLIB_H #include @@ -26,19 +26,19 @@ int main(int argc, const char * const *argv) { - apr_file_t *file; - apr_status_t status; - apr_pool_t *p; + fspr_file_t *file; + fspr_status_t status; + fspr_pool_t *p; - apr_initialize(); - apr_pool_create(&p, NULL); + fspr_initialize(); + fspr_pool_create(&p, NULL); - if (apr_file_open(&file, TESTFILE, APR_WRITE, APR_OS_DEFAULT, p) + if (fspr_file_open(&file, TESTFILE, APR_WRITE, APR_OS_DEFAULT, p) != APR_SUCCESS) { exit(UNEXPECTED_ERROR); } - status = apr_file_lock(file, APR_FLOCK_EXCLUSIVE | APR_FLOCK_NONBLOCK); + status = fspr_file_lock(file, APR_FLOCK_EXCLUSIVE | APR_FLOCK_NONBLOCK); if (status == APR_SUCCESS) { exit(SUCCESSFUL_READ); } diff --git a/libs/apr/threadproc/beos/apr_proc_stub.c b/libs/apr/threadproc/beos/fspr_proc_stub.c similarity index 100% rename from libs/apr/threadproc/beos/apr_proc_stub.c rename to libs/apr/threadproc/beos/fspr_proc_stub.c diff --git a/libs/apr/threadproc/beos/proc.c b/libs/apr/threadproc/beos/proc.c index 7af73036f5..fb2012e065 100644 --- a/libs/apr/threadproc/beos/proc.c +++ b/libs/apr/threadproc/beos/proc.c @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "apr_arch_threadproc.h" -#include "apr_strings.h" +#include "fspr_arch_threadproc.h" +#include "fspr_strings.h" struct send_pipe { int in; @@ -23,10 +23,10 @@ struct send_pipe { int err; }; -APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_procattr_create(fspr_procattr_t **new, fspr_pool_t *pool) { - (*new) = (apr_procattr_t *)apr_palloc(pool, - sizeof(apr_procattr_t)); + (*new) = (fspr_procattr_t *)fspr_palloc(pool, + sizeof(fspr_procattr_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -44,65 +44,65 @@ APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t * return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, - apr_int32_t out, apr_int32_t err) +APR_DECLARE(fspr_status_t) fspr_procattr_io_set(fspr_procattr_t *attr, fspr_int32_t in, + fspr_int32_t out, fspr_int32_t err) { - apr_status_t status; + fspr_status_t status; if (in != 0) { - if ((status = apr_file_pipe_create(&attr->child_in, &attr->parent_in, + if ((status = fspr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool)) != APR_SUCCESS) { return status; } switch (in) { case APR_FULL_BLOCK: - apr_file_pipe_timeout_set(attr->child_in, -1); - apr_file_pipe_timeout_set(attr->parent_in, -1); + fspr_file_pipe_timeout_set(attr->child_in, -1); + fspr_file_pipe_timeout_set(attr->parent_in, -1); break; case APR_PARENT_BLOCK: - apr_file_pipe_timeout_set(attr->child_in, -1); + fspr_file_pipe_timeout_set(attr->child_in, -1); break; case APR_CHILD_BLOCK: - apr_file_pipe_timeout_set(attr->parent_in, -1); + fspr_file_pipe_timeout_set(attr->parent_in, -1); break; default: break; } } if (out) { - if ((status = apr_file_pipe_create(&attr->parent_out, &attr->child_out, + if ((status = fspr_file_pipe_create(&attr->parent_out, &attr->child_out, attr->pool)) != APR_SUCCESS) { return status; } switch (out) { case APR_FULL_BLOCK: - apr_file_pipe_timeout_set(attr->child_out, -1); - apr_file_pipe_timeout_set(attr->parent_out, -1); + fspr_file_pipe_timeout_set(attr->child_out, -1); + fspr_file_pipe_timeout_set(attr->parent_out, -1); break; case APR_PARENT_BLOCK: - apr_file_pipe_timeout_set(attr->child_out, -1); + fspr_file_pipe_timeout_set(attr->child_out, -1); break; case APR_CHILD_BLOCK: - apr_file_pipe_timeout_set(attr->parent_out, -1); + fspr_file_pipe_timeout_set(attr->parent_out, -1); break; default: break; } } if (err) { - if ((status = apr_file_pipe_create(&attr->parent_err, &attr->child_err, + if ((status = fspr_file_pipe_create(&attr->parent_err, &attr->child_err, attr->pool)) != APR_SUCCESS) { return status; } switch (err) { case APR_FULL_BLOCK: - apr_file_pipe_timeout_set(attr->child_err, -1); - apr_file_pipe_timeout_set(attr->parent_err, -1); + fspr_file_pipe_timeout_set(attr->child_err, -1); + fspr_file_pipe_timeout_set(attr->parent_err, -1); break; case APR_PARENT_BLOCK: - apr_file_pipe_timeout_set(attr->child_err, -1); + fspr_file_pipe_timeout_set(attr->child_err, -1); break; case APR_CHILD_BLOCK: - apr_file_pipe_timeout_set(attr->parent_err, -1); + fspr_file_pipe_timeout_set(attr->parent_err, -1); break; default: break; @@ -111,17 +111,17 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, +APR_DECLARE(fspr_status_t) fspr_procattr_dir_set(fspr_procattr_t *attr, const char *dir) { char * cwd; if (dir[0] != '/') { cwd = (char*)malloc(sizeof(char) * PATH_MAX); getcwd(cwd, PATH_MAX); - attr->currdir = (char *)apr_pstrcat(attr->pool, cwd, "/", dir, NULL); + attr->currdir = (char *)fspr_pstrcat(attr->pool, cwd, "/", dir, NULL); free(cwd); } else { - attr->currdir = (char *)apr_pstrdup(attr->pool, dir); + attr->currdir = (char *)fspr_pstrdup(attr->pool, dir); } if (attr->currdir) { return APR_SUCCESS; @@ -129,20 +129,20 @@ APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, return APR_ENOMEM; } -APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, - apr_cmdtype_e cmd) +APR_DECLARE(fspr_status_t) fspr_procattr_cmdtype_set(fspr_procattr_t *attr, + fspr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach) +APR_DECLARE(fspr_status_t) fspr_procattr_detach_set(fspr_procattr_t *attr, fspr_int32_t detach) { attr->detached = detach; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_proc_fork(fspr_proc_t *proc, fspr_pool_t *pool) { int pid; @@ -195,32 +195,32 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) return APR_INPARENT; } -APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr, - apr_child_errfn_t *errfn) +APR_DECLARE(fspr_status_t) fspr_procattr_child_errfn_set(fspr_procattr_t *attr, + fspr_child_errfn_t *errfn) { /* won't ever be called on this platform, so don't save the function pointer */ return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr, - apr_int32_t chk) +APR_DECLARE(fspr_status_t) fspr_procattr_error_check_set(fspr_procattr_t *attr, + fspr_int32_t chk) { /* won't ever be used on this platform, so don't save the flag */ return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr, - apr_int32_t addrspace) +APR_DECLARE(fspr_status_t) fspr_procattr_addrspace_set(fspr_procattr_t *attr, + fspr_int32_t addrspace) { /* won't ever be used on this platform, so don't save the flag */ return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, +APR_DECLARE(fspr_status_t) fspr_proc_create(fspr_proc_t *new, const char *progname, const char * const *args, const char * const *env, - apr_procattr_t *attr, - apr_pool_t *pool) + fspr_procattr_t *attr, + fspr_pool_t *pool) { int i=0,nargs=0; char **newargs = NULL; @@ -228,7 +228,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, struct send_pipe *sp; char * dir = NULL; - sp = (struct send_pipe *)apr_palloc(pool, sizeof(struct send_pipe)); + sp = (struct send_pipe *)fspr_palloc(pool, sizeof(struct send_pipe)); new->in = attr->parent_in; new->err = attr->parent_err; @@ -243,7 +243,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, } newargs = (char**)malloc(sizeof(char *) * (i + 4)); - newargs[0] = strdup("/boot/home/config/bin/apr_proc_stub"); + newargs[0] = strdup("/boot/home/config/bin/fspr_proc_stub"); if (attr->currdir == NULL) { /* we require the directory , so use a temp. variable */ dir = malloc(sizeof(char) * PATH_MAX); @@ -278,13 +278,13 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, resume_thread(newproc); if (attr->child_in) { - apr_file_close(attr->child_in); + fspr_file_close(attr->child_in); } if (attr->child_out) { - apr_file_close(attr->child_out); + fspr_file_close(attr->child_out); } if (attr->child_err) { - apr_file_close(attr->child_err); + fspr_file_close(attr->child_err); } send_data(newproc, 0, (void*)sp, sizeof(struct send_pipe)); @@ -298,26 +298,26 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, +APR_DECLARE(fspr_status_t) fspr_proc_wait_all_procs(fspr_proc_t *proc, int *exitcode, - apr_exit_why_e *exitwhy, - apr_wait_how_e waithow, - apr_pool_t *p) + fspr_exit_why_e *exitwhy, + fspr_wait_how_e waithow, + fspr_pool_t *p) { proc->pid = -1; - return apr_proc_wait(proc, exitcode, exitwhy, waithow); + return fspr_proc_wait(proc, exitcode, exitwhy, waithow); } -APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, +APR_DECLARE(fspr_status_t) fspr_proc_wait(fspr_proc_t *proc, int *exitcode, - apr_exit_why_e *exitwhy, - apr_wait_how_e waithow) + fspr_exit_why_e *exitwhy, + fspr_wait_how_e waithow) { pid_t pstatus; int waitpid_options = WUNTRACED; int exit_int; int ignore; - apr_exit_why_e ignorewhy; + fspr_exit_why_e ignorewhy; if (exitcode == NULL) { exitcode = &ignore; @@ -354,65 +354,65 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, return errno; } -APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, - apr_file_t *parent_in) +APR_DECLARE(fspr_status_t) fspr_procattr_child_in_set(fspr_procattr_t *attr, fspr_file_t *child_in, + fspr_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) - apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool); + fspr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool); if (child_in != NULL) - apr_file_dup(&attr->child_in, child_in, attr->pool); + fspr_file_dup(&attr->child_in, child_in, attr->pool); if (parent_in != NULL) - apr_file_dup(&attr->parent_in, parent_in, attr->pool); + fspr_file_dup(&attr->parent_in, parent_in, attr->pool); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, - apr_file_t *parent_out) +APR_DECLARE(fspr_status_t) fspr_procattr_child_out_set(fspr_procattr_t *attr, fspr_file_t *child_out, + fspr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) - apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool); + fspr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool); if (child_out != NULL) - apr_file_dup(&attr->child_out, child_out, attr->pool); + fspr_file_dup(&attr->child_out, child_out, attr->pool); if (parent_out != NULL) - apr_file_dup(&attr->parent_out, parent_out, attr->pool); + fspr_file_dup(&attr->parent_out, parent_out, attr->pool); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, - apr_file_t *parent_err) +APR_DECLARE(fspr_status_t) fspr_procattr_child_err_set(fspr_procattr_t *attr, fspr_file_t *child_err, + fspr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) - apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool); + fspr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool); if (child_err != NULL) - apr_file_dup(&attr->child_err, child_err, attr->pool); + fspr_file_dup(&attr->child_err, child_err, attr->pool); if (parent_err != NULL) - apr_file_dup(&attr->parent_err, parent_err, attr->pool); + fspr_file_dup(&attr->parent_err, parent_err, attr->pool); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, +APR_DECLARE(fspr_status_t) fspr_procattr_limit_set(fspr_procattr_t *attr, fspr_int32_t what, void *limit) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, +APR_DECLARE(fspr_status_t) fspr_procattr_user_set(fspr_procattr_t *attr, const char *username, const char *password) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr, +APR_DECLARE(fspr_status_t) fspr_procattr_group_set(fspr_procattr_t *attr, const char *groupname) { return APR_ENOTIMPL; diff --git a/libs/apr/threadproc/beos/thread.c b/libs/apr/threadproc/beos/thread.c index 629c86def7..79248cc0c5 100644 --- a/libs/apr/threadproc/beos/thread.c +++ b/libs/apr/threadproc/beos/thread.c @@ -14,13 +14,13 @@ * limitations under the License. */ -#include "apr_arch_threadproc.h" -#include "apr_portable.h" +#include "fspr_arch_threadproc.h" +#include "fspr_portable.h" -APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_threadattr_create(fspr_threadattr_t **new, fspr_pool_t *pool) { - (*new) = (apr_threadattr_t *)apr_palloc(pool, - sizeof(apr_threadattr_t)); + (*new) = (fspr_threadattr_t *)fspr_palloc(pool, + sizeof(fspr_threadattr_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -32,7 +32,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) +APR_DECLARE(fspr_status_t) fspr_threadattr_detach_set(fspr_threadattr_t *attr, fspr_int32_t on) { if (on == 1){ attr->detached = 1; @@ -42,7 +42,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, apr_ return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr) +APR_DECLARE(fspr_status_t) fspr_threadattr_detach_get(fspr_threadattr_t *attr) { if (attr->detached == 1){ return APR_DETACH; @@ -50,32 +50,32 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr) return APR_NOTDETACH; } -APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr, - apr_size_t stacksize) +APR_DECLARE(fspr_status_t) fspr_threadattr_stacksize_set(fspr_threadattr_t *attr, + fspr_size_t stacksize) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr, - apr_size_t size) +APR_DECLARE(fspr_status_t) fspr_threadattr_guardsize_set(fspr_threadattr_t *attr, + fspr_size_t size) { return APR_ENOTIMPL; } static void *dummy_worker(void *opaque) { - apr_thread_t *thd = (apr_thread_t*)opaque; + fspr_thread_t *thd = (fspr_thread_t*)opaque; return thd->func(thd, thd->data); } -APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, - apr_thread_start_t func, void *data, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_thread_create(fspr_thread_t **new, fspr_threadattr_t *attr, + fspr_thread_start_t func, void *data, + fspr_pool_t *pool) { int32 temp; - apr_status_t stat; + fspr_status_t stat; - (*new) = (apr_thread_t *)apr_palloc(pool, sizeof(apr_thread_t)); + (*new) = (fspr_thread_t *)fspr_palloc(pool, sizeof(fspr_thread_t)); if ((*new) == NULL) { return APR_ENOMEM; } @@ -91,7 +91,7 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t else temp = B_NORMAL_PRIORITY; - stat = apr_pool_create(&(*new)->pool, pool); + stat = fspr_pool_create(&(*new)->pool, pool); if (stat != APR_SUCCESS) { return stat; } @@ -110,26 +110,26 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t } } -APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void) +APR_DECLARE(fspr_os_thread_t) fspr_os_thread_current(void) { return find_thread(NULL); } -int apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2) +int fspr_os_thread_equal(fspr_os_thread_t tid1, fspr_os_thread_t tid2) { return tid1 == tid2; } -APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t retval) +APR_DECLARE(fspr_status_t) fspr_thread_exit(fspr_thread_t *thd, fspr_status_t retval) { - apr_pool_destroy(thd->pool); + fspr_pool_destroy(thd->pool); thd->exitval = retval; exit_thread ((status_t)(retval)); /* This will never be reached... */ return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, apr_thread_t *thd) +APR_DECLARE(fspr_status_t) fspr_thread_join(fspr_status_t *retval, fspr_thread_t *thd) { status_t rv = 0, ret; ret = wait_for_thread(thd->td, &rv); @@ -149,7 +149,7 @@ APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, apr_thread_t *th } } -APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd) +APR_DECLARE(fspr_status_t) fspr_thread_detach(fspr_thread_t *thd) { if (suspend_thread(thd->td) == B_NO_ERROR){ return APR_SUCCESS; @@ -159,45 +159,45 @@ APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd) } } -void apr_thread_yield() +void fspr_thread_yield() { } -APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) +APR_DECLARE(fspr_status_t) fspr_thread_data_get(void **data, const char *key, fspr_thread_t *thread) { - return apr_pool_userdata_get(data, key, thread->pool); + return fspr_pool_userdata_get(data, key, thread->pool); } -APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_thread_t *thread) +APR_DECLARE(fspr_status_t) fspr_thread_data_set(void *data, const char *key, + fspr_status_t (*cleanup) (void *), + fspr_thread_t *thread) { - return apr_pool_userdata_set(data, key, cleanup, thread->pool); + return fspr_pool_userdata_set(data, key, cleanup, thread->pool); } -APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) +APR_DECLARE(fspr_status_t) fspr_os_thread_get(fspr_os_thread_t **thethd, fspr_thread_t *thd) { *thethd = &thd->td; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_thread_put(fspr_thread_t **thd, fspr_os_thread_t *thethd, + fspr_pool_t *pool) { if (pool == NULL) { return APR_ENOPOOL; } if ((*thd) == NULL) { - (*thd) = (apr_thread_t *)apr_pcalloc(pool, sizeof(apr_thread_t)); + (*thd) = (fspr_thread_t *)fspr_pcalloc(pool, sizeof(fspr_thread_t)); (*thd)->pool = pool; } (*thd)->td = *thethd; return APR_SUCCESS; } -static apr_status_t thread_once_cleanup(void *vcontrol) +static fspr_status_t thread_once_cleanup(void *vcontrol) { - apr_thread_once_t *control = (apr_thread_once_t *)vcontrol; + fspr_thread_once_t *control = (fspr_thread_once_t *)vcontrol; if (control->sem) { release_sem(control->sem); @@ -207,23 +207,23 @@ static apr_status_t thread_once_cleanup(void *vcontrol) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_thread_once_init(fspr_thread_once_t **control, + fspr_pool_t *p) { int rc; - *control = (apr_thread_once_t *)apr_pcalloc(p, sizeof(apr_thread_once_t)); + *control = (fspr_thread_once_t *)fspr_pcalloc(p, sizeof(fspr_thread_once_t)); (*control)->hit = 0; /* we haven't done it yet... */ rc = ((*control)->sem = create_sem(1, "thread_once")); if (rc < 0) return rc; - apr_pool_cleanup_register(p, control, thread_once_cleanup, apr_pool_cleanup_null); + fspr_pool_cleanup_register(p, control, thread_once_cleanup, fspr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, +APR_DECLARE(fspr_status_t) fspr_thread_once(fspr_thread_once_t *control, void (*func)(void)) { if (!control->hit) { diff --git a/libs/apr/threadproc/beos/threadpriv.c b/libs/apr/threadproc/beos/threadpriv.c index 442235f7dd..a50d62caa6 100644 --- a/libs/apr/threadproc/beos/threadpriv.c +++ b/libs/apr/threadproc/beos/threadpriv.c @@ -14,16 +14,16 @@ * limitations under the License. */ -#include "apr_arch_threadproc.h" +#include "fspr_arch_threadproc.h" static struct beos_key key_table[BEOS_MAX_DATAKEYS]; static struct beos_private_data *beos_data[BEOS_MAX_DATAKEYS]; static sem_id lock; -APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, - void (*dest)(void *), apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_threadkey_private_create(fspr_threadkey_t **key, + void (*dest)(void *), fspr_pool_t *pool) { - (*key) = (apr_threadkey_t *)apr_palloc(pool, sizeof(apr_threadkey_t)); + (*key) = (fspr_threadkey_t *)fspr_palloc(pool, sizeof(fspr_threadkey_t)); if ((*key) == NULL) { return APR_ENOMEM; } @@ -44,7 +44,7 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, return APR_ENOMEM; } -APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new, apr_threadkey_t *key) +APR_DECLARE(fspr_status_t) fspr_threadkey_private_get(void **new, fspr_threadkey_t *key) { thread_id tid; int i, index=0; @@ -76,7 +76,7 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new, apr_threadkey_t return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, apr_threadkey_t *key) +APR_DECLARE(fspr_status_t) fspr_threadkey_private_set(void *priv, fspr_threadkey_t *key) { thread_id tid; int i,index = 0, ret = 0; @@ -131,7 +131,7 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, apr_threadkey_t return APR_ENOMEM; } -APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key) +APR_DECLARE(fspr_status_t) fspr_threadkey_private_delete(fspr_threadkey_t *key) { if (key->key < BEOS_MAX_DATAKEYS){ acquire_sem(key_table[key->key].lock); @@ -146,33 +146,33 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key, - apr_threadkey_t *threadkey) +APR_DECLARE(fspr_status_t) fspr_threadkey_data_get(void **data, const char *key, + fspr_threadkey_t *threadkey) { - return apr_pool_userdata_get(data, key, threadkey->pool); + return fspr_pool_userdata_get(data, key, threadkey->pool); } -APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_threadkey_t *threadkey) +APR_DECLARE(fspr_status_t) fspr_threadkey_data_set(void *data, const char *key, + fspr_status_t (*cleanup) (void *), + fspr_threadkey_t *threadkey) { - return apr_pool_userdata_set(data, key, cleanup, threadkey->pool); + return fspr_pool_userdata_set(data, key, cleanup, threadkey->pool); } -APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key) +APR_DECLARE(fspr_status_t) fspr_os_threadkey_get(fspr_os_threadkey_t *thekey, fspr_threadkey_t *key) { *thekey = key->key; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, - apr_os_threadkey_t *thekey, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_threadkey_put(fspr_threadkey_t **key, + fspr_os_threadkey_t *thekey, fspr_pool_t *pool) { if (pool == NULL) { return APR_ENOPOOL; } if ((*key) == NULL) { - (*key) = (apr_threadkey_t *)apr_pcalloc(pool, sizeof(apr_threadkey_t)); + (*key) = (fspr_threadkey_t *)fspr_pcalloc(pool, sizeof(fspr_threadkey_t)); (*key)->pool = pool; } (*key)->key = *thekey; diff --git a/libs/apr/threadproc/netware/proc.c b/libs/apr/threadproc/netware/proc.c index 0f70776999..58fb147453 100644 --- a/libs/apr/threadproc/netware/proc.c +++ b/libs/apr/threadproc/netware/proc.c @@ -14,16 +14,16 @@ * limitations under the License. */ -#include "apr_arch_threadproc.h" -#include "apr_arch_file_io.h" -#include "apr_strings.h" -#include "apr_portable.h" +#include "fspr_arch_threadproc.h" +#include "fspr_arch_file_io.h" +#include "fspr_strings.h" +#include "fspr_portable.h" #include -apr_status_t apr_netware_proc_cleanup(void *theproc) +fspr_status_t fspr_netware_proc_cleanup(void *theproc) { - apr_proc_t *proc = theproc; + fspr_proc_t *proc = theproc; int exit_int; int waitpid_options = WUNTRACED | WNOHANG; @@ -35,9 +35,9 @@ apr_status_t apr_netware_proc_cleanup(void *theproc) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new,apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_procattr_create(fspr_procattr_t **new,fspr_pool_t *pool) { - (*new) = (apr_procattr_t *)apr_pcalloc(pool, sizeof(apr_procattr_t)); + (*new) = (fspr_procattr_t *)fspr_pcalloc(pool, sizeof(fspr_procattr_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -45,18 +45,18 @@ APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new,apr_pool_t *p (*new)->pool = pool; (*new)->cmdtype = APR_PROGRAM; /* Default to a current path since NetWare doesn't handle it very well */ - apr_filepath_get(&((*new)->currdir), APR_FILEPATH_NATIVE, pool); + fspr_filepath_get(&((*new)->currdir), APR_FILEPATH_NATIVE, pool); (*new)->detached = 1; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, - apr_int32_t out, apr_int32_t err) +APR_DECLARE(fspr_status_t) fspr_procattr_io_set(fspr_procattr_t *attr, fspr_int32_t in, + fspr_int32_t out, fspr_int32_t err) { - apr_status_t status; + fspr_status_t status; if (in != 0) { - if ((status = apr_file_pipe_create(&attr->child_in, &attr->parent_in, + if ((status = fspr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool)) != APR_SUCCESS) { return status; } @@ -64,18 +64,18 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - apr_file_pipe_timeout_set(attr->child_in, 0); + fspr_file_pipe_timeout_set(attr->child_in, 0); break; case APR_CHILD_BLOCK: - apr_file_pipe_timeout_set(attr->parent_in, 0); + fspr_file_pipe_timeout_set(attr->parent_in, 0); break; default: - apr_file_pipe_timeout_set(attr->child_in, 0); - apr_file_pipe_timeout_set(attr->parent_in, 0); + fspr_file_pipe_timeout_set(attr->child_in, 0); + fspr_file_pipe_timeout_set(attr->parent_in, 0); } } if (out) { - if ((status = apr_file_pipe_create(&attr->parent_out, &attr->child_out, + if ((status = fspr_file_pipe_create(&attr->parent_out, &attr->child_out, attr->pool)) != APR_SUCCESS) { return status; } @@ -83,18 +83,18 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - apr_file_pipe_timeout_set(attr->child_out, 0); + fspr_file_pipe_timeout_set(attr->child_out, 0); break; case APR_CHILD_BLOCK: - apr_file_pipe_timeout_set(attr->parent_out, 0); + fspr_file_pipe_timeout_set(attr->parent_out, 0); break; default: - apr_file_pipe_timeout_set(attr->child_out, 0); - apr_file_pipe_timeout_set(attr->parent_out, 0); + fspr_file_pipe_timeout_set(attr->child_out, 0); + fspr_file_pipe_timeout_set(attr->parent_out, 0); } } if (err) { - if ((status = apr_file_pipe_create(&attr->parent_err, &attr->child_err, + if ((status = fspr_file_pipe_create(&attr->parent_err, &attr->child_err, attr->pool)) != APR_SUCCESS) { return status; } @@ -102,90 +102,90 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - apr_file_pipe_timeout_set(attr->child_err, 0); + fspr_file_pipe_timeout_set(attr->child_err, 0); break; case APR_CHILD_BLOCK: - apr_file_pipe_timeout_set(attr->parent_err, 0); + fspr_file_pipe_timeout_set(attr->parent_err, 0); break; default: - apr_file_pipe_timeout_set(attr->child_err, 0); - apr_file_pipe_timeout_set(attr->parent_err, 0); + fspr_file_pipe_timeout_set(attr->child_err, 0); + fspr_file_pipe_timeout_set(attr->parent_err, 0); } } return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, - apr_file_t *parent_in) +APR_DECLARE(fspr_status_t) fspr_procattr_child_in_set(fspr_procattr_t *attr, fspr_file_t *child_in, + fspr_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) - apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool); + fspr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool); if (child_in != NULL) - apr_file_dup2(attr->child_in, child_in, attr->pool); + fspr_file_dup2(attr->child_in, child_in, attr->pool); if (parent_in != NULL) - apr_file_dup2(attr->parent_in, parent_in, attr->pool); + fspr_file_dup2(attr->parent_in, parent_in, attr->pool); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, - apr_file_t *parent_out) +APR_DECLARE(fspr_status_t) fspr_procattr_child_out_set(fspr_procattr_t *attr, fspr_file_t *child_out, + fspr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) - apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool); + fspr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool); if (child_out != NULL) - apr_file_dup2(attr->child_out, child_out, attr->pool); + fspr_file_dup2(attr->child_out, child_out, attr->pool); if (parent_out != NULL) - apr_file_dup2(attr->parent_out, parent_out, attr->pool); + fspr_file_dup2(attr->parent_out, parent_out, attr->pool); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, - apr_file_t *parent_err) +APR_DECLARE(fspr_status_t) fspr_procattr_child_err_set(fspr_procattr_t *attr, fspr_file_t *child_err, + fspr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) - apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool); + fspr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool); if (child_err != NULL) - apr_file_dup2(attr->child_err, child_err, attr->pool); + fspr_file_dup2(attr->child_err, child_err, attr->pool); if (parent_err != NULL) - apr_file_dup2(attr->parent_err, parent_err, attr->pool); + fspr_file_dup2(attr->parent_err, parent_err, attr->pool); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, +APR_DECLARE(fspr_status_t) fspr_procattr_dir_set(fspr_procattr_t *attr, const char *dir) { - return apr_filepath_merge(&attr->currdir, NULL, dir, + return fspr_filepath_merge(&attr->currdir, NULL, dir, APR_FILEPATH_NATIVE, attr->pool); } -APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, - apr_cmdtype_e cmd) +APR_DECLARE(fspr_status_t) fspr_procattr_cmdtype_set(fspr_procattr_t *attr, + fspr_cmdtype_e cmd) { /* won't ever be called on this platform, so don't save the function pointer */ return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach) +APR_DECLARE(fspr_status_t) fspr_procattr_detach_set(fspr_procattr_t *attr, fspr_int32_t detach) { attr->detached = detach; return APR_SUCCESS; } #if APR_HAS_FORK -APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_proc_fork(fspr_proc_t *proc, fspr_pool_t *pool) { int pid; @@ -207,7 +207,7 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) } #endif -static apr_status_t limit_proc(apr_procattr_t *attr) +static fspr_status_t limit_proc(fspr_procattr_t *attr) { #if APR_HAVE_STRUCT_RLIMIT && APR_HAVE_SETRLIMIT #ifdef RLIMIT_CPU @@ -252,33 +252,33 @@ static apr_status_t limit_proc(apr_procattr_t *attr) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr, - apr_child_errfn_t *errfn) +APR_DECLARE(fspr_status_t) fspr_procattr_child_errfn_set(fspr_procattr_t *attr, + fspr_child_errfn_t *errfn) { /* won't ever be called on this platform, so don't save the function pointer */ return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr, - apr_int32_t chk) +APR_DECLARE(fspr_status_t) fspr_procattr_error_check_set(fspr_procattr_t *attr, + fspr_int32_t chk) { /* won't ever be used on this platform, so don't save the flag */ return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr, - apr_int32_t addrspace) +APR_DECLARE(fspr_status_t) fspr_procattr_addrspace_set(fspr_procattr_t *attr, + fspr_int32_t addrspace) { attr->addrspace = addrspace; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc, +APR_DECLARE(fspr_status_t) fspr_proc_create(fspr_proc_t *newproc, const char *progname, const char * const *args, const char * const *env, - apr_procattr_t *attr, - apr_pool_t *pool) + fspr_procattr_t *attr, + fspr_pool_t *pool) { wiring_t wire; int addr_space; @@ -299,9 +299,9 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc, if (attr->currdir) { char *fullpath = NULL; - apr_status_t rv; + fspr_status_t rv; - if ((rv = apr_filepath_merge(&fullpath, attr->currdir, progname, + if ((rv = fspr_filepath_merge(&fullpath, attr->currdir, progname, APR_FILEPATH_NATIVE, pool)) != APR_SUCCESS) { return rv; } @@ -314,47 +314,47 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *newproc, } if (attr->child_in) { - apr_pool_cleanup_kill(apr_file_pool_get(attr->child_in), - attr->child_in, apr_unix_file_cleanup); - apr_file_close(attr->child_in); + fspr_pool_cleanup_kill(fspr_file_pool_get(attr->child_in), + attr->child_in, fspr_unix_file_cleanup); + fspr_file_close(attr->child_in); } if (attr->child_out) { - apr_pool_cleanup_kill(apr_file_pool_get(attr->child_out), - attr->child_out, apr_unix_file_cleanup); - apr_file_close(attr->child_out); + fspr_pool_cleanup_kill(fspr_file_pool_get(attr->child_out), + attr->child_out, fspr_unix_file_cleanup); + fspr_file_close(attr->child_out); } if (attr->child_err) { - apr_pool_cleanup_kill(apr_file_pool_get(attr->child_err), - attr->child_err, apr_unix_file_cleanup); - apr_file_close(attr->child_err); + fspr_pool_cleanup_kill(fspr_file_pool_get(attr->child_err), + attr->child_err, fspr_unix_file_cleanup); + fspr_file_close(attr->child_err); } - apr_pool_cleanup_register(pool, (void *)newproc, apr_netware_proc_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register(pool, (void *)newproc, fspr_netware_proc_cleanup, + fspr_pool_cleanup_null); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, +APR_DECLARE(fspr_status_t) fspr_proc_wait_all_procs(fspr_proc_t *proc, int *exitcode, - apr_exit_why_e *exitwhy, - apr_wait_how_e waithow, - apr_pool_t *p) + fspr_exit_why_e *exitwhy, + fspr_wait_how_e waithow, + fspr_pool_t *p) { proc->pid = -1; - return apr_proc_wait(proc, exitcode, exitwhy, waithow); + return fspr_proc_wait(proc, exitcode, exitwhy, waithow); } -APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, - int *exitcode, apr_exit_why_e *exitwhy, - apr_wait_how_e waithow) +APR_DECLARE(fspr_status_t) fspr_proc_wait(fspr_proc_t *proc, + int *exitcode, fspr_exit_why_e *exitwhy, + fspr_wait_how_e waithow) { pid_t pstatus; int waitpid_options = WUNTRACED; int exit_int; int ignore; - apr_exit_why_e ignorewhy; + fspr_exit_why_e ignorewhy; if (exitcode == NULL) { exitcode = &ignore; @@ -407,7 +407,7 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, return errno; } -APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, +APR_DECLARE(fspr_status_t) fspr_procattr_limit_set(fspr_procattr_t *attr, fspr_int32_t what, struct rlimit *limit) { switch(what) { @@ -436,7 +436,7 @@ APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32 return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, +APR_DECLARE(fspr_status_t) fspr_procattr_user_set(fspr_procattr_t *attr, const char *username, const char *password) { @@ -444,7 +444,7 @@ APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr, +APR_DECLARE(fspr_status_t) fspr_procattr_group_set(fspr_procattr_t *attr, const char *groupname) { /* Always return SUCCESS because NetWare threads don't run within a group */ diff --git a/libs/apr/threadproc/netware/procsup.c b/libs/apr/threadproc/netware/procsup.c index 72fa1d9764..07b67f65c8 100644 --- a/libs/apr/threadproc/netware/procsup.c +++ b/libs/apr/threadproc/netware/procsup.c @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "apr_arch_threadproc.h" +#include "fspr_arch_threadproc.h" -apr_status_t apr_proc_detach(int daemonize) +fspr_status_t fspr_proc_detach(int daemonize) { #if 0 int x; diff --git a/libs/apr/threadproc/netware/signals.c b/libs/apr/threadproc/netware/signals.c index bc660af7dc..a50519a0e6 100644 --- a/libs/apr/threadproc/netware/signals.c +++ b/libs/apr/threadproc/netware/signals.c @@ -14,29 +14,29 @@ * limitations under the License. */ -#include "apr_arch_threadproc.h" +#include "fspr_arch_threadproc.h" #include -#include "apr_private.h" -#include "apr_pools.h" -#include "apr_signal.h" -#include "apr_strings.h" +#include "fspr_private.h" +#include "fspr_pools.h" +#include "fspr_signal.h" +#include "fspr_strings.h" #include #if APR_HAS_THREADS && APR_HAVE_PTHREAD_H #include #endif -APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int signum) +APR_DECLARE(fspr_status_t) fspr_proc_kill(fspr_proc_t *proc, int signum) { return APR_ENOTIMPL; } -void apr_signal_init(apr_pool_t *pglobal) +void fspr_signal_init(fspr_pool_t *pglobal) { } -const char *apr_signal_description_get(int signum) +const char *fspr_signal_description_get(int signum) { switch (signum) { @@ -64,19 +64,19 @@ static void *signal_thread_func(void *signal_handler) return NULL; } -APR_DECLARE(apr_status_t) apr_setup_signal_thread(void) +APR_DECLARE(fspr_status_t) fspr_setup_signal_thread(void) { int rv = 0; return rv; } -APR_DECLARE(apr_status_t) apr_signal_block(int signum) +APR_DECLARE(fspr_status_t) fspr_signal_block(int signum) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_signal_unblock(int signum) +APR_DECLARE(fspr_status_t) fspr_signal_unblock(int signum) { return APR_ENOTIMPL; } diff --git a/libs/apr/threadproc/netware/thread.c b/libs/apr/threadproc/netware/thread.c index dcf4993db9..6bcddac2c2 100644 --- a/libs/apr/threadproc/netware/thread.c +++ b/libs/apr/threadproc/netware/thread.c @@ -14,18 +14,18 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_portable.h" -#include "apr_strings.h" -#include "apr_arch_threadproc.h" +#include "fspr.h" +#include "fspr_portable.h" +#include "fspr_strings.h" +#include "fspr_arch_threadproc.h" static int thread_count = 0; -apr_status_t apr_threadattr_create(apr_threadattr_t **new, - apr_pool_t *pool) +fspr_status_t fspr_threadattr_create(fspr_threadattr_t **new, + fspr_pool_t *pool) { - (*new) = (apr_threadattr_t *)apr_palloc(pool, - sizeof(apr_threadattr_t)); + (*new) = (fspr_threadattr_t *)fspr_palloc(pool, + sizeof(fspr_threadattr_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -38,45 +38,45 @@ apr_status_t apr_threadattr_create(apr_threadattr_t **new, return APR_SUCCESS; } -apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr,apr_int32_t on) +fspr_status_t fspr_threadattr_detach_set(fspr_threadattr_t *attr,fspr_int32_t on) { attr->detach = on; return APR_SUCCESS; } -apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr) +fspr_status_t fspr_threadattr_detach_get(fspr_threadattr_t *attr) { if (attr->detach == 1) return APR_DETACH; return APR_NOTDETACH; } -APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr, - apr_size_t stacksize) +APR_DECLARE(fspr_status_t) fspr_threadattr_stacksize_set(fspr_threadattr_t *attr, + fspr_size_t stacksize) { attr->stack_size = stacksize; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr, - apr_size_t size) +APR_DECLARE(fspr_status_t) fspr_threadattr_guardsize_set(fspr_threadattr_t *attr, + fspr_size_t size) { return APR_ENOTIMPL; } static void *dummy_worker(void *opaque) { - apr_thread_t *thd = (apr_thread_t *)opaque; + fspr_thread_t *thd = (fspr_thread_t *)opaque; return thd->func(thd, thd->data); } -apr_status_t apr_thread_create(apr_thread_t **new, - apr_threadattr_t *attr, - apr_thread_start_t func, +fspr_status_t fspr_thread_create(fspr_thread_t **new, + fspr_threadattr_t *attr, + fspr_thread_start_t func, void *data, - apr_pool_t *pool) + fspr_pool_t *pool) { - apr_status_t stat; + fspr_status_t stat; long flags = NX_THR_BIND_CONTEXT; char threadName[NX_MAX_OBJECT_NAME_LEN+1]; size_t stack_size = APR_DEFAULT_STACK_SIZE; @@ -97,7 +97,7 @@ apr_status_t apr_thread_create(apr_thread_t **new, stack_size = attr->stack_size; } - (*new) = (apr_thread_t *)apr_palloc(pool, sizeof(apr_thread_t)); + (*new) = (fspr_thread_t *)fspr_palloc(pool, sizeof(fspr_thread_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -106,9 +106,9 @@ apr_status_t apr_thread_create(apr_thread_t **new, (*new)->pool = pool; (*new)->data = data; (*new)->func = func; - (*new)->thread_name = (char*)apr_pstrdup(pool, threadName); + (*new)->thread_name = (char*)fspr_pstrdup(pool, threadName); - stat = apr_pool_create(&(*new)->pool, pool); + stat = fspr_pool_create(&(*new)->pool, pool); if (stat != APR_SUCCESS) { return stat; } @@ -141,34 +141,34 @@ apr_status_t apr_thread_create(apr_thread_t **new, return(stat);// if error } -apr_os_thread_t apr_os_thread_current() +fspr_os_thread_t fspr_os_thread_current() { return NXThreadGetId(); } -int apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2) +int fspr_os_thread_equal(fspr_os_thread_t tid1, fspr_os_thread_t tid2) { return (tid1 == tid2); } -void apr_thread_yield() +void fspr_thread_yield() { NXThreadYield(); } -apr_status_t apr_thread_exit(apr_thread_t *thd, - apr_status_t retval) +fspr_status_t fspr_thread_exit(fspr_thread_t *thd, + fspr_status_t retval) { thd->exitval = retval; - apr_pool_destroy(thd->pool); + fspr_pool_destroy(thd->pool); NXThreadExit(NULL); return APR_SUCCESS; } -apr_status_t apr_thread_join(apr_status_t *retval, - apr_thread_t *thd) +fspr_status_t fspr_thread_join(fspr_status_t *retval, + fspr_thread_t *thd) { - apr_status_t stat; + fspr_status_t stat; NXThreadId_t dthr; if ((stat = NXThreadJoin(thd->td, &dthr, NULL)) == 0) { @@ -180,16 +180,16 @@ apr_status_t apr_thread_join(apr_status_t *retval, } } -apr_status_t apr_thread_detach(apr_thread_t *thd) +fspr_status_t fspr_thread_detach(fspr_thread_t *thd) { return APR_SUCCESS; } -apr_status_t apr_thread_data_get(void **data, const char *key, - apr_thread_t *thread) +fspr_status_t fspr_thread_data_get(void **data, const char *key, + fspr_thread_t *thread) { if (thread != NULL) { - return apr_pool_userdata_get(data, key, thread->pool); + return fspr_pool_userdata_get(data, key, thread->pool); } else { data = NULL; @@ -197,12 +197,12 @@ apr_status_t apr_thread_data_get(void **data, const char *key, } } -apr_status_t apr_thread_data_set(void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_thread_t *thread) +fspr_status_t fspr_thread_data_set(void *data, const char *key, + fspr_status_t (*cleanup) (void *), + fspr_thread_t *thread) { if (thread != NULL) { - return apr_pool_userdata_set(data, key, cleanup, thread->pool); + return fspr_pool_userdata_set(data, key, cleanup, thread->pool); } else { data = NULL; @@ -210,8 +210,8 @@ apr_status_t apr_thread_data_set(void *data, const char *key, } } -APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, - apr_thread_t *thd) +APR_DECLARE(fspr_status_t) fspr_os_thread_get(fspr_os_thread_t **thethd, + fspr_thread_t *thd) { if (thd == NULL) { return APR_ENOTHREAD; @@ -220,29 +220,29 @@ APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, - apr_os_thread_t *thethd, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_thread_put(fspr_thread_t **thd, + fspr_os_thread_t *thethd, + fspr_pool_t *pool) { if (pool == NULL) { return APR_ENOPOOL; } if ((*thd) == NULL) { - (*thd) = (apr_thread_t *)apr_palloc(pool, sizeof(apr_thread_t)); + (*thd) = (fspr_thread_t *)fspr_palloc(pool, sizeof(fspr_thread_t)); (*thd)->pool = pool; } (*thd)->td = *thethd; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_thread_once_init(fspr_thread_once_t **control, + fspr_pool_t *p) { - (*control) = apr_pcalloc(p, sizeof(**control)); + (*control) = fspr_pcalloc(p, sizeof(**control)); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, +APR_DECLARE(fspr_status_t) fspr_thread_once(fspr_thread_once_t *control, void (*func)(void)) { if (!atomic_xchg(&control->value, 1)) { diff --git a/libs/apr/threadproc/netware/threadpriv.c b/libs/apr/threadproc/netware/threadpriv.c index 54680a5634..3813fdfc38 100644 --- a/libs/apr/threadproc/netware/threadpriv.c +++ b/libs/apr/threadproc/netware/threadpriv.c @@ -14,15 +14,15 @@ * limitations under the License. */ -#include "apr_portable.h" -#include "apr_arch_threadproc.h" +#include "fspr_portable.h" +#include "fspr_arch_threadproc.h" -apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, - void (*dest)(void *), apr_pool_t *pool) +fspr_status_t fspr_threadkey_private_create(fspr_threadkey_t **key, + void (*dest)(void *), fspr_pool_t *pool) { - apr_status_t stat; + fspr_status_t stat; - (*key) = (apr_threadkey_t *)apr_palloc(pool, sizeof(apr_threadkey_t)); + (*key) = (fspr_threadkey_t *)fspr_palloc(pool, sizeof(fspr_threadkey_t)); if ((*key) == NULL) { return APR_ENOMEM; } @@ -35,9 +35,9 @@ apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, return stat; } -apr_status_t apr_threadkey_private_get(void **new, apr_threadkey_t *key) +fspr_status_t fspr_threadkey_private_get(void **new, fspr_threadkey_t *key) { - apr_status_t stat; + fspr_status_t stat; if ((stat = NXKeyGetValue(key->key, new)) == 0) { return APR_SUCCESS; @@ -47,9 +47,9 @@ apr_status_t apr_threadkey_private_get(void **new, apr_threadkey_t *key) } } -apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key) +fspr_status_t fspr_threadkey_private_set(void *priv, fspr_threadkey_t *key) { - apr_status_t stat; + fspr_status_t stat; if ((stat = NXKeySetValue(key->key, priv)) == 0) { return APR_SUCCESS; } @@ -58,42 +58,42 @@ apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key) } } -apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key) +fspr_status_t fspr_threadkey_private_delete(fspr_threadkey_t *key) { - apr_status_t stat; + fspr_status_t stat; if ((stat = NXKeyDelete(key->key)) == 0) { return APR_SUCCESS; } return stat; } -apr_status_t apr_threadkey_data_get(void **data, const char *key, apr_threadkey_t *threadkey) +fspr_status_t fspr_threadkey_data_get(void **data, const char *key, fspr_threadkey_t *threadkey) { - return apr_pool_userdata_get(data, key, threadkey->pool); + return fspr_pool_userdata_get(data, key, threadkey->pool); } -apr_status_t apr_threadkey_data_set(void *data, - const char *key, apr_status_t (*cleanup) (void *), - apr_threadkey_t *threadkey) +fspr_status_t fspr_threadkey_data_set(void *data, + const char *key, fspr_status_t (*cleanup) (void *), + fspr_threadkey_t *threadkey) { - return apr_pool_userdata_set(data, key, cleanup, threadkey->pool); + return fspr_pool_userdata_set(data, key, cleanup, threadkey->pool); } -apr_status_t apr_os_threadkey_get(apr_os_threadkey_t *thekey, - apr_threadkey_t *key) +fspr_status_t fspr_os_threadkey_get(fspr_os_threadkey_t *thekey, + fspr_threadkey_t *key) { thekey = &(key->key); return APR_SUCCESS; } -apr_status_t apr_os_threadkey_put(apr_threadkey_t **key, - apr_os_threadkey_t *thekey, apr_pool_t *pool) +fspr_status_t fspr_os_threadkey_put(fspr_threadkey_t **key, + fspr_os_threadkey_t *thekey, fspr_pool_t *pool) { if (pool == NULL) { return APR_ENOPOOL; } if ((*key) == NULL) { - (*key) = (apr_threadkey_t *)apr_palloc(pool, sizeof(apr_threadkey_t)); + (*key) = (fspr_threadkey_t *)fspr_palloc(pool, sizeof(fspr_threadkey_t)); (*key)->pool = pool; } (*key)->key = *thekey; diff --git a/libs/apr/threadproc/os2/proc.c b/libs/apr/threadproc/os2/proc.c index 20dfffb8b8..8448a33bc5 100644 --- a/libs/apr/threadproc/os2/proc.c +++ b/libs/apr/threadproc/os2/proc.c @@ -17,16 +17,16 @@ #define INCL_DOS #define INCL_DOSERRORS -#include "apr_arch_threadproc.h" -#include "apr_arch_file_io.h" -#include "apr_private.h" -#include "apr_thread_proc.h" -#include "apr_file_io.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_portable.h" -#include "apr_strings.h" -#include "apr_signal.h" +#include "fspr_arch_threadproc.h" +#include "fspr_arch_file_io.h" +#include "fspr_private.h" +#include "fspr_thread_proc.h" +#include "fspr_file_io.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_portable.h" +#include "fspr_strings.h" +#include "fspr_signal.h" #include #include #include @@ -34,10 +34,10 @@ #include #include -APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_procattr_create(fspr_procattr_t **new, fspr_pool_t *pool) { - (*new) = (apr_procattr_t *)apr_palloc(pool, - sizeof(apr_procattr_t)); + (*new) = (fspr_procattr_t *)fspr_palloc(pool, + sizeof(fspr_procattr_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -55,12 +55,12 @@ APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t * return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, - apr_int32_t out, apr_int32_t err) +APR_DECLARE(fspr_status_t) fspr_procattr_io_set(fspr_procattr_t *attr, fspr_int32_t in, + fspr_int32_t out, fspr_int32_t err) { - apr_status_t stat; + fspr_status_t stat; if (in) { - if ((stat = apr_file_pipe_create(&attr->child_in, &attr->parent_in, + if ((stat = fspr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool)) != APR_SUCCESS) { return stat; } @@ -68,18 +68,18 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - apr_file_pipe_timeout_set(attr->child_in, 0); + fspr_file_pipe_timeout_set(attr->child_in, 0); break; case APR_CHILD_BLOCK: - apr_file_pipe_timeout_set(attr->parent_in, 0); + fspr_file_pipe_timeout_set(attr->parent_in, 0); break; default: - apr_file_pipe_timeout_set(attr->child_in, 0); - apr_file_pipe_timeout_set(attr->parent_in, 0); + fspr_file_pipe_timeout_set(attr->child_in, 0); + fspr_file_pipe_timeout_set(attr->parent_in, 0); } } if (out) { - if ((stat = apr_file_pipe_create(&attr->parent_out, &attr->child_out, + if ((stat = fspr_file_pipe_create(&attr->parent_out, &attr->child_out, attr->pool)) != APR_SUCCESS) { return stat; } @@ -87,18 +87,18 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - apr_file_pipe_timeout_set(attr->child_out, 0); + fspr_file_pipe_timeout_set(attr->child_out, 0); break; case APR_CHILD_BLOCK: - apr_file_pipe_timeout_set(attr->parent_out, 0); + fspr_file_pipe_timeout_set(attr->parent_out, 0); break; default: - apr_file_pipe_timeout_set(attr->child_out, 0); - apr_file_pipe_timeout_set(attr->parent_out, 0); + fspr_file_pipe_timeout_set(attr->child_out, 0); + fspr_file_pipe_timeout_set(attr->parent_out, 0); } } if (err) { - if ((stat = apr_file_pipe_create(&attr->parent_err, &attr->child_err, + if ((stat = fspr_file_pipe_create(&attr->parent_err, &attr->child_err, attr->pool)) != APR_SUCCESS) { return stat; } @@ -106,90 +106,90 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - apr_file_pipe_timeout_set(attr->child_err, 0); + fspr_file_pipe_timeout_set(attr->child_err, 0); break; case APR_CHILD_BLOCK: - apr_file_pipe_timeout_set(attr->parent_err, 0); + fspr_file_pipe_timeout_set(attr->parent_err, 0); break; default: - apr_file_pipe_timeout_set(attr->child_err, 0); - apr_file_pipe_timeout_set(attr->parent_err, 0); + fspr_file_pipe_timeout_set(attr->child_err, 0); + fspr_file_pipe_timeout_set(attr->parent_err, 0); } } return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, - apr_file_t *parent_in) +APR_DECLARE(fspr_status_t) fspr_procattr_child_in_set(fspr_procattr_t *attr, fspr_file_t *child_in, + fspr_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) - apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool); + fspr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool); if (child_in != NULL) - apr_file_dup(&attr->child_in, child_in, attr->pool); + fspr_file_dup(&attr->child_in, child_in, attr->pool); if (parent_in != NULL) - apr_file_dup(&attr->parent_in, parent_in, attr->pool); + fspr_file_dup(&attr->parent_in, parent_in, attr->pool); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, - apr_file_t *parent_out) +APR_DECLARE(fspr_status_t) fspr_procattr_child_out_set(fspr_procattr_t *attr, fspr_file_t *child_out, + fspr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) - apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool); + fspr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool); if (child_out != NULL) - apr_file_dup(&attr->child_out, child_out, attr->pool); + fspr_file_dup(&attr->child_out, child_out, attr->pool); if (parent_out != NULL) - apr_file_dup(&attr->parent_out, parent_out, attr->pool); + fspr_file_dup(&attr->parent_out, parent_out, attr->pool); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, - apr_file_t *parent_err) +APR_DECLARE(fspr_status_t) fspr_procattr_child_err_set(fspr_procattr_t *attr, fspr_file_t *child_err, + fspr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) - apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool); + fspr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool); if (child_err != NULL) - apr_file_dup(&attr->child_err, child_err, attr->pool); + fspr_file_dup(&attr->child_err, child_err, attr->pool); if (parent_err != NULL) - apr_file_dup(&attr->parent_err, parent_err, attr->pool); + fspr_file_dup(&attr->parent_err, parent_err, attr->pool); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, const char *dir) +APR_DECLARE(fspr_status_t) fspr_procattr_dir_set(fspr_procattr_t *attr, const char *dir) { - attr->currdir = apr_pstrdup(attr->pool, dir); + attr->currdir = fspr_pstrdup(attr->pool, dir); if (attr->currdir) { return APR_SUCCESS; } return APR_ENOMEM; } -APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, - apr_cmdtype_e cmd) +APR_DECLARE(fspr_status_t) fspr_procattr_cmdtype_set(fspr_procattr_t *attr, + fspr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach) +APR_DECLARE(fspr_status_t) fspr_procattr_detach_set(fspr_procattr_t *attr, fspr_int32_t detach) { attr->detached = detach; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_proc_fork(fspr_proc_t *proc, fspr_pool_t *pool) { int pid; @@ -215,7 +215,7 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) /* quotes in the string are doubled up. * Used to escape quotes in args passed to OS/2's cmd.exe */ -static char *double_quotes(apr_pool_t *pool, const char *str) +static char *double_quotes(fspr_pool_t *pool, const char *str) { int num_quotes = 0; int len = 0; @@ -225,7 +225,7 @@ static char *double_quotes(apr_pool_t *pool, const char *str) num_quotes += str[len++] == '\"'; } - quote_doubled_str = apr_palloc(pool, len + num_quotes + 1); + quote_doubled_str = fspr_palloc(pool, len + num_quotes + 1); dest = quote_doubled_str; while (*str) { @@ -240,8 +240,8 @@ static char *double_quotes(apr_pool_t *pool, const char *str) -APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr, - apr_child_errfn_t *errfn) +APR_DECLARE(fspr_status_t) fspr_procattr_child_errfn_set(fspr_procattr_t *attr, + fspr_child_errfn_t *errfn) { /* won't ever be called on this platform, so don't save the function pointer */ return APR_SUCCESS; @@ -249,15 +249,15 @@ APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr, -APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr, - apr_int32_t chk) +APR_DECLARE(fspr_status_t) fspr_procattr_error_check_set(fspr_procattr_t *attr, + fspr_int32_t chk) { /* won't ever be used on this platform, so don't save the flag */ return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr, - apr_int32_t addrspace) +APR_DECLARE(fspr_status_t) fspr_procattr_addrspace_set(fspr_procattr_t *attr, + fspr_int32_t addrspace) { /* won't ever be used on this platform, so don't save the flag */ return APR_SUCCESS; @@ -265,13 +265,13 @@ APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr, -APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname, +APR_DECLARE(fspr_status_t) fspr_proc_create(fspr_proc_t *proc, const char *progname, const char * const *args, const char * const *env, - apr_procattr_t *attr, apr_pool_t *pool) + fspr_procattr_t *attr, fspr_pool_t *pool) { int i, arg, numargs, cmdlen; - apr_status_t status; + fspr_status_t status; const char **newargs; char savedir[300]; HFILE save_in, save_out, save_err, dup; @@ -279,7 +279,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname char *extension, *newprogname, *extra_arg = NULL, *cmdline, *cmdline_pos; char interpreter[1024]; char error_object[260]; - apr_file_t *progfile; + fspr_file_t *progfile; int env_len, e; char *env_block, *env_block_pos; RESULTCODES rescodes; @@ -314,7 +314,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname DosSetFHState(attr->parent_err->filedes, OPEN_FLAGS_NOINHERIT); } - apr_signal(SIGCHLD, SIG_DFL); /*not sure if this is needed or not */ + fspr_signal(SIGCHLD, SIG_DFL); /*not sure if this is needed or not */ if (attr->currdir != NULL) { _getcwd2(savedir, sizeof(savedir)); @@ -340,21 +340,21 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname strcpy(interpreter, "#!" SHELL_PATH); extra_arg = "/C"; } else if (stricmp(extension, ".exe") != 0) { - status = apr_file_open(&progfile, progname, APR_READ|APR_BUFFERED, 0, pool); + status = fspr_file_open(&progfile, progname, APR_READ|APR_BUFFERED, 0, pool); if (status != APR_SUCCESS && APR_STATUS_IS_ENOENT(status)) { - progname = apr_pstrcat(pool, progname, ".exe", NULL); + progname = fspr_pstrcat(pool, progname, ".exe", NULL); } if (status == APR_SUCCESS) { - status = apr_file_gets(interpreter, sizeof(interpreter), progfile); + status = fspr_file_gets(interpreter, sizeof(interpreter), progfile); if (status == APR_SUCCESS) { if (interpreter[0] == '#' && interpreter[1] == '!') { /* delete CR/LF & any other whitespace off the end */ int end = strlen(interpreter) - 1; - while (end >= 0 && apr_isspace(interpreter[end])) { + while (end >= 0 && fspr_isspace(interpreter[end])) { interpreter[end] = '\0'; end--; } @@ -376,7 +376,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname } } - apr_file_close(progfile); + fspr_file_close(progfile); } } @@ -386,7 +386,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname i++; } - newargs = (const char **)apr_palloc(pool, sizeof (char *) * (i + 4)); + newargs = (const char **)fspr_palloc(pool, sizeof (char *) * (i + 4)); numargs = 0; if (interpreter[0]) @@ -394,7 +394,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname if (extra_arg) newargs[numargs++] = "/c"; - newargs[numargs++] = newprogname = apr_pstrdup(pool, progname); + newargs[numargs++] = newprogname = fspr_pstrdup(pool, progname); arg = 1; while (args && args[arg]) { @@ -412,14 +412,14 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname for (i=0; i\" ")) - a = apr_pstrcat(pool, "\"", double_quotes(pool, a), "\"", NULL); + a = fspr_pstrcat(pool, "\"", double_quotes(pool, a), "\"", NULL); if (i) *(cmdline_pos++) = ' '; @@ -441,7 +441,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname for (env_len=1, e=0; env[e]; e++) env_len += strlen(env[e]) + 1; - env_block = apr_palloc(pool, env_len); + env_block = fspr_palloc(pool, env_len); env_block_pos = env_block; for (e=0; env[e]; e++) { @@ -464,21 +464,21 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname } if (attr->child_in) { - apr_file_close(attr->child_in); + fspr_file_close(attr->child_in); dup = STDIN_FILENO; DosDupHandle(save_in, &dup); DosClose(save_in); } if (attr->child_out) { - apr_file_close(attr->child_out); + fspr_file_close(attr->child_out); dup = STDOUT_FILENO; DosDupHandle(save_out, &dup); DosClose(save_out); } if (attr->child_err) { - apr_file_close(attr->child_err); + fspr_file_close(attr->child_err); dup = STDERR_FILENO; DosDupHandle(save_err, &dup); DosClose(save_err); @@ -497,10 +497,10 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname static void proces_result_codes(RESULTCODES codes, int *exitcode, - apr_exit_why_e *exitwhy) + fspr_exit_why_e *exitwhy) { int result = 0; - apr_exit_why_e why = APR_PROC_EXIT; + fspr_exit_why_e why = APR_PROC_EXIT; switch (codes.codeTerminate) { case TC_EXIT: /* Normal exit */ @@ -553,11 +553,11 @@ static void proces_result_codes(RESULTCODES codes, -APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, +APR_DECLARE(fspr_status_t) fspr_proc_wait_all_procs(fspr_proc_t *proc, int *exitcode, - apr_exit_why_e *exitwhy, - apr_wait_how_e waithow, - apr_pool_t *p) + fspr_exit_why_e *exitwhy, + fspr_wait_how_e waithow, + fspr_pool_t *p) { RESULTCODES codes; ULONG rc; @@ -578,9 +578,9 @@ APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, -APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, - int *exitcode, apr_exit_why_e *exitwhy, - apr_wait_how_e waithow) +APR_DECLARE(fspr_status_t) fspr_proc_wait(fspr_proc_t *proc, + int *exitcode, fspr_exit_why_e *exitwhy, + fspr_wait_how_e waithow) { RESULTCODES codes; ULONG rc; @@ -599,19 +599,19 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, -APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize) +APR_DECLARE(fspr_status_t) fspr_proc_detach(int daemonize) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, +APR_DECLARE(fspr_status_t) fspr_procattr_user_set(fspr_procattr_t *attr, const char *username, const char *password) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr, +APR_DECLARE(fspr_status_t) fspr_procattr_group_set(fspr_procattr_t *attr, const char *groupname) { return APR_ENOTIMPL; diff --git a/libs/apr/threadproc/os2/thread.c b/libs/apr/threadproc/os2/thread.c index c1c35219d0..bed45d3ffd 100644 --- a/libs/apr/threadproc/os2/thread.c +++ b/libs/apr/threadproc/os2/thread.c @@ -16,17 +16,17 @@ #define INCL_DOSERRORS #define INCL_DOS -#include "apr_arch_threadproc.h" -#include "apr_thread_proc.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_portable.h" -#include "apr_arch_file_io.h" +#include "fspr_arch_threadproc.h" +#include "fspr_thread_proc.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_portable.h" +#include "fspr_arch_file_io.h" #include -APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_threadattr_create(fspr_threadattr_t **new, fspr_pool_t *pool) { - (*new) = (apr_threadattr_t *)apr_palloc(pool, sizeof(apr_threadattr_t)); + (*new) = (fspr_threadattr_t *)fspr_palloc(pool, sizeof(fspr_threadattr_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -40,7 +40,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool -APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) +APR_DECLARE(fspr_status_t) fspr_threadattr_detach_set(fspr_threadattr_t *attr, fspr_int32_t on) { attr->attr |= APR_THREADATTR_DETACHED; return APR_SUCCESS; @@ -48,40 +48,40 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, apr_ -APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr) +APR_DECLARE(fspr_status_t) fspr_threadattr_detach_get(fspr_threadattr_t *attr) { return (attr->attr & APR_THREADATTR_DETACHED) ? APR_DETACH : APR_NOTDETACH; } -APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr, - apr_size_t stacksize) +APR_DECLARE(fspr_status_t) fspr_threadattr_stacksize_set(fspr_threadattr_t *attr, + fspr_size_t stacksize) { attr->stacksize = stacksize; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr, - apr_size_t size) +APR_DECLARE(fspr_status_t) fspr_threadattr_guardsize_set(fspr_threadattr_t *attr, + fspr_size_t size) { return APR_ENOTIMPL; } -static void apr_thread_begin(void *arg) +static void fspr_thread_begin(void *arg) { - apr_thread_t *thread = (apr_thread_t *)arg; + fspr_thread_t *thread = (fspr_thread_t *)arg; thread->exitval = thread->func(thread, thread->data); } -APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, - apr_thread_start_t func, void *data, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_thread_create(fspr_thread_t **new, fspr_threadattr_t *attr, + fspr_thread_start_t func, void *data, + fspr_pool_t *pool) { - apr_status_t stat; - apr_thread_t *thread; + fspr_status_t stat; + fspr_thread_t *thread; - thread = (apr_thread_t *)apr_palloc(pool, sizeof(apr_thread_t)); + thread = (fspr_thread_t *)fspr_palloc(pool, sizeof(fspr_thread_t)); *new = thread; if (thread == NULL) { @@ -92,21 +92,21 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t thread->attr = attr; thread->func = func; thread->data = data; - stat = apr_pool_create(&thread->pool, pool); + stat = fspr_pool_create(&thread->pool, pool); if (stat != APR_SUCCESS) { return stat; } if (attr == NULL) { - stat = apr_threadattr_create(&thread->attr, thread->pool); + stat = fspr_threadattr_create(&thread->attr, thread->pool); if (stat != APR_SUCCESS) { return stat; } } - thread->tid = _beginthread(apr_thread_begin, NULL, + thread->tid = _beginthread(fspr_thread_begin, NULL, thread->attr->stacksize > 0 ? thread->attr->stacksize : APR_THREAD_STACKSIZE, thread); @@ -120,7 +120,7 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t -APR_DECLARE(apr_os_thread_t) apr_os_thread_current() +APR_DECLARE(fspr_os_thread_t) fspr_os_thread_current() { PIB *ppib; TIB *ptib; @@ -130,7 +130,7 @@ APR_DECLARE(apr_os_thread_t) apr_os_thread_current() -APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t retval) +APR_DECLARE(fspr_status_t) fspr_thread_exit(fspr_thread_t *thd, fspr_status_t retval) { thd->exitval = retval; _endthread(); @@ -139,7 +139,7 @@ APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t retval -APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, apr_thread_t *thd) +APR_DECLARE(fspr_status_t) fspr_thread_join(fspr_status_t *retval, fspr_thread_t *thd) { ULONG rc; TID waittid = thd->tid; @@ -158,7 +158,7 @@ APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, apr_thread_t *th -APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd) +APR_DECLARE(fspr_status_t) fspr_thread_detach(fspr_thread_t *thd) { thd->attr->attr |= APR_THREADATTR_DETACHED; return APR_SUCCESS; @@ -166,14 +166,14 @@ APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd) -void apr_thread_yield() +void fspr_thread_yield() { DosSleep(0); } -APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) +APR_DECLARE(fspr_status_t) fspr_os_thread_get(fspr_os_thread_t **thethd, fspr_thread_t *thd) { *thethd = &thd->tid; return APR_SUCCESS; @@ -181,11 +181,11 @@ APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, apr_thread -APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_thread_put(fspr_thread_t **thd, fspr_os_thread_t *thethd, + fspr_pool_t *pool) { if ((*thd) == NULL) { - (*thd) = (apr_thread_t *)apr_pcalloc(pool, sizeof(apr_thread_t)); + (*thd) = (fspr_thread_t *)fspr_pcalloc(pool, sizeof(fspr_thread_t)); (*thd)->pool = pool; } (*thd)->tid = *thethd; @@ -194,34 +194,34 @@ APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t -int apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2) +int fspr_os_thread_equal(fspr_os_thread_t tid1, fspr_os_thread_t tid2) { return tid1 == tid2; } -APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) +APR_DECLARE(fspr_status_t) fspr_thread_data_get(void **data, const char *key, fspr_thread_t *thread) { - return apr_pool_userdata_get(data, key, thread->pool); + return fspr_pool_userdata_get(data, key, thread->pool); } -APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_thread_t *thread) +APR_DECLARE(fspr_status_t) fspr_thread_data_set(void *data, const char *key, + fspr_status_t (*cleanup) (void *), + fspr_thread_t *thread) { - return apr_pool_userdata_set(data, key, cleanup, thread->pool); + return fspr_pool_userdata_set(data, key, cleanup, thread->pool); } APR_POOL_IMPLEMENT_ACCESSOR(thread) -static apr_status_t thread_once_cleanup(void *vcontrol) +static fspr_status_t thread_once_cleanup(void *vcontrol) { - apr_thread_once_t *control = (apr_thread_once_t *)vcontrol; + fspr_thread_once_t *control = (fspr_thread_once_t *)vcontrol; if (control->sem) { DosCloseEventSem(control->sem); @@ -232,19 +232,19 @@ static apr_status_t thread_once_cleanup(void *vcontrol) -APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_thread_once_init(fspr_thread_once_t **control, + fspr_pool_t *p) { ULONG rc; - *control = (apr_thread_once_t *)apr_pcalloc(p, sizeof(apr_thread_once_t)); + *control = (fspr_thread_once_t *)fspr_pcalloc(p, sizeof(fspr_thread_once_t)); rc = DosCreateEventSem(NULL, &(*control)->sem, 0, TRUE); - apr_pool_cleanup_register(p, control, thread_once_cleanup, apr_pool_cleanup_null); + fspr_pool_cleanup_register(p, control, thread_once_cleanup, fspr_pool_cleanup_null); return APR_FROM_OS_ERROR(rc); } -APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, +APR_DECLARE(fspr_status_t) fspr_thread_once(fspr_thread_once_t *control, void (*func)(void)) { if (!control->hit) { diff --git a/libs/apr/threadproc/os2/threadpriv.c b/libs/apr/threadproc/os2/threadpriv.c index 107ec10d71..2e315abedd 100644 --- a/libs/apr/threadproc/os2/threadpriv.c +++ b/libs/apr/threadproc/os2/threadpriv.c @@ -14,19 +14,19 @@ * limitations under the License. */ -#include "apr_arch_threadproc.h" -#include "apr_thread_proc.h" -#include "apr_portable.h" -#include "apr_general.h" -#include "apr_errno.h" -#include "apr_lib.h" -#include "apr_arch_file_io.h" +#include "fspr_arch_threadproc.h" +#include "fspr_thread_proc.h" +#include "fspr_portable.h" +#include "fspr_general.h" +#include "fspr_errno.h" +#include "fspr_lib.h" +#include "fspr_arch_file_io.h" -APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, +APR_DECLARE(fspr_status_t) fspr_threadkey_private_create(fspr_threadkey_t **key, void (*dest)(void *), - apr_pool_t *pool) + fspr_pool_t *pool) { - (*key) = (apr_threadkey_t *)apr_palloc(pool, sizeof(apr_threadkey_t)); + (*key) = (fspr_threadkey_t *)fspr_palloc(pool, sizeof(fspr_threadkey_t)); if ((*key) == NULL) { return APR_ENOMEM; @@ -36,51 +36,51 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, return APR_OS2_STATUS(DosAllocThreadLocalMemory(1, &((*key)->key))); } -APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new, apr_threadkey_t *key) +APR_DECLARE(fspr_status_t) fspr_threadkey_private_get(void **new, fspr_threadkey_t *key) { (*new) = (void *)*(key->key); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, apr_threadkey_t *key) +APR_DECLARE(fspr_status_t) fspr_threadkey_private_set(void *priv, fspr_threadkey_t *key) { *(key->key) = (ULONG)priv; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key) +APR_DECLARE(fspr_status_t) fspr_threadkey_private_delete(fspr_threadkey_t *key) { return APR_OS2_STATUS(DosFreeThreadLocalMemory(key->key)); } -APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key, - apr_threadkey_t *threadkey) +APR_DECLARE(fspr_status_t) fspr_threadkey_data_get(void **data, const char *key, + fspr_threadkey_t *threadkey) { - return apr_pool_userdata_get(data, key, threadkey->pool); + return fspr_pool_userdata_get(data, key, threadkey->pool); } -APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_threadkey_t *threadkey) +APR_DECLARE(fspr_status_t) fspr_threadkey_data_set(void *data, const char *key, + fspr_status_t (*cleanup) (void *), + fspr_threadkey_t *threadkey) { - return apr_pool_userdata_set(data, key, cleanup, threadkey->pool); + return fspr_pool_userdata_set(data, key, cleanup, threadkey->pool); } -APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key) +APR_DECLARE(fspr_status_t) fspr_os_threadkey_get(fspr_os_threadkey_t *thekey, fspr_threadkey_t *key) { *thekey = key->key; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, - apr_os_threadkey_t *thekey, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_threadkey_put(fspr_threadkey_t **key, + fspr_os_threadkey_t *thekey, + fspr_pool_t *pool) { if (pool == NULL) { return APR_ENOPOOL; } if ((*key) == NULL) { - (*key) = (apr_threadkey_t *)apr_pcalloc(pool, sizeof(apr_threadkey_t)); + (*key) = (fspr_threadkey_t *)fspr_pcalloc(pool, sizeof(fspr_threadkey_t)); (*key)->pool = pool; } (*key)->key = *thekey; diff --git a/libs/apr/threadproc/unix/proc.c b/libs/apr/threadproc/unix/proc.c index fc7f925eb4..3781876edb 100644 --- a/libs/apr/threadproc/unix/proc.c +++ b/libs/apr/threadproc/unix/proc.c @@ -14,16 +14,16 @@ * limitations under the License. */ -#include "apr_arch_threadproc.h" -#include "apr_strings.h" -#include "apr_portable.h" -#include "apr_signal.h" -#include "apr_random.h" +#include "fspr_arch_threadproc.h" +#include "fspr_strings.h" +#include "fspr_portable.h" +#include "fspr_signal.h" +#include "fspr_random.h" -APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_procattr_create(fspr_procattr_t **new, + fspr_pool_t *pool) { - (*new) = (apr_procattr_t *)apr_pcalloc(pool, sizeof(apr_procattr_t)); + (*new) = (fspr_procattr_t *)fspr_pcalloc(pool, sizeof(fspr_procattr_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -34,14 +34,14 @@ APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, - apr_int32_t in, - apr_int32_t out, - apr_int32_t err) +APR_DECLARE(fspr_status_t) fspr_procattr_io_set(fspr_procattr_t *attr, + fspr_int32_t in, + fspr_int32_t out, + fspr_int32_t err) { - apr_status_t status; + fspr_status_t status; if (in != 0) { - if ((status = apr_file_pipe_create(&attr->child_in, &attr->parent_in, + if ((status = fspr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool)) != APR_SUCCESS) { return status; } @@ -50,19 +50,19 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - apr_file_pipe_timeout_set(attr->child_in, 0); + fspr_file_pipe_timeout_set(attr->child_in, 0); break; case APR_CHILD_BLOCK: - apr_file_pipe_timeout_set(attr->parent_in, 0); + fspr_file_pipe_timeout_set(attr->parent_in, 0); break; default: - apr_file_pipe_timeout_set(attr->child_in, 0); - apr_file_pipe_timeout_set(attr->parent_in, 0); + fspr_file_pipe_timeout_set(attr->child_in, 0); + fspr_file_pipe_timeout_set(attr->parent_in, 0); } } if (out) { - if ((status = apr_file_pipe_create(&attr->parent_out, &attr->child_out, + if ((status = fspr_file_pipe_create(&attr->parent_out, &attr->child_out, attr->pool)) != APR_SUCCESS) { return status; } @@ -71,19 +71,19 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - apr_file_pipe_timeout_set(attr->child_out, 0); + fspr_file_pipe_timeout_set(attr->child_out, 0); break; case APR_CHILD_BLOCK: - apr_file_pipe_timeout_set(attr->parent_out, 0); + fspr_file_pipe_timeout_set(attr->parent_out, 0); break; default: - apr_file_pipe_timeout_set(attr->child_out, 0); - apr_file_pipe_timeout_set(attr->parent_out, 0); + fspr_file_pipe_timeout_set(attr->child_out, 0); + fspr_file_pipe_timeout_set(attr->parent_out, 0); } } if (err) { - if ((status = apr_file_pipe_create(&attr->parent_err, &attr->child_err, + if ((status = fspr_file_pipe_create(&attr->parent_err, &attr->child_err, attr->pool)) != APR_SUCCESS) { return status; } @@ -92,14 +92,14 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, case APR_FULL_BLOCK: break; case APR_PARENT_BLOCK: - apr_file_pipe_timeout_set(attr->child_err, 0); + fspr_file_pipe_timeout_set(attr->child_err, 0); break; case APR_CHILD_BLOCK: - apr_file_pipe_timeout_set(attr->parent_err, 0); + fspr_file_pipe_timeout_set(attr->parent_err, 0); break; default: - apr_file_pipe_timeout_set(attr->child_err, 0); - apr_file_pipe_timeout_set(attr->parent_err, 0); + fspr_file_pipe_timeout_set(attr->child_err, 0); + fspr_file_pipe_timeout_set(attr->parent_err, 0); } } @@ -107,67 +107,67 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, } -APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, - apr_file_t *child_in, - apr_file_t *parent_in) +APR_DECLARE(fspr_status_t) fspr_procattr_child_in_set(fspr_procattr_t *attr, + fspr_file_t *child_in, + fspr_file_t *parent_in) { - apr_status_t rv = APR_SUCCESS; + fspr_status_t rv = APR_SUCCESS; if (attr->child_in == NULL && attr->parent_in == NULL) - rv = apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool); + rv = fspr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool); if (child_in != NULL && rv == APR_SUCCESS) - rv = apr_file_dup2(attr->child_in, child_in, attr->pool); + rv = fspr_file_dup2(attr->child_in, child_in, attr->pool); if (parent_in != NULL && rv == APR_SUCCESS) - rv = apr_file_dup2(attr->parent_in, parent_in, attr->pool); + rv = fspr_file_dup2(attr->parent_in, parent_in, attr->pool); return rv; } -APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, - apr_file_t *child_out, - apr_file_t *parent_out) +APR_DECLARE(fspr_status_t) fspr_procattr_child_out_set(fspr_procattr_t *attr, + fspr_file_t *child_out, + fspr_file_t *parent_out) { - apr_status_t rv = APR_SUCCESS; + fspr_status_t rv = APR_SUCCESS; if (attr->child_out == NULL && attr->parent_out == NULL) - rv = apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool); + rv = fspr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool); if (child_out != NULL && rv == APR_SUCCESS) - rv = apr_file_dup2(attr->child_out, child_out, attr->pool); + rv = fspr_file_dup2(attr->child_out, child_out, attr->pool); if (parent_out != NULL && rv == APR_SUCCESS) - rv = apr_file_dup2(attr->parent_out, parent_out, attr->pool); + rv = fspr_file_dup2(attr->parent_out, parent_out, attr->pool); return rv; } -APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, - apr_file_t *child_err, - apr_file_t *parent_err) +APR_DECLARE(fspr_status_t) fspr_procattr_child_err_set(fspr_procattr_t *attr, + fspr_file_t *child_err, + fspr_file_t *parent_err) { - apr_status_t rv = APR_SUCCESS; + fspr_status_t rv = APR_SUCCESS; if (attr->child_err == NULL && attr->parent_err == NULL) - rv = apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool); + rv = fspr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool); if (child_err != NULL && rv == APR_SUCCESS) - rv = apr_file_dup2(attr->child_err, child_err, attr->pool); + rv = fspr_file_dup2(attr->child_err, child_err, attr->pool); if (parent_err != NULL && rv == APR_SUCCESS) - rv = apr_file_dup2(attr->parent_err, parent_err, attr->pool); + rv = fspr_file_dup2(attr->parent_err, parent_err, attr->pool); return rv; } -APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, +APR_DECLARE(fspr_status_t) fspr_procattr_dir_set(fspr_procattr_t *attr, const char *dir) { - attr->currdir = apr_pstrdup(attr->pool, dir); + attr->currdir = fspr_pstrdup(attr->pool, dir); if (attr->currdir) { return APR_SUCCESS; } @@ -175,21 +175,21 @@ APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, return APR_ENOMEM; } -APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, - apr_cmdtype_e cmd) +APR_DECLARE(fspr_status_t) fspr_procattr_cmdtype_set(fspr_procattr_t *attr, + fspr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, - apr_int32_t detach) +APR_DECLARE(fspr_status_t) fspr_procattr_detach_set(fspr_procattr_t *attr, + fspr_int32_t detach) { attr->detached = detach; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_proc_fork(fspr_proc_t *proc, fspr_pool_t *pool) { int pid; @@ -202,7 +202,7 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) proc->out = NULL; proc->err = NULL; - apr_random_after_fork(proc); + fspr_random_after_fork(proc); return APR_INCHILD; } @@ -215,7 +215,7 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool) return APR_INPARENT; } -static apr_status_t limit_proc(apr_procattr_t *attr) +static fspr_status_t limit_proc(fspr_procattr_t *attr) { #if APR_HAVE_STRUCT_RLIMIT && APR_HAVE_SETRLIMIT #ifdef RLIMIT_CPU @@ -267,35 +267,35 @@ static apr_status_t limit_proc(apr_procattr_t *attr) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr, - apr_child_errfn_t *errfn) +APR_DECLARE(fspr_status_t) fspr_procattr_child_errfn_set(fspr_procattr_t *attr, + fspr_child_errfn_t *errfn) { attr->errfn = errfn; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr, - apr_int32_t chk) +APR_DECLARE(fspr_status_t) fspr_procattr_error_check_set(fspr_procattr_t *attr, + fspr_int32_t chk) { attr->errchk = chk; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr, - apr_int32_t addrspace) +APR_DECLARE(fspr_status_t) fspr_procattr_addrspace_set(fspr_procattr_t *attr, + fspr_int32_t addrspace) { /* won't ever be used on this platform, so don't save the flag */ return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, +APR_DECLARE(fspr_status_t) fspr_procattr_user_set(fspr_procattr_t *attr, const char *username, const char *password) { - apr_status_t rv; - apr_gid_t gid; + fspr_status_t rv; + fspr_gid_t gid; - if ((rv = apr_uid_get(&attr->uid, &gid, username, + if ((rv = fspr_uid_get(&attr->uid, &gid, username, attr->pool)) != APR_SUCCESS) { attr->uid = -1; return rv; @@ -308,22 +308,22 @@ APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr, +APR_DECLARE(fspr_status_t) fspr_procattr_group_set(fspr_procattr_t *attr, const char *groupname) { - apr_status_t rv; + fspr_status_t rv; - if ((rv = apr_gid_get(&attr->gid, groupname, attr->pool)) != APR_SUCCESS) + if ((rv = fspr_gid_get(&attr->gid, groupname, attr->pool)) != APR_SUCCESS) attr->gid = -1; return rv; } -APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, +APR_DECLARE(fspr_status_t) fspr_proc_create(fspr_proc_t *new, const char *progname, const char * const *args, const char * const *env, - apr_procattr_t *attr, - apr_pool_t *pool) + fspr_procattr_t *attr, + fspr_pool_t *pool) { int i; const char * const empty_envp[] = {NULL}; @@ -385,41 +385,41 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, */ if (attr->child_in) { - apr_pool_cleanup_kill(apr_file_pool_get(attr->child_in), - attr->child_in, apr_unix_file_cleanup); + fspr_pool_cleanup_kill(fspr_file_pool_get(attr->child_in), + attr->child_in, fspr_unix_file_cleanup); } if (attr->child_out) { - apr_pool_cleanup_kill(apr_file_pool_get(attr->child_out), - attr->child_out, apr_unix_file_cleanup); + fspr_pool_cleanup_kill(fspr_file_pool_get(attr->child_out), + attr->child_out, fspr_unix_file_cleanup); } if (attr->child_err) { - apr_pool_cleanup_kill(apr_file_pool_get(attr->child_err), - attr->child_err, apr_unix_file_cleanup); + fspr_pool_cleanup_kill(fspr_file_pool_get(attr->child_err), + attr->child_err, fspr_unix_file_cleanup); } - apr_pool_cleanup_for_exec(); + fspr_pool_cleanup_for_exec(); if (attr->child_in) { - apr_file_close(attr->parent_in); + fspr_file_close(attr->parent_in); dup2(attr->child_in->filedes, STDIN_FILENO); - apr_file_close(attr->child_in); + fspr_file_close(attr->child_in); } if (attr->child_out) { - apr_file_close(attr->parent_out); + fspr_file_close(attr->parent_out); dup2(attr->child_out->filedes, STDOUT_FILENO); - apr_file_close(attr->child_out); + fspr_file_close(attr->child_out); } if (attr->child_err) { - apr_file_close(attr->parent_err); + fspr_file_close(attr->parent_err); dup2(attr->child_err->filedes, STDERR_FILENO); - apr_file_close(attr->child_err); + fspr_file_close(attr->child_err); } - apr_signal(SIGCHLD, SIG_DFL); /* not sure if this is needed or not */ + fspr_signal(SIGCHLD, SIG_DFL); /* not sure if this is needed or not */ if (attr->currdir != NULL) { if (chdir(attr->currdir) == -1) { @@ -485,7 +485,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, { char *ch, *onearg; - ch = onearg = apr_palloc(pool, onearg_len); + ch = onearg = fspr_palloc(pool, onearg_len); i = 0; while (args[i]) { size_t len = strlen(args[i]); @@ -505,7 +505,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, newargs[3] = NULL; if (attr->detached) { - apr_proc_detach(APR_PROC_DETACH_DAEMONIZE); + fspr_proc_detach(APR_PROC_DETACH_DAEMONIZE); } if (attr->cmdtype == APR_SHELLCMD) { @@ -517,14 +517,14 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } else if (attr->cmdtype == APR_PROGRAM) { if (attr->detached) { - apr_proc_detach(APR_PROC_DETACH_DAEMONIZE); + fspr_proc_detach(APR_PROC_DETACH_DAEMONIZE); } execve(progname, (char * const *)args, (char * const *)env); } else if (attr->cmdtype == APR_PROGRAM_ENV) { if (attr->detached) { - apr_proc_detach(APR_PROC_DETACH_DAEMONIZE); + fspr_proc_detach(APR_PROC_DETACH_DAEMONIZE); } execv(progname, (char * const *)args); @@ -532,7 +532,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, else { /* APR_PROGRAM_PATH */ if (attr->detached) { - apr_proc_detach(APR_PROC_DETACH_DAEMONIZE); + fspr_proc_detach(APR_PROC_DETACH_DAEMONIZE); } execvp(progname, (char * const *)args); @@ -540,7 +540,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, if (attr->errfn) { char *desc; - desc = apr_psprintf(pool, "exec of '%s' failed", + desc = fspr_psprintf(pool, "exec of '%s' failed", progname); attr->errfn(pool, errno, desc); } @@ -551,39 +551,39 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, /* Parent process */ if (attr->child_in) { - apr_file_close(attr->child_in); + fspr_file_close(attr->child_in); } if (attr->child_out) { - apr_file_close(attr->child_out); + fspr_file_close(attr->child_out); } if (attr->child_err) { - apr_file_close(attr->child_err); + fspr_file_close(attr->child_err); } return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, +APR_DECLARE(fspr_status_t) fspr_proc_wait_all_procs(fspr_proc_t *proc, int *exitcode, - apr_exit_why_e *exitwhy, - apr_wait_how_e waithow, - apr_pool_t *p) + fspr_exit_why_e *exitwhy, + fspr_wait_how_e waithow, + fspr_pool_t *p) { proc->pid = -1; - return apr_proc_wait(proc, exitcode, exitwhy, waithow); + return fspr_proc_wait(proc, exitcode, exitwhy, waithow); } -APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, - int *exitcode, apr_exit_why_e *exitwhy, - apr_wait_how_e waithow) +APR_DECLARE(fspr_status_t) fspr_proc_wait(fspr_proc_t *proc, + int *exitcode, fspr_exit_why_e *exitwhy, + fspr_wait_how_e waithow) { pid_t pstatus; int waitpid_options = WUNTRACED; int exit_int; int ignore; - apr_exit_why_e ignorewhy; + fspr_exit_why_e ignorewhy; if (exitcode == NULL) { exitcode = &ignore; @@ -633,8 +633,8 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, return errno; } -APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, - apr_int32_t what, +APR_DECLARE(fspr_status_t) fspr_procattr_limit_set(fspr_procattr_t *attr, + fspr_int32_t what, struct rlimit *limit) { switch(what) { diff --git a/libs/apr/threadproc/unix/procsup.c b/libs/apr/threadproc/unix/procsup.c index caf13bfa73..d37828c515 100644 --- a/libs/apr/threadproc/unix/procsup.c +++ b/libs/apr/threadproc/unix/procsup.c @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "apr_arch_threadproc.h" +#include "fspr_arch_threadproc.h" -APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize) +APR_DECLARE(fspr_status_t) fspr_proc_detach(int daemonize) { int x; diff --git a/libs/apr/threadproc/unix/signals.c b/libs/apr/threadproc/unix/signals.c index f44c3d7859..44da95a335 100644 --- a/libs/apr/threadproc/unix/signals.c +++ b/libs/apr/threadproc/unix/signals.c @@ -15,11 +15,11 @@ */ #define INCL_DOSEXCEPTIONS /* for OS2 */ -#include "apr_arch_threadproc.h" -#include "apr_private.h" -#include "apr_pools.h" -#include "apr_signal.h" -#include "apr_strings.h" +#include "fspr_arch_threadproc.h" +#include "fspr_private.h" +#include "fspr_pools.h" +#include "fspr_signal.h" +#include "fspr_strings.h" #include #if APR_HAS_THREADS && APR_HAVE_PTHREAD_H @@ -27,12 +27,12 @@ #endif #ifdef SIGWAIT_TAKES_ONE_ARG -#define apr_sigwait(a,b) ((*(b)=sigwait((a)))<0?-1:0) +#define fspr_sigwait(a,b) ((*(b)=sigwait((a)))<0?-1:0) #else -#define apr_sigwait(a,b) sigwait((a),(b)) +#define fspr_sigwait(a,b) sigwait((a),(b)) #endif -APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int signum) +APR_DECLARE(fspr_status_t) fspr_proc_kill(fspr_proc_t *proc, int signum) { #ifdef OS2 /* SIGTERM's don't work too well in OS/2 (only affects other EMX @@ -71,7 +71,7 @@ static void avoid_zombies(int signo) * from W. Richard Stevens' "Advanced Programming in the UNIX Environment" * (the version that does not automatically restart system calls). */ -APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func) +APR_DECLARE(fspr_sigfunc_t *) fspr_signal(int signo, fspr_sigfunc_t * func) { struct sigaction act, oact; @@ -111,10 +111,10 @@ APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func) * on the version of autoconf used. */ #if defined(SYS_SIGLIST_DECLARED) || HAVE_DECL_SYS_SIGLIST -void apr_signal_init(apr_pool_t *pglobal) +void fspr_signal_init(fspr_pool_t *pglobal) { } -const char *apr_signal_description_get(int signum) +const char *fspr_signal_description_get(int signum) { return sys_siglist[signum]; } @@ -145,7 +145,7 @@ static const char *signal_description[APR_NUMSIG]; } \ } while (0) -void apr_signal_init(apr_pool_t *pglobal) +void fspr_signal_init(fspr_pool_t *pglobal) { int sig; @@ -256,10 +256,10 @@ void apr_signal_init(apr_pool_t *pglobal) for (sig = 0; sig < APR_NUMSIG; ++sig) if (signal_description[sig] == NULL) - signal_description[sig] = apr_psprintf(pglobal, "signal #%d", sig); + signal_description[sig] = fspr_psprintf(pglobal, "signal #%d", sig); } -const char *apr_signal_description_get(int signum) +const char *fspr_signal_description_get(int signum) { return signum < APR_NUMSIG @@ -316,7 +316,7 @@ static void remove_sync_sigs(sigset_t *sig_mask) #endif } -APR_DECLARE(apr_status_t) apr_signal_thread(int(*signal_handler)(int signum)) +APR_DECLARE(fspr_status_t) fspr_signal_thread(int(*signal_handler)(int signum)) { sigset_t sig_mask; #if APR_HAVE_SIGWAIT @@ -380,7 +380,7 @@ APR_DECLARE(apr_status_t) apr_signal_thread(int(*signal_handler)(int signum)) #if APR_HAVE_SIGWAIT int signal_received; - if (apr_sigwait(&sig_mask, &signal_received) != 0) + if (fspr_sigwait(&sig_mask, &signal_received) != 0) { /* handle sigwait() error here */ } @@ -391,12 +391,12 @@ APR_DECLARE(apr_status_t) apr_signal_thread(int(*signal_handler)(int signum)) #elif HAVE_SIGSUSPEND sigsuspend(&sig_mask); #else -#error No apr_sigwait() and no sigsuspend() +#error No fspr_sigwait() and no sigsuspend() #endif } } -APR_DECLARE(apr_status_t) apr_setup_signal_thread(void) +APR_DECLARE(fspr_status_t) fspr_setup_signal_thread(void) { sigset_t sig_mask; int rv; @@ -432,7 +432,7 @@ APR_DECLARE(apr_status_t) apr_setup_signal_thread(void) #endif /* APR_HAS_THREADS && ... */ -APR_DECLARE(apr_status_t) apr_signal_block(int signum) +APR_DECLARE(fspr_status_t) fspr_signal_block(int signum) { #if APR_HAVE_SIGACTION sigset_t sig_mask; @@ -459,7 +459,7 @@ APR_DECLARE(apr_status_t) apr_signal_block(int signum) #endif } -APR_DECLARE(apr_status_t) apr_signal_unblock(int signum) +APR_DECLARE(fspr_status_t) fspr_signal_unblock(int signum) { #if APR_HAVE_SIGACTION sigset_t sig_mask; diff --git a/libs/apr/threadproc/unix/thread.c b/libs/apr/threadproc/unix/thread.c index 165dddc238..0deaefa1a8 100644 --- a/libs/apr/threadproc/unix/thread.c +++ b/libs/apr/threadproc/unix/thread.c @@ -14,19 +14,19 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_portable.h" -#include "apr_arch_threadproc.h" +#include "fspr.h" +#include "fspr_portable.h" +#include "fspr_arch_threadproc.h" #if APR_HAS_THREADS #if APR_HAVE_PTHREAD_H /* Destroy the threadattr object */ -static apr_status_t threadattr_cleanup(void *data) +static fspr_status_t threadattr_cleanup(void *data) { - apr_threadattr_t *attr = data; - apr_status_t rv; + fspr_threadattr_t *attr = data; + fspr_status_t rv; rv = pthread_attr_destroy(&attr->attr); #ifdef PTHREAD_SETS_ERRNO @@ -37,18 +37,18 @@ static apr_status_t threadattr_cleanup(void *data) return rv; } -APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_threadattr_create(fspr_threadattr_t **new, + fspr_pool_t *pool) { - apr_status_t stat; + fspr_status_t stat; - (*new) = apr_palloc(pool, sizeof(apr_threadattr_t)); + (*new) = fspr_palloc(pool, sizeof(fspr_threadattr_t)); (*new)->pool = pool; stat = pthread_attr_init(&(*new)->attr); if (stat == 0) { - apr_pool_cleanup_register(pool, *new, threadattr_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_register(pool, *new, threadattr_cleanup, + fspr_pool_cleanup_null); return APR_SUCCESS; } #ifdef PTHREAD_SETS_ERRNO @@ -60,10 +60,10 @@ APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, #define DETACH_ARG(v) ((v) ? PTHREAD_CREATE_DETACHED : PTHREAD_CREATE_JOINABLE) -APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, - apr_int32_t on) +APR_DECLARE(fspr_status_t) fspr_threadattr_detach_set(fspr_threadattr_t *attr, + fspr_int32_t on) { - apr_status_t stat; + fspr_status_t stat; #ifdef PTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR int arg = DETACH_ARG(v); @@ -83,7 +83,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, } } -APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr) +APR_DECLARE(fspr_status_t) fspr_threadattr_detach_get(fspr_threadattr_t *attr) { int state; @@ -97,8 +97,8 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr) return APR_NOTDETACH; } -APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr, - apr_size_t stacksize) +APR_DECLARE(fspr_status_t) fspr_threadattr_stacksize_set(fspr_threadattr_t *attr, + fspr_size_t stacksize) { int stat; @@ -113,11 +113,11 @@ APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr, return stat; } -APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr, - apr_size_t size) +APR_DECLARE(fspr_status_t) fspr_threadattr_guardsize_set(fspr_threadattr_t *attr, + fspr_size_t size) { #ifdef HAVE_PTHREAD_ATTR_SETGUARDSIZE - apr_status_t rv; + fspr_status_t rv; rv = pthread_attr_setguardsize(&attr->attr, size); if (rv == 0) { @@ -134,7 +134,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr, static void *dummy_worker(void *opaque) { - apr_thread_t *thread = (apr_thread_t*)opaque; + fspr_thread_t *thread = (fspr_thread_t*)opaque; #ifdef HAVE_PTHREAD_SETSCHEDPARAM if (thread->priority) { @@ -151,23 +151,23 @@ static void *dummy_worker(void *opaque) return thread->func(thread, thread->data); } -APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, - apr_threadattr_t *attr, - apr_thread_start_t func, +APR_DECLARE(fspr_status_t) fspr_thread_create(fspr_thread_t **new, + fspr_threadattr_t *attr, + fspr_thread_start_t func, void *data, - apr_pool_t *pool) + fspr_pool_t *pool) { - apr_status_t stat; + fspr_status_t stat; pthread_attr_t *temp; pthread_t tt; - (*new) = (apr_thread_t *)apr_pcalloc(pool, sizeof(apr_thread_t)); + (*new) = (fspr_thread_t *)fspr_pcalloc(pool, sizeof(fspr_thread_t)); if ((*new) == NULL) { return APR_ENOMEM; } - (*new)->td = (pthread_t *)apr_pcalloc(pool, sizeof(pthread_t)); + (*new)->td = (pthread_t *)fspr_pcalloc(pool, sizeof(pthread_t)); if ((*new)->td == NULL) { return APR_ENOMEM; @@ -182,7 +182,7 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, else temp = NULL; - stat = apr_pool_create(&(*new)->pool, pool); + stat = fspr_pool_create(&(*new)->pool, pool); if (stat != APR_SUCCESS) { return stat; } @@ -205,31 +205,31 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, } } -APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void) +APR_DECLARE(fspr_os_thread_t) fspr_os_thread_current(void) { return pthread_self(); } -APR_DECLARE(int) apr_os_thread_equal(apr_os_thread_t tid1, - apr_os_thread_t tid2) +APR_DECLARE(int) fspr_os_thread_equal(fspr_os_thread_t tid1, + fspr_os_thread_t tid2) { return pthread_equal(tid1, tid2); } -APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, - apr_status_t retval) +APR_DECLARE(fspr_status_t) fspr_thread_exit(fspr_thread_t *thd, + fspr_status_t retval) { thd->exitval = retval; - apr_pool_destroy(thd->pool); + fspr_pool_destroy(thd->pool); pthread_exit(NULL); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, - apr_thread_t *thd) +APR_DECLARE(fspr_status_t) fspr_thread_join(fspr_status_t *retval, + fspr_thread_t *thd) { - apr_status_t stat; - apr_status_t *thread_stat; + fspr_status_t stat; + fspr_status_t *thread_stat; if ((stat = pthread_join(*thd->td,(void *)&thread_stat)) == 0) { *retval = thd->exitval; @@ -244,9 +244,9 @@ APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, } } -APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd) +APR_DECLARE(fspr_status_t) fspr_thread_detach(fspr_thread_t *thd) { - apr_status_t stat; + fspr_status_t stat; #ifdef PTHREAD_DETACH_ARG1_ADDR if ((stat = pthread_detach(thd->td)) == 0) { @@ -265,40 +265,40 @@ APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd) } } -void apr_thread_yield() +void fspr_thread_yield() { } -APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, - apr_thread_t *thread) +APR_DECLARE(fspr_status_t) fspr_thread_data_get(void **data, const char *key, + fspr_thread_t *thread) { - return apr_pool_userdata_get(data, key, thread->pool); + return fspr_pool_userdata_get(data, key, thread->pool); } -APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key, - apr_status_t (*cleanup)(void *), - apr_thread_t *thread) +APR_DECLARE(fspr_status_t) fspr_thread_data_set(void *data, const char *key, + fspr_status_t (*cleanup)(void *), + fspr_thread_t *thread) { - return apr_pool_userdata_set(data, key, cleanup, thread->pool); + return fspr_pool_userdata_set(data, key, cleanup, thread->pool); } -APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, - apr_thread_t *thd) +APR_DECLARE(fspr_status_t) fspr_os_thread_get(fspr_os_thread_t **thethd, + fspr_thread_t *thd) { *thethd = thd->td; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, - apr_os_thread_t *thethd, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_thread_put(fspr_thread_t **thd, + fspr_os_thread_t *thethd, + fspr_pool_t *pool) { if (pool == NULL) { return APR_ENOPOOL; } if ((*thd) == NULL) { - (*thd) = (apr_thread_t *)apr_pcalloc(pool, sizeof(apr_thread_t)); + (*thd) = (fspr_thread_t *)fspr_pcalloc(pool, sizeof(fspr_thread_t)); (*thd)->pool = pool; } @@ -306,17 +306,17 @@ APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_thread_once_init(fspr_thread_once_t **control, + fspr_pool_t *p) { static const pthread_once_t once_init = PTHREAD_ONCE_INIT; - *control = apr_palloc(p, sizeof(**control)); + *control = fspr_palloc(p, sizeof(**control)); (*control)->once = once_init; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, +APR_DECLARE(fspr_status_t) fspr_thread_once(fspr_thread_once_t *control, void (*func)(void)) { return pthread_once(&control->once, func); @@ -330,9 +330,9 @@ APR_POOL_IMPLEMENT_ACCESSOR(thread) #if !APR_HAS_THREADS /* avoid warning for no prototype */ -APR_DECLARE(apr_status_t) apr_os_thread_get(void); +APR_DECLARE(fspr_status_t) fspr_os_thread_get(void); -APR_DECLARE(apr_status_t) apr_os_thread_get(void) +APR_DECLARE(fspr_status_t) fspr_os_thread_get(void) { return APR_ENOTIMPL; } diff --git a/libs/apr/threadproc/unix/threadpriv.c b/libs/apr/threadproc/unix/threadpriv.c index c278520380..fcc0e4d753 100644 --- a/libs/apr/threadproc/unix/threadpriv.c +++ b/libs/apr/threadproc/unix/threadpriv.c @@ -14,18 +14,18 @@ * limitations under the License. */ -#include "apr.h" -#include "apr_portable.h" -#include "apr_arch_threadproc.h" +#include "fspr.h" +#include "fspr_portable.h" +#include "fspr_arch_threadproc.h" #if APR_HAS_THREADS #if APR_HAVE_PTHREAD_H -APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, +APR_DECLARE(fspr_status_t) fspr_threadkey_private_create(fspr_threadkey_t **key, void (*dest)(void *), - apr_pool_t *pool) + fspr_pool_t *pool) { - (*key) = (apr_threadkey_t *)apr_pcalloc(pool, sizeof(apr_threadkey_t)); + (*key) = (fspr_threadkey_t *)fspr_pcalloc(pool, sizeof(fspr_threadkey_t)); if ((*key) == NULL) { return APR_ENOMEM; @@ -37,8 +37,8 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, } -APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new, - apr_threadkey_t *key) +APR_DECLARE(fspr_status_t) fspr_threadkey_private_get(void **new, + fspr_threadkey_t *key) { #ifdef PTHREAD_GETSPECIFIC_TAKES_TWO_ARGS if (pthread_getspecific(key->key,new)) @@ -49,10 +49,10 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, - apr_threadkey_t *key) +APR_DECLARE(fspr_status_t) fspr_threadkey_private_set(void *priv, + fspr_threadkey_t *key) { - apr_status_t stat; + fspr_status_t stat; if ((stat = pthread_setspecific(key->key, priv)) == 0) { return APR_SUCCESS; @@ -62,10 +62,10 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, } } -APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key) +APR_DECLARE(fspr_status_t) fspr_threadkey_private_delete(fspr_threadkey_t *key) { #ifdef HAVE_PTHREAD_KEY_DELETE - apr_status_t stat; + fspr_status_t stat; if ((stat = pthread_key_delete(key->key)) == 0) { return APR_SUCCESS; @@ -77,36 +77,36 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key) #endif } -APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key, - apr_threadkey_t *threadkey) +APR_DECLARE(fspr_status_t) fspr_threadkey_data_get(void **data, const char *key, + fspr_threadkey_t *threadkey) { - return apr_pool_userdata_get(data, key, threadkey->pool); + return fspr_pool_userdata_get(data, key, threadkey->pool); } -APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key, - apr_status_t (*cleanup)(void *), - apr_threadkey_t *threadkey) +APR_DECLARE(fspr_status_t) fspr_threadkey_data_set(void *data, const char *key, + fspr_status_t (*cleanup)(void *), + fspr_threadkey_t *threadkey) { - return apr_pool_userdata_set(data, key, cleanup, threadkey->pool); + return fspr_pool_userdata_set(data, key, cleanup, threadkey->pool); } -APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, - apr_threadkey_t *key) +APR_DECLARE(fspr_status_t) fspr_os_threadkey_get(fspr_os_threadkey_t *thekey, + fspr_threadkey_t *key) { *thekey = key->key; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, - apr_os_threadkey_t *thekey, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_threadkey_put(fspr_threadkey_t **key, + fspr_os_threadkey_t *thekey, + fspr_pool_t *pool) { if (pool == NULL) { return APR_ENOPOOL; } if ((*key) == NULL) { - (*key) = (apr_threadkey_t *)apr_pcalloc(pool, sizeof(apr_threadkey_t)); + (*key) = (fspr_threadkey_t *)fspr_pcalloc(pool, sizeof(fspr_threadkey_t)); (*key)->pool = pool; } @@ -119,9 +119,9 @@ APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, #if !APR_HAS_THREADS /* avoid warning for no prototype */ -APR_DECLARE(apr_status_t) apr_os_threadkey_get(void); +APR_DECLARE(fspr_status_t) fspr_os_threadkey_get(void); -APR_DECLARE(apr_status_t) apr_os_threadkey_get(void) +APR_DECLARE(fspr_status_t) fspr_os_threadkey_get(void) { return APR_ENOTIMPL; } diff --git a/libs/apr/threadproc/win32/proc.c b/libs/apr/threadproc/win32/proc.c index 014dfc8428..24f725d3dd 100644 --- a/libs/apr/threadproc/win32/proc.c +++ b/libs/apr/threadproc/win32/proc.c @@ -14,15 +14,15 @@ * limitations under the License. */ -#include "win32/apr_arch_threadproc.h" -#include "win32/apr_arch_file_io.h" +#include "win32/fspr_arch_threadproc.h" +#include "win32/fspr_arch_file_io.h" -#include "apr_thread_proc.h" -#include "apr_file_io.h" -#include "apr_general.h" -#include "apr_strings.h" -#include "apr_portable.h" -#include "apr_lib.h" +#include "fspr_thread_proc.h" +#include "fspr_file_io.h" +#include "fspr_general.h" +#include "fspr_strings.h" +#include "fspr_portable.h" +#include "fspr_lib.h" #include #if APR_HAVE_SIGNAL_H #include @@ -52,21 +52,21 @@ * */ -APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_procattr_create(fspr_procattr_t **new, + fspr_pool_t *pool) { - (*new) = (apr_procattr_t *)apr_pcalloc(pool, sizeof(apr_procattr_t)); + (*new) = (fspr_procattr_t *)fspr_pcalloc(pool, sizeof(fspr_procattr_t)); (*new)->pool = pool; (*new)->cmdtype = APR_PROGRAM; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, - apr_int32_t in, - apr_int32_t out, - apr_int32_t err) +APR_DECLARE(fspr_status_t) fspr_procattr_io_set(fspr_procattr_t *attr, + fspr_int32_t in, + fspr_int32_t out, + fspr_int32_t err) { - apr_status_t stat = APR_SUCCESS; + fspr_status_t stat = APR_SUCCESS; if (in) { /* APR_CHILD_BLOCK maps to APR_WRITE_BLOCK, while @@ -79,138 +79,138 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, in = APR_READ_BLOCK; else if (in == APR_PARENT_BLOCK) in = APR_WRITE_BLOCK; - stat = apr_create_nt_pipe(&attr->child_in, &attr->parent_in, in, + stat = fspr_create_nt_pipe(&attr->child_in, &attr->parent_in, in, attr->pool); if (stat == APR_SUCCESS) - stat = apr_file_inherit_unset(attr->parent_in); + stat = fspr_file_inherit_unset(attr->parent_in); } if (out && stat == APR_SUCCESS) { - stat = apr_create_nt_pipe(&attr->parent_out, &attr->child_out, out, + stat = fspr_create_nt_pipe(&attr->parent_out, &attr->child_out, out, attr->pool); if (stat == APR_SUCCESS) - stat = apr_file_inherit_unset(attr->parent_out); + stat = fspr_file_inherit_unset(attr->parent_out); } if (err && stat == APR_SUCCESS) { - stat = apr_create_nt_pipe(&attr->parent_err, &attr->child_err, err, + stat = fspr_create_nt_pipe(&attr->parent_err, &attr->child_err, err, attr->pool); if (stat == APR_SUCCESS) - stat = apr_file_inherit_unset(attr->parent_err); + stat = fspr_file_inherit_unset(attr->parent_err); } return stat; } -APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, - apr_file_t *child_in, - apr_file_t *parent_in) +APR_DECLARE(fspr_status_t) fspr_procattr_child_in_set(fspr_procattr_t *attr, + fspr_file_t *child_in, + fspr_file_t *parent_in) { - apr_status_t rv = APR_SUCCESS; + fspr_status_t rv = APR_SUCCESS; if (child_in) { if (attr->child_in == NULL) - rv = apr_file_dup(&attr->child_in, child_in, attr->pool); + rv = fspr_file_dup(&attr->child_in, child_in, attr->pool); else - rv = apr_file_dup2(attr->child_in, child_in, attr->pool); + rv = fspr_file_dup2(attr->child_in, child_in, attr->pool); if (rv == APR_SUCCESS) - rv = apr_file_inherit_set(attr->child_in); + rv = fspr_file_inherit_set(attr->child_in); } if (parent_in && rv == APR_SUCCESS) { if (attr->parent_in == NULL) - rv = apr_file_dup(&attr->parent_in, parent_in, attr->pool); + rv = fspr_file_dup(&attr->parent_in, parent_in, attr->pool); else - rv = apr_file_dup2(attr->parent_in, parent_in, attr->pool); + rv = fspr_file_dup2(attr->parent_in, parent_in, attr->pool); } return rv; } -APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, - apr_file_t *child_out, - apr_file_t *parent_out) +APR_DECLARE(fspr_status_t) fspr_procattr_child_out_set(fspr_procattr_t *attr, + fspr_file_t *child_out, + fspr_file_t *parent_out) { - apr_status_t rv = APR_SUCCESS; + fspr_status_t rv = APR_SUCCESS; if (child_out) { if (attr->child_out == NULL) - rv = apr_file_dup(&attr->child_out, child_out, attr->pool); + rv = fspr_file_dup(&attr->child_out, child_out, attr->pool); else - rv = apr_file_dup2(attr->child_out, child_out, attr->pool); + rv = fspr_file_dup2(attr->child_out, child_out, attr->pool); if (rv == APR_SUCCESS) - rv = apr_file_inherit_set(attr->child_out); + rv = fspr_file_inherit_set(attr->child_out); } if (parent_out && rv == APR_SUCCESS) { if (attr->parent_out == NULL) - rv = apr_file_dup(&attr->parent_out, parent_out, attr->pool); + rv = fspr_file_dup(&attr->parent_out, parent_out, attr->pool); else - rv = apr_file_dup2(attr->parent_out, parent_out, attr->pool); + rv = fspr_file_dup2(attr->parent_out, parent_out, attr->pool); } return rv; } -APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, - apr_file_t *child_err, - apr_file_t *parent_err) +APR_DECLARE(fspr_status_t) fspr_procattr_child_err_set(fspr_procattr_t *attr, + fspr_file_t *child_err, + fspr_file_t *parent_err) { - apr_status_t rv = APR_SUCCESS; + fspr_status_t rv = APR_SUCCESS; if (child_err) { if (attr->child_err == NULL) - rv = apr_file_dup(&attr->child_err, child_err, attr->pool); + rv = fspr_file_dup(&attr->child_err, child_err, attr->pool); else - rv = apr_file_dup2(attr->child_err, child_err, attr->pool); + rv = fspr_file_dup2(attr->child_err, child_err, attr->pool); if (rv == APR_SUCCESS) - rv = apr_file_inherit_set(attr->child_err); + rv = fspr_file_inherit_set(attr->child_err); } if (parent_err && rv == APR_SUCCESS) { if (attr->parent_err == NULL) - rv = apr_file_dup(&attr->parent_err, parent_err, attr->pool); + rv = fspr_file_dup(&attr->parent_err, parent_err, attr->pool); else - rv = apr_file_dup2(attr->parent_err, parent_err, attr->pool); + rv = fspr_file_dup2(attr->parent_err, parent_err, attr->pool); } return rv; } -APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, +APR_DECLARE(fspr_status_t) fspr_procattr_dir_set(fspr_procattr_t *attr, const char *dir) { /* curr dir must be in native format, there are all sorts of bugs in * the NT library loading code that flunk the '/' parsing test. */ - return apr_filepath_merge(&attr->currdir, NULL, dir, + return fspr_filepath_merge(&attr->currdir, NULL, dir, APR_FILEPATH_NATIVE, attr->pool); } -APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, - apr_cmdtype_e cmd) +APR_DECLARE(fspr_status_t) fspr_procattr_cmdtype_set(fspr_procattr_t *attr, + fspr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, - apr_int32_t det) +APR_DECLARE(fspr_status_t) fspr_procattr_detach_set(fspr_procattr_t *attr, + fspr_int32_t det) { attr->detached = det; return APR_SUCCESS; } -static apr_status_t attr_cleanup(void *theattr) +static fspr_status_t attr_cleanup(void *theattr) { - apr_procattr_t *attr = (apr_procattr_t *)theattr; + fspr_procattr_t *attr = (fspr_procattr_t *)theattr; if (attr->user_token) CloseHandle(attr->user_token); attr->user_token = NULL; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, +APR_DECLARE(fspr_status_t) fspr_procattr_user_set(fspr_procattr_t *attr, const char *username, const char *password) { @@ -218,18 +218,18 @@ APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, return APR_ENOTIMPL; #else HANDLE user; - apr_wchar_t *wusername = NULL; - apr_wchar_t *wpassword = NULL; - apr_status_t rv; - apr_size_t len, wlen; + fspr_wchar_t *wusername = NULL; + fspr_wchar_t *wpassword = NULL; + fspr_status_t rv; + fspr_size_t len, wlen; - if (apr_os_level >= APR_WIN_NT_4) + if (fspr_os_level >= APR_WIN_NT_4) { if (attr->user_token) { /* Cannot set that twice */ if (attr->errfn) { attr->errfn(attr->pool, 0, - apr_pstrcat(attr->pool, + fspr_pstrcat(attr->pool, "function called twice" " on username: ", username, NULL)); } @@ -237,12 +237,12 @@ APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, } len = strlen(username) + 1; wlen = len; - wusername = apr_palloc(attr->pool, wlen * sizeof(apr_wchar_t)); - if ((rv = apr_conv_utf8_to_ucs2(username, &len, wusername, &wlen)) + wusername = fspr_palloc(attr->pool, wlen * sizeof(fspr_wchar_t)); + if ((rv = fspr_conv_utf8_to_ucs2(username, &len, wusername, &wlen)) != APR_SUCCESS) { if (attr->errfn) { attr->errfn(attr->pool, rv, - apr_pstrcat(attr->pool, + fspr_pstrcat(attr->pool, "utf8 to ucs2 conversion failed" " on username: ", username, NULL)); } @@ -251,12 +251,12 @@ APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, if (password) { len = strlen(password) + 1; wlen = len; - wpassword = apr_palloc(attr->pool, wlen * sizeof(apr_wchar_t)); - if ((rv = apr_conv_utf8_to_ucs2(password, &len, wpassword, &wlen)) + wpassword = fspr_palloc(attr->pool, wlen * sizeof(fspr_wchar_t)); + if ((rv = fspr_conv_utf8_to_ucs2(password, &len, wpassword, &wlen)) != APR_SUCCESS) { if (attr->errfn) { attr->errfn(attr->pool, rv, - apr_pstrcat(attr->pool, + fspr_pstrcat(attr->pool, "utf8 to ucs2 conversion failed" " on password: ", password, NULL)); } @@ -270,10 +270,10 @@ APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, LOGON32_PROVIDER_DEFAULT, &user)) { /* Logon Failed */ - return apr_get_os_error(); + return fspr_get_os_error(); } if (wpassword) - memset(wpassword, 0, wlen * sizeof(apr_wchar_t)); + memset(wpassword, 0, wlen * sizeof(fspr_wchar_t)); /* Get the primary token for user */ if (!DuplicateTokenEx(user, TOKEN_QUERY | TOKEN_DUPLICATE | TOKEN_ASSIGN_PRIMARY, @@ -282,24 +282,24 @@ APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, TokenPrimary, &(attr->user_token))) { /* Failed to duplicate the user token */ - rv = apr_get_os_error(); + rv = fspr_get_os_error(); CloseHandle(user); return rv; } CloseHandle(user); - attr->sd = apr_pcalloc(attr->pool, SECURITY_DESCRIPTOR_MIN_LENGTH); + attr->sd = fspr_pcalloc(attr->pool, SECURITY_DESCRIPTOR_MIN_LENGTH); InitializeSecurityDescriptor(attr->sd, SECURITY_DESCRIPTOR_REVISION); SetSecurityDescriptorDacl(attr->sd, -1, 0, 0); - attr->sa = apr_palloc(attr->pool, sizeof(SECURITY_ATTRIBUTES)); + attr->sa = fspr_palloc(attr->pool, sizeof(SECURITY_ATTRIBUTES)); attr->sa->nLength = sizeof (SECURITY_ATTRIBUTES); attr->sa->lpSecurityDescriptor = attr->sd; attr->sa->bInheritHandle = TRUE; /* register the cleanup */ - apr_pool_cleanup_register(attr->pool, (void *)attr, + fspr_pool_cleanup_register(attr->pool, (void *)attr, attr_cleanup, - apr_pool_cleanup_null); + fspr_pool_cleanup_null); return APR_SUCCESS; } else @@ -307,7 +307,7 @@ APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, #endif } -APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr, +APR_DECLARE(fspr_status_t) fspr_procattr_group_set(fspr_procattr_t *attr, const char *groupname) { /* Always return SUCCESS cause groups are irrelevant */ @@ -318,20 +318,20 @@ static const char* has_space(const char *str) { const char *ch; for (ch = str; *ch; ++ch) { - if (apr_isspace(*ch)) { + if (fspr_isspace(*ch)) { return ch; } } return NULL; } -static char *apr_caret_escape_args(apr_pool_t *p, const char *str) +static char *fspr_caret_escape_args(fspr_pool_t *p, const char *str) { char *cmd; unsigned char *d; const unsigned char *s; - cmd = apr_palloc(p, 2 * strlen(str) + 1); /* Be safe */ + cmd = fspr_palloc(p, 2 * strlen(str) + 1); /* Be safe */ d = (unsigned char *)cmd; s = (const unsigned char *)str; for (; *s; ++s) { @@ -356,36 +356,36 @@ static char *apr_caret_escape_args(apr_pool_t *p, const char *str) return cmd; } -APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr, - apr_child_errfn_t *errfn) +APR_DECLARE(fspr_status_t) fspr_procattr_child_errfn_set(fspr_procattr_t *attr, + fspr_child_errfn_t *errfn) { attr->errfn = errfn; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr, - apr_int32_t chk) +APR_DECLARE(fspr_status_t) fspr_procattr_error_check_set(fspr_procattr_t *attr, + fspr_int32_t chk) { attr->errchk = chk; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr, - apr_int32_t addrspace) +APR_DECLARE(fspr_status_t) fspr_procattr_addrspace_set(fspr_procattr_t *attr, + fspr_int32_t addrspace) { /* won't ever be used on this platform, so don't save the flag */ return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, +APR_DECLARE(fspr_status_t) fspr_proc_create(fspr_proc_t *new, const char *progname, const char * const *args, const char * const *env, - apr_procattr_t *attr, - apr_pool_t *pool) + fspr_procattr_t *attr, + fspr_pool_t *pool) { - apr_status_t rv; - apr_size_t i; + fspr_status_t rv; + fspr_size_t i; const char *argv0; char *cmdline; char *pEnvBlock; @@ -404,7 +404,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, * not manage the stdio handles properly when running old 16 * bit executables if the detached attribute is set. */ - if (apr_os_level >= APR_WIN_NT) { + if (fspr_os_level >= APR_WIN_NT) { /* * XXX DETACHED_PROCESS won't on Win9x at all; on NT/W2K * 16 bit executables fail (MS KB: Q150956) @@ -418,16 +418,16 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, * XXX progname must be NULL if this is a 16 bit app running in WOW */ if (progname[0] == '\"') { - progname = apr_pstrndup(pool, progname + 1, strlen(progname) - 2); + progname = fspr_pstrndup(pool, progname + 1, strlen(progname) - 2); } if (attr->cmdtype == APR_PROGRAM || attr->cmdtype == APR_PROGRAM_ENV) { char *fullpath = NULL; - if ((rv = apr_filepath_merge(&fullpath, attr->currdir, progname, + if ((rv = fspr_filepath_merge(&fullpath, attr->currdir, progname, APR_FILEPATH_NATIVE, pool)) != APR_SUCCESS) { if (attr->errfn) { attr->errfn(pool, rv, - apr_pstrcat(pool, "filepath_merge failed.", + fspr_pstrcat(pool, "filepath_merge failed.", " currdir: ", attr->currdir, " progname: ", progname, NULL)); } @@ -437,21 +437,21 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } else { /* Do not fail if the path isn't parseable for APR_PROGRAM_PATH - * or APR_SHELLCMD. We only invoke apr_filepath_merge (with no + * or APR_SHELLCMD. We only invoke fspr_filepath_merge (with no * left hand side expression) in order to correct the path slash * delimiters. But the filename doesn't need to be in the CWD, * nor does it need to be a filename at all (it could be a * built-in shell command.) */ char *fullpath = NULL; - if ((rv = apr_filepath_merge(&fullpath, "", progname, + if ((rv = fspr_filepath_merge(&fullpath, "", progname, APR_FILEPATH_NATIVE, pool)) == APR_SUCCESS) { progname = fullpath; } } if (has_space(progname)) { - argv0 = apr_pstrcat(pool, "\"", progname, "\"", NULL); + argv0 = fspr_pstrcat(pool, "\"", progname, "\"", NULL); } else { argv0 = progname; @@ -461,10 +461,10 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, cmdline = ""; for (i = 1; args && args[i]; ++i) { if (has_space(args[i]) || !args[i][0]) { - cmdline = apr_pstrcat(pool, cmdline, " \"", args[i], "\"", NULL); + cmdline = fspr_pstrcat(pool, cmdline, " \"", args[i], "\"", NULL); } else { - cmdline = apr_pstrcat(pool, cmdline, " ", args[i], NULL); + cmdline = fspr_pstrcat(pool, cmdline, " ", args[i], NULL); } } @@ -478,22 +478,22 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, return APR_EINVAL; } if (shellcmd[0] == '"') { - progname = apr_pstrndup(pool, shellcmd + 1, strlen(shellcmd) - 2); + progname = fspr_pstrndup(pool, shellcmd + 1, strlen(shellcmd) - 2); } else { progname = shellcmd; if (has_space(shellcmd)) { - shellcmd = apr_pstrcat(pool, "\"", shellcmd, "\"", NULL); + shellcmd = fspr_pstrcat(pool, "\"", shellcmd, "\"", NULL); } } /* Command.com does not support a quoted command, while cmd.exe demands one. */ i = strlen(progname); if (i >= 11 && strcasecmp(progname + i - 11, "command.com") == 0) { - cmdline = apr_pstrcat(pool, shellcmd, " /C ", argv0, cmdline, NULL); + cmdline = fspr_pstrcat(pool, shellcmd, " /C ", argv0, cmdline, NULL); } else { - cmdline = apr_pstrcat(pool, shellcmd, " /C \"", argv0, cmdline, "\"", NULL); + cmdline = fspr_pstrcat(pool, shellcmd, " /C \"", argv0, cmdline, "\"", NULL); } } else @@ -517,12 +517,12 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, return APR_EINVAL; } if (shellcmd[0] == '"') { - progname = apr_pstrndup(pool, shellcmd + 1, strlen(shellcmd) - 2); + progname = fspr_pstrndup(pool, shellcmd + 1, strlen(shellcmd) - 2); } else { progname = shellcmd; if (has_space(shellcmd)) { - shellcmd = apr_pstrcat(pool, "\"", shellcmd, "\"", NULL); + shellcmd = fspr_pstrcat(pool, "\"", shellcmd, "\"", NULL); } } i = strlen(progname); @@ -532,7 +532,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, * until this moment in all four code paths, with some flags * to toggle 'which flavor' is needed. */ - cmdline = apr_pstrcat(pool, shellcmd, " /C ", argv0, cmdline, NULL); + cmdline = fspr_pstrcat(pool, shellcmd, " /C ", argv0, cmdline, NULL); } else { /* We must protect the cmdline args from any interpolation - this @@ -542,16 +542,16 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, * the shift-state to be toggled, and the application will * not see the caret escapes. */ - cmdline = apr_caret_escape_args(pool, cmdline); + cmdline = fspr_caret_escape_args(pool, cmdline); /* * Our app name must always be quoted so the quotes surrounding * the entire /c "command args" are unambigious. */ if (*argv0 != '"') { - cmdline = apr_pstrcat(pool, shellcmd, " /C \"\"", argv0, "\"", cmdline, "\"", NULL); + cmdline = fspr_pstrcat(pool, shellcmd, " /C \"\"", argv0, "\"", cmdline, "\"", NULL); } else { - cmdline = apr_pstrcat(pool, shellcmd, " /C \"", argv0, cmdline, "\"", NULL); + cmdline = fspr_pstrcat(pool, shellcmd, " /C \"", argv0, cmdline, "\"", NULL); } } } @@ -563,7 +563,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, * would succeed, but "c:\bin\aprtest" or "aprtest.exe" * can fail. */ - cmdline = apr_pstrcat(pool, argv0, cmdline, NULL); + cmdline = fspr_pstrcat(pool, argv0, cmdline, NULL); if (attr->cmdtype == APR_PROGRAM_PATH) { progname = NULL; @@ -576,7 +576,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, pEnvBlock = NULL; } else { - apr_size_t iEnvBlockLen; + fspr_size_t iEnvBlockLen; /* * Win32's CreateProcess call requires that the environment * be passed in an environment block, a null terminated block of @@ -594,20 +594,20 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, #if APR_HAS_UNICODE_FS IF_WIN_OS_IS_UNICODE { - apr_wchar_t *pNext; - pEnvBlock = (char *)apr_palloc(pool, iEnvBlockLen * 2); + fspr_wchar_t *pNext; + pEnvBlock = (char *)fspr_palloc(pool, iEnvBlockLen * 2); dwCreationFlags |= CREATE_UNICODE_ENVIRONMENT; i = 0; - pNext = (apr_wchar_t*)pEnvBlock; + pNext = (fspr_wchar_t*)pEnvBlock; while (env[i]) { - apr_size_t in = strlen(env[i]) + 1; - if ((rv = apr_conv_utf8_to_ucs2(env[i], &in, + fspr_size_t in = strlen(env[i]) + 1; + if ((rv = fspr_conv_utf8_to_ucs2(env[i], &in, pNext, &iEnvBlockLen)) != APR_SUCCESS) { if (attr->errfn) { attr->errfn(pool, rv, - apr_pstrcat(pool, + fspr_pstrcat(pool, "utf8 to ucs2 conversion failed" " on this string: ", env[i], NULL)); } @@ -625,7 +625,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, ELSE_WIN_OS_IS_ANSI { char *pNext; - pEnvBlock = (char *)apr_palloc(pool, iEnvBlockLen); + pEnvBlock = (char *)fspr_palloc(pool, iEnvBlockLen); i = 0; pNext = pEnvBlock; @@ -647,19 +647,19 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, IF_WIN_OS_IS_UNICODE { STARTUPINFOW si; - apr_wchar_t *wprg = NULL; - apr_wchar_t *wcmd = NULL; - apr_wchar_t *wcwd = NULL; + fspr_wchar_t *wprg = NULL; + fspr_wchar_t *wcmd = NULL; + fspr_wchar_t *wcwd = NULL; if (progname) { - apr_size_t nprg = strlen(progname) + 1; - apr_size_t nwprg = nprg + 6; - wprg = apr_palloc(pool, nwprg * sizeof(wprg[0])); - if ((rv = apr_conv_utf8_to_ucs2(progname, &nprg, wprg, &nwprg)) + fspr_size_t nprg = strlen(progname) + 1; + fspr_size_t nwprg = nprg + 6; + wprg = fspr_palloc(pool, nwprg * sizeof(wprg[0])); + if ((rv = fspr_conv_utf8_to_ucs2(progname, &nprg, wprg, &nwprg)) != APR_SUCCESS) { if (attr->errfn) { attr->errfn(pool, rv, - apr_pstrcat(pool, + fspr_pstrcat(pool, "utf8 to ucs2 conversion failed" " on progname: ", progname, NULL)); } @@ -668,14 +668,14 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } if (cmdline) { - apr_size_t ncmd = strlen(cmdline) + 1; - apr_size_t nwcmd = ncmd; - wcmd = apr_palloc(pool, nwcmd * sizeof(wcmd[0])); - if ((rv = apr_conv_utf8_to_ucs2(cmdline, &ncmd, wcmd, &nwcmd)) + fspr_size_t ncmd = strlen(cmdline) + 1; + fspr_size_t nwcmd = ncmd; + wcmd = fspr_palloc(pool, nwcmd * sizeof(wcmd[0])); + if ((rv = fspr_conv_utf8_to_ucs2(cmdline, &ncmd, wcmd, &nwcmd)) != APR_SUCCESS) { if (attr->errfn) { attr->errfn(pool, rv, - apr_pstrcat(pool, + fspr_pstrcat(pool, "utf8 to ucs2 conversion failed" " on cmdline: ", cmdline, NULL)); } @@ -685,15 +685,15 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, if (attr->currdir) { - apr_size_t ncwd = strlen(attr->currdir) + 1; - apr_size_t nwcwd = ncwd; - wcwd = apr_palloc(pool, ncwd * sizeof(wcwd[0])); - if ((rv = apr_conv_utf8_to_ucs2(attr->currdir, &ncwd, + fspr_size_t ncwd = strlen(attr->currdir) + 1; + fspr_size_t nwcwd = ncwd; + wcwd = fspr_palloc(pool, ncwd * sizeof(wcwd[0])); + if ((rv = fspr_conv_utf8_to_ucs2(attr->currdir, &ncwd, wcwd, &nwcwd)) != APR_SUCCESS) { if (attr->errfn) { attr->errfn(pool, rv, - apr_pstrcat(pool, + fspr_pstrcat(pool, "utf8 to ucs2 conversion failed" " on currdir: ", attr->currdir, NULL)); } @@ -732,7 +732,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, si.lpDesktop = L"Winsta0\\Default"; if (!ImpersonateLoggedOnUser(attr->user_token)) { /* failed to impersonate the logged user */ - rv = apr_get_os_error(); + rv = fspr_get_os_error(); CloseHandle(attr->user_token); attr->user_token = NULL; return rv; @@ -814,43 +814,43 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, /* Check CreateProcess result */ if (!rv) - return apr_get_os_error(); + return fspr_get_os_error(); - /* XXX Orphaned handle warning - no fix due to broken apr_proc_t api. + /* XXX Orphaned handle warning - no fix due to broken fspr_proc_t api. */ new->hproc = pi.hProcess; new->pid = pi.dwProcessId; if (attr->child_in) { - apr_file_close(attr->child_in); + fspr_file_close(attr->child_in); } if (attr->child_out) { - apr_file_close(attr->child_out); + fspr_file_close(attr->child_out); } if (attr->child_err) { - apr_file_close(attr->child_err); + fspr_file_close(attr->child_err); } CloseHandle(pi.hThread); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, +APR_DECLARE(fspr_status_t) fspr_proc_wait_all_procs(fspr_proc_t *proc, int *exitcode, - apr_exit_why_e *exitwhy, - apr_wait_how_e waithow, - apr_pool_t *p) + fspr_exit_why_e *exitwhy, + fspr_wait_how_e waithow, + fspr_pool_t *p) { - /* Unix does apr_proc_wait(proc(-1), exitcode, exitwhy, waithow) - * but Win32's apr_proc_wait won't work that way. We can either + /* Unix does fspr_proc_wait(proc(-1), exitcode, exitwhy, waithow) + * but Win32's fspr_proc_wait won't work that way. We can either * register all APR created processes in some sort of AsyncWait * thread, or simply walk from the global process pool for all - * apr_pool_note_subprocess()es registered with APR. + * fspr_pool_note_subprocess()es registered with APR. */ return APR_ENOTIMPL; } -static apr_exit_why_e why_from_exit_code(DWORD exit) { +static fspr_exit_why_e why_from_exit_code(DWORD exit) { /* See WinNT.h STATUS_ACCESS_VIOLATION and family for how * this class of failures was determined */ @@ -863,9 +863,9 @@ static apr_exit_why_e why_from_exit_code(DWORD exit) { /* ### No way to tell if Dr Watson grabbed a core, AFAICT. */ } -APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, - int *exitcode, apr_exit_why_e *exitwhy, - apr_wait_how_e waithow) +APR_DECLARE(fspr_status_t) fspr_proc_wait(fspr_proc_t *proc, + int *exitcode, fspr_exit_why_e *exitwhy, + fspr_wait_how_e waithow) { DWORD stat; DWORD time; @@ -889,10 +889,10 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, else if (stat == WAIT_TIMEOUT) { return APR_CHILD_NOTDONE; } - return apr_get_os_error(); + return fspr_get_os_error(); } -APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize) +APR_DECLARE(fspr_status_t) fspr_proc_detach(int daemonize) { return APR_ENOTIMPL; } diff --git a/libs/apr/threadproc/win32/signals.c b/libs/apr/threadproc/win32/signals.c index 5e714931dc..c733c4dbd8 100644 --- a/libs/apr/threadproc/win32/signals.c +++ b/libs/apr/threadproc/win32/signals.c @@ -14,11 +14,11 @@ * limitations under the License. */ -#include "win32/apr_arch_threadproc.h" -#include "win32/apr_arch_file_io.h" -#include "apr_thread_proc.h" -#include "apr_file_io.h" -#include "apr_general.h" +#include "win32/fspr_arch_threadproc.h" +#include "win32/fspr_arch_file_io.h" +#include "fspr_thread_proc.h" +#include "fspr_file_io.h" +#include "fspr_general.h" #if APR_HAVE_SIGNAL_H #include #endif @@ -32,35 +32,35 @@ * ### Actually, closing the input handle to the proc should also do fine * for most console apps. This definately needs improvement... */ -APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int signal) +APR_DECLARE(fspr_status_t) fspr_proc_kill(fspr_proc_t *proc, int signal) { if (proc->hproc != NULL) { if (TerminateProcess(proc->hproc, signal) == 0) { - return apr_get_os_error(); + return fspr_get_os_error(); } - /* On unix, SIGKILL leaves a apr_proc_wait()able pid lying around, - * so we will leave hproc alone until the app calls apr_proc_wait(). + /* On unix, SIGKILL leaves a fspr_proc_wait()able pid lying around, + * so we will leave hproc alone until the app calls fspr_proc_wait(). */ return APR_SUCCESS; } return APR_EPROC_UNKNOWN; } -void apr_signal_init(apr_pool_t *pglobal) +void fspr_signal_init(fspr_pool_t *pglobal) { } -const char *apr_signal_description_get(int signum) +const char *fspr_signal_description_get(int signum) { return "unknown signal (not supported)"; } -APR_DECLARE(apr_status_t) apr_signal_block(int signum) +APR_DECLARE(fspr_status_t) fspr_signal_block(int signum) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_signal_unblock(int signum) +APR_DECLARE(fspr_status_t) fspr_signal_unblock(int signum) { return APR_ENOTIMPL; } diff --git a/libs/apr/threadproc/win32/thread.c b/libs/apr/threadproc/win32/thread.c index 280213f2a1..e049c272db 100644 --- a/libs/apr/threadproc/win32/thread.c +++ b/libs/apr/threadproc/win32/thread.c @@ -14,25 +14,25 @@ * limitations under the License. */ -#include "apr_private.h" -#include "win32/apr_arch_threadproc.h" -#include "apr_thread_proc.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_portable.h" +#include "fspr_private.h" +#include "win32/fspr_arch_threadproc.h" +#include "fspr_thread_proc.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_portable.h" #if APR_HAVE_PROCESS_H #include #endif -#include "apr_arch_misc.h" +#include "fspr_arch_misc.h" -/* Chosen for us by apr_initialize */ -DWORD tls_apr_thread = 0; +/* Chosen for us by fspr_initialize */ +DWORD tls_fspr_thread = 0; -APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_threadattr_create(fspr_threadattr_t **new, + fspr_pool_t *pool) { - (*new) = (apr_threadattr_t *)apr_palloc(pool, - sizeof(apr_threadattr_t)); + (*new) = (fspr_threadattr_t *)fspr_palloc(pool, + sizeof(fspr_threadattr_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -45,51 +45,51 @@ APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, - apr_int32_t on) +APR_DECLARE(fspr_status_t) fspr_threadattr_detach_set(fspr_threadattr_t *attr, + fspr_int32_t on) { attr->detach = on; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr) +APR_DECLARE(fspr_status_t) fspr_threadattr_detach_get(fspr_threadattr_t *attr) { if (attr->detach == 1) return APR_DETACH; return APR_NOTDETACH; } -APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr, - apr_size_t stacksize) +APR_DECLARE(fspr_status_t) fspr_threadattr_stacksize_set(fspr_threadattr_t *attr, + fspr_size_t stacksize) { attr->stacksize = stacksize; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr, - apr_size_t size) +APR_DECLARE(fspr_status_t) fspr_threadattr_guardsize_set(fspr_threadattr_t *attr, + fspr_size_t size) { return APR_ENOTIMPL; } static void *dummy_worker(void *opaque) { - apr_thread_t *thd = (apr_thread_t *)opaque; - TlsSetValue(tls_apr_thread, thd->td); + fspr_thread_t *thd = (fspr_thread_t *)opaque; + TlsSetValue(tls_fspr_thread, thd->td); return thd->func(thd, thd->data); } -APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, - apr_threadattr_t *attr, - apr_thread_start_t func, - void *data, apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_thread_create(fspr_thread_t **new, + fspr_threadattr_t *attr, + fspr_thread_start_t func, + void *data, fspr_pool_t *pool) { - apr_status_t stat; + fspr_status_t stat; unsigned temp; HANDLE handle; int priority = THREAD_PRIORITY_NORMAL; - (*new) = (apr_thread_t *)apr_palloc(pool, sizeof(apr_thread_t)); + (*new) = (fspr_thread_t *)fspr_palloc(pool, sizeof(fspr_thread_t)); if ((*new) == NULL) { return APR_ENOMEM; @@ -99,7 +99,7 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, (*new)->data = data; (*new)->func = func; (*new)->td = NULL; - stat = apr_pool_create(&(*new)->pool, pool); + stat = fspr_pool_create(&(*new)->pool, pool); if (stat != APR_SUCCESS) { return stat; } @@ -131,7 +131,7 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, attr && attr->stacksize > 0 ? attr->stacksize : 0, (unsigned int (APR_THREAD_FUNC *)(void *))dummy_worker, (*new), 0, &temp)) == 0) { - return apr_get_os_error(); + return fspr_get_os_error(); } #endif @@ -148,11 +148,11 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, - apr_status_t retval) +APR_DECLARE(fspr_status_t) fspr_thread_exit(fspr_thread_t *thd, + fspr_status_t retval) { thd->exitval = retval; - apr_pool_destroy(thd->pool); + fspr_pool_destroy(thd->pool); thd->pool = NULL; #ifndef _WIN32_WCE _endthreadex(0); @@ -162,10 +162,10 @@ APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, - apr_thread_t *thd) +APR_DECLARE(fspr_status_t) fspr_thread_join(fspr_status_t *retval, + fspr_thread_t *thd) { - apr_status_t rv = APR_SUCCESS; + fspr_status_t rv = APR_SUCCESS; if (!thd->td) { /* Can not join on detached threads */ @@ -180,25 +180,25 @@ APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, rv = APR_INCOMPLETE; } else - rv = apr_get_os_error(); + rv = fspr_get_os_error(); CloseHandle(thd->td); thd->td = NULL; return rv; } -APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd) +APR_DECLARE(fspr_status_t) fspr_thread_detach(fspr_thread_t *thd) { if (thd->td && CloseHandle(thd->td)) { thd->td = NULL; return APR_SUCCESS; } else { - return apr_get_os_error(); + return fspr_get_os_error(); } } -APR_DECLARE(void) apr_thread_yield() +APR_DECLARE(void) fspr_thread_yield() { /* SwitchToThread is not supported on Win9x, but since it's * primarily a noop (entering time consuming code, therefore @@ -206,29 +206,29 @@ APR_DECLARE(void) apr_thread_yield() * we won't worry too much if it's not available. */ #ifndef _WIN32_WCE - if (apr_os_level >= APR_WIN_NT) { + if (fspr_os_level >= APR_WIN_NT) { SwitchToThread(); } #endif } -APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, - apr_thread_t *thread) +APR_DECLARE(fspr_status_t) fspr_thread_data_get(void **data, const char *key, + fspr_thread_t *thread) { - return apr_pool_userdata_get(data, key, thread->pool); + return fspr_pool_userdata_get(data, key, thread->pool); } -APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_thread_t *thread) +APR_DECLARE(fspr_status_t) fspr_thread_data_set(void *data, const char *key, + fspr_status_t (*cleanup) (void *), + fspr_thread_t *thread) { - return apr_pool_userdata_set(data, key, cleanup, thread->pool); + return fspr_pool_userdata_set(data, key, cleanup, thread->pool); } -APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void) +APR_DECLARE(fspr_os_thread_t) fspr_os_thread_current(void) { - HANDLE hthread = (HANDLE)TlsGetValue(tls_apr_thread); + HANDLE hthread = (HANDLE)TlsGetValue(tls_fspr_thread); HANDLE hproc; if (hthread) { @@ -242,12 +242,12 @@ APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void) DUPLICATE_SAME_ACCESS)) { return NULL; } - TlsSetValue(tls_apr_thread, hthread); + TlsSetValue(tls_fspr_thread, hthread); return hthread; } -APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, - apr_thread_t *thd) +APR_DECLARE(fspr_status_t) fspr_os_thread_get(fspr_os_thread_t **thethd, + fspr_thread_t *thd) { if (thd == NULL) { return APR_ENOTHREAD; @@ -256,29 +256,29 @@ APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, - apr_os_thread_t *thethd, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_thread_put(fspr_thread_t **thd, + fspr_os_thread_t *thethd, + fspr_pool_t *pool) { if (pool == NULL) { return APR_ENOPOOL; } if ((*thd) == NULL) { - (*thd) = (apr_thread_t *)apr_palloc(pool, sizeof(apr_thread_t)); + (*thd) = (fspr_thread_t *)fspr_palloc(pool, sizeof(fspr_thread_t)); (*thd)->pool = pool; } (*thd)->td = thethd; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_thread_once_init(fspr_thread_once_t **control, + fspr_pool_t *p) { - (*control) = apr_pcalloc(p, sizeof(**control)); + (*control) = fspr_pcalloc(p, sizeof(**control)); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, +APR_DECLARE(fspr_status_t) fspr_thread_once(fspr_thread_once_t *control, void (*func)(void)) { if (!InterlockedExchange(&control->value, 1)) { @@ -287,11 +287,11 @@ APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, return APR_SUCCESS; } -APR_DECLARE(int) apr_os_thread_equal(apr_os_thread_t tid1, - apr_os_thread_t tid2) +APR_DECLARE(int) fspr_os_thread_equal(fspr_os_thread_t tid1, + fspr_os_thread_t tid2) { /* Since the only tid's we support our are own, and - * apr_os_thread_current returns the identical handle + * fspr_os_thread_current returns the identical handle * to the one we created initially, the test is simple. */ return (tid1 == tid2); diff --git a/libs/apr/threadproc/win32/threadpriv.c b/libs/apr/threadproc/win32/threadpriv.c index 9ddc24fbd1..3f9530ab6e 100644 --- a/libs/apr/threadproc/win32/threadpriv.c +++ b/libs/apr/threadproc/win32/threadpriv.c @@ -14,18 +14,18 @@ * limitations under the License. */ -#include "win32/apr_arch_threadproc.h" -#include "apr_thread_proc.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_errno.h" -#include "apr_portable.h" +#include "win32/fspr_arch_threadproc.h" +#include "fspr_thread_proc.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_errno.h" +#include "fspr_portable.h" -APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, +APR_DECLARE(fspr_status_t) fspr_threadkey_private_create(fspr_threadkey_t **key, void (*dest)(void *), - apr_pool_t *pool) + fspr_pool_t *pool) { - (*key) = (apr_threadkey_t *)apr_palloc(pool, sizeof(apr_threadkey_t)); + (*key) = (fspr_threadkey_t *)fspr_palloc(pool, sizeof(fspr_threadkey_t)); if ((*key) == NULL) { return APR_ENOMEM; } @@ -35,64 +35,64 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, if (((*key)->key = TlsAlloc()) != 0xFFFFFFFF) { return APR_SUCCESS; } - return apr_get_os_error(); + return fspr_get_os_error(); } -APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new, - apr_threadkey_t *key) +APR_DECLARE(fspr_status_t) fspr_threadkey_private_get(void **new, + fspr_threadkey_t *key) { if ((*new) = TlsGetValue(key->key)) { return APR_SUCCESS; } - return apr_get_os_error(); + return fspr_get_os_error(); } -APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, - apr_threadkey_t *key) +APR_DECLARE(fspr_status_t) fspr_threadkey_private_set(void *priv, + fspr_threadkey_t *key) { if (TlsSetValue(key->key, priv)) { return APR_SUCCESS; } - return apr_get_os_error(); + return fspr_get_os_error(); } -APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key) +APR_DECLARE(fspr_status_t) fspr_threadkey_private_delete(fspr_threadkey_t *key) { if (TlsFree(key->key)) { return APR_SUCCESS; } - return apr_get_os_error(); + return fspr_get_os_error(); } -APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key, - apr_threadkey_t *threadkey) +APR_DECLARE(fspr_status_t) fspr_threadkey_data_get(void **data, const char *key, + fspr_threadkey_t *threadkey) { - return apr_pool_userdata_get(data, key, threadkey->pool); + return fspr_pool_userdata_get(data, key, threadkey->pool); } -APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key, - apr_status_t (*cleanup)(void *), - apr_threadkey_t *threadkey) +APR_DECLARE(fspr_status_t) fspr_threadkey_data_set(void *data, const char *key, + fspr_status_t (*cleanup)(void *), + fspr_threadkey_t *threadkey) { - return apr_pool_userdata_set(data, key, cleanup, threadkey->pool); + return fspr_pool_userdata_set(data, key, cleanup, threadkey->pool); } -APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, - apr_threadkey_t *key) +APR_DECLARE(fspr_status_t) fspr_os_threadkey_get(fspr_os_threadkey_t *thekey, + fspr_threadkey_t *key) { *thekey = key->key; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, - apr_os_threadkey_t *thekey, - apr_pool_t *pool) +APR_DECLARE(fspr_status_t) fspr_os_threadkey_put(fspr_threadkey_t **key, + fspr_os_threadkey_t *thekey, + fspr_pool_t *pool) { if (pool == NULL) { return APR_ENOPOOL; } if ((*key) == NULL) { - (*key) = (apr_threadkey_t *)apr_palloc(pool, sizeof(apr_threadkey_t)); + (*key) = (fspr_threadkey_t *)fspr_palloc(pool, sizeof(fspr_threadkey_t)); (*key)->pool = pool; } (*key)->key = *thekey; diff --git a/libs/apr/time/unix/time.c b/libs/apr/time/unix/time.c index dfa45e690c..8e77d740d3 100644 --- a/libs/apr/time/unix/time.c +++ b/libs/apr/time/unix/time.c @@ -14,14 +14,14 @@ * limitations under the License. */ -#include "apr_portable.h" -#include "apr_time.h" -#include "apr_lib.h" -#include "apr_private.h" -#include "apr_strings.h" +#include "fspr_portable.h" +#include "fspr_time.h" +#include "fspr_lib.h" +#include "fspr_private.h" +#include "fspr_strings.h" /* private APR headers */ -#include "apr_arch_internal_time.h" +#include "fspr_arch_internal_time.h" /* System Headers required for time library */ #if APR_HAVE_SYS_TIME_H @@ -36,11 +36,11 @@ /* End System Headers */ #if !defined(HAVE_STRUCT_TM_TM_GMTOFF) && !defined(HAVE_STRUCT_TM___TM_GMTOFF) -static apr_int32_t server_gmt_offset; +static fspr_int32_t server_gmt_offset; #define NO_GMTOFF_IN_STRUCT_TM #endif -static apr_int32_t get_offset(struct tm *tm) +static fspr_int32_t get_offset(struct tm *tm) { #if defined(HAVE_STRUCT_TM_TM_GMTOFF) return tm->tm_gmtoff; @@ -63,23 +63,23 @@ static apr_int32_t get_offset(struct tm *tm) #endif } -APR_DECLARE(apr_status_t) apr_time_ansi_put(apr_time_t *result, +APR_DECLARE(fspr_status_t) fspr_time_ansi_put(fspr_time_t *result, time_t input) { - *result = (apr_time_t)input * APR_USEC_PER_SEC; + *result = (fspr_time_t)input * APR_USEC_PER_SEC; return APR_SUCCESS; } /* NB NB NB NB This returns GMT!!!!!!!!!! */ -APR_DECLARE(apr_time_t) apr_time_now(void) +APR_DECLARE(fspr_time_t) fspr_time_now(void) { struct timeval tv; gettimeofday(&tv, NULL); return tv.tv_sec * APR_USEC_PER_SEC + tv.tv_usec; } -static void explode_time(apr_time_exp_t *xt, apr_time_t t, - apr_int32_t offset, int use_localtime) +static void explode_time(fspr_time_exp_t *xt, fspr_time_t t, + fspr_int32_t offset, int use_localtime) { struct tm tm; time_t tt = (t / APR_USEC_PER_SEC) + offset; @@ -109,36 +109,36 @@ static void explode_time(apr_time_exp_t *xt, apr_time_t t, xt->tm_gmtoff = get_offset(&tm); } -APR_DECLARE(apr_status_t) apr_time_exp_tz(apr_time_exp_t *result, - apr_time_t input, apr_int32_t offs) +APR_DECLARE(fspr_status_t) fspr_time_exp_tz(fspr_time_exp_t *result, + fspr_time_t input, fspr_int32_t offs) { explode_time(result, input, offs, 0); result->tm_gmtoff = offs; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_time_exp_gmt(apr_time_exp_t *result, - apr_time_t input) +APR_DECLARE(fspr_status_t) fspr_time_exp_gmt(fspr_time_exp_t *result, + fspr_time_t input) { - return apr_time_exp_tz(result, input, 0); + return fspr_time_exp_tz(result, input, 0); } -APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, - apr_time_t input) +APR_DECLARE(fspr_status_t) fspr_time_exp_lt(fspr_time_exp_t *result, + fspr_time_t input) { #if defined(__EMX__) /* EMX gcc (OS/2) has a timezone global we can use */ - return apr_time_exp_tz(result, input, -timezone); + return fspr_time_exp_tz(result, input, -timezone); #else explode_time(result, input, 0, 1); return APR_SUCCESS; #endif /* __EMX__ */ } -APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *t, apr_time_exp_t *xt) +APR_DECLARE(fspr_status_t) fspr_time_exp_get(fspr_time_t *t, fspr_time_exp_t *xt) { - apr_time_t year = xt->tm_year; - apr_time_t days; + fspr_time_t year = xt->tm_year; + fspr_time_t days; static const int dayoffset[12] = {306, 337, 0, 31, 61, 92, 122, 153, 184, 214, 245, 275}; @@ -161,25 +161,25 @@ APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *t, apr_time_exp_t *xt) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_time_exp_gmt_get(apr_time_t *t, - apr_time_exp_t *xt) +APR_DECLARE(fspr_status_t) fspr_time_exp_gmt_get(fspr_time_t *t, + fspr_time_exp_t *xt) { - apr_status_t status = apr_time_exp_get(t, xt); + fspr_status_t status = fspr_time_exp_get(t, xt); if (status == APR_SUCCESS) - *t -= (apr_time_t) xt->tm_gmtoff * APR_USEC_PER_SEC; + *t -= (fspr_time_t) xt->tm_gmtoff * APR_USEC_PER_SEC; return status; } -APR_DECLARE(apr_status_t) apr_os_imp_time_get(apr_os_imp_time_t **ostime, - apr_time_t *aprtime) +APR_DECLARE(fspr_status_t) fspr_os_imp_time_get(fspr_os_imp_time_t **ostime, + fspr_time_t *aprtime) { (*ostime)->tv_usec = *aprtime % APR_USEC_PER_SEC; (*ostime)->tv_sec = *aprtime / APR_USEC_PER_SEC; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_exp_time_get(apr_os_exp_time_t **ostime, - apr_time_exp_t *aprtime) +APR_DECLARE(fspr_status_t) fspr_os_exp_time_get(fspr_os_exp_time_t **ostime, + fspr_time_exp_t *aprtime) { (*ostime)->tm_sec = aprtime->tm_sec; (*ostime)->tm_min = aprtime->tm_min; @@ -200,17 +200,17 @@ APR_DECLARE(apr_status_t) apr_os_exp_time_get(apr_os_exp_time_t **ostime, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_imp_time_put(apr_time_t *aprtime, - apr_os_imp_time_t **ostime, - apr_pool_t *cont) +APR_DECLARE(fspr_status_t) fspr_os_imp_time_put(fspr_time_t *aprtime, + fspr_os_imp_time_t **ostime, + fspr_pool_t *cont) { *aprtime = (*ostime)->tv_sec * APR_USEC_PER_SEC + (*ostime)->tv_usec; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_time_exp_t *aprtime, - apr_os_exp_time_t **ostime, - apr_pool_t *cont) +APR_DECLARE(fspr_status_t) fspr_os_exp_time_put(fspr_time_exp_t *aprtime, + fspr_os_exp_time_t **ostime, + fspr_pool_t *cont) { aprtime->tm_sec = (*ostime)->tm_sec; aprtime->tm_min = (*ostime)->tm_min; @@ -231,7 +231,7 @@ APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_time_exp_t *aprtime, return APR_SUCCESS; } -APR_DECLARE(void) apr_sleep(apr_interval_time_t t) +APR_DECLARE(void) fspr_sleep(fspr_interval_time_t t) { #ifdef OS2 DosSleep(t/1000); @@ -248,7 +248,7 @@ APR_DECLARE(void) apr_sleep(apr_interval_time_t t) } #ifdef OS2 -APR_DECLARE(apr_status_t) apr_os2_time_to_apr_time(apr_time_t *result, +APR_DECLARE(fspr_status_t) fspr_os2_time_to_fspr_time(fspr_time_t *result, FDATE os2date, FTIME os2time) { @@ -268,9 +268,9 @@ APR_DECLARE(apr_status_t) apr_os2_time_to_apr_time(apr_time_t *result, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_apr_time_to_os2_time(FDATE *os2date, +APR_DECLARE(fspr_status_t) fspr_fspr_time_to_os2_time(FDATE *os2date, FTIME *os2time, - apr_time_t aprtime) + fspr_time_t aprtime) { time_t ansitime = aprtime / APR_USEC_PER_SEC; struct tm *lt; @@ -287,13 +287,13 @@ APR_DECLARE(apr_status_t) apr_apr_time_to_os2_time(FDATE *os2date, #endif #ifdef NETWARE -APR_DECLARE(void) apr_netware_setup_time(void) +APR_DECLARE(void) fspr_netware_setup_time(void) { tzset(); server_gmt_offset = -TZONE; } #else -APR_DECLARE(void) apr_unix_setup_time(void) +APR_DECLARE(void) fspr_unix_setup_time(void) { #ifdef NO_GMTOFF_IN_STRUCT_TM /* Precompute the offset from GMT on systems where it's not @@ -334,14 +334,14 @@ APR_DECLARE(void) apr_unix_setup_time(void) #endif t.tm_isdst = 0; /* we know this GMT time isn't daylight-savings */ t2 = mktime(&t); - server_gmt_offset = (apr_int32_t) difftime(t1, t2); + server_gmt_offset = (fspr_int32_t) difftime(t1, t2); #endif /* NO_GMTOFF_IN_STRUCT_TM */ } #endif /* A noop on all known Unix implementations */ -APR_DECLARE(void) apr_time_clock_hires(apr_pool_t *p) +APR_DECLARE(void) fspr_time_clock_hires(fspr_pool_t *p) { return; } diff --git a/libs/apr/time/unix/timestr.c b/libs/apr/time/unix/timestr.c index f74febac19..3519f26d23 100644 --- a/libs/apr/time/unix/timestr.c +++ b/libs/apr/time/unix/timestr.c @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "apr_portable.h" -#include "apr_time.h" -#include "apr_lib.h" -#include "apr_private.h" +#include "fspr_portable.h" +#include "fspr_time.h" +#include "fspr_lib.h" +#include "fspr_private.h" /* System Headers required for time library */ #if APR_HAVE_SYS_TIME_H #include @@ -30,27 +30,27 @@ #endif /* End System Headers */ -APR_DECLARE_DATA const char apr_month_snames[12][4] = +APR_DECLARE_DATA const char fspr_month_snames[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; -APR_DECLARE_DATA const char apr_day_snames[7][4] = +APR_DECLARE_DATA const char fspr_day_snames[7][4] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; -apr_status_t apr_rfc822_date(char *date_str, apr_time_t t) +fspr_status_t fspr_rfc822_date(char *date_str, fspr_time_t t) { - apr_time_exp_t xt; + fspr_time_exp_t xt; const char *s; int real_year; - apr_time_exp_gmt(&xt, t); + fspr_time_exp_gmt(&xt, t); /* example: "Sat, 08 Jan 2000 18:31:41 GMT" */ /* 12345678901234567890123456789 */ - s = &apr_day_snames[xt.tm_wday][0]; + s = &fspr_day_snames[xt.tm_wday][0]; *date_str++ = *s++; *date_str++ = *s++; *date_str++ = *s++; @@ -59,7 +59,7 @@ apr_status_t apr_rfc822_date(char *date_str, apr_time_t t) *date_str++ = xt.tm_mday / 10 + '0'; *date_str++ = xt.tm_mday % 10 + '0'; *date_str++ = ' '; - s = &apr_month_snames[xt.tm_mon][0]; + s = &fspr_month_snames[xt.tm_mon][0]; *date_str++ = *s++; *date_str++ = *s++; *date_str++ = *s++; @@ -87,22 +87,22 @@ apr_status_t apr_rfc822_date(char *date_str, apr_time_t t) return APR_SUCCESS; } -apr_status_t apr_ctime(char *date_str, apr_time_t t) +fspr_status_t fspr_ctime(char *date_str, fspr_time_t t) { - apr_time_exp_t xt; + fspr_time_exp_t xt; const char *s; int real_year; /* example: "Wed Jun 30 21:49:08 1993" */ /* 123456789012345678901234 */ - apr_time_exp_lt(&xt, t); - s = &apr_day_snames[xt.tm_wday][0]; + fspr_time_exp_lt(&xt, t); + s = &fspr_day_snames[xt.tm_wday][0]; *date_str++ = *s++; *date_str++ = *s++; *date_str++ = *s++; *date_str++ = ' '; - s = &apr_month_snames[xt.tm_mon][0]; + s = &fspr_month_snames[xt.tm_mon][0]; *date_str++ = *s++; *date_str++ = *s++; *date_str++ = *s++; @@ -129,8 +129,8 @@ apr_status_t apr_ctime(char *date_str, apr_time_t t) return APR_SUCCESS; } -apr_status_t apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, - const char *format, apr_time_exp_t *xt) +fspr_status_t fspr_strftime(char *s, fspr_size_t *retsize, fspr_size_t max, + const char *format, fspr_time_exp_t *xt) { struct tm tm; memset(&tm, 0, sizeof tm); diff --git a/libs/apr/time/win32/access.c b/libs/apr/time/win32/access.c index cd25e2f0bf..189e06d19c 100644 --- a/libs/apr/time/win32/access.c +++ b/libs/apr/time/win32/access.c @@ -14,12 +14,12 @@ * limitations under the License. */ -#include "win32/apr_arch_atime.h" -#include "apr_time.h" -#include "apr_general.h" -#include "apr_lib.h" +#include "win32/fspr_arch_atime.h" +#include "fspr_time.h" +#include "fspr_general.h" +#include "fspr_lib.h" -apr_status_t apr_get_curtime(struct atime_t *time, apr_time_t *rv) +fspr_status_t fspr_get_curtime(struct atime_t *time, fspr_time_t *rv) { if (time) { (*rv) = time->currtime; @@ -28,7 +28,7 @@ apr_status_t apr_get_curtime(struct atime_t *time, apr_time_t *rv) return APR_ENOTIME; } -apr_status_t apr_get_sec(struct atime_t *time, apr_int32_t *rv) +fspr_status_t fspr_get_sec(struct atime_t *time, fspr_int32_t *rv) { if (time) { (*rv) = time->explodedtime->wSecond; @@ -37,7 +37,7 @@ apr_status_t apr_get_sec(struct atime_t *time, apr_int32_t *rv) return APR_ENOTIME; } -apr_status_t apr_get_min(struct atime_t *time, apr_int32_t *rv) +fspr_status_t fspr_get_min(struct atime_t *time, fspr_int32_t *rv) { if (time) { (*rv) = time->explodedtime->wMinute; @@ -46,7 +46,7 @@ apr_status_t apr_get_min(struct atime_t *time, apr_int32_t *rv) return APR_ENOTIME; } -apr_status_t apr_get_hour(struct atime_t *time, apr_int32_t *rv) +fspr_status_t fspr_get_hour(struct atime_t *time, fspr_int32_t *rv) { if (time) { (*rv) = time->explodedtime->wHour; @@ -55,7 +55,7 @@ apr_status_t apr_get_hour(struct atime_t *time, apr_int32_t *rv) return APR_ENOTIME; } -apr_status_t apr_get_mday(struct atime_t *time, apr_int32_t *rv) +fspr_status_t fspr_get_mday(struct atime_t *time, fspr_int32_t *rv) { if (time) { (*rv) = time->explodedtime->wDay; @@ -64,7 +64,7 @@ apr_status_t apr_get_mday(struct atime_t *time, apr_int32_t *rv) return APR_ENOTIME; } -apr_status_t apr_get_mon(struct atime_t *time, apr_int32_t *rv) +fspr_status_t fspr_get_mon(struct atime_t *time, fspr_int32_t *rv) { if (time) { (*rv) = time->explodedtime->wMonth; @@ -73,7 +73,7 @@ apr_status_t apr_get_mon(struct atime_t *time, apr_int32_t *rv) return APR_ENOTIME; } -apr_status_t apr_get_year(struct atime_t *time, apr_int32_t *rv) +fspr_status_t fspr_get_year(struct atime_t *time, fspr_int32_t *rv) { if (time) { (*rv) = time->explodedtime->wYear; @@ -82,7 +82,7 @@ apr_status_t apr_get_year(struct atime_t *time, apr_int32_t *rv) return APR_ENOTIME; } -apr_status_t apr_get_wday(struct atime_t *time, apr_int32_t *rv) +fspr_status_t fspr_get_wday(struct atime_t *time, fspr_int32_t *rv) { if (time) { (*rv) = time->explodedtime->wDayOfWeek; @@ -91,13 +91,13 @@ apr_status_t apr_get_wday(struct atime_t *time, apr_int32_t *rv) return APR_ENOTIME; } -apr_status_t apr_set_sec(struct atime_t *time, apr_int32_t value) +fspr_status_t fspr_set_sec(struct atime_t *time, fspr_int32_t value) { if (!time) { return APR_ENOTIME; } if (time->explodedtime == NULL) { - time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt, + time->explodedtime = (SYSTEMTIME *)fspr_pcalloc(time->cntxt, sizeof(SYSTEMTIME)); } if (time->explodedtime == NULL) { @@ -107,13 +107,13 @@ apr_status_t apr_set_sec(struct atime_t *time, apr_int32_t value) return APR_SUCCESS; } -apr_status_t apr_set_min(struct atime_t *time, apr_int32_t value) +fspr_status_t fspr_set_min(struct atime_t *time, fspr_int32_t value) { if (!time) { return APR_ENOTIME; } if (time->explodedtime == NULL) { - time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt, + time->explodedtime = (SYSTEMTIME *)fspr_pcalloc(time->cntxt, sizeof(SYSTEMTIME)); } if (time->explodedtime == NULL) { @@ -123,13 +123,13 @@ apr_status_t apr_set_min(struct atime_t *time, apr_int32_t value) return APR_SUCCESS; } -apr_status_t apr_set_hour(struct atime_t *time, apr_int32_t value) +fspr_status_t fspr_set_hour(struct atime_t *time, fspr_int32_t value) { if (!time) { return APR_ENOTIME; } if (time->explodedtime == NULL) { - time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt, + time->explodedtime = (SYSTEMTIME *)fspr_pcalloc(time->cntxt, sizeof(SYSTEMTIME)); } if (time->explodedtime == NULL) { @@ -139,13 +139,13 @@ apr_status_t apr_set_hour(struct atime_t *time, apr_int32_t value) return APR_SUCCESS; } -apr_status_t apr_set_mday(struct atime_t *time, apr_int32_t value) +fspr_status_t fspr_set_mday(struct atime_t *time, fspr_int32_t value) { if (!time) { return APR_ENOTIME; } if (time->explodedtime == NULL) { - time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt, + time->explodedtime = (SYSTEMTIME *)fspr_pcalloc(time->cntxt, sizeof(SYSTEMTIME)); } if (time->explodedtime == NULL) { @@ -155,13 +155,13 @@ apr_status_t apr_set_mday(struct atime_t *time, apr_int32_t value) return APR_SUCCESS; } -apr_status_t apr_set_mon(struct atime_t *time, apr_int32_t value) +fspr_status_t fspr_set_mon(struct atime_t *time, fspr_int32_t value) { if (!time) { return APR_ENOTIME; } if (time->explodedtime == NULL) { - time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt, + time->explodedtime = (SYSTEMTIME *)fspr_pcalloc(time->cntxt, sizeof(SYSTEMTIME)); } if (time->explodedtime == NULL) { @@ -171,13 +171,13 @@ apr_status_t apr_set_mon(struct atime_t *time, apr_int32_t value) return APR_SUCCESS; } -apr_status_t apr_set_year(struct atime_t *time, apr_int32_t value) +fspr_status_t fspr_set_year(struct atime_t *time, fspr_int32_t value) { if (!time) { return APR_ENOTIME; } if (time->explodedtime == NULL) { - time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt, + time->explodedtime = (SYSTEMTIME *)fspr_pcalloc(time->cntxt, sizeof(SYSTEMTIME)); } if (time->explodedtime == NULL) { @@ -187,13 +187,13 @@ apr_status_t apr_set_year(struct atime_t *time, apr_int32_t value) return APR_SUCCESS; } -apr_status_t apr_set_wday(struct atime_t *time, apr_int32_t value) +fspr_status_t fspr_set_wday(struct atime_t *time, fspr_int32_t value) { if (!time) { return APR_ENOTIME; } if (time->explodedtime == NULL) { - time->explodedtime = (SYSTEMTIME *)apr_pcalloc(time->cntxt, + time->explodedtime = (SYSTEMTIME *)fspr_pcalloc(time->cntxt, sizeof(SYSTEMTIME)); } if (time->explodedtime == NULL) { diff --git a/libs/apr/time/win32/time.c b/libs/apr/time/win32/time.c index 6a2b2737de..3dd473a8b4 100644 --- a/libs/apr/time/win32/time.c +++ b/libs/apr/time/win32/time.c @@ -14,11 +14,11 @@ * limitations under the License. */ -#include "win32/apr_arch_atime.h" -#include "apr_time.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_portable.h" +#include "win32/fspr_arch_atime.h" +#include "fspr_time.h" +#include "fspr_general.h" +#include "fspr_lib.h" +#include "fspr_portable.h" #if APR_HAVE_TIME_H #include #endif @@ -27,7 +27,7 @@ #endif #include #include -#include "apr_arch_misc.h" +#include "fspr_arch_misc.h" /* Leap year is any year divisible by four, but not by 100 unless also * divisible by 400 @@ -49,7 +49,7 @@ static DWORD get_local_timezone(TIME_ZONE_INFORMATION **tzresult) return result; } -static void SystemTimeToAprExpTime(apr_time_exp_t *xt, SYSTEMTIME *tm) +static void SystemTimeToAprExpTime(fspr_time_exp_t *xt, SYSTEMTIME *tm) { static const int dayoffset[12] = {0, 31, 59, 90, 120, 151, 182, 212, 243, 273, 304, 334}; @@ -76,15 +76,15 @@ static void SystemTimeToAprExpTime(apr_time_exp_t *xt, SYSTEMTIME *tm) xt->tm_yday++; } -APR_DECLARE(apr_status_t) apr_time_ansi_put(apr_time_t *result, +APR_DECLARE(fspr_status_t) fspr_time_ansi_put(fspr_time_t *result, time_t input) { - *result = (apr_time_t) input * APR_USEC_PER_SEC; + *result = (fspr_time_t) input * APR_USEC_PER_SEC; return APR_SUCCESS; } /* Return micro-seconds since the Unix epoch (jan. 1, 1970) UTC */ -APR_DECLARE(apr_time_t) apr_time_now(void) +APR_DECLARE(fspr_time_t) fspr_time_now(void) { LONGLONG aprtime = 0; FILETIME time; @@ -99,8 +99,8 @@ APR_DECLARE(apr_time_t) apr_time_now(void) return aprtime; } -APR_DECLARE(apr_status_t) apr_time_exp_gmt(apr_time_exp_t *result, - apr_time_t input) +APR_DECLARE(fspr_status_t) fspr_time_exp_gmt(fspr_time_exp_t *result, + fspr_time_t input) { FILETIME ft; SYSTEMTIME st; @@ -110,13 +110,13 @@ APR_DECLARE(apr_status_t) apr_time_exp_gmt(apr_time_exp_t *result, * generally UTC, so no timezone info needed */ SystemTimeToAprExpTime(result, &st); - result->tm_usec = (apr_int32_t) (input % APR_USEC_PER_SEC); + result->tm_usec = (fspr_int32_t) (input % APR_USEC_PER_SEC); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_time_exp_tz(apr_time_exp_t *result, - apr_time_t input, - apr_int32_t offs) +APR_DECLARE(fspr_status_t) fspr_time_exp_tz(fspr_time_exp_t *result, + fspr_time_t input, + fspr_int32_t offs) { FILETIME ft; SYSTEMTIME st; @@ -126,13 +126,13 @@ APR_DECLARE(apr_status_t) apr_time_exp_tz(apr_time_exp_t *result, * generally UTC, so we will simply note the offs used. */ SystemTimeToAprExpTime(result, &st); - result->tm_usec = (apr_int32_t) (input % APR_USEC_PER_SEC); + result->tm_usec = (fspr_int32_t) (input % APR_USEC_PER_SEC); result->tm_gmtoff = offs; return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, - apr_time_t input) +APR_DECLARE(fspr_status_t) fspr_time_exp_lt(fspr_time_exp_t *result, + fspr_time_t input) { SYSTEMTIME st; FILETIME ft, localft; @@ -144,7 +144,7 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, { TIME_ZONE_INFORMATION *tz; SYSTEMTIME localst; - apr_time_t localtime; + fspr_time_t localtime; get_local_timezone(&tz); @@ -158,7 +158,7 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, */ SystemTimeToTzSpecificLocalTime(tz, &st, &localst); SystemTimeToAprExpTime(result, &localst); - result->tm_usec = (apr_int32_t) (input % APR_USEC_PER_SEC); + result->tm_usec = (fspr_int32_t) (input % APR_USEC_PER_SEC); /* Recover the resulting time as an apr time and use the @@ -166,8 +166,8 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, */ SystemTimeToFileTime(&localst, &localft); FileTimeToAprTime(&localtime, &localft); - result->tm_gmtoff = (int)apr_time_sec(localtime) - - (int)apr_time_sec(input); + result->tm_gmtoff = (int)fspr_time_sec(localtime) + - (int)fspr_time_sec(input); /* To compute the dst flag, we compare the expected * local (standard) timezone bias to the delta. @@ -189,7 +189,7 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, FileTimeToLocalFileTime(&ft, &localft); FileTimeToSystemTime(&localft, &st); SystemTimeToAprExpTime(result, &st); - result->tm_usec = (apr_int32_t) (input % APR_USEC_PER_SEC); + result->tm_usec = (fspr_int32_t) (input % APR_USEC_PER_SEC); switch (GetTimeZoneInformation(&tz)) { case TIME_ZONE_ID_UNKNOWN: @@ -216,11 +216,11 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *t, - apr_time_exp_t *xt) +APR_DECLARE(fspr_status_t) fspr_time_exp_get(fspr_time_t *t, + fspr_time_exp_t *xt) { - apr_time_t year = xt->tm_year; - apr_time_t days; + fspr_time_t year = xt->tm_year; + fspr_time_t days; static const int dayoffset[12] = {306, 337, 0, 31, 61, 92, 122, 153, 184, 214, 245, 275}; @@ -244,25 +244,25 @@ APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *t, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_time_exp_gmt_get(apr_time_t *t, - apr_time_exp_t *xt) +APR_DECLARE(fspr_status_t) fspr_time_exp_gmt_get(fspr_time_t *t, + fspr_time_exp_t *xt) { - apr_status_t status = apr_time_exp_get(t, xt); + fspr_status_t status = fspr_time_exp_get(t, xt); if (status == APR_SUCCESS) - *t -= (apr_time_t) xt->tm_gmtoff * APR_USEC_PER_SEC; + *t -= (fspr_time_t) xt->tm_gmtoff * APR_USEC_PER_SEC; return status; } -APR_DECLARE(apr_status_t) apr_os_imp_time_get(apr_os_imp_time_t **ostime, - apr_time_t *aprtime) +APR_DECLARE(fspr_status_t) fspr_os_imp_time_get(fspr_os_imp_time_t **ostime, + fspr_time_t *aprtime) { - /* TODO: Consider not passing in pointer to apr_time_t (e.g., call by value) */ + /* TODO: Consider not passing in pointer to fspr_time_t (e.g., call by value) */ AprTimeToFileTime(*ostime, *aprtime); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_exp_time_get(apr_os_exp_time_t **ostime, - apr_time_exp_t *aprexptime) +APR_DECLARE(fspr_status_t) fspr_os_exp_time_get(fspr_os_exp_time_t **ostime, + fspr_time_exp_t *aprexptime) { (*ostime)->wYear = aprexptime->tm_year + 1900; (*ostime)->wMonth = aprexptime->tm_mon + 1; @@ -275,9 +275,9 @@ APR_DECLARE(apr_status_t) apr_os_exp_time_get(apr_os_exp_time_t **ostime, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_imp_time_put(apr_time_t *aprtime, - apr_os_imp_time_t **ostime, - apr_pool_t *cont) +APR_DECLARE(fspr_status_t) fspr_os_imp_time_put(fspr_time_t *aprtime, + fspr_os_imp_time_t **ostime, + fspr_pool_t *cont) { /* XXX: sanity failure, what is file time, gmt or local ? */ @@ -285,9 +285,9 @@ APR_DECLARE(apr_status_t) apr_os_imp_time_put(apr_time_t *aprtime, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_time_exp_t *aprtime, - apr_os_exp_time_t **ostime, - apr_pool_t *cont) +APR_DECLARE(fspr_status_t) fspr_os_exp_time_put(fspr_time_exp_t *aprtime, + fspr_os_exp_time_t **ostime, + fspr_pool_t *cont) { /* The Platform SDK documents that SYSTEMTIME/FILETIME are * generally UTC, so no timezone info needed @@ -296,7 +296,7 @@ APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_time_exp_t *aprtime, return APR_SUCCESS; } -APR_DECLARE(void) apr_sleep(apr_interval_time_t t) +APR_DECLARE(void) fspr_sleep(fspr_interval_time_t t) { /* One of the few sane situations for a cast, Sleep * is in ms, not us, and passed as a DWORD value @@ -305,14 +305,14 @@ APR_DECLARE(void) apr_sleep(apr_interval_time_t t) } -static apr_status_t clock_restore(void *unsetres) +static fspr_status_t clock_restore(void *unsetres) { ULONG newRes; SetTimerResolution((ULONG)unsetres, FALSE, &newRes); return APR_SUCCESS; } -APR_DECLARE(void) apr_time_clock_hires(apr_pool_t *p) +APR_DECLARE(void) fspr_time_clock_hires(fspr_pool_t *p) { ULONG newRes; /* Timer resolution is stated in 100ns units. Note that TRUE requests the @@ -320,7 +320,7 @@ APR_DECLARE(void) apr_time_clock_hires(apr_pool_t *p) */ if (SetTimerResolution(10000, TRUE, &newRes) == 0 /* STATUS_SUCCESS */) { /* register the cleanup... */ - apr_pool_cleanup_register(p, (void*)10000, clock_restore, - apr_pool_cleanup_null); + fspr_pool_cleanup_register(p, (void*)10000, clock_restore, + fspr_pool_cleanup_null); } } diff --git a/libs/apr/time/win32/timestr.c b/libs/apr/time/win32/timestr.c index af1526497b..606291e0be 100644 --- a/libs/apr/time/win32/timestr.c +++ b/libs/apr/time/win32/timestr.c @@ -14,31 +14,31 @@ * limitations under the License. */ -#include "win32/apr_arch_atime.h" -#include "apr_portable.h" -#include "apr_strings.h" +#include "win32/fspr_arch_atime.h" +#include "fspr_portable.h" +#include "fspr_strings.h" -APR_DECLARE_DATA const char apr_month_snames[12][4] = +APR_DECLARE_DATA const char fspr_month_snames[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; -APR_DECLARE_DATA const char apr_day_snames[7][4] = +APR_DECLARE_DATA const char fspr_day_snames[7][4] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; -APR_DECLARE(apr_status_t) apr_rfc822_date(char *date_str, apr_time_t t) +APR_DECLARE(fspr_status_t) fspr_rfc822_date(char *date_str, fspr_time_t t) { - apr_time_exp_t xt; + fspr_time_exp_t xt; const char *s; int real_year; - apr_time_exp_gmt(&xt, t); + fspr_time_exp_gmt(&xt, t); /* example: "Sat, 08 Jan 2000 18:31:41 GMT" */ /* 12345678901234567890123456789 */ - s = &apr_day_snames[xt.tm_wday][0]; + s = &fspr_day_snames[xt.tm_wday][0]; *date_str++ = *s++; *date_str++ = *s++; *date_str++ = *s++; @@ -47,7 +47,7 @@ APR_DECLARE(apr_status_t) apr_rfc822_date(char *date_str, apr_time_t t) *date_str++ = xt.tm_mday / 10 + '0'; *date_str++ = xt.tm_mday % 10 + '0'; *date_str++ = ' '; - s = &apr_month_snames[xt.tm_mon][0]; + s = &fspr_month_snames[xt.tm_mon][0]; *date_str++ = *s++; *date_str++ = *s++; *date_str++ = *s++; @@ -75,22 +75,22 @@ APR_DECLARE(apr_status_t) apr_rfc822_date(char *date_str, apr_time_t t) return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t) +APR_DECLARE(fspr_status_t) fspr_ctime(char *date_str, fspr_time_t t) { - apr_time_exp_t xt; + fspr_time_exp_t xt; const char *s; int real_year; /* example: "Wed Jun 30 21:49:08 1993" */ /* 123456789012345678901234 */ - apr_time_exp_lt(&xt, t); - s = &apr_day_snames[xt.tm_wday][0]; + fspr_time_exp_lt(&xt, t); + s = &fspr_day_snames[xt.tm_wday][0]; *date_str++ = *s++; *date_str++ = *s++; *date_str++ = *s++; *date_str++ = ' '; - s = &apr_month_snames[xt.tm_mon][0]; + s = &fspr_month_snames[xt.tm_mon][0]; *date_str++ = *s++; *date_str++ = *s++; *date_str++ = *s++; @@ -120,7 +120,7 @@ APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t) #ifndef _WIN32_WCE -apr_size_t win32_strftime_extra(char *s, size_t max, const char *format, +fspr_size_t win32_strftime_extra(char *s, size_t max, const char *format, const struct tm *tm) { /* If the new format string is bigger than max, the result string won't fit @@ -128,7 +128,7 @@ apr_size_t win32_strftime_extra(char *s, size_t max, const char *format, * enough */ char *new_format = (char *) malloc(max + 11); size_t i, j, format_length = strlen(format); - apr_size_t return_value; + fspr_size_t return_value; int length_written; for (i = 0, j = 0; (i < format_length && j < max);) { @@ -138,7 +138,7 @@ apr_size_t win32_strftime_extra(char *s, size_t max, const char *format, } switch (format[i+1]) { case 'C': - length_written = apr_snprintf(new_format + j, max - j, "%2d", + length_written = fspr_snprintf(new_format + j, max - j, "%2d", (tm->tm_year + 1970)/100); j = (length_written == -1) ? max : (j + length_written); i += 2; @@ -166,7 +166,7 @@ apr_size_t win32_strftime_extra(char *s, size_t max, const char *format, j += 8; break; case 'e': - length_written = apr_snprintf(new_format + j, max - j, "%2d", + length_written = fspr_snprintf(new_format + j, max - j, "%2d", tm->tm_mday); j = (length_written == -1) ? max : (j + length_written); i += 2; @@ -192,9 +192,9 @@ apr_size_t win32_strftime_extra(char *s, size_t max, const char *format, #endif -APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize, - apr_size_t max, const char *format, - apr_time_exp_t *xt) +APR_DECLARE(fspr_status_t) fspr_strftime(char *s, fspr_size_t *retsize, + fspr_size_t max, const char *format, + fspr_time_exp_t *xt) { #ifdef _WIN32_WCE return APR_ENOTIMPL; diff --git a/libs/apr/user/netware/groupinfo.c b/libs/apr/user/netware/groupinfo.c index e7cfd9b267..86a22df502 100644 --- a/libs/apr/user/netware/groupinfo.c +++ b/libs/apr/user/netware/groupinfo.c @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "apr_strings.h" -#include "apr_portable.h" -#include "apr_user.h" -#include "apr_private.h" +#include "fspr_strings.h" +#include "fspr_portable.h" +#include "fspr_user.h" +#include "fspr_private.h" #ifdef HAVE_GRP_H #include #endif @@ -28,14 +28,14 @@ #include /* for _POSIX_THREAD_SAFE_FUNCTIONS */ #endif -APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname, apr_gid_t groupid, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_gid_name_get(char **groupname, fspr_gid_t groupid, + fspr_pool_t *p) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *groupid, - const char *groupname, apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_gid_get(fspr_gid_t *groupid, + const char *groupname, fspr_pool_t *p) { return APR_ENOTIMPL; } diff --git a/libs/apr/user/netware/userinfo.c b/libs/apr/user/netware/userinfo.c index b58991b8ea..c5677dab7e 100644 --- a/libs/apr/user/netware/userinfo.c +++ b/libs/apr/user/netware/userinfo.c @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "apr_strings.h" -#include "apr_portable.h" -#include "apr_user.h" -#include "apr_private.h" +#include "fspr_strings.h" +#include "fspr_portable.h" +#include "fspr_user.h" +#include "fspr_private.h" #ifdef HAVE_PWD_H #include #endif @@ -30,25 +30,25 @@ #define PWBUF_SIZE 512 -static apr_status_t getpwnam_safe(const char *username, +static fspr_status_t getpwnam_safe(const char *username, struct passwd *pw, char pwbuf[PWBUF_SIZE]) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_uid_homepath_get(char **dirname, +APR_DECLARE(fspr_status_t) fspr_uid_homepath_get(char **dirname, const char *username, - apr_pool_t *p) + fspr_pool_t *p) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_uid_current(apr_uid_t *uid, - apr_gid_t *gid, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_uid_current(fspr_uid_t *uid, + fspr_gid_t *gid, + fspr_pool_t *p) { return APR_ENOTIMPL; } @@ -56,14 +56,14 @@ APR_DECLARE(apr_status_t) apr_uid_current(apr_uid_t *uid, -APR_DECLARE(apr_status_t) apr_uid_get(apr_uid_t *uid, apr_gid_t *gid, - const char *username, apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_uid_get(fspr_uid_t *uid, fspr_gid_t *gid, + const char *username, fspr_pool_t *p) { return APR_ENOTIMPL; } -APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_uid_name_get(char **username, fspr_uid_t userid, + fspr_pool_t *p) { return APR_ENOTIMPL; } diff --git a/libs/apr/user/unix/groupinfo.c b/libs/apr/user/unix/groupinfo.c index 89ae966b67..994eda17a3 100644 --- a/libs/apr/user/unix/groupinfo.c +++ b/libs/apr/user/unix/groupinfo.c @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "apr_strings.h" -#include "apr_portable.h" -#include "apr_user.h" -#include "apr_private.h" +#include "fspr_strings.h" +#include "fspr_portable.h" +#include "fspr_user.h" +#include "fspr_private.h" #ifdef HAVE_GRP_H #include #endif @@ -28,15 +28,15 @@ #include /* for _POSIX_THREAD_SAFE_FUNCTIONS */ #endif -APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname, apr_gid_t groupid, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_gid_name_get(char **groupname, fspr_gid_t groupid, + fspr_pool_t *p) { struct group *gr; #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R) struct group grp; char grbuf[512]; - apr_status_t rv; + fspr_status_t rv; /* See comment in getpwnam_safe on error handling. */ rv = getgrgid_r(groupid, &grp, grbuf, sizeof(grbuf), &gr); @@ -52,19 +52,19 @@ APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname, apr_gid_t groupid, return errno ? errno : APR_ENOENT; } #endif - *groupname = apr_pstrdup(p, gr->gr_name); + *groupname = fspr_pstrdup(p, gr->gr_name); return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *groupid, - const char *groupname, apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_gid_get(fspr_gid_t *groupid, + const char *groupname, fspr_pool_t *p) { struct group *gr; #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRNAM_R) struct group grp; char grbuf[512]; - apr_status_t rv; + fspr_status_t rv; /* See comment in getpwnam_safe on error handling. */ rv = getgrnam_r(groupname, &grp, grbuf, sizeof(grbuf), &gr); diff --git a/libs/apr/user/unix/userinfo.c b/libs/apr/user/unix/userinfo.c index 8b1d6db808..3cb6c5abb7 100644 --- a/libs/apr/user/unix/userinfo.c +++ b/libs/apr/user/unix/userinfo.c @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "apr_strings.h" -#include "apr_portable.h" -#include "apr_user.h" -#include "apr_private.h" +#include "fspr_strings.h" +#include "fspr_portable.h" +#include "fspr_user.h" +#include "fspr_private.h" #ifdef HAVE_PWD_H #include #endif @@ -28,17 +28,17 @@ #include /* for _POSIX_THREAD_SAFE_FUNCTIONS */ #endif #define APR_WANT_MEMFUNC -#include "apr_want.h" +#include "fspr_want.h" #define PWBUF_SIZE 512 -static apr_status_t getpwnam_safe(const char *username, +static fspr_status_t getpwnam_safe(const char *username, struct passwd *pw, char pwbuf[PWBUF_SIZE]) { struct passwd *pwptr; #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R) - apr_status_t rv; + fspr_status_t rv; /* POSIX defines getpwnam_r() et al to return the error number * rather than set errno, and requires pwptr to be set to NULL if @@ -66,31 +66,31 @@ static apr_status_t getpwnam_safe(const char *username, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_uid_homepath_get(char **dirname, +APR_DECLARE(fspr_status_t) fspr_uid_homepath_get(char **dirname, const char *username, - apr_pool_t *p) + fspr_pool_t *p) { struct passwd pw; char pwbuf[PWBUF_SIZE]; - apr_status_t rv; + fspr_status_t rv; if ((rv = getpwnam_safe(username, &pw, pwbuf)) != APR_SUCCESS) return rv; #ifdef OS2 /* Need to manually add user name for OS/2 */ - *dirname = apr_pstrcat(p, pw.pw_dir, pw.pw_name, NULL); + *dirname = fspr_pstrcat(p, pw.pw_dir, pw.pw_name, NULL); #else - *dirname = apr_pstrdup(p, pw.pw_dir); + *dirname = fspr_pstrdup(p, pw.pw_dir); #endif return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_uid_current(apr_uid_t *uid, - apr_gid_t *gid, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_uid_current(fspr_uid_t *uid, + fspr_gid_t *gid, + fspr_pool_t *p) { *uid = getuid(); *gid = getgid(); @@ -101,12 +101,12 @@ APR_DECLARE(apr_status_t) apr_uid_current(apr_uid_t *uid, -APR_DECLARE(apr_status_t) apr_uid_get(apr_uid_t *uid, apr_gid_t *gid, - const char *username, apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_uid_get(fspr_uid_t *uid, fspr_gid_t *gid, + const char *username, fspr_pool_t *p) { struct passwd pw; char pwbuf[PWBUF_SIZE]; - apr_status_t rv; + fspr_status_t rv; if ((rv = getpwnam_safe(username, &pw, pwbuf)) != APR_SUCCESS) return rv; @@ -117,14 +117,14 @@ APR_DECLARE(apr_status_t) apr_uid_get(apr_uid_t *uid, apr_gid_t *gid, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_uid_name_get(char **username, fspr_uid_t userid, + fspr_pool_t *p) { struct passwd *pw; #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWUID_R) struct passwd pwd; char pwbuf[PWBUF_SIZE]; - apr_status_t rv; + fspr_status_t rv; rv = getpwuid_r(userid, &pwd, pwbuf, sizeof(pwbuf), &pw); if (rv) { @@ -141,6 +141,6 @@ APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid, return errno ? errno : APR_ENOENT; } #endif - *username = apr_pstrdup(p, pw->pw_name); + *username = fspr_pstrdup(p, pw->pw_name); return APR_SUCCESS; } diff --git a/libs/apr/user/win32/groupinfo.c b/libs/apr/user/win32/groupinfo.c index 7739a5428d..5ed18ee323 100644 --- a/libs/apr/user/win32/groupinfo.c +++ b/libs/apr/user/win32/groupinfo.c @@ -14,16 +14,16 @@ * limitations under the License. */ -#include "apr_strings.h" -#include "apr_portable.h" -#include "apr_user.h" -#include "apr_private.h" +#include "fspr_strings.h" +#include "fspr_portable.h" +#include "fspr_user.h" +#include "fspr_private.h" #if APR_HAVE_SYS_TYPES_H #include #endif -APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *gid, - const char *groupname, apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_gid_get(fspr_gid_t *gid, + const char *groupname, fspr_pool_t *p) { #ifdef _WIN32_WCE return APR_ENOTIMPL; @@ -37,11 +37,11 @@ APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *gid, char *pos; if (pos = strchr(groupname, '/')) { - domain = apr_pstrndup(p, groupname, pos - groupname); + domain = fspr_pstrndup(p, groupname, pos - groupname); groupname = pos + 1; } else if (pos = strchr(groupname, '\\')) { - domain = apr_pstrndup(p, groupname, pos - groupname); + domain = fspr_pstrndup(p, groupname, pos - groupname); groupname = pos + 1; } else { @@ -54,22 +54,22 @@ APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *gid, if (sidlen) { /* Give it back on the second pass */ - *gid = apr_palloc(p, sidlen); + *gid = fspr_palloc(p, sidlen); domlen = sizeof(anydomain); rv = LookupAccountName(domain, groupname, *gid, &sidlen, anydomain, &domlen, &sidtype); } if (!sidlen || !rv) { - return apr_get_os_error(); + return fspr_get_os_error(); } return APR_SUCCESS; #endif } -APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname, apr_gid_t groupid, apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_gid_name_get(char **groupname, fspr_gid_t groupid, fspr_pool_t *p) { #ifdef _WIN32_WCE - *groupname = apr_pstrdup(p, "Administrators"); + *groupname = fspr_pstrdup(p, "Administrators"); #else SID_NAME_USE type; char name[MAX_PATH], domain[MAX_PATH]; @@ -77,16 +77,16 @@ APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname, apr_gid_t groupid, if (!groupid) return APR_EINVAL; if (!LookupAccountSid(NULL, groupid, name, &cbname, domain, &cbdomain, &type)) - return apr_get_os_error(); + return fspr_get_os_error(); if (type != SidTypeGroup && type != SidTypeWellKnownGroup && type != SidTypeAlias) return APR_EINVAL; - *groupname = apr_pstrdup(p, name); + *groupname = fspr_pstrdup(p, name); #endif return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_gid_compare(apr_gid_t left, apr_gid_t right) +APR_DECLARE(fspr_status_t) fspr_gid_compare(fspr_gid_t left, fspr_gid_t right) { if (!left || !right) return APR_EINVAL; diff --git a/libs/apr/user/win32/userinfo.c b/libs/apr/user/win32/userinfo.c index aae3f9bec0..28b243d828 100644 --- a/libs/apr/user/win32/userinfo.c +++ b/libs/apr/user/win32/userinfo.c @@ -14,11 +14,11 @@ * limitations under the License. */ -#include "apr_private.h" -#include "apr_strings.h" -#include "apr_portable.h" -#include "apr_user.h" -#include "apr_arch_file_io.h" +#include "fspr_private.h" +#include "fspr_strings.h" +#include "fspr_portable.h" +#include "fspr_user.h" +#include "fspr_arch_file_io.h" #if APR_HAVE_SYS_TYPES_H #include #endif @@ -30,7 +30,7 @@ * depends on IsValidSid(), which internally we better test long * before we get here! */ -void get_sid_string(char *buf, apr_size_t blen, apr_uid_t id) +void get_sid_string(char *buf, fspr_size_t blen, fspr_uid_t id) { PSID_IDENTIFIER_AUTHORITY psia; DWORD nsa; @@ -45,10 +45,10 @@ void get_sid_string(char *buf, apr_size_t blen, apr_uid_t id) + ((DWORD)(psia->Value[3]) << 16) + ((DWORD)(psia->Value[2]) << 24); sa = (DWORD)(psia->Value[1]) + ((DWORD)(psia->Value[0]) << 8); if (sa) { - slen = apr_snprintf(buf, blen, "S-%lu-0x%04x%08x", + slen = fspr_snprintf(buf, blen, "S-%lu-0x%04x%08x", SID_REVISION, sa, nsa); } else { - slen = apr_snprintf(buf, blen, "S-%lu-%lu", + slen = fspr_snprintf(buf, blen, "S-%lu-%lu", SID_REVISION, nsa); } @@ -56,7 +56,7 @@ void get_sid_string(char *buf, apr_size_t blen, apr_uid_t id) */ nsa = *GetSidSubAuthorityCount(id); for (sa = 0; sa < nsa; ++sa) { - slen += apr_snprintf(buf + slen, blen - slen, "-%lu", + slen += fspr_snprintf(buf + slen, blen - slen, "-%lu", *GetSidSubAuthority(id, sa)); } } @@ -64,26 +64,26 @@ void get_sid_string(char *buf, apr_size_t blen, apr_uid_t id) /* Query the ProfileImagePath from the version-specific branch, where the * regkey uses the user's name on 9x, and user's sid string on NT. */ -APR_DECLARE(apr_status_t) apr_uid_homepath_get(char **dirname, +APR_DECLARE(fspr_status_t) fspr_uid_homepath_get(char **dirname, const char *username, - apr_pool_t *p) + fspr_pool_t *p) { #ifdef _WIN32_WCE - *dirname = apr_pstrdup(p, "/My Documents"); + *dirname = fspr_pstrdup(p, "/My Documents"); return APR_SUCCESS; #else - apr_status_t rv; + fspr_status_t rv; char regkey[MAX_PATH * 2]; char *fixch; DWORD keylen; DWORD type; HKEY key; - if (apr_os_level >= APR_WIN_NT) { - apr_uid_t uid; - apr_gid_t gid; + if (fspr_os_level >= APR_WIN_NT) { + fspr_uid_t uid; + fspr_gid_t gid; - if ((rv = apr_uid_get(&uid, &gid, username, p)) != APR_SUCCESS) + if ((rv = fspr_uid_get(&uid, &gid, username, p)) != APR_SUCCESS) return rv; strcpy(regkey, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\" @@ -95,7 +95,7 @@ APR_DECLARE(apr_status_t) apr_uid_homepath_get(char **dirname, strcpy(regkey, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\" "ProfileList\\"); keylen = (DWORD)strlen(regkey); - apr_cpystrn(regkey + keylen, username, sizeof(regkey) - keylen); + fspr_cpystrn(regkey + keylen, username, sizeof(regkey) - keylen); } if ((rv = RegOpenKeyEx(HKEY_LOCAL_MACHINE, regkey, 0, @@ -114,18 +114,18 @@ APR_DECLARE(apr_status_t) apr_uid_homepath_get(char **dirname, if (type == REG_SZ) { char retdir[MAX_PATH]; if ((rv = unicode_to_utf8_path(retdir, sizeof(retdir), - (apr_wchar_t*)regkey)) != APR_SUCCESS) + (fspr_wchar_t*)regkey)) != APR_SUCCESS) return rv; - *dirname = apr_pstrdup(p, retdir); + *dirname = fspr_pstrdup(p, retdir); } else if (type == REG_EXPAND_SZ) { - apr_wchar_t path[MAX_PATH]; + fspr_wchar_t path[MAX_PATH]; char retdir[MAX_PATH]; - ExpandEnvironmentStringsW((apr_wchar_t*)regkey, path, sizeof(path)); + ExpandEnvironmentStringsW((fspr_wchar_t*)regkey, path, sizeof(path)); if ((rv = unicode_to_utf8_path(retdir, sizeof(retdir), path)) != APR_SUCCESS) return rv; - *dirname = apr_pstrdup(p, retdir); + *dirname = fspr_pstrdup(p, retdir); } else return APR_ENOENT; @@ -141,12 +141,12 @@ APR_DECLARE(apr_status_t) apr_uid_homepath_get(char **dirname, if (rv != ERROR_SUCCESS) return APR_FROM_OS_ERROR(rv); if (type == REG_SZ) { - *dirname = apr_pstrdup(p, regkey); + *dirname = fspr_pstrdup(p, regkey); } else if (type == REG_EXPAND_SZ) { char path[MAX_PATH]; ExpandEnvironmentStrings(regkey, path, sizeof(path)); - *dirname = apr_pstrdup(p, path); + *dirname = fspr_pstrdup(p, path); } else return APR_ENOENT; @@ -159,9 +159,9 @@ APR_DECLARE(apr_status_t) apr_uid_homepath_get(char **dirname, #endif /* _WIN32_WCE */ } -APR_DECLARE(apr_status_t) apr_uid_current(apr_uid_t *uid, - apr_gid_t *gid, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_uid_current(fspr_uid_t *uid, + fspr_gid_t *gid, + fspr_pool_t *p) { #ifdef _WIN32_WCE return APR_ENOTIMPL; @@ -172,32 +172,32 @@ APR_DECLARE(apr_status_t) apr_uid_current(apr_uid_t *uid, TOKEN_PRIMARY_GROUP *grp; if(!OpenProcessToken(GetCurrentProcess(), STANDARD_RIGHTS_READ | READ_CONTROL | TOKEN_QUERY, &threadtok)) { - return apr_get_os_error(); + return fspr_get_os_error(); } *uid = NULL; if (!GetTokenInformation(threadtok, TokenUser, NULL, 0, &needed) && (GetLastError() == ERROR_INSUFFICIENT_BUFFER) - && (usr = apr_palloc(p, needed)) + && (usr = fspr_palloc(p, needed)) && GetTokenInformation(threadtok, TokenUser, usr, needed, &needed)) *uid = usr->User.Sid; else - return apr_get_os_error(); + return fspr_get_os_error(); if (!GetTokenInformation(threadtok, TokenPrimaryGroup, NULL, 0, &needed) && (GetLastError() == ERROR_INSUFFICIENT_BUFFER) - && (grp = apr_palloc(p, needed)) + && (grp = fspr_palloc(p, needed)) && GetTokenInformation(threadtok, TokenPrimaryGroup, grp, needed, &needed)) *gid = grp->PrimaryGroup; else - return apr_get_os_error(); + return fspr_get_os_error(); return APR_SUCCESS; #endif } -APR_DECLARE(apr_status_t) apr_uid_get(apr_uid_t *uid, apr_gid_t *gid, - const char *username, apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_uid_get(fspr_uid_t *uid, fspr_gid_t *gid, + const char *username, fspr_pool_t *p) { #ifdef _WIN32_WCE return APR_ENOTIMPL; @@ -211,11 +211,11 @@ APR_DECLARE(apr_status_t) apr_uid_get(apr_uid_t *uid, apr_gid_t *gid, char *pos; if (pos = strchr(username, '/')) { - domain = apr_pstrndup(p, username, pos - username); + domain = fspr_pstrndup(p, username, pos - username); username = pos + 1; } else if (pos = strchr(username, '\\')) { - domain = apr_pstrndup(p, username, pos - username); + domain = fspr_pstrndup(p, username, pos - username); username = pos + 1; } else { @@ -228,13 +228,13 @@ APR_DECLARE(apr_status_t) apr_uid_get(apr_uid_t *uid, apr_gid_t *gid, if (sidlen) { /* Give it back on the second pass */ - *uid = apr_palloc(p, sidlen); + *uid = fspr_palloc(p, sidlen); domlen = sizeof(anydomain); rv = LookupAccountName(domain, username, *uid, &sidlen, anydomain, &domlen, &sidtype); } if (!sidlen || !rv) { - return apr_get_os_error(); + return fspr_get_os_error(); } /* There doesn't seem to be a simple way to retrieve the primary group sid */ @@ -243,11 +243,11 @@ APR_DECLARE(apr_status_t) apr_uid_get(apr_uid_t *uid, apr_gid_t *gid, #endif } -APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid, - apr_pool_t *p) +APR_DECLARE(fspr_status_t) fspr_uid_name_get(char **username, fspr_uid_t userid, + fspr_pool_t *p) { #ifdef _WIN32_WCE - *username = apr_pstrdup(p, "Administrator"); + *username = fspr_pstrdup(p, "Administrator"); return APR_SUCCESS; #else SID_NAME_USE type; @@ -256,15 +256,15 @@ APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid, if (!userid) return APR_EINVAL; if (!LookupAccountSid(NULL, userid, name, &cbname, domain, &cbdomain, &type)) - return apr_get_os_error(); + return fspr_get_os_error(); if (type != SidTypeUser && type != SidTypeAlias && type != SidTypeWellKnownGroup) return APR_EINVAL; - *username = apr_pstrdup(p, name); + *username = fspr_pstrdup(p, name); return APR_SUCCESS; #endif } -APR_DECLARE(apr_status_t) apr_uid_compare(apr_uid_t left, apr_uid_t right) +APR_DECLARE(fspr_status_t) fspr_uid_compare(fspr_uid_t left, fspr_uid_t right) { if (!left || !right) return APR_EINVAL;