r761 - in trunk/varnish-cache: bin/varnishd include include/compat lib/libcompat lib/libvcl

des at projects.linpro.no des at projects.linpro.no
Tue Aug 8 09:17:10 CEST 2006


Author: des
Date: 2006-08-08 09:17:10 +0200 (Tue, 08 Aug 2006)
New Revision: 761

Added:
   trunk/varnish-cache/include/compat/
   trunk/varnish-cache/include/compat/asprintf.h
   trunk/varnish-cache/include/compat/strlcat.h
   trunk/varnish-cache/include/compat/strlcpy.h
   trunk/varnish-cache/include/compat/vasprintf.h
Removed:
   trunk/varnish-cache/include/compat.h
Modified:
   trunk/varnish-cache/bin/varnishd/mgt_cli.c
   trunk/varnish-cache/bin/varnishd/mgt_vcc.c
   trunk/varnish-cache/bin/varnishd/storage_file.c
   trunk/varnish-cache/bin/varnishd/tcp.c
   trunk/varnish-cache/include/Makefile.am
   trunk/varnish-cache/lib/libcompat/asprintf.c
   trunk/varnish-cache/lib/libcompat/strlcat.c
   trunk/varnish-cache/lib/libcompat/strlcpy.c
   trunk/varnish-cache/lib/libcompat/vasprintf.c
   trunk/varnish-cache/lib/libvcl/vcc_compile.c
Log:
Split compat.h into one header per function to avoid issues with e.g. the
vasprintf() prototype needing <stdarg.h> even when it isn't used.

Modified: trunk/varnish-cache/bin/varnishd/mgt_cli.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_cli.c	2006-08-08 07:15:56 UTC (rev 760)
+++ trunk/varnish-cache/bin/varnishd/mgt_cli.c	2006-08-08 07:17:10 UTC (rev 761)
@@ -13,7 +13,7 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "compat.h"
+#include "compat/vasprintf.h"
 #include "cli_priv.h"
 #include "cli.h"
 #include "vsb.h"

Modified: trunk/varnish-cache/bin/varnishd/mgt_vcc.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_vcc.c	2006-08-08 07:15:56 UTC (rev 760)
+++ trunk/varnish-cache/bin/varnishd/mgt_vcc.c	2006-08-08 07:17:10 UTC (rev 761)
@@ -11,7 +11,7 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "compat.h"
+#include "compat/asprintf.h"
 #include "vsb.h"
 #include "queue.h"
 

Modified: trunk/varnish-cache/bin/varnishd/storage_file.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/storage_file.c	2006-08-08 07:15:56 UTC (rev 760)
+++ trunk/varnish-cache/bin/varnishd/storage_file.c	2006-08-08 07:17:10 UTC (rev 761)
@@ -19,7 +19,7 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "compat.h"
+#include "compat/asprintf.h"
 #include "shmlog.h"
 #include "cache.h"
 

Modified: trunk/varnish-cache/bin/varnishd/tcp.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/tcp.c	2006-08-08 07:15:56 UTC (rev 760)
+++ trunk/varnish-cache/bin/varnishd/tcp.c	2006-08-08 07:17:10 UTC (rev 761)
@@ -10,6 +10,7 @@
 #include <stdio.h>
 #include <string.h>
 
+#include "compat/strlcpy.h"
 #include "heritage.h"
 #include "mgt.h"
 

Modified: trunk/varnish-cache/include/Makefile.am
===================================================================
--- trunk/varnish-cache/include/Makefile.am	2006-08-08 07:15:56 UTC (rev 760)
+++ trunk/varnish-cache/include/Makefile.am	2006-08-08 07:17:10 UTC (rev 761)
@@ -5,7 +5,10 @@
 	cli.h \
 	cli_common.h \
 	cli_priv.h \
-	compat.h \
+	compat/asprintf.h \
+	compat/strlcat.h \
+	compat/strlcpy.h \
+	compat/vasprintf.h \
 	hash.h \
 	http_headers.h \
 	libvarnish.h \

Added: trunk/varnish-cache/include/compat/asprintf.h
===================================================================
--- trunk/varnish-cache/include/compat/asprintf.h	2006-08-08 07:15:56 UTC (rev 760)
+++ trunk/varnish-cache/include/compat/asprintf.h	2006-08-08 07:17:10 UTC (rev 761)
@@ -0,0 +1,12 @@
+/*
+ * $Id$
+ */
+
+#ifndef COMPAT_ASPRINTF_H_INCLUDED
+#define COMPAT_ASPRINTF_H_INCLUDED
+
+#ifndef HAVE_ASPRINTF
+int asprintf(char **strp, const char *fmt, ...);
+#endif
+
+#endif


Property changes on: trunk/varnish-cache/include/compat/asprintf.h
___________________________________________________________________
Name: svn:keywords
   + Id

Added: trunk/varnish-cache/include/compat/strlcat.h
===================================================================
--- trunk/varnish-cache/include/compat/strlcat.h	2006-08-08 07:15:56 UTC (rev 760)
+++ trunk/varnish-cache/include/compat/strlcat.h	2006-08-08 07:17:10 UTC (rev 761)
@@ -0,0 +1,12 @@
+/*
+ * $Id$
+ */
+
+#ifndef COMPAT_STRLCAT_H_INCLUDED
+#define COMPAT_STRLCAT_H_INCLUDED
+
+#ifndef HAVE_STRLCAT
+size_t strlcat(char *dst, const char *src, size_t size);
+#endif
+
+#endif


Property changes on: trunk/varnish-cache/include/compat/strlcat.h
___________________________________________________________________
Name: svn:keywords
   + Id

Added: trunk/varnish-cache/include/compat/strlcpy.h
===================================================================
--- trunk/varnish-cache/include/compat/strlcpy.h	2006-08-08 07:15:56 UTC (rev 760)
+++ trunk/varnish-cache/include/compat/strlcpy.h	2006-08-08 07:17:10 UTC (rev 761)
@@ -0,0 +1,12 @@
+/*
+ * $Id$
+ */
+
+#ifndef COMPAT_STRLCPY_H_INCLUDED
+#define COMPAT_STRLCPY_H_INCLUDED
+
+#ifndef HAVE_STRLCPY
+size_t strlcpy(char *dst, const char *src, size_t size);
+#endif
+
+#endif


Property changes on: trunk/varnish-cache/include/compat/strlcpy.h
___________________________________________________________________
Name: svn:keywords
   + Id

Added: trunk/varnish-cache/include/compat/vasprintf.h
===================================================================
--- trunk/varnish-cache/include/compat/vasprintf.h	2006-08-08 07:15:56 UTC (rev 760)
+++ trunk/varnish-cache/include/compat/vasprintf.h	2006-08-08 07:17:10 UTC (rev 761)
@@ -0,0 +1,12 @@
+/*
+ * $Id$
+ */
+
+#ifndef COMPAT_VASPRINTF_H_INCLUDED
+#define COMPAT_VASPRINTF_H_INCLUDED
+
+#ifndef HAVE_VASPRINTF
+int vasprintf(char **strp, const char *fmt, va_list ap);
+#endif
+
+#endif


Property changes on: trunk/varnish-cache/include/compat/vasprintf.h
___________________________________________________________________
Name: svn:keywords
   + Id

Deleted: trunk/varnish-cache/include/compat.h
===================================================================
--- trunk/varnish-cache/include/compat.h	2006-08-08 07:15:56 UTC (rev 760)
+++ trunk/varnish-cache/include/compat.h	2006-08-08 07:17:10 UTC (rev 761)
@@ -1,26 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef COMPAT_H_INCLUDED
-#define COMPAT_H_INCLUDED
-
-#ifndef HAVE_VASPRINTF
-#ifdef va_start /* make sure <stdarg.h> is in scope */
-int vasprintf(char **strp, const char *fmt, va_list ap);
-#endif
-#endif
-
-#ifndef HAVE_ASPRINTF
-int asprintf(char **strp, const char *fmt, ...);
-#endif
-
-#ifndef HAVE_STRLCPY
-size_t strlcpy(char *dst, const char *src, size_t size);
-#endif
-
-#ifndef HAVE_STRLCAT
-size_t strlcat(char *dst, const char *src, size_t size);
-#endif
-
-#endif

Modified: trunk/varnish-cache/lib/libcompat/asprintf.c
===================================================================
--- trunk/varnish-cache/lib/libcompat/asprintf.c	2006-08-08 07:15:56 UTC (rev 760)
+++ trunk/varnish-cache/lib/libcompat/asprintf.c	2006-08-08 07:17:10 UTC (rev 761)
@@ -3,12 +3,14 @@
  *
  */
 
+#ifndef HAVE_ASPRINTF
+
 #include <stdarg.h>
 #include <stdio.h>
 
-#include "compat.h"
+#include "compat/asprintf.h"
+#include "compat/vasprintf.h"
 
-#ifndef HAVE_ASPRINTF
 int
 asprintf(char **strp, const char *fmt, ...)
 {

Modified: trunk/varnish-cache/lib/libcompat/strlcat.c
===================================================================
--- trunk/varnish-cache/lib/libcompat/strlcat.c	2006-08-08 07:15:56 UTC (rev 760)
+++ trunk/varnish-cache/lib/libcompat/strlcat.c	2006-08-08 07:17:10 UTC (rev 761)
@@ -17,12 +17,13 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#ifndef HAVE_STRLCAT
+
 #include <sys/types.h>
 #include <string.h>
 
-#include "compat.h"
+#include "compat/strlcat.h"
 
-#ifndef HAVE_STRLCAT
 /*
  * Appends src to string dst of size siz (unlike strncat, siz is the
  * full size of dst, not space left).  At most siz-1 characters

Modified: trunk/varnish-cache/lib/libcompat/strlcpy.c
===================================================================
--- trunk/varnish-cache/lib/libcompat/strlcpy.c	2006-08-08 07:15:56 UTC (rev 760)
+++ trunk/varnish-cache/lib/libcompat/strlcpy.c	2006-08-08 07:17:10 UTC (rev 761)
@@ -17,12 +17,13 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#ifndef HAVE_STRLCPY
+
 #include <sys/types.h>
 #include <string.h>
 
-#include "compat.h"
+#include "compat/strlcpy.h"
 
-#ifndef HAVE_STRLCPY
 /*
  * Copy src to string dst of size siz.  At most siz-1 characters
  * will be copied.  Always NUL terminates (unless siz == 0).

Modified: trunk/varnish-cache/lib/libcompat/vasprintf.c
===================================================================
--- trunk/varnish-cache/lib/libcompat/vasprintf.c	2006-08-08 07:15:56 UTC (rev 760)
+++ trunk/varnish-cache/lib/libcompat/vasprintf.c	2006-08-08 07:17:10 UTC (rev 761)
@@ -3,13 +3,14 @@
  *
  */
 
+#ifndef HAVE_VASPRINTF
+
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "compat.h"
+#include "compat/vasprintf.h"
 
-#ifndef HAVE_VASPRINTF
 int
 vasprintf(char **strp, const char *fmt, va_list ap)
 {

Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_compile.c	2006-08-08 07:15:56 UTC (rev 760)
+++ trunk/varnish-cache/lib/libvcl/vcc_compile.c	2006-08-08 07:17:10 UTC (rev 761)
@@ -49,7 +49,7 @@
 #include <queue.h>
 #include <unistd.h>
 
-#include "compat.h"
+#include "compat/asprintf.h"
 #include "vsb.h"
 
 #include "vcc_priv.h"




More information about the varnish-commit mailing list