lib: make public reference count functions have strict types
[babeltrace.git] / include / babeltrace / trace-ir / event-class-const.h
index 39d025f609ba44dceee55a8da8dc0462cfb44c8c..2cc9d793b0310a6a2ad2ba95e976e58adbbcf7ee 100644 (file)
@@ -80,6 +80,23 @@ bt_event_class_borrow_specific_context_field_class(
 extern const struct bt_field_class *bt_event_class_borrow_payload_field_class(
                const struct bt_event_class *event_class);
 
+extern void bt_event_class_get_ref(const struct bt_event_class *event_class);
+
+extern void bt_event_class_put_ref(const struct bt_event_class *event_class);
+
+#define BT_EVENT_CLASS_PUT_REF_AND_RESET(_var)         \
+       do {                                            \
+               bt_event_class_put_ref(_var);           \
+               (_var) = NULL;                          \
+       } while (0)
+
+#define BT_EVENT_CLASS_MOVE_REF(_var_dst, _var_src)    \
+       do {                                            \
+               bt_event_class_put_ref(_var_dst);       \
+               (_var_dst) = (_var_src);                \
+               (_var_src) = NULL;                      \
+       } while (0)
+
 #ifdef __cplusplus
 }
 #endif
This page took 0.023192 seconds and 4 git commands to generate.