From 1f23ea99b37bfc8197f1c6a376f9afe08037f0f6 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Tue, 7 Jan 2003 22:22:39 +0000 Subject: 2003-01-08 Anders Carlsson reviewed by: * dbus/dbus-internals.c: (_dbus_type_to_string): New function that returns a string describing a type. * dbus/dbus-internals.h: * dbus/dbus-message.c: (dbus_message_append_fields), (dbus_message_append_fields_valist), (dbus_message_get_fields), (dbus_message_get_fields_valist), (_dbus_message_test): * dbus/dbus-message.h: Add new convenience functions for appending and getting message fields. Also add a test for those. --- dbus/dbus-internals.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'dbus/dbus-internals.c') diff --git a/dbus/dbus-internals.c b/dbus/dbus-internals.c index f3527eb2..e24eb56b 100644 --- a/dbus/dbus-internals.c +++ b/dbus/dbus-internals.c @@ -21,6 +21,7 @@ * */ #include "dbus-internals.h" +#include "dbus-protocol.h" #include #include #include @@ -337,4 +338,28 @@ _dbus_set_fd_nonblocking (int fd, return TRUE; } +/** + * Returns a string describing the given type. + * + * @param type the type to describe + * @returns a constant string describing the type + */ +const char * +_dbus_type_to_string (int type) +{ + switch (type) + { + case DBUS_TYPE_INT32: + return "int32"; + case DBUS_TYPE_UINT32: + return "uint32"; + case DBUS_TYPE_DOUBLE: + return "double"; + case DBUS_TYPE_STRING: + return "string"; + default: + return "unknown"; + } +} + /** @} */ -- cgit