r5202 - trunk/varnish-cache/lib/libvcl

phk at varnish-cache.org phk at varnish-cache.org
Tue Sep 14 09:45:32 CEST 2010


Author: phk
Date: 2010-09-14 09:45:32 +0200 (Tue, 14 Sep 2010)
New Revision: 5202

Modified:
   trunk/varnish-cache/lib/libvcl/vcc_compile.c
   trunk/varnish-cache/lib/libvcl/vcc_compile.h
   trunk/varnish-cache/lib/libvcl/vcc_symb.c
   trunk/varnish-cache/lib/libvcl/vcc_vmod.c
Log:
Set symbol kind at creation, so all symbols have one.



Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_compile.c	2010-09-14 07:31:05 UTC (rev 5201)
+++ trunk/varnish-cache/lib/libvcl/vcc_compile.c	2010-09-14 07:45:32 UTC (rev 5202)
@@ -555,7 +555,7 @@
 	tl->sb = sb;
 
 	for (v = tl->vars; v->name != NULL; v++) {
-		sym = VCC_AddSymbol(tl, v->name);
+		sym = VCC_AddSymbol(tl, v->name, SYM_VAR);
 		sym->var = v;
 		sym->fmt = v->fmt;
 		sym->r_methods = v->r_methods;

Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.h
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_compile.h	2010-09-14 07:31:05 UTC (rev 5201)
+++ trunk/varnish-cache/lib/libvcl/vcc_compile.h	2010-09-14 07:45:32 UTC (rev 5202)
@@ -258,7 +258,7 @@
 void vcc_ExpectedStringval(struct vcc *tl);
 
 /* vcc_symbol */
-struct symbol *VCC_AddSymbol(struct vcc *tl, const char *name);
+struct symbol *VCC_AddSymbol(struct vcc *tl, const char *name, enum symkind);
 const struct symbol *VCC_FindSymbol(const struct vcc *tl,
     const struct token *t);
 

Modified: trunk/varnish-cache/lib/libvcl/vcc_symb.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_symb.c	2010-09-14 07:31:05 UTC (rev 5201)
+++ trunk/varnish-cache/lib/libvcl/vcc_symb.c	2010-09-14 07:45:32 UTC (rev 5202)
@@ -45,7 +45,7 @@
 
 
 struct symbol *
-VCC_AddSymbol(struct vcc *tl, const char *name)
+VCC_AddSymbol(struct vcc *tl, const char *name, enum symkind kind)
 {
 	struct symbol *sym;
 
@@ -61,6 +61,7 @@
 	AN(name);
 	sym->nlen = strlen(name);
 	VTAILQ_INSERT_TAIL(&tl->symbols, sym, list);
+	sym->kind = kind;
 	return (sym);
 }
 

Modified: trunk/varnish-cache/lib/libvcl/vcc_vmod.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_vmod.c	2010-09-14 07:31:05 UTC (rev 5201)
+++ trunk/varnish-cache/lib/libvcl/vcc_vmod.c	2010-09-14 07:45:32 UTC (rev 5202)
@@ -80,8 +80,7 @@
 	}
 
 	bprintf(fn, "%.*s", PF(mod));
-	sym = VCC_AddSymbol(tl, fn);
-	sym->kind = SYM_VMOD;
+	sym = VCC_AddSymbol(tl, fn, SYM_VMOD);
 	sym->def_b = t1;
 	sym->def_e = tl->t;
 
@@ -152,7 +151,7 @@
 			Fi(tl, 0, "\t%s(&vmod_priv_%.*s, &VCL_conf);\n", p, PF(mod));
 			Ff(tl, 0, "\t%s(&vmod_priv_%.*s, 0);\n", p, PF(mod));
 		} else {
-			sym = VCC_AddSymbol(tl, p);
+			sym = VCC_AddSymbol(tl, p, SYM_FUNC);
 			p += strlen(p) + 1;
 			sym->cfunc = p;
 			p += strlen(p) + 1;




More information about the varnish-commit mailing list