Return component port counts by parameter
[babeltrace.git] / lib / component / sink.c
index e6c890c650547e29104bdab084410e46c762e8b2..e516d325a1a3d83e8822b27f9c85bbf0edea2c81 100644 (file)
@@ -163,25 +163,26 @@ end:
 }
 */
 
-int bt_component_sink_get_input_port_count(struct bt_component *component)
+enum bt_component_status bt_component_sink_get_input_port_count(
+               struct bt_component *component, uint64_t *count)
 {
-       int ret;
+       enum bt_component_status status = BT_COMPONENT_STATUS_OK;
        struct bt_component_sink *sink;
 
-       if (!component) {
-               ret = -1;
+       if (!component || !count) {
+               status = BT_COMPONENT_STATUS_INVALID;
                goto end;
        }
 
        if (component->class->type != BT_COMPONENT_CLASS_TYPE_SINK) {
-               ret = -1;
+               status = BT_COMPONENT_STATUS_INVALID;
                goto end;
        }
 
        sink = container_of(component, struct bt_component_sink, parent);
-       ret = sink->input_ports->len;
+       *count = (uint64_t) sink->input_ports->len;
 end:
-       return ret;
+       return status;
 }
 
 struct bt_port *bt_component_sink_get_input_port(
This page took 0.023171 seconds and 4 git commands to generate.