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 #include "apr.h" /* configuration data */ 00018 /** 00019 * @file apr_want.h 00020 * @brief APR Standard Headers Support 00021 * 00022 * <PRE> 00023 * Features: 00024 * 00025 * APR_WANT_STRFUNC: strcmp, strcat, strcpy, etc 00026 * APR_WANT_MEMFUNC: memcmp, memcpy, etc 00027 * APR_WANT_STDIO: <stdio.h> and related bits 00028 * APR_WANT_IOVEC: struct iovec 00029 * APR_WANT_BYTEFUNC: htons, htonl, ntohl, ntohs 00030 * 00031 * Typical usage: 00032 * 00033 * #define APR_WANT_STRFUNC 00034 * #define APR_WANT_MEMFUNC 00035 * #include "apr_want.h" 00036 * 00037 * The appropriate headers will be included. 00038 * 00039 * Note: it is safe to use this in a header (it won't interfere with other 00040 * headers' or source files' use of apr_want.h) 00041 * </PRE> 00042 */ 00043 00044 /* --------------------------------------------------------------------- */ 00045 00046 #ifdef APR_WANT_STRFUNC 00047 00048 #if APR_HAVE_STRING_H 00049 #include <string.h> 00050 #endif 00051 #if APR_HAVE_STRINGS_H 00052 #include <strings.h> 00053 #endif 00054 00055 #undef APR_WANT_STRFUNC 00056 #endif 00057 00058 /* --------------------------------------------------------------------- */ 00059 00060 #ifdef APR_WANT_MEMFUNC 00061 00062 #if APR_HAVE_STRING_H 00063 #include <string.h> 00064 #endif 00065 00066 #undef APR_WANT_MEMFUNC 00067 #endif 00068 00069 /* --------------------------------------------------------------------- */ 00070 00071 #ifdef APR_WANT_STDIO 00072 00073 #if APR_HAVE_STDIO_H 00074 #include <stdio.h> 00075 #endif 00076 00077 #undef APR_WANT_STDIO 00078 #endif 00079 00080 /* --------------------------------------------------------------------- */ 00081 00082 #ifdef APR_WANT_IOVEC 00083 00084 #if APR_HAVE_IOVEC 00085 00086 #if APR_HAVE_SYS_UIO_H 00087 #include <sys/uio.h> 00088 #endif 00089 00090 #else 00091 00092 struct iovec 00093 { 00094 char *iov_base; 00095 size_t iov_len; 00096 }; 00097 00098 #endif 00099 00100 /* apr_want is included at several layers; redefining APR_HAVE_IOVEC 00101 * now to ensure that our struct is not introduced several times. 00102 */ 00103 #undef APR_HAVE_IOVEC 00104 #define APR_HAVE_IOVEC 1 00105 00106 #undef APR_WANT_IOVEC 00107 #endif 00108 00109 /* --------------------------------------------------------------------- */ 00110 00111 #ifdef APR_WANT_BYTEFUNC 00112 00113 /* Single Unix says they are in arpa/inet.h. Linux has them in 00114 * netinet/in.h. FreeBSD has them in arpa/inet.h but requires that 00115 * netinet/in.h be included first. 00116 */ 00117 #if APR_HAVE_NETINET_IN_H 00118 #include <netinet/in.h> 00119 #endif 00120 #if APR_HAVE_ARPA_INET_H 00121 #include <arpa/inet.h> 00122 #endif 00123 00124 #undef APR_WANT_BYTEFUNC 00125 #endif 00126 00127 /* --------------------------------------------------------------------- */