Add bt_connection_is_ended()
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 7 Jun 2017 15:52:37 +0000 (11:52 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 9 Jun 2017 21:03:27 +0000 (17:03 -0400)
Quickly indicates if a connection is ended without having to get and
puts its individual endpoint ports.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
include/babeltrace/graph/connection.h
lib/graph/connection.c

index 2d276fe3ac0ee45ecc38e2cca6892a49c0392536..60b9eef81c83a3a3080c84894e29b852bec6b6c9 100644 (file)
@@ -41,6 +41,8 @@ extern struct bt_port *bt_connection_get_downstream_port(
 extern struct bt_port *bt_connection_get_upstream_port(
                struct bt_connection *connection);
 
+extern bt_bool bt_connection_is_ended(struct bt_connection *connection);
+
 #ifdef __cplusplus
 }
 #endif
index b0f64aeb871403965c0fbcb88a2235a2a93ca636..a13bce3e55e2d3114aaf374891897eace082eb59 100644 (file)
@@ -402,3 +402,8 @@ void bt_connection_remove_iterator(struct bt_connection *conn,
                "conn-addr=%p, iter-addr=%p", conn, iterator);
        bt_connection_try_remove_from_graph(conn);
 }
+
+bt_bool bt_connection_is_ended(struct bt_connection *connection)
+{
+       return !connection->downstream_port && !connection->upstream_port;
+}
This page took 0.027764 seconds and 4 git commands to generate.