[patch] updated glib work snapshot

Colin Walters walters at verbum.org
Wed May 4 12:10:36 PDT 2005


On Wed, 2005-05-04 at 14:56 -0400, Havoc Pennington wrote:
> On Wed, 2005-05-04 at 14:02 -0400, Colin Walters wrote:
> > 
> > But that doesn't work in general for recursive types; e.g. "aas".  
> > 
> 
> For string arrays the most natural binding is probably
> null-terminated...

True.

> For int arrays something like:
> 
>  struct { int *values, int len } 

Yes...that's what DBusGArray is, essentially.

> Blah. Recursive types are just nasty. 

Several times I've been tempted to just punt and special-case mappings
for stuff like "as" (char **) and "a{s?}" (GHashTable), and just make
the rest some DBusGValue type you have to iterate over and free with
e.g. dbus_gvalue_free.  But if we can make things fairly clean for the
common cases (and I don't think GArray is that bad), then it seems worth
it to make things work in general.

> btw, I don't think the
> cut-and-paste of ghash/garray is going to work... it's too fragile. 

The cut n' paste is fragile, I agree.  But my hope is we'd get support
for it in glib.

> So
> maybe we have to suck it up and have destructors or something.

You mean like e.g. having an opaque DBusGValue type for the complex
cases which you have to free using dbus_g_value_free?

> It might be useful to sit down with Owen and Matthias and get some
> insights from them.

Yeah, agreed.
-------------- 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/20050504/efdba94a/attachment.pgp


More information about the dbus mailing list