Add bt_port_is_input(), bt_port_is_output()
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 6 Apr 2017 07:29:48 +0000 (03:29 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 16:57:40 +0000 (12:57 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
include/babeltrace/graph/port.h

index 9d802440c41a4585166fcceb22b0bbb6928ed9e9..af4063415811a733a251f86e2e8e58871f236e6f 100644 (file)
@@ -28,6 +28,7 @@
  */
 
 #include <stdint.h>
+#include <stdbool.h>
 
 #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
This page took 0.049639 seconds and 4 git commands to generate.