Make bt_graph_connect_ports() return a status code
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 7 Jun 2017 16:38:17 +0000 (12:38 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 9 Jun 2017 21:03:27 +0000 (17:03 -0400)
commita256a42d2324f0ba50153f29e2f7ef513a9905c0
tree2f81e20a2cec528db2708b65f8bac594b4c1e584
parent090a4c0ac02fab83b9ad13bc2abb81534820f7f4
Make bt_graph_connect_ports() return a status code

bt_graph_connect_ports() can fail for multiple reasons, some of which
are not errors per se, but conditions which make the connection
impossible, for example a component refuses the connection, or the graph
is canceled.

With this version, the connection is returned as an output parameter,
which can be NULL if the user is not interested in the connection object
(most common case), and the function returns a graph status code.

Two new status codes are added in order to satisfy this patch:

* BT_GRAPH_STATUS_COMPONENT_REFUSES_PORT_CONNECTION
* BT_GRAPH_STATUS_NOMEM

The first one is not considered an error, that is, the graph's user
could only _try_ to connect two components until the function returns
BT_GRAPH_STATUS_OK (and retry in case of
BT_GRAPH_STATUS_COMPONENT_REFUSES_PORT_CONNECTION).

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
cli/babeltrace.c
include/babeltrace/graph/graph-internal.h
include/babeltrace/graph/graph.h
lib/graph/graph.c
tests/lib/test_bt_notification_iterator.c
tests/lib/test_graph_topo.c
tests/plugins/test-utils-muxer.c
This page took 0.025772 seconds and 4 git commands to generate.