From: Greg Stein Date: Sat, 10 Feb 2001 14:04:21 +0000 (+0000) Subject: *) continued header revamping X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1a80c8fe6947af1989d0a405229f120a1e7aeed9;p=apache *) continued header revamping *) torch some headers (and some libs) from the autoconf stuff git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88061 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/cache/mod_file_cache.c b/modules/cache/mod_file_cache.c index 7e569699b7..6667f1ce7f 100644 --- a/modules/cache/mod_file_cache.c +++ b/modules/cache/mod_file_cache.c @@ -109,15 +109,16 @@ an extra stat() that's a waste. */ -#ifdef HAVE_STDIOP_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H +#include "apr.h" +#include "apr_mmap.h" +#include "apr_strings.h" + +#define APR_WANT_STRFUNC +#include "apr_want.h" + +#if APR_HAVE_SYS_TYPES_H #include #endif -#ifdef HAVE_STRING_H -#include -#endif #define CORE_PRIVATE @@ -127,8 +128,6 @@ #include "http_protocol.h" #include "http_request.h" #include "http_core.h" -#include "apr_mmap.h" -#include "apr_strings.h" module AP_MODULE_DECLARE_DATA file_cache_module; diff --git a/modules/filters/mod_include.c b/modules/filters/mod_include.c index 206960ebcf..c4d595855a 100644 --- a/modules/filters/mod_include.c +++ b/modules/filters/mod_include.c @@ -70,6 +70,10 @@ #include "apr_hash.h" #include "apr_user.h" #include "apr_lib.h" +#include "apr_optional.h" + +#define APR_WANT_STRFUNC +#include "apr_want.h" #define CORE_PRIVATE @@ -84,14 +88,7 @@ #include "http_main.h" #include "util_script.h" #include "http_core.h" -#include "apr_optional.h" #include "mod_include.h" -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_STRINGS_H -#include -#endif #include "util_ebcdic.h" module AP_MODULE_DECLARE_DATA includes_module; diff --git a/modules/generators/mod_cgi.c b/modules/generators/mod_cgi.c index e23c7032ec..057aeec0bd 100644 --- a/modules/generators/mod_cgi.c +++ b/modules/generators/mod_cgi.c @@ -72,10 +72,14 @@ #include "apr.h" #include "apr_strings.h" #include "apr_thread_proc.h" /* for RLIMIT stuff */ +#include "apr_optional.h" +#include "apr_buckets.h" + +#define APR_WANT_STRFUNC +#include "apr_want.h" #define CORE_PRIVATE -#include "apr_buckets.h" #include "util_filter.h" #include "ap_config.h" #include "httpd.h" @@ -87,14 +91,8 @@ #include "http_log.h" #include "util_script.h" #include "ap_mpm.h" -#include "apr_optional.h" #include "../filters/mod_include.h" -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_STRINGS_H -#include -#endif + module AP_MODULE_DECLARE_DATA cgi_module; diff --git a/modules/generators/mod_cgid.c b/modules/generators/mod_cgid.c index 8ae35df02c..9b530953b4 100644 --- a/modules/generators/mod_cgid.c +++ b/modules/generators/mod_cgid.c @@ -69,16 +69,29 @@ * they fail. */ - - -#define CORE_PRIVATE - #include "apr_lib.h" #include "apr_strings.h" #include "apr_general.h" #include "apr_file_io.h" #include "apr_portable.h" #include "apr_buckets.h" +#include "apr_optional.h" + +#define APR_WANT_STRFUNC +#include "apr_want.h" + +#if APR_HAVE_SYS_SOCKET_H +#include +#endif +#if APR_HAVE_UNISTD_H +#include +#endif +#if APR_HAVE_SYS_TYPES_H +#include +#endif + +#define CORE_PRIVATE + #include "util_filter.h" #include "httpd.h" #include "http_config.h" @@ -91,20 +104,12 @@ #include "ap_mpm.h" #include "unixd.h" #include "mod_suexec.h" -#include "apr_optional.h" #include "../filters/mod_include.h" + +/* ### should be tossed in favor of APR */ #include -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_STRINGS_H -#include -#endif #include /* for sockaddr_un */ -#include + module AP_MODULE_DECLARE_DATA cgid_module; diff --git a/modules/http/http_core.c b/modules/http/http_core.c index 5f3956b9d7..6ad101bca5 100644 --- a/modules/http/http_core.c +++ b/modules/http/http_core.c @@ -87,13 +87,6 @@ #include "mod_core.h" -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif - /* LimitXMLRequestBody handling */ #define AP_LIMIT_UNSET ((long) -1) diff --git a/modules/http/mod_mime.c b/modules/http/mod_mime.c index f2ed64957c..a8d60b9f68 100644 --- a/modules/http/mod_mime.c +++ b/modules/http/mod_mime.c @@ -63,18 +63,19 @@ * */ -#define MIME_PRIVATE - +#include "apr.h" #include "apr_strings.h" #include "apr_lib.h" + +#define APR_WANT_STRFUNC +#include "apr_want.h" + #include "ap_config.h" #include "httpd.h" #include "http_config.h" #include "http_log.h" #include "http_request.h" -#ifdef HAVE_STRING_H -#include -#endif + /* XXXX - fix me / EBCDIC * there was a cludge here which would use its diff --git a/modules/mappers/mod_speling.c b/modules/mappers/mod_speling.c index 3d8b39053e..d433949b5c 100644 --- a/modules/mappers/mod_speling.c +++ b/modules/mappers/mod_speling.c @@ -56,6 +56,13 @@ * University of Illinois, Urbana-Champaign. */ +#include "apr.h" +#include "apr_file_io.h" +#include "apr_strings.h" + +#define APR_WANT_STRFUNC +#include "apr_want.h" + #define WANT_BASENAME_MATCH #include "httpd.h" @@ -63,12 +70,6 @@ #include "http_config.h" #include "http_request.h" #include "http_log.h" -#include "apr_file_io.h" -#include "apr_strings.h" - -#ifdef HAVE_STRINGS_H -#include -#endif /* mod_speling.c - by Alexei Kosut June, 1996 * diff --git a/modules/mappers/mod_userdir.c b/modules/mappers/mod_userdir.c index 3cc49f5d87..d7c7299cf1 100644 --- a/modules/mappers/mod_userdir.c +++ b/modules/mappers/mod_userdir.c @@ -91,25 +91,29 @@ * disabled, except those explicitly turned on with the "enabled" keyword. */ -#if !defined(WIN32) && !defined(OS2) && !defined(BEOS) -#define HAVE_UNIX_SUEXEC -#endif - #include "apr_strings.h" #include "apr_user.h" + +#define APR_WANT_STRFUNC +#include "apr_want.h" + +#if APR_HAVE_UNISTD_H +#include +#endif + #include "ap_config.h" #include "httpd.h" #include "http_config.h" #include "http_request.h" + +#if !defined(WIN32) && !defined(OS2) && !defined(BEOS) +#define HAVE_UNIX_SUEXEC +#endif + #ifdef HAVE_UNIX_SUEXEC #include "unixd.h" /* Contains the suexec_identity hook used on Unix */ #endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_STRINGS_H -#include -#endif + /* The default directory in user's home dir */ #ifndef DEFAULT_USER_DIR diff --git a/modules/mappers/mod_vhost_alias.c b/modules/mappers/mod_vhost_alias.c index 2b15a3bb4b..985d6d49a6 100644 --- a/modules/mappers/mod_vhost_alias.c +++ b/modules/mappers/mod_vhost_alias.c @@ -75,16 +75,18 @@ * both written by James Grinter . */ +#include "apr.h" #include "apr_strings.h" #include "apr_hooks.h" + +#define APR_WANT_STRFUNC +#include "apr_want.h" + #include "httpd.h" #include "http_config.h" #include "http_core.h" #include "http_request.h" /* for ap_hook_translate_name */ -#ifdef HAVE_STRINGS_H -#include -#endif module AP_MODULE_DECLARE_DATA vhost_alias_module; diff --git a/modules/metadata/mod_cern_meta.c b/modules/metadata/mod_cern_meta.c index 21f7ca4201..caf2762942 100644 --- a/modules/metadata/mod_cern_meta.c +++ b/modules/metadata/mod_cern_meta.c @@ -149,20 +149,23 @@ * 29.Jun.96 All directives made per-directory. */ +#include "apr.h" +#include "apr_strings.h" + +#define APR_WANT_STRFUNC +#include "apr_want.h" + +#if APR_HAVE_SYS_TYPES_H +#include +#endif + #include "ap_config.h" #include "httpd.h" #include "http_config.h" #include "util_script.h" #include "http_log.h" #include "http_request.h" -#include "apr_strings.h" -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_STRINGS_H -#include -#endif #define DIR_CMD_PERMS OR_INDEXES diff --git a/modules/metadata/mod_env.c b/modules/metadata/mod_env.c index 21b8301bd3..3b1907ded2 100644 --- a/modules/metadata/mod_env.c +++ b/modules/metadata/mod_env.c @@ -99,14 +99,18 @@ * *** older versions of the module. *** */ +#include "apr.h" #include "apr_strings.h" + +#if APR_HAVE_STDLIB_H +#include +#endif + #include "ap_config.h" #include "httpd.h" #include "http_config.h" #include "http_request.h" -#ifdef HAVE_STDLIB_H -#include -#endif + typedef struct { apr_table_t *vars; diff --git a/modules/metadata/mod_expires.c b/modules/metadata/mod_expires.c index b0e72aa53b..3c5c972c53 100644 --- a/modules/metadata/mod_expires.c +++ b/modules/metadata/mod_expires.c @@ -193,18 +193,18 @@ * Hi, welcome to the internet. */ +#include "apr.h" +#include "apr_strings.h" +#include "apr_lib.h" + +#define APR_WANT_STRFUNC +#include "apr_want.h" + #include "ap_config.h" -#ifdef HAVE_CTYPE_H -#include -#endif -#ifdef HAVE_STRINGS_H -#include -#endif #include "httpd.h" #include "http_config.h" #include "http_log.h" #include "http_request.h" -#include "apr_strings.h" typedef struct { int active; diff --git a/modules/metadata/mod_headers.c b/modules/metadata/mod_headers.c index 9c3c9ea49b..009d206f23 100644 --- a/modules/metadata/mod_headers.c +++ b/modules/metadata/mod_headers.c @@ -102,14 +102,16 @@ * */ +#include "apr.h" #include "apr_strings.h" + +#define APR_WANT_STRFUNC +#include "apr_want.h" + #include "httpd.h" #include "http_config.h" #include "http_request.h" -#ifdef HAVE_STRINGS_H -#include -#endif typedef enum { hdr_add = 'a', /* add header (could mean multiple hdrs) */ diff --git a/modules/metadata/mod_mime_magic.c b/modules/metadata/mod_mime_magic.c index 4d1404f704..67eb4409e2 100644 --- a/modules/metadata/mod_mime_magic.c +++ b/modules/metadata/mod_mime_magic.c @@ -124,7 +124,13 @@ * */ +#include "apr.h" #include "apr_strings.h" + +#if APR_HAVE_UNISTD_H +#include +#endif + #include "ap_config.h" #include "httpd.h" #include "http_config.h" @@ -133,9 +139,8 @@ #include "http_log.h" #include "http_protocol.h" #include "util_script.h" -#ifdef HAVE_UNISTD_H -#include -#endif + +/* ### this isn't set by configure? does anybody set this? */ #ifdef HAVE_UTIME_H #include #endif diff --git a/modules/metadata/mod_setenvif.c b/modules/metadata/mod_setenvif.c index 5914db504e..b09c6ac148 100644 --- a/modules/metadata/mod_setenvif.c +++ b/modules/metadata/mod_setenvif.c @@ -115,16 +115,19 @@ * SetEnvIf remote_addr (127.0.0.1|192.168.10.) LOCAL */ +#include "apr.h" #include "apr_strings.h" + +#define APR_WANT_STRFUNC +#include "apr_want.h" + #include "ap_config.h" #include "httpd.h" #include "http_config.h" #include "http_core.h" #include "http_log.h" #include "http_protocol.h" -#ifdef HAVE_STRINGS_H -#include -#endif + enum special { SPECIAL_NOT, diff --git a/modules/metadata/mod_unique_id.c b/modules/metadata/mod_unique_id.c index 31eff29dbe..385cf8a2d1 100644 --- a/modules/metadata/mod_unique_id.c +++ b/modules/metadata/mod_unique_id.c @@ -63,25 +63,13 @@ * UUencoding modified by: Alvaro Martinez Echevarria */ +#include "apr_general.h" /* for XtOffsetOf */ + #include "httpd.h" #include "http_config.h" #include "http_log.h" #include "http_protocol.h" /* for ap_hook_post_read_request */ -#include "apr_general.h" /* for XtOffsetOf */ - -#ifdef HAVE_NETDB_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif typedef struct { unsigned int stamp; diff --git a/modules/metadata/mod_usertrack.c b/modules/metadata/mod_usertrack.c index 5f3bcf193f..d9e71975e2 100644 --- a/modules/metadata/mod_usertrack.c +++ b/modules/metadata/mod_usertrack.c @@ -100,15 +100,17 @@ * This file replaces mod_cookies.c */ +#include "apr.h" +#include "apr_strings.h" + +#define APR_WANT_STRFUNC +#include "apr_want.h" + #include "httpd.h" #include "http_config.h" #include "http_core.h" #include "http_request.h" -#include "apr_strings.h" -#ifdef HAVE_STRINGS_H -#include -#endif module AP_MODULE_DECLARE_DATA usertrack_module; diff --git a/modules/proxy/mod_proxy.h b/modules/proxy/mod_proxy.h index 6588c32b72..b1369dd10a 100644 --- a/modules/proxy/mod_proxy.h +++ b/modules/proxy/mod_proxy.h @@ -88,30 +88,28 @@ #define TESTING 0 #undef EXPLAIN -#include "httpd.h" -#include "http_config.h" -#include "http_protocol.h" -#include "proxy_cache.h" - #include "apr_compat.h" #include "apr_strings.h" -#ifdef HAVE_NETDB_H +#if APR_HAVE_NETDB_H #include #endif - -#ifdef HAVE_SYS_SOCKET_H +#if APR_HAVE_SYS_SOCKET_H #include #endif - -#ifdef HAVE_NETINET_IN_H +#if APR_HAVE_NETINET_IN_H #include #endif - -#ifdef HAVE_ARPA_INET_H +#if APR_HAVE_ARPA_INET_H #include #endif +#include "httpd.h" +#include "http_config.h" +#include "http_protocol.h" +#include "proxy_cache.h" + + extern module AP_MODULE_DECLARE_DATA proxy_module; diff --git a/server/config.c b/server/config.c index 2fe88af9e9..5a417fc399 100644 --- a/server/config.c +++ b/server/config.c @@ -76,9 +76,9 @@ #include "apr_portable.h" #include "apr_file_io.h" -#if APR_HAVE_STDIO_H -#include -#endif +#define APR_WANT_STDIO +#define APR_WANT_STRFUNC +#include "apr_want.h" #define CORE_PRIVATE @@ -92,12 +92,7 @@ #include "http_main.h" #include "http_vhost.h" #include "util_cfgtree.h" -#ifdef HAVE_ARPA_INET_H -#include -#endif -#ifdef HAVE_STRINGS_H -#include -#endif + AP_DECLARE_DATA const char *ap_server_argv0; diff --git a/server/config.m4 b/server/config.m4 index 479fbeafff..66b6ee3b76 100644 --- a/server/config.m4 +++ b/server/config.m4 @@ -1,7 +1,5 @@ dnl ## Check for libraries -AC_DEFUN(APACHE_DEFINE_HAVE_CRYPT, [ -]) AC_CHECK_LIB(nsl, gethostname, [ AC_ADD_LIBRARY(nsl) ], []) @@ -11,29 +9,13 @@ AC_CHECK_LIB(socket, socket, [ AC_CHECK_LIB(nsl, gethostbyaddr, [ AC_ADD_LIBRARY(nsl) ], []) -AC_CHECK_LIB(crypt, crypt, [ - AC_ADD_LIBRARY(crypt) -], [ - AC_CHECK_LIB(ufc, crypt, [ - AC_ADD_LIBRARY(ufc) - ], []) -]) dnl ## Check for header files -AC_HEADER_STDC -AC_CHECK_HEADERS( -bstring.h \ -crypt.h \ -unistd.h \ -sys/resource.h \ -sys/select.h \ -sys/processor.h \ -) +AC_CHECK_HEADERS(bstring.h unistd.h) dnl ## Check for typedefs, structures, and compiler characteristics. -AC_TYPE_RLIM_T AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff, [AC_TRY_COMPILE([#include #include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_gmtoff;], @@ -46,9 +28,7 @@ fi dnl ## Check for library functions -AC_CHECK_FUNCS( -syslog \ -) +AC_CHECK_FUNCS(syslog) dnl Obsolete scoreboard code uses this. AC_CHECK_HEADERS(sys/times.h) diff --git a/server/connection.c b/server/connection.c index 0a0b380d28..15c7458475 100644 --- a/server/connection.c +++ b/server/connection.c @@ -56,9 +56,11 @@ * University of Illinois, Urbana-Champaign. */ +#include "apr.h" +#include "apr_strings.h" + #define CORE_PRIVATE #include "ap_config.h" -#include "apr_strings.h" #include "httpd.h" #include "http_connection.h" #include "http_request.h" @@ -71,13 +73,6 @@ #include "http_log.h" #include "util_filter.h" -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif - APR_HOOK_STRUCT( APR_HOOK_LINK(pre_connection) APR_HOOK_LINK(process_connection) diff --git a/server/listen.c b/server/listen.c index 3617e08da3..46aafe083a 100644 --- a/server/listen.c +++ b/server/listen.c @@ -57,19 +57,20 @@ */ #include "apr_network_io.h" +#include "apr_strings.h" + +#define APR_WANT_STRFUNC +#include "apr_want.h" #define CORE_PRIVATE #include "ap_config.h" #include "httpd.h" #include "http_config.h" #include "ap_listen.h" -#include "apr_strings.h" #include "http_log.h" #include "mpm.h" #include "mpm_common.h" -#ifdef HAVE_STRING_H -#include -#endif + ap_listen_rec *ap_listeners; #if APR_HAVE_IPV6 diff --git a/server/mpm/mpmt_pthread/mpmt_pthread.c b/server/mpm/mpmt_pthread/mpmt_pthread.c index 0211ad46eb..1d3885d548 100644 --- a/server/mpm/mpmt_pthread/mpmt_pthread.c +++ b/server/mpm/mpmt_pthread/mpmt_pthread.c @@ -56,12 +56,21 @@ * University of Illinois, Urbana-Champaign. */ -#define CORE_PRIVATE - +#include "apr.h" #include "apr_portable.h" #include "apr_strings.h" #include "apr_file_io.h" #include "apr_thread_proc.h" + +#if APR_HAVE_SYS_SOCKET_H +#include +#endif +#if APR_HAVE_SYS_WAIT_H +#include +#endif + +#define CORE_PRIVATE + #include "ap_config.h" #include "httpd.h" #include "http_main.h" @@ -78,12 +87,7 @@ #ifdef HAVE_NETINET_TCP_H #include #endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_SYS_WAIT_H -#include -#endif + #include #include diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c index 739bc58380..d2d9bba7a6 100644 --- a/server/mpm/prefork/prefork.c +++ b/server/mpm/prefork/prefork.c @@ -89,14 +89,15 @@ #include "apr_strings.h" #include "apr_thread_proc.h" -#if APR_HAVE_STDIO_H -#include /* for perror() */ -#endif -#if APR_HAVE_SYS_WAIT_H -#include +#define APR_WANT_STDIO +#define APR_WANT_STRFUNC +#include "apr_want.h" + +#if APR_HAVE_UNISTD_H +#include #endif -#if APR_HAVE_SYS_SOCKET_H -#include +#if APR_HAVE_SYS_TYPES_H +#include #endif #define CORE_PRIVATE @@ -115,22 +116,10 @@ #include "mpm_common.h" #include "ap_listen.h" #include "ap_mmn.h" -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_NETINET_TCP_H -#include /* for TCP_NODELAY */ -#endif #ifdef HAVE_BSTRING_H #include /* for IRIX, FD_SET calls bzero() */ #endif -#ifdef HAVE_STRINGS_H -#include -#endif #ifdef HAVE_TIME_H #include #endif diff --git a/server/util_filter.c b/server/util_filter.c index 8a21b755a1..c4fef0de5e 100644 --- a/server/util_filter.c +++ b/server/util_filter.c @@ -52,14 +52,13 @@ * . */ +#define APR_WANT_STRFUNC +#include "apr_want.h" + #include "httpd.h" #include "http_log.h" #include "util_filter.h" -#ifdef HAVE_STRINGS_H -#include -#endif - /* ### make this visible for direct manipulation? * ### use a hash table */ diff --git a/server/util_uri.c b/server/util_uri.c index cf4aa6b22f..aa360432ce 100644 --- a/server/util_uri.c +++ b/server/util_uri.c @@ -61,20 +61,16 @@ * */ -#include "ap_config.h" +#include "apr.h" #include "apr_strings.h" + +#define APR_WANT_STRFUNC +#include "apr_want.h" + +#include "ap_config.h" #include "httpd.h" #include "http_log.h" #include "util_uri.h" -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_STRINGS_H -#include -#endif -#ifdef HAVE_NETDB_H -#include -#endif /* Some WWW schemes and their default ports; this is basically /etc/services */ /* This will become global when the protocol abstraction comes */