diff options
author | peter <peter@FreeBSD.org> | 2014-08-12 01:40:11 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2014-08-12 01:40:11 +0000 |
commit | 72d63a715ab3bb85109696154deb9b90d0495852 (patch) | |
tree | ce225c894795f3e26aadf9170baf8fd0556c18d2 /contrib/apr/include | |
parent | d307c6d3b7fc94a241aab28f56b9e92a10d98bee (diff) | |
download | FreeBSD-src-72d63a715ab3bb85109696154deb9b90d0495852.zip FreeBSD-src-72d63a715ab3bb85109696154deb9b90d0495852.tar.gz |
MFC r266728,266731,266735,266736,268135,268960,269833
Update apr 1.4.8 -> 1.5.1
Update apr-util 1.5.2 -> 1.5.3
Update serf 1.3.4 -> 1.3.7
Update svnlite 1.8.8 -> 1.8.10
Deal with svnlite.1 manpage.
Diffstat (limited to 'contrib/apr/include')
27 files changed, 1651 insertions, 188 deletions
diff --git a/contrib/apr/include/apr.h.in b/contrib/apr/include/apr.h.in index a411dd0..0ad7a91 100644 --- a/contrib/apr/include/apr.h.in +++ b/contrib/apr/include/apr.h.in @@ -116,7 +116,7 @@ * or the extern "C" namespace */ -#if APR_HAVE_WINDOWS_H +#if APR_HAVE_WINDOWS_H && defined(WIN32) /* If windows.h was already included, our preferences don't matter. * If not, include a restricted set of windows headers to our tastes. */ @@ -453,6 +453,8 @@ typedef apr_uint32_t apr_uintptr_t; */ #define APR_THREAD_FUNC @apr_thread_func@ +#if defined(DOXYGEN) || !defined(WIN32) + /** * The public APR functions are declared with APR_DECLARE(), so they may * use the most appropriate calling convention. Public APR functions with @@ -505,6 +507,20 @@ typedef apr_uint32_t apr_uintptr_t; */ #define APR_DECLARE_DATA +#elif defined(APR_DECLARE_STATIC) +#define APR_DECLARE(type) type __stdcall +#define APR_DECLARE_NONSTD(type) type __cdecl +#define APR_DECLARE_DATA +#elif defined(APR_DECLARE_EXPORT) +#define APR_DECLARE(type) __declspec(dllexport) type __stdcall +#define APR_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl +#define APR_DECLARE_DATA __declspec(dllexport) +#else +#define APR_DECLARE(type) __declspec(dllimport) type __stdcall +#define APR_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl +#define APR_DECLARE_DATA __declspec(dllimport) +#endif + /* 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", diff --git a/contrib/apr/include/apr.hwc b/contrib/apr/include/apr.hwc new file mode 100644 index 0000000..0579962 --- /dev/null +++ b/contrib/apr/include/apr.hwc @@ -0,0 +1,641 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#ifndef APR_H +#define APR_H + +/* GENERATED FILE WARNING! DO NOT EDIT apr.h + * + * You must modify apr.hwc instead. + * + * And please, make an effort to stub apr.hnw and apr.h.in in the process. + * + * This is the Win32 specific version of apr.h. It is copied from + * apr.hw by the apr.dsp and libapr.dsp projects. + */ + +/** + * @file apr.h + * @brief APR Platform Definitions + * @remark This is a generated header generated from include/apr.h.in by + * ./configure, or copied from include/apr.hw or include/apr.hnw + * for Win32 or Netware by those build environments, respectively. + */ + +/* Make sure we have our platform identifier macro defined we ask for later. + */ +#if defined(_WIN32) && !defined(WIN32) +#define WIN32 1 +#endif + +#if defined(WIN32) || defined(DOXYGEN) + +/* Ignore most warnings (back down to /W3) for poorly constructed headers + */ +#if defined(_MSC_VER) && _MSC_VER >= 1200 +#pragma warning(push, 3) +#endif + +/* disable or reduce the frequency of... + * C4057: indirection to slightly different base types + * C4075: slight indirection changes (unsigned short* vs short[]) + * C4100: unreferenced formal parameter + * C4127: conditional expression is constant + * C4163: '_rotl64' : not available as an intrinsic function + * C4201: nonstandard extension nameless struct/unions + * C4244: int to char/short - precision loss + * C4514: unreferenced inline function removed + */ +#pragma warning(disable: 4100 4127 4163 4201 4514; once: 4057 4075 4244) + +/* Ignore Microsoft's interpretation of secure development + * and the POSIX string handling API + */ +#if defined(_MSC_VER) && _MSC_VER >= 1400 +#ifndef _CRT_SECURE_NO_DEPRECATE +#define _CRT_SECURE_NO_DEPRECATE +#endif +#pragma warning(disable: 4996) +#endif + +/* Has windows.h already been included? If so, our preferences don't matter, + * but we will still need the winsock things no matter what was included. + * If not, include a restricted set of windows headers to our tastes. + */ +#ifndef _WINDOWS_ +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#ifndef _WIN32_WINNT +#define _WIN32_WINNT @win32_winnt_str@ +#endif +#ifndef NOUSER +#define NOUSER +#endif +#ifndef NOMCX +#define NOMCX +#endif +#ifndef NOIME +#define NOIME +#endif +#include <windows.h> +/* + * Add a _very_few_ declarations missing from the restricted set of headers + * (If this list becomes extensive, re-enable the required headers above!) + * winsock headers were excluded by WIN32_LEAN_AND_MEAN, so include them now + */ +#define SW_HIDE 0 +#ifndef _WIN32_WCE +#include <winsock2.h> +#include <ws2tcpip.h> +#include <mswsock.h> +#else +#include <winsock.h> +#endif +#endif /* !_WINDOWS_ */ + +/** + * @defgroup APR Apache Portability Runtime library + * @{ + */ +/** + * @defgroup apr_platform Platform Definitions + * @{ + * @warning + * <strong><em>The actual values of macros and typedefs on this page<br> + * are platform specific and should NOT be relied upon!</em></strong> + */ + +#define APR_INLINE __inline +#define APR_HAS_INLINE 1 +#if !defined(__GNUC__) && !defined(__attribute__) +#define __attribute__(__x) +#endif + +#ifndef _WIN32_WCE +#define APR_HAVE_ARPA_INET_H 0 +#define APR_HAVE_CONIO_H 1 +#define APR_HAVE_CRYPT_H 0 +#define APR_HAVE_CTYPE_H 1 +#define APR_HAVE_DIRENT_H 0 +#define APR_HAVE_ERRNO_H 1 +#define APR_HAVE_FCNTL_H 1 +#define APR_HAVE_IO_H 1 +#define APR_HAVE_LIMITS_H 1 +#define APR_HAVE_NETDB_H 0 +#define APR_HAVE_NETINET_IN_H 0 +#define APR_HAVE_NETINET_SCTP_H 0 +#define APR_HAVE_NETINET_SCTP_UIO_H 0 +#define APR_HAVE_NETINET_TCP_H 0 +#define APR_HAVE_PTHREAD_H 0 +#define APR_HAVE_SEMAPHORE_H 0 +#define APR_HAVE_SIGNAL_H 1 +#define APR_HAVE_STDARG_H 1 +#define APR_HAVE_STDINT_H 0 +#define APR_HAVE_STDIO_H 1 +#define APR_HAVE_STDLIB_H 1 +#define APR_HAVE_STRING_H 1 +#define APR_HAVE_STRINGS_H 0 +#define APR_HAVE_SYS_IOCTL_H 0 +#define APR_HAVE_SYS_SENDFILE_H 0 +#define APR_HAVE_SYS_SIGNAL_H 0 +#define APR_HAVE_SYS_SOCKET_H 0 +#define APR_HAVE_SYS_SOCKIO_H 0 +#define APR_HAVE_SYS_SYSLIMITS_H 0 +#define APR_HAVE_SYS_TIME_H 0 +#define APR_HAVE_SYS_TYPES_H 1 +#define APR_HAVE_SYS_UIO_H 0 +#define APR_HAVE_SYS_UN_H 0 +#define APR_HAVE_SYS_WAIT_H 0 +#define APR_HAVE_TIME_H 1 +#define APR_HAVE_UNISTD_H 0 +#define APR_HAVE_STDDEF_H 1 +#define APR_HAVE_PROCESS_H 1 +#else +#define APR_HAVE_ARPA_INET_H 0 +#define APR_HAVE_CONIO_H 0 +#define APR_HAVE_CRYPT_H 0 +#define APR_HAVE_CTYPE_H 0 +#define APR_HAVE_DIRENT_H 0 +#define APR_HAVE_ERRNO_H 0 +#define APR_HAVE_FCNTL_H 0 +#define APR_HAVE_IO_H 0 +#define APR_HAVE_LIMITS_H 0 +#define APR_HAVE_NETDB_H 0 +#define APR_HAVE_NETINET_IN_H 0 +#define APR_HAVE_NETINET_SCTP_H 0 +#define APR_HAVE_NETINET_SCTP_UIO_H 0 +#define APR_HAVE_NETINET_TCP_H 0 +#define APR_HAVE_PTHREAD_H 0 +#define APR_HAVE_SEMAPHORE_H 0 +#define APR_HAVE_SIGNAL_H 0 +#define APR_HAVE_STDARG_H 0 +#define APR_HAVE_STDINT_H 0 +#define APR_HAVE_STDIO_H 1 +#define APR_HAVE_STDLIB_H 1 +#define APR_HAVE_STRING_H 1 +#define APR_HAVE_STRINGS_H 0 +#define APR_HAVE_SYS_IOCTL_H 0 +#define APR_HAVE_SYS_SENDFILE_H 0 +#define APR_HAVE_SYS_SIGNAL_H 0 +#define APR_HAVE_SYS_SOCKET_H 0 +#define APR_HAVE_SYS_SOCKIO_H 0 +#define APR_HAVE_SYS_SYSLIMITS_H 0 +#define APR_HAVE_SYS_TIME_H 0 +#define APR_HAVE_SYS_TYPES_H 0 +#define APR_HAVE_SYS_UIO_H 0 +#define APR_HAVE_SYS_UN_H 0 +#define APR_HAVE_SYS_WAIT_H 0 +#define APR_HAVE_TIME_H 0 +#define APR_HAVE_UNISTD_H 0 +#define APR_HAVE_STDDEF_H 0 +#define APR_HAVE_PROCESS_H 0 +#endif + +/** @} */ +/** @} */ + +/* We don't include our conditional headers within the doxyblocks + * or the extern "C" namespace + */ + +#if APR_HAVE_STDLIB_H +#include <stdlib.h> +#endif +#if APR_HAVE_STDIO_H +#include <stdio.h> +#endif +#if APR_HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#if APR_HAVE_STDDEF_H +#include <stddef.h> +#endif +#if APR_HAVE_TIME_H +#include <time.h> +#endif +#if APR_HAVE_PROCESS_H +#include <process.h> +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @addtogroup apr_platform + * @ingroup APR + * @{ + */ + +#define APR_HAVE_SHMEM_MMAP_TMP 0 +#define APR_HAVE_SHMEM_MMAP_SHM 0 +#define APR_HAVE_SHMEM_MMAP_ZERO 0 +#define APR_HAVE_SHMEM_SHMGET_ANON 0 +#define APR_HAVE_SHMEM_SHMGET 0 +#define APR_HAVE_SHMEM_MMAP_ANON 0 +#define APR_HAVE_SHMEM_BEOS 0 + +#define APR_USE_SHMEM_MMAP_TMP 0 +#define APR_USE_SHMEM_MMAP_SHM 0 +#define APR_USE_SHMEM_MMAP_ZERO 0 +#define APR_USE_SHMEM_SHMGET_ANON 0 +#define APR_USE_SHMEM_SHMGET 0 +#define APR_USE_SHMEM_MMAP_ANON 0 +#define APR_USE_SHMEM_BEOS 0 + +#define APR_USE_FLOCK_SERIALIZE 0 +#define APR_USE_POSIXSEM_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 + +#define APR_HAS_FLOCK_SERIALIZE 0 +#define APR_HAS_SYSVSEM_SERIALIZE 0 +#define APR_HAS_POSIXSEM_SERIALIZE 0 +#define APR_HAS_FCNTL_SERIALIZE 0 +#define APR_HAS_PROC_PTHREAD_SERIALIZE 0 + +#define APR_PROCESS_LOCK_IS_GLOBAL 0 + +#define APR_HAVE_CORKABLE_TCP 0 +#define APR_HAVE_GETRLIMIT 0 +#define APR_HAVE_ICONV 0 +#define APR_HAVE_IN_ADDR 1 +#define APR_HAVE_INET_ADDR 1 +#define APR_HAVE_INET_NETWORK 0 +#define APR_HAVE_IPV6 @apr_have_ipv6_10@ +#define APR_HAVE_MEMMOVE 1 +#define APR_HAVE_SETRLIMIT 0 +#define APR_HAVE_SIGACTION 0 +#define APR_HAVE_SIGSUSPEND 0 +#define APR_HAVE_SIGWAIT 0 +#define APR_HAVE_SA_STORAGE 0 +#define APR_HAVE_STRCASECMP 0 +#define APR_HAVE_STRDUP 1 +#define APR_HAVE_STRNCASECMP 0 +#define APR_HAVE_STRSTR 1 +#define APR_HAVE_MEMCHR 1 +#define APR_HAVE_STRUCT_RLIMIT 0 +#define APR_HAVE_UNION_SEMUN 0 +#define APR_HAVE_SCTP 0 +#define APR_HAVE_IOVEC 0 + +#ifndef _WIN32_WCE +#define APR_HAVE_STRICMP 1 +#define APR_HAVE_STRNICMP 1 +#else +#define APR_HAVE_STRICMP 0 +#define APR_HAVE_STRNICMP 0 +#endif + +/* APR Feature Macros */ +#define APR_HAS_SHARED_MEMORY 1 +#define APR_HAS_THREADS 1 +#define APR_HAS_MMAP 1 +#define APR_HAS_FORK 0 +#define APR_HAS_RANDOM 1 +#define APR_HAS_OTHER_CHILD 1 +#define APR_HAS_DSO 1 +#define APR_HAS_SO_ACCEPTFILTER 0 +#define APR_HAS_UNICODE_FS 1 +#define APR_HAS_PROC_INVOKED 1 +#define APR_HAS_OS_UUID 1 + +#ifndef _WIN32_WCE +#define APR_HAS_SENDFILE 1 +#define APR_HAS_USER 1 +#define APR_HAS_LARGE_FILES 1 +#define APR_HAS_XTHREAD_FILES 1 +#define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 1 +#else +#define APR_HAS_SENDFILE 0 +#define APR_HAS_USER 0 +#define APR_HAS_LARGE_FILES 0 +#define APR_HAS_XTHREAD_FILES 0 +#define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 0 +#endif + +/* APR sets APR_FILES_AS_SOCKETS to 1 on systems where it is possible + * to poll on files/pipes. + */ +#define APR_FILES_AS_SOCKETS 0 + +/* This macro indicates whether or not EBCDIC is the native character set. + */ +#define APR_CHARSET_EBCDIC 0 + +/* If we have a TCP implementation that can be "corked", what flag + * do we use? + */ +#define APR_TCP_NOPUSH_FLAG @apr_tcp_nopush_flag@ + +/* Is the TCP_NODELAY socket option inherited from listening sockets? + */ +#define APR_TCP_NODELAY_INHERITED 1 + +/* Is the O_NONBLOCK flag inherited from listening sockets? + */ +#define APR_O_NONBLOCK_INHERITED 1 + +/* Typedefs that APR needs. */ + +typedef unsigned char apr_byte_t; + +typedef short apr_int16_t; +typedef unsigned short apr_uint16_t; + +typedef int apr_int32_t; +typedef unsigned int apr_uint32_t; + +typedef __int64 apr_int64_t; +typedef unsigned __int64 apr_uint64_t; + +typedef size_t apr_size_t; +#if APR_HAVE_STDDEF_H +typedef ptrdiff_t apr_ssize_t; +#else +typedef int apr_ssize_t; +#endif +#if APR_HAS_LARGE_FILES +typedef __int64 apr_off_t; +#else +typedef int apr_off_t; +#endif +typedef int apr_socklen_t; +typedef apr_uint64_t apr_ino_t; + +#ifdef _WIN64 +#define APR_SIZEOF_VOIDP 8 +#else +#define APR_SIZEOF_VOIDP 4 +#endif + +#if APR_SIZEOF_VOIDP == 8 +typedef apr_uint64_t apr_uintptr_t; +#else +typedef apr_uint32_t apr_uintptr_t; +#endif + +/* Are we big endian? */ +/* XXX: Fatal assumption on Alpha platforms */ +#define APR_IS_BIGENDIAN 0 + +/* Mechanisms to properly type numeric literals */ + +#ifndef __GNUC__ +#define APR_INT64_C(val) (val##i64) +#define APR_UINT64_C(val) (val##Ui64) +#else +#define APR_INT64_C(val) (val##LL) +#define APR_UINT64_C(val) (val##ULL) +#endif + +#ifdef INT16_MIN +#define APR_INT16_MIN INT16_MIN +#else +#define APR_INT16_MIN (-0x7fff - 1) +#endif + +#ifdef INT16_MAX +#define APR_INT16_MAX INT16_MAX +#else +#define APR_INT16_MAX (0x7fff) +#endif + +#ifdef UINT16_MAX +#define APR_UINT16_MAX UINT16_MAX +#else +#define APR_UINT16_MAX (0xffff) +#endif + +#ifdef INT32_MIN +#define APR_INT32_MIN INT32_MIN +#else +#define APR_INT32_MIN (-0x7fffffff - 1) +#endif + +#ifdef INT32_MAX +#define APR_INT32_MAX INT32_MAX +#else +#define APR_INT32_MAX 0x7fffffff +#endif + +#ifdef UINT32_MAX +#define APR_UINT32_MAX UINT32_MAX +#else +#define APR_UINT32_MAX (0xffffffffU) +#endif + +#ifdef INT64_MIN +#define APR_INT64_MIN INT64_MIN +#else +#define APR_INT64_MIN (APR_INT64_C(-0x7fffffffffffffff) - 1) +#endif + +#ifdef INT64_MAX +#define APR_INT64_MAX INT64_MAX +#else +#define APR_INT64_MAX APR_INT64_C(0x7fffffffffffffff) +#endif + +#ifdef UINT64_MAX +#define APR_UINT64_MAX UINT64_MAX +#else +#define APR_UINT64_MAX APR_UINT64_C(0xffffffffffffffff) +#endif + +#define APR_SIZE_MAX (~((apr_size_t)0)) + +/* Definitions that APR programs need to work properly. */ + +/** + * APR public API wrap for C++ compilers. + */ +#ifdef __cplusplus +#define APR_BEGIN_DECLS extern "C" { +#define APR_END_DECLS } +#else +#define APR_BEGIN_DECLS +#define APR_END_DECLS +#endif + +/** + * Thread callbacks from APR functions must be declared with APR_THREAD_FUNC, + * so that they follow the platform's calling convention. + * <PRE> + * + * void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data); + * + * </PRE> + */ +#define APR_THREAD_FUNC __stdcall + + +#if defined(DOXYGEN) || !defined(WIN32) + +/** + * The public APR functions are declared with APR_DECLARE(), so they may + * use the most appropriate calling convention. Public APR functions with + * variable arguments must use APR_DECLARE_NONSTD(). + * + * @remark Both the declaration and implementations must use the same macro. + * + * <PRE> + * APR_DECLARE(rettype) apr_func(args) + * </PRE> + * @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA + * @remark Note that when APR compiles the library itself, it passes the + * symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32) + * to export public symbols from the dynamic library build.\n + * The user must define the APR_DECLARE_STATIC when compiling to target + * the static APR library on some platforms (e.g. Win32.) The public symbols + * are neither exported nor imported when APR_DECLARE_STATIC is defined.\n + * By default, compiling an application and including the APR public + * headers, without defining APR_DECLARE_STATIC, will prepare the code to be + * linked to the dynamic library. + */ +#define APR_DECLARE(type) type + +/** + * The public APR functions using variable arguments are declared with + * APR_DECLARE_NONSTD(), as they must follow the C language calling convention. + * @see APR_DECLARE @see APR_DECLARE_DATA + * @remark Both the declaration and implementations must use the same macro. + * <PRE> + * + * APR_DECLARE_NONSTD(rettype) apr_func(args, ...); + * + * </PRE> + */ +#define APR_DECLARE_NONSTD(type) type + +/** + * The public APR variables are declared with AP_MODULE_DECLARE_DATA. + * This assures the appropriate indirection is invoked at compile time. + * @see APR_DECLARE @see APR_DECLARE_NONSTD + * @remark Note that the declaration and implementations use different forms, + * but both must include the macro. + * + * <PRE> + * + * extern APR_DECLARE_DATA type apr_variable;\n + * APR_DECLARE_DATA type apr_variable = value; + * + * </PRE> + */ +#define APR_DECLARE_DATA + +#elif defined(APR_DECLARE_STATIC) +#define APR_DECLARE(type) type __stdcall +#define APR_DECLARE_NONSTD(type) type __cdecl +#define APR_DECLARE_DATA +#elif defined(APR_DECLARE_EXPORT) +#define APR_DECLARE(type) __declspec(dllexport) type __stdcall +#define APR_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl +#define APR_DECLARE_DATA __declspec(dllexport) +#else +#define APR_DECLARE(type) __declspec(dllimport) type __stdcall +#define APR_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl +#define APR_DECLARE_DATA __declspec(dllimport) +#endif + +#ifdef _WIN64 +#define APR_SSIZE_T_FMT "I64d" +#define APR_SIZE_T_FMT "I64u" +#else +#define APR_SSIZE_T_FMT "d" +#define APR_SIZE_T_FMT "u" +#endif + +#if APR_HAS_LARGE_FILES +#define APR_OFF_T_FMT "I64d" +#else +#define APR_OFF_T_FMT "d" +#endif + +#define APR_PID_T_FMT "d" + +#define APR_INT64_T_FMT "I64d" +#define APR_UINT64_T_FMT "I64u" +#define APR_UINT64_T_HEX_FMT "I64x" + +/* No difference between PROC and GLOBAL mutex */ +#define APR_PROC_MUTEX_IS_GLOBAL 1 + +/* Local machine definition for console and log output. */ +#define APR_EOL_STR "\r\n" + +typedef int apr_wait_t; + +#if APR_HAS_UNICODE_FS +/* An arbitrary size that is digestable. True max is a bit less than 32000 */ +#define APR_PATH_MAX 8192 +#else /* !APR_HAS_UNICODE_FS */ +#define APR_PATH_MAX MAX_PATH +#endif + +#define APR_DSOPATH "PATH" + +/** @} */ + +/* Definitions that only Win32 programs need to compile properly. */ + +/* XXX These simply don't belong here, perhaps in apr_portable.h + * based on some APR_HAVE_PID/GID/UID? + */ +#ifndef __GNUC__ +typedef int pid_t; +#endif +typedef int uid_t; +typedef int gid_t; + +/* Win32 .h ommissions we really need */ +#define STDIN_FILENO 0 +#define STDOUT_FILENO 1 +#define STDERR_FILENO 2 + +#if APR_HAVE_IPV6 + +/* Appears in later flavors, not the originals. */ +#ifndef in_addr6 +#define in6_addr in_addr6 +#endif + +#ifndef WS2TCPIP_INLINE +#define IN6_IS_ADDR_V4MAPPED(a) \ + ( (*(const apr_uint64_t *)(const void *)(&(a)->s6_addr[0]) == 0) \ + && (*(const apr_uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) +#endif + +#endif /* APR_HAS_IPV6 */ + +#ifdef __cplusplus +} +#endif + +/* Done with badly written headers + */ +#if defined(_MSC_VER) && _MSC_VER >= 1200 +#pragma warning(pop) +#pragma warning(disable: 4996) +#endif + +#endif /* WIN32 */ + +#endif /* APR_H */ diff --git a/contrib/apr/include/apr_allocator.h b/contrib/apr/include/apr_allocator.h index 5d66776..70d31ef 100644 --- a/contrib/apr/include/apr_allocator.h +++ b/contrib/apr/include/apr_allocator.h @@ -131,7 +131,7 @@ APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator) /** * Set the current threshold at which the allocator should start * giving blocks back to the system. - * @param allocator The allocator the set the threshold on + * @param allocator The allocator to set the threshold on * @param size The threshold. 0 == unlimited. */ APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator, diff --git a/contrib/apr/include/apr_errno.h b/contrib/apr/include/apr_errno.h index d4d44cb..58eaf73 100644 --- a/contrib/apr/include/apr_errno.h +++ b/contrib/apr/include/apr_errno.h @@ -45,7 +45,7 @@ typedef int apr_status_t; /** * Return a human readable string describing the specified error. - * @param statcode The error code the get a string for. + * @param statcode The error code to get a string for. * @param buf A buffer to hold the error string. * @param bufsize Size of the buffer to hold the string. */ @@ -126,7 +126,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, * use within apr-util. This space is reserved above that used by APR * internally. * @note This number MUST be smaller than APR_OS_ERRSPACE_SIZE by a - * large enough amount that APR has sufficient room for it's + * large enough amount that APR has sufficient room for its * codes. */ #define APR_UTIL_ERRSPACE_SIZE 20000 @@ -135,7 +135,7 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, */ #define APR_OS_START_STATUS (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE) /** - * APR_UTIL_START_STATUS is where APR-Util starts defining it's + * APR_UTIL_START_STATUS is where APR-Util starts defining its * status codes. */ #define APR_UTIL_START_STATUS (APR_OS_START_STATUS + \ diff --git a/contrib/apr/include/apr_escape.h b/contrib/apr/include/apr_escape.h new file mode 100644 index 0000000..5b60ac6 --- /dev/null +++ b/contrib/apr/include/apr_escape.h @@ -0,0 +1,374 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file apr_escape.h + * @brief APR-UTIL Escaping + */ +#ifndef APR_ESCAPE_H +#define APR_ESCAPE_H +#include "apr.h" +#include "apr_general.h" +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup APR_Util_Escaping Escape functions + * @ingroup APR + * @{ + */ + +/* Simple escape/unescape functions. + * + */ + +/** + * When passing a string to one of the escape functions, this value can be + * passed to indicate a string-valued key, and have the length computed + * automatically. + */ +#define APR_ESCAPE_STRING (-1) + +/** + * Perform shell escaping on the provided string. + * + * Shell escaping causes characters to be prefixed with a '\' character. + * @param escaped Optional buffer to write the encoded string, can be + * NULL + * @param str The original string + * @param slen The length of the original string, or APR_ESCAPE_STRING + * @param len If present, returns the length of the string + * @return APR_SUCCESS, or APR_NOTFOUND if no changes to the string were + * detected or the string was NULL + */ +APR_DECLARE(apr_status_t) apr_escape_shell(char *escaped, const char *str, + apr_ssize_t slen, apr_size_t *len); + +/** + * Perform shell escaping on the provided string, returning the result + * from the pool. + * + * Shell escaping causes characters to be prefixed with a '\' character. + * + * If no characters were escaped, the original string is returned. + * @param p Pool to allocate from + * @param str The original string + * @return the encoded string, allocated from the pool, or the original + * string if no escaping took place or the string was NULL. + */ +APR_DECLARE(const char *) apr_pescape_shell(apr_pool_t *p, const char *str) + __attribute__((nonnull(1))); + +/** + * Unescapes a URL, leaving reserved characters intact. + * @param escaped Optional buffer to write the encoded string, can be + * NULL + * @param url String to be unescaped + * @param slen The length of the original url, or APR_ESCAPE_STRING + * @param forbid Optional list of forbidden characters, in addition to + * 0x00 + * @param reserved Optional list of reserved characters that will be + * left unescaped + * @param plus If non zero, '+' is converted to ' ' as per + * application/x-www-form-urlencoded encoding + * @param len If set, the length of the escaped string will be returned + * @return APR_SUCCESS on success, APR_NOTFOUND if no characters are + * decoded or the string is NULL, APR_EINVAL if a bad escape sequence is + * found, APR_BADCH if a character on the forbid list is found. + */ +APR_DECLARE(apr_status_t) apr_unescape_url(char *escaped, const char *url, + apr_ssize_t slen, const char *forbid, const char *reserved, int plus, + apr_size_t *len); + +/** + * Unescapes a URL, leaving reserved characters intact, returning the + * result from a pool. + * @param p Pool to allocate from + * @param url String to be unescaped in place + * @param forbid Optional list of forbidden characters, in addition to + * 0x00 + * @param reserved Optional list of reserved characters that will be + * left unescaped + * @param plus If non zero, '+' is converted to ' ' as per + * application/x-www-form-urlencoded encoding + * @return A string allocated from the pool on success, the original string + * if no characters are decoded, or NULL if a bad escape sequence is found + * or if a character on the forbid list is found, or if the original string + * was NULL. + */ +APR_DECLARE(const char *) apr_punescape_url(apr_pool_t *p, const char *url, + const char *forbid, const char *reserved, int plus) + __attribute__((nonnull(1))); + +/** + * Escape a path segment, as defined in RFC1808. + * @param escaped Optional buffer to write the encoded string, can be + * NULL + * @param str The original string + * @param slen The length of the original string, or APR_ESCAPE_STRING + * @param len If present, returns the length of the string + * @return APR_SUCCESS, or APR_NOTFOUND if no changes to the string were + * detected or the string was NULL + */ +APR_DECLARE(apr_status_t) apr_escape_path_segment(char *escaped, + const char *str, apr_ssize_t slen, apr_size_t *len); + +/** + * Escape a path segment, as defined in RFC1808, returning the result from a + * pool. + * @param p Pool to allocate from + * @param str String to be escaped + * @return A string allocated from the pool on success, the original string + * if no characters are encoded or the string is NULL. + */ +APR_DECLARE(const char *) apr_pescape_path_segment(apr_pool_t *p, + const char *str) __attribute__((nonnull(1))); + +/** + * Converts an OS path to a URL, in an OS dependent way, as defined in RFC1808. + * In all cases if a ':' occurs before the first '/' in the URL, the URL should + * be prefixed with "./" (or the ':' escaped). In the case of Unix, this means + * leaving '/' alone, but otherwise doing what escape_path_segment() does. For + * efficiency reasons, we don't use escape_path_segment(), which is provided for + * reference. Again, RFC 1808 is where this stuff is defined. + * + * If partial is set, os_escape_path() assumes that the path will be appended to + * something with a '/' in it (and thus does not prefix "./"). + * @param escaped Optional buffer to write the encoded string, can be + * NULL + * @param path The original string + * @param slen The length of the original string, or APR_ESCAPE_STRING + * @param partial If non zero, suppresses the prepending of "./" + * @param len If present, returns the length of the string + * @return APR_SUCCESS, or APR_NOTFOUND if no changes to the string were + * detected or if the string was NULL + */ +APR_DECLARE(apr_status_t) apr_escape_path(char *escaped, const char *path, + apr_ssize_t slen, int partial, apr_size_t *len); + +/** + * Converts an OS path to a URL, in an OS dependent way, as defined in RFC1808, + * returning the result from a pool. + * + * In all cases if a ':' occurs before the first '/' in the URL, the URL should + * be prefixed with "./" (or the ':' escaped). In the case of Unix, this means + * leaving '/' alone, but otherwise doing what escape_path_segment() does. For + * efficiency reasons, we don't use escape_path_segment(), which is provided for + * reference. Again, RFC 1808 is where this stuff is defined. + * + * If partial is set, os_escape_path() assumes that the path will be appended to + * something with a '/' in it (and thus does not prefix "./"). + * @param p Pool to allocate from + * @param str The original string + * @param partial If non zero, suppresses the prepending of "./" + * @return A string allocated from the pool on success, the original string + * if no characters are encoded or if the string was NULL. + */ +APR_DECLARE(const char *) apr_pescape_path(apr_pool_t *p, const char *str, + int partial) __attribute__((nonnull(1))); + +/** + * Urlencode a string, as defined in + * http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1. + * @param escaped Optional buffer to write the encoded string, can be + * NULL + * @param str The original string + * @param slen The length of the original string, or APR_ESCAPE_STRING + * @param len If present, returns the length of the string + * @return APR_SUCCESS, or APR_NOTFOUND if no changes to the string were + * detected or if the stirng was NULL + */ +APR_DECLARE(apr_status_t) apr_escape_urlencoded(char *escaped, const char *str, + apr_ssize_t slen, apr_size_t *len); + +/** + * Urlencode a string, as defined in + * http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1, returning + * the result from a pool. + * @param p Pool to allocate from + * @param str String to be escaped + * @return A string allocated from the pool on success, the original string + * if no characters are encoded or if the string was NULL. + */ +APR_DECLARE(const char *) apr_pescape_urlencoded(apr_pool_t *p, + const char *str) __attribute__((nonnull(1))); + +/** + * Apply entity encoding to a string. Characters are replaced as follows: + * '<' becomes '<', '>' becomes '>', '&' becomes '&', the + * double quote becomes '"" and the single quote becomes '''. + * + * If toasc is not zero, any non ascii character will be encoded as + * '%\#ddd;', where ddd is the decimal code of the character. + * @param escaped Optional buffer to write the encoded string, can be + * NULL + * @param str The original string + * @param slen The length of the original string, or APR_ESCAPE_STRING + * @param toasc If non zero, encode non ascii characters + * @param len If present, returns the length of the string + * @return APR_SUCCESS, or APR_NOTFOUND if no changes to the string were + * detected or the string was NULL + */ +APR_DECLARE(apr_status_t) apr_escape_entity(char *escaped, const char *str, + apr_ssize_t slen, int toasc, apr_size_t *len); + +/** + * Apply entity encoding to a string, returning the result from a pool. + * Characters are replaced as follows: '<' becomes '<', '>' becomes + * '>', '&' becomes '&', the double quote becomes '"" and the + * single quote becomes '''. + * @param p Pool to allocate from + * @param str The original string + * @param toasc If non zero, encode non ascii characters + * @return A string allocated from the pool on success, the original string + * if no characters are encoded or the string is NULL. + */ +APR_DECLARE(const char *) apr_pescape_entity(apr_pool_t *p, const char *str, + int toasc) __attribute__((nonnull(1))); + +/** + * Decodes html entities or numeric character references in a string. If + * the string to be unescaped is syntactically incorrect, then the + * following fixups will be made: + * unknown entities will be left undecoded; + * references to unused numeric characters will be deleted. + * In particular, � will not be decoded, but will be deleted. + * @param unescaped Optional buffer to write the encoded string, can be + * NULL + * @param str The original string + * @param slen The length of the original string, or APR_ESCAPE_STRING + * @param len If present, returns the length of the string + * @return APR_SUCCESS, or APR_NOTFOUND if no changes to the string were + * detected or the string was NULL + */ +APR_DECLARE(apr_status_t) apr_unescape_entity(char *unescaped, const char *str, + apr_ssize_t slen, apr_size_t *len); + +/** + * Decodes html entities or numeric character references in a string. If + * the string to be unescaped is syntactically incorrect, then the + * following fixups will be made: + * unknown entities will be left undecoded; + * references to unused numeric characters will be deleted. + * In particular, � will not be decoded, but will be deleted. + * @param p Pool to allocate from + * @param str The original string + * @return A string allocated from the pool on success, the original string + * if no characters are encoded or the string is NULL. + */ +APR_DECLARE(const char *) apr_punescape_entity(apr_pool_t *p, const char *str) + __attribute__((nonnull(1))); + +/** + * Escape control characters in a string, as performed by the shell's + * 'echo' command. Characters are replaced as follows: + * \\a alert (bell), \\b backspace, \\f form feed, \\n new line, \\r carriage + * return, \\t horizontal tab, \\v vertical tab, \\ backslash. + * + * Any non ascii character will be encoded as '\\xHH', where HH is the hex + * code of the character. + * + * If quote is not zero, the double quote character will also be escaped. + * @param escaped Optional buffer to write the encoded string, can be + * NULL + * @param str The original string + * @param slen The length of the original string, or APR_ESCAPE_STRING + * @param quote If non zero, encode double quotes + * @param len If present, returns the length of the string + * @return APR_SUCCESS, or APR_NOTFOUND if no changes to the string were + * detected or the string was NULL + */ +APR_DECLARE(apr_status_t) apr_escape_echo(char *escaped, const char *str, + apr_ssize_t slen, int quote, apr_size_t *len); + +/** + * Escape control characters in a string, as performed by the shell's + * 'echo' command, and return the results from a pool. Characters are + * replaced as follows: \\a alert (bell), \\b backspace, \\f form feed, + * \\n new line, \\r carriage return, \\t horizontal tab, \\v vertical tab, + * \\ backslash. + * + * Any non ascii character will be encoded as '\\xHH', where HH is the hex + * code of the character. + * + * If quote is not zero, the double quote character will also be escaped. + * @param p Pool to allocate from + * @param str The original string + * @param quote If non zero, encode double quotes + * @return A string allocated from the pool on success, the original string + * if no characters are encoded or the string is NULL. + */ +APR_DECLARE(const char *) apr_pescape_echo(apr_pool_t *p, const char *str, + int quote); + +/** + * Convert binary data to a hex encoding. + * @param dest The destination buffer, can be NULL + * @param src The original buffer + * @param srclen The length of the original buffer + * @param colon If not zero, insert colon characters between hex digits. + * @param len If present, returns the length of the string + * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL + */ +APR_DECLARE(apr_status_t) apr_escape_hex(char *dest, const void *src, + apr_size_t srclen, int colon, apr_size_t *len); + +/** + * Convert binary data to a hex encoding, and return the results from a + * pool. + * @param p Pool to allocate from + * @param src The original buffer + * @param slen The length of the original buffer + * @param colon If not zero, insert colon characters between hex digits. + * @return A zero padded buffer allocated from the pool on success, or + * NULL if src was NULL. + */ +APR_DECLARE(const char *) apr_pescape_hex(apr_pool_t *p, const void *src, + apr_size_t slen, int colon) __attribute__((nonnull(1))); + +/** + * Convert hex encoded string to binary data. + * @param dest The destination buffer, can be NULL + * @param str The original buffer + * @param slen The length of the original buffer + * @param colon If not zero, ignore colon characters between hex digits. + * @param len If present, returns the length of the string + * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL, or APR_BADCH + * if a non hex character is present. + */ +APR_DECLARE(apr_status_t) apr_unescape_hex(void *dest, const char *str, + apr_ssize_t slen, int colon, apr_size_t *len); + +/** + * Convert hex encoding to binary data, and return the results from a pool. + * If the colon character appears between pairs of hex digits, it will be + * ignored. + * @param p Pool to allocate from + * @param str The original string + * @param colon If not zero, ignore colon characters between hex digits. + * @param len If present, returns the length of the final buffer + * @return A buffer allocated from the pool on success, or NULL if src was + * NULL, or a bad character was present. + */ +APR_DECLARE(const void *) apr_punescape_hex(apr_pool_t *p, const char *str, + int colon, apr_size_t *len); + +/** @} */ +#ifdef __cplusplus +} +#endif + +#endif /* !APR_ESCAPE_H */ diff --git a/contrib/apr/include/apr_file_info.h b/contrib/apr/include/apr_file_info.h index 94e84e8..1d19eb6 100644 --- a/contrib/apr/include/apr_file_info.h +++ b/contrib/apr/include/apr_file_info.h @@ -208,7 +208,7 @@ struct apr_finfo_t { const char *fname; /** The file's name (no path) in filesystem case */ const char *name; - /** The file's handle, if accessed (can be submitted to apr_duphandle) */ + /** Unused */ struct apr_file_t *filehand; }; @@ -316,7 +316,7 @@ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir); * @param filepath the pathname to parse for its root component * @param flags the desired rules to apply, from * <PRE> - * APR_FILEPATH_NATIVE Use native path seperators (e.g. '\' on Win32) + * APR_FILEPATH_NATIVE Use native path separators (e.g. '\' on Win32) * APR_FILEPATH_TRUENAME Tests that the root exists, and makes it proper * </PRE> * @param p the pool to allocate the new path string from @@ -328,7 +328,7 @@ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir); * test for the validity of that root (e.g., that a drive d:/ or network * share //machine/foovol/). * The function returns APR_ERELATIVE if filepath isn't rooted (an - * error), APR_EINCOMPLETE if the root path is ambigious (but potentially + * error), APR_EINCOMPLETE if the root path is ambiguous (but potentially * legitimate, e.g. "/" on Windows is incomplete because it doesn't specify * the drive letter), or APR_EBADPATH if the root is simply invalid. * APR_SUCCESS is returned if filepath is an absolute path. @@ -362,7 +362,7 @@ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, * @param pathelts the returned components of the search path * @param liststr the search path (e.g., <tt>getenv("PATH")</tt>) * @param p the pool to allocate the array and path components from - * @remark empty path componenta do not become part of @a pathelts. + * @remark empty path components do not become part of @a pathelts. * @remark the path separator in @a liststr is system specific; * e.g., ':' on Unix, ';' on Windows, etc. */ diff --git a/contrib/apr/include/apr_file_io.h b/contrib/apr/include/apr_file_io.h index ca99751..eb683af 100644 --- a/contrib/apr/include/apr_file_io.h +++ b/contrib/apr/include/apr_file_io.h @@ -57,8 +57,10 @@ extern "C" { #define APR_FOPEN_APPEND 0x00008 /**< Append to the end of the file */ #define APR_FOPEN_TRUNCATE 0x00010 /**< Open the file and truncate to 0 length */ -#define APR_FOPEN_BINARY 0x00020 /**< Open the file in binary mode */ -#define APR_FOPEN_EXCL 0x00040 /**< Open should fail if APR_CREATE +#define APR_FOPEN_BINARY 0x00020 /**< Open the file in binary mode + (This flag is ignored on UNIX + because it has no meaning)*/ +#define APR_FOPEN_EXCL 0x00040 /**< Open should fail if #APR_FOPEN_CREATE and file exists. */ #define APR_FOPEN_BUFFERED 0x00080 /**< Open the file for buffered I/O */ #define APR_FOPEN_DELONCLOSE 0x00100 /**< Delete the file after close */ @@ -70,7 +72,10 @@ extern "C" { access to support writes across process/machines */ #define APR_FOPEN_NOCLEANUP 0x00800 /**< Do not register a cleanup - when the file is opened */ + when the file is opened. The + apr_os_file_t handle in apr_file_t + will not be closed when the pool + is destroyed. */ #define APR_FOPEN_SENDFILE_ENABLED 0x01000 /**< Advisory flag that this file should support apr_socket_sendfile operation */ @@ -80,6 +85,9 @@ extern "C" { #define APR_FOPEN_SPARSE 0x08000 /**< Platform dependent flag to enable * sparse file support, see WARNING below */ +#define APR_FOPEN_NONBLOCK 0x40000 /**< Platform dependent flag to enable + * non blocking file io */ + /* backcompat */ #define APR_READ APR_FOPEN_READ /**< @deprecated @see APR_FOPEN_READ */ @@ -97,17 +105,19 @@ extern "C" { #define APR_SENDFILE_ENABLED APR_FOPEN_SENDFILE_ENABLED /**< @deprecated @see APR_FOPEN_SENDFILE_ENABLED */ #define APR_LARGEFILE APR_FOPEN_LARGEFILE /**< @deprecated @see APR_FOPEN_LARGEFILE */ -/** @warning APR_FOPEN_LARGEFILE flag only has effect on some +/** @def APR_FOPEN_LARGEFILE + * @warning APR_FOPEN_LARGEFILE flag only has effect on some * platforms where sizeof(apr_off_t) == 4. Where implemented, it * allows opening and writing to a file which exceeds the size which * can be represented by apr_off_t (2 gigabytes). When a file's size * does exceed 2Gb, apr_file_info_get() will fail with an error on the * descriptor, likewise apr_stat()/apr_lstat() will fail on the - * filename. apr_dir_read() will fail with APR_INCOMPLETE on a + * filename. apr_dir_read() will fail with #APR_INCOMPLETE on a * directory entry for a large file depending on the particular * APR_FINFO_* flags. Generally, it is not recommended to use this * flag. * + * @def APR_FOPEN_SPARSE * @warning APR_FOPEN_SPARSE may, depending on platform, convert a * normal file to a sparse file. Some applications may be unable * to decipher a sparse file, so it's critical that the sparse file @@ -117,6 +127,10 @@ extern "C" { * if it was previously created and written without the sparse flag. * On platforms which do not understand, or on file systems which * cannot handle sparse files, the flag is ignored by apr_file_open(). + * + * @def APR_FOPEN_NONBLOCK + * @warning APR_FOPEN_NONBLOCK is not implemented on all platforms. + * Callers should be prepared for it to fail with #APR_ENOTIMPL. */ /** @} */ @@ -200,33 +214,34 @@ typedef struct apr_file_t apr_file_t; * @param newf The opened file descriptor. * @param fname The full path to the file (using / on all systems) * @param flag Or'ed value of: - * <PRE> - * 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. - * APR_XTHREAD Platform dependent tag to open the file + * @li #APR_FOPEN_READ open for reading + * @li #APR_FOPEN_WRITE open for writing + * @li #APR_FOPEN_CREATE create the file if not there + * @li #APR_FOPEN_APPEND file ptr is set to end prior to all writes + * @li #APR_FOPEN_TRUNCATE set length to zero if file exists + * @li #APR_FOPEN_BINARY not a text file + * @li #APR_FOPEN_BUFFERED buffer the data. Default is non-buffered + * @li #APR_FOPEN_EXCL return error if #APR_FOPEN_CREATE and file exists + * @li #APR_FOPEN_DELONCLOSE delete the file after closing + * @li #APR_FOPEN_XTHREAD Platform dependent tag to open the file * for use across multiple threads - * APR_SHARELOCK Platform dependent support for higher + * @li #APR_FOPEN_SHARELOCK Platform dependent support for higher * level locked read/write access to support * writes across process/machines - * APR_FILE_NOCLEANUP Do not register a cleanup with the pool - * passed in on the <EM>pool</EM> argument (see below). - * The apr_os_file_t handle in apr_file_t will not - * be closed when the pool is destroyed. - * APR_SENDFILE_ENABLED Open with appropriate platform semantics + * @li #APR_FOPEN_NOCLEANUP Do not register a cleanup with the pool + * passed in on the @a pool argument (see below) + * @li #APR_FOPEN_SENDFILE_ENABLED Open with appropriate platform semantics * for sendfile operations. Advisory only, - * apr_socket_sendfile does not check this flag. - * </PRE> + * apr_socket_sendfile does not check this flag + * @li #APR_FOPEN_LARGEFILE Platform dependent flag to enable large file + * support, see WARNING below + * @li #APR_FOPEN_SPARSE Platform dependent flag to enable sparse file + * support, see WARNING below + * @li #APR_FOPEN_NONBLOCK Platform dependent flag to enable + * non blocking file io * @param perm Access permissions for file. * @param pool The pool to use. - * @remark If perm is APR_OS_DEFAULT and the file is being created, + * @remark If perm is #APR_FPROT_OS_DEFAULT and the file is being created, * appropriate default permissions will be used. * @remark By default, the returned file descriptor will not be * inherited by child processes created by apr_proc_create(). This @@ -279,7 +294,7 @@ APR_DECLARE(apr_status_t) apr_file_link(const char *from_path, * @param to_path The full path to the new file (using / on all systems) * @param perms Access permissions for the new file if it is created. * In place of the usual or'd combination of file permissions, the - * value APR_FILE_SOURCE_PERMS may be given, in which case the source + * value #APR_FPROT_FILE_SOURCE_PERMS may be given, in which case the source * file's permissions are copied. * @param pool The pool to use. * @remark The new file does not need to exist, it will be created if required. @@ -296,7 +311,7 @@ APR_DECLARE(apr_status_t) apr_file_copy(const char *from_path, * @param to_path The full path to the destination file (use / on all systems) * @param perms Access permissions for the destination file if it is created. * In place of the usual or'd combination of file permissions, the - * value APR_FILE_SOURCE_PERMS may be given, in which case the source + * value #APR_FPROT_FILE_SOURCE_PERMS may be given, in which case the source * file's permissions are copied. * @param pool The pool to use. * @remark The new file does not need to exist, it will be created if required. @@ -309,7 +324,7 @@ APR_DECLARE(apr_status_t) apr_file_append(const char *from_path, /** * Are we at the end of the file * @param fptr The apr file we are testing. - * @remark Returns APR_EOF if we are at the end of file, APR_SUCCESS otherwise. + * @remark Returns #APR_EOF if we are at the end of file, #APR_SUCCESS otherwise. */ APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr); @@ -336,7 +351,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, * @param thefile The apr file to use as stdout. * @param pool The pool to allocate the file out of. * - * @remark See remarks for apr_file_open_stderr. + * @remark See remarks for apr_file_open_stderr(). */ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *pool); @@ -346,7 +361,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, * @param thefile The apr file to use as stdin. * @param pool The pool to allocate the file out of. * - * @remark See remarks for apr_file_open_stderr. + * @remark See remarks for apr_file_open_stderr(). */ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *pool); @@ -354,13 +369,19 @@ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, /** * open standard error as an apr file pointer, with flags. * @param thefile The apr file to use as stderr. - * @param flags The flags to open the file with. Only the APR_EXCL, - * APR_BUFFERED, APR_XTHREAD, APR_SHARELOCK, - * APR_SENDFILE_ENABLED and APR_LARGEFILE flags should - * be used. The APR_WRITE flag will be set unconditionally. + * @param flags The flags to open the file with. Only the + * @li #APR_FOPEN_EXCL + * @li #APR_FOPEN_BUFFERED + * @li #APR_FOPEN_XTHREAD + * @li #APR_FOPEN_SHARELOCK + * @li #APR_FOPEN_SENDFILE_ENABLED + * @li #APR_FOPEN_LARGEFILE + * + * flags should be used. The #APR_FOPEN_WRITE flag will + * be set unconditionally. * @param pool The pool to allocate the file out of. * - * @remark See remarks for apr_file_open_stderr. + * @remark See remarks for apr_file_open_stderr(). */ APR_DECLARE(apr_status_t) apr_file_open_flags_stderr(apr_file_t **thefile, apr_int32_t flags, @@ -369,13 +390,19 @@ APR_DECLARE(apr_status_t) apr_file_open_flags_stderr(apr_file_t **thefile, /** * open standard output as an apr file pointer, with flags. * @param thefile The apr file to use as stdout. - * @param flags The flags to open the file with. Only the APR_EXCL, - * APR_BUFFERED, APR_XTHREAD, APR_SHARELOCK, - * APR_SENDFILE_ENABLED and APR_LARGEFILE flags should - * be used. The APR_WRITE flag will be set unconditionally. + * @param flags The flags to open the file with. Only the + * @li #APR_FOPEN_EXCL + * @li #APR_FOPEN_BUFFERED + * @li #APR_FOPEN_XTHREAD + * @li #APR_FOPEN_SHARELOCK + * @li #APR_FOPEN_SENDFILE_ENABLED + * @li #APR_FOPEN_LARGEFILE + * + * flags should be used. The #APR_FOPEN_WRITE flag will + * be set unconditionally. * @param pool The pool to allocate the file out of. * - * @remark See remarks for apr_file_open_stderr. + * @remark See remarks for apr_file_open_stderr(). */ APR_DECLARE(apr_status_t) apr_file_open_flags_stdout(apr_file_t **thefile, apr_int32_t flags, @@ -384,13 +411,19 @@ APR_DECLARE(apr_status_t) apr_file_open_flags_stdout(apr_file_t **thefile, /** * open standard input as an apr file pointer, with flags. * @param thefile The apr file to use as stdin. - * @param flags The flags to open the file with. Only the APR_EXCL, - * APR_BUFFERED, APR_XTHREAD, APR_SHARELOCK, - * APR_SENDFILE_ENABLED and APR_LARGEFILE flags should - * be used. The APR_READ flag will be set unconditionally. + * @param flags The flags to open the file with. Only the + * @li #APR_FOPEN_EXCL + * @li #APR_FOPEN_BUFFERED + * @li #APR_FOPEN_XTHREAD + * @li #APR_FOPEN_SHARELOCK + * @li #APR_FOPEN_SENDFILE_ENABLED + * @li #APR_FOPEN_LARGEFILE + * + * flags should be used. The #APR_FOPEN_WRITE flag will + * be set unconditionally. * @param pool The pool to allocate the file out of. * - * @remark See remarks for apr_file_open_stderr. + * @remark See remarks for apr_file_open_stderr(). */ APR_DECLARE(apr_status_t) apr_file_open_flags_stdin(apr_file_t **thefile, apr_int32_t flags, @@ -403,15 +436,15 @@ APR_DECLARE(apr_status_t) apr_file_open_flags_stdin(apr_file_t **thefile, * @param nbytes On entry, the number of bytes to read; on exit, the number * of bytes read. * - * @remark apr_file_read will read up to the specified number of + * @remark apr_file_read() will read up to the specified number of * bytes, but never more. If there isn't enough data to fill that * number of bytes, all of the available data is read. The third * argument is modified to reflect the number of bytes read. If a * char was put back into the stream via ungetc, it will be the first * character returned. * - * @remark It is not possible for both bytes to be read and an APR_EOF - * or other error to be returned. APR_EINTR is never returned. + * @remark It is not possible for both bytes to be read and an #APR_EOF + * or other error to be returned. #APR_EINTR is never returned. */ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes); @@ -423,13 +456,13 @@ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, * @param nbytes On entry, the number of bytes to write; on exit, the number * of bytes written. * - * @remark apr_file_write will write up to the specified number of + * @remark apr_file_write() will write up to the specified number of * bytes, but never more. If the OS cannot write that many bytes, it * will write as many as it can. The third argument is modified to * reflect the * number of bytes written. * * @remark It is possible for both bytes to be written and an error to - * be returned. APR_EINTR is never returned. + * be returned. #APR_EINTR is never returned. */ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes); @@ -439,14 +472,14 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, * @param thefile The file descriptor to write to. * @param vec The array from which to get the data to write to the file. * @param nvec The number of elements in the struct iovec array. This must - * be smaller than APR_MAX_IOVEC_SIZE. If it isn't, the function - * will fail with APR_EINVAL. + * be smaller than #APR_MAX_IOVEC_SIZE. If it isn't, the function + * will fail with #APR_EINVAL. * @param nbytes The number of bytes written. * * @remark It is possible for both bytes to be written and an error to - * be returned. APR_EINTR is never returned. + * be returned. #APR_EINTR is never returned. * - * @remark apr_file_writev is available even if the underlying + * @remark apr_file_writev() is available even if the underlying * operating system doesn't provide writev(). */ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, @@ -461,7 +494,7 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, * @param nbytes The number of bytes to read. * @param bytes_read If non-NULL, this will contain the number of bytes read. * - * @remark apr_file_read will read up to the specified number of + * @remark apr_file_read_full() will read up to the specified number of * bytes, but never more. If there isn't enough data to fill that * number of bytes, then the process/thread will block until it is * available or EOF is reached. If a char was put back into the @@ -471,7 +504,7 @@ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, * returned. And if *bytes_read is less than nbytes, an accompanying * error is _always_ returned. * - * @remark APR_EINTR is never returned. + * @remark #APR_EINTR is never returned. */ APR_DECLARE(apr_status_t) apr_file_read_full(apr_file_t *thefile, void *buf, apr_size_t nbytes, @@ -485,7 +518,7 @@ APR_DECLARE(apr_status_t) apr_file_read_full(apr_file_t *thefile, void *buf, * @param nbytes The number of bytes to write. * @param bytes_written If non-NULL, set to the number of bytes written. * - * @remark apr_file_write will write up to the specified number of + * @remark apr_file_write_full() will write up to the specified number of * bytes, but never more. If the OS cannot write that many bytes, the * process/thread will block until they can be written. Exceptional * error such as "out of space" or "pipe closed" will terminate with @@ -495,7 +528,7 @@ APR_DECLARE(apr_status_t) apr_file_read_full(apr_file_t *thefile, void *buf, * be returned. And if *bytes_written is less than nbytes, an * accompanying error is _always_ returned. * - * @remark APR_EINTR is never returned. + * @remark #APR_EINTR is never returned. */ APR_DECLARE(apr_status_t) apr_file_write_full(apr_file_t *thefile, const void *buf, @@ -509,11 +542,11 @@ APR_DECLARE(apr_status_t) apr_file_write_full(apr_file_t *thefile, * @param thefile The file descriptor to write to. * @param vec The array from which to get the data to write to the file. * @param nvec The number of elements in the struct iovec array. This must - * be smaller than APR_MAX_IOVEC_SIZE. If it isn't, the function - * will fail with APR_EINVAL. + * be smaller than #APR_MAX_IOVEC_SIZE. If it isn't, the function + * will fail with #APR_EINVAL. * @param nbytes The number of bytes written. * - * @remark apr_file_writev_full is available even if the underlying + * @remark apr_file_writev_full() is available even if the underlying * operating system doesn't provide writev(). */ APR_DECLARE(apr_status_t) apr_file_writev_full(apr_file_t *thefile, @@ -621,7 +654,7 @@ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, * @param buffer The buffer * @param bufsize The size of the buffer * @remark It is possible to add a buffer to previously unbuffered - * file handles, the APR_BUFFERED flag will be added to + * file handles, the #APR_FOPEN_BUFFERED flag will be added to * the file handle's flags. Likewise, with buffer=NULL and * bufsize=0 arguments it is possible to make a previously * buffered file handle unbuffered. @@ -640,11 +673,9 @@ APR_DECLARE(apr_size_t) apr_file_buffer_size_get(apr_file_t *thefile); * Move the read/write file offset to a specified byte within a file. * @param thefile The file descriptor * @param where How to move the pointer, one of: - * <PRE> - * 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 - * </PRE> + * @li #APR_SET -- set the offset to offset + * @li #APR_CUR -- add the offset to the current position + * @li #APR_END -- add the offset to the current file size * @param offset The offset to move the pointer to. * @remark The third argument is modified to be the offset the pointer was actually moved to. @@ -664,7 +695,7 @@ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, * @bug Some platforms cannot toggle between blocking and nonblocking, * and when passing a pipe as a standard handle to an application which * does not expect it, a non-blocking stream will fluxor the client app. - * @deprecated @see apr_file_pipe_create_ex + * @deprecated @see apr_file_pipe_create_ex() */ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, @@ -675,20 +706,18 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, * @param in The newly created pipe's file for reading. * @param out The newly created pipe's file for writing. * @param blocking one of these values defined in apr_thread_proc.h; + * @li #APR_FULL_BLOCK + * @li #APR_READ_BLOCK + * @li #APR_WRITE_BLOCK + * @li #APR_FULL_NONBLOCK * @param pool The pool to operate on. - * <pre> - * APR_FULL_BLOCK - * APR_READ_BLOCK - * APR_WRITE_BLOCK - * APR_FULL_NONBLOCK - * </pre> * @remark By default, the returned file descriptors will be inherited * by child processes created using apr_proc_create(). This can be * changed using apr_file_inherit_unset(). * @remark Some platforms cannot toggle between blocking and nonblocking, * and when passing a pipe as a standard handle to an application which * does not expect it, a non-blocking stream will fluxor the client app. - * Use this function rather than apr_file_pipe_create to create pipes + * Use this function rather than apr_file_pipe_create() to create pipes * where one or both ends require non-blocking semantics. */ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, @@ -789,11 +818,11 @@ APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, * @param perms The permission bits to apply to the file. * * @warning Some platforms may not be able to apply all of the - * available permission bits; APR_INCOMPLETE will be returned if some + * available permission bits; #APR_INCOMPLETE will be returned if some * permissions are specified which could not be set. * * @warning Platforms which do not implement this feature will return - * APR_ENOTIMPL. + * #APR_ENOTIMPL. */ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, apr_fileperms_t perms); @@ -802,11 +831,9 @@ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, * Set attributes of the specified file. * @param fname The full path to the file (using / on all systems) * @param attributes Or'd combination of - * <PRE> - * APR_FILE_ATTR_READONLY - make the file readonly - * APR_FILE_ATTR_EXECUTABLE - make the file executable - * APR_FILE_ATTR_HIDDEN - make the file hidden - * </PRE> + * @li #APR_FILE_ATTR_READONLY - make the file readonly + * @li #APR_FILE_ATTR_EXECUTABLE - make the file executable + * @li #APR_FILE_ATTR_HIDDEN - make the file hidden * @param attr_mask Mask of valid bits in attributes. * @param pool the pool to use. * @remark This function should be used in preference to explicit manipulation @@ -814,7 +841,7 @@ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, * attributes are platform specific and may involve more than simply * setting permission bits. * @warning Platforms which do not implement this feature will return - * APR_ENOTIMPL. + * #APR_ENOTIMPL. */ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, apr_fileattrs_t attributes, @@ -827,7 +854,7 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, * @param mtime The mtime to apply to the file. * @param pool The pool to use. * @warning Platforms which do not implement this feature will return - * APR_ENOTIMPL. + * #APR_ENOTIMPL. */ APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, apr_time_t mtime, @@ -865,7 +892,7 @@ APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *pool); /** * get the specified file's stats. * @param finfo Where to store the information about the file. - * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values + * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_* values * @param thefile The file to get information about. */ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, @@ -910,7 +937,8 @@ APR_DECLARE_INHERIT_UNSET(file); * @param templ The template to use when creating a temp file. * @param flags The flags to open the file with. If this is zero, * the file is opened with - * APR_CREATE | APR_READ | APR_WRITE | APR_EXCL | APR_DELONCLOSE + * #APR_FOPEN_CREATE | #APR_FOPEN_READ | #APR_FOPEN_WRITE | + * #APR_FOPEN_EXCL | #APR_FOPEN_DELONCLOSE * @param p The pool to allocate the file out of. * @remark * This function generates a unique temporary file name from template. diff --git a/contrib/apr/include/apr_fnmatch.h b/contrib/apr/include/apr_fnmatch.h index ef6d0b2..e8f6b03 100644 --- a/contrib/apr/include/apr_fnmatch.h +++ b/contrib/apr/include/apr_fnmatch.h @@ -60,9 +60,7 @@ extern "C" { #define APR_FNM_NOESCAPE 0x01 /**< Disable backslash escaping. */ #define APR_FNM_PATHNAME 0x02 /**< Slash must be matched by slash. */ #define APR_FNM_PERIOD 0x04 /**< Period must be matched by period. */ -#define APR_FNM_CASE_BLIND 0x08 /**< Compare characters case-insensitively. - * @remark This flag is an Apache addition - */ +#define APR_FNM_CASE_BLIND 0x08 /**< Compare characters case-insensitively. */ /** * Try to match the string to the given pattern, return APR_SUCCESS if @@ -130,13 +128,19 @@ APR_DECLARE(apr_status_t) apr_fnmatch(const char *pattern, APR_DECLARE(int) apr_fnmatch_test(const char *pattern); /** - * Find all files that match a specified pattern. - * @param pattern The pattern to use for finding files. + * Find all files that match a specified pattern in a directory. + * @param dir_pattern The pattern to use for finding files, appended + * to the search directory. The pattern is anything following the + * final forward or backward slash in the parameter. If no slash + * is found, the current directory is searched. * @param result Array to use when storing the results * @param p The pool to use. - * @return non-zero if pattern has any glob characters in it + * @return APR_SUCCESS if no processing errors occurred, APR error + * code otherwise + * @remark The returned array may be empty even if APR_SUCCESS was + * returned. */ -APR_DECLARE(apr_status_t) apr_match_glob(const char *pattern, +APR_DECLARE(apr_status_t) apr_match_glob(const char *dir_pattern, apr_array_header_t **result, apr_pool_t *p); diff --git a/contrib/apr/include/apr_hash.h b/contrib/apr/include/apr_hash.h index 8e48c7e..37d972f 100644 --- a/contrib/apr/include/apr_hash.h +++ b/contrib/apr/include/apr_hash.h @@ -167,6 +167,27 @@ APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, const void **key, apr_ssize_t *klen, void **val); /** + * Get the current entry's key from the iteration state. + * @param hi The iteration state + * @return The pointer to the key + */ +APR_DECLARE(const void*) apr_hash_this_key(apr_hash_index_t *hi); + +/** + * Get the current entry's key length from the iteration state. + * @param hi The iteration state + * @return The key length + */ +APR_DECLARE(apr_ssize_t) apr_hash_this_key_len(apr_hash_index_t *hi); + +/** + * Get the current entry's value from the iteration state. + * @param hi The iteration state + * @return The pointer to the value + */ +APR_DECLARE(void*) apr_hash_this_val(apr_hash_index_t *hi); + +/** * Get the number of key/value pairs in the hash table. * @param ht The hash table * @return The number of key/value pairs in the hash table. diff --git a/contrib/apr/include/apr_inherit.h b/contrib/apr/include/apr_inherit.h index b7f7480..b9fe56f 100644 --- a/contrib/apr/include/apr_inherit.h +++ b/contrib/apr/include/apr_inherit.h @@ -28,7 +28,7 @@ * Prototype for type-specific declarations of apr_foo_inherit_set * functions. * @remark Doxygen unwraps this macro (via doxygen.conf) to provide - * actual help for each specific occurance of apr_foo_inherit_set. + * actual help for each specific occurrence of apr_foo_inherit_set. * @remark the linkage is specified for APR. It would be possible to expand * the macros to support other linkages. */ @@ -40,7 +40,7 @@ * Prototype for type-specific declarations of apr_foo_inherit_unset * functions. * @remark Doxygen unwraps this macro (via doxygen.conf) to provide - * actual help for each specific occurance of apr_foo_inherit_unset. + * actual help for each specific occurrence of apr_foo_inherit_unset. * @remark the linkage is specified for APR. It would be possible to expand * the macros to support other linkages. */ diff --git a/contrib/apr/include/apr_lib.h b/contrib/apr/include/apr_lib.h index 8c0fea7..466e818 100644 --- a/contrib/apr/include/apr_lib.h +++ b/contrib/apr/include/apr_lib.h @@ -111,19 +111,19 @@ APR_DECLARE(const char *) apr_filepath_name_get(const char *pathname); * <PRE> * The extensions are: * - * %%pA takes a struct in_addr *, and prints it as a.b.c.d - * %%pI takes an apr_sockaddr_t * and prints it as a.b.c.d:port or - * [ipv6-address]:port - * %%pT takes an apr_os_thread_t * and prints it in decimal - * ('0' is printed if !APR_HAS_THREADS) - * %%pt takes an apr_os_thread_t * and prints it in hexadecimal - * ('0' is printed if !APR_HAS_THREADS) - * %%pm takes an apr_status_t * and prints the appropriate error - * string (from apr_strerror) corresponding to that error code. - * %%pp takes a void * and outputs it in hex - * %%pB takes a apr_uint32_t * as bytes and outputs it's apr_strfsize - * %%pF same as above, but takes a apr_off_t * - * %%pS same as above, but takes a apr_size_t * + * - %%pA takes a struct in_addr *, and prints it as a.b.c.d + * - %%pI takes an apr_sockaddr_t * and prints it as a.b.c.d:port or + * \[ipv6-address\]:port + * - %%pT takes an apr_os_thread_t * and prints it in decimal + * ('0' is printed if !APR_HAS_THREADS) + * - %%pt takes an apr_os_thread_t * and prints it in hexadecimal + * ('0' is printed if !APR_HAS_THREADS) + * - %%pm takes an apr_status_t * and prints the appropriate error + * string (from apr_strerror) corresponding to that error code. + * - %%pp takes a void * and outputs it in hex + * - %%pB takes a apr_uint32_t * as bytes and outputs it's apr_strfsize + * - %%pF same as above, but takes a apr_off_t * + * - %%pS same as above, but takes a apr_size_t * * * %%pA, %%pI, %%pT, %%pp are available from APR 1.0.0 onwards (and in 0.9.x). * %%pt is only available from APR 1.2.0 onwards. diff --git a/contrib/apr/include/apr_mmap.h b/contrib/apr/include/apr_mmap.h index 77d697f..c14de19 100644 --- a/contrib/apr/include/apr_mmap.h +++ b/contrib/apr/include/apr_mmap.h @@ -120,7 +120,7 @@ struct apr_mmap_t { /** * Create a new mmap'ed file out of an existing APR file. * @param newmmap The newly created mmap'ed file. - * @param file The file turn into an mmap. + * @param file The file to turn into an mmap. * @param offset The offset into the file to start the data pointer at. * @param size The size of the file * @param flag bit-wise or of: diff --git a/contrib/apr/include/apr_network_io.h b/contrib/apr/include/apr_network_io.h index 8b9209e..0d34a84 100644 --- a/contrib/apr/include/apr_network_io.h +++ b/contrib/apr/include/apr_network_io.h @@ -99,6 +99,8 @@ extern "C" { * until data is available. * @see apr_socket_accept_filter */ +#define APR_SO_BROADCAST 65536 /**< Allow broadcast + */ /** @} */ @@ -278,6 +280,9 @@ struct apr_hdtr_t { * @param type The type of the socket (e.g., SOCK_STREAM). * @param protocol The protocol of the socket (e.g., APR_PROTO_TCP). * @param cont The pool for the apr_socket_t and associated storage. + * @note The pool will be used by various functions that operate on the + * socket. The caller must ensure that it is not used by other threads + * at the same time. */ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new_sock, int family, int type, @@ -333,6 +338,9 @@ APR_DECLARE(apr_status_t) apr_socket_listen(apr_socket_t *sock, * be used for all future communication. * @param sock The socket we are listening on. * @param connection_pool The pool for the new socket. + * @note The pool will be used by various functions that operate on the + * socket. The caller must ensure that it is not used by other threads + * at the same time. */ APR_DECLARE(apr_status_t) apr_socket_accept(apr_socket_t **new_sock, apr_socket_t *sock, @@ -397,6 +405,8 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, * @param hostname The hostname. * @param sa The apr_sockaddr_t. * @param flags Special processing flags. + * @remark Results can vary significantly between platforms + * when processing wildcard socket addresses. */ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, apr_sockaddr_t *sa, @@ -489,7 +499,7 @@ APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf, apr_size_t *len); /** - * Send multiple packets of data over a network. + * Send multiple buffers over a network. * @param sock The socket to send the data over. * @param vec The array of iovec structs containing the data to send * @param nvec The number of iovec structs in the array @@ -499,7 +509,7 @@ APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf, * This functions acts like a blocking write by default. To change * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK * socket option. - * The number of bytes actually sent is stored in argument 3. + * The number of bytes actually sent is stored in argument 4. * * It is possible for both bytes to be sent and an error to be returned. * @@ -671,7 +681,7 @@ APR_DECLARE(apr_status_t) apr_socket_atmark(apr_socket_t *sock, /** * Return an address associated with a socket; either the address to - * which the socket is bound locally or the the address of the peer + * which the socket is bound locally or the address of the peer * to which the socket is connected. * @param sa The returned apr_sockaddr_t. * @param which Whether to retrieve the local or remote address @@ -713,6 +723,16 @@ APR_DECLARE(int) apr_sockaddr_equal(const apr_sockaddr_t *addr1, const apr_sockaddr_t *addr2); /** + * See if the IP address in an APR socket address refers to the wildcard + * address for the protocol family (e.g., INADDR_ANY for IPv4). + * + * @param addr The APR socket address to examine. + * @remark The return value will be non-zero if the address is + * initialized and is the wildcard address. + */ +APR_DECLARE(int) apr_sockaddr_is_wildcard(const apr_sockaddr_t *addr); + +/** * Return the type of the socket. * @param sock The socket to query. * @param type The returned type (e.g., SOCK_STREAM). diff --git a/contrib/apr/include/apr_poll.h b/contrib/apr/include/apr_poll.h index 3e8d092..1381ddd 100644 --- a/contrib/apr/include/apr_poll.h +++ b/contrib/apr/include/apr_poll.h @@ -42,7 +42,9 @@ extern "C" { */ /** - * Poll options + * @defgroup pollopts Poll options + * @ingroup apr_poll + * @{ */ #define APR_POLLIN 0x001 /**< Can read without blocking */ #define APR_POLLPRI 0x002 /**< Priority data available */ @@ -50,9 +52,12 @@ extern "C" { #define APR_POLLERR 0x010 /**< Pending error */ #define APR_POLLHUP 0x020 /**< Hangup occurred */ #define APR_POLLNVAL 0x040 /**< Descriptor invalid */ +/** @} */ /** - * Pollset Flags + * @defgroup pollflags Pollset Flags + * @ingroup apr_poll + * @{ */ #define APR_POLLSET_THREADSAFE 0x001 /**< Adding or removing a descriptor is * thread-safe @@ -67,6 +72,7 @@ extern "C" { * the specified non-default method cannot be * used */ +/** @} */ /** * Pollset Methods @@ -77,7 +83,8 @@ typedef enum { APR_POLLSET_KQUEUE, /**< Poll uses kqueue method */ APR_POLLSET_PORT, /**< Poll uses Solaris event port method */ APR_POLLSET_EPOLL, /**< Poll uses epoll method */ - APR_POLLSET_POLL /**< Poll uses poll method */ + APR_POLLSET_POLL, /**< Poll uses poll method */ + APR_POLLSET_AIO_MSGQ /**< Poll uses z/OS asio method */ } apr_pollset_method_e; /** Used in apr_pollfd_t to determine what the apr_descriptor is */ @@ -131,7 +138,7 @@ typedef struct apr_pollset_t apr_pollset_t; * @remark If flags contains APR_POLLSET_WAKEABLE, then a pollset is * created with an additional internal pipe object used for the * apr_pollset_wakeup() call. The actual size of pollset is - * in that case size + 1. This feature is only supported on some + * in that case @a size + 1. This feature is only supported on some * platforms; the apr_pollset_create() call will fail with * APR_ENOTIMPL on platforms where it is not supported. * @remark If flags contains APR_POLLSET_NOCOPY, then the apr_pollfd_t @@ -226,6 +233,7 @@ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, * Remove a descriptor from a pollset * @param pollset The pollset from which to remove the descriptor * @param descriptor The descriptor to remove + * @remark If the descriptor is not found, APR_NOTFOUND is returned. * @remark If the pollset has been created with APR_POLLSET_THREADSAFE * and thread T1 is blocked in a call to apr_pollset_poll() for * this same pollset that is being modified via apr_pollset_remove() @@ -259,8 +267,6 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, * @remark Multiple signalled conditions for the same descriptor may be reported * in one or more returned apr_pollfd_t structures, depending on the * implementation. - * @bug With versions 1.4.2 and prior on Windows, a call with no descriptors - * and timeout will return immediately with the wrong error code. */ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, apr_interval_time_t timeout, @@ -290,8 +296,6 @@ APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset); * descriptor has been signalled or the timeout has expired. * @remark The rtnevents field in the apr_pollfd_t array will only be filled- * in if the return value is APR_SUCCESS. - * @bug With versions 1.4.2 and prior on Windows, a call with no descriptors - * and timeout will return immediately with the wrong error code. */ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t numsock, apr_int32_t *nsds, @@ -309,7 +313,7 @@ APR_DECLARE(const char *) apr_pollset_method_name(apr_pollset_t *pollset); */ APR_DECLARE(const char *) apr_poll_method_defname(void); -/** Opaque structure used for pollset API */ +/** Opaque structure used for pollcb API */ typedef struct apr_pollcb_t apr_pollcb_t; /** @@ -397,8 +401,6 @@ typedef apr_status_t (*apr_pollcb_cb_t)(void *baton, apr_pollfd_t *descriptor); * @remark Multiple signalled conditions for the same descriptor may be reported * in one or more calls to the callback function, depending on the * implementation. - * @bug With versions 1.4.2 and prior on Windows, a call with no descriptors - * and timeout will return immediately with the wrong error code. */ APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, apr_interval_time_t timeout, diff --git a/contrib/apr/include/apr_pools.h b/contrib/apr/include/apr_pools.h index 0f0b95e..783c9c4 100644 --- a/contrib/apr/include/apr_pools.h +++ b/contrib/apr/include/apr_pools.h @@ -71,10 +71,10 @@ typedef struct apr_pool_t apr_pool_t; * <pre> * APR_POOL_DECLARE_ACCESSOR(file); * becomes: - * APR_DECLARE(apr_pool_t *) apr_file_pool_get(apr_file_t *ob); + * APR_DECLARE(apr_pool_t *) apr_file_pool_get(const apr_file_t *thefile); * </pre> * @remark Doxygen unwraps this macro (via doxygen.conf) to provide - * actual help for each specific occurance of apr_foo_pool_get. + * actual help for each specific occurrence of apr_foo_pool_get. * @remark the linkage is specified for APR. It would be possible to expand * the macros to support other linkages. */ @@ -118,15 +118,15 @@ typedef struct apr_pool_t apr_pool_t; * * | | | | | x | | | | Pool owner checking. On each use of a * pool, check if the current thread is the - * pools owner. If not, abort(). In + * pool's owner. If not, abort(). In * combination with the verbose flag above, * it will output OWNER in such an event * prior to aborting. Use the debug * function apr_pool_owner_set() to switch - * a pools ownership. + * a pool's ownership. * * When no debug level was specified, assume general debug mode. - * If level 0 was specified, debugging is switched off + * If level 0 was specified, debugging is switched off. * </pre> */ #if defined(APR_POOL_DEBUG) @@ -212,12 +212,16 @@ APR_DECLARE(apr_status_t) apr_pool_create_core_ex(apr_pool_t **newpool, * @param newpool The pool we have just created. * @param abort_fn A function to use if the pool cannot allocate more memory. * @param allocator The allocator to use with the new pool. If NULL a - * new allocator will be crated with newpool as owner. + * new allocator will be created with the new pool as owner. * @remark An unmanaged pool is a special pool without a parent; it will * NOT be destroyed upon apr_terminate. It must be explicitly * destroyed by calling apr_pool_destroy, to prevent memory leaks. * Use of this function is discouraged, think twice about whether * you really really need it. + * @warning Any child cleanups registered against the new pool, or + * against sub-pools thereof, will not be executed during an + * invocation of apr_proc_create(), so resources created in an + * "unmanaged" pool hierarchy will leak to child processes. */ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, apr_abortfunc_t abort_fn, @@ -233,7 +237,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. * @remark Only available when APR_POOL_DEBUG is defined. - * Call this directly if you have you apr_pool_create_ex + * Call this directly if you have your apr_pool_create_ex * calls in a wrapper function and wish to override * the file_line argument to reflect the caller of * your wrapper function. If you do not have @@ -270,7 +274,7 @@ APR_DECLARE(apr_status_t) apr_pool_create_core_ex_debug(apr_pool_t **newpool, * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. * @remark Only available when APR_POOL_DEBUG is defined. - * Call this directly if you have you apr_pool_create_unmanaged_ex + * Call this directly if you have your apr_pool_create_unmanaged_ex * calls in a wrapper function and wish to override * the file_line argument to reflect the caller of * your wrapper function. If you do not have @@ -321,7 +325,7 @@ APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, #endif /** - * Create a new pool. + * Create a new unmanaged pool. * @param newpool The pool we have just created. */ #if defined(DOXYGEN) @@ -366,7 +370,7 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *p) __attribute__((nonnull(1))); * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. * @remark Only available when APR_POOL_DEBUG is defined. - * Call this directly if you have you apr_pool_clear + * Call this directly if you have your apr_pool_clear * calls in a wrapper function and wish to override * the file_line argument to reflect the caller of * your wrapper function. If you do not have @@ -396,7 +400,7 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p) __attribute__((nonnull(1))); * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. * @remark Only available when APR_POOL_DEBUG is defined. - * Call this directly if you have you apr_pool_destroy + * Call this directly if you have your apr_pool_destroy * calls in a wrapper function and wish to override * the file_line argument to reflect the caller of * your wrapper function. If you do not have @@ -614,7 +618,7 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, /** * Register a function to be called when a pool is cleared or destroyed - * @param p The pool register the cleanup with + * @param p The pool to register the cleanup with * @param data The data to pass to the cleanup function. * @param plain_cleanup The function to call when the pool is cleared * or destroyed @@ -630,11 +634,11 @@ APR_DECLARE(void) apr_pool_cleanup_register( /** * Register a function to be called when a pool is cleared or destroyed. * - * Unlike apr_pool_cleanup_register which register a cleanup - * that is called AFTER all subpools are destroyed this function register - * a function that will be called before any of the subpool is destoryed. + * Unlike apr_pool_cleanup_register which registers a cleanup + * that is called AFTER all subpools are destroyed, this function registers + * a function that will be called before any of the subpools are destroyed. * - * @param p The pool register the cleanup with + * @param p The pool to register the cleanup with * @param data The data to pass to the cleanup function. * @param plain_cleanup The function to call when the pool is cleared * or destroyed diff --git a/contrib/apr/include/apr_shm.h b/contrib/apr/include/apr_shm.h index 2b1d50f..49543bb 100644 --- a/contrib/apr/include/apr_shm.h +++ b/contrib/apr/include/apr_shm.h @@ -43,7 +43,8 @@ extern "C" { typedef struct apr_shm_t apr_shm_t; /** - * Create and make accessable a shared memory segment. + * Create and make accessible a shared memory segment with default + * properties. * @param m The shared memory structure to create. * @param reqsize The desired size of the segment. * @param filename The file to use for shared memory on platforms that @@ -71,6 +72,52 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, apr_pool_t *pool); /** + * Special processing flags for apr_shm_create_ex() and apr_shm_attach_ex(). + */ +#define APR_SHM_NS_LOCAL 1 /* Create or attach to named shared memory + * segment in the "Local" namespace on + * Windows. (Ignored on other platforms.) + * By default, the "Global" namespace is + * used for privileged processes and the + * "Local" namespace is used otherwise. + */ +#define APR_SHM_NS_GLOBAL 2 /* Create or attach to named shared memory + * segment in the "Global" namespace on + * Windows. (Ignored on other platforms.) + */ + +/** + * Create and make accessible a shared memory segment with platform- + * specific processing. + * @param m The shared memory structure to create. + * @param reqsize The desired size of the segment. + * @param filename The file to use for shared memory on platforms that + * require it. + * @param pool the pool from which to allocate the shared memory + * structure. + * @param flags mask of APR_SHM_* (defined above) + * @remark A note about Anonymous vs. Named shared memory segments: + * Not all plaforms support anonymous shared memory segments, but in + * some cases it is prefered over other types of shared memory + * implementations. Passing a NULL 'file' parameter to this function + * will cause the subsystem to use anonymous shared memory segments. + * If such a system is not available, APR_ENOTIMPL is returned. + * @remark A note about allocation sizes: + * On some platforms it is necessary to store some metainformation + * about the segment within the actual segment. In order to supply + * the caller with the requested size it may be necessary for the + * implementation to request a slightly greater segment length + * from the subsystem. In all cases, the apr_shm_baseaddr_get() + * function will return the first usable byte of memory. + * + */ +APR_DECLARE(apr_status_t) apr_shm_create_ex(apr_shm_t **m, + apr_size_t reqsize, + const char *filename, + apr_pool_t *pool, + apr_int32_t flags); + +/** * Remove named resource associated with a shared memory segment, * preventing attachments to the resource, but not destroying it. * @param filename The filename associated with shared-memory segment which @@ -80,7 +127,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, * name-based shared memory segments, and will return APR_ENOTIMPL on * platforms without such support. Removing the file while the shm * is in use is not entirely portable, caller may use this to enhance - * obscurity of the resource, but be prepared for the the call to fail, + * obscurity of the resource, but be prepared for the call to fail, * and for concurrent attempts to create a resource of the same name * to also fail. The pool cleanup of apr_shm_create (apr_shm_destroy) * also removes the named resource. @@ -108,6 +155,21 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, apr_pool_t *pool); /** + * Attach to a shared memory segment that was created + * by another process, with platform-specific processing. + * @param m The shared memory structure to create. + * @param filename The file used to create the original segment. + * (This MUST match the original filename.) + * @param pool the pool from which to allocate the shared memory + * structure for this process. + * @param flags mask of APR_SHM_* (defined above) + */ +APR_DECLARE(apr_status_t) apr_shm_attach_ex(apr_shm_t **m, + const char *filename, + apr_pool_t *pool, + apr_int32_t flags); + +/** * Detach from a shared memory segment without destroying it. * @param m The shared memory structure representing the segment * to detach from. diff --git a/contrib/apr/include/apr_skiplist.h b/contrib/apr/include/apr_skiplist.h new file mode 100644 index 0000000..bc17efd --- /dev/null +++ b/contrib/apr/include/apr_skiplist.h @@ -0,0 +1,259 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APR_SKIPLIST_H +#define APR_SKIPLIST_H +/** + * @file apr_skiplist.h + * @brief APR skip list implementation + */ + +#include "apr.h" +#include "apr_portable.h" +#include <stdlib.h> + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @defgroup apr_skiplist Skip list implementation + * Refer to http://en.wikipedia.org/wiki/Skip_list for information + * about the purpose of and ideas behind skip lists. + * @ingroup APR + * @{ + */ + +/** + * apr_skiplist_compare is the function type that must be implemented + * per object type that is used in a skip list for comparisons to maintain + * order + * */ +typedef int (*apr_skiplist_compare) (void *, void *); + +/** + * apr_skiplist_freefunc is the function type that must be implemented + * to handle elements as they are removed from a skip list. + */ +typedef void (*apr_skiplist_freefunc) (void *); + +/** Opaque structure used to represent the skip list */ +struct apr_skiplist; +/** Opaque structure used to represent the skip list */ +typedef struct apr_skiplist apr_skiplist; + +/** + * Opaque structure used to represent abstract nodes in the skip list + * (an abstraction above the raw elements which are collected in the + * skip list). + */ +struct apr_skiplistnode; +/** Opaque structure */ +typedef struct apr_skiplistnode apr_skiplistnode; + +/** + * Allocate memory using the same mechanism as the skip list. + * @param sl The skip list + * @param size The amount to allocate + * @remark If a pool was provided to apr_skiplist_init(), memory will + * be allocated from the pool or from a free list maintained with + * the skip list. Otherwise, memory will be allocated using the + * C standard library heap functions. + */ +APR_DECLARE(void *) apr_skiplist_alloc(apr_skiplist *sl, size_t size); + +/** + * Free memory using the same mechanism as the skip list. + * @param sl The skip list + * @param mem The object to free + * @remark If a pool was provided to apr_skiplist_init(), memory will + * be added to a free list maintained with the skip list and be available + * to operations on the skip list or to other calls to apr_skiplist_alloc(). + * Otherwise, memory will be freed using the C standard library heap + * functions. + */ +APR_DECLARE(void) apr_skiplist_free(apr_skiplist *sl, void *mem); + +/** + * Allocate a new skip list + * @param sl The pointer in which to return the newly created skip list + * @param p The pool from which to allocate the skip list (optional). + * @remark Unlike most APR functions, a pool is optional. If no pool + * is provided, the C standard library heap functions will be used instead. + */ +APR_DECLARE(apr_status_t) apr_skiplist_init(apr_skiplist **sl, apr_pool_t *p); + +/** + * Set the comparison functions to be used for searching the skip list. + * @param sl The skip list + * @param XXX1 FIXME + * @param XXX2 FIXME + * + * @remark If existing comparison functions are being replaced, the index + * will be replaced during this call. That is a potentially expensive + * operation. + */ +APR_DECLARE(void) apr_skiplist_set_compare(apr_skiplist *sl, apr_skiplist_compare XXX1, + apr_skiplist_compare XXX2); + +/** + * Set the indexing functions to the specified comparison functions and + * rebuild the index. + * @param sl The skip list + * @param XXX1 FIXME + * @param XXX2 FIXME + * + * @remark If an index already exists, it will not be replaced and the + * comparison functions will not be changed. + */ +APR_DECLARE(void) apr_skiplist_add_index(apr_skiplist *sl, apr_skiplist_compare XXX1, + apr_skiplist_compare XXX2); + +/** + * Return the list maintained by the skip list abstraction. + * @param sl The skip list + */ +APR_DECLARE(apr_skiplistnode *) apr_skiplist_getlist(apr_skiplist *sl); + +/** + * Return the next matching element in the skip list using the specified + * comparison function. + * @param sl The skip list + * @param data The value to search for + * @param iter A pointer to the returned skip list node representing the element + * found + * @param func The comparison function to use + */ +APR_DECLARE(void *) apr_skiplist_find_compare(apr_skiplist *sl, + void *data, + apr_skiplistnode **iter, + apr_skiplist_compare func); + +/** + * Return the next matching element in the skip list using the current comparison + * function. + * @param sl The skip list + * @param data The value to search for + * @param iter A pointer to the returned skip list node representing the element + * found + */ +APR_DECLARE(void *) apr_skiplist_find(apr_skiplist *sl, void *data, apr_skiplistnode **iter); + +/** + * Return the next element in the skip list. + * @param sl The skip list + * @param iter On entry, a pointer to the skip list node to start with; on return, + * a pointer to the skip list node representing the element returned + * @remark If iter points to a NULL value on entry, NULL will be returned. + */ +APR_DECLARE(void *) apr_skiplist_next(apr_skiplist *sl, apr_skiplistnode **iter); + +/** + * Return the previous element in the skip list. + * @param sl The skip list + * @param iter On entry, a pointer to the skip list node to start with; on return, + * a pointer to the skip list node representing the element returned + * @remark If iter points to a NULL value on entry, NULL will be returned. + */ +APR_DECLARE(void *) apr_skiplist_previous(apr_skiplist *sl, apr_skiplistnode **iter); + +/** + * Insert an element into the skip list using the specified comparison function. + * @param sl The skip list + * @param data The element to insert + * @param comp The comparison function to use for placement into the skip list + */ +APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert_compare(apr_skiplist *sl, + void *data, apr_skiplist_compare comp); + +/** + * Insert an element into the skip list using the existing comparison function. + * @param sl The skip list + * @param data The element to insert + * @remark If no comparison function has been set for the skip list, the element + * will not be inserted and NULL will be returned. + */ +APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert(apr_skiplist* sl, void *data); + +/** + * Remove an element from the skip list using the specified comparison function for + * locating the element. + * @param sl The skip list + * @param data The element to remove + * @param myfree A function to be called for each removed element + * @param comp The comparison function to use for placement into the skip list + * @remark If the element is not found, 0 will be returned. Otherwise, the heightXXX + * will be returned. + */ +APR_DECLARE(int) apr_skiplist_remove_compare(apr_skiplist *sl, void *data, + apr_skiplist_freefunc myfree, apr_skiplist_compare comp); + +/** + * Remove an element from the skip list using the existing comparison function for + * locating the element. + * @param sl The skip list + * @param data The element to remove + * @param myfree A function to be called for each removed element + * @remark If the element is not found, 0 will be returned. Otherwise, the heightXXX + * will be returned. + * @remark If no comparison function has been set for the skip list, the element + * will not be removed and 0 will be returned. + */ +APR_DECLARE(int) apr_skiplist_remove(apr_skiplist *sl, void *data, apr_skiplist_freefunc myfree); + +/** + * Remove all elements from the skip list. + * @param sl The skip list + * @param myfree A function to be called for each removed element + */ +APR_DECLARE(void) apr_skiplist_remove_all(apr_skiplist *sl, apr_skiplist_freefunc myfree); + +/** + * Remove each element from the skip list. + * @param sl The skip list + * @param myfree A function to be called for each removed element + */ +APR_DECLARE(void) apr_skiplist_destroy(apr_skiplist *sl, apr_skiplist_freefunc myfree); + +/** + * Return the first element in the skip list, leaving the element in the skip list. + * @param sl The skip list + * @param myfree A function to be called for the removed element + * @remark NULL will be returned if there are no elements + */ +APR_DECLARE(void *) apr_skiplist_pop(apr_skiplist *sl, apr_skiplist_freefunc myfree); + +/** + * Return the first element in the skip list, leaving the element in the skip list. + * @param sl The skip list + * @remark NULL will be returned if there are no elements + */ +APR_DECLARE(void *) apr_skiplist_peek(apr_skiplist *sl); + +/** + * Merge two skip lists. XXX SEMANTICS + * @param sl1 One of two skip lists to be merged + * @param sl2 The other of two skip lists to be merged + */ +APR_DECLARE(apr_skiplist *) apr_skiplist_merge(apr_skiplist *sl1, apr_skiplist *sl2); + +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* ! APR_SKIPLIST_H */ diff --git a/contrib/apr/include/apr_strings.h b/contrib/apr/include/apr_strings.h index 4572173..c0642ad 100644 --- a/contrib/apr/include/apr_strings.h +++ b/contrib/apr/include/apr_strings.h @@ -90,7 +90,7 @@ APR_DECLARE(int) apr_strnatcasecmp(char const *a, char const *b); * duplicate a string into memory allocated out of a pool * @param p The pool to allocate out of * @param s The string to duplicate - * @return The new string + * @return The new string or NULL if s == NULL */ APR_DECLARE(char *) apr_pstrdup(apr_pool_t *p, const char *s); @@ -100,7 +100,7 @@ APR_DECLARE(char *) apr_pstrdup(apr_pool_t *p, const char *s); * @param p The pool to allocate out of * @param s The block of characters to duplicate * @param n The number of characters to duplicate - * @return The new string + * @return The new string or NULL if s == NULL * @remark This is a faster alternative to apr_pstrndup, for use * when you know that the string being duplicated really * has 'n' or more characters. If the string might contain @@ -118,7 +118,7 @@ APR_DECLARE(char *) apr_pstrmemdup(apr_pool_t *p, const char *s, apr_size_t n) * @param p The pool to allocate out of * @param s The string to duplicate * @param n The maximum number of characters to duplicate - * @return The new string + * @return The new string or NULL if s == NULL * @remark The amount of memory allocated from the pool is the length * of the returned string including the NUL terminator */ @@ -130,7 +130,7 @@ APR_DECLARE(char *) apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n); * @param p The pool to allocate from * @param m The memory to duplicate * @param n The number of bytes to duplicate - * @return The new block of memory + * @return The new block of memory or NULL if m == NULL */ APR_DECLARE(void *) apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n) #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) @@ -235,8 +235,14 @@ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str, * first call to apr_strtok() for a given string, and NULL * on subsequent calls. * @param sep The set of delimiters - * @param last Internal state saved by apr_strtok() between calls. + * @param last State saved by apr_strtok() between calls. * @return The next token from the string + * @note the 'last' state points to the trailing NUL char of the final + * token, otherwise it points to the character following the current + * token (all successive or empty occurances of sep are skiped on the + * subsequent call to apr_strtok). Therefore it is possible to avoid + * a strlen() determination, with the following logic; + * toklen = last - retval; if (*last) --toklen; */ APR_DECLARE(char *) apr_strtok(char *str, const char *sep, char **last); diff --git a/contrib/apr/include/apr_tables.h b/contrib/apr/include/apr_tables.h index 1e7a57d..194af02 100644 --- a/contrib/apr/include/apr_tables.h +++ b/contrib/apr/include/apr_tables.h @@ -268,6 +268,18 @@ APR_DECLARE(void) apr_table_clear(apr_table_t *t); APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key); /** + * Get values associated with a given key from the table. If more than one + * value exists, return a comma separated list of values. After this call, the + * data is still in the table. + * @param p The pool to allocate the combined value from, if necessary + * @param t The table to search for the key + * @param key The key to search for (case does not matter) + * @return The value associated with the key, or NULL if the key does not exist. + */ +APR_DECLARE(const char *) apr_table_getm(apr_pool_t *p, const apr_table_t *t, + const char *key); + +/** * Add a key/value pair to a table. If another element already exists with the * same key, this will overwrite the old data. * @param t The table to add the data to. diff --git a/contrib/apr/include/apr_thread_mutex.h b/contrib/apr/include/apr_thread_mutex.h index 4596dce..193a70a 100644 --- a/contrib/apr/include/apr_thread_mutex.h +++ b/contrib/apr/include/apr_thread_mutex.h @@ -59,7 +59,7 @@ typedef struct apr_thread_mutex_t apr_thread_mutex_t; * </PRE> * @param pool the pool from which to allocate the mutex. * @warning Be cautious in using APR_THREAD_MUTEX_DEFAULT. While this is the - * most optimial mutex based on a given platform's performance charateristics, + * most optimal mutex based on a given platform's performance characteristics, * it will behave as either a nested or an unnested lock. */ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, diff --git a/contrib/apr/include/apr_thread_proc.h b/contrib/apr/include/apr_thread_proc.h index 0a97c95..e721ede 100644 --- a/contrib/apr/include/apr_thread_proc.h +++ b/contrib/apr/include/apr_thread_proc.h @@ -114,7 +114,7 @@ typedef enum { #define APR_OC_REASON_DEATH 0 /**< child has died, caller must call * unregister still */ #define APR_OC_REASON_UNWRITABLE 1 /**< write_fd is unwritable */ -#define APR_OC_REASON_RESTART 2 /**< a restart is occuring, perform +#define APR_OC_REASON_RESTART 2 /**< a restart is occurring, perform * any necessary cleanup (including * sending a special signal to child) */ @@ -123,7 +123,7 @@ typedef enum { * kill the child) */ #define APR_OC_REASON_LOST 4 /**< somehow the child exited without * us knowing ... buggy os? */ -#define APR_OC_REASON_RUNNING 5 /**< a health check is occuring, +#define APR_OC_REASON_RUNNING 5 /**< a health check is occurring, * for most maintainence functions * this is a no-op. */ @@ -197,7 +197,9 @@ typedef struct apr_other_child_rec_t apr_other_child_rec_t; typedef void *(APR_THREAD_FUNC *apr_thread_start_t)(apr_thread_t*, void*); typedef enum { - APR_KILL_NEVER, /**< process is never sent any signals */ + APR_KILL_NEVER, /**< process is never killed (i.e., never sent + * any signals), but it will be reaped if it exits + * before the pool is cleaned up */ APR_KILL_ALWAYS, /**< process is sent SIGKILL on apr_pool_t cleanup */ APR_KILL_AFTER_TIMEOUT, /**< SIGTERM, wait 3 seconds, SIGKILL */ APR_JUST_WAIT, /**< wait forever for the process to complete */ @@ -632,7 +634,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new_proc, * APR_NOWAIT -- return immediately regardless of if the * child is dead or not. * </PRE> - * @remark The childs status is in the return code to this process. It is one of: + * @remark The child's status is in the return code to this process. It is one of: * <PRE> * APR_CHILD_DONE -- child is no longer running. * APR_CHILD_NOTDONE -- child is still running. diff --git a/contrib/apr/include/apr_time.h b/contrib/apr/include/apr_time.h index 6dd70cc..15e0b96 100644 --- a/contrib/apr/include/apr_time.h +++ b/contrib/apr/include/apr_time.h @@ -42,7 +42,7 @@ APR_DECLARE_DATA extern const char apr_month_snames[12][4]; APR_DECLARE_DATA extern const char apr_day_snames[7][4]; -/** number of microseconds since 00:00:00 january 1, 1970 UTC */ +/** number of microseconds since 00:00:00 January 1, 1970 UTC */ typedef apr_int64_t apr_time_t; @@ -93,7 +93,7 @@ typedef struct apr_time_exp_t apr_time_exp_t; /** * a structure similar to ANSI struct tm with the following differences: * - tm_usec isn't an ANSI field - * - tm_gmtoff isn't an ANSI field (it's a bsdism) + * - tm_gmtoff isn't an ANSI field (it's a BSDism) */ struct apr_time_exp_t { /** microseconds past tm_sec */ @@ -110,9 +110,9 @@ struct apr_time_exp_t { apr_int32_t tm_mon; /** year since 1900 */ apr_int32_t tm_year; - /** (0-6) days since sunday */ + /** (0-6) days since Sunday */ apr_int32_t tm_wday; - /** (0-365) days since jan 1 */ + /** (0-365) days since January 1 */ apr_int32_t tm_yday; /** daylight saving time */ apr_int32_t tm_isdst; @@ -121,7 +121,7 @@ struct apr_time_exp_t { }; /** - * convert an ansi time_t to an apr_time_t + * Convert an ansi time_t to an apr_time_t * @param result the resulting apr_time_t * @param input the time_t to convert */ @@ -129,8 +129,8 @@ APR_DECLARE(apr_status_t) apr_time_ansi_put(apr_time_t *result, time_t input); /** - * convert a time to its human readable components using an offset - * from GMT + * Convert a time to its human readable components using an offset + * from GMT. * @param result the exploded time * @param input the time to explode * @param offs the number of seconds offset to apply @@ -140,7 +140,7 @@ APR_DECLARE(apr_status_t) apr_time_exp_tz(apr_time_exp_t *result, apr_int32_t offs); /** - * convert a time to its human readable components in GMT timezone + * Convert a time to its human readable components (GMT). * @param result the exploded time * @param input the time to explode */ @@ -148,7 +148,7 @@ APR_DECLARE(apr_status_t) apr_time_exp_gmt(apr_time_exp_t *result, apr_time_t input); /** - * convert a time to its human readable components in local timezone + * Convert a time to its human readable components in the local timezone. * @param result the exploded time * @param input the time to explode */ @@ -156,8 +156,8 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, apr_time_t input); /** - * Convert time value from human readable format to a numeric apr_time_t - * e.g. elapsed usec since epoch + * Convert time value from human readable format to a numeric apr_time_t + * (elapsed microseconds since the epoch). * @param result the resulting imploded time * @param input the input exploded time */ @@ -166,7 +166,7 @@ APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *result, /** * Convert time value from human readable format to a numeric apr_time_t that - * always represents GMT + * always represents GMT. * @param result the resulting imploded time * @param input the input exploded time */ @@ -185,7 +185,7 @@ APR_DECLARE(void) apr_sleep(apr_interval_time_t t); /** * apr_rfc822_date formats dates in the RFC822 * format in an efficient manner. It is a fixed length - * format which requires the indicated amount of storage, + * format which requires APR_RFC822_DATA_LEN bytes of storage, * including the trailing NUL terminator. * @param date_str String to write to. * @param t the time to convert @@ -196,18 +196,18 @@ APR_DECLARE(apr_status_t) apr_rfc822_date(char *date_str, apr_time_t t); #define APR_CTIME_LEN (25) /** * apr_ctime formats dates in the ctime() format - * in an efficient manner. it is a fixed length format - * and requires the indicated amount of storage including + * in an efficient manner. It is a fixed length format + * and requires APR_CTIME_LEN bytes of storage including * the trailing NUL terminator. * Unlike ANSI/ISO C ctime(), apr_ctime() does not include - * a \n at the end of the string. + * a \\n at the end of the string. * @param date_str String to write to. * @param t the time to convert */ APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t); /** - * formats the exploded time according to the format specified + * Formats the exploded time according to the format specified * @param s string to write to * @param retsize The length of the returned string * @param max The maximum length of the string @@ -220,7 +220,7 @@ APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize, /** * Improve the clock resolution for the lifetime of the given pool. - * Generally this is only desireable on benchmarking and other very + * Generally this is only desirable on benchmarking and other very * time-sensitive applications, and has no impact on most platforms. * @param p The pool to associate the finer clock resolution */ diff --git a/contrib/apr/include/apr_user.h b/contrib/apr/include/apr_user.h index 0179e22..0e0a3ac 100644 --- a/contrib/apr/include/apr_user.h +++ b/contrib/apr/include/apr_user.h @@ -81,7 +81,7 @@ APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid, * Get the userid (and groupid) for the specified username * @param userid Returns the user id * @param groupid Returns the user's group id - * @param username The username to lookup + * @param username The username to look up * @param p The pool from which to allocate working space * @remark This function is available only if APR_HAS_USER is defined. */ @@ -103,7 +103,7 @@ APR_DECLARE(apr_status_t) apr_uid_homepath_get(char **dirname, * Compare two user identifiers for equality. * @param left One uid to test * @param right Another uid to test - * @return APR_SUCCESS if the apr_uid_t strutures identify the same user, + * @return APR_SUCCESS if the apr_uid_t structures identify the same user, * APR_EMISMATCH if not, APR_BADARG if an apr_uid_t is invalid. * @remark This function is available only if APR_HAS_USER is defined. */ @@ -137,7 +137,7 @@ APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *groupid, * Compare two group identifiers for equality. * @param left One gid to test * @param right Another gid to test - * @return APR_SUCCESS if the apr_gid_t strutures identify the same group, + * @return APR_SUCCESS if the apr_gid_t structures identify the same group, * APR_EMISMATCH if not, APR_BADARG if an apr_gid_t is invalid. * @remark This function is available only if APR_HAS_USER is defined. */ diff --git a/contrib/apr/include/apr_version.h b/contrib/apr/include/apr_version.h index 4b06508..2111053 100644 --- a/contrib/apr/include/apr_version.h +++ b/contrib/apr/include/apr_version.h @@ -38,7 +38,7 @@ */ -#define APR_COPYRIGHT "Copyright (c) 2013 The Apache Software " \ +#define APR_COPYRIGHT "Copyright (c) 2000-2014 The Apache Software " \ "Foundation or its licensors, as applicable." /* The numeric compile-time version constants. These constants are the @@ -56,13 +56,13 @@ * Minor API changes that do not cause binary compatibility problems. * Reset to 0 when upgrading APR_MAJOR_VERSION */ -#define APR_MINOR_VERSION 4 +#define APR_MINOR_VERSION 5 /** patch level * The Patch Level never includes API changes, simply bug fixes. * Reset to 0 when upgrading APR_MINOR_VERSION */ -#define APR_PATCH_VERSION 8 +#define APR_PATCH_VERSION 1 /** * The symbol APR_IS_DEV_VERSION is only defined for internal, diff --git a/contrib/apr/include/arch/unix/apr_arch_poll_private.h b/contrib/apr/include/arch/unix/apr_arch_poll_private.h index 1d31f96..2dd7b1f 100644 --- a/contrib/apr/include/arch/unix/apr_arch_poll_private.h +++ b/contrib/apr/include/arch/unix/apr_arch_poll_private.h @@ -45,6 +45,11 @@ #define HAS_PIPES(dt) (dt == APR_POLL_FILE) ? 1 : 0 #endif +#if defined(HAVE_AIO_H) && defined(HAVE_AIO_MSGQ) +#define _AIO_OS390 /* enable a bunch of z/OS aio.h definitions */ +#include <aio.h> /* aiocb */ +#endif + /* Choose the best method platform specific to use in apr_pollset */ #ifdef HAVE_KQUEUE #define POLLSET_USES_KQUEUE @@ -55,6 +60,9 @@ #elif defined(HAVE_EPOLL) #define POLLSET_USES_EPOLL #define POLLSET_DEFAULT_METHOD APR_POLLSET_EPOLL +#elif defined(HAVE_AIO_MSGQ) +#define POLLSET_USES_AIO_MSGQ +#define POLLSET_DEFAULT_METHOD APR_POLLSET_AIO_MSGQ #elif defined(HAVE_POLL) #define POLLSET_USES_POLL #define POLLSET_DEFAULT_METHOD APR_POLLSET_POLL @@ -75,7 +83,7 @@ #endif #endif -#if defined(POLLSET_USES_KQUEUE) || defined(POLLSET_USES_EPOLL) || defined(POLLSET_USES_PORT) +#if defined(POLLSET_USES_KQUEUE) || defined(POLLSET_USES_EPOLL) || defined(POLLSET_USES_PORT) || defined(POLLSET_USES_AIO_MSGQ) #include "apr_ring.h" @@ -107,6 +115,7 @@ struct pfd_elem_t { typedef struct apr_pollset_private_t apr_pollset_private_t; typedef struct apr_pollset_provider_t apr_pollset_provider_t; typedef struct apr_pollcb_provider_t apr_pollcb_provider_t; + struct apr_pollset_t { apr_pool_t *pool; diff --git a/contrib/apr/include/arch/unix/apr_arch_threadproc.h b/contrib/apr/include/arch/unix/apr_arch_threadproc.h index b76dc9b..a61830f 100644 --- a/contrib/apr/include/arch/unix/apr_arch_threadproc.h +++ b/contrib/apr/include/arch/unix/apr_arch_threadproc.h @@ -39,7 +39,7 @@ #if APR_HAVE_STRING_H #include <string.h> #endif -#if HAVE_SCHED_H +#ifdef HAVE_SCHED_H #include <sched.h> #endif /* End System Headers */ diff --git a/contrib/apr/include/arch/unix/apr_private.h.in b/contrib/apr/include/arch/unix/apr_private.h.in index f7ea7e9..12af027 100644 --- a/contrib/apr/include/arch/unix/apr_private.h.in +++ b/contrib/apr/include/arch/unix/apr_private.h.in @@ -83,6 +83,9 @@ /* Define if accept4 function is supported */ #undef HAVE_ACCEPT4 +/* Define if async i/o supports message q's */ +#undef HAVE_AIO_MSGQ + /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA @@ -929,7 +932,7 @@ /* switch this on if we have a BeOS version below BONE */ -#if BEOS && !HAVE_BONE_VERSION +#if defined(BEOS) && !defined(HAVE_BONE_VERSION) #define BEOS_R5 1 #else #define BEOS_BONE 1 |