aboutsummaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-plugin.h
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-05-14 12:50:39 +0000
committerGerrit Code Review <gerrit@automotivelinux.org>2018-05-14 12:50:39 +0000
commit0ff8c30892be48ecba1265276532f94b242f6289 (patch)
tree02dcb2b41742d4b00961d64a4552926bb51e2735 /ctl-lib/ctl-plugin.h
parent2fa16f981f6e5d86ac5938821e0c533786b60fc7 (diff)
parent492c6dc1ecba7b8dfd3353a52352645d9f6984e8 (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-plugin.h')
-rw-r--r--ctl-lib/ctl-plugin.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/ctl-lib/ctl-plugin.h b/ctl-lib/ctl-plugin.h
index 5d505ac..85d9788 100644
--- a/ctl-lib/ctl-plugin.h
+++ b/ctl-lib/ctl-plugin.h
@@ -30,9 +30,6 @@ extern "C" {
#include <json-c/json.h>
-#define CONTROL_PLUGIN_EXT ".ctlso"
-#define CONTROL_SCRIPT_EXT ".lua"
-
// Waiting for a clean AppFW-V3 API
#ifdef USE_API_DYN
#define AFB_BINDING_VERSION dyn
@@ -165,6 +162,15 @@ extern "C" {
#define UNUSED_FUNCTION(x) __attribute__((__unused__)) UNUSED_ ## x
#endif
+#ifdef CONTROL_SUPPORT_LUA
+ typedef struct luaL_Reg luaL_Reg;
+
+ typedef struct CtlLua2cFuncT {
+ luaL_Reg *l2cFunc;
+ const char *prefix;
+ int l2cCount;
+} CtlLua2cFuncT;
+#endif
typedef struct {
const char *uid;
@@ -177,6 +183,9 @@ typedef struct {
AFB_ApiT api;
void *dlHandle;
void *context;
+#ifdef CONTROL_SUPPORT_LUA
+ CtlLua2cFuncT *ctlL2cFunc;
+#endif
} CtlPluginT;
typedef enum {
@@ -227,8 +236,9 @@ typedef struct {
} exec;
} CtlActionT;
+extern CtlPluginT *ctlPlugins;
-typedef void*(*DispatchPluginInstallCbT)(CtlPluginT *plugin, void* handle);
+typedef int(*DispatchPluginInstallCbT)(CtlPluginT *plugin, void* handle);
#define MACRO_STR_VALUE(arg) #arg
#define CTLP_CAPI_REGISTER(pluglabel) CtlPluginMagicT CtlPluginMagic={.uid=pluglabel,.magic=CTL_PLUGIN_MAGIC}; struct afb_binding_data_v2;