summaryrefslogtreecommitdiff
path: root/dbus/dbus-string.c
diff options
context:
space:
mode:
authorAleksandar Kanchev <kanchev@itestra.com>2012-07-09 18:09:04 +0200
committerJavier Jardón <jjardon@gnome.org>2015-09-08 19:55:15 +0100
commit6b265f7e2ce10e69a07d4a6bc4ec2746fb032135 (patch)
tree4afceb380181d067f32cc48b1dca00c636e7464b /dbus/dbus-string.c
parentd2236978c0f3868a3ace3b575dd0631f91c4e064 (diff)
downloaddbus-baserock/v1.10.0+custom_marshaling.tar.gz
DBusMessage: add support for custom marshalingbaserock/v1.10.0+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.
Diffstat (limited to 'dbus/dbus-string.c')
-rw-r--r--dbus/dbus-string.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/dbus/dbus-string.c b/dbus/dbus-string.c
index 98d9f2b7..565fa26e 100644
--- a/dbus/dbus-string.c
+++ b/dbus/dbus-string.c
@@ -744,6 +744,22 @@ _dbus_string_get_length (const DBusString *str)
}
#endif /* !_dbus_string_get_length */
+/* Only have the function if we don't have the macro */
+#ifndef _dbus_string_get_allocated
+/**
+ * Gets the allocated length of a string (not including nul termination).
+ *
+ * @returns the allocated length.
+ */
+int
+_dbus_string_get_allocated(const DBusString *str)
+{
+ DBUS_CONST_STRING_PREAMBLE (str);
+
+ return real->allocated;
+}
+#endif /* !_dbus_string_get_allocated */
+
/**
* Makes a string longer by the given number of bytes. Checks whether
* adding additional_length to the current length would overflow an