- /* retrieves the register function */
- pluginAfbV1RegisterFct = dlsym(desc->handle, plugin_register_function);
- if (!pluginAfbV1RegisterFct) {
- ERROR("plugin [%s] is not an AFB plugin", path);
- goto error3;
- }
- INFO("plugin [%s] is a valid AFB plugin", path);
-
- /* init the interface */
- desc->interface.verbosity = 0;
- desc->interface.mode = AFB_MODE_LOCAL;
- desc->interface.daemon.itf = &daemon_itf;
- desc->interface.daemon.closure = desc;
-
- /* init the plugin */
- desc->plugin = pluginAfbV1RegisterFct(&desc->interface);
- if (desc->plugin == NULL) {
- ERROR("plugin [%s] register function failed. continuing...", path);
- goto error3;
- }
-
- /* 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;