[master] e78e58ef1 Tell VCC about VEXTs.

Poul-Henning Kamp phk at FreeBSD.org
Mon Aug 1 12:28:05 UTC 2022


commit e78e58ef1f9bc26d7a27856654c4417f91a5b79c
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Aug 1 11:23:23 2022 +0000

    Tell VCC about VEXTs.

diff --git a/bin/varnishd/common/common_vext.c b/bin/varnishd/common/common_vext.c
index fffd9a8d5..d655fc4f5 100644
--- a/bin/varnishd/common/common_vext.c
+++ b/bin/varnishd/common/common_vext.c
@@ -85,6 +85,15 @@ vext_argument(const char *arg)
 		    vp->argv[1], strerror(errno));
 }
 
+void
+vext_iter(vext_iter_f *func, void *priv)
+{
+	struct vext *vp;
+
+	VTAILQ_FOREACH(vp, &vext_list, list)
+		func(VSB_data(vp->vsb), priv);
+}
+
 void
 vext_copyin(struct vsb *vident)
 {
diff --git a/bin/varnishd/common/heritage.h b/bin/varnishd/common/heritage.h
index 7ef4b04ba..48b0e243d 100644
--- a/bin/varnishd/common/heritage.h
+++ b/bin/varnishd/common/heritage.h
@@ -134,3 +134,5 @@ void vext_argument(const char *);
 void vext_copyin(struct vsb *);
 void vext_load(void);
 void vext_cleanup(void);
+typedef void vext_iter_f(const char *, void *);
+void vext_iter(vext_iter_f *func, void *);
diff --git a/bin/varnishd/mgt/mgt_vcc.c b/bin/varnishd/mgt/mgt_vcc.c
index f55031a1c..d029ab057 100644
--- a/bin/varnishd/mgt/mgt_vcc.c
+++ b/bin/varnishd/mgt/mgt_vcc.c
@@ -85,6 +85,13 @@ mgt_DumpBuiltin(void)
  * Invoke system VCC compiler in a sub-process
  */
 
+static void
+vcc_vext_iter_func(const char *filename, void *priv)
+{
+
+	VCC_VEXT(priv, filename);
+}
+
 static void v_noreturn_ v_matchproto_(vsub_func_f)
 run_vcc(void *priv)
 {
@@ -110,6 +117,8 @@ run_vcc(void *priv)
 	VCC_Opt_ ## l(vcc, MGT_VCC_FEATURE(VCC_FEATURE_ ## U));
 #include "tbl/vcc_feature_bits.h"
 
+	vext_iter(vcc_vext_iter_func, vcc);
+
 	STV_Foreach(stv)
 		VCC_Predef(vcc, "VCL_STEVEDORE", stv->ident);
 	VTAILQ_FOREACH(vpg, &vclhead, list)
diff --git a/include/libvcc.h b/include/libvcc.h
index 3bf4e15c8..852fe91b0 100644
--- a/include/libvcc.h
+++ b/include/libvcc.h
@@ -38,6 +38,7 @@ void VCC_VCL_path(struct vcc *, const char *);
 void VCC_VMOD_path(struct vcc *, const char *);
 void VCC_Predef(struct vcc *, const char *type, const char *name);
 void VCC_VCL_Range(unsigned *, unsigned *);
+void VCC_VEXT(struct vcc *, const char *);
 
 #define VCC_FEATURE_BIT(U, l, d)				\
 	void VCC_Opt_ ## l(struct vcc *, unsigned);
diff --git a/lib/libvcc/vcc_compile.c b/lib/libvcc/vcc_compile.c
index 4d04328bf..a23791dca 100644
--- a/lib/libvcc/vcc_compile.c
+++ b/lib/libvcc/vcc_compile.c
@@ -956,3 +956,10 @@ VCC_Predef(struct vcc *vcc, const char *type, const char *name)
 	else
 		WRONG("Unknown VCC predef type");
 }
+
+void
+VCC_VEXT(struct vcc *vcc, const char *filename)
+{
+	CHECK_OBJ_NOTNULL(vcc, VCC_MAGIC);
+	(void)filename;
+}


More information about the varnish-commit mailing list