apr.hw 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. /* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
  2. * applicable.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef APR_H
  17. #define APR_H
  18. /* GENERATED FILE WARNING! DO NOT EDIT apr.h
  19. *
  20. * You must modify apr.hw instead.
  21. *
  22. * And please, make an effort to stub apr.hnw and apr.h.in in the process.
  23. *
  24. * This is the Win32 specific version of apr.h. It is copied from
  25. * apr.hw by the apr.dsp and libapr.dsp projects.
  26. */
  27. /**
  28. * @file apr.h
  29. * @brief APR Platform Definitions
  30. * @remark This is a generated header generated from include/apr.h.in by
  31. * ./configure, or copied from include/apr.hw or include/apr.hnw
  32. * for Win32 or Netware by those build environments, respectively.
  33. */
  34. #if defined(WIN32) || defined(DOXYGEN)
  35. /* Ignore most warnings (back down to /W3) for poorly constructed headers
  36. */
  37. #if defined(_MSC_VER) && _MSC_VER >= 1200
  38. #pragma warning(push, 3)
  39. #endif
  40. /* disable or reduce the frequency of...
  41. * C4057: indirection to slightly different base types
  42. * C4075: slight indirection changes (unsigned short* vs short[])
  43. * C4100: unreferenced formal parameter
  44. * C4127: conditional expression is constant
  45. * C4163: '_rotl64' : not available as an intrinsic function
  46. * C4201: nonstandard extension nameless struct/unions
  47. * C4244: int to char/short - precision loss
  48. * C4514: unreferenced inline function removed
  49. */
  50. #pragma warning(disable: 4100 4127 4163 4201 4514; once: 4057 4075 4244)
  51. /* Ignore Microsoft's interpretation of secure development
  52. * and the POSIX string handling API
  53. */
  54. #if defined(_MSC_VER) && _MSC_VER >= 1400
  55. #ifndef _CRT_SECURE_NO_DEPRECATE
  56. #define _CRT_SECURE_NO_DEPRECATE
  57. #endif
  58. #pragma warning(disable: 4996)
  59. #endif
  60. /* Has windows.h already been included? If so, our preferences don't matter,
  61. * but we will still need the winsock things no matter what was included.
  62. * If not, include a restricted set of windows headers to our tastes.
  63. */
  64. #ifndef _WINDOWS_
  65. #ifndef WIN32_LEAN_AND_MEAN
  66. #define WIN32_LEAN_AND_MEAN
  67. #endif
  68. #ifndef _WIN32_WINNT
  69. /* Restrict the server to a subset of Windows NT 4.0 header files by default
  70. */
  71. #define _WIN32_WINNT 0x0501
  72. #endif
  73. #ifndef NOUSER
  74. #define NOUSER
  75. #endif
  76. #ifndef NOMCX
  77. #define NOMCX
  78. #endif
  79. #ifndef NOIME
  80. #define NOIME
  81. #endif
  82. #include <windows.h>
  83. /*
  84. * Add a _very_few_ declarations missing from the restricted set of headers
  85. * (If this list becomes extensive, re-enable the required headers above!)
  86. * winsock headers were excluded by WIN32_LEAN_AND_MEAN, so include them now
  87. */
  88. #define SW_HIDE 0
  89. #ifndef _WIN32_WCE
  90. #include <winsock2.h>
  91. #include <mswsock.h>
  92. #include <ws2tcpip.h>
  93. #else
  94. #include <winsock.h>
  95. #endif
  96. #endif /* !_WINDOWS_ */
  97. /**
  98. * @defgroup apr_platform Platform Definitions
  99. * @ingroup APR
  100. * @{
  101. */
  102. #define APR_INLINE __inline
  103. #define APR_HAS_INLINE 1
  104. #ifndef __attribute__
  105. #define __attribute__(__x)
  106. #endif
  107. #ifndef _WIN32_WCE
  108. #define APR_HAVE_ARPA_INET_H 0
  109. #define APR_HAVE_CONIO_H 1
  110. #define APR_HAVE_CRYPT_H 0
  111. #define APR_HAVE_CTYPE_H 1
  112. #define APR_HAVE_DIRENT_H 0
  113. #define APR_HAVE_ERRNO_H 1
  114. #define APR_HAVE_FCNTL_H 1
  115. #define APR_HAVE_IO_H 1
  116. #define APR_HAVE_LIMITS_H 1
  117. #define APR_HAVE_NETDB_H 0
  118. #define APR_HAVE_NETINET_IN_H 0
  119. #define APR_HAVE_NETINET_SCTP_H 0
  120. #define APR_HAVE_NETINET_SCTP_UIO_H 0
  121. #define APR_HAVE_NETINET_TCP_H 0
  122. #define APR_HAVE_PTHREAD_H 0
  123. #define APR_HAVE_SIGNAL_H 1
  124. #define APR_HAVE_STDARG_H 1
  125. #define APR_HAVE_STDINT_H 0
  126. #define APR_HAVE_STDIO_H 1
  127. #define APR_HAVE_STDLIB_H 1
  128. #define APR_HAVE_STRING_H 1
  129. #define APR_HAVE_STRINGS_H 0
  130. #define APR_HAVE_SYS_SENDFILE_H 0
  131. #define APR_HAVE_SYS_SIGNAL_H 0
  132. #define APR_HAVE_SYS_SOCKET_H 0
  133. #define APR_HAVE_SYS_SOCKIO_H 0
  134. #define APR_HAVE_SYS_SYSLIMITS_H 0
  135. #define APR_HAVE_SYS_TIME_H 0
  136. #define APR_HAVE_SYS_TYPES_H 1
  137. #define APR_HAVE_SYS_UIO_H 0
  138. #define APR_HAVE_SYS_WAIT_H 0
  139. #define APR_HAVE_UNISTD_H 0
  140. #define APR_HAVE_STDDEF_H 1
  141. #define APR_HAVE_PROCESS_H 1
  142. #define APR_HAVE_TIME_H 1
  143. #else
  144. #define APR_HAVE_ARPA_INET_H 0
  145. #define APR_HAVE_CONIO_H 0
  146. #define APR_HAVE_CRYPT_H 0
  147. #define APR_HAVE_CTYPE_H 0
  148. #define APR_HAVE_DIRENT_H 0
  149. #define APR_HAVE_ERRNO_H 0
  150. #define APR_HAVE_FCNTL_H 0
  151. #define APR_HAVE_IO_H 0
  152. #define APR_HAVE_LIMITS_H 0
  153. #define APR_HAVE_NETDB_H 0
  154. #define APR_HAVE_NETINET_IN_H 0
  155. #define APR_HAVE_NETINET_TCP_H 0
  156. #define APR_HAVE_PTHREAD_H 0
  157. #define APR_HAVE_SIGNAL_H 0
  158. #define APR_HAVE_STDARG_H 0
  159. #define APR_HAVE_STDINT_H 0
  160. #define APR_HAVE_STDIO_H 1
  161. #define APR_HAVE_STDLIB_H 1
  162. #define APR_HAVE_STRING_H 1
  163. #define APR_HAVE_STRINGS_H 0
  164. #define APR_HAVE_SYS_SENDFILE_H 0
  165. #define APR_HAVE_SYS_SIGNAL_H 0
  166. #define APR_HAVE_SYS_SOCKET_H 0
  167. #define APR_HAVE_SYS_SYSLIMITS_H 0
  168. #define APR_HAVE_SYS_TIME_H 0
  169. #define APR_HAVE_SYS_TYPES_H 0
  170. #define APR_HAVE_SYS_UIO_H 0
  171. #define APR_HAVE_SYS_WAIT_H 0
  172. #define APR_HAVE_UNISTD_H 0
  173. #define APR_HAVE_STDDEF_H 0
  174. #define APR_HAVE_PROCESS_H 0
  175. #define APR_HAVE_TIME_H 0
  176. #endif
  177. #define APR_USE_FLOCK_SERIALIZE 0
  178. #define APR_USE_SYSVSEM_SERIALIZE 0
  179. #define APR_USE_FCNTL_SERIALIZE 0
  180. #define APR_USE_PROC_PTHREAD_SERIALIZE 0
  181. #define APR_USE_PTHREAD_SERIALIZE 0
  182. #define APR_HAS_FLOCK_SERIALIZE 0
  183. #define APR_HAS_SYSVSEM_SERIALIZE 0
  184. #define APR_HAS_FCNTL_SERIALIZE 0
  185. #define APR_HAS_PROC_PTHREAD_SERIALIZE 0
  186. #define APR_HAS_RWLOCK_SERIALIZE 0
  187. #define APR_HAS_LOCK_CREATE_NP 0
  188. #define APR_PROCESS_LOCK_IS_GLOBAL 0
  189. #define APR_USES_ANONYMOUS_SHM 0
  190. #define APR_USES_FILEBASED_SHM 0
  191. #define APR_USES_KEYBASED_SHM 0
  192. #define APR_FILE_BASED_SHM 0
  193. #define APR_MEM_BASED_SHM 0
  194. #define APR_HAVE_CORKABLE_TCP 0
  195. #define APR_HAVE_GETRLIMIT 0
  196. #define APR_HAVE_ICONV 0
  197. #define APR_HAVE_IN_ADDR 1
  198. #define APR_HAVE_INET_ADDR 1
  199. #define APR_HAVE_INET_NETWORK 0
  200. #define APR_HAVE_IPV6 1
  201. #define APR_HAVE_MEMMOVE 1
  202. #define APR_HAVE_SETRLIMIT 0
  203. #define APR_HAVE_SIGACTION 0
  204. #define APR_HAVE_SIGSUSPEND 0
  205. #define APR_HAVE_SIGWAIT 0
  206. #define APR_HAVE_STRCASECMP 0
  207. #define APR_HAVE_STRDUP 1
  208. #define APR_HAVE_STRNCASECMP 0
  209. #define APR_HAVE_STRSTR 1
  210. #define APR_HAVE_MEMCHR 1
  211. #define APR_HAVE_STRUCT_RLIMIT 0
  212. #define APR_HAVE_UNION_SEMUN 0
  213. #define APR_HAVE_SCTP 0
  214. #ifndef _WIN32_WCE
  215. #define APR_HAVE_STRICMP 1
  216. #define APR_HAVE_STRNICMP 1
  217. #define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 1
  218. #else
  219. #define APR_HAVE_STRICMP 0
  220. #define APR_HAVE_STRNICMP 0
  221. #define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 0
  222. #endif
  223. /** @} */
  224. /* We don't include our conditional headers within the doxyblocks
  225. * or the extern "C" namespace
  226. */
  227. #if APR_HAVE_STDLIB_H
  228. #include <stdlib.h>
  229. #endif
  230. #if APR_HAVE_STDIO_H
  231. #include <stdio.h>
  232. #endif
  233. #if APR_HAVE_SYS_TYPES_H
  234. #include <sys/types.h>
  235. #endif
  236. #if APR_HAVE_STDDEF_H
  237. #include <stddef.h>
  238. #endif
  239. #if APR_HAVE_TIME_H
  240. #include <time.h>
  241. #endif
  242. #if APR_HAVE_PROCESS_H
  243. #include <process.h>
  244. #endif
  245. #if APR_HAVE_IPV6
  246. #include <ws2tcpip.h>
  247. #endif
  248. #ifdef __cplusplus
  249. extern "C" {
  250. #endif
  251. /**
  252. * @addtogroup apr_platform
  253. * @ingroup APR
  254. * @{
  255. */
  256. /* APR Feature Macros */
  257. #define APR_HAS_SHARED_MEMORY 1
  258. #define APR_HAS_THREADS 1
  259. #define APR_HAS_MMAP 1
  260. #define APR_HAS_FORK 0
  261. #define APR_HAS_RANDOM 1
  262. #define APR_HAS_OTHER_CHILD 1
  263. #define APR_HAS_DSO 1
  264. #define APR_HAS_SO_ACCEPTFILTER 0
  265. #define APR_HAS_UNICODE_FS 1
  266. #define APR_HAS_PROC_INVOKED 1
  267. #ifndef _WIN32_WCE
  268. #define APR_HAS_SENDFILE 1
  269. #define APR_HAS_USER 1
  270. #define APR_HAS_LARGE_FILES 1
  271. #define APR_HAS_XTHREAD_FILES 1
  272. #else
  273. #define APR_HAS_SENDFILE 0
  274. #define APR_HAS_USER 0
  275. #define APR_HAS_LARGE_FILES 0
  276. #define APR_HAS_XTHREAD_FILES 0
  277. #endif
  278. #define APR_HAS_OS_UUID 1
  279. /* Win32 cannot poll [just yet] on files/pipes.
  280. */
  281. #define APR_FILES_AS_SOCKETS 0
  282. /* This macro indicates whether or not EBCDIC is the native character set.
  283. */
  284. #define APR_CHARSET_EBCDIC 0
  285. /* Is the TCP_NODELAY socket option inherited from listening sockets?
  286. */
  287. #define APR_TCP_NODELAY_INHERITED 1
  288. /* Is the O_NONBLOCK flag inherited from listening sockets?
  289. */
  290. #define APR_O_NONBLOCK_INHERITED 1
  291. /* Typedefs that APR needs. */
  292. typedef unsigned char apr_byte_t;
  293. typedef short apr_int16_t;
  294. typedef unsigned short apr_uint16_t;
  295. typedef int apr_int32_t;
  296. typedef unsigned int apr_uint32_t;
  297. typedef __int64 apr_int64_t;
  298. typedef unsigned __int64 apr_uint64_t;
  299. typedef size_t apr_size_t;
  300. #if APR_HAVE_STDDEF_H
  301. typedef ptrdiff_t apr_ssize_t;
  302. #else
  303. typedef int apr_ssize_t;
  304. #endif
  305. #if APR_HAS_LARGE_FILES
  306. typedef __int64 apr_off_t;
  307. #else
  308. typedef int apr_off_t;
  309. #endif
  310. typedef int apr_socklen_t;
  311. /* Are we big endian? */
  312. /* XXX: Fatal assumption on Alpha platforms */
  313. #define APR_IS_BIGENDIAN 0
  314. #ifdef WIN64
  315. #define APR_SIZEOF_VOIDP 8
  316. #else
  317. #define APR_SIZEOF_VOIDP 4
  318. #endif
  319. /* XXX These simply don't belong here, perhaps in apr_portable.h
  320. * based on some APR_HAVE_PID/GID/UID?
  321. */
  322. typedef int pid_t;
  323. typedef int uid_t;
  324. typedef int gid_t;
  325. /* Mechanisms to properly type numeric literals */
  326. #define APR_INT64_C(val) (val##i64)
  327. #define APR_UINT64_C(val) (val##Ui64)
  328. #if APR_HAVE_IPV6
  329. /* Appears in later flavors, not the originals. */
  330. #ifndef in_addr6
  331. #define in6_addr in_addr6
  332. #endif
  333. #ifndef WS2TCPIP_INLINE
  334. #define IN6_IS_ADDR_V4MAPPED(a) \
  335. ( (*(const apr_uint64_t *)(const void *)(&(a)->s6_addr[0]) == 0) \
  336. && (*(const apr_uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff)))
  337. #endif
  338. #endif /* APR_HAS_IPV6 */
  339. /* Definitions that APR programs need to work properly. */
  340. /**
  341. * Thread callbacks from APR functions must be declared with APR_THREAD_FUNC,
  342. * so that they follow the platform's calling convention.
  343. * @example
  344. */
  345. /** void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data);
  346. */
  347. #define APR_THREAD_FUNC __stdcall
  348. #if defined(DOXYGEN) || !defined(WIN32)
  349. /**
  350. * The public APR functions are declared with APR_DECLARE(), so they may
  351. * use the most appropriate calling convention. Public APR functions with
  352. * variable arguments must use APR_DECLARE_NONSTD().
  353. *
  354. * @remark Both the declaration and implementations must use the same macro.
  355. * @example
  356. */
  357. /** APR_DECLARE(rettype) apr_func(args)
  358. * @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA
  359. * @remark Note that when APR compiles the library itself, it passes the
  360. * symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32)
  361. * to export public symbols from the dynamic library build.\n
  362. * The user must define the APR_DECLARE_STATIC when compiling to target
  363. * the static APR library on some platforms (e.g. Win32.) The public symbols
  364. * are neither exported nor imported when APR_DECLARE_STATIC is defined.\n
  365. * By default, compiling an application and including the APR public
  366. * headers, without defining APR_DECLARE_STATIC, will prepare the code to be
  367. * linked to the dynamic library.
  368. */
  369. #define APR_DECLARE(type) type
  370. /**
  371. * The public APR functions using variable arguments are declared with
  372. * APR_DECLARE_NONSTD(), as they must follow the C language calling convention.
  373. * @see APR_DECLARE @see APR_DECLARE_DATA
  374. * @remark Both the declaration and implementations must use the same macro.
  375. * @example
  376. */
  377. /** APR_DECLARE_NONSTD(rettype) apr_func(args, ...);
  378. */
  379. #define APR_DECLARE_NONSTD(type) type
  380. /**
  381. * The public APR variables are declared with AP_MODULE_DECLARE_DATA.
  382. * This assures the appropriate indirection is invoked at compile time.
  383. * @see APR_DECLARE @see APR_DECLARE_NONSTD
  384. * @remark Note that the declaration and implementations use different forms,
  385. * but both must include the macro.
  386. * @example
  387. */
  388. /** extern APR_DECLARE_DATA type apr_variable;\n
  389. * APR_DECLARE_DATA type apr_variable = value;
  390. */
  391. #define APR_DECLARE_DATA
  392. #elif defined(APR_DECLARE_STATIC)
  393. #define APR_DECLARE(type) type __stdcall
  394. #define APR_DECLARE_NONSTD(type) type __cdecl
  395. #define APR_DECLARE_DATA
  396. #elif defined(APR_DECLARE_EXPORT)
  397. #define APR_DECLARE(type) __declspec(dllexport) type __stdcall
  398. #define APR_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl
  399. #define APR_DECLARE_DATA __declspec(dllexport)
  400. #else
  401. #define APR_DECLARE(type) __declspec(dllimport) type __stdcall
  402. #define APR_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl
  403. #define APR_DECLARE_DATA __declspec(dllimport)
  404. #endif
  405. #ifdef WIN64
  406. #define APR_SSIZE_T_FMT "I64d"
  407. #define APR_SIZE_T_FMT "I64d"
  408. #else
  409. #define APR_SSIZE_T_FMT "d"
  410. #define APR_SIZE_T_FMT "d"
  411. #endif
  412. #if APR_HAS_LARGE_FILES
  413. #define APR_OFF_T_FMT "I64d"
  414. #else
  415. #define APR_OFF_T_FMT "d"
  416. #endif
  417. #define APR_PID_T_FMT "d"
  418. #define APR_INT64_T_FMT "I64d"
  419. #define APR_UINT64_T_FMT "I64u"
  420. #define APR_UINT64_T_HEX_FMT "I64x"
  421. /* Local machine definition for console and log output. */
  422. #define APR_EOL_STR "\r\n"
  423. /* No difference between PROC and GLOBAL mutex */
  424. #define APR_PROC_MUTEX_IS_GLOBAL 1
  425. typedef int apr_wait_t;
  426. /* struct iovec is needed to emulate Unix writev */
  427. struct iovec {
  428. char* iov_base;
  429. apr_size_t iov_len;
  430. };
  431. /* Nasty Win32 .h ommissions we really need */
  432. #define STDIN_FILENO 0
  433. #define STDOUT_FILENO 1
  434. #define STDERR_FILENO 2
  435. #if APR_HAS_UNICODE_FS
  436. /* An arbitrary size that is digestable. True max is a bit less than 32000 */
  437. #define APR_PATH_MAX 8192
  438. #else /* !APR_HAS_UNICODE_FS */
  439. #define APR_PATH_MAX MAX_PATH
  440. #endif
  441. /** @} */
  442. #ifdef __cplusplus
  443. }
  444. #endif
  445. /* Done with badly written headers
  446. */
  447. #if defined(_MSC_VER) && _MSC_VER >= 1200
  448. #pragma warning(pop)
  449. #endif
  450. /* Ignore Microsoft's interpretation of secure development
  451. * and their opinion of the POSIX standard string handling API
  452. */
  453. #if defined(_MSC_VER) && _MSC_VER >= 1400
  454. #ifndef _CRT_SECURE_NO_DEPRECATE
  455. #define _CRT_SECURE_NO_DEPRECATE
  456. #endif
  457. #pragma warning(disable: 4996)
  458. #endif
  459. #endif /* WIN32 */
  460. #endif /* APR_H */