lib: rename include dir to babeltrace2
[babeltrace.git] / lib / graph / port.c
index 01ee3944fc62bc83d101545da44266055e966399..f119d60b6dfb5414ac805cc90b3b1550c4296f2b 100644 (file)
  */
 
 #define BT_LOG_TAG "PORT"
-#include <babeltrace/lib-logging-internal.h>
-
-#include <babeltrace/graph/port-const.h>
-#include <babeltrace/graph/port-input-const.h>
-#include <babeltrace/graph/port-output-const.h>
-#include <babeltrace/graph/self-component-port.h>
-#include <babeltrace/graph/self-component-port-input.h>
-#include <babeltrace/graph/self-component-port-output.h>
-#include <babeltrace/graph/component-internal.h>
-#include <babeltrace/graph/port-internal.h>
-#include <babeltrace/graph/connection-internal.h>
-#include <babeltrace/object-internal.h>
-#include <babeltrace/object.h>
-#include <babeltrace/compiler-internal.h>
-#include <babeltrace/assert-internal.h>
-#include <babeltrace/assert-pre-internal.h>
+#include <babeltrace2/lib-logging-internal.h>
+
+#include <babeltrace2/assert-internal.h>
+#include <babeltrace2/assert-pre-internal.h>
+#include <babeltrace2/graph/port-const.h>
+#include <babeltrace2/graph/port-input-const.h>
+#include <babeltrace2/graph/port-output-const.h>
+#include <babeltrace2/graph/self-component-port.h>
+#include <babeltrace2/graph/self-component-port-input.h>
+#include <babeltrace2/graph/self-component-port-output.h>
+#include <babeltrace2/graph/component-internal.h>
+#include <babeltrace2/graph/port-internal.h>
+#include <babeltrace2/graph/connection-internal.h>
+#include <babeltrace2/object-internal.h>
+#include <babeltrace2/compiler-internal.h>
 
 static
 void destroy_port(struct bt_object *obj)
@@ -138,36 +137,44 @@ void bt_port_set_connection(struct bt_port *port,
                connection);
 }
 
-enum bt_self_component_port_status bt_self_component_port_remove_from_component(
-               struct bt_self_component_port *self_port)
+bt_bool bt_port_is_connected(const struct bt_port *port)
 {
-       struct bt_port *port = (void *) self_port;
-       struct bt_component *comp = NULL;
+       BT_ASSERT_PRE_NON_NULL(port, "Port");
+       return port->connection ? BT_TRUE : BT_FALSE;
+}
 
+void *bt_self_component_port_get_data(const struct bt_self_component_port *port)
+{
        BT_ASSERT_PRE_NON_NULL(port, "Port");
+       return ((struct bt_port *) port)->user_data;
+}
 
-       comp = (void *) bt_object_borrow_parent(&port->base);
-       if (!comp) {
-               BT_LIB_LOGV("Port already removed from its component: %!+p",
-                       port);
-               goto end;
-       }
+void bt_port_get_ref(const struct bt_port *port)
+{
+       bt_object_get_ref(port);
+}
 
-       /* bt_component_remove_port() logs details */
-       bt_component_remove_port(comp, port);
+void bt_port_put_ref(const struct bt_port *port)
+{
+       bt_object_put_ref(port);
+}
 
-end:
-       return BT_SELF_PORT_STATUS_OK;
+void bt_port_input_get_ref(const struct bt_port_input *port_input)
+{
+       bt_object_get_ref(port_input);
 }
 
-bt_bool bt_port_is_connected(const struct bt_port *port)
+void bt_port_input_put_ref(const struct bt_port_input *port_input)
 {
-       BT_ASSERT_PRE_NON_NULL(port, "Port");
-       return port->connection ? BT_TRUE : BT_FALSE;
+       bt_object_put_ref(port_input);
 }
 
-void *bt_self_component_port_get_data(const struct bt_self_component_port *port)
+void bt_port_output_get_ref(const struct bt_port_output *port_output)
 {
-       BT_ASSERT_PRE_NON_NULL(port, "Port");
-       return ((struct bt_port *) port)->user_data;
+       bt_object_get_ref(port_output);
+}
+
+void bt_port_output_put_ref(const struct bt_port_output *port_output)
+{
+       bt_object_put_ref(port_output);
 }
This page took 0.024076 seconds and 4 git commands to generate.