[patch] initial conversion of glib bindings to use signatures

Havoc Pennington hp at redhat.com
Mon Feb 28 13:47:20 PST 2005


On Mon, 2005-02-28 at 15:21 -0500, Colin Walters wrote:
> >
> > - we don't necessarily have to generate a struct at all, though we can.
> >We can just 
> >   declare that "(ii)" can be stored in anything that is:
> >   struct { dbus_int32_t field1; dbus_int32_t field2; }
> >   so while dbus-binding-tool will probably know how to generate such a
> >struct 
> >   decl, you can also just declare your own struct if not using dbus-
> >binding-tool.
> 
> So we could generate glue like this client-side:
> 
> #ifndef DBUS_DEFINED_STRUCT_ii
> #define DBUS_DEFINED_STRUCT_ii
> typedef struct { dbus_int32_t field1; dbus_int32_t field2; } DBusStructure_ii;
> #endif
> 
> gboolean
> org_freedesktop_NetworkManager_frobnicate (int x, DBusStructure_ii *foo, GError **error)
> {
>   /* invoke dbus method */
> }
> 
> And we'd have similar typedef bits in the server-side glue.
> 
> Is that about right?

Yes. The other thing I'm saying though is that we'd consider it
"supported" to define your own struct with two int32 in it and use that.
i.e. you don't _have_ to use the generated struct if you don't want to.

The point is to avoid structs with weird magic in them, like special
padding or something.

Havoc




More information about the dbus mailing list