diff options
author | 2018-08-30 11:03:22 +0200 | |
---|---|---|
committer | 2018-08-30 11:03:22 +0200 | |
commit | a185e5cf960ec2083fc45048e93a3a22a02c094f (patch) | |
tree | 9a80e4401d0538d3729518420d8de2f69f0275d6 /ctl-lib/ctl-plugin.c | |
parent | 82820f44b1307ef8c6e12a505f383037fdad9fcb (diff) |
shared library: update to a v3 shared library
- AFB_BINDING_VERSION = 3
- remove preprocessor variables
- mandatory lua
- name of library is ctl-utilities
- does not work with v2 versions
Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
Diffstat (limited to 'ctl-lib/ctl-plugin.c')
-rw-r--r-- | ctl-lib/ctl-plugin.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ctl-lib/ctl-plugin.c b/ctl-lib/ctl-plugin.c index d27b71d..e57fb8a 100644 --- a/ctl-lib/ctl-plugin.c +++ b/ctl-lib/ctl-plugin.c @@ -84,8 +84,8 @@ static int PluginLoadCOne(AFB_ApiT apiHandle, const char *pluginpath, json_objec } CtlPluginMagicT *ctlPluginMagic = (CtlPluginMagicT*) dlsym(dlHandle, "CtlPluginMagic"); - if (!ctlPluginMagic || ctlPluginMagic->magic != CTL_PLUGIN_MAGIC) { - AFB_ApiError(apiHandle, "CTL-PLUGIN-LOADONE symbol'CtlPluginMagic' missing or != CTL_PLUGIN_MAGIC plugin=%s", pluginpath); + if (!ctlPluginMagic) { + AFB_ApiError(apiHandle, "CTL-PLUGIN-LOADONE symbol'CtlPluginMagic' missing %s", pluginpath); return -1; } else { AFB_ApiNotice(apiHandle, "CTL-PLUGIN-LOADONE %s successfully registered", ctlPluginMagic->uid); @@ -268,14 +268,14 @@ char *GetDefaultPluginSearchPath(AFB_ApiT apiHandle, const char *prefix) * between bindingPath and envDirList concatenation. */ if(envDirList) { - envDirList_len = strlen(CONTROL_PLUGIN_PATH) + strlen(envDirList) + strlen(bindingPath) + strlen(rootDir) + 3; + envDirList_len = strlen(envDirList) + strlen(bindingPath) + strlen(rootDir) + 3; searchPath = malloc(envDirList_len + 1); - snprintf(searchPath, envDirList_len + 1, "%s:%s:%s:%s", rootDir, bindingPath, envDirList, CONTROL_PLUGIN_PATH); + snprintf(searchPath, envDirList_len + 1, "%s:%s:%s", rootDir, bindingPath, envDirList); } else { - envDirList_len = strlen(CONTROL_PLUGIN_PATH) + strlen(bindingPath) + strlen(rootDir) + 2; + envDirList_len = strlen(bindingPath) + strlen(rootDir) + 2; searchPath = malloc(envDirList_len + 1); - snprintf(searchPath, envDirList_len + 1, "%s:%s:%s", rootDir, bindingPath, CONTROL_PLUGIN_PATH); + snprintf(searchPath, envDirList_len + 1, "%s:%s", rootDir, bindingPath); } free(rootDir); |