summaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-lua.h
diff options
context:
space:
mode:
authorfulup <fulup.arfoll@iot.bzh>2017-10-18 11:31:33 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-12-13 15:02:54 +0100
commit2b77a50d5c578d92ac692b872f5a51c227c29334 (patch)
tree262f653a0369d080e2368bddd840e3c0fa089b29 /ctl-lib/ctl-lua.h
parent2da9781ef4b8c68b22a9a45aaa60c6e5b1e1142d (diff)
1st V2/pre-V3 version
Diffstat (limited to 'ctl-lib/ctl-lua.h')
-rw-r--r--ctl-lib/ctl-lua.h15
1 files changed, 4 insertions, 11 deletions
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);