]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Compat: Shuffle final squid.h hacks into libcompat
authorAmos Jeffries <amosjeffries@squid-cache.org>
Thu, 25 Mar 2010 08:27:46 +0000 (02:27 -0600)
committerAmos Jeffries <amosjeffries@squid-cache.org>
Thu, 25 Mar 2010 08:27:46 +0000 (02:27 -0600)
35 files changed:
compat/compat_shared.h
compat/os/solaris.h
configure.in
helpers/basic_auth/RADIUS/basic_radius_auth.cc
helpers/basic_auth/RADIUS/radius-util.cc
helpers/negotiate_auth/kerberos/negotiate_kerberos_auth.cc
helpers/negotiate_auth/kerberos/negotiate_kerberos_auth_test.cc
helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.h
include/profiling.h
include/snmp_api.h
include/strnstr.h
include/util.h
lib/iso3307.c
lib/rfc1035.c
lib/rfc1123.c
lib/rfc3596.c
lib/xusleep.c
src/PingData.h
src/SquidTime.h
src/dnsserver.cc
src/fde.h
src/fs/coss/store_dir_coss.cc
src/fs/ufs/store_dir_ufs.cc
src/fs/ufs/ufscommon.cc
src/fs/ufs/ufscommon.h
src/log/File.h
src/main.cc
src/structs.h
test-suite/hash.c
test-suite/membanger.c
test-suite/pconn-banger.c
test-suite/tcp-banger2.c
test-suite/tcp-banger3.c
test-suite/waiter.c
tools/cachemgr.cc

index 753396e38e0adf66bdd2c2bdca1736680229c778..92ac7b116a359f13bd57ec1fbaa5d601dc24c79f 100644 (file)
@@ -194,4 +194,15 @@ extern "C" {
 #endif
 #endif
 
+
+/* Apparently the IPPROTO_ are not always defined either... */ 
+/* TODO: find out what OS require these and define specifically for them. */
+#ifndef IPPROTO_UDP
+#define IPPROTO_UDP 0
+#endif
+#ifndef IPPROTO_TCP
+#define IPPROTO_TCP 0  
+#endif
+
+
 #endif /* _SQUID_COMPAT_SHARED_H */
index e159e8545fe5b0b1de8788b0425f7e7bf3fa0ee2..4bf7f29222453f703cdab42ece614c5eb0629dc8 100644 (file)
@@ -30,7 +30,9 @@ typedef union {
 
 /**
  * prototypes for system function missing from system includes
+ * NP: sys/resource.h and sys/time.h are apparently order-dependant.
  */
+#include <sys/time.h>
 #include <sys/resource.h>
 SQUIDCEXTERN int getrusage(int, struct rusage *);
 
index 6e2edbc213ff49a420b627ec3a822b85effae581..13ce8cc249711196b1195901941f5c7e8ca9ea85 100644 (file)
@@ -4037,6 +4037,14 @@ if test "$ac_cv_needs_sys_errlist" = "yes" ; then
   AC_DEFINE(NEED_SYS_ERRLIST,1,[If we need to declare sys_errlist[] as external])
 fi
 
+dnl Hurd does not supply MAXPATHLEN. we may need to define it outselves.
+dnl Other system define it in system headers
+AC_CHECK_HEADERS([sys/param.h])
+AC_MSG_CHECKING(for MAXPATHLEN)
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/param.h>]],[[int i = MAXPATHLEN;]])],[AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)
+    AC_DEFINE(MAXPATHLEN,256,[If MAXPATHLEN has not been defined])])
+
+
 dnl Not cached since people are likely to change this
 AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
 AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern int _dns_ttl_;]], [[return _dns_ttl_;]])],[AC_MSG_RESULT(yes)
index 0320c9321db2c8318bf752f407cada2cea2e6fd7..51fc29c50a7c62dc9d7158f42911debdecf465fc 100644 (file)
 #include       "radius.h"
 #include       "radius-util.h"
 
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
 #if HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
 #if HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
@@ -86,9 +80,6 @@
 #if HAVE_PWD_H
 #include <pwd.h>
 #endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
 #if HAVE_TIME_H
 #include <time.h>
 #endif
index 4388dcc96e9740f53c893869fe91840444ec3ea8..d040766be6406c434bd3d766c49f85a057bf7576 100644 (file)
@@ -38,15 +38,9 @@ char util_sccsid[] =
 
 #include       "config.h"
 
-#if HAVE_SYS_TYES_H
-#include       <sys/types.h>
-#endif
 #if HAVE_SYS_SOCKET_H
 #include       <sys/socket.h>
 #endif
-#if HAVE_SYS_TIME_H
-#include       <sys/time.h>
-#endif
 #if HAVE_NETINET_IN_H
 #include       <netinet/in.h>
 #endif
@@ -54,9 +48,6 @@ char util_sccsid[] =
 #if HAVE_STDIO_H
 #include       <stdio.h>
 #endif
-#if HAVE_STDLIB_H
-#include       <stdlib.h>
-#endif
 #if HAVE_NETDB_H
 #include       <netdb.h>
 #endif
index 5f84ea41f8cd0d95cd8def8fadc3e23ebd3de2b9..015f894db9d0466c5d5fdd41ccd5f93fa024103c 100644 (file)
@@ -41,9 +41,6 @@
 #if HAVE_STDOI_H
 #include <stdio.h>
 #endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
 #if HAVE_NETDB_H
 #include <netdb.h>
 #endif
@@ -53,9 +50,6 @@
 #if HAVE_TIME_H
 #include <time.h>
 #endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
 
 #include "util.h"
 #include "base64.h"
index f15ebb515ce0d72f11f3408e6f35c3049537784a..56c75252cb6c2a97709df22cc7a3f64333207aac 100644 (file)
@@ -35,9 +35,6 @@
 #if HAVE_STDIO_H
 #include <stdio.h>
 #endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
 #if HAVE_NETDB_H
 #include <netdb.h>
 #endif
@@ -47,9 +44,6 @@
 #if HAVE_TIME_H
 #include <time.h>
 #endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
 #if HAVE_ERRNO_H
 #include <errno.h>
 #endif
index bfb296760c9f76eed2f2821eae4cd9abd12f94ea..52b08e96379ab6b238f4a693b8b86b39965693fd 100644 (file)
@@ -25,9 +25,6 @@
 #if HAVE_TIME_H
 #include <time.h>
 #endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
 
 /************* CONFIGURATION ***************/
 /*
index bd9d489c1396bf9d48f9a07e5f036bbf3e22654a..730303144c36d03e804dbc62960d08e9e2b633d7 100644 (file)
@@ -13,8 +13,6 @@ class CacheManager;
 
 #if !_SQUID_SOLARIS_
 typedef int64_t  hrtime_t;
-#else
-#include <sys/time.h>
 #endif
 
 #if defined(__GNUC__) && ( defined(__i386) || defined(__i386__) )
index 7614c4fd0698ece052919d70657e0e7212ca1f5c..da69dbfd9ec1640b4789e5d7acb03ac7615794db 100644 (file)
@@ -1,14 +1,7 @@
-/*
- * $Id$
- */
-
 #ifndef SQUID_SNMP_API_H
 #define SQUID_SNMP_API_H
 
 #include "config.h"
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
 
 /***********************************************************
        Copyright 1989 by Carnegie Mellon University
index bb3dc01ffc4fa32c9e5eca20b96a2db04466bff4..63724a19970e5465e3a9eeac586eba3c709ef417 100644 (file)
@@ -1,11 +1,8 @@
-/*
- * Squid VCS $Id$
- */
 #include "config.h"
 
 #if HAVE_STRNSTR
 
-/* Is strnstr exists and is usablewe do so. */
+/* Is strnstr exists and is usable we do so. */
 #define squid_strnstr(a,b,c)   strnstr(a,b,c)
 
 #else /* not HAVE_STRNSTR */
index f02e042435da153bea53e021820816f8bc04cf9c..cebd0594bde87febd9da53aec5cf65c1b43fd5f9 100644 (file)
 #if HAVE_TIME_H
 #include <time.h>
 #endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
 #if HAVE_ARPA_INET_H
 #include <arpa/inet.h>
 #endif
 
-#if defined(_SQUID_FREEBSD_)
-#define _etext etext
-#endif
-
 SQUIDCEXTERN const char *mkhttpdlogtime(const time_t *);
 SQUIDCEXTERN const char *mkrfc1123(time_t);
 SQUIDCEXTERN char *uudecode(const char *);
index c7bc33d94d7662569c63525d8a88ac3f5120a761..1d1491bd61d9f85914e79b69773a6622889bc0bd 100644 (file)
@@ -1,7 +1,3 @@
-/*
- * $Id$
- */
-
 #include "config.h"
 #include "util.h"
 
 #if HAVE_CTYPE_H
 #include <ctype.h>
 #endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
 #if HAVE_TIME_H
 #include <time.h>
 #endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
 
 
 #define ASCII_DIGIT(c) ((c)-48)
index fb5635d21c870f083972767d0dae794b5c7db494..e960855070b2e44a7188d42ba35df48aafdad2f8 100644 (file)
@@ -1,4 +1,3 @@
-
 /*
  * $Id$
  *
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
 #if HAVE_MEMORY_H
 #include <memory.h>
 #endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
 #if HAVE_ASSERT_H
 #include <assert.h>
 #endif
@@ -742,7 +735,6 @@ rfc1035SetQueryID(char *buf, unsigned short qid)
 
 #if DRIVER
 #include <sys/socket.h>
-#include <sys/time.h>
 int
 main(int argc, char *argv[])
 {
index dd98d360ae007b4c5ccb370a1163e03be1be168f..7350e3d886680c400fb4158aa54f456a561e4f1a 100644 (file)
@@ -1,4 +1,3 @@
-
 /*
  * $Id$
  *
 #if HAVE_STDIO_H
 #include <stdio.h>
 #endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
 #if HAVE_STRING_H
 #include <string.h>
 #endif
 #if HAVE_CTYPE_H
 #include <ctype.h>
 #endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
 #if HAVE_TIME_H
 #include <time.h>
 #endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-
 #include "util.h"
 
 #define RFC850_STRFTIME "%A, %d-%b-%y %H:%M:%S GMT"
index ab93de9fc8224e6ba9eb9681ddae64c0faffe381..fba04e311e33fe82a8e6468cbed855a8229f36e3 100644 (file)
@@ -1,4 +1,3 @@
-
 /*
  * $Id$
  *
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
 #if HAVE_MEMORY_H
 #include <memory.h>
 #endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
 #if HAVE_ASSERT_H
 #include <assert.h>
 #endif
@@ -210,7 +203,6 @@ rfc3596BuildPTRQuery6(const struct in6_addr addr, char *buf, size_t sz, unsigned
 #  undef main(a,b)
 
 #include <sys/socket.h>
-#include <sys/time.h>
 
 int
 main(int argc, char *argv[])
index 91d88dedc5fd7343c90b734c7a70e88d219372fd..8de597ab86534dfb0a3aa31a4f71c4a9a3375c20 100644 (file)
@@ -5,9 +5,6 @@
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
 
 /**
  * xusleep, as usleep but accepts longer pauses
index bca2e1c859f04108485eab78b4ad20e3654c6aee..50caacf0113c914bc0d37e86b663e24d5859c260 100644 (file)
 
 #include "config.h"
 
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-
 class ping_data
 {
 
index b9a3d43f40dd742b427a5b7037e8e2a49955b5e3..411bcfd072ca1e5c3793c29a7b3e15e64477034f 100644 (file)
 #if HAVE_TIME_H
 #include <time.h>
 #endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-
+/* NP: sys/time.h is provided by libcompat */
 
 /* globals for accessing time */
 extern struct timeval current_time;
index a5a40b2df758e7a101bd6a780aec918d3afb641d..441815d49856694ca490edd31c155ff82b135e69 100644 (file)
 #if HAVE_SYS_PARAM_H
 #include <sys/param.h>
 #endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#if HAVE_SYS_RESOURCE_H
-#include <sys/resource.h>      /* needs sys/time.h above it */
-#endif
 #if HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
index a0b903d1a3d43ebf4c2c9cc1566575757c311ba1..a56148eab7acc05e9a8f754ec592aa0c6119d0df 100644 (file)
--- a/src/fde.h
+++ b/src/fde.h
@@ -128,4 +128,7 @@ private:
 
 SQUIDCEXTERN int fdNFree(void);
 
+#define FD_READ_METHOD(fd, buf, len) (*fd_table[fd].read_method)(fd, buf, len)
+#define FD_WRITE_METHOD(fd, buf, len) (*fd_table[fd].write_method)(fd, buf, len)
+
 #endif /* SQUID_FDE_H */
index 959334d0a1cbd5cfb0efe1b064991fe04b1c8154..bda27c7f056ca5aa5caa36f632f6c25f710068d2 100644 (file)
@@ -91,13 +91,13 @@ static FILE *storeCossDirOpenTmpSwapLog(CossSwapDir *, int *, int *);
 static char *
 storeCossDirSwapLogFile(SwapDir * sd, const char *ext)
 {
-    LOCAL_ARRAY(char, path, SQUID_MAXPATHLEN);
-    LOCAL_ARRAY(char, pathtmp, SQUID_MAXPATHLEN);
+    LOCAL_ARRAY(char, path, MAXPATHLEN);
+    LOCAL_ARRAY(char, pathtmp, MAXPATHLEN);
     LOCAL_ARRAY(char, digit, 32);
     char *pathtmp2;
 
     if (Config.Log.swap) {
-        xstrncpy(pathtmp, sd->path, SQUID_MAXPATHLEN - 64);
+        xstrncpy(pathtmp, sd->path, MAXPATHLEN - 64);
         pathtmp2 = pathtmp;
 
         while ((pathtmp2 = strchr(pathtmp2, '/')) != NULL)
@@ -107,15 +107,15 @@ storeCossDirSwapLogFile(SwapDir * sd, const char *ext)
             pathtmp[strlen(pathtmp) - 1] = '\0';
 
         for (pathtmp2 = pathtmp; *pathtmp2 == '.'; pathtmp2++);
-        snprintf(path, SQUID_MAXPATHLEN - 64, Config.Log.swap, pathtmp2);
+        snprintf(path, MAXPATHLEN - 64, Config.Log.swap, pathtmp2);
 
-        if (strncmp(path, Config.Log.swap, SQUID_MAXPATHLEN - 64) == 0) {
+        if (strncmp(path, Config.Log.swap, MAXPATHLEN - 64) == 0) {
             strcat(path, ".");
             snprintf(digit, 32, "%02d", sd->index);
             strncat(path, digit, 3);
         }
     } else {
-        xstrncpy(path, sd->path, SQUID_MAXPATHLEN - 64);
+        xstrncpy(path, sd->path, MAXPATHLEN - 64);
         strcat(path, "/swap.state");
     }
 
index e4f95ebde27cb261fa829d1cddfe6de301220ad7..8f86832499aa707ac81f6034dc239a3e8cbfc506 100644 (file)
@@ -484,9 +484,9 @@ UFSSwapDir::mapBitAllocate()
 char *
 UFSSwapDir::swapSubDir(int subdirn)const
 {
-    LOCAL_ARRAY(char, fullfilename, SQUID_MAXPATHLEN);
+    LOCAL_ARRAY(char, fullfilename, MAXPATHLEN);
     assert(0 <= subdirn && subdirn < l1);
-    snprintf(fullfilename, SQUID_MAXPATHLEN, "%s/%02X", path, subdirn);
+    snprintf(fullfilename, MAXPATHLEN, "%s/%02X", path, subdirn);
     return fullfilename;
 }
 
@@ -589,13 +589,13 @@ UFSSwapDir::createSwapSubDirs()
 char *
 UFSSwapDir::logFile(char const *ext) const
 {
-    LOCAL_ARRAY(char, lpath, SQUID_MAXPATHLEN);
-    LOCAL_ARRAY(char, pathtmp, SQUID_MAXPATHLEN);
+    LOCAL_ARRAY(char, lpath, MAXPATHLEN);
+    LOCAL_ARRAY(char, pathtmp, MAXPATHLEN);
     LOCAL_ARRAY(char, digit, 32);
     char *pathtmp2;
 
     if (Config.Log.swap) {
-        xstrncpy(pathtmp, path, SQUID_MAXPATHLEN - 64);
+        xstrncpy(pathtmp, path, MAXPATHLEN - 64);
         pathtmp2 = pathtmp;
 
         while ((pathtmp2 = strchr(pathtmp2, '/')) != NULL)
@@ -605,15 +605,15 @@ UFSSwapDir::logFile(char const *ext) const
             pathtmp[strlen(pathtmp) - 1] = '\0';
 
         for (pathtmp2 = pathtmp; *pathtmp2 == '.'; pathtmp2++);
-        snprintf(lpath, SQUID_MAXPATHLEN - 64, Config.Log.swap, pathtmp2);
+        snprintf(lpath, MAXPATHLEN - 64, Config.Log.swap, pathtmp2);
 
-        if (strncmp(lpath, Config.Log.swap, SQUID_MAXPATHLEN - 64) == 0) {
+        if (strncmp(lpath, Config.Log.swap, MAXPATHLEN - 64) == 0) {
             strcat(lpath, ".");
             snprintf(digit, 32, "%02d", index);
             strncat(lpath, digit, 3);
         }
     } else {
-        xstrncpy(lpath, path, SQUID_MAXPATHLEN - 64);
+        xstrncpy(lpath, path, MAXPATHLEN - 64);
         strcat(lpath, "/swap.state");
     }
 
@@ -1087,7 +1087,7 @@ UFSSwapDir::DirClean(int swap_index)
     D1 = (swap_index / N0) % N1;
     N2 = SD->l2;
     D2 = ((swap_index / N0) / N1) % N2;
-    snprintf(p1, SQUID_MAXPATHLEN, "%s/%02X/%02X",
+    snprintf(p1, MAXPATHLEN, "%s/%02X/%02X",
              SD->path, D1, D2);
     debugs(36, 3, "storeDirClean: Cleaning directory " << p1);
     dir_pointer = opendir(p1);
@@ -1336,7 +1336,7 @@ UFSSwapDir::dump(StoreEntry & entry) const
 char *
 UFSSwapDir::fullPath(sfileno filn, char *fullpath) const
 {
-    LOCAL_ARRAY(char, fullfilename, SQUID_MAXPATHLEN);
+    LOCAL_ARRAY(char, fullfilename, MAXPATHLEN);
     int L1 = l1;
     int L2 = l2;
 
@@ -1345,7 +1345,7 @@ UFSSwapDir::fullPath(sfileno filn, char *fullpath) const
 
     fullpath[0] = '\0';
 
-    snprintf(fullpath, SQUID_MAXPATHLEN, "%s/%02X/%02X/%08X",
+    snprintf(fullpath, MAXPATHLEN, "%s/%02X/%02X/%08X",
              path,
              ((filn / L2) / L2) % L1,
              (filn / L2) % L2,
index d994e97d0af1f209e79ad84a83e264f272261cc6..686ab35bf5160a89f4a825c73a0e076827dcdf94 100644 (file)
@@ -702,7 +702,7 @@ RebuildState::getNextFile(sfileno * filn_p, int *size)
         }
 
         if (0 == in_dir) {     /* we need to read in a new directory */
-            snprintf(fullpath, SQUID_MAXPATHLEN, "%s/%02X/%02X",
+            snprintf(fullpath, MAXPATHLEN, "%s/%02X/%02X",
                      sd->path,
                      curlvl1, curlvl2);
 
@@ -747,7 +747,7 @@ RebuildState::getNextFile(sfileno * filn_p, int *size)
                 continue;
             }
 
-            snprintf(fullfilename, SQUID_MAXPATHLEN, "%s/%s",
+            snprintf(fullfilename, MAXPATHLEN, "%s/%s",
                      fullpath, entry->d_name);
             debugs(47, 3, "commonUfsDirGetNextFile: Opening " << fullfilename);
             fd = file_open(fullfilename, O_RDONLY | O_BINARY);
index 815e3b2d641402220bf88a49f7abbd995089368c..ad313e9e07485c0fa091edbfcb1c0909ab2bf40b 100644 (file)
@@ -401,8 +401,8 @@ public:
 
     struct dirent *entry;
     DIR *td;
-    char fullpath[SQUID_MAXPATHLEN];
-    char fullfilename[SQUID_MAXPATHLEN];
+    char fullpath[MAXPATHLEN];
+    char fullfilename[MAXPATHLEN];
 
     struct _store_rebuild_data counts;
 
index 4d98e2fd782ddd86cb3dc0bbc62e8dd3690afb73..56b690e43e144191a51e04c7a033b492eab3ed5f 100644 (file)
@@ -4,6 +4,10 @@
 #include "config.h"
 #include "dlink.h"
 
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
 class logfile_buffer_t
 {
 public:
@@ -27,7 +31,7 @@ class Logfile
 {
 
 public:
-    char path[SQUID_MAXPATHLEN];
+    char path[MAXPATHLEN];
 
     struct {
         unsigned int fatal;
index 255528623c43dfd676dd98d74d80fdb979d49e70..57d329a37acb3128d7408a48042d59086d6bc5c0 100644 (file)
@@ -1455,7 +1455,7 @@ sendSignal(void)
 static void
 mainStartScript(const char *prog)
 {
-    char script[SQUID_MAXPATHLEN];
+    char script[MAXPATHLEN];
     char *t;
     size_t sl = 0;
     pid_t cpid;
index 25c87fad81c2113b133503286240c65d0642822b..ab31438a0e6f75f3db9c0c9f8d0007fe79d26e77 100644 (file)
@@ -512,6 +512,10 @@ struct SquidConfig {
         int n_allocated;
         int n_configured;
     } cacheSwap;
+/*
+ * I'm sick of having to keep doing this ..
+ */
+#define INDEXSD(i)   (Config.cacheSwap.swapDirs[(i)].getRaw())
 
     struct {
         char *directory;
index f69dc0b1c33c74c2a50f08e56f235422a15f7f8b..1dad26882a935c23191a36ebf9ff6a3c0c04e465 100644 (file)
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
  *
  */
+#include "config.h"
 
+#if HAVE_UNISTD_H
 #include <unistd.h>
-#include <stdlib.h>
+#endif
+#if HAVE_STDIO_H
 #include <stdio.h>
-#include <sys/types.h>
+#endif
+#if HAVE_CTYPE_H
 #include <ctype.h>
-#include <sys/time.h>
+#endif
+#if HAVE_STRINGS_H
 #include <strings.h>
+#endif
+#if HAVE_ASSERT_H
 #include <assert.h>
+#endif
+
 #include "hash.h"
+
 #undef free
 extern void my_free(char *, int, void *);
 
index 9c032e7f7665ec1a2275736811bdad37a31b1a3d..77eddbddcd41b31e3cbf56d47fbccf722ab937bc 100644 (file)
@@ -1,14 +1,18 @@
+#include "config.h"
+#include "hash.h"
+
+#if HAVE_UNISTD_H
 #include <unistd.h>
-#include <stdlib.h>
+#endif
+#if HAVE_STDIO_H
 #include <stdio.h>
-#include <sys/types.h>
+#endif
+#if HAVE_CTYPE_H
 #include <ctype.h>
-#include <sys/time.h>
+#endif
+#if HAVE_STRINGS_H
 #include <strings.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-
-#include "hash.h"
+#endif
 
 static hash_table *mem_table = NULL;
 static hash_link *mem_entry;
index 93345dbc6446f77aac4362a2209e93c04ead4259..0527d0662767836078dbf8166236433d678594d4 100644 (file)
@@ -25,9 +25,6 @@
 #if HAVE_TIME_H
 #include <time.h>
 #endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
 #if HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
index e6acd1a02d76a89f9e5b547867a9563181549094..d3072c43796b5c089f53b13d7c568551af2440ea 100644 (file)
@@ -54,9 +54,6 @@
 #if HAVE_TIME_H
 #include <time.h>
 #endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
 #if HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
index cb15886fb18df0e620c58da38023bf89217d3502..79c3470688122109747fe75bc0970099ceeac7c7 100644 (file)
@@ -52,9 +52,6 @@
 #if HAVE_TIME_H
 #include <time.h>
 #endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
 #if HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
 #if HAVE_ASSERT_H
 #include <assert.h>
 #endif
+#if HAVE_NETDB_H
 #include <netdb.h>
+#endif
+#if HAVE_SYS_WAIT_H
 #include <sys/wait.h>
+#endif
 
 #define READ_BUF_SZ 4096
 #define URL_BUF_SZ 4096
index 5a3b39e63037266bff2913cd22bbc6829b488015..770fa099568b0500144262df6a96c6f789675969 100644 (file)
@@ -1,5 +1,8 @@
-#include <sys/time.h>
+#include "config.h"
+
+#if HAVE_ASSERT_H
 #include <assert.h>
+#endif
 
 int
 main(int argc, char *argv[])
index 98a600b94ad0de2c30dfa2dc0d205306b6faa4c6..34e8b2c3b454b0bfdf8d0d118cb22f18db98b4c9 100644 (file)
 #if HAVE_SYS_PARAM_H
 #include <sys/param.h>
 #endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#if HAVE_SYS_RESOURCE_H
-#include <sys/resource.h>      /* needs sys/time.h above it */
-#endif
 #if HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif