[DBUS]Append byte as array
Colin Walters
walters at verbum.org
Fri May 13 13:47:02 PDT 2005
On Fri, 2005-05-13 at 17:37 -0300, Claudio Takahasi wrote:
> Hi folks,
>
> the function dbus_message_iter_append_byte_array is not available in
> DBUS version
> 0.33. What is the function that replace it?
>
> I am not sure, but I think that dbus_message_iter_append_fixed_array can be used
> for replace it.
That's correct, however the function is broken in 0.33; it is fixed in
CVS HEAD.
> Can anyone send me a code sample of how append and get a byte array?
There's one in the patch to the GLib bindings I sent to the list
Wednesday. Here's the code snippet:
if (!dbus_message_iter_open_container (iter,
DBUS_TYPE_ARRAY,
subsignature_str,
&subiter))
goto out;
/* TODO - This assumes that basic values are the same size
* is this always true? If it is we can probably avoid
* a lot of the overhead in _marshal_basic_instance...
*/
if (!dbus_message_iter_append_fixed_array (&subiter,
subsignature_str[0],
&(array->data),
array->len))
goto out;
if (!dbus_message_iter_close_container (iter, &subiter))
goto out;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/dbus/attachments/20050513/cb458232/attachment.pgp
More information about the dbus
mailing list