#define BABELTRACE_TRACE_IR_PACKET_CONST_H
/*
- * Copyright 2016 Philippe Proulx <pproulx@efficios.com>
+ * Copyright 2016-2018 Philippe Proulx <pproulx@efficios.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
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