- /* retrieves the register function */
- pluginRegisterFct = dlsym(desc->handle, plugin_register_function);
- if (!pluginRegisterFct) {
- fprintf(stderr, "[%s] not an AFB plugin, continuing...\n", path);
- goto error3;
- }
- if (verbosity)
- fprintf(stderr, "[%s] is a valid AFB plugin\n", path);
-
- /* init the interface */
- desc->interface.verbosity = 0;
- desc->interface.mode = AFB_MODE_LOCAL;
- desc->interface.poll_open = itf_poll_open;
-
- /* init the plugin */
- desc->plugin = pluginRegisterFct(&desc->interface);
- if (desc->plugin == NULL) {
- fprintf(stderr, "ERROR: plugin [%s] register function failed. continuing...\n", path);
- goto error3;
- }
-
- /* check the returned structure */
- if (desc->plugin->type != AFB_PLUGIN_JSON) {
- fprintf(stderr, "ERROR: plugin [%s] invalid type %d...\n", path, desc->plugin->type);
- goto error3;
- }
- if (desc->plugin->prefix == NULL || *desc->plugin->prefix == 0) {
- fprintf(stderr, "ERROR: plugin [%s] bad prefix...\n", path);
- goto error3;
- }
- if (desc->plugin->info == NULL || *desc->plugin->info == 0) {
- fprintf(stderr, "ERROR: plugin [%s] bad description...\n", path);
- goto error3;
- }
- if (desc->plugin->apis == NULL) {
- fprintf(stderr, "ERROR: plugin [%s] no APIs...\n", path);
- goto error3;