apr.h

Go to the documentation of this file.
00001 /* Licensed to the Apache Software Foundation (ASF) under one or more
00002  * contributor license agreements.  See the NOTICE file distributed with
00003  * this work for additional information regarding copyright ownership.
00004  * The ASF licenses this file to You under the Apache License, Version 2.0
00005  * (the "License"); you may not use this file except in compliance with
00006  * the License.  You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 
00018 #ifndef APR_H
00019 #define APR_H
00020 
00021 /* GENERATED FILE WARNING!  DO NOT EDIT apr.h
00022  *
00023  * You must modify apr.h.in instead.
00024  *
00025  * And please, make an effort to stub apr.hw and apr.hnw in the process.
00026  */
00027 
00028 /**
00029  * @file apr.h
00030  * @brief APR Platform Definitions
00031  * @remark This is a generated header generated from include/apr.h.in by
00032  * ./configure, or copied from include/apr.hw or include/apr.hnw 
00033  * for Win32 or Netware by those build environments, respectively.
00034  */
00035 
00036 /**
00037  * @defgroup APR Apache Portability Runtime library
00038  * @{
00039  */
00040 /**
00041  * @defgroup apr_platform Platform Definitions
00042  * @{
00043  * @warning
00044  * <strong><em>The actual values of macros and typedefs on this page<br>
00045  * are platform specific and should NOT be relied upon!</em></strong>
00046  */
00047 
00048 /* So that we can use inline on some critical functions, and use
00049  * GNUC attributes (such as to get -Wall warnings for printf-like
00050  * functions).  Only do this in gcc 2.7 or later ... it may work
00051  * on earlier stuff, but why chance it.
00052  *
00053  * We've since discovered that the gcc shipped with NeXT systems
00054  * as "cc" is completely broken.  It claims to be __GNUC__ and so
00055  * on, but it doesn't implement half of the things that __GNUC__
00056  * means.  In particular it's missing inline and the __attribute__
00057  * stuff.  So we hack around it.  PR#1613. -djg
00058  */
00059 #if !defined(__GNUC__) || __GNUC__ < 2 || \
00060     (__GNUC__ == 2 && __GNUC_MINOR__ < 7) ||\
00061     defined(NEXT)
00062 #ifndef __attribute__
00063 #define __attribute__(__x)
00064 #endif
00065 #define APR_INLINE
00066 #define APR_HAS_INLINE          0
00067 #else
00068 #define APR_INLINE __inline__
00069 #define APR_HAS_INLINE          1
00070 #endif
00071 
00072 #define APR_HAVE_ARPA_INET_H     1
00073 #define APR_HAVE_CONIO_H         0
00074 #define APR_HAVE_CRYPT_H         1
00075 #define APR_HAVE_CTYPE_H         1
00076 #define APR_HAVE_DIRENT_H        1
00077 #define APR_HAVE_ERRNO_H         1
00078 #define APR_HAVE_FCNTL_H         1
00079 #define APR_HAVE_IO_H            0
00080 #define APR_HAVE_LIMITS_H        1
00081 #define APR_HAVE_NETDB_H         1
00082 #define APR_HAVE_NETINET_IN_H    1
00083 #define APR_HAVE_NETINET_SCTP_H  0
00084 #define APR_HAVE_NETINET_SCTP_UIO_H 0
00085 #define APR_HAVE_NETINET_TCP_H   1
00086 #define APR_HAVE_PTHREAD_H       1
00087 #define APR_HAVE_SEMAPHORE_H     1
00088 #define APR_HAVE_SIGNAL_H        1
00089 #define APR_HAVE_STDARG_H        1
00090 #define APR_HAVE_STDINT_H        1
00091 #define APR_HAVE_STDIO_H         1
00092 #define APR_HAVE_STDLIB_H        1
00093 #define APR_HAVE_STRING_H        1
00094 #define APR_HAVE_STRINGS_H       1
00095 #define APR_HAVE_SYS_IOCTL_H     1
00096 #define APR_HAVE_SYS_SENDFILE_H  1
00097 #define APR_HAVE_SYS_SIGNAL_H    1
00098 #define APR_HAVE_SYS_SOCKET_H    1
00099 #define APR_HAVE_SYS_SOCKIO_H    0
00100 #define APR_HAVE_SYS_SYSLIMITS_H 0
00101 #define APR_HAVE_SYS_TIME_H      1
00102 #define APR_HAVE_SYS_TYPES_H     1
00103 #define APR_HAVE_SYS_UIO_H       1
00104 #define APR_HAVE_SYS_UN_H        1
00105 #define APR_HAVE_SYS_WAIT_H      1
00106 #define APR_HAVE_TIME_H          1
00107 #define APR_HAVE_UNISTD_H        1
00108 #define APR_HAVE_WINDOWS_H       0
00109 #define APR_HAVE_WINSOCK2_H      0
00110 
00111 /** @} */
00112 /** @} */
00113 
00114 /* We don't include our conditional headers within the doxyblocks 
00115  * or the extern "C" namespace 
00116  */
00117 
00118 #if APR_HAVE_WINDOWS_H
00119 #include <windows.h>
00120 #endif
00121 
00122 #if APR_HAVE_WINSOCK2_H
00123 #include <winsock2.h>
00124 #endif
00125 
00126 #if APR_HAVE_SYS_TYPES_H
00127 #include <sys/types.h>
00128 #endif
00129 
00130 #if APR_HAVE_SYS_SOCKET_H
00131 #include <sys/socket.h>
00132 #endif
00133 
00134 #if defined(__cplusplus) && !defined(__STDC_CONSTANT_MACROS)
00135 /* C99 7.18.4 requires that stdint.h only exposes INT64_C 
00136  * and UINT64_C for C++ implementations if this is defined: */
00137 #define __STDC_CONSTANT_MACROS
00138 #endif
00139 
00140 #if APR_HAVE_STDINT_H
00141 #include <stdint.h>
00142 #endif
00143 
00144 #if APR_HAVE_SYS_WAIT_H
00145 #include <sys/wait.h>
00146 #endif
00147 
00148 #ifdef OS2
00149 #define INCL_DOS
00150 #define INCL_DOSERRORS
00151 #include <os2.h>
00152 #endif
00153 
00154 /* header files for PATH_MAX, _POSIX_PATH_MAX */
00155 #if APR_HAVE_LIMITS_H
00156 #include <limits.h>
00157 #else
00158 #if APR_HAVE_SYS_SYSLIMITS_H
00159 #include <sys/syslimits.h>
00160 #endif
00161 #endif
00162 
00163 
00164 #ifdef __cplusplus
00165 extern "C" {
00166 #endif
00167 
00168 /**
00169  * @addtogroup apr_platform
00170  * @ingroup APR 
00171  * @{
00172  */
00173 
00174 #define APR_HAVE_SHMEM_MMAP_TMP     1
00175 #define APR_HAVE_SHMEM_MMAP_SHM     1
00176 #define APR_HAVE_SHMEM_MMAP_ZERO    1
00177 #define APR_HAVE_SHMEM_SHMGET_ANON  1
00178 #define APR_HAVE_SHMEM_SHMGET       1
00179 #define APR_HAVE_SHMEM_MMAP_ANON    1
00180 #define APR_HAVE_SHMEM_BEOS         0
00181 
00182 #define APR_USE_SHMEM_MMAP_TMP     0
00183 #define APR_USE_SHMEM_MMAP_SHM     0
00184 #define APR_USE_SHMEM_MMAP_ZERO    0
00185 #define APR_USE_SHMEM_SHMGET_ANON  0
00186 #define APR_USE_SHMEM_SHMGET       1
00187 #define APR_USE_SHMEM_MMAP_ANON    1
00188 #define APR_USE_SHMEM_BEOS         0
00189 
00190 #define APR_USE_FLOCK_SERIALIZE           0 
00191 #define APR_USE_SYSVSEM_SERIALIZE         1
00192 #define APR_USE_POSIXSEM_SERIALIZE        0
00193 #define APR_USE_FCNTL_SERIALIZE           0
00194 #define APR_USE_PROC_PTHREAD_SERIALIZE    0 
00195 #define APR_USE_PTHREAD_SERIALIZE         1 
00196 
00197 #define APR_HAS_FLOCK_SERIALIZE           1
00198 #define APR_HAS_SYSVSEM_SERIALIZE         1
00199 #define APR_HAS_POSIXSEM_SERIALIZE        1
00200 #define APR_HAS_FCNTL_SERIALIZE           1
00201 #define APR_HAS_PROC_PTHREAD_SERIALIZE    1
00202 
00203 #define APR_PROCESS_LOCK_IS_GLOBAL        0
00204 
00205 #define APR_HAVE_CORKABLE_TCP   1 
00206 #define APR_HAVE_GETRLIMIT      1
00207 #define APR_HAVE_IN_ADDR        1
00208 #define APR_HAVE_INET_ADDR      1
00209 #define APR_HAVE_INET_NETWORK   1
00210 #define APR_HAVE_IPV6           1
00211 #define APR_HAVE_MEMMOVE        1
00212 #define APR_HAVE_SETRLIMIT      1
00213 #define APR_HAVE_SIGACTION      1
00214 #define APR_HAVE_SIGSUSPEND     1
00215 #define APR_HAVE_SIGWAIT        1
00216 #define APR_HAVE_SA_STORAGE     1
00217 #define APR_HAVE_STRCASECMP     1
00218 #define APR_HAVE_STRDUP         1
00219 #define APR_HAVE_STRICMP        0
00220 #define APR_HAVE_STRNCASECMP    1
00221 #define APR_HAVE_STRNICMP       0
00222 #define APR_HAVE_STRSTR         1
00223 #define APR_HAVE_MEMCHR         1
00224 #define APR_HAVE_STRUCT_RLIMIT  1
00225 #define APR_HAVE_UNION_SEMUN    0
00226 #define APR_HAVE_SCTP           0
00227 #define APR_HAVE_IOVEC          1
00228 
00229 /*  APR Feature Macros */
00230 #define APR_HAS_SHARED_MEMORY     1
00231 #define APR_HAS_THREADS           1
00232 #define APR_HAS_SENDFILE          1
00233 #define APR_HAS_MMAP              1
00234 #define APR_HAS_FORK              1
00235 #define APR_HAS_RANDOM            1
00236 #define APR_HAS_OTHER_CHILD       1
00237 #define APR_HAS_DSO               1
00238 #define APR_HAS_SO_ACCEPTFILTER   0
00239 #define APR_HAS_UNICODE_FS        0
00240 #define APR_HAS_PROC_INVOKED      0
00241 #define APR_HAS_USER              1
00242 #define APR_HAS_LARGE_FILES       0
00243 #define APR_HAS_XTHREAD_FILES     0
00244 #define APR_HAS_OS_UUID           0
00245 
00246 #define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 0
00247 
00248 /* APR sets APR_FILES_AS_SOCKETS to 1 on systems where it is possible
00249  * to poll on files/pipes.
00250  */
00251 #define APR_FILES_AS_SOCKETS      1
00252 
00253 /* This macro indicates whether or not EBCDIC is the native character set.
00254  */
00255 #define APR_CHARSET_EBCDIC        0
00256 
00257 /* If we have a TCP implementation that can be "corked", what flag
00258  * do we use?
00259  */
00260 #define APR_TCP_NOPUSH_FLAG       TCP_CORK
00261 
00262 /* Is the TCP_NODELAY socket option inherited from listening sockets?
00263 */
00264 #define APR_TCP_NODELAY_INHERITED 1
00265 
00266 /* Is the O_NONBLOCK flag inherited from listening sockets?
00267 */
00268 #define APR_O_NONBLOCK_INHERITED 0
00269 
00270 /* Typedefs that APR needs. */
00271 
00272 typedef  unsigned char           apr_byte_t;
00273 
00274 typedef  short           apr_int16_t;
00275 typedef  unsigned short  apr_uint16_t;
00276 
00277 typedef  int             apr_int32_t;
00278 typedef  unsigned int    apr_uint32_t;
00279 
00280 typedef  long            apr_int64_t;
00281 typedef  unsigned long   apr_uint64_t;
00282 
00283 typedef  size_t          apr_size_t;
00284 typedef  ssize_t         apr_ssize_t;
00285 typedef  off_t           apr_off_t;
00286 typedef  socklen_t       apr_socklen_t;
00287 typedef  ino_t           apr_ino_t;
00288 
00289 #define APR_SIZEOF_VOIDP 8
00290 
00291 #if APR_SIZEOF_VOIDP == 8
00292 typedef  apr_uint64_t            apr_uintptr_t;
00293 #else
00294 typedef  apr_uint32_t            apr_uintptr_t;
00295 #endif
00296 
00297 /* Are we big endian? */
00298 #define APR_IS_BIGENDIAN        0
00299 
00300 /* Mechanisms to properly type numeric literals */
00301 #define APR_INT64_C(val) INT64_C(val)
00302 #define APR_UINT64_C(val) UINT64_C(val)
00303 
00304 #ifdef INT16_MIN
00305 #define APR_INT16_MIN   INT16_MIN
00306 #else
00307 #define APR_INT16_MIN   (-0x7fff - 1)
00308 #endif
00309 
00310 #ifdef INT16_MAX
00311 #define APR_INT16_MAX  INT16_MAX
00312 #else
00313 #define APR_INT16_MAX   (0x7fff)
00314 #endif
00315 
00316 #ifdef UINT16_MAX
00317 #define APR_UINT16_MAX  UINT16_MAX
00318 #else
00319 #define APR_UINT16_MAX  (0xffff)
00320 #endif
00321 
00322 #ifdef INT32_MIN
00323 #define APR_INT32_MIN   INT32_MIN
00324 #else
00325 #define APR_INT32_MIN   (-0x7fffffff - 1)
00326 #endif
00327 
00328 #ifdef INT32_MAX
00329 #define APR_INT32_MAX  INT32_MAX
00330 #else
00331 #define APR_INT32_MAX  0x7fffffff
00332 #endif
00333 
00334 #ifdef UINT32_MAX
00335 #define APR_UINT32_MAX  UINT32_MAX
00336 #else
00337 #define APR_UINT32_MAX  (0xffffffffU)
00338 #endif
00339 
00340 #ifdef INT64_MIN
00341 #define APR_INT64_MIN   INT64_MIN
00342 #else
00343 #define APR_INT64_MIN   (APR_INT64_C(-0x7fffffffffffffff) - 1)
00344 #endif
00345 
00346 #ifdef INT64_MAX
00347 #define APR_INT64_MAX   INT64_MAX
00348 #else
00349 #define APR_INT64_MAX   APR_INT64_C(0x7fffffffffffffff)
00350 #endif
00351 
00352 #ifdef UINT64_MAX
00353 #define APR_UINT64_MAX  UINT64_MAX
00354 #else
00355 #define APR_UINT64_MAX  APR_UINT64_C(0xffffffffffffffff)
00356 #endif
00357 
00358 #define APR_SIZE_MAX    (~((apr_size_t)0))
00359 
00360 
00361 /* Definitions that APR programs need to work properly. */
00362 
00363 /**
00364  * APR public API wrap for C++ compilers.
00365  */
00366 #ifdef __cplusplus
00367 #define APR_BEGIN_DECLS     extern "C" {
00368 #define APR_END_DECLS       }
00369 #else
00370 #define APR_BEGIN_DECLS
00371 #define APR_END_DECLS
00372 #endif
00373 
00374 /** 
00375  * Thread callbacks from APR functions must be declared with APR_THREAD_FUNC, 
00376  * so that they follow the platform's calling convention.
00377  * <PRE>
00378  *
00379  * void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data);
00380  *
00381  * </PRE>
00382  */
00383 #define APR_THREAD_FUNC
00384 
00385 /**
00386  * The public APR functions are declared with APR_DECLARE(), so they may
00387  * use the most appropriate calling convention.  Public APR functions with 
00388  * variable arguments must use APR_DECLARE_NONSTD().
00389  *
00390  * @remark Both the declaration and implementations must use the same macro.
00391  *
00392  * <PRE>
00393  * APR_DECLARE(rettype) apr_func(args)
00394  * </PRE>
00395  * @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA
00396  * @remark Note that when APR compiles the library itself, it passes the 
00397  * symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32) 
00398  * to export public symbols from the dynamic library build.\n
00399  * The user must define the APR_DECLARE_STATIC when compiling to target
00400  * the static APR library on some platforms (e.g. Win32.)  The public symbols 
00401  * are neither exported nor imported when APR_DECLARE_STATIC is defined.\n
00402  * By default, compiling an application and including the APR public
00403  * headers, without defining APR_DECLARE_STATIC, will prepare the code to be
00404  * linked to the dynamic library.
00405  */
00406 #define APR_DECLARE(type)            type 
00407 
00408 /**
00409  * The public APR functions using variable arguments are declared with 
00410  * APR_DECLARE_NONSTD(), as they must follow the C language calling convention.
00411  * @see APR_DECLARE @see APR_DECLARE_DATA
00412  * @remark Both the declaration and implementations must use the same macro.
00413  * <PRE>
00414  *
00415  * APR_DECLARE_NONSTD(rettype) apr_func(args, ...);
00416  *
00417  * </PRE>
00418  */
00419 #define APR_DECLARE_NONSTD(type)     type
00420 
00421 /**
00422  * The public APR variables are declared with AP_MODULE_DECLARE_DATA.
00423  * This assures the appropriate indirection is invoked at compile time.
00424  * @see APR_DECLARE @see APR_DECLARE_NONSTD
00425  * @remark Note that the declaration and implementations use different forms,
00426  * but both must include the macro.
00427  * 
00428  * <PRE>
00429  *
00430  * extern APR_DECLARE_DATA type apr_variable;\n
00431  * APR_DECLARE_DATA type apr_variable = value;
00432  *
00433  * </PRE>
00434  */
00435 #define APR_DECLARE_DATA
00436 
00437 /* Define APR_SSIZE_T_FMT.  
00438  * If ssize_t is an integer we define it to be "d",
00439  * if ssize_t is a long int we define it to be "ld",
00440  * if ssize_t is neither we declare an error here.
00441  * I looked for a better way to define this here, but couldn't find one, so
00442  * to find the logic for this definition search for "ssize_t_fmt" in
00443  * configure.in.
00444  */
00445 #define APR_SSIZE_T_FMT "ld"
00446 
00447 /* And APR_SIZE_T_FMT */
00448 #define APR_SIZE_T_FMT "lu"
00449 
00450 /* And APR_OFF_T_FMT */
00451 #define APR_OFF_T_FMT "ld"
00452 
00453 /* And APR_PID_T_FMT */
00454 #define APR_PID_T_FMT "d"
00455 
00456 /* And APR_INT64_T_FMT */
00457 #define APR_INT64_T_FMT "ld"
00458 
00459 /* And APR_UINT64_T_FMT */
00460 #define APR_UINT64_T_FMT "lu"
00461 
00462 /* And APR_UINT64_T_HEX_FMT */
00463 #define APR_UINT64_T_HEX_FMT "lx"
00464 
00465 /* Does the proc mutex lock threads too */
00466 #define APR_PROC_MUTEX_IS_GLOBAL      0
00467 
00468 /* Local machine definition for console and log output. */
00469 #define APR_EOL_STR              "\n"
00470 
00471 #if APR_HAVE_SYS_WAIT_H
00472 #ifdef WEXITSTATUS
00473 #define apr_wait_t       int
00474 #else
00475 #define apr_wait_t       union wait
00476 #define WEXITSTATUS(status)    (int)((status).w_retcode)
00477 #define WTERMSIG(status)       (int)((status).w_termsig)
00478 #endif /* !WEXITSTATUS */
00479 #elif defined(__MINGW32__)
00480 typedef int apr_wait_t;
00481 #endif /* HAVE_SYS_WAIT_H */
00482 
00483 #if defined(PATH_MAX)
00484 #define APR_PATH_MAX       PATH_MAX
00485 #elif defined(_POSIX_PATH_MAX)
00486 #define APR_PATH_MAX       _POSIX_PATH_MAX
00487 #else
00488 #error no decision has been made on APR_PATH_MAX for your platform
00489 #endif
00490 
00491 #define APR_DSOPATH "LD_LIBRARY_PATH"
00492 
00493 /** @} */
00494 
00495 /* Definitions that only Win32 programs need to compile properly. */
00496 
00497 /* XXX These simply don't belong here, perhaps in apr_portable.h
00498  * based on some APR_HAVE_PID/GID/UID?
00499  */
00500 #ifdef __MINGW32__
00501 #ifndef __GNUC__
00502 typedef  int         pid_t;
00503 #endif
00504 typedef  int         uid_t;
00505 typedef  int         gid_t;
00506 #endif
00507 
00508 #ifdef __cplusplus
00509 }
00510 #endif
00511 
00512 #endif /* APR_H */

Generated on Sun Nov 10 18:38:48 2013 for Apache Portable Runtime by  doxygen 1.4.6