[master] a80c4f14d Start segregating the very private API between VCC and Varnishd which nobody else is allowed to even think about calling.

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


commit a80c4f14d2ec046a307a4a041d7647377a7a9a4c
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Apr 23 08:40:16 2019 +0000

    Start segregating the very private API between VCC and Varnishd
    which nobody else is allowed to even think about calling.

diff --git a/bin/varnishd/cache/cache_vrt_vcl.c b/bin/varnishd/cache/cache_vrt_vcl.c
index 8f2cdce77..c06066da5 100644
--- a/bin/varnishd/cache/cache_vrt_vcl.c
+++ b/bin/varnishd/cache/cache_vrt_vcl.c
@@ -38,6 +38,8 @@
 #include "vcl.h"
 #include "vtim.h"
 
+#include "vcc_interface.h"
+
 #include "cache_director.h"
 #include "cache_vcl.h"
 
diff --git a/flint.lnt b/flint.lnt
index 6c98c5c94..c043f969d 100644
--- a/flint.lnt
+++ b/flint.lnt
@@ -35,7 +35,7 @@
 ///////////////////////////////////////////////////////////////////////
 // General stylistic issues
 -e663		// Suspicious array to pointer conversion
--e574		// Signed-unsigned mix with relational
+//-e574		// Signed-unsigned mix with relational
 -e641		// Converting enum '...' to int
 -e716		// while(1) ...
 -e726		// Extraneous comma ignored
diff --git a/include/Makefile.am b/include/Makefile.am
index ddd5fefcf..7899eda6e 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -86,6 +86,7 @@ nobase_noinst_HEADERS = \
 	compat/daemon.h \
 	vfl.h \
 	libvcc.h \
+	vcc_interface.h \
 	vcli_serve.h \
 	vcs_version.h \
 	vct.h \
diff --git a/include/vcc_interface.h b/include/vcc_interface.h
new file mode 100644
index 000000000..08b4756de
--- /dev/null
+++ b/include/vcc_interface.h
@@ -0,0 +1,38 @@
+/*-
+ * Copyright (c) 2006 Verdens Gang AS
+ * Copyright (c) 2006-2019 Varnish Software AS
+ * All rights reserved.
+ *
+ * Author: Poul-Henning Kamp <phk at phk.freebsd.dk>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * Runtime support for compiled VCL programs and VMODs.
+ *
+ * This file contains prototypes for functions nobody but VCC may call.
+ *
+ * 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);
diff --git a/include/vrt.h b/include/vrt.h
index 9f3e52e89..e4e3b8841 100644
--- a/include/vrt.h
+++ b/include/vrt.h
@@ -52,6 +52,9 @@
  * binary/load-time compatible, increment MAJOR version
  *
  * unreleased (planned for 2019-09-15)
+ *	VRT_vcl_get moved to vcc_interface.h
+ *	VRT_vcl_rel emoved to vcc_interface.h
+ *	VRT_vcl_select emoved to vcc_interface.h
  *	[cache.h] WS_ReserveAll() added
  *	[cache.h] WS_Reserve(ws, 0) deprecated
  * 9.0 (2019-03-15)
@@ -110,8 +113,6 @@
  *	VRT_ipcmp added
  *	VRT_Vmod_Init signature changed
  *	VRT_vcl_lookup removed
- *	VRT_vcl_get added
- *	VRT_vcl_rel added
  *	VRT_fail added
  *	[cache.h] WS_Reset and WS_Snapshot signatures changed
  *	[cache.h] WS_Front added
@@ -527,11 +528,6 @@ int VRT_Vmod_Init(VRT_CTX, struct vmod **hdl, unsigned nbr, void *ptr, int len,
     const char *nm, const char *path, const char *file_id, const char *backup);
 void VRT_Vmod_Unload(VRT_CTX, struct vmod **hdl);
 
-/* VCL program related */
-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);
-
 typedef int vmod_event_f(VRT_CTX, struct vmod_priv *, enum vcl_event_e);
 
 typedef void vmod_priv_free_f(void *);
diff --git a/lib/libvcc/generate.py b/lib/libvcc/generate.py
index d36012eef..b5237f8f8 100755
--- a/lib/libvcc/generate.py
+++ b/lib/libvcc/generate.py
@@ -779,6 +779,7 @@ vcl_output_lang_h(struct vsb *sb)
 
 emit_file(fo, srcroot, "include/vdef.h")
 emit_file(fo, srcroot, "include/vrt.h")
+emit_file(fo, srcroot, "include/vcc_interface.h")
 emit_file(fo, buildroot, "include/vcl.h")
 emit_file(fo, buildroot, "include/vrt_obj.h")
 


More information about the varnish-commit mailing list