From d471b2e3e1e7caa60b075be36ad02fff6169f62e Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@13f79535-47bb-0310-9956-ffa450edef68> Date: Fri, 28 Apr 2000 18:27:49 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'APACHE_2_0_ALPHA_3'. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/tags/APACHE_2_0_ALPHA_3@59984 13f79535-47bb-0310-9956-ffa450edef68 --- apr.dsp | 415 ------------ include/.cvsignore | 3 - include/apr.h.in | 119 ---- include/apr.hw | 151 ----- include/apr_dso.h | 123 ---- include/apr_errno.h | 251 ------- include/apr_file_io.h | 687 ------------------- include/apr_fnmatch.h | 64 -- include/apr_general.h | 378 ----------- include/apr_getopt.h | 95 --- include/apr_lib.h | 376 ----------- include/apr_lock.h | 197 ------ include/apr_md5.h | 119 ---- include/apr_mmap.h | 121 ---- include/apr_network_io.h | 722 -------------------- include/apr_pools.h | 244 ------- include/apr_portable.h | 444 ------------- include/apr_private.hw | 158 ----- include/apr_shmem.h | 213 ------ include/apr_signal.h | 73 -- include/apr_strnatcmp.h | 37 -- include/arch/aix/dso.h | 73 -- include/arch/beos/dso.h | 70 -- include/arch/beos/locks.h | 82 --- include/arch/beos/networkio.h | 112 ---- include/arch/beos/threadproc.h | 134 ---- include/arch/os2/dso.h | 72 -- include/arch/os2/fileio.h | 102 --- include/arch/os2/locks.h | 77 --- include/arch/os2/networkio.h | 97 --- include/arch/os2/os2calls.h | 140 ---- include/arch/os2/threadproc.h | 108 --- include/arch/unix/dso.h | 90 --- include/arch/unix/fileio.h | 138 ---- include/arch/unix/locks.h | 157 ----- include/arch/unix/misc.h | 98 --- include/arch/unix/mmap.c | 120 ---- include/arch/unix/networkio.h | 139 ---- include/arch/unix/threadproc.h | 126 ---- include/arch/win32/apr_private.h | 158 ----- include/arch/win32/atime.h | 72 -- include/arch/win32/dso.h | 68 -- include/arch/win32/fileio.h | 134 ---- include/arch/win32/locks.h | 70 -- include/arch/win32/misc.h | 98 --- include/arch/win32/networkio.h | 83 --- include/arch/win32/threadproc.h | 103 --- libapr.def | 251 ------- libapr.dsp | 103 --- memory/unix/apr_pools.c | 1364 -------------------------------------- misc/win32/libapr.c | 7 - threadproc/beos/threadcancel.c | 88 --- threadproc/os2/threadcancel.c | 85 --- threadproc/unix/threadcancel.c | 114 ---- threadproc/win32/threadcancel.c | 86 --- 55 files changed, 9809 deletions(-) delete mode 100644 apr.dsp delete mode 100644 include/.cvsignore delete mode 100644 include/apr.h.in delete mode 100644 include/apr.hw delete mode 100644 include/apr_dso.h delete mode 100644 include/apr_errno.h delete mode 100644 include/apr_file_io.h delete mode 100644 include/apr_fnmatch.h delete mode 100644 include/apr_general.h delete mode 100644 include/apr_getopt.h delete mode 100644 include/apr_lib.h delete mode 100644 include/apr_lock.h delete mode 100644 include/apr_md5.h delete mode 100644 include/apr_mmap.h delete mode 100644 include/apr_network_io.h delete mode 100644 include/apr_pools.h delete mode 100644 include/apr_portable.h delete mode 100644 include/apr_private.hw delete mode 100644 include/apr_shmem.h delete mode 100644 include/apr_signal.h delete mode 100644 include/apr_strnatcmp.h delete mode 100644 include/arch/aix/dso.h delete mode 100644 include/arch/beos/dso.h delete mode 100644 include/arch/beos/locks.h delete mode 100644 include/arch/beos/networkio.h delete mode 100644 include/arch/beos/threadproc.h delete mode 100644 include/arch/os2/dso.h delete mode 100644 include/arch/os2/fileio.h delete mode 100644 include/arch/os2/locks.h delete mode 100644 include/arch/os2/networkio.h delete mode 100644 include/arch/os2/os2calls.h delete mode 100644 include/arch/os2/threadproc.h delete mode 100644 include/arch/unix/dso.h delete mode 100644 include/arch/unix/fileio.h delete mode 100644 include/arch/unix/locks.h delete mode 100644 include/arch/unix/misc.h delete mode 100644 include/arch/unix/mmap.c delete mode 100644 include/arch/unix/networkio.h delete mode 100644 include/arch/unix/threadproc.h delete mode 100644 include/arch/win32/apr_private.h delete mode 100644 include/arch/win32/atime.h delete mode 100644 include/arch/win32/dso.h delete mode 100644 include/arch/win32/fileio.h delete mode 100644 include/arch/win32/locks.h delete mode 100644 include/arch/win32/misc.h delete mode 100644 include/arch/win32/networkio.h delete mode 100644 include/arch/win32/threadproc.h delete mode 100644 libapr.def delete mode 100644 libapr.dsp delete mode 100644 memory/unix/apr_pools.c delete mode 100644 misc/win32/libapr.c delete mode 100644 threadproc/beos/threadcancel.c delete mode 100644 threadproc/os2/threadcancel.c delete mode 100644 threadproc/unix/threadcancel.c delete mode 100644 threadproc/win32/threadcancel.c diff --git a/apr.dsp b/apr.dsp deleted file mode 100644 index 746feec57..000000000 --- a/apr.dsp +++ /dev/null @@ -1,415 +0,0 @@ -# Microsoft Developer Studio Project File - Name="aprlib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=aprlib - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "aprlib.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "aprlib.mak" CFG="aprlib - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "aprlib - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "aprlib - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe - -!IF "$(CFG)" == "aprlib - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "LibR" -# PROP BASE Intermediate_Dir "LibR" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "LibR" -# PROP Intermediate_Dir "LibR" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "./include" /I "./inc" /I "./misc/win32" /I "./file_io/win32" /I "./time/win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# SUBTRACT CPP /YX -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:".\LibR\apr.lib" -# ADD LIB32 /nologo /out:".\LibR\apr.lib" - -!ELSEIF "$(CFG)" == "aprlib - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "LibD" -# PROP BASE Intermediate_Dir "LibD" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "LibD" -# PROP Intermediate_Dir "LibD" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "./include" /I "./inc" /I "./misc/win32" /I "./file_io/win32" /I "./time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# SUBTRACT CPP /YX -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:".\LibD\apr.lib" -# ADD LIB32 /nologo /out:".\LibD\apr.lib" - -!ENDIF - -# Begin Target - -# Name "aprlib - Win32 Release" -# Name "aprlib - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=.\time\win32\access.c -# End Source File -# Begin Source File - -SOURCE=.\lib\apr_cpystrn.c -# End Source File -# Begin Source File - -SOURCE=.\lib\apr_execve.c -# End Source File -# Begin Source File - -SOURCE=.\lib\apr_fnmatch.c -# End Source File -# Begin Source File - -SOURCE=.\lib\apr_getpass.c -# End Source File -# Begin Source File - -SOURCE=.\lib\apr_md5.c -# End Source File -# Begin Source File - -SOURCE=.\lib\apr_pools.c -# End Source File -# Begin Source File - -SOURCE=.\lib\apr_snprintf.c -# End Source File -# Begin Source File - -SOURCE=.\lib\apr_strnatcmp.c -# End Source File -# Begin Source File - -SOURCE=.\lib\apr_tables.c -# End Source File -# Begin Source File - -SOURCE=.\aprlib.def -# End Source File -# Begin Source File - -SOURCE=.\misc\win32\canonerr.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\dir.c -# End Source File -# Begin Source File - -SOURCE=.\dso\win32\dso.c -# End Source File -# Begin Source File - -SOURCE=.\misc\win32\errorcodes.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\fileacc.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\filedup.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\filestat.c -# End Source File -# Begin Source File - -SOURCE=.\misc\win32\getopt.c -# End Source File -# Begin Source File - -SOURCE=.\locks\win32\locks.c -# End Source File -# Begin Source File - -SOURCE=.\misc\win32\names.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\open.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\pipe.c -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\poll.c -# End Source File -# Begin Source File - -SOURCE=.\threadproc\win32\proc.c -# End Source File -# Begin Source File - -SOURCE=.\misc\win32\rand.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\readwrite.c -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\seek.c -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\sendrecv.c -# End Source File -# Begin Source File - -SOURCE=.\threadproc\win32\signals.c -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\sockaddr.c -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\sockets.c -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\sockopt.c -# End Source File -# Begin Source File - -SOURCE=.\misc\win32\start.c -# End Source File -# Begin Source File - -SOURCE=.\threadproc\win32\thread.c -# End Source File -# Begin Source File - -SOURCE=.\threadproc\win32\threadpriv.c -# End Source File -# Begin Source File - -SOURCE=.\time\win32\time.c -# End Source File -# Begin Source File - -SOURCE=.\time\win32\timestr.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=.\include\apr_dso.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_errno.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_file_io.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_fnmatch.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_general.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_getopt.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_lib.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_lock.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_md5.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_network_io.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_pools.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_portable.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_shmem.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_signal.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_strnatcmp.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_thread_proc.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_time.h -# End Source File -# Begin Source File - -SOURCE=.\time\win32\atime.h -# End Source File -# Begin Source File - -SOURCE=.\dso\win32\dso.h -# End Source File -# Begin Source File - -SOURCE=.\file_io\win32\fileio.h -# End Source File -# Begin Source File - -SOURCE=.\locks\win32\locks.h -# End Source File -# Begin Source File - -SOURCE=.\misc\win32\misc.h -# End Source File -# Begin Source File - -SOURCE=.\network_io\win32\networkio.h -# End Source File -# Begin Source File - -SOURCE=.\threadproc\win32\threadproc.h -# End Source File -# End Group -# Begin Group "Generated Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\apr.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_private.h -# End Source File -# End Group -# Begin Group "Internal Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\apr_private.hw - -!IF "$(CFG)" == "aprlib - Win32 Release" - -# Begin Custom Build -InputPath=.\include\apr_private.hw - -".\include\apr_private.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr_private.hw .\include\apr_private.h > nul - echo Created apr_private.h from apr_private.hw - -# End Custom Build - -!ELSEIF "$(CFG)" == "aprlib - Win32 Debug" - -# Begin Custom Build -InputPath=.\include\apr_private.hw - -".\include\apr_private.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr_private.hw .\include\apr_private.h > nul - echo Created apr_private.h from apr_private.hw - -# End Custom Build - -!ENDIF - -# End Source File -# End Group -# Begin Group "External Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\apr.hw - -!IF "$(CFG)" == "aprlib - Win32 Release" - -# Begin Custom Build -InputPath=.\include\apr.hw - -".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr.hw .\include\apr.h > nul - echo Created apr.h from apr.hw - -# End Custom Build - -!ELSEIF "$(CFG)" == "aprlib - Win32 Debug" - -# Begin Custom Build -InputPath=.\include\apr.hw - -".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy .\include\apr.hw .\include\apr.h > nul - echo Created apr.h from apr.hw - -# End Custom Build - -!ENDIF - -# End Source File -# End Group -# End Target -# End Project diff --git a/include/.cvsignore b/include/.cvsignore deleted file mode 100644 index e5db22b8d..000000000 --- a/include/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -apr.h -apr_private.h -apr_private.h.in diff --git a/include/apr.h.in b/include/apr.h.in deleted file mode 100644 index ce4e59775..000000000 --- a/include/apr.h.in +++ /dev/null @@ -1,119 +0,0 @@ -#ifndef APR_H -#define APR_H - -/* So that we can use inline on some critical functions, and use - * GNUC attributes (such as to get -Wall warnings for printf-like - * functions). Only do this in gcc 2.7 or later ... it may work - * on earlier stuff, but why chance it. - * - * We've since discovered that the gcc shipped with NeXT systems - * as "cc" is completely broken. It claims to be __GNUC__ and so - * on, but it doesn't implement half of the things that __GNUC__ - * means. In particular it's missing inline and the __attribute__ - * stuff. So we hack around it. PR#1613. -djg - */ -#if !defined(__GNUC__) || __GNUC__ < 2 || \ - (__GNUC__ == 2 && __GNUC_MINOR__ < 7) ||\ - defined(NEXT) -#define ap_inline -#define __attribute__(__x) -#define ENUM_BITFIELD(e,n,w) signed int n : w -#else -#define ap_inline __inline__ -#define USE_GNU_INLINE -#define ENUM_BITFIELD(e,n,w) e n : w -#endif - -#define APR_HAVE_ERRNO_H @errnoh@ -#define APR_HAVE_DIRENT_H @direnth@ -#define APR_HAVE_FCNTL_H @fcntlh@ -#define APR_HAVE_NETINET_IN_H @netinet_inh@ -#define APR_HAVE_PTHREAD_H @pthreadh@ -#define APR_HAVE_STDARG_H @stdargh@ -#define APR_HAVE_STDIO_H @stdioh@ -#define APR_HAVE_SYS_TYPES_H @sys_typesh@ -#define APR_HAVE_SYS_UIO_H @sys_uioh@ -#define APR_HAVE_SIGNAL_H @signalh@ - -#define APR_USE_FLOCK_SERIALIZE @flockser@ -#define APR_USE_SYSVSEM_SERIALIZE @sysvser@ -#define APR_USE_FCNTL_SERIALIZE @fcntlser@ -#define APR_USE_PROC_PTHREAD_SERIALIZE @procpthreadser@ -#define APR_USE_PTHREAD_SERIALIZE @pthreadser@ - -#define APR_USES_ANONYMOUS_SHM @anonymous_shm@ -#define APR_USES_FILEBASED_SHM @filebased_shm@ -#define APR_USES_KEYBASED_SHM @keybased_shm@ - - -#define APR_HAVE_IN_ADDR @have_in_addr@ -#define APR_HAVE_INET_ADDR @inet_addr@ -#define APR_HAVE_INET_NETWORK @inet_network@ -#define APR_HAVE_UNION_SEMUN @have_union_semun@ - -#if APR_HAVE_SYS_TYPES_H -#include -#endif - -/* APR Feature Macros */ -#define APR_HAS_SHARED_MEMORY @sharedmem@ -#define APR_HAS_THREADS @threads@ -#define APR_HAS_SENDFILE @sendfile@ -#define APR_HAS_MMAP @mmap@ -#define APR_HAS_FORK @fork@ -#define APR_HAS_RANDOM @rand@ -#define APR_HAS_XLATE @iconv@ - -/* Typedefs that APR needs. */ - -typedef @short_value@ ap_int16_t; -typedef unsigned @short_value@ ap_uint16_t; - -typedef @int_value@ ap_int32_t; -typedef unsigned @int_value@ ap_uint32_t; - -typedef @long_value@ ap_int64_t; -typedef unsigned @long_value@ ap_uint64_t; - -typedef @size_t_value@ ap_size_t; -typedef @ssize_t_value@ ap_ssize_t; -typedef @off_t_value@ ap_off_t; - -/* Definitions that APR programs need to work properly. */ - -#define API_THREAD_FUNC -#define API_EXPORT(type) type -#define API_EXPORT_NONSTD(type) type -#define API_VAR_IMPORT extern -#define API_VAR_EXPORT - -/* Define APR_SSIZE_T_FMT. - * If ssize_t is an integer we define it to be "d", - * if ssize_t is a long int we define it to be "ld", - * if ssize_t is neither we declare an error here. - * I looked for a better way to define this here, but couldn't find one, so - * to find the logic for this definition search for "ssize_t_fmt" in - * configure.in. - */ -@ssize_t_fmt@ - -/* And APR_OFF_T_FMT */ -@off_t_fmt@ - -/* Define ap_signal and related necessary definitions. - */ -/* We are checking for HAVE_SIGACTION, but autoconf is filling this in - * for us automatically. - */ -#if @have_sigaction@ && !defined(NO_USE_SIGACTION) -typedef void Sigfunc(int); -Sigfunc *ap_signal(int signo, Sigfunc * func); - -#if defined(SIG_ING) && !defined(SIG_ERR) -#define SIG_ERR ((Sigfunc *)-1) -#endif -#else -#define ap_signal(a,b) signal(a,b) -#endif - -#endif /* APR_H */ diff --git a/include/apr.hw b/include/apr.hw deleted file mode 100644 index 4b29e31d6..000000000 --- a/include/apr.hw +++ /dev/null @@ -1,151 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -/* - * Note: This is a Windows specific version of apr.h. It is renamed to - * apr.h at the start of a Windows build. - */ - -#ifdef WIN32 -#ifndef APR_H -#define APR_H - -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#ifndef _WIN32_WINNT -/* - * Compile the server including all the Windows NT 4.0 header files by - * default. - */ -#define _WIN32_WINNT 0x0400 -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define ap_inline -#define __attribute__(__x) -#define ENUM_BITFIELD(e,n,w) signed int n : w - -#define APR_HAVE_ERRNO_H 1 -#define APR_HAVE_DIRENT_H 0 -#define APR_HAVE_FCNTL_H 0 -#define APR_HAVE_NETINET_IN_H 0 -#define APR_HAVE_PTHREAD_H 0 -#define APR_HAVE_STDARG_H 1 -#define APR_HAVE_STDIO_H 1 -#define APR_HAVE_SYS_TYPES_H 1 -#define APR_HAVE_SYS_UIO_H 0 -#define APR_HAVE_IN_ADDR 1 - -#define APR_USE_FLOCK_SERIALIZE 0 -#define APR_USE_SYSVSEM_SERIALIZE 0 -#define APR_USE_FCNTL_SERIALIZE 0 -#define APR_USE_PROC_PTHREAD_SERIALIZE 0 -#define APR_USE_PTHREAD_SERIALIZE 0 - -#if APR_HAVE_SYS_TYPES_H -#include -#endif - -/* APR Feature Macros */ -#define APR_HAS_THREADS 1 -#define APR_HAS_SENDFILE 1 -#define APR_HAS_MMAP 0 -#define APR_HAS_RANDOM 1 -#define APR_HAS_XLATE 0 - -/* Typedefs that APR needs. */ - -typedef short ap_int16_t; -typedef unsigned short ap_uint16_t; - -typedef int ap_int32_t; -typedef unsigned int ap_uint32_t; - -typedef __int64 ap_int64_t; -typedef unsigned __int64 ap_uint64_t; - -typedef int ap_size_t; -typedef int ap_ssize_t; -typedef _off_t ap_off_t; -typedef int pid_t; -typedef int uid_t; -typedef int gid_t; - -/* Definitions that APR programs need to work properly. */ -#define APR_SSIZE_T_FMT "d" -#define API_THREAD_FUNC __stdcall -#define API_EXPORT(type) type -#define API_EXPORT_NONSTD(type) type -#define API_VAR_IMPORT extern _declspec(dllimport) -#define API_VAR_EXPORT - -#define ap_signal(a,b) signal(a,b) - -/* struct iovec is needed to emulate Unix writev */ -struct iovec { - char* iov_base; - int iov_len; -}; -#endif /* APR_H */ -#endif /* WIN32 */ diff --git a/include/apr_dso.h b/include/apr_dso.h deleted file mode 100644 index 01f71c34c..000000000 --- a/include/apr_dso.h +++ /dev/null @@ -1,123 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef APR_DSO_DOT_H -#define APR_DSO_DOT_H - -#include "apr_general.h" -#include "apr_errno.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct ap_dso_handle_t ap_dso_handle_t; -typedef void * ap_dso_handle_sym_t; - -/* - -=head1 ap_status_t ap_dso_init(void) - -B - -=cut - */ -ap_status_t ap_dso_init(void); - -/* - -=head1 ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, ap_pool_t *ctx) - -B - - arg 1) Location to store new handle for the DSO. - arg 2) Path to the DSO library - arg 3) Pool to use. - -=cut - */ -ap_status_t ap_dso_load(ap_dso_handle_t **res_handle, const char *path, - ap_pool_t *ctx); - -/* - -=head1 ap_status_t ap_dso_unload(ap_dso_handle_t *handle) - -B - - arg 1) handle to close. - -=cut - */ -ap_status_t ap_dso_unload(ap_dso_handle_t *handle); - -/* - -=head1 ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, ap_dso_handle_t *handle *, const char *symname) - -B - - arg 1) Location to store the loaded symbol - arg 2) handle to load from. - arg 3) Name of the symbol to load. - -=cut - */ -ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, ap_dso_handle_t *handle, - const char *symname); -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/apr_errno.h b/include/apr_errno.h deleted file mode 100644 index 9eb186e41..000000000 --- a/include/apr_errno.h +++ /dev/null @@ -1,251 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef APR_ERRNO_H -#define APR_ERRNO_H - -#include "apr.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef int ap_status_t; - -int ap_canonical_error(ap_status_t err); - - -/* APR_OS_START_ERROR is where the APR specific error values should start. - * APR_OS_START_STATUS is where the APR specific status codes should start. - * APR_OS_START_USEERR are reserved for applications that use APR that - * layer their own error codes along with APR's. - * APR_OS_START_SYSERR should be used for system error values on - * each platform. - */ -#define APR_OS_START_ERROR 1000 -#define APR_OS_START_STATUS (APR_OS_START_ERROR + 500) -#define APR_OS_START_USEERR (APR_OS_START_STATUS + 500) -#define APR_OS_START_CANONERR (APR_OS_START_USEERR + 500) -#define APR_OS_START_SYSERR (APR_OS_START_CANONERR + 500) - -#define APR_OS2_STATUS(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR) - -#define APR_SUCCESS 0 - -/* APR ERROR VALUES */ -#define APR_ENOSTAT (APR_OS_START_ERROR + 1) -#define APR_ENOPOOL (APR_OS_START_ERROR + 2) -#define APR_ENOFILE (APR_OS_START_ERROR + 3) -#define APR_EBADDATE (APR_OS_START_ERROR + 4) -#define APR_EINVALSOCK (APR_OS_START_ERROR + 5) -#define APR_ENOPROC (APR_OS_START_ERROR + 6) -#define APR_ENOTIME (APR_OS_START_ERROR + 7) -#define APR_ENODIR (APR_OS_START_ERROR + 8) -#define APR_ENOLOCK (APR_OS_START_ERROR + 9) -#define APR_ENOPOLL (APR_OS_START_ERROR + 10) -#define APR_ENOSOCKET (APR_OS_START_ERROR + 11) -#define APR_ENOTHREAD (APR_OS_START_ERROR + 12) -#define APR_ENOTHDKEY (APR_OS_START_ERROR + 13) -/* empty slot: +14 */ -#define APR_ENOSHMAVAIL (APR_OS_START_ERROR + 15) -/* empty slot: +16 */ -/* empty slot: +17 */ -/* empty slot: +18 */ -#define APR_EDSOOPEN (APR_OS_START_ERROR + 19) - -/* APR STATUS VALUES */ -#define APR_INCHILD (APR_OS_START_STATUS + 1) -#define APR_INPARENT (APR_OS_START_STATUS + 2) -#define APR_DETACH (APR_OS_START_STATUS + 3) -#define APR_NOTDETACH (APR_OS_START_STATUS + 4) -#define APR_CHILD_DONE (APR_OS_START_STATUS + 5) -#define APR_CHILD_NOTDONE (APR_OS_START_STATUS + 6) -#define APR_TIMEUP (APR_OS_START_STATUS + 7) -/* empty slot: +8 */ -/* empty slot: +9 */ -/* empty slot: +10 */ -/* empty slot: +11 */ -#define APR_BADCH (APR_OS_START_STATUS + 12) -#define APR_BADARG (APR_OS_START_STATUS + 13) -#define APR_EOF (APR_OS_START_STATUS + 14) -#define APR_NOTFOUND (APR_OS_START_STATUS + 15) -/* empty slot: +16 */ -/* empty slot: +17 */ -/* empty slot: +18 */ -#define APR_ANONYMOUS (APR_OS_START_STATUS + 19) -#define APR_FILEBASED (APR_OS_START_STATUS + 20) -#define APR_KEYBASED (APR_OS_START_STATUS + 21) - -/* A simple value to be used to initialze a status variable. */ -#define APR_EINIT (APR_OS_START_STATUS + 22) - -/* Not implemented either because we haven't gotten to it yet, or - * because it is not possible to do correctly. - */ -#define APR_ENOTIMPL (APR_OS_START_STATUS + 23) - -/* Passwords do not match. - */ -#define APR_EMISMATCH (APR_OS_START_STATUS + 24) - - -/* APR CANONICAL ERROR VALUES */ -#ifdef EACCES -#define APR_EACCES EACCES -#else -#define APR_EACCES (APR_OS_START_CANONERR + 1) -#endif - -#ifdef EEXIST -#define APR_EEXIST EEXIST -#else -#define APR_EEXIST (APR_OS_START_CANONERR + 2) -#endif - -#ifdef ENAMETOOLONG -#define APR_ENAMETOOLONG ENAMETOOLONG -#else -#define APR_ENAMETOOLONG (APR_OS_START_CANONERR + 3) -#endif - -#ifdef ENOENT -#define APR_ENOENT ENOENT -#else -#define APR_ENOENT (APR_OS_START_CANONERR + 4) -#endif - -#ifdef ENOTDIR -#define APR_ENOTDIR ENOTDIR -#else -#define APR_ENOTDIR (APR_OS_START_CANONERR + 5) -#endif - -#ifdef ENOSPC -#define APR_ENOSPC ENOSPC -#else -#define APR_ENOSPC (APR_OS_START_CANONERR + 6) -#endif - -#ifdef ENONOMEM -#define APR_ENOMEM ENOMEM -#else -#define APR_ENOMEM (APR_OS_START_CANONERR + 7) -#endif - -#ifdef EMFILE -#define APR_EMFILE EMFILE -#else -#define APR_EMFILE (APR_OS_START_CANONERR + 8) -#endif - -#ifdef ENFILE -#define APR_ENFILE ENFILE -#else -#define APR_ENFILE (APR_OS_START_CANONERR + 9) -#endif - -#ifdef EBADF -#define APR_EBADF EBADF -#else -#define APR_EBADF (APR_OS_START_CANONERR + 10) -#endif - -#ifdef EINVAL -#define APR_EINVAL EINVAL -#else -#define APR_EINVAL (APR_OS_START_CANONERR + 11) -#endif - -#ifdef ESPIPE -#define APR_ESPIPE ESPIPE -#else -#define APR_ESPIPE (APR_OS_START_CANONERR + 12) -#endif - -#ifdef EAGAIN -#define APR_EAGAIN EAGAIN -#else -#define APR_EAGAIN (APR_OS_START_CANONERR + 13) -#endif - -#ifdef EINTR -#define APR_EINTR EINTR -#else -#define APR_EINTR (APR_OS_START_CANONERR + 14) -#endif - -#ifdef ENOTSOCK -#define APR_ENOTSOCK ENOTSOCK -#else -#define APR_ENOTSOCK (APR_OS_START_CANONERR + 15) -#endif - -#ifdef ECONNREFUSED -#define APR_ECONNREFUSED ECONNREFUSED -#else -#define APR_ECONNREFUSED (APR_OS_START_CANONERR + 16) -#endif - -#ifdef EINPROGRESS -#define APR_EINPROGRESS EINPROGRESS -#else -#define APR_EINPROGRESS (APR_OS_START_CANONERR + 17) -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* ! APR_ERRNO_H */ diff --git a/include/apr_file_io.h b/include/apr_file_io.h deleted file mode 100644 index 3bee3987e..000000000 --- a/include/apr_file_io.h +++ /dev/null @@ -1,687 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef APR_FILE_IO_H -#define APR_FILE_IO_H - -#include "apr_general.h" -#include "apr_time.h" -#include "apr_errno.h" -#if APR_HAVE_SYS_UIO_H -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef enum {APR_NOFILE, APR_REG, APR_DIR, APR_CHR, APR_BLK, APR_PIPE, APR_LNK, - APR_SOCK} ap_filetype_e; - -/* Flags for ap_open */ -#define APR_READ 1 /* Open the file for reading */ -#define APR_WRITE 2 /* Open the file for writing */ -#define APR_CREATE 4 /* Create the file if not there */ -#define APR_APPEND 8 /* Append to the end of the file */ -#define APR_TRUNCATE 16 /* Open the file and truncate to 0 length */ -#define APR_BINARY 32 /* Open the file in binary mode */ -#define APR_EXCL 64 /* Open should fail if APR_CREATE and file - exists. */ -#define APR_BUFFERED 128 /* Open the file for buffered I/O */ -#define APR_DELONCLOSE 256 /* Delete the file after close */ - -/* flags for ap_seek */ -#define APR_SET SEEK_SET -#define APR_CUR SEEK_CUR -#define APR_END SEEK_END - -/* Permissions flags */ -#define APR_UREAD 0x400 -#define APR_UWRITE 0x200 -#define APR_UEXECUTE 0x100 - -#define APR_GREAD 0x040 -#define APR_GWRITE 0x020 -#define APR_GEXECUTE 0x010 - -#define APR_WREAD 0x004 -#define APR_WWRITE 0x002 -#define APR_WEXECUTE 0x001 - -#define APR_OS_DEFAULT 0xFFF - -/* should be same as whence type in lseek, POSIX defines this as int */ -typedef ap_int32_t ap_seek_where_t; - -typedef struct ap_file_t ap_file_t; -typedef struct ap_finfo_t ap_finfo_t; -typedef struct ap_dir_t ap_dir_t; -typedef ap_int32_t ap_fileperms_t; -typedef uid_t ap_uid_t; -typedef gid_t ap_gid_t; -typedef ino_t ap_ino_t; - -struct ap_finfo_t { - ap_fileperms_t protection; - ap_filetype_e filetype; - ap_uid_t user; - ap_gid_t group; - ap_ino_t inode; - ap_off_t size; - ap_time_t atime; - ap_time_t mtime; - ap_time_t ctime; -}; - -/* Function definitions */ -/* - -=head1 ap_status_t ap_open(ap_file_t **new, char *fname, ap_int32 flag, ap_fileperms perm, ap_pool_t *cont) - -B - - arg 1) The opened file descriptor. - arg 2) The full path to the file (using / on all systems) - arg 3) Or'ed value of: - APR_READ open for reading - APR_WRITE open for writing - APR_CREATE create the file if not there - APR_APPEND file ptr is set to end prior to all writes - APR_TRUNCATE set length to zero if file exists - APR_BINARY not a text file (This flag is ignored on - UNIX because it has no meaning) - APR_BUFFERED buffer the data. Default is non-buffered - APR_EXCL return error if APR_CREATE and file exists - APR_DELONCLOSE delete the file after closing. - arg 4) Access permissions for file. - arg 5) The pool to use. - -B: If perm is APR_OS_DEFAULT and the file is being created, appropriate - default permissions will be used. *arg1 must point to a valid file_t, - or NULL (in which case it will be allocated) - -=cut - */ -ap_status_t ap_open(ap_file_t **new, const char *fname, ap_int32_t flag, - ap_fileperms_t perm, ap_pool_t *cont); - -/* - -=head1 ap_status_t ap_close(ap_file_t *file) - -B - - arg 1) The file descriptor to close. - -=cut - */ -ap_status_t ap_close(ap_file_t *file); - -/* - -=head1 ap_status_t ap_remove_file(char *path, ap_pool_t *cont) - -B - - arg 1) The full path to the file (using / on all systems) - arg 2) The pool to use. - -B: If the file is open, it won't be removed until all instances are - closed. - -=cut - */ -ap_status_t ap_remove_file(char *path, ap_pool_t *cont); - -/* - -=head1 ap_status_t ap_eof(ap_file_t *fptr) - -B - - arg 1) The apr file we are testing. - -B: Returns APR_EOF if we are at the end of file, APR_SUCCESS otherwise. - -=cut - */ -ap_status_t ap_eof(ap_file_t *fptr); - -/* - -=head1 ap_status_t ap_ferror(ap_file_t *fptr) - -B - - arg 1) The apr file we are testing. - -B: Returns -1 if the error indicator is set, APR_SUCCESS otherwise. - -=cut - */ -ap_status_t ap_ferror(ap_file_t *fptr); - -/* - -=head1 ap_status_t ap_open_stderr(ap_file_t **thefile, ap_pool_t *cont) - -B - - arg 1) The apr file to use as stderr. - arg 2) The pool to allocate the file out of. - -=cut - */ -ap_status_t ap_open_stderr(ap_file_t **thefile, ap_pool_t *cont); - -/* - -=head1 ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) - -B - - arg 1) The file descriptor to read from. - arg 2) The buffer to store the data to. - arg 3) On entry, the number of bytes to read; on exit, the number - of bytes read. - -B: ap_read will read up to the specified number of bytes, but never - more. If there isn't enough data to fill that number of bytes, all of - the available data is read. The third argument is modified to reflect the - number of bytes read. If a char was put back into the stream via - ungetc, it will be the first character returned. - - It is possible for both bytes to be read and an APR_EOF or other error - to be returned. - - APR_EINTR is never returned. - -=cut - */ -ap_status_t ap_read(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes); - -/* - -=head1 ap_status_t ap_write(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes) - -B - - arg 1) The file descriptor to write to. - arg 2) The buffer which contains the data. - arg 3) On entry, the number of bytes to write; on exit, the number - of bytes write. - -B: ap_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. - - It is possible for both bytes to be written and an error to be - returned. - - APR_EINTR is never returned. - -=cut - */ -ap_status_t ap_write(ap_file_t *thefile, void *buf, ap_ssize_t *nbytes); - -/* - -=head1 ap_status_t ap_writev(ap_file_t *thefile, struct iovec *vec, ap_size_t nvec, ap_ssize_t *nbytes) - -B - - arg 1) The file descriptor to write to. - arg 2) The array from which to get the data to write to the file. - arg 3) The number of elements in the struct iovec array. This must be - smaller than AP_MAX_IOVEC_SIZE. If it isn't, the function will - fail with APR_EINVAL. - arg 4) The number of bytes written. - - It is possible for both bytes to be written and an error to be - returned. - - APR_EINTR is never returned. - - ap_writev is available even if the underlying operating system - doesn't provide writev(). - -=cut - */ -ap_status_t ap_writev(ap_file_t *thefile, const struct iovec *vec, - ap_size_t nvec, ap_ssize_t *nbytes); - -/* - -=head1 ap_status_t ap_putc(char ch, ap_file_t *thefile) - -B - - arg 1) The character to write. - arg 2) The file descriptor to write to - -=cut - */ -ap_status_t ap_putc(char ch, ap_file_t *thefile); - -/* - -=head1 ap_status_t ap_getc(char *ch, ap_file_t *thefil) - -B - - arg 1) The character to write. - arg 2) The file descriptor to write to - -=cut - */ -ap_status_t ap_getc(char *ch, ap_file_t *thefile); - -/* - -=head1 ap_status_t ap_ungetc(char ch, ap_file_t *thefile) - -B - - arg 1) The character to write. - arg 2) The file descriptor to write to - -=cut - */ -ap_status_t ap_ungetc(char ch, ap_file_t *thefile); - -/* - -=head1 ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile) - -B - - arg 1) The buffer to store the string in. - arg 2) The length of the string - arg 3) The file descriptor to read from - -=cut - */ -ap_status_t ap_fgets(char *str, int len, ap_file_t *thefile); - -/* - -=head1 ap_status_t ap_puts(char *str, ap_file_t *thefile) - -B - - arg 1) The string to write. - arg 2) The file descriptor to write to from - -=cut - */ -ap_status_t ap_puts(char *str, ap_file_t *thefile); - -/* - -=head1 ap_status_t ap_flush(ap_file_t *thefile) - -B - - arg 1) The file descriptor to flush - -=cut - */ -ap_status_t ap_flush(ap_file_t *thefile); -API_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...) - __attribute__((format(printf,2,3))); - -/* - -=head1 ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p) - -B - - arg 1) The structure to duplicate into. - arg 2) The file to duplicate. - arg 3) The pool to use for the new file. - -B: *arg1 must point to a valid ap_file_t, or point to NULL - -=cut - */ -ap_status_t ap_dupfile(ap_file_t **new_file, ap_file_t *old_file, ap_pool_t *p); - -/* - -=head1 ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile) - -B - - arg 1) Where to store the information about the file. - arg 2) The file to get information about. - -=cut - */ -ap_status_t ap_getfileinfo(ap_finfo_t *finfo, ap_file_t *thefile); -ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont); - -/* - -=head1 ap_status_t ap_stat(ap_file_t **finfo, char *fname, ap_pool_t *cont) - -B - - arg 1) Where to store the information about the file. - arg 2) The name of the file to stat. - arg 3) the pool to use to allocate the new file. - -=cut - */ -ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_pool_t *cont); - -/* - -=head1 ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where, ap_off_t *offset) - -B - - arg 1) The file descriptor - arg 2) How to move the pointer, one of: - APR_SET -- set the offset to offset - APR_CUR -- add the offset to the current position - APR_END -- add the offset to the current file size - arg 3) The offset to move the pointer to. - -B: The third argument is modified to be the offset the pointer - was actually moved to. - -=cut - */ -ap_status_t ap_seek(ap_file_t *thefile, ap_seek_where_t where,ap_off_t *offset); - -/* - -=head1 ap_status_t ap_opendir(ap_dir_t **new, char *dirname, ap_pool_t *cont) - -B - - arg 1) The opened directory descriptor. - arg 2) The full path to the directory (use / on all systems) - arg 3) The pool to use. - -=cut - */ -ap_status_t ap_opendir(ap_dir_t **new, const char *dirname, ap_pool_t *cont); - -/* - -=head1 ap_status_t ap_closedir(ap_dir_t *thedir) - -B - - arg 1) the directory descriptor to close. - -=cut - */ -ap_status_t ap_closedir(ap_dir_t *thedir); - -/* - -=head1 ap_status_t ap_readdir(ap_dir_t *thedir) - -B - - arg 1) the directory descriptor to read from, and fill out. - -B: All systems return . and .. as the first two files. - -=cut - */ -ap_status_t ap_readdir(ap_dir_t *thedir); - -/* - -=head1 ap_status_t ap_rewinddir(ap_dir_t *thedir) - -B - - arg 1) the directory descriptor to rewind. - -=cut - */ -ap_status_t ap_rewinddir(ap_dir_t *thedir); - -/* - -=head1 ap_status_t ap_make_dir(const char *path, ap_fileperms_t perm, ap_pool_t *cont) - -B - - arg 1) the path for the directory to be created. (use / on all systems) - arg 2) Permissions for the new direcoty. - arg 3) the pool to use. - -=cut - */ -ap_status_t ap_make_dir(const char *path, ap_fileperms_t perm, - ap_pool_t *cont); - -/* - -=head1 ap_status_t ap_remove_dir(const char *path, ap_pool_t *cont) - -B - - arg 1) the path for the directory to be removed. (use / on all systems) - arg 2) the pool to use. - -=cut - */ -ap_status_t ap_remove_dir(const char *path, ap_pool_t *cont); - -/* - -=head1 ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont) - -B - - arg 1) The file descriptor to use as input to the pipe. - arg 2) The file descriptor to use as output from the pipe. - arg 3) The pool to operate on. - -=cut - */ -ap_status_t ap_create_pipe(ap_file_t **in, ap_file_t **out, ap_pool_t *cont); - -/* - -=head1 ap_status_t ap_create_namedpipe(char *filename, ap_fileperms_t perm, ap_pool_t *cont) - -B - - arg 1) The filename of the named pipe - arg 2) The permissions for the newly created pipe. - arg 3) The pool to operate on. - -=cut - */ -ap_status_t ap_create_namedpipe(char *filename, ap_fileperms_t perm, - ap_pool_t *cont); - -/* - -=head1 ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_int32_t timeout) - -B - - arg 1) The pipe we are setting a timeout on. - arg 2) The timeout value in seconds. Values < 0 mean wait forever, 0 - means do not wait at all. - -=cut - */ -ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout); - -/* - -=head1 ap_status_t ap_block_pipe(ap_file_t *thepipe) - -B - - arg 1) The pipe to operate on. - -=cut - */ -ap_status_t ap_block_pipe(ap_file_t *thepipe); - -/*accessor and general file_io functions. */ - -/* - -=head1 ap_status_t ap_get_filename(char **new, ap_file_t *thefile) - -B - - arg 1) The path of the file. - arg 2) The currently open file. - -=cut - */ -ap_status_t ap_get_filename(char **new, ap_file_t *thefile); - -/* - -=head1 ap_status_t ap_get_dir_filename(char **new, ap_dir_t *thedir) - -B - - arg 1) the file name of the directory entry. - arg 2) the currently open directory. - -=cut - */ -ap_status_t ap_get_dir_filename(char **new, ap_dir_t *thedir); - -/* - -=head1 ap_status_t ap_get_filedata(void **data, char *key, ap_file_t *file) - -B - - arg 1) The user data associated with the file. - arg 2) The key to use for retreiving data associated with this file. - arg 3) The currently open file. - -=cut - */ -ap_status_t ap_get_filedata(void **data, char *key, ap_file_t *file); - -/* - -=head1 ap_status_t ap_set_filedata(ap_file_t *file, void *data, char *key, ap_status (*cleanup) (void *)) - -B - - arg 1) The currently open file. - arg 2) The user data to associate with the file. - arg 3) The key to use for assocaiteing data with the file. - arg 4) The cleanup routine to use when the file is destroyed. - -=cut - */ -ap_status_t ap_set_filedata(ap_file_t *file, void *data, char *key, - ap_status_t (*cleanup) (void *)); - -/* - -=head1 ap_status_t ap_dir_entry_size(ap_ssize_t *size, ap_dir_t *thedir) - -B - - arg 1) the size of the directory entry. - arg 2) the currently open directory. - -=cut - */ -ap_status_t ap_dir_entry_size(ap_ssize_t *size, ap_dir_t *thedir); - -/* - -=head1 ap_status_t ap_dir_entry_mtime(ap_time_t *mtime, ap_dir_t *thedir) - -B - - arg 1) the last modified time of the directory entry. - arg 2) the currently open directory. - -=cut - */ -ap_status_t ap_dir_entry_mtime(ap_time_t *mtime, ap_dir_t *thedir); - -/* - -=head1 ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, ap_dir_t *thedir) - -B - - arg 1) the file type of the directory entry. - arg 2) the currently open directory. - -=cut - */ -ap_status_t ap_dir_entry_ftype(ap_filetype_e *type, ap_dir_t *thedir); - -#ifdef __cplusplus -} -#endif - -#endif /* ! APR_FILE_IO_H */ - - diff --git a/include/apr_fnmatch.h b/include/apr_fnmatch.h deleted file mode 100644 index c0300b638..000000000 --- a/include/apr_fnmatch.h +++ /dev/null @@ -1,64 +0,0 @@ -/*- - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)fnmatch.h 8.1 (Berkeley) 6/2/93 - */ - -/* This file has been modified by the Apache Software Foundation. */ -#ifndef _APR_FNMATCH_H_ -#define _APR_FNMATCH_H_ - -#include "apr_errno.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define FNM_NOMATCH 1 /* Match failed. */ - -#define FNM_NOESCAPE 0x01 /* Disable backslash escaping. */ -#define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */ -#define FNM_PERIOD 0x04 /* Period must be matched by period. */ -/* This flag is an Apache addition */ -#define FNM_CASE_BLIND 0x08 /* Compare characters case ap_pool_t nsensitively. */ - -API_EXPORT(ap_status_t) ap_fnmatch(const char *pattern, const char *strings, - int flags); - -/* this function is an Apache addition */ -API_EXPORT(int) ap_is_fnmatch(const char *pattern); - -#ifdef __cplusplus -} -#endif - -#endif /* !_FNMATCH_H_ */ diff --git a/include/apr_general.h b/include/apr_general.h deleted file mode 100644 index 5e86b6bc5..000000000 --- a/include/apr_general.h +++ /dev/null @@ -1,378 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef APR_GENERAL_H -#define APR_GENERAL_H - -#include "apr.h" - -#if APR_HAVE_STDIO_H -#include -#endif -#if APR_HAVE_SYS_TYPES_H -#include -#endif -#if APR_HAVE_SIGNAL_H -#include -#endif -#include "apr_errno.h" - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#define TRUE 1 -#define FALSE 0 - -#define MAXIMUM_WAIT_OBJECTS 64 - -typedef int ap_signum_t; - -#ifdef SIGHUP -#define APR_SIGHUP SIGHUP -#endif -#ifdef SIGINT -#define APR_SIGINT SIGINT -#endif -#ifdef SIGQUIT -#define APR_SIGQUIT SIGQUIT -#endif -#ifdef SIGILL -#define APR_SIGILL SIGILL -#endif -#ifdef SIGTRAP -#define APR_SIGTRAP SIGTRAP -#endif -#ifdef SIGABRT -#define APR_SIGABRT SIGABRT -#endif -#ifdef SIGIOT -#define APR_SIGIOT SIGIOT -#endif -#ifdef SIGBUS -#define APR_SIGBUS SIGBUS -#endif -#ifdef SIGFPE -#define APR_SIGFPE SIGFPE -#endif -#ifdef SIGKILL -#define APR_SIGKILL SIGKILL -#endif -#ifdef SIGUSR1 -#define APR_SIGUSR1 SIGUSR1 -#endif -#ifdef SIGSEGV -#define APR_SIGSEGV SIGSEGV -#endif -#ifdef SIGUSR2 -#define APR_SIGUSR2 SIGUSR2 -#endif -#ifdef SIGPIPE -#define APR_SIGPIPE SIGPIPE -#endif -#ifdef SIGALRM -#define APR_SIGALRM SIGALRM -#endif -#ifdef SIGTERM -#define APR_SIGTERM SIGTERM -#endif -#ifdef SIGSTKFLT -#define APR_SIGSTKFLT SIGSTKFLT -#endif -#ifdef SIGCHLD -#define APR_SIGCHLD SIGCHLD -#endif -#ifdef SIGCONT -#define APR_SIGCONT SIGCONT -#endif -#ifdef SIGSTOP -#define APR_SIGSTOP SIGSTOP -#endif -#ifdef SIGTSTP -#define APR_SIGTSTP SIGTSTP -#endif -#ifdef SIGTTIN -#define APR_SIGTTIN SIGTTIN -#endif -#ifdef SIGTTOU -#define APR_SIGTTOU SIGTTOU -#endif -#ifdef SIGURG -#define APR_SIGURG SIGURG -#endif -#ifdef SIGXCPU -#define APR_SIGXCPU SIGXCPU -#endif -#ifdef SIGXFSZ -#define APR_SIGXFSZ SIGXFSZ -#endif -#ifdef SIGVTALRM -#define APR_SIGVTALRM SIGVTALRM -#endif -#ifdef SIGPROF -#define APR_SIGPROF SIGPROF -#endif -#ifdef SIGWINCH -#define APR_SIGWINCH SIGWINCH -#endif -#ifdef SIGIO -#define APR_SIGIO SIGIO -#endif - -#ifdef WIN32 -#define APR_INLINE __inline -#elif defined(__GNUC__) && defined(__GNUC__) && \ - __GNUC__ >= 2 && __GNUC_MINOR__ >= 7 -#define APR_INLINE __inline__ -#else -#define APR_INLINE /*nop*/ -#endif - -/* Finding offsets of elements within structures. - * Taken from the X code... they've sweated portability of this stuff - * so we don't have to. Sigh... - */ - -#if defined(CRAY) || (defined(__arm) && !defined(LINUX)) -#ifdef __STDC__ -#define XtOffset(p_type,field) _Offsetof(p_type,field) -#else -#ifdef CRAY2 -#define XtOffset(p_type,field) \ - (sizeof(int)*((unsigned int)&(((p_type)NULL)->field))) - -#else /* !CRAY2 */ - -#define XtOffset(p_type,field) ((unsigned int)&(((p_type)NULL)->field)) - -#endif /* !CRAY2 */ -#endif /* __STDC__ */ -#else /* ! (CRAY || __arm) */ - -#define XtOffset(p_type,field) \ - ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL))) - -#endif /* !CRAY */ - -#ifdef offsetof -#define XtOffsetOf(s_type,field) offsetof(s_type,field) -#else -#define XtOffsetOf(s_type,field) XtOffset(s_type*,field) -#endif - -#if APR_HAS_RANDOM -/* - -=head1 ap_status_t ap_generate_random_bytes(unsigned char * buf, int length) - -B - - arg 1) Random bytes go here - arg 2) size of the buffer - -=cut - */ -/* TODO: I'm not sure this is the best place to put this prototype...*/ -ap_status_t ap_generate_random_bytes(unsigned char * buf, int length); -#endif - -typedef struct ap_pool_t { - union block_hdr *first; - union block_hdr *last; - struct cleanup *cleanups; - struct process_chain *subprocesses; - struct ap_pool_t *sub_pools; - struct ap_pool_t *sub_next; - struct ap_pool_t *sub_prev; - struct ap_pool_t *parent; - char *free_first_avail; -#ifdef ALLOC_USE_MALLOC - void *allocation_list; -#endif -#ifdef POOL_DEBUG - ap_pool_t *joined; -#endif - int (*apr_abort)(int retcode); - struct datastruct *prog_data; -}ap_pool_t; - -/* pool functions */ -/* - -=head1 ap_status_t ap_create_pool(ap_pool_t **newcont, ap_pool_t *cont) - -B - - arg 1) The pool we have just created. - arg 2) The parent pool. If this is NULL, the new pool is a root - pool. If it is non-NULL, the new pool will inherit all - of it's parent pool's attributes, except the ap_pool_t will - be a sub-pool. - -=cut - */ -ap_status_t ap_create_pool(ap_pool_t **newcont, ap_pool_t *cont); - -/* - -=head1 ap_status_t ap_destroy_pool(ap_pool_t *cont) - -B - - arg 1) The pool to free. - -=cut - */ - -ap_status_t ap_exit(ap_pool_t *); - -/* - -=head1 ap_status_t ap_set_userdata(void *data, char *key, ap_status_t (*cleanup) (void *), ap_pool_t *cont) - -B. - - arg 1) The user data associated with the pool. - arg 2) The key to use for association - arg 3) The cleanup program to use to cleanup the data; - arg 4) The current pool. - -B: The data to be attached to the pool should have the same - life span as the pool it is being attached to. - - Users of APR must take EXTREME care when choosing a key to - use for their data. It is possible to accidentally overwrite - data by choosing a key that another part of the program is using - It is advised that steps are taken to ensure that a unique - key is used at all times. - -=cut - */ -ap_status_t ap_set_userdata(void *data, char *key, - ap_status_t (*cleanup) (void *), - ap_pool_t *cont); - -/* - -=head1 ap_status_t ap_get_userdata(void **data, char *key, ap_pool_t *cont) - -B - - arg 1) The key for the data to retrieve - arg 2) The user data associated with the pool. - arg 3) The current pool. - -=cut - */ -ap_status_t ap_get_userdata(void **, char *key, ap_pool_t *cont); - -/* - -=head1 ap_status_t ap_initialize(void) - -B - -=cut - */ -ap_status_t ap_initialize(void); - -/* - -=head1 void ap_terminate(void) - -B - -B: An APR program must call this function at termination once it - has stopped using APR services. - -=cut - */ -void ap_terminate(void); - -/* - -=head1 ap_status_t ap_set_abort(int (*apr_abort)(int retcode), ap_pool_t *cont) - -B - -B: This is in for backwards compatability. If the program using - APR wants APR to exit on a memory allocation error, then this - function should be called to set the function to use in order - to actually exit the program. If this function is not called, - then APR will return an error and expect the calling program to - deal with the error accordingly. - -=cut - */ -ap_status_t ap_set_abort(int (*apr_abort)(int retcode), ap_pool_t *cont); - -/* - -=head1 char *ap_strerror(ap_status_t statcode, char *buf, ap_size_t bufsize) - -B - - arg 1) The error code the get a string for. - arg 2) A buffer to hold the error string. - arg 3) Size of the buffer to hold the string. - -=cut - */ -char *ap_strerror(ap_status_t statcode, char *buf, ap_size_t bufsize); - -#ifdef __cplusplus -} -#endif - -#endif /* ! APR_GENERAL_H */ diff --git a/include/apr_getopt.h b/include/apr_getopt.h deleted file mode 100644 index f9ae7603f..000000000 --- a/include/apr_getopt.h +++ /dev/null @@ -1,95 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef APR_GETOPT_H -#define APR_GETOPT_H - -API_VAR_IMPORT int - ap_opterr, /* if error message should be printed */ - ap_optind, /* index into parent argv vector */ - ap_optopt, /* character checked for validity */ - ap_optreset; /* reset getopt */ -API_VAR_IMPORT char * - ap_optarg; /* argument associated with option */ - -/* - -=head1 ap_status_t ap_getopt(ap_int32_t nargc, char *const *nargv, const char *ostr, ap_int32_t *rv, ap_pool_t *cont) - -B - - arg 1) The number of arguments passed to ap_getopt to parse - arg 2) The array of command line options to parse - arg 3) A string of characters that are acceptable options to the program. - characters followed by ":" are required to have an option - associated - arg 4) The next option found. There are four potential values for - this variable on exit. They are: - APR_EOF -- No more options to parse - APR_BADCH -- Found a bad option character - APR_BADARG -- Missing parameter for the found option - Other -- The next option found. - arg 5) The pool to operate on. - -B: Arguments 2 and 3 are most commonly argc and argv from - main(argc, argv) - -=cut - */ -ap_status_t ap_getopt(ap_int32_t nargc, char *const *nargv, const char *ostr, - ap_int32_t *rv, ap_pool_t *cont); - -#endif /* ! APR_GETOPT_H */ - - diff --git a/include/apr_lib.h b/include/apr_lib.h deleted file mode 100644 index 4b9153b85..000000000 --- a/include/apr_lib.h +++ /dev/null @@ -1,376 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef APR_LIB_H -#define APR_LIB_H - -#include "apr_general.h" -#include "apr_file_io.h" -#include "apr_thread_proc.h" - -#if APR_HAVE_STDARG_H -#include -#endif -#if APR_HAVE_SYS_TYPES_H -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#define HUGE_STRING_LEN 8192 - -/* - * Define the structures used by the APR general-purpose library. - */ - -/* - * Memory allocation stuff, like pools, arrays, and tables. Pools - * and tables are opaque structures to applications, but arrays are - * published. - */ -typedef struct ap_table_t ap_table_t; -typedef struct ap_child_info_t ap_child_info_t; -typedef void ap_mutex_t; -typedef struct ap_array_header_t { - ap_pool_t *cont; - int elt_size; - int nelts; - int nalloc; - char *elts; -} ap_array_header_t; - -typedef struct ap_table_entry_t { - char *key; /* maybe NULL in future; - * check when iterating thru table_elts - */ - char *val; -} ap_table_entry_t; - -/* XXX: these know about the definition of struct ap_table_t in alloc.c. That - * definition is not here because it is supposed to be private, and by not - * placing it here we are able to get compile-time diagnostics from modules - * written which assume that a ap_table_t is the same as an ap_array_header_t. -djg - */ -#define ap_table_elts(t) ((ap_array_header_t *)(t)) -#define ap_is_empty_table(t) (((t) == NULL)||(((ap_array_header_t *)(t))->nelts == 0)) - -/* - * Structure used by the variable-formatter routines. - */ -typedef struct ap_vformatter_buff_t { - char *curpos; - char *endpos; -} ap_vformatter_buff_t; - -enum kill_conditions { - kill_never, /* process is never sent any signals */ - kill_always, /* process is sent SIGKILL on ap_pool_t cleanup */ - kill_after_timeout, /* SIGTERM, wait 3 seconds, SIGKILL */ - just_wait, /* wait forever for the process to complete */ - kill_only_once /* send SIGTERM and then wait */ -}; - -/* - * Define the prototypes for the various APR GP routines. - */ -API_EXPORT(char *) ap_cpystrn(char *d, const char *s, size_t l); -API_EXPORT(ap_status_t) ap_tokenize_to_argv(char *arg_str, char ***argv_out, - ap_pool_t *token_context); -API_EXPORT(const char *) ap_filename_of_pathname(const char *pathname); -API_EXPORT(char *) ap_collapse_spaces(char *dest, const char *src); - -/*API_EXPORT(ap_mutex_t *) ap_create_mutex(void *m);*/ -API_EXPORT(int) ap_slack(int l, int h); -API_EXPORT_NONSTD(ap_status_t) ap_execle(const char *c, const char *a, ...); -API_EXPORT_NONSTD(ap_status_t) ap_execve(const char *c, const char *argv[], - const char *envp[]); - -#define ap_create_mutex(x) (0) -#define ap_release_mutex(x) (0) -#define ap_acquire_mutex(x) (0) - -/* 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 - * the standard macros do. Tough. - */ -#define ap_isalnum(c) (isalnum(((unsigned char)(c)))) -#define ap_isalpha(c) (isalpha(((unsigned char)(c)))) -#define ap_iscntrl(c) (iscntrl(((unsigned char)(c)))) -#define ap_isdigit(c) (isdigit(((unsigned char)(c)))) -#define ap_isgraph(c) (isgraph(((unsigned char)(c)))) -#define ap_islower(c) (islower(((unsigned char)(c)))) -#define ap_isprint(c) (isprint(((unsigned char)(c)))) -#define ap_ispunct(c) (ispunct(((unsigned char)(c)))) -#define ap_isspace(c) (isspace(((unsigned char)(c)))) -#define ap_isupper(c) (isupper(((unsigned char)(c)))) -#define ap_isxdigit(c) (isxdigit(((unsigned char)(c)))) -#define ap_tolower(c) (tolower(((unsigned char)(c)))) -#define ap_toupper(c) (toupper(((unsigned char)(c)))) - - - - -/* - * Small utility macros to make things easier to read. Not usually a - * goal, to be sure.. - */ - -#ifdef WIN32 -#define ap_killpg(x, y) -#else /* WIN32 */ -#ifdef NO_KILLPG -#define ap_killpg(x, y) (kill (-(x), (y))) -#else /* NO_KILLPG */ -#define ap_killpg(x, y) (killpg ((x), (y))) -#endif /* NO_KILLPG */ -#endif /* WIN32 */ - -/* - * ap_vformatter() is a generic printf-style formatting routine - * with some extensions. The extensions are: - * - * %pA takes a struct in_addr *, and prints it as a.b.c.d - * %pI takes a struct sockaddr_in * and prints it as a.b.c.d:port - * %pp takes a void * and outputs it in hex - * - * The %p hacks are to force gcc's printf warning code to skip - * over a pointer argument without complaining. This does - * mean that the ANSI-style %p (output a void * in hex format) won't - * work as expected at all, but that seems to be a fair trade-off - * for the increased robustness of having printf-warnings work. - * - * Additionally, ap_vformatter allows for arbitrary output methods - * using the ap_vformatter_buff and flush_func. - * - * The ap_vformatter_buff has two elements curpos and endpos. - * curpos is where ap_vformatter will write the next byte of output. - * It proceeds writing output to curpos, and updating curpos, until - * either the end of output is reached, or curpos == endpos (i.e. the - * buffer is full). - * - * If the end of output is reached, ap_vformatter returns the - * number of bytes written. - * - * When the buffer is full, the flush_func is called. The flush_func - * can return -1 to indicate that no further output should be attempted, - * and ap_vformatter will return immediately with -1. Otherwise - * the flush_func should flush the buffer in whatever manner is - * appropriate, re ap_pool_t nitialize curpos and endpos, and return 0. - * - * Note that flush_func is only invoked as a result of attempting to - * write another byte at curpos when curpos >= endpos. So for - * example, it's possible when the output exactly matches the buffer - * space available that curpos == endpos will be true when - * ap_vformatter returns. - * - * ap_vformatter does not call out to any other code, it is entirely - * self-contained. This allows the callers to do things which are - * otherwise "unsafe". For example, ap_psprintf uses the "scratch" - * space at the unallocated end of a block, and doesn't actually - * complete the allocation until ap_vformatter returns. ap_psprintf - * would be completely broken if ap_vformatter were to call anything - * that used a ap_pool_t. Similarly http_bprintf() uses the "scratch" - * space at the end of its output buffer, and doesn't actually note - * that the space is in use until it either has to flush the buffer - * or until ap_vformatter returns. - */ - -API_EXPORT(int) ap_vformatter(int (*flush_func)(ap_vformatter_buff_t *b), - ap_vformatter_buff_t *c, const char *fmt, - va_list ap); - - -/* A small routine to validate a plain text password with a password - * that has been encrypted using any algorithm APR knows about. - */ -API_EXPORT(ap_status_t) ap_validate_password(const char *passwd, const char *hash); - - -/* - * These are snprintf implementations based on ap_vformatter(). - * - * Note that various standards and implementations disagree on the return - * value of snprintf, and side-effects due to %n in the formatting string. - * ap_snprintf behaves as follows: - * - * Process the format string until the entire string is exhausted, or - * the buffer fills. If the buffer fills then stop processing immediately - * (so no further %n arguments are processed), and return the buffer - * length. In all cases the buffer is NUL terminated. - * - * In no event does ap_snprintf return a negative number. It's not possible - * to distinguish between an output which was truncated, and an output which - * exactly filled the buffer. - */ -API_EXPORT(int) ap_snprintf(char *buf, size_t len, const char *format, ...) - __attribute__((format(printf,3,4))); -API_EXPORT(int) ap_vsnprintf(char *buf, size_t len, const char *format, - va_list ap); - -/* - * APR memory structure manipulators (pools, tables, and arrays). - */ -API_EXPORT(ap_pool_t *) ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retcode)); -API_EXPORT(void) ap_clear_pool(struct ap_pool_t *p); -API_EXPORT(void) ap_destroy_pool(struct ap_pool_t *p); -API_EXPORT(long) ap_bytes_in_pool(ap_pool_t *p); -API_EXPORT(long) ap_bytes_in_free_blocks(void); -API_EXPORT(ap_pool_t *) ap_find_pool(const void *ts); -API_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b); -API_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub); - -/* used to guarantee to the ap_pool_t debugging code that the sub ap_pool_t will not be - * destroyed before the parent pool - */ -#ifndef POOL_DEBUG -#ifdef ap_pool_join -#undef ap_pool_join -#endif /* ap_pool_join */ -#define ap_pool_join(a,b) -#endif /* POOL_DEBUG */ - - -API_EXPORT(void *) ap_palloc(struct ap_pool_t *c, int reqsize); -API_EXPORT(void *) ap_pcalloc(struct ap_pool_t *p, int size); -API_EXPORT(char *) ap_pstrdup(struct ap_pool_t *p, const char *s); -API_EXPORT(char *) ap_pstrndup(struct ap_pool_t *p, const char *s, int n); -API_EXPORT_NONSTD(char *) ap_pstrcat(struct ap_pool_t *p, ...); -API_EXPORT(char *) ap_pvsprintf(struct ap_pool_t *p, const char *fmt, va_list ap); -API_EXPORT_NONSTD(char *) ap_psprintf(struct ap_pool_t *p, const char *fmt, ...); -API_EXPORT(ap_array_header_t *) ap_make_array(struct ap_pool_t *p, int nelts, - int elt_size); -API_EXPORT(void *) ap_push_array(ap_array_header_t *arr); -API_EXPORT(void) ap_array_cat(ap_array_header_t *dst, - const ap_array_header_t *src); -API_EXPORT(ap_array_header_t *) ap_copy_array(struct ap_pool_t *p, - const ap_array_header_t *arr); -API_EXPORT(ap_array_header_t *) - ap_copy_array_hdr(struct ap_pool_t *p, - const ap_array_header_t *arr); -API_EXPORT(ap_array_header_t *) - ap_append_arrays(struct ap_pool_t *p, - const ap_array_header_t *first, - const ap_array_header_t *second); -API_EXPORT(char *) ap_array_pstrcat(struct ap_pool_t *p, - const ap_array_header_t *arr, - const char sep); -API_EXPORT(ap_table_t *) ap_make_table(struct ap_pool_t *p, int nelts); -API_EXPORT(ap_table_t *) ap_copy_table(struct ap_pool_t *p, const ap_table_t *t); -API_EXPORT(void) ap_clear_table(ap_table_t *t); -API_EXPORT(const char *) ap_table_get(const ap_table_t *t, const char *key); -API_EXPORT(void) ap_table_set(ap_table_t *t, const char *key, - const char *val); -API_EXPORT(void) ap_table_setn(ap_table_t *t, const char *key, - const char *val); -API_EXPORT(void) ap_table_unset(ap_table_t *t, const char *key); -API_EXPORT(void) ap_table_merge(ap_table_t *t, const char *key, - const char *val); -API_EXPORT(void) ap_table_mergen(ap_table_t *t, const char *key, - const char *val); -API_EXPORT(void) ap_table_add(ap_table_t *t, const char *key, - const char *val); -API_EXPORT(void) ap_table_addn(ap_table_t *t, const char *key, - const char *val); -API_EXPORT(ap_table_t *) ap_overlay_tables(struct ap_pool_t *p, - const ap_table_t *overlay, - const ap_table_t *base); -API_EXPORT(void) - ap_table_do(int (*comp) (void *, const char *, const char *), - void *rec, const ap_table_t *t, ...); -#define AP_OVERLAP_TABLES_SET (0) -#define AP_OVERLAP_TABLES_MERGE (1) -API_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b, - unsigned flags); -API_EXPORT(void) ap_register_cleanup(struct ap_pool_t *p, void *data, - ap_status_t (*plain_cleanup) (void *), - ap_status_t (*child_cleanup) (void *)); -API_EXPORT(void) ap_kill_cleanup(struct ap_pool_t *p, void *data, - ap_status_t (*cleanup) (void *)); -API_EXPORT(void) ap_run_cleanup(struct ap_pool_t *p, void *data, - ap_status_t (*cleanup) (void *)); -API_EXPORT(void) ap_cleanup_for_exec(void); -API_EXPORT(ap_status_t) ap_getpass(const char *prompt, char *pwbuf, size_t *bufsize); -API_EXPORT_NONSTD(ap_status_t) ap_null_cleanup(void *data); - -API_EXPORT(void) ap_note_subprocess(struct ap_pool_t *a, ap_proc_t *pid, - enum kill_conditions how); -API_EXPORT(int) - ap_spawn_child(ap_pool_t *p, - int (*func) (void *a, ap_child_info_t *c), - void *data, enum kill_conditions kill_how, - FILE **pipe_in, FILE **pipe_out, - FILE **pipe_err); - -API_EXPORT(char *) ap_cpystrn(char *dst, const char *src, size_t dst_size); - -/* - * Routine definitions that only work on Windows. - */ - -/*#ifdef TPF*/ -#define ap_block_alarms() -#define ap_unblock_alarms() -/*#else -API_EXPORT(void) ap_block_alarms(void); -API_EXPORT(void) ap_unblock_alarms(void); -#endif */ - -#ifdef __cplusplus -} -#endif - -#endif /* ! APR_LIB_H */ diff --git a/include/apr_lock.h b/include/apr_lock.h deleted file mode 100644 index b2ebc2382..000000000 --- a/include/apr_lock.h +++ /dev/null @@ -1,197 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef APR_LOCKS_H -#define APR_LOCKS_H - -#include "apr_general.h" -#include "apr_errno.h" - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef enum {APR_CROSS_PROCESS, APR_INTRAPROCESS, APR_LOCKALL} ap_lockscope_e; - -typedef enum {APR_MUTEX, APR_READWRITE} ap_locktype_e; - -typedef struct ap_lock_t ap_lock_t; - -/* Function definitions */ -/* - -=head1 ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, ap_lockscope_e scope, const char *fname, ap_pool_t *cont) - -B - - arg 1) The newly created lock structure. - arg 2) The type of lock to create, one of: - APR_MUTEX - APR_READWRITE - arg 3) The scope of the lock to create, one of: - APR_CROSS_PROCESS -- lock processes from the protected area. - APR_INTRAPROCESS -- lock threads from the protected area. - APR_LOCKALL -- lock processes and threads from the - protected area. - arg 4) A file name to use if the lock mechanism requires one. This - argument should always be provided. The lock code itself will - determine if it should be used. - arg 5) The pool to operate on. - -B: APR_CROSS_PROCESS may lock both processes and threads, but it is - only guaranteed to lock processes. - -=cut - */ -ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, - ap_lockscope_e scope, const char *fname, - ap_pool_t *cont); - -/* - -=head1 ap_status_t ap_lock(ap_lock_t *lock) - -B - - arg 1) The lock to set. - -=cut - */ -ap_status_t ap_lock(ap_lock_t *lock); - -/* - -=head1 ap_status_t ap_unlock(ap_lock_t *lock) - -B - - arg 1) The lock to reset. - -=cut - */ -ap_status_t ap_unlock(ap_lock_t *lock); - -/* - -=head1 ap_status_t ap_destroy_lock(ap_lock_t *lock) - -B - - arg 1) The lock to free. - -B: If the lock is currently active when it is destroyed, it - will be unlocked first. - -=cut - */ -ap_status_t ap_destroy_lock(ap_lock_t *lock); - -/* - -=head1 ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, ap_pool_t *cont) - -B - - arg 1) The newly re-opened lock structure. - arg 2) A file name to use if the lock mechanism requires one. This - argument should always be provided. The lock code itself will - determine if it should be used. This filename should be the same - one that was passed to ap_create_lock - arg 3) The pool to operate on. - -B: This function doesn't always do something, it depends on the - locking mechanism chosen for the platform, but it is a good - idea to call it regardless, because it makes the code more - portable. - -=cut - */ -ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, - ap_pool_t *cont); - -/* - -=head1 ap_status_t ap_get_lockdata(ap_lock_t *lock, char *key, void *data) - -B - - arg 1) The currently open lock. - arg 2) The key to use when retreiving data associated with this lock - arg 3) The user data associated with the lock. - -=cut - */ -ap_status_t ap_get_lockdata(ap_lock_t *lock, char *key, void *data); - -/* - -=head1 ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, char *key, ap_status_t (*cleanup) (void *)) - -B - - arg 1) The currently open lock. - arg 2) The user data to associate with the lock. - arg 3) The key to use when associating data with this lock - arg 4) The cleanup to use when the lock is destroyed. - -=cut - */ -ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, char *key, - ap_status_t (*cleanup) (void *)); - -#ifdef __cplusplus -} -#endif - -#endif /* ! APR_LOCKS_H */ diff --git a/include/apr_md5.h b/include/apr_md5.h deleted file mode 100644 index 8f2506bc4..000000000 --- a/include/apr_md5.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - * This is work is derived from material Copyright RSA Data Security, Inc. - * - * The RSA copyright statement and Licence for that original material is - * included below. This is followed by the Apache copyright statement and - * licence for the modifications made to that material. - */ - -/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All - rights reserved. - - License to copy and use this software is granted provided that it - is identified as the "RSA Data Security, Inc. MD5 Message-Digest - Algorithm" in all material mentioning or referencing this software - or this function. - - License is also granted to make and use derivative works provided - that such works are identified as "derived from the RSA Data - Security, Inc. MD5 Message-Digest Algorithm" in all material - mentioning or referencing the derived work. - - RSA Data Security, Inc. makes no representations concerning either - the merchantability of this software or the suitability of this - software for any particular purpose. It is provided "as is" - without express or implied warranty of any kind. - - These notices must be retained in any copies of any part of this - documentation and/or software. - */ - -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef APACHE_MD5_H -#define APACHE_MD5_H - -#include "apr_lib.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define MD5_DIGESTSIZE 16 - -/* UINT4 defines a four byte word */ -typedef unsigned int UINT4; - -/* MD5 context. */ -typedef struct { - UINT4 state[4]; /* state (ABCD) */ - UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ - unsigned char buffer[64]; /* input buffer */ -} ap_md5_ctx_t; - -API_EXPORT(ap_status_t) ap_MD5Init(ap_md5_ctx_t *context); -API_EXPORT(ap_status_t) ap_MD5Update(ap_md5_ctx_t *context, - const unsigned char *input, - unsigned int inputLen); -API_EXPORT(ap_status_t) ap_MD5Final(unsigned char digest[MD5_DIGESTSIZE], - ap_md5_ctx_t *context); -API_EXPORT(ap_status_t) ap_MD5Encode(const char *password, const char *salt, - char *result, size_t nbytes); - -#ifdef __cplusplus -} -#endif - -#endif /* !APACHE_MD5_H */ diff --git a/include/apr_mmap.h b/include/apr_mmap.h deleted file mode 100644 index 598b0e3f9..000000000 --- a/include/apr_mmap.h +++ /dev/null @@ -1,121 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef APR_MMAP_H -#define APR_MMAP_H - -#include "apr_general.h" -#include "apr_errno.h" -#include "apr_network_io.h" -#include "apr_portable.h" - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -typedef struct ap_mmap_t ap_mmap_t; - -/* Function definitions */ - -/* - -=head1 ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset) - -B - - arg 1) The newly created mmap'ed file. - arg 2) The file turn into an mmap. - arg 3) The offset into the file to start the data pointer at. - arg 4) The size of the file - arg 5) The pool to use when creating the mmap. - -=cut - */ -ap_status_t ap_mmap_create(ap_mmap_t ** newmmap, ap_file_t *file, ap_off_t offset, - ap_size_t size, ap_pool_t *cntxt); - -/* - -=head1 ap_status_t ap_mmap_delete(ap_mmap_t *mmap) - -B - - arg 1) The mmap'ed file. - -=cut - */ -ap_status_t ap_mmap_delete(ap_mmap_t *mmap); - -/* - -=head1 ap_status_t ap_mmap_offset(void **addr, ap_mmap_t *mmap, ap_offset_t offset) - -B - - arg 1) The pointer to the offset specified. - arg 2) The mmap'ed file. - arg 3) The offset to move to. - -=cut - */ -ap_status_t ap_mmap_offset(void **addr, ap_mmap_t *mmap, ap_off_t offset); - -#ifdef __cplusplus -} -#endif - -#endif /* ! APR_MMAP_H */ - - diff --git a/include/apr_network_io.h b/include/apr_network_io.h deleted file mode 100644 index 8646f939e..000000000 --- a/include/apr_network_io.h +++ /dev/null @@ -1,722 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef APR_NETWORK_IO_H -#define APR_NETWORK_IO_H - -#ifdef WIN32 -#include -#endif - -#include "apr_general.h" -#include "apr_file_io.h" -#include "apr_errno.h" -#if APR_HAVE_NETINET_IN_H -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#ifndef MAX_SECS_TO_LINGER -#define MAX_SECS_TO_LINGER 30 -#endif - -#ifndef APRMAXHOSTLEN -#define APRMAXHOSTLEN 256 -#endif - -#ifndef APR_ANYADDR -#define APR_ANYADDR "0.0.0.0" -#endif - -/* Socket option definitions */ -#define APR_SO_LINGER 1 -#define APR_SO_KEEPALIVE 2 -#define APR_SO_DEBUG 4 -#define APR_SO_NONBLOCK 8 -#define APR_SO_REUSEADDR 16 -#define APR_SO_TIMEOUT 32 -#define APR_SO_SNDBUF 64 - -#define APR_POLLIN 0x001 -#define APR_POLLPRI 0x002 -#define APR_POLLOUT 0x004 -#define APR_POLLERR 0x010 -#define APR_POLLHUP 0x020 -#define APR_POLLNVAL 0x040 - -typedef enum {APR_SHUTDOWN_READ, APR_SHUTDOWN_WRITE, - APR_SHUTDOWN_READWRITE} ap_shutdown_how_e; - -/* We need to make sure we always have an in_addr type, so APR will just - * define it ourselves, if the platform doesn't provide it. - */ -#if !defined(APR_HAVE_IN_ADDR) -struct in_addr { - ap_uint32_t s_addr; -} -#endif - -/* I guess not everybody uses inet_addr. This defines ap_inet_addr - * appropriately. - */ - -#if APR_HAVE_INET_ADDR -#define ap_inet_addr inet_addr -#elif APR_HAVE_INET_NETWORK /* only DGUX, as far as I know */ -#define ap_inet_addr inet_network -#endif - -typedef struct ap_socket_t ap_socket_t; -typedef struct ap_pollfd_t ap_pollfd_t; -typedef struct ap_hdtr_t ap_hdtr_t; -typedef struct in_addr ap_in_addr; - -#if APR_HAS_SENDFILE -/* A structure to encapsulate headers and trailers for ap_sendfile */ -struct ap_hdtr_t { - struct iovec* headers; - int numheaders; - struct iovec* trailers; - int numtrailers; -}; -#endif - -/* function definitions */ - -/* - -=head1 ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont) - -B - - arg 1) The new socket that has been setup. - arg 2) The pool to use - -=cut - */ -ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_pool_t *cont); - -/* - -=head1 ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how) - -B - - arg 1) The socket to close - arg 2) How to shutdown the socket. One of: - APR_SHUTDOWN_READ -- no longer allow read requests - APR_SHUTDOWN_WRITE -- no longer allow write requests - APR_SHUTDOWN_READWRITE -- no longer allow read or write requests - -B: This does not actually close the socket descriptor, it just - controls which calls are still valid on the socket. - -=cut - */ -ap_status_t ap_shutdown(ap_socket_t *ithesocket, ap_shutdown_how_e how); - -/* - -=head1 ap_status_t ap_close_socket(ap_socket_t *thesocket) - -B - - arg 1) The socket to close - -=cut - */ -ap_status_t ap_close_socket(ap_socket_t *thesocket); - -/* - -=head1 ap_status_t ap_bind(ap_socket_t *sock) - -B - - arg 1) The socket to bind - -B: This is where we will find out if there is any other process - using the selected port. - -=cut - */ -ap_status_t ap_bind(ap_socket_t *sock); - -/* - -=head1 ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) - -B - - arg 1) The socket to listen on - arg 2) The number of outstanding connections allowed in the sockets - listen queue. If this value is less than zero, the listen - queue size is set to zero. - -=cut - */ -ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog); - -/* - -=head1 ap_status_t ap_accept(ap_socket_t **new, ap_socket_t *sock, ap_pool_t *connection_pool) - -B - - arg 1) A copy of the socket that is connected to the socket that - made the connection request. This is the socket which should - be used for all future communication. - arg 2) The socket we are listening on. - arg 3) The pool for the new socket. - -=cut - */ -ap_status_t ap_accept(ap_socket_t **new, const ap_socket_t *sock, - ap_pool_t *connection_pool); - -/* - -=head1 ap_status_t ap_connect(ap_socket_t *sock, char *hostname) - -B - - arg 1) The socket we wish to use for our side of the connection - arg 2) The hostname of the machine we wish to connect to. If NULL, - APR assumes that the sockaddr_in in the apr_socket is completely - filled out. - -=cut - */ -ap_status_t ap_connect(ap_socket_t *sock, char *hostname); - -/* - -=head1 ap_status_t ap_get_remote_hostname(char **name, ap_socket_t *sock) - -B - - arg 1) A buffer to store the hostname in. - arg 2) The socket to examine. - -=cut - */ -ap_status_t ap_get_remote_hostname(char **name, ap_socket_t *sock); - -/* - -=head1 ap_status_t ap_gethostname(char *buf, ap_int32_t len, ap_pool_t *cont) - -B - - arg 1) A buffer to store the hostname in. - arg 2) The maximum length of the hostname that can be stored in the - buffer provided. - arg 3) The pool to use. - -=cut - */ -ap_status_t ap_gethostname(char *buf, int len, ap_pool_t *cont); - -/* - -=head1 ap_status_t ap_get_socketdata(void **data, char *key, ap_socket_t *sock) - -B - - arg 1) The currently open socket. - arg 2) The user data associated with the socket. - -=cut - */ -ap_status_t ap_get_socketdata(void **data, char *key, ap_socket_t *sock); - -/* - -=head1 ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, char *key, ap_status_t (*cleanup) (void *)) - -B - - arg 1) The currently open socket. - arg 2) The user data to associate with the socket. - arg 3) The key to associate with the data. - arg 4) The cleanup to call when the socket is destroyed. - -=cut - */ -ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, char *key, - ap_status_t (*cleanup) (void*)); - -/* - -=head1 ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len) - -B - - arg 1) The socket to send the data over. - arg 2) The buffer which contains the data to be sent. - arg 3) On entry, the number of bytes to send; on exit, the number - of bytes sent. - -B: This functions acts like a blocking write by default. To change - this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option. - - It is possible for both bytes to be sent and an error to be returned. - - APR_EINTR is never returned. - -=cut - */ -ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len); - -/* - -=head1 ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec, ap_int32_t nvec, ap_int32_t *len) - -B - - arg 1) The socket to send the data over. - arg 2) The array of iovec structs containing the data to send - arg 3) The number of iovec structs in the array - arg 4) Receives the number of bytes actually written - -B: This functions acts like a blocking write by default. To change - this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option. - The number of bytes actually sent is stored in argument 3. - - It is possible for both bytes to be sent and an error to be returned. - - APR_EINTR is never returned. - -=cut - */ -ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec, - ap_int32_t nvec, ap_int32_t *len); - -#if APR_HAS_SENDFILE -/* - -=head1 ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, ap_hdtr_t *hdtr, ap_off_t *offset, ap_size_t *len, ap_int32_t flags) - -B - - arg 1) The socket to which we're writing - arg 2) The open file from which to read - arg 3) A structure containing the headers and trailers to send - arg 4) Offset into the file where we should begin writing - arg 5) Number of bytes to send - arg 6) OS-specific flags to pass to sendfile() - -B: This functions acts like a blocking write by default. To change - this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option. - The number of bytes actually sent is stored in argument 5. - -=cut - */ -ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, ap_hdtr_t *hdtr, - ap_off_t *offset, ap_size_t *len, ap_int32_t flags); -#endif - -/* - -=head1 ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) - -B - - arg 1) The socket to read the data from. - arg 2) The buffer to store the data in. - arg 3) On entry, the number of bytes to receive; on exit, the number - of bytes received. - -B: This functions acts like a blocking read by default. To change - this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option. - The number of bytes actually sent is stored in argument 3. - - It is possible for both bytes to be received and an APR_EOF or - other error to be returned. - - APR_EINTR is never returned. - -=cut - */ -ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len); - -/* - -=head1 ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) - -B - - arg 1) The socket to set up. - arg 2) The option we would like to configure. One of: - APR_SO_DEBUG -- turn on debugging information - APR_SO_KEEPALIVE -- keep connections active - APR_SO_LINGER -- lingers on close if data is present - APR_SO_NONBLOCK -- Turns blocking on/off for socket - APR_SO_REUSEADDR -- The rules used in validating addresses - supplied to bind should allow reuse - of local addresses. - APR_SO_TIMEOUT -- Set the timeout value in microseconds. - values < 0 mean wait forever. 0 means - don't wait at all. - APR_SO_SNDBUF -- Set the SendBufferSize - arg 3) Are we turning the option on or off. - -=cut - */ -ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on); - -/* - -=head1 ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port) - Assocaite a local port with a socket. - - arg 1) The socket to set - arg 2) The local port this socket will be dealing with. - -B: This does not bind the two together, it is just telling apr - that this socket is going to use this port if possible. If - the port is already used, we won't find out about it here. - -=cut - */ -ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port); - -/* - -=head1 ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port) - -B - - arg 1) The socket to enquire about. - arg 2) The local port this socket will be dealing with. - -B: This does not make a connection to the remote port, it is just - telling apr which port ap_connect() should attempt to connect to. - -=cut - */ -ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port); - -/* - -=head1 ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock) - -B - - arg 1) The local port this socket is associated with. - arg 2) The socket to enquire about. - -=cut - */ -ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock); - -/* - -=head1 ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock) - -B - - arg 1) The remote port this socket is associated with. - arg 2) The socket to enquire about. - -=cut - */ -ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock); - -/* - -=head1 ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, cont char *addr) - -B - - arg 1) The socket to use - arg 2) The IP address to attach to the socket. - Use APR_ANYADDR to use any IP addr on the machine. - -B: This does not bind the two together, it is just telling apr - that this socket is going to use this address if possible. - -=cut - */ -ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, const char *addr); - -/* - -=head1 ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, cont char *addr) - -B - - arg 1) The socket to use - arg 2) The IP address to attach to the socket. - -B: This does not make a connection to the remote address, it is just - telling apr which address ap_connect() should attempt to connect to. - -=cut - */ -ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr); - -/* - -=head1 ap_status_t ap_get_local_ipaddr(char **addr, const ap_socket_t *sock) - -B - - arg 1) The local IP address associated with the socket. - arg 2) The socket to use - -=cut - */ -ap_status_t ap_get_local_ipaddr(char **addr, const ap_socket_t *sock); - -/* - -=head1 ap_status_t ap_get_remote_ipaddr(char **addr, const ap_socket_t *sock) - -B - - arg 1) The remote IP address associated with the socket. - arg 2) The socket to use - -=cut - */ -ap_status_t ap_get_remote_ipaddr(char **addr, const ap_socket_t *sock); - -/* - -=head1 ap_status_t ap_get_local_name(struct sockaddr_in **name, const ap_socket_t *sock) - -B - - arg 1) The local name associated with the socket. - arg 2) The socket to use - -=cut - */ -ap_status_t ap_get_local_name(struct sockaddr_in **name, const ap_socket_t *sock); - -/* - -=head1 ap_status_t ap_get_remote_name(struct sockaddr_in **name, const ap_socket_t *sock) - -B - - arg 1) The remote name associated with the socket. - arg 2) The socket to use - -=cut - */ -ap_status_t ap_get_remote_name(struct sockaddr_in **name, const ap_socket_t *sock); - -/* - -=head1 ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_pool_t *cont) - -B - - arg 1) The poll structure to be used. - arg 2) The number of socket descriptors to be polled. - arg 3) The pool to operate on. - -=cut - */ -ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, - ap_pool_t *cont); - -/* - -=head1 ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, ap_interval_time_t timeout) - -B - - arg 1) The poll structure we will be using. - arg 2) The number of sockets we are polling. - arg 3) The amount of time in microseconds to wait. This is a maximum, not - a minimum. If a socket is signalled, we will wake up before this - time. A negative number means wait until a socket is signalled. - -B: The number of sockets signalled is returned in the second argument. - - This is a blocking call, and it will not return until either a - socket has been signalled, or the timeout has expired. - -=cut - */ -ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, ap_interval_time_t timeout); - -/* - -=head1 ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock, ap_int16_t event) - -B - - arg 1) The poll structure we will be using. - arg 2) The socket to add to the current poll structure. - arg 3) The events to look for when we do the poll. One of: - APR_POLLIN -- signal if read will not block - APR_POLLPRI -- signal if prioirty data is availble to be read - APR_POLLOUT -- signal if write will not block - -=cut - */ -ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, ap_socket_t *socket, - ap_int16_t event); - -/* - -=head1 ap_status_t ap_mask_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock, ap_int16_t events) - -B - - arg 1) The poll structure we will be using. - arg 2) The socket to modify in poll structure. - arg 3) The events to stop looking for during the poll. One of: - APR_POLLIN -- signal if read will not block - APR_POLLPRI -- signal if prioirty data is availble to be read - APR_POLLOUT -- signal if write will not block - -=cut - */ -ap_status_t ap_mask_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock, - ap_int16_t events); -/* - -=head1 ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock) - -B - - arg 1) The poll structure we will be using. - arg 2) The socket to remove from the current poll structure. - -=cut - */ -ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock); - -/* - -=head1 ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t events) - -B - - arg 1) The poll structure we will be using. - arg 2) The events to clear from all sockets. One of: - APR_POLLIN -- signal if read will not block - APR_POLLPRI -- signal if prioirty data is availble to be read - APR_POLLOUT -- signal if write will not block - -=cut - */ -ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t events); - -/* - -=head1 ap_status_t ap_get_revents(ap_int_16_t *event, ap_socket_t *sock, ap_pollfd_t *aprset) - -B - - arg 1) The returned events for the socket. One of: - APR_POLLIN -- Data is available to be read - APR_POLLPRI -- Prioirty data is availble to be read - APR_POLLOUT -- Write will succeed - APR_POLLERR -- An error occurred on the socket - APR_POLLHUP -- The connection has been terminated - APR_POLLNVAL -- This is an invalid socket to poll on. - Socket not open. - arg 2) The socket we wish to get information about. - arg 3) The poll structure we will be using. - -=cut - */ -ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, - ap_pollfd_t *aprset); - -/* - -=head1 ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, char *key, void *data) - -B - - arg 1) The currently open pollfd. - arg 2) The key to use for retreiving data associated with a poll struct. - arg 3) The user data associated with the pollfd. - -=cut - */ -ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, char *key, void *data); - -/* - -=head1 ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, char *key, ap_status_t (*cleanup) (void *)) - -B - - arg 1) The currently open pollfd. - arg 2) The user data to associate with the pollfd. - -=cut - */ -ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, char *key, - ap_status_t (*cleanup) (void *)); - -/* accessor functions */ - -#ifdef __cplusplus -} -#endif - -#endif /* ! APR_NETWORK_IO_H */ - diff --git a/include/apr_pools.h b/include/apr_pools.h deleted file mode 100644 index c485464e2..000000000 --- a/include/apr_pools.h +++ /dev/null @@ -1,244 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef ap_POOLS_H -#define ap_POOLS_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Resource allocation routines... - * - * designed so that we don't have to keep track of EVERYTHING so that - * it can be explicitly freed later (a fundamentally unsound strategy --- - * particularly in the presence of die()). - * - * Instead, we maintain pools, and allocate items (both memory and I/O - * handlers) from the pools --- currently there are two, one for per - * transaction info, and one for config info. When a transaction is over, - * we can delete everything in the per-transaction ap_pool_t without fear, and - * without thinking too hard about it either. - * - * rst - */ - -/* Arenas for configuration info and transaction info - * --- actual layout of the ap_pool_t structure is private to - * alloc.c. - */ - -#include "apr_lib.h" - -#if APR_HAVE_SYS_TYPES_H -#include -#endif - -struct process_chain { - ap_proc_t *pid; - enum kill_conditions kill_how; - struct process_chain *next; -}; - -struct ap_table_t { - /* This has to be first to promote backwards compatibility with - * older modules which cast a ap_table_t * to an ap_array_header_t *... - * they should use the table_elts() function for most of the - * cases they do this for. - */ - ap_array_header_t a; -#ifdef MAKE_TABLE_PROFILE - void *creator; -#endif -}; - -/* - * Tables. Implemented alist style, for now, though we try to keep - * it so that imposing a hash table structure on top in the future - * wouldn't be *too* hard... - * - * Note that key comparisons for these are case-insensitive, largely - * because that's what's appropriate and convenient everywhere they're - * currently being used... - */ - -ap_status_t ap_init_alloc(void); /* Set up everything */ -void ap_term_alloc(void); /* Tear down everything */ - -/* used to guarantee to the pool debugging code that the sub pool will not be - * destroyed before the parent pool - */ -#ifndef POOL_DEBUG -#ifdef ap_pool_join -#undef ap_pool_join -#endif /* ap_pool_join */ -#define ap_pool_join(a,b) -#endif /* POOL_DEBUG */ - -/* Clearing out EVERYTHING in an pool... destroys any sub-pools */ - -/* Preparing for exec() --- close files, etc., but *don't* flush I/O - * buffers, *don't* wait for subprocesses, and *don't* free any memory. - */ - -/* routines to allocate memory from an pool... */ - -API_EXPORT_NONSTD(char *) ap_psprintf(struct ap_pool_t *, const char *fmt, ...) - __attribute__((format(printf,2,3))); - -/* array and alist management... keeping lists of things. - * Common enough to want common support code ... - */ - -/* ap_array_pstrcat generates a new string from the ap_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. - */ - -/* copy_array copies the *entire* array. copy_array_hdr just copies - * the header, and arranges for the elements to be copied if (and only - * if) the code subsequently does a push or arraycat. - */ - - - -/* Conceptually, ap_overlap_tables does this: - - ap_array_header_t *barr = ap_table_elts(b); - ap_table_entry_t *belt = (ap_table_entry_t *)barr->elts; - int i; - - for (i = 0; i < barr->nelts; ++i) { - if (flags & ap_OVERLAP_TABLES_MERGE) { - ap_table_mergen(a, belt[i].key, belt[i].val); - } - else { - ap_table_setn(a, belt[i].key, belt[i].val); - } - } - - Except that it is more efficient (less space and cpu-time) especially - when b has many elements. - - Notice the assumptions on the keys and values in b -- they must be - in an ancestor of a's pool. In practice b and a are usually from - the same pool. -*/ -#define ap_OVERLAP_TABLES_SET (0) -#define ap_OVERLAP_TABLES_MERGE (1) - -/* A set of flags which indicate places where the server should raise(SIGSTOP). - * This is useful for debugging, because you can then attach to that process - * with gdb and continue. This is important in cases where one_process - * debugging isn't possible. - */ -#define SIGSTOP_DETACH 1 -#define SIGSTOP_MAKE_CHILD 2 #define SIGSTOP_SPAWN_CHILD 4 -#define SIGSTOP_PIPED_LOG_SPAWN 8 -#define SIGSTOP_CGI_CHILD 16 - -#ifdef DEBUG_SIGSTOP -extern int raise_sigstop_flags; -#define RAISE_SIGSTOP(x) do { \ - if (raise_sigstop_flags & SIGSTOP_##x) raise(SIGSTOP);\ - } while (0) -#else -#define RAISE_SIGSTOP(x) -#endif - -#ifdef ULTRIX_BRAIN_DEATH -#define ap_fdopen(d,m) fdopen((d), (char *)(m)) -#else -#define ap_fdopen(d,m) fdopen((d), (m)) -#endif - -/* XXX - the socket functions for pools should (and will) use APR sockets. - * This is temporary. */ -#ifndef BEOS /* this really screws up BeOS R4.5 !! */ -#define closesocket(s) close(s) -#endif - - - -/* XXX: these know about the definition of struct ap_table_t in alloc.c. That - * definition is not here because it is supposed to be private, and by not - * placing it here we are able to get compile-time diagnostics from modules - * written which assume that a ap_table_t is the same as an ap_array_header_t. -djg - */ -#define ap_table_elts(t) ((ap_array_header_t *)(t)) -#define ap_is_empty_table(t) (((t) == NULL)||(((ap_array_header_t *)(t))->nelts == 0)) - -/* magic numbers --- min free bytes to consider a free ap_pool_t block useable, - * and the min amount to allocate if we have to go to malloc() */ - -#ifndef BLOCK_MINFREE -#define BLOCK_MINFREE 4096 -#endif -#ifndef BLOCK_MINALLOC -#define BLOCK_MINALLOC 8192 -#endif - -/* Finally, some accounting */ - -API_EXPORT(long) ap_bytes_in_pool(ap_pool_t *p); -API_EXPORT(long) ap_bytes_in_free_blocks(void); - -#ifdef __cplusplus -} -#endif - -#endif /* !ap_POOLS_H */ diff --git a/include/apr_portable.h b/include/apr_portable.h deleted file mode 100644 index dca3d43dd..000000000 --- a/include/apr_portable.h +++ /dev/null @@ -1,444 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -/* This header file is where you should put ANY platform specific information. - * This should be the only header file that programs need to include that - * actually has platform dependant code which refers to the . - */ -#ifndef APR_PORTABLE_H -#define APR_PORTABLE_H - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include "apr_general.h" -#include "apr_thread_proc.h" -#include "apr_file_io.h" -#include "apr_network_io.h" -#include "apr_errno.h" -#include "apr_lock.h" -#include "apr_time.h" - -#if APR_HAVE_DIRENT_H -#include -#endif -#if APR_HAVE_FCNTL_H -#include -#endif -#if APR_HAVE_PTHREAD_H -#include -#endif -#if APR_HAVE_UNION_SEMUN -#include -#endif - -#ifdef WIN32 -/* The primitives for Windows types */ -typedef HANDLE ap_os_file_t; -typedef HANDLE ap_os_dir_t; -typedef SOCKET ap_os_sock_t; -typedef HANDLE ap_os_lock_t; -typedef HANDLE ap_os_thread_t; -typedef PROCESS_INFORMATION ap_os_proc_t; -typedef DWORD ap_os_threadkey_t; -typedef FILETIME ap_os_imp_time_t; -typedef SYSTEMTIME ap_os_exp_time_t; - -#elif defined(OS2) -#define INCL_DOS -#include -typedef HFILE ap_os_file_t; -typedef HDIR ap_os_dir_t; -typedef int ap_os_sock_t; -typedef HMTX ap_os_lock_t; -typedef TID ap_os_thread_t; -typedef PID ap_os_proc_t; -typedef PULONG ap_os_threadkey_t; -typedef struct timeval ap_os_imp_time_t; -typedef struct tm ap_os_exp_time_t; - -#elif defined(BEOS) -#include - -struct ap_os_lock_t { - /* Inter proc */ - sem_id sem_interproc; - int32 ben_interproc; - /* Intra Proc */ - sem_id sem_intraproc; - int32 ben_intraproc; -}; - -typedef int ap_os_file_t; -typedef DIR ap_os_dir_t; -typedef int ap_os_sock_t; -typedef struct ap_os_lock_t ap_os_lock_t; -typedef thread_id ap_os_thread_t; -typedef thread_id ap_os_proc_t; -typedef int ap_os_threadkey_t; -typedef struct timeval ap_os_imp_time_t; -typedef struct tm ap_os_exp_time_t; - -#else -/* Any other OS should go above this one. This is the lowest common - * denominator typedefs for all UNIX-like systems. :) - */ - -#ifdef NEED_UNION_SEMUN -/* it makes no sense, but this isn't defined on solaris */ -union semun { - long val; - struct semid_ds *buf; - ushort *array; -}; -#endif - -struct ap_os_lock_t { -#if APR_USE_SYSVSEM_SERIALIZE - int crossproc; -#elif APR_USE_FCNTL_SERIALIZE - int crossproc; -#elif APR_USE_PROC_PTHREAD_SERIALIZE - pthread_mutex_t *crossproc; -#elif APR_USE_FLOCK_SERIALIZE - int crossproc; -#else - /* No Interprocess serialization, too bad. */ -#endif -#if APR_HAS_THREADS - /* If no threads, no need for thread locks */ -#if APR_USE_PTHREAD_SERIALIZE - pthread_mutex_t *intraproc; -#endif -#endif -}; - -typedef int ap_os_file_t; -typedef DIR ap_os_dir_t; -typedef int ap_os_sock_t; -typedef struct ap_os_lock_t ap_os_lock_t; -#if APR_HAS_THREADS && APR_HAVE_PTHREAD_H -typedef pthread_t ap_os_thread_t; -typedef pthread_key_t ap_os_threadkey_t; -#endif -typedef pid_t ap_os_proc_t; -typedef struct timeval ap_os_imp_time_t; -typedef struct tm ap_os_exp_time_t; -#endif - -/* - -=head1 ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file) - -B - - arg 1) The os specific file we are converting to - arg 2) The apr file to convert. - -B: On Unix, it is only possible to get a file descriptor from - an apr file type. - -=cut - */ -ap_status_t ap_get_os_file(ap_os_file_t *thefile, ap_file_t *file); - -/* - -=head1 ap_status_t ap_get_os_dir(ap_os_dir_t **thedir, ap_dir_t *dir) - -B - - arg 1) The os specific dir we are converting to - arg 2) The apr dir to convert. - -=cut - */ -ap_status_t ap_get_os_dir(ap_os_dir_t **thedir, ap_dir_t *dir); - -/* - -=head1 ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock) - -B - - arg 1) The socket to convert. - arg 2) The os specifc equivelant of the apr socket.. - -=cut - */ -ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock); - -/* - -=head1 ap_status_t ap_get_os_lock(ap_os_lock_t *oslock, ap_lock_t *lock) - -B - - arg 1) The os specific lock we are converting to. - arg 2) The apr lock to convert. - -=cut - */ -ap_status_t ap_get_os_lock(ap_os_lock_t *oslock, ap_lock_t *lock); - -/* - -=head1 ap_status_t ap_get_os_proc(ap_os_proc_t *theproc, ap_proc_t *proc) - -B - - arg 1) The os specific proc we are converting to - arg 2) The apr proc we are converting - -=cut - */ -ap_status_t ap_get_os_proc(ap_os_proc_t *theproc, ap_proc_t *proc); - -/* - -=head1 ap_status_t ap_get_os_exp_time(ap_os_exp_time_t **ostime, ap_exploded_time_t *aprtime) - -B - - arg 1) the native time format - arg 2) the time to convert - -=cut - */ -ap_status_t ap_get_os_exp_time(ap_os_exp_time_t **, ap_exploded_time_t *); - -/* - -=head1 ap_status_t ap_get_os_imp_time(ap_os_imp_time_t **ostime, ap_time_t *aprtime) - -B - - arg 1) the native time format - arg 2) the time to convert - -=cut - */ -ap_status_t ap_get_os_imp_time(ap_os_imp_time_t **, ap_time_t *); -#if APR_HAS_THREADS -/* - -=head1 ap_status_t ap_get_os_thread(ap_thread_t *thethd, ap_os_thread_t *thd) - -B - - arg 1) The apr thread to convert - arg 2) The os specific thread we are converting to - -=cut - */ -ap_status_t ap_get_os_thread(ap_os_thread_t *thethd, ap_thread_t *thd); - -/* - -=head1 ap_status_t ap_get_os_threadkey(ap_threadkey_t *thekey, ap_os_threadkey_t *key) - -B - - arg 1) The apr handle we are converting from. - arg 2) The os specific handle we are converting to. - -=cut - */ -ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *thekey, ap_threadkey_t *key); -#endif - -/* - -=head1 ap_status_t ap_put_os_file(ap_file_t **file, ap_os_file_t *thefile, ap_pool_t *cont) - -B - - arg 1) The apr file we are converting to. - arg 2) The os specific file to convert - arg 3) The pool to use if it is needed. - -B: On Unix, it is only possible to put a file descriptor into - an apr file type. - -=cut - */ -ap_status_t ap_put_os_file(ap_file_t **file, ap_os_file_t *thefile, - ap_pool_t *cont); - -/* - -=head1 ap_status_t ap_put_os_dir(ap_dir_t **dir, ap_os_dir_t *thedir, ap_pool_t *cont) - -B - - arg 1) The apr dir we are converting to. - arg 2) The os specific dir to convert - arg 3) The pool to use when creating to apr directory. - -=cut - */ -ap_status_t ap_put_os_dir(ap_dir_t **dir, ap_os_dir_t *thedir, - ap_pool_t *cont); - -/* - -=head1 ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_socket_t *thesock, ap_pool_t *cont) - -B - - arg 1) The pool to use. - arg 2) The socket to convert to. - arg 3) The socket we are converting to an apr type. - -=cut - */ -ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_sock_t *thesock, - ap_pool_t *cont); - -/* - -=head1 ap_status_t ap_put_os_lock(ap_lock_t **lock, ap_os_lock_t *, ap_pool_t *cont) - -B - - arg 1) The apr lock we are converting to. - arg 2) The os specific lock to convert. - arg 3) The pool to use if it is needed. - -=cut - */ -ap_status_t ap_put_os_lock(ap_lock_t **lock, ap_os_lock_t *thelock, - ap_pool_t *cont); - -/* - -=head1 ap_status_t ap_put_os_proc(ap_proc_t *proc, ap_os_proc_t *theproc, ap_pool_t *cont) - -B - - arg 1) The apr proc we are converting to. - arg 2) The os specific proc to convert - arg 3) The pool to use if it is needed. - -=cut - */ -ap_status_t ap_put_os_proc(ap_proc_t **proc, ap_os_proc_t *theproc, - ap_pool_t *cont); - -/* - -=head1 ap_status_t ap_put_os_imp_time(ap_time_t *aprtime, ap_os_imp_time_t **ostime, ap_pool_t, *cont) - -B - - arg 1) the APR time format - arg 2) the time to convert - arg 3) the pool to use if necessary - -=cut - */ -ap_status_t ap_put_os_imp_time(ap_time_t *, ap_os_imp_time_t **, ap_pool_t *); - -/* - -=head1 ap_status_t ap_put_os_exp_time(ap_exploded_time_t *aprtime, ap_os_exp_time_t **ostime, ap_pool_t, *cont) - -B - - arg 1) the APR time format - arg 2) the time to convert - arg 3) the pool to use if necessary - -=cut - */ -ap_status_t ap_put_os_exp_time(ap_exploded_time_t *, ap_os_exp_time_t **, ap_pool_t *); - -#if APR_HAS_THREADS -/* - -=head1 ap_status_t ap_put_os_thread(ap_thread_t *thd, ap_os_thread_t *thethd, ap_pool_t *cont) - -B - - arg 1) The apr thread we are converting to. - arg 2) The os specific thread to convert - arg 3) The pool to use if it is needed. - -=cut - */ -ap_status_t ap_put_os_thread(ap_thread_t **thd, ap_os_thread_t *thethd, - ap_pool_t *cont); - -/* - -=head1 ap_status_t ap_put_os_threadkey(ap_threadkey_t *key, ap_os_threadkey_t *thekey, ap_pool_t *cont) - -B - - arg 1) The apr handle we are converting to. - arg 2) The os specific handle to convert - arg 3) The pool to use if it is needed. - -=cut - */ -ap_status_t ap_put_os_threadkey(ap_threadkey_t **key, ap_os_threadkey_t *thekey, - ap_pool_t *cont); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* ! APR_PORTABLE_H */ diff --git a/include/apr_private.hw b/include/apr_private.hw deleted file mode 100644 index d3015e358..000000000 --- a/include/apr_private.hw +++ /dev/null @@ -1,158 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -/* - * Note: - * This is the windows specific autoconf like config file - * which is used to generate apr_private.h at build time. - * Do not put any code into this file which depends on - * APR include files. - */ - -#ifdef WIN32 - -#ifndef APR_CONFIG_H -#define APR_CONFIG_H - -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#ifndef _WIN32_WINNT -/* - * Compile the server including all the Windows NT 4.0 header files by - * default. - */ -#define _WIN32_WINNT 0x0400 -#endif -#include -#include -#include -#include -#include -#include -#include - -#define HAVE_SENDFILE 1 - -/* Use this section to define all of the HAVE_FOO_H - * that are required to build properly. - */ -#define HAVE_CONIO_H 1 -#define HAVE_MALLOC_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_SIGNAL_H 1 - -#define SIGHUP 1 -/* 2 is used for SIGINT on windows */ -#define SIGQUIT 3 -/* 4 is used for SIGILL on windows */ -#define SIGTRAP 5 -#define SIGIOT 6 -#define SIGBUS 7 -/* 8 is used for SIGFPE on windows */ -#define SIGKILL 9 -#define SIGUSR1 10 -/* 11 is used for SIGSEGV on windows */ -#define SIGUSR2 12 -#define SIGPIPE 13 -#define SIGALRM 14 -/* 15 is used for SIGTERM on windows */ -#define SIGSTKFLT 16 -#define SIGCHLD 17 -#define SIGCONT 18 -#define SIGSTOP 19 -#define SIGTSTP 20 -/* 21 is used for SIGBREAK on windows */ -/* 22 is used for SIGABRT on windows */ -#define SIGTTIN 23 -#define SIGTTOU 24 -#define SIGURG 25 -#define SIGXCPU 26 -#define SIGXFSZ 27 -#define SIGVTALRM 28 -#define SIGPROF 29 -#define SIGWINCH 30 -#define SIGIO 31 - -#define __attribute__(__x) - -/* APR COMPATABILITY FUNCTIONS - * This section should be used to define functions and - * macros which are need to make Windows features look - * like POSIX features. - */ -typedef void (Sigfunc)(int); - -#define strcasecmp(s1, s2) stricmp(s1, s2) -#define sleep(t) Sleep(t * 1000) - - -/* APR FEATURE MACROS. - * This section should be used to define feature macros - * that the windows port needs. - */ -#define APR_HAS_THREADS 1 - -#define SIZEOF_SHORT 2 -#define SIZEOF_INT 4 -#define SIZEOF_LONGLONG 8 -#define SIZEOF_CHAR 1 -#define SIZEOF_SSIZE_T SIZEOF_INT - -unsigned __stdcall SignalHandling(void *); -int thread_ready(void); - -#endif /*APR_CONFIG_H*/ -#endif /*WIN32*/ diff --git a/include/apr_shmem.h b/include/apr_shmem.h deleted file mode 100644 index 47cf5944f..000000000 --- a/include/apr_shmem.h +++ /dev/null @@ -1,213 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef APR_SHMEM_H -#define APR_SHMEM_H - -#include "apr.h" -#include "apr_general.h" -#include "apr_errno.h" - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#if APR_USES_ANONYMOUS_SHM -typedef void ap_shm_name_t; -#elif APR_USES_FILEBASED_SHM -typedef char * ap_shm_name_t; -#elif APR_USES_KEYBASED_SHM -typedef key_t ap_shm_name_t; -#endif - -typedef struct shmem_t ap_shmem_t; - -/* - -=head1 ap_status_t ap_shm_init(ap_shmem_t *m, ap_size_t reqsize, char *file) - -B - - arg 1) The shared memory block. - arg 2) The size of the shared memory pool. - arg 3) The file to use for the shared memory on platforms that - require it. - arg 4) The pool to use - -=cut - */ -ap_status_t ap_shm_init(ap_shmem_t **m, ap_size_t reqsize, const char *file, ap_pool_t *cont); - -/* - -=head1 ap_status_t ap_shm_destroy(ap_shmem_t *m) - -B - - arg 1) The shared memory block to destroy. - -=cut - */ -ap_status_t ap_shm_destroy(ap_shmem_t *m); - -/* - -=head1 ap_status_t ap_shm_malloc(ap_shmem_t *c, ap_size_t reqsize) - -B - - arg 1) The shared memory block to destroy. - arg 2) How much memory to allocate - -=cut - */ -void *ap_shm_malloc(ap_shmem_t *c, ap_size_t reqsize); - -/* - -=head1 void *ap_shm_calloc(ap_shmem_t *shared, ap_size_t size) - -B - - arg 1) The shared memory block to destroy. - arg 2) How much memory to allocate - -=cut - */ -void *ap_shm_calloc(ap_shmem_t *shared, ap_size_t size); - -/* - -=head1 ap_status_t ap_shm_free(ap_shmem_t *shared, void *entity) - -B - - arg 1) The shared memory block to destroy. - -=cut - */ -ap_status_t ap_shm_free(ap_shmem_t *shared, void *free); - -/* - -=head1 ap_status_t ap_get_shm_name(ap_shmem_t *c, ap_shm_name_t **name) - -B - - arg 1) The shared memory block to destroy. - arg 2) The name of the shared memory block, NULL if anonymous - shared memory. - return) APR_USES_ANONYMOUS_SHM if we are using anonymous shared - memory. APR_USES_FILEBASED_SHM if our shared memory is - based on file access. APR_USES_KEYBASED_SHM if shared - memory is based on a key value such as shmctl. If the - shared memory is anonymous, the name is NULL. - -=cut - */ -ap_status_t ap_get_shm_name(ap_shmem_t *c, ap_shm_name_t **name); - -/* - -=head1 ap_status_t ap_set_shm_name(ap_shmem_t *c, ap_shm_name_t *name) - -B This is to allow processes to open -shared memory created by another process. - - arg 1) The shared memory block to destroy. - arg 2) The name of the shared memory block, NULL if anonymous - shared memory. - return) APR_USES_ANONYMOUS_SHM if we are using anonymous shared - memory. APR_SUCCESS if we are using named shared memory - and we were able to assign the name correctly. - -=cut - */ -ap_status_t ap_set_shm_name(ap_shmem_t *c, ap_shm_name_t *name); - -/* - -=head1 ap_status_t ap_open_shmem(ap_shmem_t *c) - -B - - arg 1) The shared memory block to open in the child. - return) This should be called after ap_set_shm_name. The ap_shmem_t - variable must refer to the memory segment to open. - -=cut - */ -ap_status_t ap_open_shmem(ap_shmem_t *c); - -/* - -=head1 ap_status_t ap_shm_avail(ap_shmem_t *c, ap_size_t *size) - -B - - arg 1) The shared memory block to open in the child. - arg 2) The amount of space available in the shared memory block. - -=cut - */ -ap_status_t ap_shm_avail(ap_shmem_t *c, ap_size_t *avail); - -#ifdef __cplusplus -} -#endif - -#endif /* ! APR_FILE_IO_H */ - - diff --git a/include/apr_signal.h b/include/apr_signal.h deleted file mode 100644 index 34f02ce37..000000000 --- a/include/apr_signal.h +++ /dev/null @@ -1,73 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef APR_SIGNAL_H -#define APR_SIGNAL_H - -#include "apr_general.h" -#include "apr_errno.h" - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef int ap_signum_t; - -#ifdef __cplusplus -} -#endif - -#endif /* ! APR_SIGNAL_H */ - - diff --git a/include/apr_strnatcmp.h b/include/apr_strnatcmp.h deleted file mode 100644 index c65f6dfb6..000000000 --- a/include/apr_strnatcmp.h +++ /dev/null @@ -1,37 +0,0 @@ -/* -*- mode: c; c-file-style: "k&r" -*- - - strnatcmp.c -- Perform 'natural order' comparisons of strings in C. - Copyright (C) 2000 by Martin Pool - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef APR_STRNATCMP_H -#define APR_STRNATCMP_H - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -int ap_strnatcmp(char const *a, char const *b); -int ap_strnatcasecmp(char const *a, char const *b); - -#ifdef __cplusplus -} -#endif - -#endif /* !APR_STRNATCMP_H */ diff --git a/include/arch/aix/dso.h b/include/arch/aix/dso.h deleted file mode 100644 index 392a92015..000000000 --- a/include/arch/aix/dso.h +++ /dev/null @@ -1,73 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef DSO_H -#define DSO_H - -#include "apr_private.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_dso.h" - -void *dlopen(const char *path, int mode); -void *dlsym(void *handle, const char *symbol); -const char *dlerror(void); -int dlclose(void *handle); - -struct ap_dso_handle_t { - ap_pool_t *cont; - void *handle; -}; - -#endif diff --git a/include/arch/beos/dso.h b/include/arch/beos/dso.h deleted file mode 100644 index 2666d779a..000000000 --- a/include/arch/beos/dso.h +++ /dev/null @@ -1,70 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#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 - -struct ap_dso_handle_t { - image_id handle; /* Handle to the DSO loaded */ - ap_pool_t *cont; -}; - -#endif diff --git a/include/arch/beos/locks.h b/include/arch/beos/locks.h deleted file mode 100644 index 0160b5e71..000000000 --- a/include/arch/beos/locks.h +++ /dev/null @@ -1,82 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef LOCKS_H -#define LOCKS_H - -#include -#include "apr_lock.h" -#include "apr_file_io.h" -#include "apr_general.h" -#include "apr_lib.h" - -struct ap_lock_t { - ap_pool_t *cntxt; - ap_locktype_e type; - ap_lockscope_e scope; - int curr_locked; - char *fname; - /* Inter proc */ - sem_id sem_interproc; - int32 ben_interproc; - /* Intra Proc */ - sem_id sem_intraproc; - int32 ben_intraproc; - /* At some point, we should do a scope for both inter and intra process - * locking here. Something like pthread_mutex with PTHREAD_PROCESS_SHARED - */ -}; - -#endif /* LOCKS_H */ - diff --git a/include/arch/beos/networkio.h b/include/arch/beos/networkio.h deleted file mode 100644 index 3966acf43..000000000 --- a/include/arch/beos/networkio.h +++ /dev/null @@ -1,112 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef NETWORK_IO_H -#define NETWORK_IO_H - -#include -#include -#include -#include -#include -#include -#include "apr_network_io.h" -#include "apr_general.h" -#include "apr_portable.h" -#include "apr_lib.h" -#include "fileio.h" -#include "apr_errno.h" - -/* The definition of isascii was missed from the PowerPC ctype.h - * - * It will be included in the next release, but until then... */ -#if __POWERPC__ -#define isascii(c) (((c) & ~0x7f)==0) -#endif - -#include "apr_general.h" -#include /* for the ntohs definition */ - -#define POLLIN 1 -#define POLLPRI 2 -#define POLLOUT 4 -#define POLLERR 8 -#define POLLHUP 16 -#define POLLNVAL 32 - -struct ap_socket_t { - ap_pool_t *cntxt; - int socketdes; - struct sockaddr_in *local_addr; - struct sockaddr_in *remote_addr; - int addr_len; - ap_interval_time_t timeout; - int connected; -}; - -struct ap_pollfd_t { - ap_pool_t *cntxt; - struct ap_socket_t *sock; - fd_set *read; - fd_set *write; - fd_set *except; - int highsock; -}; - -ap_int16_t get_event(ap_int16_t); - -int inet_aton(const char *cp, struct in_addr *addr); - -#endif /* ! NETWORK_IO_H */ - diff --git a/include/arch/beos/threadproc.h b/include/arch/beos/threadproc.h deleted file mode 100644 index 4588105d1..000000000 --- a/include/arch/beos/threadproc.h +++ /dev/null @@ -1,134 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr_thread_proc.h" -#include "fileio.h" -#include "apr_file_io.h" -#include "apr_thread_proc.h" -#include "apr_file_io.h" -#include "apr_general.h" -#include "apr_portable.h" -#include -#include -#include -#include - -#ifndef THREAD_PROC_H -#define THREAD_PROC_H - -#define SHELL_PATH "/bin/sh" - -#define PTHREAD_CANCEL_AYNCHRONOUS CANCEL_ASYNCH; -#define PTHREAD_CANCEL_DEFERRED CANCEL_DEFER; - -#define PTHREAD_CANCEL_ENABLE CANCEL_ENABLE; -#define PTHREAD_CANCEL_DISABLE CANCEL_DISABLE; - -#define BEOS_MAX_DATAKEYS 128 - -struct ap_thread_t { - ap_pool_t *cntxt; - thread_id td; -}; - -struct ap_threadattr_t { - ap_pool_t *cntxt; - int32 attr; - int detached; - int joinable; -}; - -struct ap_threadkey_t { - ap_pool_t *cntxt; - int32 key; -}; - -struct beos_private_data { - const void ** data; - int count; - volatile thread_id td; -}; - -struct beos_key { - int assigned; - int count; - sem_id lock; - int32 ben_lock; - void (* destructor) (); -}; - -struct ap_procattr_t { - ap_pool_t *cntxt; - ap_file_t *parent_in; - ap_file_t *child_in; - ap_file_t *parent_out; - ap_file_t *child_out; - ap_file_t *parent_err; - ap_file_t *child_err; - char *currdir; - ap_int32_t cmdtype; - ap_int32_t detached; -}; - -struct ap_proc_t { - ap_pool_t *cntxt; - thread_id pid; - struct ap_procattr_t *attr; -}; - -/* we need a structure to pass off to the thread that will run any - * new process we create */ - -#endif /* ! THREAD_PROC_H */ - diff --git a/include/arch/os2/dso.h b/include/arch/os2/dso.h deleted file mode 100644 index 02855bb0c..000000000 --- a/include/arch/os2/dso.h +++ /dev/null @@ -1,72 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef DSO_H -#define DSO_H - -#define INCL_DOS -#include - -#include "apr_private.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_dso.h" - -struct ap_dso_handle_t { - ap_pool_t *cont; /* Context for returning error strings */ - HMODULE handle; /* Handle to the DSO loaded */ - char *failed_module; -}; - -#endif diff --git a/include/arch/os2/fileio.h b/include/arch/os2/fileio.h deleted file mode 100644 index b2d6d6d2e..000000000 --- a/include/arch/os2/fileio.h +++ /dev/null @@ -1,102 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef FILE_IO_H -#define FILE_IO_H - -#define INCL_DOS -#include - -#include "apr_private.h" -#include "apr_general.h" -#include "apr_lock.h" -#include "apr_file_io.h" -#include "apr_errno.h" - -#define APR_FILE_BUFSIZE 4096 - -struct ap_file_t { - ap_pool_t *cntxt; - HFILE filedes; - char * fname; - int isopen; - int buffered; - int eof_hit; - ap_int32_t flags; - int timeout; - int pipe; - HEV pipeSem; - - /* 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 - unsigned long filePtr; // position in file of handle - ap_lock_t *mutex; // mutex semaphore, must be owned to access the above fields -}; - -struct ap_dir_t { - ap_pool_t *cntxt; - char *dirname; - ULONG handle; - FILEFINDBUF3 entry; - int validentry; -}; - -ap_status_t apr_file_cleanup(void *); -ap_status_t ap_os2_time_to_ap_time(ap_time_t *result, FDATE os2date, FTIME os2time); - -#endif /* ! FILE_IO_H */ - diff --git a/include/arch/os2/locks.h b/include/arch/os2/locks.h deleted file mode 100644 index d416b6b08..000000000 --- a/include/arch/os2/locks.h +++ /dev/null @@ -1,77 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef LOCKS_H -#define LOCKS_H - -#include "apr_lock.h" -#include "apr_file_io.h" -#define INCL_DOS -#include - -struct ap_lock_t { - ap_pool_t *cntxt; - ap_locktype_e type; - ap_lockscope_e scope; - char *fname; - HMTX hMutex; - TID owner; - int lock_count; - TIB *tib; -}; - -void setup_lock(); - -#endif /* LOCKS_H */ - diff --git a/include/arch/os2/networkio.h b/include/arch/os2/networkio.h deleted file mode 100644 index 63424de6a..000000000 --- a/include/arch/os2/networkio.h +++ /dev/null @@ -1,97 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef NETWORK_IO_H -#define NETWORK_IO_H - -#include "apr_network_io.h" -#include "apr_general.h" -#include "os2calls.h" - -struct ap_socket_t { - ap_pool_t *cntxt; - int socketdes; - struct sockaddr_in *local_addr; - struct sockaddr_in *remote_addr; - int addr_len; - ap_interval_time_t timeout; - int nonblock; -}; - -struct ap_pollfd_t { - ap_pool_t *cntxt; - int *socket_list; - int *r_socket_list; - int num_read; - int num_write; - int num_except; - int num_total; -}; - -/* Error codes returned from sock_errno() */ -#define SOCBASEERR 10000 -#define SOCEPERM (SOCBASEERR+1) /* Not owner */ -#define SOCESRCH (SOCBASEERR+3) /* No such process */ -#define SOCEINTR (SOCBASEERR+4) /* Interrupted system call */ -#define SOCENXIO (SOCBASEERR+6) /* No such device or address */ -#define SOCEBADF (SOCBASEERR+9) /* Bad file number */ -#define SOCEACCES (SOCBASEERR+13) /* Permission denied */ -#define SOCEFAULT (SOCBASEERR+14) /* Bad address */ -#define SOCEINVAL (SOCBASEERR+22) /* Invalid argument */ -#define SOCEMFILE (SOCBASEERR+24) /* Too many open files */ -#define SOCEPIPE (SOCBASEERR+32) /* Broken pipe */ -#define SOCEOS2ERR (SOCBASEERR+100) /* OS/2 Error */ - -#endif /* ! NETWORK_IO_H */ - diff --git a/include/arch/os2/os2calls.h b/include/arch/os2/os2calls.h deleted file mode 100644 index 40d54ee6e..000000000 --- a/include/arch/os2/os2calls.h +++ /dev/null @@ -1,140 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#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); - -#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 - - -/* Error codes returned by above calls */ -#define SOCBASEERR 10000 - -#define SOCEPERM (SOCBASEERR+1) /* Not owner */ -#define SOCESRCH (SOCBASEERR+3) /* No such process */ -#define SOCEINTR (SOCBASEERR+4) /* Interrupted system call */ -#define SOCENXIO (SOCBASEERR+6) /* No such device or address */ -#define SOCEBADF (SOCBASEERR+9) /* Bad file number */ -#define SOCEACCES (SOCBASEERR+13) /* Permission denied */ -#define SOCEFAULT (SOCBASEERR+14) /* Bad address */ -#define SOCEINVAL (SOCBASEERR+22) /* Invalid argument */ -#define SOCEMFILE (SOCBASEERR+24) /* Too many open files */ -#define SOCEPIPE (SOCBASEERR+32) /* Broken pipe */ -#define SOCEOS2ERR (SOCBASEERR+100) /* OS/2 Error */ -#define SOCEWOULDBLOCK (SOCBASEERR+35) /* Operation would block */ -#define SOCEINPROGRESS (SOCBASEERR+36) /* Operation now in progress */ -#define SOCEALREADY (SOCBASEERR+37) /* Operation already in progress */ -#define SOCENOTSOCK (SOCBASEERR+38) /* Socket operation on non-socket */ -#define SOCEDESTADDRREQ (SOCBASEERR+39) /* Destination address required */ -#define SOCEMSGSIZE (SOCBASEERR+40) /* Message too long */ -#define SOCEPROTOTYPE (SOCBASEERR+41) /* Protocol wrong type for socket */ -#define SOCENOPROTOOPT (SOCBASEERR+42) /* Protocol not available */ -#define SOCEPROTONOSUPPORT (SOCBASEERR+43) /* Protocol not supported */ -#define SOCESOCKTNOSUPPORT (SOCBASEERR+44) /* Socket type not supported */ -#define SOCEOPNOTSUPP (SOCBASEERR+45) /* Operation not supported on socket */ -#define SOCEPFNOSUPPORT (SOCBASEERR+46) /* Protocol family not supported */ -#define SOCEAFNOSUPPORT (SOCBASEERR+47) /* Address family not supported by protocol family */ -#define SOCEADDRINUSE (SOCBASEERR+48) /* Address already in use */ -#define SOCEADDRNOTAVAIL (SOCBASEERR+49) /* Can't assign requested address */ -#define SOCENETDOWN (SOCBASEERR+50) /* Network is down */ -#define SOCENETUNREACH (SOCBASEERR+51) /* Network is unreachable */ -#define SOCENETRESET (SOCBASEERR+52) /* Network dropped connection on reset */ -#define SOCECONNABORTED (SOCBASEERR+53) /* Software caused connection abort */ -#define SOCECONNRESET (SOCBASEERR+54) /* Connection reset by peer */ -#define SOCENOBUFS (SOCBASEERR+55) /* No buffer space available */ -#define SOCEISCONN (SOCBASEERR+56) /* Socket is already connected */ -#define SOCENOTCONN (SOCBASEERR+57) /* Socket is not connected */ -#define SOCESHUTDOWN (SOCBASEERR+58) /* Can't send after socket shutdown */ -#define SOCETOOMANYREFS (SOCBASEERR+59) /* Too many references: can't splice */ -#define SOCETIMEDOUT (SOCBASEERR+60) /* Connection timed out */ -#define SOCECONNREFUSED (SOCBASEERR+61) /* Connection refused */ -#define SOCELOOP (SOCBASEERR+62) /* Too many levels of symbolic links */ -#define SOCENAMETOOLONG (SOCBASEERR+63) /* File name too long */ -#define SOCEHOSTDOWN (SOCBASEERR+64) /* Host is down */ -#define SOCEHOSTUNREACH (SOCBASEERR+65) /* No route to host */ -#define SOCENOTEMPTY (SOCBASEERR+66) /* Directory not empty */ diff --git a/include/arch/os2/threadproc.h b/include/arch/os2/threadproc.h deleted file mode 100644 index cfcca8d62..000000000 --- a/include/arch/os2/threadproc.h +++ /dev/null @@ -1,108 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr_thread_proc.h" -#include "apr_file_io.h" - -#ifndef THREAD_PROC_H -#define THREAD_PROC_H - -#define APR_THREADATTR_DETACHED 1 - -#define SHELL_PATH "cmd.exe" -#define APR_THREAD_STACKSIZE 65536 - -struct ap_threadattr_t { - ap_pool_t *cntxt; - unsigned long attr; -}; - -struct ap_thread_t { - ap_pool_t *cntxt; - struct ap_threadattr_t *attr; - unsigned long tid; - ap_thread_start_t func; - void *data; - void *rv; -}; - -struct ap_threadkey_t { - ap_pool_t *cntxt; - unsigned long *key; -}; - -struct ap_procattr_t { - ap_pool_t *cntxt; - ap_file_t *parent_in; - ap_file_t *child_in; - ap_file_t *parent_out; - ap_file_t *child_out; - ap_file_t *parent_err; - ap_file_t *child_err; - char *currdir; - ap_int32_t cmdtype; - ap_int32_t detached; -}; - -struct ap_proc_t { - ap_pool_t *cntxt; - pid_t pid; - struct ap_procattr_t *attr; - int running; -}; - -typedef void (*os2_thread_start_t)(void *); - -#endif /* ! THREAD_PROC_H */ - diff --git a/include/arch/unix/dso.h b/include/arch/unix/dso.h deleted file mode 100644 index 67bf85104..000000000 --- a/include/arch/unix/dso.h +++ /dev/null @@ -1,90 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef DSO_H -#define DSO_H - -#include "apr_private.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_dso.h" - -#ifdef HAVE_DLFCN_H -#include -#endif - -#ifdef HAVE_DL_H -#include -#endif - -#ifndef RTLD_NOW -#define RTLD_NOW 1 -#endif - -#ifndef RTLD_GLOBAL -#define RTLD_GLOBAL 0 -#endif - -#if (defined(__FreeBSD__) ||\ - defined(__OpenBSD__) ||\ - defined(__NetBSD__) ) && !defined(__ELF__) -#define DLSYM_NEEDS_UNDERSCORE -#endif - -struct ap_dso_handle_t { - ap_pool_t *cont; - void *handle; -}; - -#endif diff --git a/include/arch/unix/fileio.h b/include/arch/unix/fileio.h deleted file mode 100644 index 1ef43ba09..000000000 --- a/include/arch/unix/fileio.h +++ /dev/null @@ -1,138 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef FILE_IO_H -#define FILE_IO_H - -#include "apr_private.h" -#include "apr_general.h" -#include "apr_file_io.h" -#include "apr_errno.h" -#include "apr_lib.h" - -/* System headers the file I/O library needs */ -#if HAVE_FCNTL_H -#include -#endif -#if HAVE_SYS_TYPES_H -#include -#endif -#if HAVE_ERRNO_H -#include -#endif -#if HAVE_STRING_H -#include -#endif -#if HAVE_DIRENT_H -#include -#endif -#if HAVE_SYS_STAT_H -#include -#endif -#if HAVE_UNISTD_H -#include -#endif -#if HAVE_STDIO_H -#include -#endif -#if HAVE_STDLIB_H -#include -#endif -#if HAVE_SYS_UIO_H -#include -#endif -#if HAVE_SYS_TIME_H -#include -#endif -#ifdef BEOS -#include -#endif -/* End System headers */ - -#define APR_FILE_BUFSIZE 4096 - -struct ap_file_t { - ap_pool_t *cntxt; - int filedes; - char * fname; - int oflags; - int eof_hit; - int pipe; - ap_interval_time_t timeout; - int buffered; - int ungetchar; /* Last char provided by an unget op. (-1 = no char)*/ - - /* 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 */ - unsigned long filePtr; /* position in file of handle */ -#if APR_HAS_THREADS - struct ap_lock_t *thlock; -#endif -}; - -struct ap_dir_t { - ap_pool_t *cntxt; - char *dirname; - DIR *dirstruct; - struct dirent *entry; -}; - -ap_status_t ap_unix_file_cleanup(void *); -mode_t ap_unix_get_fileperms(ap_fileperms_t); - -#endif /* ! FILE_IO_H */ - diff --git a/include/arch/unix/locks.h b/include/arch/unix/locks.h deleted file mode 100644 index f6d37100d..000000000 --- a/include/arch/unix/locks.h +++ /dev/null @@ -1,157 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef LOCKS_H -#define LOCKS_H - -#include "apr_private.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_lock.h" - -/* System headers required by Locks library */ -#if HAVE_UNISTD_H -#include -#endif -#if HAVE_STRING_H -#include -#endif -#if HAVE_USLOCKS_H -#include -#endif -#if HAVE_SYS_TYPES_H -#include -#endif -#if HAVE_SYS_IPC_H -#include -#endif -#if HAVE_SYS_SEM_H -#include -#endif -#if HAVE_SYS_FILE_H -#include -#endif -#if HAVE_STDIO_H -#include -#endif -#if HAVE_FCNTL_H -#include -#endif -#if HAVE_SYS_MMAN_H -#include -#endif - -#if APR_HAS_THREADS -#if HAVE_PTHREAD_H -#include -#endif -#endif -/* End System Headers */ - -#if !APR_HAVE_UNION_SEMUN && APR_USE_SYSVSEM_SERIALIZE -/* it makes no sense, but this isn't defined on solaris */ -union semun { - long val; - struct semid_ds *buf; - ushort *array; -}; -#endif - -struct ap_lock_t { - ap_pool_t *cntxt; - ap_locktype_e type; - ap_lockscope_e scope; - int curr_locked; - char *fname; -#if USE_SYSVSEM_SERIALIZE - int interproc; -#elif USE_FCNTL_SERIALIZE - int interproc; -#elif USE_PROC_PTHREAD_SERIALIZE - pthread_mutex_t *interproc; -#elif USE_FLOCK_SERIALIZE - int interproc; -#else - /* No Interprocess serialization. Too bad. */ -#endif -#if APR_HAS_THREADS - /* APR doesn't have threads, no sense in having an thread lock mechanism. - */ -#if USE_PTHREAD_SERIALIZE - pthread_mutex_t *intraproc; -#endif -#endif - /* At some point, we should do a scope for both inter and intra process - * locking here. Something like pthread_mutex with PTHREAD_PROCESS_SHARED - */ -}; - -#if APR_HAS_THREADS -ap_status_t ap_unix_create_intra_lock(struct ap_lock_t *new); -ap_status_t ap_unix_lock_intra(struct ap_lock_t *lock); -ap_status_t ap_unix_unlock_intra(struct ap_lock_t *lock); -ap_status_t ap_unix_destroy_intra_lock(struct ap_lock_t *lock); -#endif - -void ap_unix_setup_lock(void); -ap_status_t ap_unix_create_inter_lock(struct ap_lock_t *new); -ap_status_t ap_unix_lock_inter(struct ap_lock_t *lock); -ap_status_t ap_unix_unlock_inter(struct ap_lock_t *lock); -ap_status_t ap_unix_destroy_inter_lock(struct ap_lock_t *lock); - -ap_status_t ap_unix_child_init_lock(struct ap_lock_t **lock, ap_pool_t *cont, - const char *fname); - -#endif /* LOCKS_H */ - diff --git a/include/arch/unix/misc.h b/include/arch/unix/misc.h deleted file mode 100644 index bb754bbf6..000000000 --- a/include/arch/unix/misc.h +++ /dev/null @@ -1,98 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef MISC_H -#define MISC_H - -#include "apr.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_getopt.h" -#include "apr_thread_proc.h" -#include "apr_errno.h" -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STDIO_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_SIGNAL_H -#include -#endif -#ifdef HAVE_PTHREAD_H -#include -#endif - -typedef struct datastruct { - void *data; - char *key; - struct datastruct *next; - struct datastruct *prev; -} datastruct; - -struct ap_other_child_rec_t { - struct ap_other_child_rec_t *next; - int pid; - void (*maintenance) (int, void *, int); - void *data; - int write_fd; -}; - - -#endif /* ! MISC_H */ - diff --git a/include/arch/unix/mmap.c b/include/arch/unix/mmap.c deleted file mode 100644 index 5e5b571f7..000000000 --- a/include/arch/unix/mmap.c +++ /dev/null @@ -1,120 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifdef BEOS -#include "../beos/mmap_h.h" -#else -#include "mmap_h.h" -#endif - -#include "apr_portable.h" - -#if HAVE_MMAP - -static ap_status_t mmap_cleanup(void *themmap) -{ - ap_mmap_t *mm = themmap; - int rv; - rv = munmap(mm->mm, mm->size); - - if (rv == 0) { - mm->mm = (caddr_t)-1; - return APR_SUCCESS; - } - else - return errno; -} - -ap_status_t ap_mmap_create(ap_mmap_t **new, ap_file_t *file, ap_off_t offset, - ap_size_t size, ap_pool_t *cont) -{ - caddr_t mm; - - if (file == NULL || file->filedes == -1) - return APR_EBADF; - - (*new) = (ap_mmap_t *)ap_palloc(cont, sizeof(ap_mmap_t)); - - ap_seek(file, APR_SET, &offset); - mm = mmap(NULL, size, PROT_READ, MAP_SHARED, file->filedes ,0); - - if (mm == (caddr_t)-1) { - /* we failed to get an mmap'd file... */ - return APR_ENOMEM; - } - (*new)->mm = mm; - (*new)->size = size; - (*new)->cntxt = cont; - - /* register the cleanup... */ - ap_register_cleanup((*new)->cntxt, (void*)(*new), mmap_cleanup, - ap_null_cleanup); - return APR_SUCCESS; -} - -ap_status_t ap_mmap_delete(ap_mmap_t *mmap) -{ - ap_status_t rv; - - if (mmap->mm == (caddr_t) -1) - return APR_ENOENT; - - if ((rv = mmap_cleanup(mmap)) == APR_SUCCESS) { - ap_kill_cleanup(mmap->cntxt, mmap, mmap_cleanup); - return APR_SUCCESS; - } - return rv; -} - -#endif diff --git a/include/arch/unix/networkio.h b/include/arch/unix/networkio.h deleted file mode 100644 index 9880b0431..000000000 --- a/include/arch/unix/networkio.h +++ /dev/null @@ -1,139 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef NETWORK_IO_H -#define NETWORK_IO_H - -#include "apr_private.h" -#include "apr_network_io.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_lib.h" - -/* System headers the network I/O library needs */ -#if HAVE_SYS_TYPES_H -#include -#endif -#if HAVE_SYS_UIO_H -#include -#endif -#if HAVE_POLL_H -#include -#endif -#if HAVE_ERRNO_H -#include -#endif -#if HAVE_SYS_TIME_H -#include -#endif -#if HAVE_UNISTD_H -#include -#endif -#if HAVE_STRING_H -#include -#endif -#if HAVE_NETINET_TCP_H -#include -#endif -#if HAVE_NETINET_IN_H -#include -#endif -#if HAVE_ARPA_INET_H -#include -#endif -#if HAVE_SYS_SOCKET_H -#include -#endif -#if HAVE_NETDB_H -#include -#endif -#if HAVE_FCNTL_H -#include -#endif -#if HAVE_SYS_SENDFILE_H -#include -#endif -/* End System Headers */ - -struct ap_socket_t { - ap_pool_t *cntxt; - int socketdes; - struct sockaddr_in *local_addr; - struct sockaddr_in *remote_addr; - socklen_t addr_len; - ap_interval_time_t timeout; -#ifndef HAVE_POLL - int connected; -#endif -}; - -struct ap_pollfd_t { - ap_pool_t *cntxt; -#ifdef HAVE_POLL - struct pollfd *pollset; - int num; - int curpos; -#else - fd_set *read; - fd_set *write; - fd_set *except; - int highsock; -#endif - ap_int16_t *events; - ap_int16_t *revents; - -}; - -#endif /* ! NETWORK_IO_H */ - diff --git a/include/arch/unix/threadproc.h b/include/arch/unix/threadproc.h deleted file mode 100644 index ea4c8289d..000000000 --- a/include/arch/unix/threadproc.h +++ /dev/null @@ -1,126 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr_private.h" -#include "apr_thread_proc.h" -#include "apr_file_io.h" -#include "fileio.h" - -/* System headers required for thread/process library */ -#if HAVE_PTHREAD_H -#include -#endif -#if HAVE_SIGNAL_H -#include -#endif -#if HAVE_STRING_H -#include -#endif -#if HAVE_SYS_WAIT_H -#include -#endif -#if HAVE_STRING_H -#include -#endif -/* End System Headers */ - - -#ifndef THREAD_PROC_H -#define THREAD_PROC_H - -#define SHELL_PATH "/bin/sh" - -#if APR_HAS_THREADS -struct ap_thread_t { - ap_pool_t *cntxt; - pthread_t *td; -}; - -struct ap_threadattr_t { - ap_pool_t *cntxt; - pthread_attr_t *attr; -}; - -struct ap_threadkey_t { - ap_pool_t *cntxt; - pthread_key_t key; -}; -#endif - -struct ap_procattr_t { - ap_pool_t *cntxt; - ap_file_t *parent_in; - ap_file_t *child_in; - ap_file_t *parent_out; - ap_file_t *child_out; - ap_file_t *parent_err; - ap_file_t *child_err; - char *currdir; - ap_int32_t cmdtype; - ap_int32_t detached; -}; - -struct ap_proc_t { - ap_pool_t *cntxt; - pid_t pid; - struct ap_procattr_t *attr; -}; - -/*This will move to ap_threadproc.h in time, but I need to figure it out - * on windows first. :) - */ -ap_status_t ap_detach(struct ap_proc_t **, ap_pool_t *); - -#endif /* ! THREAD_PROC_H */ - diff --git a/include/arch/win32/apr_private.h b/include/arch/win32/apr_private.h deleted file mode 100644 index d3015e358..000000000 --- a/include/arch/win32/apr_private.h +++ /dev/null @@ -1,158 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -/* - * Note: - * This is the windows specific autoconf like config file - * which is used to generate apr_private.h at build time. - * Do not put any code into this file which depends on - * APR include files. - */ - -#ifdef WIN32 - -#ifndef APR_CONFIG_H -#define APR_CONFIG_H - -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#ifndef _WIN32_WINNT -/* - * Compile the server including all the Windows NT 4.0 header files by - * default. - */ -#define _WIN32_WINNT 0x0400 -#endif -#include -#include -#include -#include -#include -#include -#include - -#define HAVE_SENDFILE 1 - -/* Use this section to define all of the HAVE_FOO_H - * that are required to build properly. - */ -#define HAVE_CONIO_H 1 -#define HAVE_MALLOC_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_SIGNAL_H 1 - -#define SIGHUP 1 -/* 2 is used for SIGINT on windows */ -#define SIGQUIT 3 -/* 4 is used for SIGILL on windows */ -#define SIGTRAP 5 -#define SIGIOT 6 -#define SIGBUS 7 -/* 8 is used for SIGFPE on windows */ -#define SIGKILL 9 -#define SIGUSR1 10 -/* 11 is used for SIGSEGV on windows */ -#define SIGUSR2 12 -#define SIGPIPE 13 -#define SIGALRM 14 -/* 15 is used for SIGTERM on windows */ -#define SIGSTKFLT 16 -#define SIGCHLD 17 -#define SIGCONT 18 -#define SIGSTOP 19 -#define SIGTSTP 20 -/* 21 is used for SIGBREAK on windows */ -/* 22 is used for SIGABRT on windows */ -#define SIGTTIN 23 -#define SIGTTOU 24 -#define SIGURG 25 -#define SIGXCPU 26 -#define SIGXFSZ 27 -#define SIGVTALRM 28 -#define SIGPROF 29 -#define SIGWINCH 30 -#define SIGIO 31 - -#define __attribute__(__x) - -/* APR COMPATABILITY FUNCTIONS - * This section should be used to define functions and - * macros which are need to make Windows features look - * like POSIX features. - */ -typedef void (Sigfunc)(int); - -#define strcasecmp(s1, s2) stricmp(s1, s2) -#define sleep(t) Sleep(t * 1000) - - -/* APR FEATURE MACROS. - * This section should be used to define feature macros - * that the windows port needs. - */ -#define APR_HAS_THREADS 1 - -#define SIZEOF_SHORT 2 -#define SIZEOF_INT 4 -#define SIZEOF_LONGLONG 8 -#define SIZEOF_CHAR 1 -#define SIZEOF_SSIZE_T SIZEOF_INT - -unsigned __stdcall SignalHandling(void *); -int thread_ready(void); - -#endif /*APR_CONFIG_H*/ -#endif /*WIN32*/ diff --git a/include/arch/win32/atime.h b/include/arch/win32/atime.h deleted file mode 100644 index cf5ab4873..000000000 --- a/include/arch/win32/atime.h +++ /dev/null @@ -1,72 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef ATIME_H -#define ATIME_H - -#include "apr_private.h" -#include "apr_time.h" -#include - -struct atime_t { - ap_pool_t *cntxt; - ap_time_t currtime; - SYSTEMTIME *explodedtime; -}; - -void FileTimeToAprTime(ap_time_t *atime, FILETIME *ft); -void AprTimeToFileTime(LPFILETIME pft, ap_time_t t); - -#endif /* ! ATIME_H */ - diff --git a/include/arch/win32/dso.h b/include/arch/win32/dso.h deleted file mode 100644 index 745db192d..000000000 --- a/include/arch/win32/dso.h +++ /dev/null @@ -1,68 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef DSO_H -#define DSO_H - -#include "apr_private.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_dso.h" - -struct ap_dso_handle_t { - ap_pool_t *cont; - void *handle; -}; - -#endif diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h deleted file mode 100644 index 974889dd0..000000000 --- a/include/arch/win32/fileio.h +++ /dev/null @@ -1,134 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef FILE_IO_H -#define FILE_IO_H - -#ifdef HAVE_SYS_STAT_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_FCNTL_H -#include -#endif -#ifdef HAVE_TIME_H -#include -#endif -#ifdef HAVE_DIRENT_H -#include -#endif -#ifdef HAVE_MALLOC_H -#include -#endif -#ifdef HAVE_UIO_H -#include -#endif -#include "apr_private.h" -#include "apr_pools.h" -#include "apr_general.h" -#include "apr_file_io.h" -#include "apr_errno.h" - -/* quick run-down of fields in windows' ap_file_t structure that may have - * obvious uses. - * fname -- the filename as passed to the open call. - * dwFileAttricutes -- Attributes used to open the file. - * demonfname -- the canonicalized filename. Used to store the result from - * ap_os_canonicalize_filename. - * lowerdemonfname -- inserted at Ken Parzygnat's request, because of the - * ugly way windows deals with case in the filesystem. - * append -- Windows doesn't support the append concept when opening files. - * APR needs to keep track of this, and always make sure we append - * correctly when writing to a file with this flag set TRUE. - */ - -struct ap_file_t { - ap_pool_t *cntxt; - HANDLE filehand; - char *fname; - DWORD dwFileAttributes; - int eof_hit; - int pipe; - ap_interval_time_t timeout; - int buffered; /* Not currently used on Windows */ - int ungetchar; /* Not used. Last char provided by an unget op. (-1 = no char)*/ - - char *demonfname; - char *lowerdemonfname; - int append; - - off_t size; - ap_time_t atime; - ap_time_t mtime; - ap_time_t ctime; -}; - -struct ap_dir_t { - ap_pool_t *cntxt; - char *dirname; - HANDLE dirhand; - WIN32_FIND_DATA *entry; -}; - -ap_status_t file_cleanup(void *); -/*mode_t get_fileperms(ap_fileperms_t); -*/ -API_EXPORT(char *) ap_os_systemcase_filename(struct ap_pool_t *pCont, - const char *szFile); -char * canonical_filename(struct ap_pool_t *pCont, const char *szFile); - -#endif /* ! FILE_IO_H */ - diff --git a/include/arch/win32/locks.h b/include/arch/win32/locks.h deleted file mode 100644 index 602c2eb67..000000000 --- a/include/arch/win32/locks.h +++ /dev/null @@ -1,70 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef LOCKS_H -#define LOCKS_H - -#include "apr_lock.h" - -struct ap_lock_t { - ap_pool_t *cntxt; - ap_locktype_e type; - ap_lockscope_e scope; - HANDLE mutex; - CRITICAL_SECTION section; - char *fname; -}; - -#endif /* LOCKS_H */ - diff --git a/include/arch/win32/misc.h b/include/arch/win32/misc.h deleted file mode 100644 index bb754bbf6..000000000 --- a/include/arch/win32/misc.h +++ /dev/null @@ -1,98 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef MISC_H -#define MISC_H - -#include "apr.h" -#include "apr_private.h" -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_getopt.h" -#include "apr_thread_proc.h" -#include "apr_errno.h" -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STDIO_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_SIGNAL_H -#include -#endif -#ifdef HAVE_PTHREAD_H -#include -#endif - -typedef struct datastruct { - void *data; - char *key; - struct datastruct *next; - struct datastruct *prev; -} datastruct; - -struct ap_other_child_rec_t { - struct ap_other_child_rec_t *next; - int pid; - void (*maintenance) (int, void *, int); - void *data; - int write_fd; -}; - - -#endif /* ! MISC_H */ - diff --git a/include/arch/win32/networkio.h b/include/arch/win32/networkio.h deleted file mode 100644 index 58d82f8b1..000000000 --- a/include/arch/win32/networkio.h +++ /dev/null @@ -1,83 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#ifndef NETWORK_IO_H -#define NETWORK_IO_H - -#include "apr_network_io.h" -#include "apr_general.h" - -struct ap_socket_t { - ap_pool_t *cntxt; - SOCKET sock; - struct sockaddr_in *local_addr; - struct sockaddr_in *remote_addr; - size_t addr_len; - ap_interval_time_t timeout; -}; - -struct ap_pollfd_t { - ap_pool_t *cntxt; - fd_set *read; - int numread; - fd_set *write; - int numwrite; - fd_set *except; - int numexcept; -}; - -ap_status_t status_from_res_error(int); - -#endif /* ! NETWORK_IO_H */ - diff --git a/include/arch/win32/threadproc.h b/include/arch/win32/threadproc.h deleted file mode 100644 index 16667de67..000000000 --- a/include/arch/win32/threadproc.h +++ /dev/null @@ -1,103 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "apr_private.h" -#include "apr_thread_proc.h" -#include "apr_file_io.h" -#include - -#ifndef THREAD_PROC_H -#define THREAD_PROC_H - -#define SHELL_PATH "cmd.exe" - -struct ap_thread_t { - ap_pool_t *cntxt; - HANDLE td; - ap_int32_t cancel; - ap_int32_t cancel_how; -}; - -struct ap_threadattr_t { - ap_pool_t *cntxt; - ap_int32_t detach; -}; - -struct ap_threadkey_t { - ap_pool_t *cntxt; - DWORD key; -}; - -struct ap_procattr_t { - ap_pool_t *cntxt; - STARTUPINFO si; - ap_file_t *parent_in; - ap_file_t *child_in; - ap_file_t *parent_out; - ap_file_t *child_out; - ap_file_t *parent_err; - ap_file_t *child_err; - char *currdir; - ap_int32_t cmdtype; - ap_int32_t detached; -}; - -struct ap_proc_t { - ap_pool_t *cntxt; - PROCESS_INFORMATION pi; - struct ap_procattr_t *attr; -}; - -#endif /* ! THREAD_PROC_H */ - diff --git a/libapr.def b/libapr.def deleted file mode 100644 index b9fe301fe..000000000 --- a/libapr.def +++ /dev/null @@ -1,251 +0,0 @@ -; aprlib.def : - -LIBRARY aprlib -DESCRIPTION '' - -EXPORTS - ; Add new API calls to the end of this list. - ap_opendir @1 - ap_closedir @2 - ap_readdir @3 - ap_rewinddir @4 - ap_make_dir @5 - ap_remove_dir @6 - ap_dir_entry_size @7 - ap_dir_entry_mtime @8 - ap_dir_entry_ftype @9 - ap_get_dir_filename @10 -; ap_get_filename @11 - ap_stat @11 -; ap_get_filesize @12 -; ap_get_fileatime @13 -; ap_get_filectime @14 -; ap_make_iov @15 - ap_dupfile @16 - ap_getfileinfo @17 - ap_open @18 - ap_close @19 - ap_remove_file @20 - ap_create_pipe @21 - ap_read @22 - ap_write @23 - ap_seek @24 - ap_get_filedata @25 - ap_set_filedata @26 - ap_get_os_file @27 - ap_put_os_file @28 - ap_get_os_dir @29 - ap_putc @30 - ap_getc @31 - ap_puts @32 - ap_fgets @33 - ap_flush @34 - ap_fprintf @35 - ap_eof @36 -; ap_get_filetype @37 - ap_writev @38 - ; locks - ap_create_lock @39 - ap_lock @40 - ap_unlock @41 - ap_destroy_lock @42 - ap_child_init_lock @43 - ap_get_lockdata @44 - ap_set_lockdata @45 - ap_get_os_lock @46 - ap_create_tcp_socket @47 - ap_shutdown @48 - ap_close_socket @49 - ap_bind @50 - ap_listen @51 - ap_accept @52 - ap_connect @53 - ap_get_remote_hostname @54 - ap_gethostname @55 - ap_send @56 - ap_recv @57 - ap_setsocketopt @58 - ap_sendv @59 - ap_sendfile @60 - ap_setup_poll @61 - ap_poll @62 - ap_add_poll_socket @63 - ap_get_revents @64 - ap_get_socketdata @65 - ap_set_socketdata @66 - ap_get_polldata @67 - ap_set_polldata @68 - ap_put_os_sock @69 - ap_get_os_sock @70 - ap_remove_poll_socket @71 - ap_clear_poll_sockets @72 -; ap_setipaddr @73 -; ap_getipaddr @74 -; ap_create_signal @75 -; ap_setup_signal @76 -; SignalHandling @77 -; ap_send_signal @78 -; thread_ready @79 - ap_createprocattr_init @80 - ap_setprocattr_io @81 - ap_setprocattr_dir @82 - ap_setprocattr_cmdtype @83 - ap_setprocattr_detach @84 - ap_create_process @85 - ap_get_childin @86 - ap_get_childout @87 - ap_get_childerr @88 - ap_wait_proc @89 - ap_kill @90 - ap_create_threadattr @91 - ap_setthreadattr_detach @92 - ap_getthreadattr_detach @93 - ap_create_thread @94 - ap_thread_exit @95 - ap_thread_join @96 - ap_thread_detach @97 -; ap_cancel_thread @98 - ap_create_thread_private @99 - ap_get_thread_private @100 - ap_set_thread_private @101 - ap_delete_thread_private @102 - ap_get_threaddata @103 - ap_set_threaddata @104 - ap_get_threadkeydata @105 - ap_set_threadkeydata @106 - ap_get_procdata @107 -; ap_set_procdata @108 - ap_get_os_proc @109 - ap_get_os_thread @110 - ap_get_os_threadkey @111 - ap_os_systemcase_filename @112 - canonical_filename @113 - ap_create_pool @114 - ap_destroy_context @115 -; WinTimeToUnixTime @116 -; ap_get_oslevel @117 - ap_get_userdata @118 - ap_set_userdata @119 - ap_initialize @120 - ap_getopt @121 - ap_opterr @122 DATA - ap_optind @123 DATA - ap_optopt @124 DATA - ap_optreset @125 DATA - ap_optarg @126 DATA -; ap_make_time @127 - ap_ansi_time_to_ap_time @127 -; ap_current_time @128 - ap_now @128 -; ap_explode_time @129 - ap_explode_gmt @129 -; ap_implode_time @130 - ap_explode_localtime @130 -; ap_get_curtime @131 - ap_implode_time @131 -; ap_get_sec @132 - ap_get_os_imp_time @132 -; ap_get_min @133 - ap_get_os_exp_time @133 -; ap_get_hour @134 - ap_put_os_imp_time @134 -; ap_get_mday @135 - ap_put_os_exp_time @135 -; ap_get_mon @136 - ap_ctime @136 -; ap_get_year @137 - ap_rfc822_date @137 -; ap_get_wday @138 - ap_strftime @138 -; ap_set_sec @139 -; ap_set_min @140 -; ap_set_hour @141 -; ap_set_mday @142 -; ap_set_mon @143 -; ap_set_year @144 -; ap_set_wday @145 -; ap_get_timedata @146 -; ap_set_timedata @147 -; ap_get_os_time @148 -; ap_timediff @149 - ap_MD5Final @150 - ap_MD5Init @151 - ap_MD5Update @152 - ap_cpystrn @153 - ap_register_cleanup @154 - ap_kill_cleanup @155 - ap_fnmatch @156 - ap_is_fnmatch @157 - ap_MD5Encode @158 - ap_validate_password @159 - ap_make_sub_pool @160 - ap_init_alloc @161 - ap_clear_pool @162 - ap_destroy_pool @163 - ap_bytes_in_pool @164 - ap_bytes_in_free_blocks @165 - ap_palloc @166 - ap_pcalloc @167 - ap_pstrdup @168 - ap_pstrndup @169 - ap_pstrcat @170 - ap_pvsprintf @171 - ap_psprintf @172 - ap_make_array @173 - ap_push_array @174 - ap_array_cat @175 - ap_copy_array @176 - ap_copy_array_hdr @177 - ap_append_arrays @178 - ap_array_pstrcat @179 - ap_make_table @180 - ap_copy_table @181 - ap_clear_table @182 - ap_table_get @183 - ap_table_set @184 - ap_table_setn @185 - ap_table_unset @186 - ap_table_merge @187 - ap_table_mergen @188 - ap_table_add @189 - ap_table_addn @190 - ap_overlay_tables @191 - ap_table_do @192 - ap_overlap_tables @193 - ap_run_cleanup @194 - ap_cleanup_for_exec @195 - ap_null_cleanup @196 - ap_note_subprocess @197 -; ap_slack @198 - ap_vformatter @199 - ap_snprintf @200 - ap_vsnprintf @201 - ap_getpass @202 - ap_ungetc @203 - ap_tokenize_to_argv @204 - ap_filename_of_pathname @205 - ap_get_remote_name @206 - ap_get_local_name @207 - ap_get_local_ipaddr @208 - ap_set_local_ipaddr @209 - ap_get_remote_ipaddr @210 - ap_set_remote_ipaddr @211 - ap_get_local_port @212 - ap_set_local_port @213 - ap_get_remote_port @214 - ap_set_remote_port @215 - ap_open_stderr @216 - ap_set_pipe_timeout @217 - ap_terminate @218 - ap_dso_load @219 - ap_dso_unload @220 - ap_dso_sym @221 - ap_dso_init @222 - ap_collapse_spaces @223 - ap_month_snames @224 - ap_day_snames @225 - ap_canonical_error @226 - ap_strerror @227 - ap_generate_random_bytes @228 - ap_strnatcmp @229 - ap_strnatcasecmp @230 diff --git a/libapr.dsp b/libapr.dsp deleted file mode 100644 index 05f5831e2..000000000 --- a/libapr.dsp +++ /dev/null @@ -1,103 +0,0 @@ -# Microsoft Developer Studio Project File - Name="aprlibdll" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=aprlibdll - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "aprlibdll.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "aprlibdll.mak" CFG="aprlibdll - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "aprlibdll - Win32 Release" (based on\ - "Win32 (x86) Dynamic-Link Library") -!MESSAGE "aprlibdll - Win32 Debug" (based on\ - "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "aprlibdll - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "./include" /I "./inc" /I "./misc/win32" /I "./file_io/win32" /I "./time/win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /def:".\aprlib.def" /out:"Release/aprlib.dll" /libpath:"LibR" /base:@"..\..\os\win32\BaseAddr.ref",aprlib -# ADD LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /def:".\aprlib.def" /out:"Release/aprlib.dll" /libpath:"LibR" /base:@"..\..\os\win32\BaseAddr.ref",aprlib - -!ELSEIF "$(CFG)" == "aprlibdll - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "./include" /I "./inc" /I "./misc/win32" /I "./file_io/win32" /I "./time/win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 aprlib.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /def:".\aprlib.def" /out:"Debug/aprlib.dll" /libpath:"LibD" /base:@"..\..\os\win32\BaseAddr.ref",aprlib -# ADD LINK32 apr.lib kernel32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /def:".\aprlib.def" /out:"Debug/aprlib.dll" /libpath:"LibD" /base:@"..\..\os\win32\BaseAddr.ref",aprlib - -!ENDIF - -# Begin Target - -# Name "aprlibdll - Win32 Release" -# Name "aprlibdll - Win32 Debug" -# Begin Source File - -SOURCE=.\misc\win32\aprlib.c -# End Source File -# Begin Source File - -SOURCE=.\aprlib.def -# PROP Exclude_From_Build 1 -# End Source File -# End Target -# End Project diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c deleted file mode 100644 index 0d853a730..000000000 --- a/memory/unix/apr_pools.c +++ /dev/null @@ -1,1364 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -/* - * Resource allocation code... the code here is responsible for making - * sure that nothing leaks. - * - * rst --- 4/95 --- 6/95 - */ - -#include "apr_private.h" - -#include "apr_portable.h" /* for get_os_proc */ -#include "apr_general.h" -#include "apr_pools.h" -#include "apr_lib.h" -#include "apr_lock.h" -#include "misc.h" - -#ifdef HAVE_SYS_STAT_H -#include -#endif -#ifdef HAVE_SYS_SIGNAL_H -#include -#endif -#ifdef HAVE_SIGNAL_H -#include -#endif -#ifdef HAVE_SYS_WAIT_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_FCNTL_H -#include -#endif - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_MALLOC_H -#include -#endif - -/* - * Debugging support: Define this to enable code which helps detect re-use - * of freed memory and other such nonsense. - * - * The theory is simple. The FILL_BYTE (0xa5) is written over all malloc'd - * memory as we receive it, and is written over everything that we free up - * during a clear_pool. We check that blocks on the free list always - * have the FILL_BYTE in them, and we check during palloc() that the bytes - * still have FILL_BYTE in them. If you ever see garbage URLs or whatnot - * containing lots of 0xa5s then you know something used data that's been - * freed or uninitialized. - */ -/* #define ALLOC_DEBUG */ - -/* - * Debugging support: If defined all allocations will be done with - * malloc and free()d appropriately at the end. This is intended to be - * used with something like Electric Fence or Purify to help detect - * memory problems. Note that if you're using efence then you should also - * add in ALLOC_DEBUG. But don't add in ALLOC_DEBUG if you're using Purify - * because ALLOC_DEBUG would hide all the uninitialized read errors that - * Purify can diagnose. - */ -/* #define ALLOC_USE_MALLOC */ - -/* - * Pool debugging support: This is intended to detect cases where the - * wrong pool is used when assigning data to an object in another pool. - * In particular, it causes the table_{set,add,merge}n routines to check - * that their arguments are safe for the ap_table_t they're being placed in. - * It currently only works with the unix multiprocess model, but could - * be extended to others. - */ -/* #define POOL_DEBUG */ - -/* - * Provide diagnostic information about make_table() calls which are - * possibly too small. This requires a recent gcc which supports - * __builtin_return_address(). The error_log output will be a - * message such as: - * table_push: ap_table_t created by 0x804d874 hit limit of 10 - * Use "l *0x804d874" to find the source that corresponds to. It - * indicates that a ap_table_t allocated by a call at that address has - * possibly too small an initial ap_table_t size guess. - */ -/* #define MAKE_TABLE_PROFILE */ - -/* - * Provide some statistics on the cost of allocations. It requires a - * bit of an understanding of how alloc.c works. - */ -/* #define ALLOC_STATS */ - -#ifdef POOL_DEBUG -#ifdef ALLOC_USE_MALLOC -#error "sorry, no support for ALLOC_USE_MALLOC and POOL_DEBUG at the same time" -#endif /* ALLOC_USE_MALLOC */ - -#ifdef MULTITHREAD -# error "sorry, no support for MULTITHREAD and POOL_DEBUG at the same time" -#endif /* MULTITHREAD */ - -#endif /* POOL_DEBUG */ - -#ifdef ALLOC_USE_MALLOC -#undef BLOCK_MINFREE -#undef BLOCK_MINALLOC -#define BLOCK_MINFREE 0 -#define BLOCK_MINALLOC 0 -#endif /* ALLOC_USE_MALLOC */ - -#define AP_SLACK_LOW 1 -#define AP_SLACK_HIGH 2 - - -/***************************************************************** - * - * Managing free storage blocks... - */ - -union align { - /* - * Types which are likely to have the longest RELEVANT alignment - * restrictions... - */ - - char *cp; - void (*f) (void); - long l; - FILE *fp; - double d; -}; - -#define CLICK_SZ (sizeof(union align)) - -union block_hdr { - union align a; - - /* Actual header... */ - - struct { - char *endp; - union block_hdr *next; - char *first_avail; -#ifdef POOL_DEBUG - union block_hdr *global_next; - ap_pool_t *owning_pool; -#endif /* POOL_DEBUG */ - } h; -}; - -#define APR_ABORT(conditional, retcode, func, str) \ - if (conditional) { \ - if ((func) == NULL) { \ - return NULL; \ - } \ - else { \ - fprintf(stderr, "%s", str); \ - (*(func))(retcode); \ - } \ - } - -/* - * Static cells for managing our internal synchronisation. - */ -static union block_hdr *block_freelist = NULL; - -#if APR_HAS_THREADS -static ap_lock_t *alloc_mutex; -static ap_lock_t *spawn_mutex; -#endif - -#ifdef POOL_DEBUG -static char *known_stack_point; -static int stack_direction; -static union block_hdr *global_block_list; -#define FREE_POOL ((ap_pool_t *)(-1)) -#endif /* POOL_DEBUG */ - -#ifdef ALLOC_STATS -static unsigned long long num_free_blocks_calls; -static unsigned long long num_blocks_freed; -static unsigned max_blocks_in_one_free; -static unsigned num_malloc_calls; -static unsigned num_malloc_bytes; -#endif /* ALLOC_STATS */ - -#ifdef ALLOC_DEBUG -#define FILL_BYTE ((char)(0xa5)) -#define debug_fill(ptr,size) ((void)memset((ptr), FILL_BYTE, (size))) - -static APR_INLINE void debug_verify_filled(const char *ptr, const char *endp, - const char *error_msg) -{ - for ( ; ptr < endp; ++ptr) { - if (*ptr != FILL_BYTE) { - fputs(error_msg, stderr); - abort(); - exit(1); - } - } -} - -#else /* ALLOC_DEBUG */ -#define debug_fill(a,b) -#define debug_verify_filled(a,b,c) -#endif /* ALLOC_DEBUG */ - -/* - * Get a completely new block from the system pool. Note that we rely on - * malloc() to provide aligned memory. - */ - -static union block_hdr *malloc_block(int size, int (*apr_abort)(int retcode)) -{ - union block_hdr *blok; - -#ifdef ALLOC_DEBUG - /* make some room at the end which we'll fill and expect to be - * always filled - */ - size += CLICK_SZ; -#endif /* ALLOC_DEBUG */ - -#ifdef ALLOC_STATS - ++num_malloc_calls; - num_malloc_bytes += size + sizeof(union block_hdr); -#endif /* ALLOC_STATS */ - - blok = (union block_hdr *) malloc(size + sizeof(union block_hdr)); - APR_ABORT(blok == NULL, APR_ENOMEM, apr_abort, - "Ouch! malloc failed in malloc_block()\n"); - debug_fill(blok, size + sizeof(union block_hdr)); - blok->h.next = NULL; - blok->h.first_avail = (char *) (blok + 1); - blok->h.endp = size + blok->h.first_avail; - -#ifdef ALLOC_DEBUG - blok->h.endp -= CLICK_SZ; -#endif /* ALLOC_DEBUG */ - -#ifdef POOL_DEBUG - blok->h.global_next = global_block_list; - global_block_list = blok; - blok->h.owning_pool = NULL; -#endif /* POOL_DEBUG */ - - return blok; -} - - - -#if defined(ALLOC_DEBUG) && !defined(ALLOC_USE_MALLOC) -static void chk_on_blk_list(union block_hdr *blok, union block_hdr *free_blk) -{ - debug_verify_filled(blok->h.endp, blok->h.endp + CLICK_SZ, - "Ouch! Someone trounced the padding " - "at the end of a block!\n"); - while (free_blk) { - if (free_blk == blok) { - fprintf(stderr, "Ouch! Freeing free block\n"); - abort(); - exit(1); - } - free_blk = free_blk->h.next; - } -} -#else /* defined(ALLOC_DEBUG) && !defined(ALLOC_USE_MALLOC) */ -#define chk_on_blk_list(_x, _y) -#endif /* defined(ALLOC_DEBUG) && !defined(ALLOC_USE_MALLOC) */ - -/* Free a chain of blocks --- must be called with alarms blocked. */ - -static void free_blocks(union block_hdr *blok) -{ -#ifdef ALLOC_USE_MALLOC - union block_hdr *next; - - for ( ; blok; blok = next) { - next = blok->h.next; - free(blok); - } -#else /* ALLOC_USE_MALLOC */ - -#ifdef ALLOC_STATS - unsigned num_blocks; -#endif /* ALLOC_STATS */ - - /* - * First, put new blocks at the head of the free list --- - * we'll eventually bash the 'next' pointer of the last block - * in the chain to point to the free blocks we already had. - */ - - union block_hdr *old_free_list; - - if (blok == NULL) { - return; /* Sanity check --- freeing empty pool? */ - } - -#if APR_HAS_THREADS - ap_lock(alloc_mutex); -#endif - old_free_list = block_freelist; - block_freelist = blok; - - /* - * Next, adjust first_avail pointers of each block --- have to do it - * sooner or later, and it simplifies the search in new_block to do it - * now. - */ - -#ifdef ALLOC_STATS - num_blocks = 1; -#endif /* ALLOC_STATS */ - - while (blok->h.next != NULL) { - -#ifdef ALLOC_STATS - ++num_blocks; -#endif /* ALLOC_STATS */ - - chk_on_blk_list(blok, old_free_list); - blok->h.first_avail = (char *) (blok + 1); - debug_fill(blok->h.first_avail, blok->h.endp - blok->h.first_avail); -#ifdef POOL_DEBUG - blok->h.owning_pool = FREE_POOL; -#endif /* POOL_DEBUG */ - blok = blok->h.next; - } - - chk_on_blk_list(blok, old_free_list); - blok->h.first_avail = (char *) (blok + 1); - debug_fill(blok->h.first_avail, blok->h.endp - blok->h.first_avail); -#ifdef POOL_DEBUG - blok->h.owning_pool = FREE_POOL; -#endif /* POOL_DEBUG */ - - /* Finally, reset next pointer to get the old free blocks back */ - - blok->h.next = old_free_list; - -#ifdef ALLOC_STATS - if (num_blocks > max_blocks_in_one_free) { - max_blocks_in_one_free = num_blocks; - } - ++num_free_blocks_calls; - num_blocks_freed += num_blocks; -#endif /* ALLOC_STATS */ - -#if APR_HAS_THREADS - ap_unlock(alloc_mutex); -#endif /* APR_HAS_THREADS */ -#endif /* ALLOC_USE_MALLOC */ -} - -/* - * Get a new block, from our own free list if possible, from the system - * if necessary. Must be called with alarms blocked. - */ - -static union block_hdr *new_block(int min_size, int (*apr_abort)(int retcode)) -{ - union block_hdr **lastptr = &block_freelist; - union block_hdr *blok = block_freelist; - - /* First, see if we have anything of the required size - * on the free list... - */ - - while (blok != NULL) { - if (min_size + BLOCK_MINFREE <= blok->h.endp - blok->h.first_avail) { - *lastptr = blok->h.next; - blok->h.next = NULL; - debug_verify_filled(blok->h.first_avail, blok->h.endp, - "Ouch! Someone trounced a block " - "on the free list!\n"); - return blok; - } - else { - lastptr = &blok->h.next; - blok = blok->h.next; - } - } - - /* Nope. */ - - min_size += BLOCK_MINFREE; - blok = malloc_block((min_size > BLOCK_MINALLOC) - ? min_size : BLOCK_MINALLOC, apr_abort); - return blok; -} - - -/* Accounting */ - -static long bytes_in_block_list(union block_hdr *blok) -{ - long size = 0; - - while (blok) { - size += blok->h.endp - (char *) (blok + 1); - blok = blok->h.next; - } - - return size; -} - - -/***************************************************************** - * - * Pool internals and management... - * NB that subprocesses are not handled by the generic cleanup code, - * basically because we don't want cleanups for multiple subprocesses - * to result in multiple three-second pauses. - */ - -struct process_chain; -struct cleanup; - -static void run_cleanups(struct cleanup *c); -static void free_proc_chain(struct process_chain *p); - -static ap_pool_t *permanent_pool; - -/* Each pool structure is allocated in the start of its own first block, - * so we need to know how many bytes that is (once properly aligned...). - * This also means that when a pool's sub-pool is destroyed, the storage - * associated with it is *completely* gone, so we have to make sure it - * gets taken off the parent's sub-pool list... - */ - -#define POOL_HDR_CLICKS (1 + ((sizeof(struct ap_pool_t) - 1) / CLICK_SZ)) -#define POOL_HDR_BYTES (POOL_HDR_CLICKS * CLICK_SZ) - -API_EXPORT(ap_pool_t *) ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retcode)) -{ - union block_hdr *blok; - ap_pool_t *new_pool; - - ap_block_alarms(); - -#if APR_HAS_THREADS - ap_lock(alloc_mutex); -#endif - - blok = new_block(POOL_HDR_BYTES, apr_abort); - new_pool = (ap_pool_t *) blok->h.first_avail; - blok->h.first_avail += POOL_HDR_BYTES; -#ifdef POOL_DEBUG - blok->h.owning_pool = new_pool; -#endif - - memset((char *) new_pool, '\0', sizeof(struct ap_pool_t)); - new_pool->free_first_avail = blok->h.first_avail; - new_pool->first = new_pool->last = blok; - - if (p) { - new_pool->parent = p; - new_pool->sub_next = p->sub_pools; - if (new_pool->sub_next) { - new_pool->sub_next->sub_prev = new_pool; - } - p->sub_pools = new_pool; - } - else { - permanent_pool = new_pool; - } - -#if APR_HAS_THREADS - ap_unlock(alloc_mutex); -#endif - ap_unblock_alarms(); - - return new_pool; -} - -#ifdef POOL_DEBUG -static void stack_var_init(char *s) -{ - char t; - - if (s < &t) { - stack_direction = 1; /* stack grows up */ - } - else { - stack_direction = -1; /* stack grows down */ - } -} -#endif - -#ifdef ALLOC_STATS -static void dump_stats(void) -{ - fprintf(stderr, - "alloc_stats: [%d] #free_blocks %llu #blocks %llu max " - "%u #malloc %u #bytes %u\n", - (int) getpid(), - num_free_blocks_calls, - num_blocks_freed, - max_blocks_in_one_free, - num_malloc_calls, - num_malloc_bytes); -} -#endif - -/***************************************************************** - * - * Managing generic cleanups. - */ - -struct cleanup { - void *data; - ap_status_t (*plain_cleanup) (void *); - ap_status_t (*child_cleanup) (void *); - struct cleanup *next; -}; - -static void * ap_pool_palloc(ap_pool_t *a, int reqsize, int (*apr_abort)(int retcode)); - -#if 0 -static void ap_register_pool_cleanup(struct ap_pool_t *p, void *data, - ap_status_t (*plain_cleanup) (void *), - ap_status_t (*child_cleanup) (void *)) -{ - struct cleanup *c; - - if (p != NULL) { - c = (struct cleanup *) ap_pool_palloc(p, sizeof(struct cleanup), NULL); - c->data = data; - c->plain_cleanup = plain_cleanup; - c->child_cleanup = child_cleanup; - c->next = p->cleanups; - p->cleanups = c; - } -} -#endif - -API_EXPORT(void) ap_register_cleanup(ap_pool_t *p, void *data, - ap_status_t (*plain_cleanup) (void *), - ap_status_t (*child_cleanup) (void *)) -{ - struct cleanup *c; - - if (p != NULL) { - c = (struct cleanup *) ap_palloc(p, sizeof(struct cleanup)); - c->data = data; - c->plain_cleanup = plain_cleanup; - c->child_cleanup = child_cleanup; - c->next = p->cleanups; - p->cleanups = c; - } -} - -API_EXPORT(void) ap_kill_cleanup(ap_pool_t *p, void *data, - ap_status_t (*cleanup) (void *)) -{ - struct cleanup *c; - struct cleanup **lastp; - - if (p == NULL) - return; - c = p->cleanups; - lastp = &p->cleanups; - while (c) { - if (c->data == data && c->plain_cleanup == cleanup) { - *lastp = c->next; - break; - } - - lastp = &c->next; - c = c->next; - } -} - -API_EXPORT(void) ap_run_cleanup(ap_pool_t *p, void *data, - ap_status_t (*cleanup) (void *)) -{ - ap_block_alarms(); /* Run cleanup only once! */ - (*cleanup) (data); - ap_kill_cleanup(p, data, cleanup); - ap_unblock_alarms(); -} - -static void run_cleanups(struct cleanup *c) -{ - while (c) { - (*c->plain_cleanup) (c->data); - c = c->next; - } -} - -static void run_child_cleanups(struct cleanup *c) -{ - while (c) { - (*c->child_cleanup) (c->data); - c = c->next; - } -} - -static void cleanup_pool_for_exec(ap_pool_t *p) -{ - run_child_cleanups(p->cleanups); - p->cleanups = NULL; - - for (p = p->sub_pools; p; p = p->sub_next) { - cleanup_pool_for_exec(p); - } -} - -API_EXPORT(void) ap_cleanup_for_exec(void) -{ -#if !defined(WIN32) && !defined(OS2) - /* - * Don't need to do anything on NT or OS/2, because I - * am actually going to spawn the new process - not - * exec it. All handles that are not inheritable, will - * be automajically closed. The only problem is with - * file handles that are open, but there isn't much - * I can do about that (except if the child decides - * to go out and close them - */ - ap_block_alarms(); - cleanup_pool_for_exec(permanent_pool); - ap_unblock_alarms(); -#endif /* ndef WIN32 */ -} - -API_EXPORT_NONSTD(ap_status_t) ap_null_cleanup(void *data) -{ - /* do nothing cleanup routine */ - return APR_SUCCESS; -} - -ap_status_t ap_init_alloc(void) -{ -#if APR_HAS_THREADS - ap_status_t status; -#endif -#ifdef POOL_DEBUG - char s; - - known_stack_point = &s; - stack_var_init(&s); -#endif -#if APR_HAS_THREADS - status = ap_create_lock(&alloc_mutex, APR_MUTEX, APR_INTRAPROCESS, - NULL, NULL); - if (status != APR_SUCCESS) { - ap_destroy_lock(alloc_mutex); - return status; - } - status = ap_create_lock(&spawn_mutex, APR_MUTEX, APR_INTRAPROCESS, - NULL, NULL); - if (status != APR_SUCCESS) { - ap_destroy_lock(spawn_mutex); - return status; - } -#endif - -#ifdef ALLOC_STATS - atexit(dump_stats); -#endif - - return APR_SUCCESS; -} - -void ap_term_alloc(void) -{ -#if APR_HAS_THREADS - ap_destroy_lock(alloc_mutex); - ap_destroy_lock(spawn_mutex); -#endif -} - -/* We only want to lock the mutex if we are being called from ap_clear_pool. - * This is because if we also call this function from ap_destroy_real_pool, - * which also locks the same mutex, and recursive locks aren't portable. - * This way, we are garaunteed that we only lock this mutex once when calling - * either one of these functions. - */ -API_EXPORT(void) ap_clear_pool(ap_pool_t *a) -{ - ap_block_alarms(); - - while (a->sub_pools) { - ap_destroy_pool(a->sub_pools); - } - /* - * Don't hold the mutex during cleanups. - */ - run_cleanups(a->cleanups); - a->cleanups = NULL; - free_proc_chain(a->subprocesses); - a->subprocesses = NULL; - free_blocks(a->first->h.next); - a->first->h.next = NULL; - - a->last = a->first; - a->first->h.first_avail = a->free_first_avail; - debug_fill(a->first->h.first_avail, - a->first->h.endp - a->first->h.first_avail); - -#ifdef ALLOC_USE_MALLOC - { - void *c, *n; - - for (c = a->allocation_list; c; c = n) { - n = *(void **)c; - free(c); - } - a->allocation_list = NULL; - } -#endif - - ap_unblock_alarms(); -} - -API_EXPORT(void) ap_destroy_pool(ap_pool_t *a) -{ - ap_block_alarms(); - ap_clear_pool(a); -#if APR_HAS_THREADS - ap_lock(alloc_mutex); -#endif - - if (a->parent) { - if (a->parent->sub_pools == a) { - a->parent->sub_pools = a->sub_next; - } - if (a->sub_prev) { - a->sub_prev->sub_next = a->sub_next; - } - if (a->sub_next) { - a->sub_next->sub_prev = a->sub_prev; - } - } -#if APR_HAS_THREADS - ap_unlock(alloc_mutex); -#endif - free_blocks(a->first); - ap_unblock_alarms(); -} - -API_EXPORT(long) ap_bytes_in_pool(ap_pool_t *p) -{ - return bytes_in_block_list(p->first); -} -API_EXPORT(long) ap_bytes_in_free_blocks(void) -{ - return bytes_in_block_list(block_freelist); -} - -/***************************************************************** - * POOL_DEBUG support - */ -#ifdef POOL_DEBUG - -/* the unix linker defines this symbol as the last byte + 1 of - * the executable... so it includes TEXT, BSS, and DATA - */ -extern char _end; - -/* is ptr in the range [lo,hi) */ -#define is_ptr_in_range(ptr, lo, hi) \ - (((unsigned long)(ptr) - (unsigned long)(lo)) \ - < (unsigned long)(hi) - (unsigned long)(lo)) - -/* Find the pool that ts belongs to, return NULL if it doesn't - * belong to any pool. - */ -API_EXPORT(ap_pool_t *) ap_find_pool(const void *ts, int (apr_abort)(int retcode)) -{ - const char *s = ts; - union block_hdr **pb; - union block_hdr *b; - - /* short-circuit stuff which is in TEXT, BSS, or DATA */ - if (is_ptr_in_range(s, 0, &_end)) { - return NULL; - } - /* consider stuff on the stack to also be in the NULL pool... - * XXX: there's cases where we don't want to assume this - */ - APR_ABORT((stack_direction == -1 && - is_ptr_in_range(s, &ts, known_stack_point)) || - (stack_direction == 1 && - is_ptr_in_range(s, known_stack_point, &ts)), 1, apr_abort, - "Ouch! find_pool() called on pointer in a free block\n"); - ap_block_alarms(); - /* search the global_block_list */ - for (pb = &global_block_list; *pb; pb = &b->h.global_next) { - b = *pb; - if (is_ptr_in_range(s, b, b->h.endp)) { - if (b->h.owning_pool == FREE_POOL) { - abort(); - exit(1); - } - if (b != global_block_list) { - /* - * promote b to front of list, this is a hack to speed - * up the lookup - */ - *pb = b->h.global_next; - b->h.global_next = global_block_list; - global_block_list = b; - } - ap_unblock_alarms(); - return b->h.owning_pool; - } - } - ap_unblock_alarms(); - return NULL; -} - -/* return TRUE iff a is an ancestor of b - * NULL is considered an ancestor of all pools - */ -API_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b) -{ - if (a == NULL) { - return 1; - } - while (a->joined) { - a = a->joined; - } - while (b) { - if (a == b) { - return 1; - } - b = b->parent; - } - return 0; -} - -/* - * All blocks belonging to sub will be changed to point to p - * instead. This is a guarantee by the caller that sub will not - * be destroyed before p is. - */ -API_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub, - int (*apr_abort)(int retcode)) -{ - union block_hdr *b; - - /* We could handle more general cases... but this is it for now. */ - APR_ABORT(sub->parent != p, 1, apr_abort, - "pool_join: p is not a parent of sub\n"); - ap_block_alarms(); - while (p->joined) { - p = p->joined; - } - sub->joined = p; - for (b = global_block_list; b; b = b->h.global_next) { - if (b->h.owning_pool == sub) { - b->h.owning_pool = p; - } - } - ap_unblock_alarms(); -} -#endif - -/***************************************************************** - * - * Allocating stuff... - */ - -void * ap_palloc(ap_pool_t *a, int reqsize) -{ -#ifdef ALLOC_USE_MALLOC - int size = reqsize + CLICK_SZ; - void *ptr; - - if (a == NULL) { - return malloc(reqsize); - } - ap_block_alarms(); - if (c == NULL) { - return malloc(reqsize); - } - ptr = malloc(size); - if (ptr == NULL) { - fputs("Ouch! Out of memory!\n", stderr); - exit(1); - } - debug_fill(ptr, size); /* might as well get uninitialized protection */ - *(void **)ptr = a->allocation_list; - a->allocation_list = ptr; - ap_unblock_alarms(); - return (char *)ptr + CLICK_SZ; -#else - - /* - * Round up requested size to an even number of alignment units - * (core clicks) - */ - int nclicks; - int size; - - /* First, see if we have space in the block most recently - * allocated to this pool - */ - - union block_hdr *blok; - char *first_avail; - char *new_first_avail; - - if (a == NULL) { - return malloc(reqsize); - } - - nclicks = 1 + ((reqsize - 1) / CLICK_SZ); - size = nclicks * CLICK_SZ; - - /* First, see if we have space in the block most recently - * allocated to this pool - */ - - blok = a->last; - first_avail = blok->h.first_avail; - - if (reqsize <= 0) { - return NULL; - } - - new_first_avail = first_avail + size; - - if (new_first_avail <= blok->h.endp) { - debug_verify_filled(first_avail, blok->h.endp, - "Ouch! Someone trounced past the end " - "of their allocation!\n"); - blok->h.first_avail = new_first_avail; - return (void *) first_avail; - } - - /* Nope --- get a new one that's guaranteed to be big enough */ - - ap_block_alarms(); - -#if APR_HAS_THREADS - ap_lock(alloc_mutex); -#endif - - blok = new_block(size, a->apr_abort); - a->last->h.next = blok; - a->last = blok; -#ifdef POOL_DEBUG - blok->h.owning_pool = a; -#endif - -#if APR_HAS_THREADS - ap_unlock(alloc_mutex); -#endif - - ap_unblock_alarms(); - - first_avail = blok->h.first_avail; - blok->h.first_avail += size; - - return (void *) first_avail; -#endif -} - -API_EXPORT(void *) ap_pcalloc(ap_pool_t *a, int size) -{ - void *res = ap_palloc(a, size); - memset(res, '\0', size); - return res; -} - -API_EXPORT(char *) ap_pstrdup(ap_pool_t *a, const char *s) -{ - char *res; - size_t len; - - if (s == NULL) { - return NULL; - } - len = strlen(s) + 1; - res = ap_palloc(a, len); - memcpy(res, s, len); - return res; -} - -API_EXPORT(char *) ap_pstrndup(ap_pool_t *a, const char *s, int n) -{ - char *res; - - if (s == NULL) { - return NULL; - } - res = ap_palloc(a, n + 1); - memcpy(res, s, n); - res[n] = '\0'; - return res; -} - -API_EXPORT_NONSTD(char *) ap_pstrcat(ap_pool_t *a, ...) -{ - char *cp, *argp, *res; - - /* Pass one --- find length of required string */ - - int len = 0; - va_list adummy; - - va_start(adummy, a); - - while ((cp = va_arg(adummy, char *)) != NULL) { - len += strlen(cp); - } - - va_end(adummy); - - /* Allocate the required string */ - - res = (char *) ap_palloc(a, len + 1); - cp = res; - *cp = '\0'; - - /* Pass two --- copy the argument strings into the result space */ - - va_start(adummy, a); - - while ((argp = va_arg(adummy, char *)) != NULL) { - strcpy(cp, argp); - cp += strlen(argp); - } - - va_end(adummy); - - /* Return the result string */ - - return res; -} - -/* - * ap_psprintf is implemented by writing directly into the current - * block of the pool, starting right at first_avail. If there's - * insufficient room, then a new block is allocated and the earlier - * output is copied over. The new block isn't linked into the pool - * until all the output is done. - * - * Note that this is completely safe because nothing else can - * allocate in this ap_pool_t while ap_psprintf is running. alarms are - * blocked, and the only thing outside of alloc.c that's invoked - * is ap_vformatter -- which was purposefully written to be - * self-contained with no callouts. - */ - -struct psprintf_data { - ap_vformatter_buff_t vbuff; -#ifdef ALLOC_USE_MALLOC - char *base; -#else - union block_hdr *blok; - int got_a_new_block; -#endif -}; - -static int psprintf_flush(ap_vformatter_buff_t *vbuff) -{ - struct psprintf_data *ps = (struct psprintf_data *)vbuff; -#ifdef ALLOC_USE_MALLOC - int size; - char *ptr; - - size = (char *)ps->vbuff.curpos - ps->base; - ptr = realloc(ps->base, 2*size); - if (ptr == NULL) { - fputs("Ouch! Out of memory!\n", stderr); - exit(1); - } - ps->base = ptr; - ps->vbuff.curpos = ptr + size; - ps->vbuff.endpos = ptr + 2*size - 1; - return 0; -#else - union block_hdr *blok; - union block_hdr *nblok; - size_t cur_len; - char *strp; - - blok = ps->blok; - strp = ps->vbuff.curpos; - cur_len = strp - blok->h.first_avail; - - /* must try another blok */ -#if APR_HAS_THREADS - ap_lock(alloc_mutex); -#endif - nblok = new_block(2 * cur_len, NULL); -#if APR_HAS_THREADS - ap_unlock(alloc_mutex); -#endif - memcpy(nblok->h.first_avail, blok->h.first_avail, cur_len); - ps->vbuff.curpos = nblok->h.first_avail + cur_len; - /* save a byte for the NUL terminator */ - ps->vbuff.endpos = nblok->h.endp - 1; - - /* did we allocate the current blok? if so free it up */ - if (ps->got_a_new_block) { - debug_fill(blok->h.first_avail, blok->h.endp - blok->h.first_avail); -#if APR_HAS_THREADS - ap_lock(alloc_mutex); -#endif - blok->h.next = block_freelist; - block_freelist = blok; -#if APR_HAS_THREADS - ap_unlock(alloc_mutex); -#endif - } - ps->blok = nblok; - ps->got_a_new_block = 1; - /* note that we've deliberately not linked the new block onto - * the pool yet... because we may need to flush again later, and - * we'd have to spend more effort trying to unlink the block. - */ - return 0; -#endif -} - -API_EXPORT(char *) ap_pvsprintf(ap_pool_t *p, const char *fmt, va_list ap) -{ -#ifdef ALLOC_USE_MALLOC - struct psprintf_data ps; - void *ptr; - - ap_block_alarms(); - ps.base = malloc(512); - if (ps.base == NULL) { - fputs("Ouch! Out of memory!\n", stderr); - exit(1); - } - /* need room at beginning for allocation_list */ - ps.vbuff.curpos = ps.base + CLICK_SZ; - ps.vbuff.endpos = ps.base + 511; - ap_vformatter(psprintf_flush, &ps.vbuff, fmt, ap); - *ps.vbuff.curpos++ = '\0'; - ptr = ps.base; - /* shrink */ - ptr = realloc(ptr, (char *)ps.vbuff.curpos - (char *)ptr); - if (ptr == NULL) { - fputs("Ouch! Out of memory!\n", stderr); - exit(1); - } - *(void **)ptr = p->allocation_list; - p->allocation_list = ptr; - ap_unblock_alarms(); - return (char *)ptr + CLICK_SZ; -#else - struct psprintf_data ps; - char *strp; - int size; - - ap_block_alarms(); - ps.blok = p->last; - ps.vbuff.curpos = ps.blok->h.first_avail; - ps.vbuff.endpos = ps.blok->h.endp - 1; /* save one for NUL */ - ps.got_a_new_block = 0; - - ap_vformatter(psprintf_flush, &ps.vbuff, fmt, ap); - - strp = ps.vbuff.curpos; - *strp++ = '\0'; - - size = strp - ps.blok->h.first_avail; - size = (1 + ((size - 1) / CLICK_SZ)) * CLICK_SZ; - strp = ps.blok->h.first_avail; /* save away result pointer */ - ps.blok->h.first_avail += size; - - /* have to link the block in if it's a new one */ - if (ps.got_a_new_block) { - p->last->h.next = ps.blok; - p->last = ps.blok; -#ifdef POOL_DEBUG - ps.blok->h.owning_pool = p; -#endif - } - ap_unblock_alarms(); - - return strp; -#endif -} - -API_EXPORT_NONSTD(char *) ap_psprintf(ap_pool_t *p, const char *fmt, ...) -{ - va_list ap; - char *res; - - va_start(ap, fmt); - res = ap_pvsprintf(p, fmt, ap); - va_end(ap); - return res; -} - - -/***************************************************************** - * - * More grotty system stuff... subprocesses. Frump. These don't use - * the generic cleanup interface because I don't want multiple - * subprocesses to result in multiple three-second pauses; the - * subprocesses have to be "freed" all at once. If someone comes - * along with another resource they want to allocate which has the - * same property, we might want to fold support for that into the - * generic interface, but for now, it's a special case - */ - -API_EXPORT(void) ap_note_subprocess(ap_pool_t *a, ap_proc_t *pid, - enum kill_conditions how) -{ - struct process_chain *new = - (struct process_chain *) ap_palloc(a, sizeof(struct process_chain)); - - new->pid = pid; - new->kill_how = how; - new->next = a->subprocesses; - a->subprocesses = new; -} - -static void free_proc_chain(struct process_chain *procs) -{ - /* Dispose of the subprocesses we've spawned off in the course of - * whatever it was we're cleaning up now. This may involve killing - * some of them off... - */ - struct process_chain *p; - int need_timeout = 0; - - if (procs == NULL) { - return; /* No work. Whew! */ - } - - /* First, check to see if we need to do the SIGTERM, sleep, SIGKILL - * dance with any of the processes we're cleaning up. If we've got - * any kill-on-sight subprocesses, ditch them now as well, so they - * don't waste any more cycles doing whatever it is that they shouldn't - * be doing anymore. - */ - -#ifndef NEED_WAITPID - /* Pick up all defunct processes */ - for (p = procs; p; p = p->next) { - if (ap_wait_proc(p->pid, APR_NOWAIT) == APR_CHILD_DONE) { - p->kill_how = kill_never; - } - } -#endif - - for (p = procs; p; p = p->next) { - if ((p->kill_how == kill_after_timeout) - || (p->kill_how == kill_only_once)) { - /* - * Subprocess may be dead already. Only need the timeout if not. - * Note: ap_kill on Windows is TerminateProcess(), which is - * similar to a SIGKILL, so always give the process a timeout - * under Windows before killing it. - */ -#ifdef WIN32 - need_timeout = 1; -#else - if (ap_kill(p->pid, APR_SIGTERM) == APR_SUCCESS) { - need_timeout = 1; - } -#endif - } - else if (p->kill_how == kill_always) { - ap_kill(p->pid, APR_SIGKILL); - } - } - - /* Sleep only if we have to... */ - if (need_timeout) { - sleep(3); - } - - /* OK, the scripts we just timed out for have had a chance to clean up - * --- now, just get rid of them, and also clean up the system accounting - * goop... - */ - for (p = procs; p; p = p->next) { - if (p->kill_how == kill_after_timeout) { - ap_kill(p->pid, APR_SIGKILL); - } - } -#ifdef WIN32 - /* - * Do we need an APR function to clean-up a proc_t? - */ - { - PROCESS_INFORMATION pi; - for (p = procs; p; p = p->next) { - ap_get_os_proc(&pi, p->pid); - CloseHandle(pi.hProcess); - } - } -#endif /* WIN32 */ - - /* Now wait for all the signaled processes to die */ - for (p = procs; p; p = p->next) { - if (p->kill_how != kill_never) { - (void) ap_wait_proc(p->pid, APR_WAIT); - } - } -} diff --git a/misc/win32/libapr.c b/misc/win32/libapr.c deleted file mode 100644 index b54667430..000000000 --- a/misc/win32/libapr.c +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Placeholder to force aprlib.dll creation with no LNK4001 error - * - * However, this isn't a bad place to store dynamic-only functions - * that determine which version of apr the application has loaded. - * These functions are of (less?) importance to static-bound apps. - */ diff --git a/threadproc/beos/threadcancel.c b/threadproc/beos/threadcancel.c deleted file mode 100644 index 94a7e9407..000000000 --- a/threadproc/beos/threadcancel.c +++ /dev/null @@ -1,88 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "threadproc.h" - - -ap_status_t ap_cancel_thread(ap_thread_t *thd) -{ - if (kill_thread(thd->td) == 0) { - return APR_SUCCESS; - } - else { - return errno; - } -} - - -ap_status_t ap_setcanceltype(ap_int32_t type, ap_pool_t *cont) -{ -/* if (pthread_setcanceltype(type, NULL) == 0) {*/ - return APR_SUCCESS; -/* } - else { - return APR_FAILURE; - }*/ -} - -ap_status_t ap_setcancelstate(ap_int32_t type, ap_pool_t *cont) -{ -/* if (pthread_setcanceltype(type, NULL) == 0) {*/ - return APR_SUCCESS; -/* } - else { - return APR_FAILURE; - }*/ -} - diff --git a/threadproc/os2/threadcancel.c b/threadproc/os2/threadcancel.c deleted file mode 100644 index ca7a18753..000000000 --- a/threadproc/os2/threadcancel.c +++ /dev/null @@ -1,85 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "threadproc.h" -#include "apr_thread_proc.h" -#include "apr_general.h" -#include "fileio.h" - -ap_status_t ap_cancel_thread(ap_thread_t *thd) -{ - return APR_OS2_STATUS(DosKillThread(thd->tid)); -} - - - -ap_status_t ap_setcanceltype(ap_int32_t type, ap_pool_t *cont) -{ - ULONG rc, nesting; - - if (type == APR_CANCEL_DEFER) - rc = DosEnterMustComplete(&nesting); - else - rc = DosExitMustComplete(&nesting); - - return APR_OS2_STATUS(rc); -} - - - -ap_status_t ap_setcancelstate(ap_int32_t type, ap_pool_t *cont) -{ -/* There's no way to ignore thread kills altogether in OS/2 (that I know of) */ - return APR_ENOTIMPL; -} diff --git a/threadproc/unix/threadcancel.c b/threadproc/unix/threadcancel.c deleted file mode 100644 index 81e3d3e7c..000000000 --- a/threadproc/unix/threadcancel.c +++ /dev/null @@ -1,114 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "threadproc.h" -#if APR_HAS_THREADS - -#ifdef HAVE_PTHREAD_H - -#if 0 /* some platforms, e.g. FreeBSD 2.2.8, do not have pthread_cancel (they do have an undocumented pthread_kill, though) */ -/* ***APRDOC******************************************************** - * ap_status_t ap_cancel_thread(ap_thread_t *thd) - * Asynchronously kill a thread - * arg 1) The thread to kill. - */ -ap_status_t ap_cancel_thread(ap_thread_t *thd) -{ - ap_status_t stat; - if ((stat = pthread_cancel(*thd->td)) == 0) { - return APR_SUCCESS; - } - else { - return stat; - } -} -#endif - -/* ***APRDOC******************************************************** - * ap_status_t ap_setcanceltype(ap_int32_t type, ap_pool_t *cont) - * Determine how threads are cancelable. - * arg 1) how are threads cancelable. One of: - * APR_CANCEL_ASYNCH -- cancel it no matter where it is - * APR_CANCEL_DEFER -- only cancel the thread if it is safe. - * arg 2) The context to operate on - */ -ap_status_t ap_setcanceltype(ap_int32_t type, ap_pool_t *cont) -{ - ap_status_t stat; - if ((stat = pthread_setcanceltype(type, NULL)) == 0) { - return APR_SUCCESS; - } - else { - return stat; - } -} - -/* ***APRDOC******************************************************** - * ap_status_t ap_setcancelstate(ap_int32_t type, ap_pool_t *cont) - * Determine if threads will be cancelable. - * arg 1) Are threads cancelable. - * arg 2) The context to operate on - */ -ap_status_t ap_setcancelstate(ap_int32_t type, ap_pool_t *cont) -{ - ap_status_t stat; - if ((stat = pthread_setcanceltype(type, NULL)) == 0) { - return APR_SUCCESS; - } - else { - return stat; - } -} -#endif -#endif diff --git a/threadproc/win32/threadcancel.c b/threadproc/win32/threadcancel.c deleted file mode 100644 index 3a509202b..000000000 --- a/threadproc/win32/threadcancel.c +++ /dev/null @@ -1,86 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - */ - -#include "threadproc.h" -#include "apr_thread_proc.h" -#include "apr_general.h" - - -ap_status_t ap_cancel_thread(ap_thread_t *thd) -{ - if (TerminateThread(thd->td, APR_SUCCESS) == 0) { - return APR_EEXIST; - } - else { - return APR_SUCCESS; - } -} - -/* Not sure of the best way to do this just yet. -ap_status_t ap_setcanceltype(ap_int32_t type, ap_pool_t *cont) -{ - -} - -ap_status_t ap_setcancelstate(ap_int32_t type, ap_pool_t *cont) -{ - ap_status_t stat; - if ((stat = pthread_setcanceltype(type, NULL)) == 0) { - return APR_SUCCESS; - } - else { - return stat; - } -} -*/ -- cgit v1.2.1