Commit aa7295e5 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Move VRT_Vmod_{Init|Unload} To VPI

Relevant to #2800
parent a2bb3507
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "vcli_serve.h" #include "vcli_serve.h"
#include "vcc_interface.h"
#include "vmod_abi.h" #include "vmod_abi.h"
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
...@@ -78,7 +79,7 @@ vmod_abi_mismatch(const struct vmod_data *d) ...@@ -78,7 +79,7 @@ vmod_abi_mismatch(const struct vmod_data *d)
} }
int int
VRT_Vmod_Init(VRT_CTX, struct vmod **hdl, unsigned nbr, void *ptr, int len, VPI_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) const char *nm, const char *path, const char *file_id, const char *backup)
{ {
struct vmod *v; struct vmod *v;
...@@ -162,7 +163,7 @@ VRT_Vmod_Init(VRT_CTX, struct vmod **hdl, unsigned nbr, void *ptr, int len, ...@@ -162,7 +163,7 @@ VRT_Vmod_Init(VRT_CTX, struct vmod **hdl, unsigned nbr, void *ptr, int len,
} }
void void
VRT_Vmod_Unload(VRT_CTX, struct vmod **hdl) VPI_Vmod_Unload(VRT_CTX, struct vmod **hdl)
{ {
struct vmod *v; struct vmod *v;
......
...@@ -50,3 +50,8 @@ struct vpi_ref { ...@@ -50,3 +50,8 @@ struct vpi_ref {
}; };
void VPI_count(VRT_CTX, unsigned); void VPI_count(VRT_CTX, unsigned);
int VPI_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 VPI_Vmod_Unload(VRT_CTX, struct vmod **hdl);
...@@ -52,6 +52,8 @@ ...@@ -52,6 +52,8 @@
* binary/load-time compatible, increment MAJOR version * binary/load-time compatible, increment MAJOR version
* *
* unreleased (planned for 2019-09-15) * unreleased (planned for 2019-09-15)
* VRT_Vmod_{Init|Unload} moved to vcc_interface.h
* VRT_count moved to vcc_interface.h
* VRT_VCL_Busy() and VRT_VCL_Unbusy() added. * VRT_VCL_Busy() and VRT_VCL_Unbusy() added.
* VRT_vcl_get moved to vcc_interface.h * VRT_vcl_get moved to vcc_interface.h
* VRT_vcl_rel emoved to vcc_interface.h * VRT_vcl_rel emoved to vcc_interface.h
...@@ -511,11 +513,6 @@ void VRT_DelDirector(VCL_BACKEND *); ...@@ -511,11 +513,6 @@ void VRT_DelDirector(VCL_BACKEND *);
/* Suckaddr related */ /* Suckaddr related */
int VRT_VSA_GetPtr(VCL_IP sua, const unsigned char ** dst); int VRT_VSA_GetPtr(VCL_IP sua, const unsigned char ** dst);
/* VMOD/Modules related */
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);
typedef int vmod_event_f(VRT_CTX, struct vmod_priv *, enum vcl_event_e); typedef int vmod_event_f(VRT_CTX, struct vmod_priv *, enum vcl_event_e);
typedef void vmod_priv_free_f(void *); typedef void vmod_priv_free_f(void *);
......
...@@ -303,7 +303,7 @@ vcc_ParseImport(struct vcc *tl) ...@@ -303,7 +303,7 @@ vcc_ParseImport(struct vcc *tl)
ifp = New_IniFin(tl); ifp = New_IniFin(tl);
VSB_printf(ifp->ini, "\tif (VRT_Vmod_Init(ctx,\n"); VSB_printf(ifp->ini, "\tif (VPI_Vmod_Init(ctx,\n");
VSB_printf(ifp->ini, "\t &VGC_vmod_%.*s,\n", PF(mod)); VSB_printf(ifp->ini, "\t &VGC_vmod_%.*s,\n", PF(mod));
VSB_printf(ifp->ini, "\t %u,\n", tl->vmod_count++); VSB_printf(ifp->ini, "\t %u,\n", tl->vmod_count++);
VSB_printf(ifp->ini, "\t &%s,\n", vmd->func_name); VSB_printf(ifp->ini, "\t &%s,\n", vmd->func_name);
...@@ -326,7 +326,7 @@ vcc_ParseImport(struct vcc *tl) ...@@ -326,7 +326,7 @@ vcc_ParseImport(struct vcc *tl)
/* XXX: zero the function pointer structure ?*/ /* XXX: zero the function pointer structure ?*/
VSB_printf(ifp->fin, "\t\tVRT_priv_fini(&vmod_priv_%.*s);", PF(mod)); VSB_printf(ifp->fin, "\t\tVRT_priv_fini(&vmod_priv_%.*s);", PF(mod));
VSB_printf(ifp->final, VSB_printf(ifp->final,
"\t\tVRT_Vmod_Unload(ctx, &VGC_vmod_%.*s);", PF(mod)); "\t\tVPI_Vmod_Unload(ctx, &VGC_vmod_%.*s);", PF(mod));
vj = vjsn_parse(vmd->json, &p); vj = vjsn_parse(vmd->json, &p);
XXXAZ(p); XXXAZ(p);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment