-enum bt_component_status bt_component_filter_set_iterator_init_cb(
- struct bt_component *component,
- bt_component_filter_init_iterator_cb init_iterator)
-{
- struct bt_component_filter *filter;
- enum bt_component_status ret = BT_COMPONENT_STATUS_OK;
-
- if (component->class->type != BT_COMPONENT_TYPE_FILTER ||
- !component->initializing) {
- ret = BT_COMPONENT_STATUS_INVALID;
- goto end;
- }
-
- filter = container_of(component, struct bt_component_filter, parent);
- filter->init_iterator = init_iterator;
-end:
- return ret;
-}
-
-enum bt_component_status bt_component_filter_set_add_iterator_cb(
- struct bt_component *component,
- bt_component_filter_add_iterator_cb add_iterator)
-{
- struct bt_component_filter *filter;
- enum bt_component_status ret = BT_COMPONENT_STATUS_OK;
-
- if (!component) {
- ret = BT_COMPONENT_STATUS_INVALID;
- goto end;
- }
-
- if (bt_component_get_type(component) != BT_COMPONENT_TYPE_FILTER) {
- ret = BT_COMPONENT_STATUS_UNSUPPORTED;
- goto end;
- }
-
- if (!component->initializing) {
- ret = BT_COMPONENT_STATUS_INVALID;
- goto end;
- }
-
- filter = container_of(component, struct bt_component_filter, parent);
- filter->add_iterator = add_iterator;
-end:
- return ret;
-}
-