- /* init the plugin */
- plugin = pluginRegisterFct();
- if (plugin == NULL) {
- fprintf(stderr, "ERROR: plugin [%s] register function failed. continuing...\n", path);
- goto error2;
- }
-
- /* check the returned structure */
- if (plugin->type != AFB_PLUGIN_JSON) {
- fprintf(stderr, "ERROR: plugin [%s] invalid type %d...\n", path, plugin->type);
- goto error2;
- }
- if (plugin->prefix == NULL || *plugin->prefix == 0) {
- fprintf(stderr, "ERROR: plugin [%s] bad prefix...\n", path);
- goto error2;
- }
- if (plugin->info == NULL || *plugin->info == 0) {
- fprintf(stderr, "ERROR: plugin [%s] bad description...\n", path);
- goto error2;
- }
- if (plugin->apis == NULL) {
- fprintf(stderr, "ERROR: plugin [%s] no APIs...\n", path);
- goto error2;
- }
-
- /* check previously existing plugin */
- len = strlen(plugin->prefix);
- if (afb_apis_get_apiidx(plugin->prefix, len) >= 0) {
- fprintf(stderr, "ERROR: plugin [%s] prefix %s duplicated...\n", path, plugin->prefix);
- goto error2;