diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2018-05-14 12:50:39 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@automotivelinux.org> | 2018-05-14 12:50:39 +0000 |
commit | 0ff8c30892be48ecba1265276532f94b242f6289 (patch) | |
tree | 02dcb2b41742d4b00961d64a4552926bb51e2735 /ctl-lib/ctl-config.h | |
parent | 2fa16f981f6e5d86ac5938821e0c533786b60fc7 (diff) | |
parent | 492c6dc1ecba7b8dfd3353a52352645d9f6984e8 (diff) |
Merge changes from topic 'sandbox/claneys/wip'
* changes:
Loads l2c functions per plugin.
Improve json object release
Improve way to loading an action
Diffstat (limited to 'ctl-lib/ctl-config.h')
-rw-r--r-- | ctl-lib/ctl-config.h | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/ctl-lib/ctl-config.h b/ctl-lib/ctl-config.h index 432d86c..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,8 +47,13 @@ extern "C" { #ifndef CTL_PLUGIN_EXT #define CTL_PLUGIN_EXT ".ctlso" + #define CTL_SCRIPT_EXT ".lua" #endif +#define LUA_ACTION_PREFIX "lua://" +#define API_ACTION_PREFIX "api://" +#define PLUGIN_ACTION_PREFIX "plugin://" + typedef struct ConfigSectionS { const char *key; const char *uid; @@ -64,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, @@ -85,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); @@ -93,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) ; |