summaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-lua.h
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-07-12 18:18:01 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-12-13 15:02:55 +0100
commitd0035a84e055fe2224fd1333f814873578e3dde6 (patch)
treed0e6a7f5cfcc9824c0990b5dc6457892734ed62a /ctl-lib/ctl-lua.h
parentc9ed0f7a1556a7c0828aec0daf4db19cdf0f29a4 (diff)
Use prefix variable to find controller's plugins
Prefix is the most reliable variable to find files or variables for a controller, so this lets you access it wherever it is needed without using global hardcoded variables. This helps to search for controller's plugins in several locations depending on environment variables and hardcoded variables (CONTROL_PLUGIN_PATH, CONTROL_CONFIG_PATH). This implies also a change a LUA interpreter loading step to correctly set the package.path variables with the environment variables, too. Correct the missing 'extern' in function declarations. Depends-On: Ic448ff017e6158bec05895d63688b8968b5c6434 Change-Id: I0ad19242612559d1f4b66b6f9af9e7032d4675a8 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'ctl-lib/ctl-lua.h')
-rw-r--r--ctl-lib/ctl-lua.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/ctl-lib/ctl-lua.h b/ctl-lib/ctl-lua.h
index bb202d6..0ec4960 100644
--- a/ctl-lib/ctl-lua.h
+++ b/ctl-lib/ctl-lua.h
@@ -52,12 +52,12 @@ typedef enum {
} LuaDoActionT;
extern const char *lua_utils;
-int LuaLoadScript(const char *luaScriptPath);
-int LuaConfigLoad (AFB_ApiT apiHandle);
-void LuaL2cNewLib(luaL_Reg *l2cFunc, int count, const char *prefix);
-int Lua2cWrapper(void* luaHandle, char *funcname, Lua2cFunctionT callback);
-int LuaCallFunc (CtlSourceT *source, CtlActionT *action, json_object *queryJ) ;
-int LuaConfigExec(AFB_ApiT apiHandle);
+extern int LuaLoadScript(const char *luaScriptPath);
+extern int LuaConfigLoad (AFB_ApiT apiHandle, const char *prefix);
+extern void LuaL2cNewLib(luaL_Reg *l2cFunc, int count, const char *prefix);
+extern int Lua2cWrapper(void* luaHandle, char *funcname, Lua2cFunctionT callback);
+extern int LuaCallFunc (CtlSourceT *source, CtlActionT *action, json_object *queryJ) ;
+extern int LuaConfigExec(AFB_ApiT apiHandle);
#ifdef __cplusplus
}