/* For bt_bool */
#include <babeltrace/types.h>
+/* For bt_get */
+#include <babeltrace/ref.h>
+
#ifdef __cplusplus
extern "C" {
#endif
BT_COMPONENT_CLASS_TYPE_SINK;
}
-extern struct bt_graph *bt_component_get_graph(struct bt_component *component);
+extern struct bt_graph *bt_component_borrow_graph(struct bt_component *component);
+
+static inline
+struct bt_graph *bt_component_get_graph(struct bt_component *component)
+{
+ return bt_get(bt_component_borrow_graph(component));
+}
#ifdef __cplusplus
}