apr_want.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /* Licensed to the Apache Software Foundation (ASF) under one or more
  2. * contributor license agreements. See the NOTICE file distributed with
  3. * this work for additional information regarding copyright ownership.
  4. * The ASF licenses this file to You under the Apache License, Version 2.0
  5. * (the "License"); you may not use this file except in compliance with
  6. * the License. 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. #include "apr.h" /* configuration data */
  17. /**
  18. * @file apr_want.h
  19. * @brief APR Standard Headers Support
  20. *
  21. * <PRE>
  22. * Features:
  23. *
  24. * APR_WANT_STRFUNC: strcmp, strcat, strcpy, etc
  25. * APR_WANT_MEMFUNC: memcmp, memcpy, etc
  26. * APR_WANT_STDIO: <stdio.h> and related bits
  27. * APR_WANT_IOVEC: struct iovec
  28. * APR_WANT_BYTEFUNC: htons, htonl, ntohl, ntohs
  29. *
  30. * Typical usage:
  31. *
  32. * \#define APR_WANT_STRFUNC
  33. * \#define APR_WANT_MEMFUNC
  34. * \#include "apr_want.h"
  35. *
  36. * The appropriate headers will be included.
  37. *
  38. * Note: it is safe to use this in a header (it won't interfere with other
  39. * headers' or source files' use of apr_want.h)
  40. * </PRE>
  41. */
  42. /* --------------------------------------------------------------------- */
  43. #ifdef APR_WANT_STRFUNC
  44. #if APR_HAVE_STRING_H
  45. #include <string.h>
  46. #endif
  47. #if APR_HAVE_STRINGS_H
  48. #include <strings.h>
  49. #endif
  50. #undef APR_WANT_STRFUNC
  51. #endif
  52. /* --------------------------------------------------------------------- */
  53. #ifdef APR_WANT_MEMFUNC
  54. #if APR_HAVE_STRING_H
  55. #include <string.h>
  56. #endif
  57. #undef APR_WANT_MEMFUNC
  58. #endif
  59. /* --------------------------------------------------------------------- */
  60. #ifdef APR_WANT_STDIO
  61. #if APR_HAVE_STDIO_H
  62. #include <stdio.h>
  63. #endif
  64. #undef APR_WANT_STDIO
  65. #endif
  66. /* --------------------------------------------------------------------- */
  67. #ifdef APR_WANT_IOVEC
  68. #if APR_HAVE_IOVEC
  69. #if APR_HAVE_SYS_UIO_H
  70. #include <sys/uio.h>
  71. #endif
  72. #else
  73. #ifndef APR_IOVEC_DEFINED
  74. #define APR_IOVEC_DEFINED
  75. struct iovec
  76. {
  77. void *iov_base;
  78. size_t iov_len;
  79. };
  80. #endif /* !APR_IOVEC_DEFINED */
  81. #endif /* APR_HAVE_IOVEC */
  82. #undef APR_WANT_IOVEC
  83. #endif
  84. /* --------------------------------------------------------------------- */
  85. #ifdef APR_WANT_BYTEFUNC
  86. /* Single Unix says they are in arpa/inet.h. Linux has them in
  87. * netinet/in.h. FreeBSD has them in arpa/inet.h but requires that
  88. * netinet/in.h be included first.
  89. */
  90. #if APR_HAVE_NETINET_IN_H
  91. #include <netinet/in.h>
  92. #endif
  93. #if APR_HAVE_ARPA_INET_H
  94. #include <arpa/inet.h>
  95. #endif
  96. #undef APR_WANT_BYTEFUNC
  97. #endif
  98. /* --------------------------------------------------------------------- */