diff options
author | Fulup Ar Foll <fulup@iot.bzh> | 2017-10-24 22:17:59 +0200 |
---|---|---|
committer | Fulup Ar Foll <fulup@iot.bzh> | 2017-10-24 22:17:59 +0200 |
commit | d0563706f01f9da67de39a30e6eeb324cc25652d (patch) | |
tree | 158e6d4920cd460ccafbdaa1cee97738242daec6 /ctl-lib/ctl-plugin.c | |
parent | 17a6011775e8c6d1536994f8b9cd4fa2f99791f7 (diff) |
First working version as submodule
Diffstat (limited to 'ctl-lib/ctl-plugin.c')
-rw-r--r-- | ctl-lib/ctl-plugin.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/ctl-lib/ctl-plugin.c b/ctl-lib/ctl-plugin.c index 03f4c34..9ecb7d0 100644 --- a/ctl-lib/ctl-plugin.c +++ b/ctl-lib/ctl-plugin.c @@ -42,12 +42,12 @@ PUBLIC int PluginGetCB (AFB_ApiT apiHandle, CtlActionT *action , json_object *ca goto OnErrorExit; } - for (idx=0; ctlPlugins[idx].label != NULL; idx++) { - if (!strcasecmp (ctlPlugins[idx].label, plugin)) break; + for (idx=0; ctlPlugins[idx].uid != NULL; idx++) { + if (!strcasecmp (ctlPlugins[idx].uid, plugin)) break; } - if (!ctlPlugins[idx].label) { - AFB_ApiError(apiHandle, "PluginGetCB no plugin with label=%s", plugin); + if (!ctlPlugins[idx].uid) { + AFB_ApiError(apiHandle, "PluginGetCB no plugin with uid=%s", plugin); goto OnErrorExit; } @@ -87,14 +87,14 @@ STATIC int PluginLoadOne (AFB_ApiT apiHandle, CtlPluginT *ctlPlugin, json_object if (!pluginJ) return 0; int err = wrap_json_unpack(pluginJ, "{ss,s?s,s?s,s?s !}", - "label", &ctlPlugin->label, "info", &ctlPlugin->info, "ldpath", &ldSearchPath, "basename", &basename); + "uid", &ctlPlugin->uid, "info", &ctlPlugin->info, "ldpath", &ldSearchPath, "basename", &basename); if (err) { - AFB_ApiError(apiHandle, "CTL-PLUGIN-LOADONE Plugin missing label|[info]|[basename]|[ldpath] in:\n-- %s", json_object_get_string(pluginJ)); + AFB_ApiError(apiHandle, "CTL-PLUGIN-LOADONE Plugin missing uid|[info]|[basename]|[ldpath] in:\n-- %s", json_object_get_string(pluginJ)); goto OnErrorExit; } - // default basename equal label - if (!basename) basename=ctlPlugin->label; + // default basename equal uid + if (!basename) basename=ctlPlugin->uid; // if search path not in Json config file, then try default if (!ldSearchPath) ldSearchPath = CONTROL_PLUGIN_PATH; @@ -133,7 +133,7 @@ STATIC int PluginLoadOne (AFB_ApiT apiHandle, CtlPluginT *ctlPlugin, json_object AFB_ApiError(apiHandle, "CTL-PLUGIN-LOADONE symbol'CtlPluginMagic' missing or != CTL_PLUGIN_MAGIC plugin=%s", pluginpath); goto OnErrorExit; } else { - AFB_ApiNotice(apiHandle, "CTL-PLUGIN-LOADONE %s successfully registered", ctlPluginMagic->label); + AFB_ApiNotice(apiHandle, "CTL-PLUGIN-LOADONE %s successfully registered", ctlPluginMagic->uid); } // store dlopen handle to enable onload action at exec time |