Update notification iterator's "init" function signature
[babeltrace.git] / include / babeltrace / component / graph.h
index 814218fe9817132d140dba19e52874fc5bc32f5f..2d62484fa4bc220e9181269dcca1f3c44dd860e6 100644 (file)
@@ -37,6 +37,8 @@ struct bt_port;
 struct bt_connection;
 
 enum bt_graph_status {
+       /** No sink can consume at the moment. */
+       BT_GRAPH_STATUS_AGAIN = 2,
        /** Downstream component does not support multiple inputs. */
        BT_GRAPH_STATUS_END = 1,
        BT_GRAPH_STATUS_OK = 0,
@@ -50,10 +52,18 @@ enum bt_graph_status {
        BT_GRAPH_STATUS_NO_SINK = -4,
        /** General error. */
        BT_GRAPH_STATUS_ERROR = -5,
-       /** No sink can consume at the moment. */
-       BT_GRAPH_STATUS_AGAIN = -6,
 };
 
+typedef void (*bt_graph_port_added_listener)(struct bt_port *port,
+               void *data);
+typedef void (*bt_graph_port_removed_listener)(struct bt_component *component,
+               struct bt_port *port, void *data);
+typedef void (*bt_graph_port_connected_listener)(struct bt_port *port,
+               void *data);
+typedef void (*bt_graph_port_disconnected_listener)(
+               struct bt_component *component, struct bt_port *port,
+               void *data);
+
 extern struct bt_graph *bt_graph_create(void);
 
 /**
@@ -79,15 +89,30 @@ extern enum bt_graph_status bt_graph_add_component_as_sibling(
  * Runs "bt_component_sink_consume()" on all sinks in round-robin until they all
  * indicate that the end is reached or that an error occured.
  */
-extern enum bt_graph_status bt_graph_run(struct bt_graph *graph,
-               enum bt_component_status *component_status);
+extern enum bt_graph_status bt_graph_run(struct bt_graph *graph);
 
 /**
  * Runs "bt_component_sink_consume()" on the graph's sinks. Each invokation will
  * invoke "bt_component_sink_consume()" on the next sink, in round-robin, until
  * they all indicated that the end is reached.
  */
-extern enum bt_component_status bt_graph_consume(struct bt_graph *graph);
+extern enum bt_graph_status bt_graph_consume(struct bt_graph *graph);
+
+extern enum bt_graph_status bt_graph_add_port_added_listener(
+               struct bt_graph *graph,
+               bt_graph_port_added_listener listener, void *data);
+
+extern enum bt_graph_status bt_graph_add_port_removed_listener(
+               struct bt_graph *graph,
+               bt_graph_port_removed_listener listener, void *data);
+
+extern enum bt_graph_status bt_graph_add_port_connected_listener(
+               struct bt_graph *graph,
+               bt_graph_port_connected_listener listener, void *data);
+
+extern enum bt_graph_status bt_graph_add_port_disconnected_listener(
+               struct bt_graph *graph,
+               bt_graph_port_disconnected_listener listener, void *data);
 
 #ifdef __cplusplus
 }
This page took 0.024961 seconds and 4 git commands to generate.