diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2018-05-07 17:05:00 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2018-05-11 11:33:25 +0200 |
commit | 492c6dc1ecba7b8dfd3353a52352645d9f6984e8 (patch) | |
tree | 02dcb2b41742d4b00961d64a4552926bb51e2735 /ctl-lib/ctl-config.h | |
parent | c5250690f38e4995a9b32d81e406894f92584a38 (diff) |
Loads l2c functions per plugin.
L2C functions are prefixed with either the chosen
prefix or plugin uid by default.
Change-Id: Id296ec629c803ab06cd05f5278fed3c48cbcf10e
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'ctl-lib/ctl-config.h')
-rw-r--r-- | ctl-lib/ctl-config.h | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/ctl-lib/ctl-config.h b/ctl-lib/ctl-config.h index d36b5f5..8a7f2a3 100644 --- a/ctl-lib/ctl-config.h +++ b/ctl-lib/ctl-config.h @@ -33,6 +33,10 @@ extern "C" { #include <filescan-utils.h> #include <wrap-json.h> +#ifdef CONTROL_SUPPORT_LUA + #include "ctl-lua.h" +#endif + #ifndef CONTROL_MAXPATH_LEN #define CONTROL_MAXPATH_LEN 255 #endif @@ -43,6 +47,7 @@ extern "C" { #ifndef CTL_PLUGIN_EXT #define CTL_PLUGIN_EXT ".ctlso" + #define CTL_SCRIPT_EXT ".lua" #endif #define LUA_ACTION_PREFIX "lua://" @@ -68,16 +73,6 @@ typedef struct { CtlSectionT *sections; } CtlConfigT; - -#ifdef CONTROL_SUPPORT_LUA - #include "ctl-lua.h" - - typedef struct CtlLua2cFuncT { - luaL_Reg *l2cFunc; - int l2cCount; -} CtlLua2cFuncT; -#endif - // This should not be global as application may want to define their own sections typedef enum { CTL_SECTION_PLUGIN, @@ -89,7 +84,6 @@ typedef enum { CTL_SECTION_ENDTAG, } SectionEnumT; - // ctl-action.c PUBLIC CtlActionT *ActionConfig(AFB_ApiT apiHandle, json_object *actionsJ, int exportApi); PUBLIC void ActionExecUID(AFB_ReqT request, CtlConfigT *ctlConfig, const char *uid, json_object *queryJ); @@ -97,7 +91,6 @@ PUBLIC void ActionExecOne( CtlSourceT *source, CtlActionT* action, json_object * PUBLIC int ActionLoadOne(AFB_ApiT apiHandle, CtlActionT *action, json_object *, int exportApi); PUBLIC int ActionLabelToIndex(CtlActionT* actions, const char* actionLabel); - // ctl-config.c PUBLIC int CtlConfigMagicNew(); PUBLIC json_object* CtlConfigScan(const char *dirList, const char *prefix) ; |