From e537e421ff4f092621fcd9f6b51526a017ad020c Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Sun, 16 Mar 2003 13:32:10 +0000 Subject: 2003-03-16 Anders Carlsson * dbus/dbus-connection.c: (dbus_connection_send_with_reply_and_block): Decrease connection->n_incoming when removing an entry from the list. * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array), (dbus_dict_set_uint32_array), (dbus_dict_set_double_array), (dbus_dict_set_byte_array), (dbus_dict_set_string_array), (dbus_dict_get_boolean_array), (dbus_dict_get_double_array), (dbus_dict_get_byte_array): Handle NULL arrays and strings. Also add support for byte arrays. * dbus/dbus-marshal.c: (_dbus_marshal_byte_array), (_dbus_marshal_dict), (_dbus_demarshal_byte_array), (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array), (_dbus_demarshal_double_array), (_dbus_demarshal_string_array), (_dbus_demarshal_dict), (demarshal_and_validate_len), (_dbus_marshal_validate_arg), (_dbus_marshal_test): * dbus/dbus-marshal.h: Add support for marshalling and demarshalling empty arrays and strings. * dbus/dbus-message.c: (dbus_message_append_args_valist), (dbus_message_append_string_array), (dbus_message_iter_get_boolean), (dbus_message_iter_get_boolean_array), (dbus_message_iter_get_int32_array), (dbus_message_iter_get_uint32_array), (dbus_message_iter_get_double_array), (dbus_message_iter_get_byte_array), (dbus_message_iter_get_string_array), (dbus_message_iter_get_dict), (check_message_handling): Add support for getting empty arrays and dicts. * dbus/dbus-string.c: (_dbus_string_validate_utf8): Don't do any validation at all for now, that's better than just checking for ASCII. * test/data/valid-messages/emptiness.message: New test message with lots of empty arrays. --- dbus/dbus-marshal.h | 167 +++++++++++++++++++++++++++------------------------- 1 file changed, 86 insertions(+), 81 deletions(-) (limited to 'dbus/dbus-marshal.h') diff --git a/dbus/dbus-marshal.h b/dbus/dbus-marshal.h index 156ad09f..85549e1d 100644 --- a/dbus/dbus-marshal.h +++ b/dbus/dbus-marshal.h @@ -92,88 +92,93 @@ dbus_bool_t _dbus_marshal_set_string (DBusString *str, const DBusString *value, int len); +dbus_bool_t _dbus_marshal_int32 (DBusString *str, + int byte_order, + dbus_int32_t value); +dbus_bool_t _dbus_marshal_uint32 (DBusString *str, + int byte_order, + dbus_uint32_t value); +dbus_bool_t _dbus_marshal_double (DBusString *str, + int byte_order, + double value); +dbus_bool_t _dbus_marshal_string (DBusString *str, + int byte_order, + const char *value); +dbus_bool_t _dbus_marshal_byte_array (DBusString *str, + int byte_order, + const unsigned char *value, + int len); +dbus_bool_t _dbus_marshal_int32_array (DBusString *str, + int byte_order, + const dbus_int32_t *value, + int len); +dbus_bool_t _dbus_marshal_uint32_array (DBusString *str, + int byte_order, + const dbus_uint32_t *value, + int len); +dbus_bool_t _dbus_marshal_double_array (DBusString *str, + int byte_order, + const double *value, + int len); +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); +dbus_int32_t _dbus_demarshal_int32 (const DBusString *str, + 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); +char * _dbus_demarshal_string (const DBusString *str, + int byte_order, + int pos, + int *new_pos); +dbus_bool_t _dbus_demarshal_byte_array (const DBusString *str, + int byte_order, + int pos, + int *new_pos, + unsigned char **array, + int *array_len); +dbus_bool_t _dbus_demarshal_int32_array (const DBusString *str, + int byte_order, + int pos, + int *new_pos, + dbus_int32_t **array, + int *array_len); +dbus_bool_t _dbus_demarshal_uint32_array (const DBusString *str, + int byte_order, + int pos, + int *new_pos, + dbus_uint32_t **array, + int *array_len); +dbus_bool_t _dbus_demarshal_double_array (const DBusString *str, + int byte_order, + int pos, + int *new_pos, + double **array, + int *array_len); +dbus_bool_t _dbus_demarshal_string_array (const DBusString *str, + int byte_order, + int pos, + int *new_pos, + char ***array, + int *array_len); +dbus_bool_t _dbus_demarshal_dict (const DBusString *str, + int byte_order, + int pos, + int *new_pos, + DBusDict **dict); -dbus_bool_t _dbus_marshal_int32 (DBusString *str, - int byte_order, - dbus_int32_t value); -dbus_bool_t _dbus_marshal_uint32 (DBusString *str, - int byte_order, - dbus_uint32_t value); -dbus_bool_t _dbus_marshal_double (DBusString *str, - int byte_order, - double value); -dbus_bool_t _dbus_marshal_string (DBusString *str, - int byte_order, - const char *value); -dbus_bool_t _dbus_marshal_byte_array (DBusString *str, - int byte_order, - const unsigned char *value, - int len); -dbus_bool_t _dbus_marshal_int32_array (DBusString *str, - int byte_order, - const dbus_int32_t *value, - int len); -dbus_bool_t _dbus_marshal_uint32_array (DBusString *str, - int byte_order, - const dbus_uint32_t *value, - int len); -dbus_bool_t _dbus_marshal_double_array (DBusString *str, - int byte_order, - const double *value, - int len); -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); -dbus_int32_t _dbus_demarshal_int32 (const DBusString *str, - 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); -char * _dbus_demarshal_string (const DBusString *str, - 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); -dbus_int32_t * _dbus_demarshal_int32_array (const DBusString *str, - 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); -double * _dbus_demarshal_double_array (const DBusString *str, - 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); -DBusDict * _dbus_demarshal_dict (const DBusString *str, - int byte_order, - int pos, - int *new_pos); -- cgit