Expressing large integer values in D-Bus APIs

Lawrence D'Oliveiro ldo at geek-central.gen.nz
Mon Jul 17 20:10:21 UTC 2017


On Mon, 17 Jul 2017 12:12:09 -0700, Andy Grover wrote:

> If we have a large integer value that might exceed 64 bits, how best
> to expose it on D-Bus? Convert to string? an array of [u64 (high),
> u64 (low)]? An array of 16 bytes and specify endianness?

An array of integers sounds like the obvious answer, so you
concatenate the bits to produce the complete value. Have all unsigned
except the last, which would carry the sign for a signed integer. Or
have a separate boolean to convey the sign.

This could be extended further, with a struct if you want to have an
exponent for floating-point as well.


More information about the dbus mailing list