From 799a3ff443f5357ae7857ebe989a7f92f7bd84df Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Mon, 10 Mar 2003 00:13:55 +0000 Subject: 2003-03-10 Anders Carlsson * dbus/dbus-marshal.c: (_dbus_marshal_set_string): Take a length argument so we can marshal the correct string length. (_dbus_marshal_dict), (_dbus_demarshal_dict), (_dbus_marshal_get_arg_end_pos), (_dbus_marshal_validate_arg), (_dbus_marshal_test): * dbus/dbus-marshal.h: Add support for marshalling and demarshalling dicts. * dbus/dbus-message-builder.c: (_dbus_message_data_load): Add support for TYPE DICT. * dbus/dbus-message.c: (set_string_field): Adjust header padding. (dbus_message_append_args_valist), (dbus_message_append_dict), (dbus_message_get_args_valist), (dbus_message_iter_get_arg_type), (dbus_message_iter_get_dict), (_dbus_message_loader_return_buffer), (check_message_handling), (check_have_valid_message): * dbus/dbus-message.h: Add functions for setting and getting dicts. * dbus/dbus-protocol.h: Add DBUS_TYPE_DICT. * dbus/dbus.h: Add dbus-dict.h * doc/dbus-specification.sgml: Add information about how dicts are marshalled. * test/data/invalid-messages/dict-with-nil-value.message: * test/data/invalid-messages/too-short-dict.message: * test/data/valid-messages/dict-simple.message: * test/data/valid-messages/dict.message: Add sample messages containing dicts. --- dbus/dbus-marshal.h | 76 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 33 deletions(-) (limited to 'dbus/dbus-marshal.h') diff --git a/dbus/dbus-marshal.h b/dbus/dbus-marshal.h index cedca6b8..156ad09f 100644 --- a/dbus/dbus-marshal.h +++ b/dbus/dbus-marshal.h @@ -25,6 +25,7 @@ #define DBUS_MARSHAL_H #include +#include #include #include #include @@ -88,7 +89,8 @@ void _dbus_marshal_set_uint32 (DBusString *str, dbus_bool_t _dbus_marshal_set_string (DBusString *str, int byte_order, int offset, - const DBusString *value); + const DBusString *value, + int len); dbus_bool_t _dbus_marshal_int32 (DBusString *str, @@ -123,48 +125,56 @@ dbus_bool_t _dbus_marshal_string_array (DBusString *str, int byte_order, const char **value, int len); +dbus_bool_t _dbus_marshal_dict (DBusString *str, + int byte_order, + DBusDict *dict); double _dbus_demarshal_double (const DBusString *str, - int byte_order, - int pos, - int *new_pos); + int byte_order, + int pos, + int *new_pos); dbus_int32_t _dbus_demarshal_int32 (const DBusString *str, - int byte_order, - int pos, - int *new_pos); + int byte_order, + int pos, + int *new_pos); dbus_uint32_t _dbus_demarshal_uint32 (const DBusString *str, - int byte_order, - int pos, - int *new_pos); + int byte_order, + int pos, + int *new_pos); char * _dbus_demarshal_string (const DBusString *str, - int byte_order, - int pos, - int *new_pos); + int byte_order, + int pos, + int *new_pos); unsigned char *_dbus_demarshal_byte_array (const DBusString *str, - int byte_order, - int pos, - int *new_pos, - int *array_len); + int byte_order, + int pos, + int *new_pos, + int *array_len); dbus_int32_t * _dbus_demarshal_int32_array (const DBusString *str, - int byte_order, - int pos, - int *new_pos, - int *array_len); + int byte_order, + int pos, + int *new_pos, + int *array_len); dbus_uint32_t *_dbus_demarshal_uint32_array (const DBusString *str, - int byte_order, - int pos, - int *new_pos, - int *array_len); + int byte_order, + int pos, + int *new_pos, + int *array_len); double * _dbus_demarshal_double_array (const DBusString *str, - int byte_order, - int pos, - int *new_pos, - int *array_len); + int byte_order, + int pos, + int *new_pos, + int *array_len); char ** _dbus_demarshal_string_array (const DBusString *str, - int byte_order, - int pos, - int *new_pos, - int *array_len); + int byte_order, + int pos, + int *new_pos, + int *array_len); +DBusDict * _dbus_demarshal_dict (const DBusString *str, + int byte_order, + int pos, + int *new_pos); + dbus_bool_t _dbus_marshal_get_arg_end_pos (const DBusString *str, -- cgit