dbus glib structure

Rob Taylor robtaylor at floopily.org
Thu Aug 24 10:27:58 PDT 2006


keith preston wrote:
>>
>> I'd recommended looking at gabble_media_channel_list_streams in
>>
>> http://projects.collabora.co.uk/trac/telepathy/browser/src/gabble-media-channel.c
>>
>> for an example of how to do this.
>>
>>
>>
> 
> Ok so from what I understand now.   The process is to:
> 
> Make a new GValue.
> Initialize it to a special boxed type that we get through
> dbus_g_type_get_struct(...)
> Insert values into the special boxed type gvalue  using
> dbus_g_type_struct_set
> 
> At this point we have the special structure which DBUS sees as a struct.
> If I want an array of them I just add them to a GPtrArray
> 
> This seems like a lot of work, maybe I could just go with my quick fix and
> break it into array of the pieces.  Is there any better or quicker way to
> facilitate transporting a C struct across DBUS (preferable with GLIB
> bindings)?
> 

That's all planned, but its a lot less trivial than you'd expect.. ;)
I'd recommend doing what makes sense for the stability of your dbus
service's API.

Thanks,
Rob Taylor


More information about the dbus mailing list