From: Philippe Proulx Date: Thu, 6 Apr 2017 07:29:48 +0000 (-0400) Subject: Add bt_port_is_input(), bt_port_is_output() X-Git-Tag: v2.0.0-pre1~372 X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=e365508426b71db9bdc15274058a473ad7b55477;p=babeltrace.git Add bt_port_is_input(), bt_port_is_output() Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- diff --git a/include/babeltrace/graph/port.h b/include/babeltrace/graph/port.h index 9d802440..af406341 100644 --- a/include/babeltrace/graph/port.h +++ b/include/babeltrace/graph/port.h @@ -28,6 +28,7 @@ */ #include +#include #ifdef __cplusplus extern "C" { @@ -58,6 +59,18 @@ extern int bt_port_remove_from_component(struct bt_port *port); extern int bt_port_disconnect(struct bt_port *port); extern int bt_port_is_connected(struct bt_port *port); +static inline +bool bt_port_is_input(struct bt_port *port) +{ + return bt_port_get_type(port) == BT_PORT_TYPE_INPUT; +} + +static inline +bool bt_port_is_output(struct bt_port *port) +{ + return bt_port_get_type(port) == BT_PORT_TYPE_OUTPUT; +} + #ifdef __cplusplus } #endif