Re: Expressing large integer values in D-Bus APIs
Lawrence D'Oliveiro <ldo-kC51rjc0cqs1dNLGKZg6taU/[email protected]>
| Newsgroups | gmane.comp.freedesktop.dbus |
|---|---|
| Organization | Geek Central |
| Message-ID | <[email protected]> |
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. _______________________________________________ dbus mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dbus