summaryrefslogtreecommitdiffstats
path: root/controller/ctl-lua.h
diff options
context:
space:
mode:
Diffstat (limited to 'controller/ctl-lua.h')
-rw-r--r--controller/ctl-lua.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/controller/ctl-lua.h b/controller/ctl-lua.h
index 2a85543..2fbebf5 100644
--- a/controller/ctl-lua.h
+++ b/controller/ctl-lua.h
@@ -25,6 +25,10 @@
#define _GNU_SOURCE
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// prefix start debug script
#ifndef CONTROL_DOSCRIPT_PRE
#define CONTROL_DOSCRIPT_PRE "debug"
@@ -35,11 +39,6 @@
#define CONTROL_LUA_EVENT "luaevt"
#endif
-// default use same search path for config.json and script.lua
-#ifndef CONTROL_LUA_PATH
-#define CONTROL_LUA_PATH CONTROL_CONFIG_PATH
-#endif
-
#define AFB_BINDING_VERSION 2
#include <afb/afb-binding.h>
@@ -65,7 +64,7 @@ typedef int (*Lua2cWrapperT) (lua_State* luaState, char *funcname, Lua2cFunction
#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));};\
+ int lua2c_ ## FuncName(lua_State* luaState){return((*Lua2cWrap)(luaState, MACRO_STR_VALUE(FuncName), FuncName));};\
static int FuncName(char* label, json_object* argsJ, void* context)
typedef enum {
@@ -74,7 +73,6 @@ typedef enum {
LUA_DOSCRIPT,
} LuaDoActionT;
-
int LuaConfigLoad();
int LuaConfigExec();
void LuaL2cNewLib(const char *label, luaL_Reg *l2cFunc, int count);
@@ -85,4 +83,8 @@ void ctlapi_lua_dostring (afb_req request);
void ctlapi_lua_doscript (afb_req request);
+#ifdef __cplusplus
+}
+#endif
+
#endif