X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fgraph%2Fconnection-internal.h;h=366dc0e4e8babc81ed854fdcfc76f9065689af15;hb=6ac74c0c883983329e958a1e0580ecde29985c76;hp=fb4f668f36c040c8bfb62cf4da545239aa8f65df;hpb=c28d097c6679d7b46b79fd3b5bdf0853520f9740;p=babeltrace.git diff --git a/include/babeltrace/graph/connection-internal.h b/include/babeltrace/graph/connection-internal.h index fb4f668f..366dc0e4 100644 --- a/include/babeltrace/graph/connection-internal.h +++ b/include/babeltrace/graph/connection-internal.h @@ -1,5 +1,5 @@ -#ifndef BABELTRACE_COMPONENT_CONNECTION_INTERNAL_H -#define BABELTRACE_COMPONENT_CONNECTION_INTERNAL_H +#ifndef BABELTRACE_GRAPH_CONNECTION_INTERNAL_H +#define BABELTRACE_GRAPH_CONNECTION_INTERNAL_H /* * BabelTrace - Component Connection Internal @@ -29,8 +29,11 @@ #include #include +#include #include #include +#include +#include struct bt_graph; @@ -58,7 +61,7 @@ struct bt_connection { }; static inline -struct bt_connection *bt_connection_from_private( +struct bt_connection *bt_connection_borrow_from_private( struct bt_private_connection *private_connection) { return (void *) private_connection; @@ -77,16 +80,16 @@ struct bt_connection *bt_connection_create(struct bt_graph *graph, struct bt_port *downstream_port); BT_HIDDEN -void bt_connection_disconnect_ports(struct bt_connection *conn); +void bt_connection_end(struct bt_connection *conn, bool try_remove_from_graph); BT_HIDDEN void bt_connection_remove_iterator(struct bt_connection *conn, - struct bt_notification_iterator *iterator); + struct bt_notification_iterator_private_connection *iterator); static inline struct bt_graph *bt_connection_borrow_graph(struct bt_connection *conn) { - assert(conn); + BT_ASSERT(conn); return (void *) conn->base.parent; } @@ -121,4 +124,25 @@ bt_connection_status_from_notification_iterator_status( } } -#endif /* BABELTRACE_COMPONENT_CONNECTION_INTERNAL_H */ +static inline +const char *bt_connection_status_string(enum bt_connection_status status) +{ + switch (status) { + case BT_CONNECTION_STATUS_GRAPH_IS_CANCELED: + return "BT_CONNECTION_STATUS_GRAPH_IS_CANCELED"; + case BT_CONNECTION_STATUS_OK: + return "BT_CONNECTION_STATUS_OK"; + case BT_CONNECTION_STATUS_INVALID: + return "BT_CONNECTION_STATUS_INVALID"; + case BT_CONNECTION_STATUS_ERROR: + return "BT_CONNECTION_STATUS_ERROR"; + case BT_CONNECTION_STATUS_NOMEM: + return "BT_CONNECTION_STATUS_NOMEM"; + case BT_CONNECTION_STATUS_IS_ENDED: + return "BT_CONNECTION_STATUS_IS_ENDED"; + default: + return "(unknown)"; + } +} + +#endif /* BABELTRACE_GRAPH_CONNECTION_INTERNAL_H */