[master] 1bf7f62 Eliminate the cache_ban.h header file, it's contents is entirely private to cache_ban.c, so inline it there.

Poul-Henning Kamp phk at varnish-cache.org
Sat May 14 11:53:21 CEST 2011


commit 1bf7f6209c44388e4e6603c4a02fa738de398242
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Sat May 14 09:52:45 2011 +0000

    Eliminate the cache_ban.h header file, it's contents is entirely
    private to cache_ban.c, so inline it there.

diff --git a/bin/varnishd/Makefile.am b/bin/varnishd/Makefile.am
index f293d09..b6d78e7 100644
--- a/bin/varnishd/Makefile.am
+++ b/bin/varnishd/Makefile.am
@@ -77,7 +77,6 @@ varnishd_SOURCES = \
 noinst_HEADERS = \
 	acct_fields.h \
 	cache.h \
-	cache_ban.h \
 	cache_backend.h \
 	cache_backend_poll.h \
 	cache_esi.h \
diff --git a/bin/varnishd/cache_ban.c b/bin/varnishd/cache_ban.c
index 2ce40ef..becfd4e 100644
--- a/bin/varnishd/cache_ban.c
+++ b/bin/varnishd/cache_ban.c
@@ -54,7 +54,41 @@
 #include "hash_slinger.h"
 #include "vre.h"
 
-#include "cache_ban.h"
+struct ban_test;
+
+/* A ban-testing function */
+typedef int ban_cond_f(const struct ban_test *bt, const struct object *o,
+    const struct sess *sp);
+
+/* Each individual test to be performed on a ban */
+struct ban_test {
+	unsigned		magic;
+#define BAN_TEST_MAGIC		0x54feec67
+	VTAILQ_ENTRY(ban_test)	list;
+	ban_cond_f		*func;
+	int			flags;
+#define BAN_T_REGEXP		(1 << 0)
+#define BAN_T_NOT		(1 << 1)
+	vre_t			*re;
+	char			*dst;
+	char			*src;
+};
+
+struct ban {
+	unsigned		magic;
+#define BAN_MAGIC		0x700b08ea
+	VTAILQ_ENTRY(ban)	list;
+	unsigned		refcount;
+	int			flags;
+#define BAN_F_GONE		(1 << 0)
+#define BAN_F_PENDING		(1 << 1)
+#define BAN_F_REQ		(1 << 2)
+	VTAILQ_HEAD(,ban_test)	tests;
+	VTAILQ_HEAD(,objcore)	objcore;
+	double			t0;
+	struct vsb		*vsb;
+	char			*test;
+};
 
 static VTAILQ_HEAD(banhead_s,ban) ban_head = VTAILQ_HEAD_INITIALIZER(ban_head);
 static struct lock ban_mtx;
diff --git a/bin/varnishd/cache_ban.h b/bin/varnishd/cache_ban.h
deleted file mode 100644
index 700bc12..0000000
--- a/bin/varnishd/cache_ban.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*-
- * Copyright (c) 2006 Verdens Gang AS
- * Copyright (c) 2006-2009 Linpro 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.
- *
- */
-
-struct ban_test;
-
-/* A ban-testing function */
-typedef int ban_cond_f(const struct ban_test *bt, const struct object *o,
-    const struct sess *sp);
-
-/* Each individual test to be performed on a ban */
-struct ban_test {
-	unsigned		magic;
-#define BAN_TEST_MAGIC		0x54feec67
-	VTAILQ_ENTRY(ban_test)	list;
-	ban_cond_f		*func;
-	int			flags;
-#define BAN_T_REGEXP		(1 << 0)
-#define BAN_T_NOT		(1 << 1)
-	vre_t			*re;
-	char			*dst;
-	char			*src;
-};
-
-struct ban {
-	unsigned		magic;
-#define BAN_MAGIC		0x700b08ea
-	VTAILQ_ENTRY(ban)	list;
-	unsigned		refcount;
-	int			flags;
-#define BAN_F_GONE		(1 << 0)
-#define BAN_F_PENDING		(1 << 1)
-#define BAN_F_REQ		(1 << 2)
-	VTAILQ_HEAD(,ban_test)	tests;
-	VTAILQ_HEAD(,objcore)	objcore;
-	double			t0;
-	struct vsb		*vsb;
-	char			*test;
-};



More information about the varnish-commit mailing list