X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fgraph%2Fcomponent.h;h=f2db9d723c1f254056937b90e1be920fe016429f;hb=5c5632787fc9cafa602c89a28966bcfd01ec0204;hp=7423e92a5fa3861c83360e7316adbd8187a84597;hpb=312c056ae3d374b253fa0cfe5ed576c0b0e5e569;p=babeltrace.git diff --git a/include/babeltrace/graph/component.h b/include/babeltrace/graph/component.h index 7423e92a..f2db9d72 100644 --- a/include/babeltrace/graph/component.h +++ b/include/babeltrace/graph/component.h @@ -33,6 +33,9 @@ /* For bt_bool */ #include +/* For bt_get */ +#include + #ifdef __cplusplus extern "C" { #endif @@ -84,7 +87,13 @@ bt_bool bt_component_is_sink(struct bt_component *component) 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 }