r5422 - in trunk/varnish-cache: bin/varnishd include lib/libvcl

phk at varnish-cache.org phk at varnish-cache.org
Mon Oct 11 22:07:11 CEST 2010


Author: phk
Date: 2010-10-11 22:07:10 +0200 (Mon, 11 Oct 2010)
New Revision: 5422

Modified:
   trunk/varnish-cache/bin/varnishd/cache_vrt.c
   trunk/varnish-cache/include/vrt.h
   trunk/varnish-cache/lib/libvcl/vcc_expr.c
Log:
Add conversion from BOOL to STRING



Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vrt.c	2010-10-11 11:56:58 UTC (rev 5421)
+++ trunk/varnish-cache/bin/varnishd/cache_vrt.c	2010-10-11 20:07:10 UTC (rev 5422)
@@ -355,6 +355,14 @@
 	return (d->vcl_name);
 }
 
+const char *
+VRT_bool_string(const struct sess *sp, unsigned val)
+{
+
+	(void)sp;
+	return (val ? "true" : "false");
+}
+
 /*--------------------------------------------------------------------*/
 
 void

Modified: trunk/varnish-cache/include/vrt.h
===================================================================
--- trunk/varnish-cache/include/vrt.h	2010-10-11 11:56:58 UTC (rev 5421)
+++ trunk/varnish-cache/include/vrt.h	2010-10-11 20:07:10 UTC (rev 5422)
@@ -213,6 +213,7 @@
 char *VRT_int_string(const struct sess *sp, int);
 char *VRT_double_string(const struct sess *sp, double);
 char *VRT_time_string(const struct sess *sp, double);
+const char *VRT_bool_string(const struct sess *sp, unsigned);
 const char *VRT_backend_string(struct sess *sp, const struct director *d);
 
 #define VRT_done(sp, hand)			\

Modified: trunk/varnish-cache/lib/libvcl/vcc_expr.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_expr.c	2010-10-11 11:56:58 UTC (rev 5421)
+++ trunk/varnish-cache/lib/libvcl/vcc_expr.c	2010-10-11 20:07:10 UTC (rev 5422)
@@ -359,12 +359,12 @@
 	p = NULL;
 	switch((*e)->fmt) {
 	case BACKEND:	p = "VRT_backend_string(sp, \v1)"; break;
+	case BOOL:	p = "VRT_bool_string(sp, \v1)"; break;
+	case DURATION:	p = "VRT_double_string(sp, \v1)"; break; /* XXX: should have "s" suffix ? */
 	case INT:	p = "VRT_int_string(sp, \v1)"; break;
 	case IP:	p = "VRT_IP_string(sp, \v1)"; break;
+	case REAL:	p = "VRT_double_string(sp, \v1)"; break;
 	case TIME:	p = "VRT_time_string(sp, \v1)"; break;
-	case REAL:	p = "VRT_double_string(sp, \v1)"; break;
-	case DURATION:	p = "VRT_double_string(sp, \v1)"; break;
-			/* XXX: should have "s" suffix ? */
 	default:	break;
 	}
 	if (p != NULL)




More information about the varnish-commit mailing list