Commit 830a63f1 authored by Simon McVittie's avatar Simon McVittie

DBusBasicValue: add bool_val and fd members to complete the set

dbus_bool_t is the same as dbus_uint32_t, but if we have a separate
bool_val member, it's more obvious that people are getting it right.
It's not called bool because that's a keyword in C++.

int (for file descriptors) doesn't appear in the D-Bus message wire
format, but then again neither does char *, and
dbus_message_iter_get_basic() and friends can return an int (due to
internal index-into-array-of-fds -> fd remapping in libdbus).
In theory int might not be the same size as any of the dbus_intNN_t
types, and anyway it's easier to see that people are getting it right
if we make it explicit.

Bug: default avatarSimon McVittie <>
Reviewed-by: default avatarWill Thompson <>
parent abd6294f
......@@ -161,6 +161,7 @@ typedef union
dbus_uint16_t u16; /**< as int16 */
dbus_int32_t i32; /**< as int32 */
dbus_uint32_t u32; /**< as int32 */
dbus_bool_t bool_val; /**< as boolean */
#ifdef DBUS_HAVE_INT64
dbus_int64_t i64; /**< as int64 */
dbus_uint64_t u64; /**< as int64 */
......@@ -168,7 +169,8 @@ typedef union
DBus8ByteStruct eight; /**< as 8-byte struct */
double dbl; /**< as double */
unsigned char byt; /**< as byte */
char *str; /**< as char* */
char *str; /**< as char* (string, object path or signature) */
int fd; /**< as Unix file descriptor */
} DBusBasicValue;
/** @} */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment