returning a struct with dbus-glib bindings?

Nick Welch nick at incise.org
Thu Dec 4 13:29:21 PST 2008


On Thu, Dec 4, 2008 at 12:35 PM, Colin Walters <walters at verbum.org> wrote:
> On Wed, Dec 3, 2008 at 2:49 AM, Nick Welch <nick at incise.org> wrote:
> > i.e. a struct of two 16 byte ints.  First of all, outside of <typedef short
> > gshort>, glib seems to completely ignore the existence of 16 byte integers.
> > There is no G_TYPE_SHORT (or G_TYPE_INT16), for example.
>
> Right; unfortunately from looking at the code I think the answer right
> now is that you can't send (u)int16 with dbus-glib.
>
> Practically speaking, I think using int32 is easier all around and it seems
> rather unlikely to me that using int16 vs int32 would show up in any
> noticeable way in performance profiles.

Totally agree with you there.  The return values of the methods this applies to
are small either way and aren't generally going to be called in quick
succession or anything like that.  I think the people that drew up the spec
were just trying to be minimalist.  Which I'm usually all for... except right
now.

> Still though it is something we should allow; I guess we'd have to register
> custom gtypes for them since their inclusion in glib has been shot down.

I'm still somewhat new with both glib and dbus, can you possibly give me any
hints as to how I could somehow implement this?  Would it be doable in my own
code or would I have to hack dbus-glib?


More information about the dbus mailing list