aboutsummaryrefslogtreecommitdiffstats
path: root/controller
diff options
context:
space:
mode:
Diffstat (limited to 'controller')
-rw-r--r--controller/ctl-plugin.c6
-rw-r--r--controller/ctl-plugin.h4
2 files changed, 7 insertions, 3 deletions
diff --git a/controller/ctl-plugin.c b/controller/ctl-plugin.c
index b14d591..69f0f09 100644
--- a/controller/ctl-plugin.c
+++ b/controller/ctl-plugin.c
@@ -21,6 +21,9 @@
#define _GNU_SOURCE
#include <string.h>
#include <dlfcn.h>
+#include <link.h>
+#include <stdio.h>
+#include <stdlib.h>
#ifdef CONTROL_SUPPORT_LUA
#include "ctl-lua.h"
@@ -202,7 +205,8 @@ STATIC int PluginLoadOne (CtlPluginT *ctlPlugin, json_object *pluginJ, void* han
}
}
#endif
- DispatchPluginInstallCbT ctlPluginOnload = dlsym(dlHandle, "CtlPluginOnload");
+
+DispatchPluginInstallCbT ctlPluginOnload = dlsym(dlHandle, "CtlPluginOnload");
if (ctlPluginOnload) {
ctlPlugin->context = (*ctlPluginOnload) (ctlPlugin, handle);
}
diff --git a/controller/ctl-plugin.h b/controller/ctl-plugin.h
index 7c1d0f1..1c772c7 100644
--- a/controller/ctl-plugin.h
+++ b/controller/ctl-plugin.h
@@ -49,7 +49,7 @@ typedef struct {
typedef struct {
long magic;
- char *label;
+ const char *label;
void *handle;
} CtlPluginMagicT;
@@ -66,7 +66,7 @@ typedef void*(*DispatchPluginInstallCbT)(CtlPluginT *plugin, void* handle);
#define MACRO_STR_VALUE(arg) #arg
-#define CTLP_REGISTER(pluglabel) CtlPluginMagicT CtlPluginMagic={.magic=CTL_PLUGIN_MAGIC,.label=pluglabel}; struct afb_binding_data_v2;
+#define CTLP_REGISTER(pluglabel) CtlPluginMagicT CtlPluginMagic={.magic=CTL_PLUGIN_MAGIC,.label=pluglabel,.handle=NULL}; struct afb_binding_data_v2;
#define CTLP_ONLOAD(plugin, handle) void* CtlPluginOnload(CtlPluginT *plugin, void* handle)
#define CTLP_CAPI(funcname, source, argsJ, queryJ, context) int funcname(CtlSourceT *source, json_object* argsJ, json_object* queryJ, void* context)