- /* check the returned structure */
- if (desc->plugin->type != AFB_PLUGIN_VERSION_1) {
- ERROR("plugin [%s] invalid type %d...", path, desc->plugin->type);
- goto error3;
- }
- if (desc->plugin->v1.prefix == NULL || *desc->plugin->v1.prefix == 0) {
- ERROR("plugin [%s] bad prefix...", path);
- goto error3;
- }
- if (!afb_apis_is_valid_api_name(desc->plugin->v1.prefix)) {
- ERROR("plugin [%s] invalid prefix...", path);
- goto error3;
- }
- if (desc->plugin->v1.info == NULL || *desc->plugin->v1.info == 0) {
- ERROR("plugin [%s] bad description...", path);
- goto error3;
- }
- if (desc->plugin->v1.verbs == NULL) {
- ERROR("plugin [%s] no APIs...", path);
- goto error3;
- }
-
- /* records the plugin */
- desc->apilength = strlen(desc->plugin->v1.prefix);
- if (afb_apis_add(desc->plugin->v1.prefix, (struct afb_api){
- .closure = desc,
- .call = (void*)call}) < 0) {
- ERROR("plugin [%s] can't be registered...", path);
- goto error3;
- }
- NOTICE("plugin %s loaded with API prefix %s", path, desc->plugin->v1.prefix);
- return 0;
+ /* not a valid binding */
+ if (force)
+ ERROR("binding [%s] is not an AFB binding", path);
+ else
+ INFO("binding [%s] is not an AFB binding", path);