Remove default port API
[babeltrace.git] / lib / graph / component.c
index 792a36145bf2aaf8dbf78c34c2fa990de11b56cc..c4f26a8989c6d78e0914ecc016eda6f746c2c811 100644 (file)
@@ -135,7 +135,7 @@ enum bt_component_class_type bt_component_get_class_type(
 static
 struct bt_port *bt_component_add_port(
                struct bt_component *component, GPtrArray *ports,
-               enum bt_port_type port_type, const char *name)
+               enum bt_port_type port_type, const char *name, void *user_data)
 {
        size_t i;
        struct bt_port *new_port = NULL;
@@ -162,7 +162,7 @@ struct bt_port *bt_component_add_port(
                }
        }
 
-       new_port = bt_port_create(component, port_type, name);
+       new_port = bt_port_create(component, port_type, name, user_data);
        if (!new_port) {
                goto end;
        }
@@ -209,7 +209,6 @@ struct bt_component *bt_component_create_with_init_method_data(
        int ret;
        struct bt_component *component = NULL;
        enum bt_component_class_type type;
-       struct bt_port *default_port = NULL;
 
        bt_get(params);
 
@@ -273,32 +272,6 @@ struct bt_component *bt_component_create_with_init_method_data(
                goto end;
        }
 
-       if (type == BT_COMPONENT_CLASS_TYPE_SOURCE ||
-                       type == BT_COMPONENT_CLASS_TYPE_FILTER) {
-               default_port = bt_component_add_port(component,
-                       component->output_ports, BT_PORT_TYPE_OUTPUT,
-                       DEFAULT_OUTPUT_PORT_NAME);
-               if (!default_port) {
-                       BT_PUT(component);
-                       goto end;
-               }
-
-               BT_PUT(default_port);
-       }
-
-       if (type == BT_COMPONENT_CLASS_TYPE_FILTER ||
-                       type == BT_COMPONENT_CLASS_TYPE_SINK) {
-               default_port = bt_component_add_port(component,
-                       component->input_ports, BT_PORT_TYPE_INPUT,
-                       DEFAULT_INPUT_PORT_NAME);
-               if (!default_port) {
-                       BT_PUT(component);
-                       goto end;
-               }
-
-               BT_PUT(default_port);
-       }
-
        component->initializing = true;
 
        if (component_class->methods.init) {
@@ -322,7 +295,6 @@ struct bt_component *bt_component_create_with_init_method_data(
        bt_component_class_freeze(component->class);
 end:
        bt_put(params);
-       bt_put(default_port);
        return component;
 }
 
@@ -492,18 +464,20 @@ struct bt_port *bt_component_get_output_port_by_index(struct bt_component *comp,
 
 BT_HIDDEN
 struct bt_port *bt_component_add_input_port(
-               struct bt_component *component, const char *name)
+               struct bt_component *component, const char *name,
+               void *user_data)
 {
        return bt_component_add_port(component, component->input_ports,
-               BT_PORT_TYPE_INPUT, name);
+               BT_PORT_TYPE_INPUT, name, user_data);
 }
 
 BT_HIDDEN
 struct bt_port *bt_component_add_output_port(
-               struct bt_component *component, const char *name)
+               struct bt_component *component, const char *name,
+               void *user_data)
 {
        return bt_component_add_port(component, component->output_ports,
-               BT_PORT_TYPE_OUTPUT, name);
+               BT_PORT_TYPE_OUTPUT, name, user_data);
 }
 
 static
This page took 0.025773 seconds and 4 git commands to generate.