aboutsummaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-config.h
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-05-07 17:05:00 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-12-13 15:02:54 +0100
commit777f6909df08215bf58d5901cdc155a3b56174c2 (patch)
tree02dcb2b41742d4b00961d64a4552926bb51e2735 /ctl-lib/ctl-config.h
parentd6b30258e3e794ecddd6cc2664cca90461a08286 (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.h17
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) ;