lib: add sink component class's "graph is configured" method
[babeltrace.git] / plugins / text / pretty / pretty.c
index d83b30c160123b85b3693a4bfab665e90118eaff..1b5729ab30c71081654ea90f7ce225e7fd44717c 100644 (file)
@@ -62,6 +62,9 @@ const char *plugin_options[] = {
        "field-callsite",
 };
 
+static
+const char * const in_port_name = "in";
+
 static
 void destroy_pretty_data(struct pretty_component *pretty)
 {
@@ -152,10 +155,8 @@ bt_self_component_status handle_message(
 }
 
 BT_HIDDEN
-bt_self_component_status pretty_port_connected(
-               bt_self_component_sink *comp,
-               bt_self_component_port_input *self_port,
-               const bt_port_output *other_port)
+bt_self_component_status pretty_graph_is_configured(
+               bt_self_component_sink *comp)
 {
        bt_self_component_status status = BT_SELF_COMPONENT_STATUS_OK;
        struct pretty_component *pretty;
@@ -165,7 +166,8 @@ bt_self_component_status pretty_port_connected(
        BT_ASSERT(pretty);
        BT_ASSERT(!pretty->iterator);
        pretty->iterator = bt_self_component_port_input_message_iterator_create(
-               self_port);
+               bt_self_component_sink_borrow_input_port_by_name(comp,
+                       in_port_name));
        if (!pretty->iterator) {
                status = BT_SELF_COMPONENT_STATUS_NOMEM;
        }
@@ -650,7 +652,8 @@ bt_self_component_status pretty_init(
                goto end;
        }
 
-       ret = bt_self_component_sink_add_input_port(comp, "in", NULL, NULL);
+       ret = bt_self_component_sink_add_input_port(comp, in_port_name,
+               NULL, NULL);
        if (ret != BT_SELF_COMPONENT_STATUS_OK) {
                goto end;
        }
This page took 0.024317 seconds and 4 git commands to generate.