From 4ac03908fcb4966d44b816f1a828d5e237912f3d Mon Sep 17 00:00:00 2001
From: Robert James Kaes <rjkaes@users.sourceforge.net>
Date: Thu, 25 Oct 2001 17:27:39 +0000
Subject: Header reorganization. Basically all system headers are now included
 in tinyproxy.h and all the other files include the tinyproxy.h header. This
 moves all the dependancy issues into one file.

---
 src/acl.c       |  4 +---
 src/anonymous.c | 12 ++----------
 src/dnscache.c  | 11 ++---------
 src/filter.c    |  5 +----
 src/log.c       |  4 +---
 src/scanner.l   |  5 ++---
 src/ternary.c   | 22 +++++-----------------
 src/tinyproxy.c | 11 +----------
 src/tinyproxy.h | 14 ++++++++++++--
 src/utils.c     |  6 +-----
 10 files changed, 28 insertions(+), 66 deletions(-)

(limited to 'src')

diff --git a/src/acl.c b/src/acl.c
index eb6b1ea..3333b34 100644
--- a/src/acl.c
+++ b/src/acl.c
@@ -1,4 +1,4 @@
-/* $Id: acl.c,v 1.8 2001-09-15 21:21:01 rjkaes Exp $
+/* $Id: acl.c,v 1.9 2001-10-25 17:27:39 rjkaes Exp $
  *
  * This system handles Access Control for use of this daemon. A list of
  * domains, or IP addresses (including IP blocks) are stored in a list
@@ -19,8 +19,6 @@
 
 #include "tinyproxy.h"
 
-#include <ctype.h>
-
 #include "acl.h"
 #include "log.h"
 #include "sock.h"
diff --git a/src/anonymous.c b/src/anonymous.c
index 4463080..f1bf4e6 100644
--- a/src/anonymous.c
+++ b/src/anonymous.c
@@ -1,4 +1,4 @@
-/* $Id: anonymous.c,v 1.6 2001-08-26 21:07:27 rjkaes Exp $
+/* $Id: anonymous.c,v 1.7 2001-10-25 17:27:39 rjkaes Exp $
  *
  * Handles insertion and searches for headers which should be let through when
  * the anonymous feature is turned on. The headers are stored in a Ternary
@@ -18,15 +18,7 @@
  * General Public License for more details.
  */
 
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <assert.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
+#include "tinyproxy.h"
 
 #include "anonymous.h"
 #include "log.h"
diff --git a/src/dnscache.c b/src/dnscache.c
index 588ea15..13a178b 100644
--- a/src/dnscache.c
+++ b/src/dnscache.c
@@ -1,4 +1,4 @@
-/* $Id: dnscache.c,v 1.16 2001-09-12 03:32:24 rjkaes Exp $
+/* $Id: dnscache.c,v 1.17 2001-10-25 17:27:39 rjkaes Exp $
  *
  * This is a caching DNS system. When a host name is needed we look it up here
  * and see if there is already an answer for it. The domains are placed in a
@@ -20,14 +20,7 @@
  * General Public License for more details.
  */
 
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <assert.h>
-#include <ctype.h>
-#include <unistd.h>
+#include "tinyproxy.h"
 
 #include "dnscache.h"
 #include "log.h"
diff --git a/src/filter.c b/src/filter.c
index 3700c63..a1f5ed8 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -1,4 +1,4 @@
-/* $Id: filter.c,v 1.6 2001-09-12 03:32:54 rjkaes Exp $
+/* $Id: filter.c,v 1.7 2001-10-25 17:27:39 rjkaes Exp $
  *
  * Copyright (c) 1999  George Talusan (gstalusan@uwaterloo.ca)
  *
@@ -18,9 +18,6 @@
 
 #include "tinyproxy.h"
 
-#include <ctype.h>
-#include <sysexits.h>
-
 #include "filter.h"
 #include "regexp.h"
 #include "utils.h"
diff --git a/src/log.c b/src/log.c
index e907881..67007cc 100644
--- a/src/log.c
+++ b/src/log.c
@@ -1,4 +1,4 @@
-/* $Id: log.c,v 1.14 2001-09-04 16:50:22 rjkaes Exp $
+/* $Id: log.c,v 1.15 2001-10-25 17:27:39 rjkaes Exp $
  *
  * Logs the various messages which tinyproxy produces to either a log file or
  * the syslog daemon. Not much to it...
@@ -19,8 +19,6 @@
 
 #include "tinyproxy.h"
 
-#include <stdarg.h>
-
 #include "log.h"
 
 static char *syslog_level[] = {
diff --git a/src/scanner.l b/src/scanner.l
index ab87b39..0f4cf29 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -1,4 +1,4 @@
-/* $Id: scanner.l,v 1.5 2001-09-16 20:08:24 rjkaes Exp $
+/* $Id: scanner.l,v 1.6 2001-10-25 17:27:39 rjkaes Exp $
  *
  * This builds the scanner for the tinyproxy configuration file. This
  * file needs to stay in sync with grammar.y. If someone knows lex and yacc
@@ -19,9 +19,8 @@
 %{
 
 #include "tinyproxy.h"
+
 #include "grammar.h"
-#include <string.h>
-#include <stdio.h>
 
 struct keyword {
         char *kw_name;
diff --git a/src/ternary.c b/src/ternary.c
index dfc423a..f4f0dc4 100644
--- a/src/ternary.c
+++ b/src/ternary.c
@@ -1,4 +1,4 @@
-/* $Id: ternary.c,v 1.10 2001-09-08 18:58:02 rjkaes Exp $
+/* $Id: ternary.c,v 1.11 2001-10-25 17:27:39 rjkaes Exp $
  *
  * This module creates a Ternary Search Tree which can store both string
  * keys, and arbitrary data for each key. It works similar to a hash, and
@@ -21,23 +21,11 @@
  * General Public License for more details.
  */
 
-#if defined HAVE_CONFIG_H
-#  include 	<config.h>
-#endif
+#include "tinyproxy.h"
 
-#if defined HAVE_SYS_TYPES_H
-#  include 	<sys/types.h>
-#endif
-
-#include        <ctype.h>
-#include 	<stdio.h>
-#include 	<stdlib.h>
-#include	<string.h>
-
-#include	"log.h"
-#include 	"ternary.h"
-#include	"tinyproxy.h"
-#include	"utils.h"
+#include "log.h"
+#include "ternary.h"
+#include "utils.h"
 
 /*
  * Macros for the tree structures (limits)
diff --git a/src/tinyproxy.c b/src/tinyproxy.c
index 8269ea1..fa6280a 100644
--- a/src/tinyproxy.c
+++ b/src/tinyproxy.c
@@ -1,4 +1,4 @@
-/* $Id: tinyproxy.c,v 1.17 2001-09-16 20:11:54 rjkaes Exp $
+/* $Id: tinyproxy.c,v 1.18 2001-10-25 17:27:39 rjkaes Exp $
  *
  * The initialise routine. Basically sets up all the initial stuff (logfile,
  * listening socket, config options, etc.) and then sits there and loops
@@ -24,15 +24,6 @@
 
 #include "tinyproxy.h"
 
-#ifdef HAVE_SYS_RESOURCE_H
-#  include <sys/resource.h>
-#endif /* HAVE_SYS_RESOUCE_H */
-#include <grp.h>
-#include <pwd.h>
-#include <signal.h>
-#include <sysexits.h>
-#include <syslog.h>
-
 #include "anonymous.h"
 #include "buffer.h"
 #include "dnscache.h"
diff --git a/src/tinyproxy.h b/src/tinyproxy.h
index 03aa197..7dd6402 100644
--- a/src/tinyproxy.h
+++ b/src/tinyproxy.h
@@ -1,4 +1,4 @@
-/* $Id: tinyproxy.h,v 1.18 2001-10-25 16:58:50 rjkaes Exp $
+/* $Id: tinyproxy.h,v 1.19 2001-10-25 17:27:39 rjkaes Exp $
  *
  * See 'tinyproxy.c' for a detailed description.
  *
@@ -27,6 +27,9 @@
  * Include standard headers which are used through-out tinyproxy
  */
 #include        <sys/types.h>
+#ifdef HAVE_SYS_RESOURCE_H
+#  include      <sys/resource.h>
+#endif
 #ifdef HAVE_SYS_SELECT_H
 #  include	<sys/select.h>
 #endif
@@ -45,12 +48,18 @@
 #include	<sys/uio.h>
 #include	<netinet/in.h>
 #include	<arpa/inet.h>
+#include        <assert.h>
+#include        <ctype.h>
 #include	<errno.h>
 #include	<fcntl.h>
+#include        <grp.h>
 #include	<netdb.h>
 #ifdef HAVE_PTHREAD_H
 #  include	<pthread.h>
 #endif
+#include        <pwd.h>
+#include        <signal.h>
+#include        <stdarg.h>
 #ifdef HAVE_STDINT_H
 #  include	<stdint.h>
 #endif
@@ -60,8 +69,9 @@
 #ifdef HAVE_STRINGS_H
 #  include	<strings.h>
 #endif
+#include        <sysexits.h>
+#include        <syslog.h>
 #include        <unistd.h>
-#include        <assert.h>
 
 #ifndef SHUT_RD			/* these three Posix.1g names are quite new */
 #  define SHUT_RD	0	/* shutdown for reading */
diff --git a/src/utils.c b/src/utils.c
index 3901027..0954bc4 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -1,4 +1,4 @@
-/* $Id: utils.c,v 1.15 2001-10-25 16:58:50 rjkaes Exp $
+/* $Id: utils.c,v 1.16 2001-10-25 17:27:39 rjkaes Exp $
  *
  * Misc. routines which are used by the various functions to handle strings
  * and memory allocation and pretty much anything else we can think of. Also,
@@ -21,10 +21,6 @@
 
 #include "tinyproxy.h"
 
-#include <ctype.h>
-#include <signal.h>
-#include <sysexits.h>
-
 #include "buffer.h"
 #include "conns.h"
 #include "log.h"
-- 
cgit v1.2.3