From: Simon McVittie Date: Tue, 15 Nov 2011 13:11:03 +0000 (+0000) Subject: DBusBasicValue: add bool_val and fd members to complete the set X-Git-Tag: dbus-1.5.12~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=830a63f1049c6ef6281c6743e0f9e7e66d5cd8da;p=thirdparty%2Fdbus.git 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: https://bugs.freedesktop.org/show_bug.cgi?id=11191 Signed-off-by: Simon McVittie Reviewed-by: Will Thompson --- diff --git a/dbus/dbus-types.h b/dbus/dbus-types.h index 7251d6543..57fc586ac 100644 --- a/dbus/dbus-types.h +++ b/dbus/dbus-types.h @@ -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; /** @} */