From 2b77a50d5c578d92ac692b872f5a51c227c29334 Mon Sep 17 00:00:00 2001 From: fulup Date: Wed, 18 Oct 2017 11:31:33 +0200 Subject: 1st V2/pre-V3 version --- ctl-lib/ctl-lua.h | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'ctl-lib/ctl-lua.h') diff --git a/ctl-lib/ctl-lua.h b/ctl-lib/ctl-lua.h index 6f2ce7d..53eb6cb 100644 --- a/ctl-lib/ctl-lua.h +++ b/ctl-lib/ctl-lua.h @@ -49,13 +49,6 @@ PUBLIC int LuaLibInit (); -typedef int (*Lua2cFunctionT)(char *funcname, json_object *argsJ); -typedef int (*Lua2cWrapperT) (lua_State* luaState, char *funcname, Lua2cFunctionT callback); - -#define CTLP_LUALOAD Lua2cWrapperT Lua2cWrap; -#define CTLP_LUA2C(FuncName, label,argsJ, context) static int FuncName(char*label,json_object*argsJ);\ - int lua2c_ ## FuncName(lua_State* luaState){return((*Lua2cWrap)(luaState, MACRO_STR_VALUE(FuncName), FuncName, PLUGIN_NAME));};\ - static int FuncName(char* label, json_object* argsJ, void* context) typedef enum { LUA_DOCALL, @@ -64,11 +57,11 @@ typedef enum { } LuaDoActionT; -PUBLIC int LuaConfigLoad(); -PUBLIC int LuaConfigExec(); +PUBLIC int LuaConfigLoad (AFB_ApiT apiHandle); +PUBLIC int LuaConfigExec(AFB_ApiT apiHandle); PUBLIC void LuaL2cNewLib(const char *label, luaL_Reg *l2cFunc, int count); -PUBLIC int Lua2cWrapper(lua_State* luaState, char *funcname, Lua2cFunctionT callback); -PUBLIC int LuaCallFunc (CtlActionT *action, json_object *queryJ) ; +PUBLIC int Lua2cWrapper(void* luaHandle, char *funcname, Lua2cFunctionT callback); +PUBLIC int LuaCallFunc (CtlSourceT *source, CtlActionT *action, json_object *queryJ) ; PUBLIC void ctlapi_lua_docall (afb_req request); PUBLIC void ctlapi_lua_dostring (afb_req request); PUBLIC void ctlapi_lua_doscript (afb_req request); -- cgit 1.2.3-korg