From 61411a061c09def43687153e6c734ff27b7fd556 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 11 May 2005 18:07:22 +0000 Subject: 2005-05-11 Colin Walters * dbus/dbus-signature.c (dbus_signature_iter_get_signature): New function, returns signature string for signature iter. * dbus/dbus-signature.h: Prototype it. * dbus/dbus-message.c (dbus_message_iter_get_signature): New function, returns signature string for message iter. (dbus_message_iter_get_array_len): New function, returns length of array. (dbus_message_iter_get_fixed_array): Fix assertion; this function should be used when the iter is pointing to the contents of an array * dbus/dbus-message.h: Prototypes. * dbus/dbus-marshal-recursive.c (_dbus_type_reader_get_array_length): New function; returns length of an array. * dbus/dbus-marshal-recursive.h: Prototype it. --- dbus/dbus-marshal-recursive.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'dbus/dbus-marshal-recursive.c') diff --git a/dbus/dbus-marshal-recursive.c b/dbus/dbus-marshal-recursive.c index 6fcbd623..1427a803 100644 --- a/dbus/dbus-marshal-recursive.c +++ b/dbus/dbus-marshal-recursive.c @@ -985,6 +985,21 @@ _dbus_type_reader_read_basic (const DBusTypeReader *reader, #endif } +/** + * Returns the number of values remaining in the current array reader. + * + * @param reader the reader to read from + * @returns the number of elements remaining in the array + */ +int +_dbus_type_reader_get_array_length (const DBusTypeReader *reader) +{ + _dbus_assert (!reader->klass->types_only); + _dbus_assert (reader->klass == &array_reader_class); + + return array_reader_get_array_len (reader); +} + /** * Reads a block of fixed-length basic values, from the current point * in an array to the end of the array. Does not work for arrays of -- cgit