lib: graph: add "self" and some "private" APIs
[babeltrace.git] / include / babeltrace / graph / port.h
index af4063415811a733a251f86e2e8e58871f236e6f..c70ca5e04e48e1a4515ce11ae728b6e7adb573eb 100644 (file)
@@ -1,9 +1,7 @@
-#ifndef BABELTRACE_COMPONENT_PORT_H
-#define BABELTRACE_COMPONENT_PORT_H
+#ifndef BABELTRACE_GRAPH_PORT_H
+#define BABELTRACE_GRAPH_PORT_H
 
 /*
- * BabelTrace - Babeltrace Component Connection Interface
- *
  * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
  *
  * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
@@ -28,7 +26,9 @@
  */
 
 #include <stdint.h>
-#include <stdbool.h>
+
+/* For bt_bool */
+#include <babeltrace/types.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -36,37 +36,31 @@ extern "C" {
 
 struct bt_port;
 struct bt_connection;
-
-enum bt_port_status {
-       BT_PORT_STATUS_OK = 0,
-       BT_PORT_STATUS_ERROR = -1,
-       BT_PORT_STATUS_INVALID = -2,
-};
+struct bt_component;
 
 enum bt_port_type {
        BT_PORT_TYPE_INPUT = 0,
        BT_PORT_TYPE_OUTPUT = 1,
-       BT_PORT_TYPE_UNKOWN = -1,
 };
 
-extern const char *BT_DEFAULT_PORT_NAME;
-
 extern const char *bt_port_get_name(struct bt_port *port);
+
 extern enum bt_port_type bt_port_get_type(struct bt_port *port);
-extern struct bt_connection *bt_port_get_connection(struct bt_port *port);
-extern struct bt_component *bt_port_get_component(struct bt_port *port);
-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);
+
+extern struct bt_connection *bt_port_borrow_connection(struct bt_port *port);
+
+extern struct bt_component *bt_port_borrow_component(struct bt_port *port);
+
+extern bt_bool bt_port_is_connected(struct bt_port *port);
 
 static inline
-bool bt_port_is_input(struct bt_port *port)
+bt_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)
+bt_bool bt_port_is_output(struct bt_port *port)
 {
        return bt_port_get_type(port) == BT_PORT_TYPE_OUTPUT;
 }
@@ -75,4 +69,4 @@ bool bt_port_is_output(struct bt_port *port)
 }
 #endif
 
-#endif /* BABELTRACE_COMPONENT_PORT_H */
+#endif /* BABELTRACE_GRAPH_PORT_H */
This page took 0.025566 seconds and 4 git commands to generate.