From bbb4351eab7476be9a93f0248860ac0d1574d8a6 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Tue, 26 Sep 2017 12:17:55 +0200 Subject: Make calling lua2c function from lua works Change-Id: I56d78a3fe567d1f7a6c675f6a56473f96d325c85 Signed-off-by: Romain Forlot --- controller/ctl-plugin.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'controller/ctl-plugin.h') diff --git a/controller/ctl-plugin.h b/controller/ctl-plugin.h index 7934d8d..361fd34 100644 --- a/controller/ctl-plugin.h +++ b/controller/ctl-plugin.h @@ -43,6 +43,8 @@ extern "C" { #define UNUSED_FUNCTION(x) __attribute__((__unused__)) UNUSED_ ## x #endif +typedef struct luaL_Reg luaL_Reg; + typedef struct { char *label; char *info; @@ -50,25 +52,26 @@ typedef struct { void *context; } CtlSourceT; - typedef struct { long magic; const char *label; void *handle; } CtlPluginMagicT; - typedef struct { const char *label; const char *info; const char *version; void *context; void *dlHandle; +#ifdef CONTROL_SUPPORT_LUA + luaL_Reg *l2cFunc; + int l2cCount; +#endif } CtlPluginT; typedef void*(*DispatchPluginInstallCbT)(CtlPluginT *plugin, void* handle); - #define MACRO_STR_VALUE(arg) #arg #define CTLP_REGISTER(pluglabel) CtlPluginMagicT CtlPluginMagic={.magic=CTL_PLUGIN_MAGIC,.label=pluglabel,.handle=NULL}; struct afb_binding_data_v2; #define CTLP_ONLOAD(plugin, handle) void* CtlPluginOnload(CtlPluginT *plugin, void* handle) -- cgit 1.2.3-korg