+static
+const bt_component_class_source *find_source_component_class(
+ const char *plugin_name, const char *comp_class_name)
+{
+ return (const void *) find_component_class_from_plugin(
+ plugin_name, comp_class_name,
+ (plugin_borrow_comp_cls_func_t)
+ bt_plugin_borrow_source_component_class_by_name_const);
+}
+
+static
+const bt_component_class_filter *find_filter_component_class(
+ const char *plugin_name, const char *comp_class_name)
+{
+ return (const void *) find_component_class_from_plugin(
+ plugin_name, comp_class_name,
+ (plugin_borrow_comp_cls_func_t)
+ bt_plugin_borrow_filter_component_class_by_name_const);
+}
+
+static
+const bt_component_class_sink *find_sink_component_class(
+ const char *plugin_name, const char *comp_class_name)
+{
+ return (const void *) find_component_class_from_plugin(plugin_name,
+ comp_class_name,
+ (plugin_borrow_comp_cls_func_t)
+ bt_plugin_borrow_sink_component_class_by_name_const);
+}
+
+static
+const bt_component_class *find_component_class(const char *plugin_name,
+ const char *comp_class_name,
+ enum bt_component_class_type comp_class_type)
+{
+ const bt_component_class *comp_cls = NULL;
+
+ switch (comp_class_type) {
+ case BT_COMPONENT_CLASS_TYPE_SOURCE:
+ comp_cls = bt_component_class_source_as_component_class_const(find_source_component_class(plugin_name, comp_class_name));
+ break;
+ case BT_COMPONENT_CLASS_TYPE_FILTER:
+ comp_cls = bt_component_class_filter_as_component_class_const(find_filter_component_class(plugin_name, comp_class_name));
+ break;
+ case BT_COMPONENT_CLASS_TYPE_SINK:
+ comp_cls = bt_component_class_sink_as_component_class_const(find_sink_component_class(plugin_name, comp_class_name));
+ break;
+ default:
+ abort();
+ }
+
+ return comp_cls;
+}
+