diff options
author | Havoc Pennington <hp@redhat.com> | 2005-01-28 05:30:53 +0000 |
---|---|---|
committer | Havoc Pennington <hp@redhat.com> | 2005-01-28 05:30:53 +0000 |
commit | c7816d45e82ba8dd7e1e969c2cb6c3a27577cf68 (patch) | |
tree | dab370aee8a3a856b52daab0c898bfce06233288 /dbus/dbus-message.c | |
parent | 3ed9db546e1143bc9aa2d83a6f423fdd81227352 (diff) |
2005-01-28 Havoc Pennington <hp@redhat.com>
* doc/dbus-specification.xml: update to describe 16-bit types and
dict entries
* dbus/dbus-marshal-basic.c (_dbus_unpack_uint16): fix broken
assertion
* dbus/dbus-protocol.h (DBUS_TYPE_DICT_ENTRY): add DICT_ENTRY as a
type
* dbus/dbus-marshal-recursive.c: implement
Diffstat (limited to 'dbus/dbus-message.c')
-rw-r--r-- | dbus/dbus-message.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/dbus/dbus-message.c b/dbus/dbus-message.c index 38ae317a..85252005 100644 --- a/dbus/dbus-message.c +++ b/dbus/dbus-message.c @@ -2112,10 +2112,10 @@ dbus_message_iter_append_fixed_array (DBusMessageIter *iter, * dbus_message_iter_close_container(). Container types are for * example struct, variant, and array. For variants, the * contained_signature should be the type of the single value inside - * the variant. For structs, contained_signature should be #NULL; it - * will be set to whatever types you write into the struct. For - * arrays, contained_signature should be the type of the array - * elements. + * the variant. For structs and dict entries, contained_signature + * should be #NULL; it will be set to whatever types you write into + * the struct. For arrays, contained_signature should be the type of + * the array elements. * * @todo If this fails due to lack of memory, the message is hosed and * you have to start over building the whole message. @@ -2142,7 +2142,21 @@ dbus_message_iter_open_container (DBusMessageIter *iter, _dbus_return_val_if_fail (sub != NULL, FALSE); _dbus_return_val_if_fail ((type == DBUS_TYPE_STRUCT && contained_signature == NULL) || + (type == DBUS_TYPE_DICT_ENTRY && + contained_signature == NULL) || contained_signature != NULL, FALSE); + _dbus_return_val_if_fail (type != DBUS_TYPE_DICT_ENTRY || + dbus_message_iter_get_arg_type (iter) == DBUS_TYPE_ARRAY, + FALSE); + +#if 0 + /* FIXME this would fail if the contained_signature is a dict entry, + * since dict entries are invalid signatures standalone (they must be in + * an array) + */ + _dbus_return_val_if_fail (contained_signature == NULL || + _dbus_check_is_valid_signature (contained_signature)); +#endif if (!_dbus_message_iter_open_signature (real)) return FALSE; |