[master] a32c827 Put some "section headers" in the compiled VCL code.
Poul-Henning Kamp
phk at varnish-cache.org
Sun Oct 27 13:43:45 CET 2013
commit a32c82723ebc1c81287646b515705405a75af83e
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Sun Oct 27 12:43:30 2013 +0000
Put some "section headers" in the compiled VCL code.
diff --git a/lib/libvcc/generate.py b/lib/libvcc/generate.py
index 6b5b365..0d21382 100755
--- a/lib/libvcc/generate.py
+++ b/lib/libvcc/generate.py
@@ -542,7 +542,9 @@ def emit_vcl_tnames(fo, tokens):
#######################################################################
# Read a C-source file and spit out code that outputs it with VSB_cat()
-def emit_file(fo, fn):
+def emit_file(fo, fd, bn):
+ fn = fd + "/" + bn
+
fi = open(fn)
fc = fi.read()
fi.close()
@@ -553,6 +555,7 @@ def emit_file(fo, fn):
x = 0
l = 0
fo.write("\n\t/* %s */\n\n" % fn)
+ fo.write('\tVSB_cat(sb, "/* ---===### %s ###===--- */\\n");\n' % bn)
for c in fc:
if l == 0:
fo.write("\tVSB_cat(sb, \"")
@@ -878,9 +881,9 @@ vcl_output_lang_h(struct vsb *sb)
{
""")
-emit_file(fo, buildroot + "/include/vcl.h")
-emit_file(fo, srcroot + "/include/vrt.h")
-emit_file(fo, buildroot + "/include/vrt_obj.h")
+emit_file(fo, buildroot, "include/vcl.h")
+emit_file(fo, srcroot, "include/vrt.h")
+emit_file(fo, buildroot, "include/vrt_obj.h")
fo.write("""
}
diff --git a/lib/libvcc/vcc_compile.c b/lib/libvcc/vcc_compile.c
index 1b3ee4e..41b8ede 100644
--- a/lib/libvcc/vcc_compile.c
+++ b/lib/libvcc/vcc_compile.c
@@ -626,7 +626,7 @@ vcc_CompileSource(const struct vcc *tl0, struct vsb *sb, struct source *sp)
sym->wildcard = vcc_Stv_Wildcard;
vcl_output_lang_h(tl->fh);
- Fh(tl, 0, "\n/* ---===### VCC generated below here ###===---*/\n");
+ Fh(tl, 0, "\n/* ---===### VCC generated code ###===---*/\n");
Fh(tl, 0, "\nextern const struct VCL_conf VCL_conf;\n");
/* Macro for accessing directors */
More information about the varnish-commit
mailing list