[master] e5cbbed Use VCL typedefs for generated VRT prototypes, and also for implementations which return VCL_IP

Poul-Henning Kamp phk at varnish-cache.org
Sun Oct 27 23:38:51 CET 2013


commit e5cbbedd2d9342595817c1b66b22d1c90e8c60fc
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Sun Oct 27 22:38:28 2013 +0000

    Use VCL typedefs for generated VRT prototypes, and also for implementations
    which return VCL_IP

diff --git a/bin/varnishd/cache/cache_vrt_var.c b/bin/varnishd/cache/cache_vrt_var.c
index ec97408..2526d3b 100644
--- a/bin/varnishd/cache/cache_vrt_var.c
+++ b/bin/varnishd/cache/cache_vrt_var.c
@@ -258,7 +258,7 @@ VRT_r_beresp_backend_name(const struct vrt_ctx *ctx)
 	return(ctx->bo->vbc->backend->vcl_name);
 }
 
-const void *
+VCL_IP
 VRT_r_beresp_backend_ip(const struct vrt_ctx *ctx)
 {
 
@@ -535,7 +535,7 @@ REQ_BOOL(hash_always_miss)
 
 /*--------------------------------------------------------------------*/
 
-const void *
+VCL_IP
 VRT_r_client_ip(const struct vrt_ctx *ctx)
 {
 
diff --git a/lib/libvcc/generate.py b/lib/libvcc/generate.py
index 0d21382..f0224e3 100755
--- a/lib/libvcc/generate.py
+++ b/lib/libvcc/generate.py
@@ -815,6 +815,7 @@ const struct var vcc_vars[] = {
 
 sp_variables.sort()
 for i in sp_variables:
+	fh.write("\n")
 	typ = i[1]
 	cnam = i[0].replace(".", "_")
 	ctyp = vcltypes[typ]
@@ -829,7 +830,7 @@ for i in sp_variables:
 		fo.write('",\n')
 	else:
 		fo.write('\t    "VRT_r_%s(ctx)",\n' % cnam)
-		fh.write(ctyp + " VRT_r_%s(const struct vrt_ctx *);\n" % cnam )
+		fh.write("VCL_" + typ + " VRT_r_%s(const struct vrt_ctx *);\n" % cnam )
 	restrict(fo, i[2])
 
 	if len(i[3]) == 0:
@@ -842,7 +843,7 @@ for i in sp_variables:
 		fo.write('\t    "VRT_l_%s(ctx, ",\n' % cnam)
 		fh.write("void VRT_l_%s(const struct vrt_ctx *, " % cnam)
 		if typ != "STRING":
-			fh.write(ctyp + ");\n")
+			fh.write("VCL_" + typ + ");\n")
 		else:
 			fh.write(ctyp + ", ...);\n")
 	restrict(fo, i[3])
@@ -851,6 +852,7 @@ for i in sp_variables:
 
 fo.write("\t{ NULL }\n};\n")
 
+fh.write("\n")
 for i in stv_variables:
 	fh.write(vcltypes[i[1]] + " VRT_Stv_" + i[0] + "(const char *);\n")
 



More information about the varnish-commit mailing list