X-Git-Url: https://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fctf-ir%2Fevent-internal.h;h=8dab37891000d5c188866f2341a1bba6d0ef2fd0;hb=f6ccaed94e575af57fe6bf38154771bee4871a2a;hp=b15af1107ead8b12aadfb575e053bcd7863d73c3;hpb=464ebc311d460b29f681703aea0aa00eef9e6475;p=babeltrace.git diff --git a/include/babeltrace/ctf-ir/event-internal.h b/include/babeltrace/ctf-ir/event-internal.h index b15af110..8dab3789 100644 --- a/include/babeltrace/ctf-ir/event-internal.h +++ b/include/babeltrace/ctf-ir/event-internal.h @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include struct bt_stream_pos; @@ -53,29 +53,39 @@ struct bt_event { int frozen; }; -BT_HIDDEN -int bt_event_validate(struct bt_event *event); - BT_HIDDEN int bt_event_serialize(struct bt_event *event, struct bt_stream_pos *pos, enum bt_byte_order native_byte_order); BT_HIDDEN -void bt_event_freeze(struct bt_event *event); +int _bt_event_validate(struct bt_event *event); -static inline struct bt_packet *bt_event_borrow_packet( - struct bt_event *event) +BT_HIDDEN +void _bt_event_freeze(struct bt_event *event); + +#ifdef BT_DEV_MODE +# define bt_event_validate _bt_event_validate +# define bt_event_freeze _bt_event_freeze +#else +# define bt_event_validate(_event) 0 +# define bt_event_freeze(_event) +#endif + +static inline struct bt_packet *bt_event_borrow_packet(struct bt_event *event) { - assert(event); + BT_ASSERT(event); return event->packet; } +BT_HIDDEN +struct bt_stream *bt_event_borrow_stream(struct bt_event *event); + static inline struct bt_event_class *bt_event_borrow_event_class( struct bt_event *event) { - assert(event); + BT_ASSERT(event); return event->event_class; }