From 62978a41badcfd617faff75f468d612fd4e0bfa1 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 15 Nov 2011 13:11:03 +0000 Subject: [PATCH 2/2] 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 --- dbus/dbus-types.h | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/dbus/dbus-types.h b/dbus/dbus-types.h index 7251d65..57fc586 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; /** @} */ -- 1.7.7.2