From 88892db78f2f5b047923af5b36169052c96bc3c0 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Thu, 12 Jul 2018 18:18:01 +0200 Subject: 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 --- ctl-lib/ctl-plugin.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ctl-lib/ctl-plugin.h') diff --git a/ctl-lib/ctl-plugin.h b/ctl-lib/ctl-plugin.h index 6488e86..e4b8ccb 100644 --- a/ctl-lib/ctl-plugin.h +++ b/ctl-lib/ctl-plugin.h @@ -133,6 +133,8 @@ typedef int (*Lua2cWrapperT) (void*luaHandle, const char *funcname, Lua2cFunctio int lua2c_ ## funcname (void* luaState){return((*Lua2cWrap)(luaState, MACRO_STR_VALUE(funcname), funcname));};\ int funcname (CtlSourceT* source, json_object* argsJ, json_object** responseJ) +extern char *GetDefaultPluginSearchPath(AFB_ApiT apiHandle, const char *prefix); + #ifdef __cplusplus } #endif -- cgit 1.2.3-korg