From 880f5199aa8b6d6e864d25099e04bad410b76ace Mon Sep 17 00:00:00 2001 From: Aleksandar Kanchev Date: Mon, 9 Jul 2012 18:09:04 +0200 Subject: DBusMessage: add support for custom marshaling Add functions to support querying and manipulating the message body and signature. This is useful for code generators, which can generate custom marshaling functions based on a given IDL. Those functions tend to be optimized and faster than the generic iterator based marshaling. --- dbus/dbus-string.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'dbus/dbus-string.h') diff --git a/dbus/dbus-string.h b/dbus/dbus-string.h index 44860feb..aaee82c2 100644 --- a/dbus/dbus-string.h +++ b/dbus/dbus-string.h @@ -61,6 +61,7 @@ struct DBusString */ #define _dbus_string_get_data(s) ((char*)(((DBusString*)(s))->dummy1)) #define _dbus_string_get_length(s) (((DBusString*)(s))->dummy2) +#define _dbus_string_get_allocated(s) (((DBusString*)(s))->dummy3 - _DBUS_STRING_ALLOCATION_PADDING) #define _dbus_string_set_byte(s, i, b) ((((unsigned char*)(((DBusString*)(s))->dummy1))[(i)]) = (unsigned char) (b)) #define _dbus_string_get_byte(s, i) (((const unsigned char*)(((DBusString*)(s))->dummy1))[(i)]) #define _dbus_string_get_const_data(s) ((const char*)(((DBusString*)(s))->dummy1)) @@ -133,6 +134,9 @@ void _dbus_string_copy_to_buffer_with_nul (const DBusString *str, #ifndef _dbus_string_get_length int _dbus_string_get_length (const DBusString *str); #endif /* !_dbus_string_get_length */ +#ifndef _dbus_string_get_allocated +int _dbus_string_get_allocated (const DBusString *str); +#endif /* !_dbus_string_get_allocated */ dbus_bool_t _dbus_string_lengthen (DBusString *str, int additional_length); -- cgit v1.2.1