[master] 4944555 Confine the VSC_C structs to vsc.c
Poul-Henning Kamp
phk at FreeBSD.org
Fri May 26 23:23:05 CEST 2017
commit 49445552fcb4558e814c366d8f458862e7a9cc31
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Fri May 26 21:10:13 2017 +0000
Confine the VSC_C structs to vsc.c
diff --git a/bin/varnishd/common/common.h b/bin/varnishd/common/common.h
index a6bbbbb..f0b4cf8 100644
--- a/bin/varnishd/common/common.h
+++ b/bin/varnishd/common/common.h
@@ -81,14 +81,14 @@ int VCL_TestLoad(const char *);
/* common_vsm.c */
struct vsm_sc;
-struct VSC_C_main;
+struct VSC_main;
struct vsm_sc *VSM_common_new(void *ptr, ssize_t len);
void *VSM_common_alloc(struct vsm_sc *sc, ssize_t size,
const char *class, const char *type, const char *ident);
void VSM_common_free(struct vsm_sc *sc, void *ptr);
void VSM_common_delete(struct vsm_sc **sc);
void VSM_common_copy(struct vsm_sc *to, const struct vsm_sc *from);
-void VSM_common_cleaner(struct vsm_sc *sc, struct VSC_C_main *stats);
+void VSM_common_cleaner(struct vsm_sc *sc, struct VSC_main *stats);
void VSM_common_ageupdate(const struct vsm_sc *sc);
void *VSC_Alloc(const char *, size_t, size_t, const unsigned char *, size_t,
diff --git a/bin/varnishd/common/common_vsm.c b/bin/varnishd/common/common_vsm.c
index 7994d95..fb30c70 100644
--- a/bin/varnishd/common/common_vsm.c
+++ b/bin/varnishd/common/common_vsm.c
@@ -45,6 +45,8 @@
#include "vmb.h"
#include "vtim.h"
+#include "VSC_main.h"
+
extern volatile struct params * cache_param;
/*--------------------------------------------------------------------*/
@@ -165,7 +167,7 @@ VSM_common_new(void *p, ssize_t l)
*/
void
-VSM_common_cleaner(struct vsm_sc *sc, struct VSC_C_main *stats)
+VSM_common_cleaner(struct vsm_sc *sc, struct VSC_main *stats)
{
double now = VTIM_real();
struct vsm_range *vr, *vr2;
diff --git a/include/vapi/vsc_int.h b/include/vapi/vsc_int.h
index 352c8ba..cc48d9c 100644
--- a/include/vapi/vsc_int.h
+++ b/include/vapi/vsc_int.h
@@ -41,9 +41,3 @@ enum VSC_level_e {
/* Forward declare the static vsc type names */
#define VSC_TYPE_F(n,t,l,e,d) extern const char *VSC_type_##n;
#include "tbl/vsc_types.h"
-
-/* Define the vsc type structs */
-#define VSC_DO(u,l,t,h) struct VSC_C_##l {
-#define VSC_F(n,t,l,s,f,v,d,e) t n;
-#define VSC_DONE(u,l,t) };
-#include "tbl/vsc_all.h"
diff --git a/lib/libvarnishapi/vsc.c b/lib/libvarnishapi/vsc.c
index 744b35b..748fb27 100644
--- a/lib/libvarnishapi/vsc.c
+++ b/lib/libvarnishapi/vsc.c
@@ -51,6 +51,12 @@
#include "vsm_api.h"
+/* Define the vsc type structs */
+#define VSC_DO(u,l,t,h) struct VSC_C_##l {
+#define VSC_F(n,t,l,s,f,v,d,e) t n;
+#define VSC_DONE(u,l,t) };
+#include "tbl/vsc_all.h"
+
enum {
#define VSC_TYPE_F(n,t,l,e,d) \
VSC_type_order_##n,
More information about the varnish-commit
mailing list