-int bt_ctfser_write_int(struct bt_ctfser *ctfser, union bt_ctfser_int_val value,
- unsigned int alignment_bits, unsigned int size_bits, bool is_signed,
+int bt_ctfser_write_byte_aligned_signed_int(struct bt_ctfser *ctfser,
+ int64_t value, unsigned int alignment_bits,
+ unsigned int size_bits, int byte_order)
+{
+ int ret;
+
+ BT_ASSERT(alignment_bits % 8 == 0);
+ ret = bt_ctfser_align_offset_in_current_packet(ctfser, alignment_bits);
+ if (unlikely(ret)) {
+ goto end;
+ }
+
+ if (unlikely(!_bt_ctfser_has_space_left(ctfser, size_bits))) {
+ ret = _bt_ctfser_increase_cur_packet_size(ctfser);
+ if (unlikely(ret)) {
+ goto end;
+ }
+ }
+
+ ret = _bt_ctfser_write_byte_aligned_signed_int_no_align(ctfser, value,
+ size_bits, byte_order);
+ if (unlikely(ret)) {
+ goto end;
+ }
+
+end:
+ return ret;
+}
+
+/*
+ * Writes an unsigned integer at the current offset within the current
+ * packet.
+ */
+static inline
+int bt_ctfser_write_unsigned_int(struct bt_ctfser *ctfser, uint64_t value,
+ unsigned int alignment_bits, unsigned int size_bits,