lib: make public reference count functions have strict types
[babeltrace.git] / include / babeltrace / trace-ir / packet-const.h
index a59324fc7b9b160a94fae10e64364a1084205111..3aee95ec60c194badfc0c385efe8c49b70c325ea 100644 (file)
@@ -73,6 +73,23 @@ extern
 enum bt_property_availability bt_packet_get_packet_counter_snapshot(
                const struct bt_packet *packet, uint64_t *value);
 
+extern void bt_packet_get_ref(const struct bt_packet *packet);
+
+extern void bt_packet_put_ref(const struct bt_packet *packet);
+
+#define BT_PACKET_PUT_REF_AND_RESET(_var)              \
+       do {                                            \
+               bt_packet_put_ref(_var);                \
+               (_var) = NULL;                          \
+       } while (0)
+
+#define BT_PACKET_MOVE_REF(_var_dst, _var_src)         \
+       do {                                            \
+               bt_packet_put_ref(_var_dst);            \
+               (_var_dst) = (_var_src);                \
+               (_var_src) = NULL;                      \
+       } while (0)
+
 #ifdef __cplusplus
 }
 #endif
This page took 0.02421 seconds and 4 git commands to generate.