[master] f58469a70 Reserve "VPI_" for functions which only VCC is allowed to call.

Poul-Henning Kamp phk at FreeBSD.org
Tue Apr 23 09:08:08 UTC 2019


commit f58469a700a86932bf3502aeb58e33e7e667e551
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Apr 23 08:53:32 2019 +0000

    Reserve "VPI_" for functions which only VCC is allowed to call.

diff --git a/bin/varnishd/cache/cache_vrt_vcl.c b/bin/varnishd/cache/cache_vrt_vcl.c
index c06066da5..0137655f3 100644
--- a/bin/varnishd/cache/cache_vrt_vcl.c
+++ b/bin/varnishd/cache/cache_vrt_vcl.c
@@ -325,7 +325,7 @@ VRT_count(VRT_CTX, unsigned u)
 }
 
 VCL_VCL
-VRT_vcl_get(VRT_CTX, const char *name)
+VPI_vcl_get(VRT_CTX, const char *name)
 {
 	VCL_VCL vcl;
 
@@ -339,7 +339,7 @@ VRT_vcl_get(VRT_CTX, const char *name)
 }
 
 void
-VRT_vcl_rel(VRT_CTX, VCL_VCL vcl)
+VPI_vcl_rel(VRT_CTX, VCL_VCL vcl)
 {
 	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
 	AN(vcl);
@@ -349,7 +349,7 @@ VRT_vcl_rel(VRT_CTX, VCL_VCL vcl)
 }
 
 void
-VRT_vcl_select(VRT_CTX, VCL_VCL vcl)
+VPI_vcl_select(VRT_CTX, VCL_VCL vcl)
 {
 	struct req *req = ctx->req;
 
diff --git a/doc/sphinx/reference/vtla.rst b/doc/sphinx/reference/vtla.rst
index 76dccd068..a2f2e3030 100644
--- a/doc/sphinx/reference/vtla.rst
+++ b/doc/sphinx/reference/vtla.rst
@@ -62,6 +62,10 @@ VLU
     Varnish Line Up -- library functions to collect stream of bytes
     into lines for processing. (lib/libvarnish/vlu.c)
 
+VPI
+    VCC Private Interface -- functions in varnishd which only VCC is
+    allowed to call.
+
 VRE
     Varnish Regular Expression -- library functions for regular expression
     based matching and substring replacement. (lib/libvarnish/vre.c)
diff --git a/include/vcc_interface.h b/include/vcc_interface.h
index 08b4756de..f86157555 100644
--- a/include/vcc_interface.h
+++ b/include/vcc_interface.h
@@ -33,6 +33,6 @@
  * NB: When this file is changed, lib/libvcc/generate.py *MUST* be rerun.
  */
 
-VCL_VCL VRT_vcl_get(VRT_CTX, const char *);
-void VRT_vcl_rel(VRT_CTX, VCL_VCL);
-void VRT_vcl_select(VRT_CTX, VCL_VCL);
+VCL_VCL VPI_vcl_get(VRT_CTX, const char *);
+void VPI_vcl_rel(VRT_CTX, VCL_VCL);
+void VPI_vcl_select(VRT_CTX, VCL_VCL);
diff --git a/lib/libvcc/vcc_action.c b/lib/libvcc/vcc_action.c
index 02d323a14..af1d7fee6 100644
--- a/lib/libvcc/vcc_action.c
+++ b/lib/libvcc/vcc_action.c
@@ -284,12 +284,12 @@ vcc_act_return_vcl(struct vcc *tl)
 
 		p = New_IniFin(tl);
 		AN(p);
-		VSB_printf(p->ini, "\t%s = VRT_vcl_get(ctx, \"%s\");",
+		VSB_printf(p->ini, "\t%s = VPI_vcl_get(ctx, \"%s\");",
 		    buf, sym->name);
-		VSB_printf(p->fin, "\tVRT_vcl_rel(ctx, %s);",
+		VSB_printf(p->fin, "\tVPI_vcl_rel(ctx, %s);",
 		    buf);
 	}
-	Fb(tl, 1, "VRT_vcl_select(ctx, %s);\t/* %s */\n",
+	Fb(tl, 1, "VPI_vcl_select(ctx, %s);\t/* %s */\n",
 	    (const char*)sym->eval_priv, sym->name);
 	SkipToken(tl, ')');
 }


More information about the varnish-commit mailing list