[master] 080f259 Push "vas.h", <stdint.h>, and NULL out of libvarnish.h

Poul-Henning Kamp phk at varnish-cache.org
Sun Oct 9 21:52:11 CEST 2011


commit 080f2595d2d5f71a6795445cc6f688d221c48f08
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Sun Oct 9 19:51:08 2011 +0000

    Push "vas.h", <stdint.h>, and NULL out of libvarnish.h

diff --git a/bin/varnishadm/varnishadm.c b/bin/varnishadm/varnishadm.c
index d371b9f..b857f8a 100644
--- a/bin/varnishadm/varnishadm.c
+++ b/bin/varnishadm/varnishadm.c
@@ -46,7 +46,7 @@
 
 #include "vcli.h"
 #include "cli_common.h"
-#include "libvarnish.h"
+#include "vas.h"
 #include "vss.h"
 
 #ifdef HAVE_LIBEDIT
diff --git a/bin/varnishd/common.h b/bin/varnishd/common.h
index f755b97..0e6d95d 100644
--- a/bin/varnishd/common.h
+++ b/bin/varnishd/common.h
@@ -29,6 +29,7 @@
  */
 
 #include "libvarnish.h"
+#include "vas.h"
 #include "vsb.h"
 #include "vqueue.h"
 #include "miniobj.h"
diff --git a/bin/varnishhist/varnishhist.c b/bin/varnishhist/varnishhist.c
index 9485df7..92d17b3 100644
--- a/bin/varnishhist/varnishhist.c
+++ b/bin/varnishhist/varnishhist.c
@@ -48,6 +48,7 @@
 #include <string.h>
 #include <unistd.h>
 
+#include "vas.h"
 #include "libvarnish.h"
 
 #define HIST_N 2000 /* how far back we remember */
diff --git a/bin/varnishlog/varnishlog.c b/bin/varnishlog/varnishlog.c
index c67432d..3142d1b 100644
--- a/bin/varnishlog/varnishlog.c
+++ b/bin/varnishlog/varnishlog.c
@@ -47,6 +47,7 @@
 #include "vsb.h"
 #include "vpf.h"
 
+#include "vas.h"
 #include "libvarnish.h"
 
 static int	b_flag, c_flag;
diff --git a/bin/varnishncsa/varnishncsa.c b/bin/varnishncsa/varnishncsa.c
index d010a73..4805d81 100644
--- a/bin/varnishncsa/varnishncsa.c
+++ b/bin/varnishncsa/varnishncsa.c
@@ -73,6 +73,7 @@
 
 #include "compat/daemon.h"
 
+#include "vas.h"
 #include "vsb.h"
 #include "vpf.h"
 #include "vqueue.h"
diff --git a/bin/varnishreplay/varnishreplay.c b/bin/varnishreplay/varnishreplay.c
index dbb6f51..ef4118a 100644
--- a/bin/varnishreplay/varnishreplay.c
+++ b/bin/varnishreplay/varnishreplay.c
@@ -48,6 +48,7 @@
 
 #include "vqueue.h"
 
+#include "vas.h"
 #include "libvarnish.h"
 #include "vss.h"
 
diff --git a/bin/varnishsizes/varnishsizes.c b/bin/varnishsizes/varnishsizes.c
index ac9dbf8..70fcad1 100644
--- a/bin/varnishsizes/varnishsizes.c
+++ b/bin/varnishsizes/varnishsizes.c
@@ -48,6 +48,7 @@
 #include <string.h>
 #include <unistd.h>
 
+#include "vas.h"
 #include "libvarnish.h"
 
 #define HIST_N 2000 /* how far back we remember */
diff --git a/bin/varnishstat/varnishstat.c b/bin/varnishstat/varnishstat.c
index 76a2e03..b160a26 100644
--- a/bin/varnishstat/varnishstat.c
+++ b/bin/varnishstat/varnishstat.c
@@ -44,7 +44,6 @@
 #include <time.h>
 #include <unistd.h>
 
-#include "libvarnish.h"
 #include "varnishstat.h"
 
 /*--------------------------------------------------------------------*/
diff --git a/bin/varnishstat/varnishstat.h b/bin/varnishstat/varnishstat.h
index 245af35..322ebc4 100644
--- a/bin/varnishstat/varnishstat.h
+++ b/bin/varnishstat/varnishstat.h
@@ -27,4 +27,7 @@
  *
  */
 
+#include "vas.h"
+#include "libvarnish.h"
+
 void do_curses(struct VSM_data *vd, const struct VSC_C_main *VSC_C_main, int delay);
diff --git a/bin/varnishstat/varnishstat_curses.c b/bin/varnishstat/varnishstat_curses.c
index fc948e9..1e93155 100644
--- a/bin/varnishstat/varnishstat_curses.c
+++ b/bin/varnishstat/varnishstat_curses.c
@@ -50,7 +50,6 @@
 #include <time.h>
 #include <unistd.h>
 
-#include "libvarnish.h"
 #include "vqueue.h"
 #include "varnishstat.h"
 
diff --git a/bin/varnishtest/vtc.h b/bin/varnishtest/vtc.h
index e96940d..3621dc5 100644
--- a/bin/varnishtest/vtc.h
+++ b/bin/varnishtest/vtc.h
@@ -34,11 +34,11 @@
 #include <pthread_np.h>
 #endif
 
+#include "miniobj.h"
+#include "vas.h"
 #include "vqueue.h"
 #include "vsb.h"
-#include "miniobj.h"
 
-struct vsb;
 struct vtclog;
 struct cmds;
 
diff --git a/bin/varnishtop/varnishtop.c b/bin/varnishtop/varnishtop.c
index de3789f..1022e32 100644
--- a/bin/varnishtop/varnishtop.c
+++ b/bin/varnishtop/varnishtop.c
@@ -50,6 +50,7 @@
 
 #include "vsb.h"
 
+#include "vas.h"
 #include "libvarnish.h"
 
 #if 0
diff --git a/include/libvarnish.h b/include/libvarnish.h
index 65287b5..4cbb18d 100644
--- a/include/libvarnish.h
+++ b/include/libvarnish.h
@@ -28,16 +28,6 @@
  *
  */
 
-#include <stdint.h>
-
-#include "vas.h"
-
-#ifndef NULL
-#define NULL ((void*)0)
-#endif
-
-struct vsb;
-
 /* from libvarnish/version.c */
 void VCS_Message(const char *);
 
@@ -54,3 +44,4 @@ void VCS_Message(const char *);
 		assert(vsnprintf(buf, sizeof buf, fmt, ap)		\
 		    < sizeof buf);					\
 	} while (0)
+
diff --git a/include/vnum.h b/include/vnum.h
new file mode 100644
index 0000000..a821355
--- /dev/null
+++ b/include/vnum.h
@@ -0,0 +1,34 @@
+/*-
+ * Copyright (c) 2006 Verdens Gang AS
+ * Copyright (c) 2006-2011 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.
+ *
+ */
+
+#include <stdint.h>
+
+/* from libvarnish/vnum.c */
+const char *VNUM_2bytes(const char *p, uintmax_t *r, uintmax_t rel);
diff --git a/lib/libvarnish/binary_heap.c b/lib/libvarnish/binary_heap.c
index f49c736..4b0edc3 100644
--- a/lib/libvarnish/binary_heap.c
+++ b/lib/libvarnish/binary_heap.c
@@ -35,12 +35,13 @@
 
 #include "config.h"
 
-#include <unistd.h>
-#include <stdlib.h>
 #include <limits.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <unistd.h>
 
 #include "binary_heap.h"
-#include "libvarnish.h"
+#include "vas.h"
 
 /* Parameters --------------------------------------------------------*/
 
diff --git a/lib/libvarnish/cli_auth.c b/lib/libvarnish/cli_auth.c
index fc66fa7..da0a241 100644
--- a/lib/libvarnish/cli_auth.c
+++ b/lib/libvarnish/cli_auth.c
@@ -32,11 +32,10 @@
 #include <stdio.h>
 #include <unistd.h>
 
+#include "vas.h"
 #include "vcli.h"
-#include "libvarnish.h"
 #include "vsha256.h"
 
-
 void
 VCLI_AuthResponse(int S_fd, const char *challenge,
     char response[CLI_AUTH_RESPONSE_LEN + 1])
diff --git a/lib/libvarnish/cli_common.c b/lib/libvarnish/cli_common.c
index 994bd9a..e423da4 100644
--- a/lib/libvarnish/cli_common.c
+++ b/lib/libvarnish/cli_common.c
@@ -36,6 +36,7 @@
 #include <poll.h>
 #include <signal.h>
 #include <stdarg.h>
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -44,7 +45,7 @@
 
 #include "vsb.h"
 
-#include "libvarnish.h"
+#include "vas.h"
 
 #include "vcli.h"
 #include "cli_priv.h"
diff --git a/lib/libvarnish/cli_serve.c b/lib/libvarnish/cli_serve.c
index 03cf1d4..13b9663 100644
--- a/lib/libvarnish/cli_serve.c
+++ b/lib/libvarnish/cli_serve.c
@@ -39,6 +39,7 @@
 #include <time.h>
 #include <unistd.h>
 
+#include "vas.h"
 #include "vqueue.h"
 #include "vsb.h"
 #include "vav.h"
@@ -47,7 +48,6 @@
 #include "cli_priv.h"
 #include "cli_common.h"
 #include "cli_serve.h"
-#include "libvarnish.h"
 #include "miniobj.h"
 
 struct VCLS_func {
diff --git a/lib/libvarnish/vas.c b/lib/libvarnish/vas.c
index 82351ce..6f69928 100644
--- a/lib/libvarnish/vas.c
+++ b/lib/libvarnish/vas.c
@@ -35,7 +35,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "libvarnish.h"
+#include "vas.h"
 
 static void
 VAS_Fail_default(const char *func, const char *file, int line,
diff --git a/lib/libvarnish/vev.c b/lib/libvarnish/vev.c
index c55ebfc..004ce08 100644
--- a/lib/libvarnish/vev.c
+++ b/lib/libvarnish/vev.c
@@ -38,7 +38,7 @@
 #include <stdlib.h>
 #include <pthread.h>
 
-#include "libvarnish.h"
+#include "vas.h"
 #include "vtim.h"
 #include "vev.h"
 #include "miniobj.h"
diff --git a/lib/libvarnish/vin.c b/lib/libvarnish/vin.c
index 0f1b680..ccd58a9 100644
--- a/lib/libvarnish/vin.c
+++ b/lib/libvarnish/vin.c
@@ -36,9 +36,10 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "libvarnish.h"
+#include "vas.h"
 #include "vsm.h"
 #include "vin.h"
+#include "libvarnish.h"
 
 int
 VIN_N_Arg(const char *n_arg, char **name, char **dir, char **vsl)
diff --git a/lib/libvarnish/vlu.c b/lib/libvarnish/vlu.c
index db107a1..01d21de 100644
--- a/lib/libvarnish/vlu.c
+++ b/lib/libvarnish/vlu.c
@@ -34,6 +34,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include "libvarnish.h"
+#include "vas.h"
 #include "vlu.h"
 #include "miniobj.h"
 
diff --git a/lib/libvarnish/vpf.c b/lib/libvarnish/vpf.c
index c35b3cd..f6543c6 100644
--- a/lib/libvarnish/vpf.c
+++ b/lib/libvarnish/vpf.c
@@ -34,6 +34,7 @@
 
 #include <errno.h>
 #include <fcntl.h>
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -41,6 +42,7 @@
 
 #include "libvarnish.h"		/* XXX: for assert() */
 #include "flopen.h"
+#include "vas.h"
 #include "vpf.h"
 
 struct vpf_fh {
diff --git a/lib/libvarnish/vre.c b/lib/libvarnish/vre.c
index 68beaf8..e330e99 100644
--- a/lib/libvarnish/vre.c
+++ b/lib/libvarnish/vre.c
@@ -31,6 +31,7 @@
 
 #include "libvarnish.h"
 #include "miniobj.h"
+#include "vas.h"
 #include "vre.h"
 
 struct vre {
diff --git a/lib/libvarnish/vsb.c b/lib/libvarnish/vsb.c
index 75414f7..4930be2 100644
--- a/lib/libvarnish/vsb.c
+++ b/lib/libvarnish/vsb.c
@@ -35,7 +35,7 @@ __FBSDID("$FreeBSD: head/sys/kern/subr_vsb.c 222004 2011-05-17 06:36:32Z phk $")
 #include <stdlib.h>
 #include <string.h>
 
-#include "libvarnish.h"
+#include "vas.h"
 #include "vsb.h"
 
 #define	KASSERT(e, m)		assert(e)
diff --git a/lib/libvarnish/vsha256.c b/lib/libvarnish/vsha256.c
index 83dd6a1..942a186 100644
--- a/lib/libvarnish/vsha256.c
+++ b/lib/libvarnish/vsha256.c
@@ -42,7 +42,7 @@
 #define VBIG_ENDIAN	_BIG_ENDIAN
 #endif
 
-#include "libvarnish.h"
+#include "vas.h"
 #include "vsha256.h"
 #include "vend.h"
 
diff --git a/lib/libvarnish/vss.c b/lib/libvarnish/vss.c
index ff19ac7..297df11 100644
--- a/lib/libvarnish/vss.c
+++ b/lib/libvarnish/vss.c
@@ -43,7 +43,7 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "libvarnish.h"
+#include "vas.h"
 #include "vtcp.h"
 #include "vss.h"
 
diff --git a/lib/libvarnish/vtcp.c b/lib/libvarnish/vtcp.c
index e8932e8..c955e65 100644
--- a/lib/libvarnish/vtcp.c
+++ b/lib/libvarnish/vtcp.c
@@ -51,8 +51,8 @@
 #include <unistd.h>
 #include <math.h>
 
+#include "vas.h"
 #include "vtcp.h"
-#include "libvarnish.h"
 
 /*--------------------------------------------------------------------*/
 
diff --git a/lib/libvcl/vcc_compile.h b/lib/libvcl/vcc_compile.h
index 141f4f1..ebbba86 100644
--- a/lib/libvcl/vcc_compile.h
+++ b/lib/libvcl/vcc_compile.h
@@ -28,15 +28,22 @@
  *
  */
 
-#include "vqueue.h"
+#include <stdint.h>
+
+#include "libvarnish.h"
+#include "vas.h"
 
 #include "miniobj.h"
-#include "vsb.h"
 #include "vcl.h"
-#include "libvarnish.h"
+#include "vqueue.h"
+#include "vsb.h"
 
 #include "vcc_token_defs.h"
 
+#ifndef NULL
+#define NULL ((void*)0)
+#endif
+
 struct vsb;
 
 #define isident1(c) (isalpha(c))



More information about the varnish-commit mailing list