- enum bt_plugin_status status = BT_PLUGIN_STATUS_OK;
- struct bt_component_class *comp_class_dup = NULL;
- int comp_class_index = -1;
-
- if (!plugin) {
- BT_LOGW_STR("Invalid parameter: plugin is NULL.");
- goto error;
- }
-
- if (!comp_class) {
- BT_LOGW_STR("Invalid parameter: component class is NULL.");
- goto error;
- }
-
- if (plugin->frozen) {
- BT_LOGW("Invalid parameter: plugin is frozen: "
- "addr=%p, name=\"%s\"", plugin,
- bt_plugin_get_name(plugin));
- goto error;
- }
-
- /* Check for duplicate */
- comp_class_dup = bt_plugin_get_component_class_by_name_and_type(plugin,
- bt_component_class_get_name(comp_class),
- bt_component_class_get_type(comp_class));
- if (comp_class_dup) {
- BT_LOGW("Invalid parameter: a component class with this name and type already exists in the plugin: "
- "plugin-addr=%p, plugin-name=\"%s\", plugin-path=\"%s\", "
- "comp-class-name=\"%s\", comp-class-type=%s",
- plugin, bt_plugin_get_name(plugin),
- bt_plugin_get_path(plugin),
- bt_component_class_get_name(comp_class),
- bt_component_class_type_string(
- bt_component_class_get_type(comp_class)));
- goto error;
- }