Replace assert() -> BT_ASSERT() and some preconditions with BT_ASSERT_PRE()
[babeltrace.git] / include / babeltrace / ctf-ir / event-internal.h
index b15af1107ead8b12aadfb575e053bcd7863d73c3..8dab37891000d5c188866f2341a1bba6d0ef2fd0 100644 (file)
@@ -35,7 +35,7 @@
 #include <babeltrace/ctf-ir/stream.h>
 #include <babeltrace/ctf-ir/packet.h>
 #include <babeltrace/object-internal.h>
-#include <assert.h>
+#include <babeltrace/assert-internal.h>
 #include <glib.h>
 
 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;
 }
 
This page took 0.024635 seconds and 4 git commands to generate.