[master] b4bb850 More #include cleanuppery

Poul-Henning Kamp phk at varnish-cache.org
Sun Oct 9 10:24:39 CEST 2011


commit b4bb85057482f1fcb79d86f340a4e6665ca4352d
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Sun Oct 9 08:24:21 2011 +0000

    More #include cleanuppery

diff --git a/include/Makefile.am b/include/Makefile.am
index e40ea2a..c68e07c 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -3,9 +3,15 @@
 pkginclude_HEADERS = \
 	tbl/acct_fields.h \
 	tbl/backend_poll.h \
+	tbl/ban_vars.h \
 	tbl/body_status.h \
+	tbl/http_headers.h \
+	tbl/http_response.h \
 	tbl/locks.h \
 	tbl/steps.h \
+	tbl/vcc_types.h \
+	tbl/vcl_returns.h \
+	tbl/vrt_stv_var.h \
 	tbl/vsc_all.h \
 	tbl/vsc_fields.h \
 	tbl/vsl_tags.h \
@@ -28,11 +34,6 @@ nobase_noinst_HEADERS = \
 	libvcl.h \
 	miniobj.h \
 	persistent.h \
-	tbl/ban_vars.h \
-	tbl/http_headers.h \
-	tbl/http_response.h \
-	tbl/vcl_returns.h \
-	tbl/vrt_stv_var.h \
 	vas.h \
 	vav.h \
 	vbm.h \
diff --git a/include/tbl/vcc_types.h b/include/tbl/vcc_types.h
new file mode 100644
index 0000000..469b56c
--- /dev/null
+++ b/include/tbl/vcc_types.h
@@ -0,0 +1,44 @@
+/*-
+ * Copyright (c) 2010 Varnish Software AS
+ * All rights reserved.
+ *
+ * Author: Poul-Henning Kamp <phk at phk.freebsd.dk>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+/*lint -save -e525 -e539 */
+VCC_TYPE(VOID)
+VCC_TYPE(BACKEND)
+VCC_TYPE(BOOL)
+VCC_TYPE(INT)
+VCC_TYPE(TIME)
+VCC_TYPE(DURATION)
+VCC_TYPE(STRING)
+VCC_TYPE(STRING_LIST)
+VCC_TYPE(IP)
+VCC_TYPE(HEADER)
+VCC_TYPE(BYTES)
+VCC_TYPE(REAL)
+VCC_TYPE(ENUM)
+/*lint -restore */
diff --git a/lib/libvcl/Makefile.am b/lib/libvcl/Makefile.am
index fa61423..099ad36 100644
--- a/lib/libvcl/Makefile.am
+++ b/lib/libvcl/Makefile.am
@@ -10,7 +10,6 @@ libvcl_la_SOURCES = \
 	vcc_priv.h \
 	vcc_compile.h \
 	vcc_token_defs.h \
-	vcc_types.h \
 	symbol_kind.h \
 	\
 	vcc_acl.c \
diff --git a/lib/libvcl/vcc_acl.c b/lib/libvcl/vcc_acl.c
index 6eb451c..bd94a5b 100644
--- a/lib/libvcl/vcc_acl.c
+++ b/lib/libvcl/vcc_acl.c
@@ -30,7 +30,6 @@
 #include "config.h"
 
 #include <stdio.h>
-#include <stdlib.h>
 #include <stddef.h>
 #include <string.h>
 #include <sys/types.h>
@@ -38,10 +37,10 @@
 #include <netdb.h>
 #include <netinet/in.h>
 
-#include "vrt.h"
 
-#include "vcc_priv.h"
 #include "vcc_compile.h"
+#include "vrt.h"
+#include "vcc_priv.h"
 #include "libvarnish.h"
 
 struct acl_e {
diff --git a/lib/libvcl/vcc_action.c b/lib/libvcl/vcc_action.c
index c11f5b2..1fafe98 100644
--- a/lib/libvcl/vcc_action.c
+++ b/lib/libvcl/vcc_action.c
@@ -32,11 +32,9 @@
 
 #include "config.h"
 
-#include <stdio.h>
-#include <string.h>
 
-#include "vcc_priv.h"
 #include "vcc_compile.h"
+#include "vcc_priv.h"
 #include "libvarnish.h"
 
 /*--------------------------------------------------------------------*/
diff --git a/lib/libvcl/vcc_backend.c b/lib/libvcl/vcc_backend.c
index dfe58d2..67fecd6 100644
--- a/lib/libvcl/vcc_backend.c
+++ b/lib/libvcl/vcc_backend.c
@@ -55,16 +55,13 @@
 
 #include <limits.h>
 #include <netdb.h>
-#include <stdio.h>
-#include <stdarg.h>
 #include <stdlib.h>
 #include <string.h>
 
-#include "vss.h"
-
-#include "vcc_priv.h"
 #include "vcc_compile.h"
+#include "vcc_priv.h"
 #include "libvarnish.h"
+#include "vss.h"
 
 struct host {
 	VTAILQ_ENTRY(host)      list;
diff --git a/lib/libvcl/vcc_compile.c b/lib/libvcl/vcc_compile.c
index a09f396..be3ec63 100644
--- a/lib/libvcl/vcc_compile.c
+++ b/lib/libvcl/vcc_compile.c
@@ -52,18 +52,15 @@
 
 #include "config.h"
 
-#include <sys/stat.h>
-
 #include <ctype.h>
 #include <errno.h>
 #include <stdio.h>
 #include <stdarg.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
 
-#include "vcc_priv.h"
 #include "vcc_compile.h"
+#include "vcc_priv.h"
 
 #include "libvcl.h"
 #include "libvarnish.h"
diff --git a/lib/libvcl/vcc_compile.h b/lib/libvcl/vcc_compile.h
index a3aa800..438fe58 100644
--- a/lib/libvcl/vcc_compile.h
+++ b/lib/libvcl/vcc_compile.h
@@ -44,7 +44,7 @@ struct symbol;
 
 enum var_type {
 #define VCC_TYPE(foo)		foo,
-#include "vcc_types.h"
+#include "tbl/vcc_types.h"
 #undef VCC_TYPE
 };
 
diff --git a/lib/libvcl/vcc_dir_dns.c b/lib/libvcl/vcc_dir_dns.c
index a8cb24b..a5952c8 100644
--- a/lib/libvcl/vcc_dir_dns.c
+++ b/lib/libvcl/vcc_dir_dns.c
@@ -28,16 +28,12 @@
 
 #include "config.h"
 
-#include <sys/types.h>
-#include <sys/socket.h>
-
 #include <stdio.h>
-#include <stdarg.h>
 #include <string.h>
 #include <limits.h>
 
-#include "vcc_priv.h"
 #include "vcc_compile.h"
+#include "vcc_priv.h"
 #include "libvarnish.h"
 
 /*--------------------------------------------------------------------
diff --git a/lib/libvcl/vcc_dir_random.c b/lib/libvcl/vcc_dir_random.c
index aa362f9..46f74c2 100644
--- a/lib/libvcl/vcc_dir_random.c
+++ b/lib/libvcl/vcc_dir_random.c
@@ -29,15 +29,8 @@
 
 #include "config.h"
 
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
-
-#include "vcc_priv.h"
 #include "vcc_compile.h"
+#include "vcc_priv.h"
 #include "libvarnish.h"
 
 /*--------------------------------------------------------------------
diff --git a/lib/libvcl/vcc_dir_round_robin.c b/lib/libvcl/vcc_dir_round_robin.c
index 67fb118..b1094fe 100644
--- a/lib/libvcl/vcc_dir_round_robin.c
+++ b/lib/libvcl/vcc_dir_round_robin.c
@@ -28,15 +28,8 @@
 
 #include "config.h"
 
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
-
-#include "vcc_priv.h"
 #include "vcc_compile.h"
+#include "vcc_priv.h"
 #include "libvarnish.h"
 
 /*--------------------------------------------------------------------
diff --git a/lib/libvcl/vcc_expr.c b/lib/libvcl/vcc_expr.c
index b7b6ba6..4fbcd85 100644
--- a/lib/libvcl/vcc_expr.c
+++ b/lib/libvcl/vcc_expr.c
@@ -46,7 +46,7 @@ vcc_Type(enum var_type fmt)
 {
 	switch(fmt) {
 #define VCC_TYPE(a)	case a: return(#a);
-#include "vcc_types.h"
+#include "tbl/vcc_types.h"
 #undef VCC_TYPE
 	default:
 		assert("Unknwon Type");
@@ -403,7 +403,7 @@ vcc_arg_type(const char **p)
 {
 
 #define VCC_TYPE(a) if (!strcmp(#a, *p)) { *p += strlen(#a) + 1; return (a);}
-#include "vcc_types.h"
+#include "tbl/vcc_types.h"
 #undef VCC_TYPE
 	return (VOID);
 }
diff --git a/lib/libvcl/vcc_types.h b/lib/libvcl/vcc_types.h
deleted file mode 100644
index 469b56c..0000000
--- a/lib/libvcl/vcc_types.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*-
- * Copyright (c) 2010 Varnish Software AS
- * All rights reserved.
- *
- * Author: Poul-Henning Kamp <phk at phk.freebsd.dk>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-/*lint -save -e525 -e539 */
-VCC_TYPE(VOID)
-VCC_TYPE(BACKEND)
-VCC_TYPE(BOOL)
-VCC_TYPE(INT)
-VCC_TYPE(TIME)
-VCC_TYPE(DURATION)
-VCC_TYPE(STRING)
-VCC_TYPE(STRING_LIST)
-VCC_TYPE(IP)
-VCC_TYPE(HEADER)
-VCC_TYPE(BYTES)
-VCC_TYPE(REAL)
-VCC_TYPE(ENUM)
-/*lint -restore */



More information about the varnish-commit mailing list