r3671 - in branches/2.0/varnish-cache: include lib/libvcl

tfheen at projects.linpro.no tfheen at projects.linpro.no
Fri Feb 6 14:44:13 CET 2009


Author: tfheen
Date: 2009-02-06 14:44:13 +0100 (Fri, 06 Feb 2009)
New Revision: 3671

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



Modified: branches/2.0/varnish-cache/include/libvcl.h
===================================================================
--- branches/2.0/varnish-cache/include/libvcl.h	2009-02-06 13:41:00 UTC (rev 3670)
+++ branches/2.0/varnish-cache/include/libvcl.h	2009-02-06 13:44:13 UTC (rev 3671)
@@ -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: branches/2.0/varnish-cache/lib/libvcl/vcc_compile.c
===================================================================
--- branches/2.0/varnish-cache/lib/libvcl/vcc_compile.c	2009-02-06 13:41:00 UTC (rev 3670)
+++ branches/2.0/varnish-cache/lib/libvcl/vcc_compile.c	2009-02-06 13:44:13 UTC (rev 3671)
@@ -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