From c7816d45e82ba8dd7e1e969c2cb6c3a27577cf68 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Fri, 28 Jan 2005 05:30:53 +0000 Subject: 2005-01-28 Havoc Pennington * 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 --- doc/TODO | 9 ++++---- doc/dbus-specification.xml | 54 ++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 57 insertions(+), 6 deletions(-) (limited to 'doc') diff --git a/doc/TODO b/doc/TODO index c2586c43..631b7719 100644 --- a/doc/TODO +++ b/doc/TODO @@ -36,14 +36,15 @@ Important for 1.0 yourself; is it an error, or allowed? If allowed, we need to have a test for it in the test suite. - - array lengths should probably be returned as size_t rather than int - (though they are kind of a pita to pass in as size_t with the - varargs, so maybe not - what does glib do with g_object_get()?) - - add string array support back to append_args() + - validate dict entry number of fields + - just before 1.0, try a HAVE_INT64=0 build and be sure it runs + - the spec and implementation should probably require dict keys + to be basic types + Important for 1.0 GLib Bindings === diff --git a/doc/dbus-specification.xml b/doc/dbus-specification.xml index c0be80fb..f72434b3 100644 --- a/doc/dbus-specification.xml +++ b/doc/dbus-specification.xml @@ -7,8 +7,8 @@
D-BUS Specification - Version 0.9 - 17 January 2005 + Version 0.10 + 28 January 2005 Havoc @@ -262,6 +262,28 @@ marshaled value of that type. + + A DICT_ENTRY works exactly like a struct, but rather + than parentheses it uses curly braces, and it has more restrictions. + The restrictions are: it occurs only as an array element type; and it + has exactly two single complete types inside the curly + braces. Implementations must not accept dict entries outside of arrays, + and must not accept dict entries with zero, one, or more than two + fields. A dict entry is always a key-value pair. + + + + The first field in the DICT_ENTRY is always the key. + A message is considered corrupt if the same key occurs twice in the same + array of DICT_ENTRY. However, for performance reasons + implementations are not required to reject dicts with duplicate keys. + + + + In most languages, an array of dict entry would be represented as a + map, hash table, or dict object. + + The following table summarizes the D-BUS types. @@ -286,6 +308,14 @@ BOOLEAN 98 (ASCII 'b') Boolean value, 0 is FALSE and 1 is TRUE. Everything else is invalid. + + INT16 + 110 (ASCII 'n') + 16-bit signed integer + + UINT16 + 113 (ASCII 'q') + 16-bit unsigned integer INT32 105 (ASCII 'i') @@ -330,6 +360,10 @@ VARIANT 118 (ASCII 'v') Variant type (the type of the value is part of the value itself) + + DICT_ENTRY + 101 (ASCII 'e'), 123 (ASCII '{'), 125 (ASCII '}') + Entry in a dict or map (array of key-value pairs) @@ -391,6 +425,14 @@ BOOLEAN As for UINT32, but only 0 and 1 are valid values. 4 + + INT16 + 16-bit signed integer in the message's byte order. + 2 + + UINT16 + 16-bit unsigned integer in the message's byte order. + 2 INT32 32-bit signed integer in the message's byte order. @@ -478,6 +520,14 @@ 1 (alignment of the signature) + + DICT_ENTRY + + Identical to STRUCT. + + + 8 + -- cgit