X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fgraph%2Fnotification-stream-internal.h;h=a9067947bbf1f8a6370b6d8b3cc4e8a193888c9b;hb=6ac74c0c883983329e958a1e0580ecde29985c76;hp=839c220ccaa445773150d33b20d61697bb53e7c6;hpb=b2e0c9076135f47110af2d96dfaee397c597bc90;p=babeltrace.git diff --git a/include/babeltrace/graph/notification-stream-internal.h b/include/babeltrace/graph/notification-stream-internal.h index 839c220c..a9067947 100644 --- a/include/babeltrace/graph/notification-stream-internal.h +++ b/include/babeltrace/graph/notification-stream-internal.h @@ -1,5 +1,5 @@ -#ifndef BABELTRACE_COMPONENT_NOTIFICATION_STREAM_INTERNAL_H -#define BABELTRACE_COMPONENT_NOTIFICATION_STREAM_INTERNAL_H +#ifndef BABELTRACE_GRAPH_NOTIFICATION_STREAM_INTERNAL_H +#define BABELTRACE_GRAPH_NOTIFICATION_STREAM_INTERNAL_H /* * BabelTrace - Stream-related Notifications @@ -27,12 +27,43 @@ * SOFTWARE. */ +#include #include #include +#include + +struct bt_notification_stream_begin { + struct bt_notification parent; + struct bt_stream *stream; +}; struct bt_notification_stream_end { struct bt_notification parent; - struct bt_ctf_stream *stream; + struct bt_stream *stream; }; -#endif /* BABELTRACE_COMPONENT_NOTIFICATION_STREAM_INTERNAL_H */ +static inline +struct bt_stream *bt_notification_stream_begin_borrow_stream( + struct bt_notification *notif) +{ + struct bt_notification_stream_begin *notif_stream_begin = + container_of(notif, + struct bt_notification_stream_begin, parent); + + BT_ASSERT(notif_stream_begin); + return notif_stream_begin->stream; +} + +static inline +struct bt_stream *bt_notification_stream_end_borrow_stream( + struct bt_notification *notif) +{ + struct bt_notification_stream_end *notif_stream_end = + container_of(notif, + struct bt_notification_stream_end, parent); + + BT_ASSERT(notif_stream_end); + return notif_stream_end->stream; +} + +#endif /* BABELTRACE_GRAPH_NOTIFICATION_STREAM_INTERNAL_H */