r3478 - in trunk/varnish-cache: include lib/libvcl

phk at projects.linpro.no phk at projects.linpro.no
Sun Dec 21 11:46:34 CET 2008


Author: phk
Date: 2008-12-21 11:46:34 +0100 (Sun, 21 Dec 2008)
New Revision: 3478

Modified:
   trunk/varnish-cache/include/libvcl.h
   trunk/varnish-cache/lib/libvcl/vcc_compile.c
Log:
Add a VCC_Return_Name() function to convert a return action to a string.



Modified: trunk/varnish-cache/include/libvcl.h
===================================================================
--- trunk/varnish-cache/include/libvcl.h	2008-12-21 10:45:33 UTC (rev 3477)
+++ trunk/varnish-cache/include/libvcl.h	2008-12-21 10:46:34 UTC (rev 3478)
@@ -31,5 +31,5 @@
 
 char *VCC_Compile(struct vsb *sb, const char *b, const char *e);
 void VCC_InitCompile(const char *default_vcl);
+const char *VCC_Return_Name(unsigned action);
 
-

Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_compile.c	2008-12-21 10:45:33 UTC (rev 3477)
+++ trunk/varnish-cache/lib/libvcl/vcc_compile.c	2008-12-21 10:46:34 UTC (rev 3478)
@@ -662,6 +662,23 @@
 	return (r);
 }
 
+/*--------------------------------------------------------------------*/
+
+const char *
+VCC_Return_Name(unsigned method)
+{
+
+	switch (method) {
+	case 0:	return ("<none>");
+#define VCL_RET_MAC(l, u, b, i) case b: return(#u);
+#define VCL_RET_MAC_E(l, u, b, i) case b: return(#u);
+#include "vcl_returns.h"
+#undef VCL_RET_MAC_E
+#undef VCL_RET_MAC
+	}
+	return (NULL);
+}
+
 /*--------------------------------------------------------------------
  * Initialize the compiler and register the default VCL code for later
  * compilation runs.



More information about the varnish-commit mailing list