diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-11-15 13:11:03 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-02-24 10:58:57 +0000 |
commit | 830a63f1049c6ef6281c6743e0f9e7e66d5cd8da (patch) | |
tree | bd33350f355e2e426d42981b8abd980c3ad6333b | |
parent | abd6294fa5a9de25802cc2cbe21b6e6e401d9328 (diff) | |
download | dbus-830a63f1049c6ef6281c6743e0f9e7e66d5cd8da.tar.gz |
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 <simon.mcvittie@collabora.co.uk>
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
-rw-r--r-- | 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 7251d654..57fc586a 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; /** @} */ |