aboutsummaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-plugin.c
diff options
context:
space:
mode:
authorFulup Ar Foll <fulup@iot.bzh>2017-10-24 22:17:59 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-12-13 15:02:54 +0100
commit67d50c819ea60b00a3441d446ce6719ec3bf2349 (patch)
tree158e6d4920cd460ccafbdaa1cee97738242daec6 /ctl-lib/ctl-plugin.c
parent2b77a50d5c578d92ac692b872f5a51c227c29334 (diff)
First working version as submodule
Diffstat (limited to 'ctl-lib/ctl-plugin.c')
-rw-r--r--ctl-lib/ctl-plugin.c18
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