summaryrefslogtreecommitdiff
path: root/dbus/dbus-string.c
diff options
context:
space:
mode:
authorAleksandar Kanchev <kanchev@itestra.com>2012-07-09 18:09:04 +0200
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2014-12-02 11:13:24 +0000
commit880f5199aa8b6d6e864d25099e04bad410b76ace (patch)
treed4d966fe390a4f3bc74dd1b645540a4c4fca5608 /dbus/dbus-string.c
parent1e7653d74914eb0111bd39c39f422a25bae3eda9 (diff)
downloaddbus-880f5199aa8b6d6e864d25099e04bad410b76ace.tar.gz
DBusMessage: add support for custom marshalingbaserock/genivi/dbus-1.9.4
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 15cff9c6..25b1d003 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