Re: Introspecting functions taking variable arguments



On Sun, Feb 5, 2012 at 20:05, Daniel Trebbien <dtrebbien gmail com> wrote:
> On <http://live.gnome.org/PyGObject/IntrospectionPorting#Non-introspectable_functions.2BAC8-methods>,
> there is the following note:
>
>> Varargs cannot be handled safely by libgirepository. In these cases there are
>> often alternatives available (such as gtk_cell_area_cell_set_property()). For
>> other cases libraries now often have a ..._v() counterpart which takes a list
>> instead of variable arguments.
>
> What are some good examples of ..._v() counterparts? I thought that
> all I needed to do was use a va_list, but that doesn't work.
>
> What are good ways of making variadic functions introspectable?

We could do some tricks with libffi, similar to what Python's ctypes
do, the problem is that PyGObject is still using the "toy"
g_*_info_invoke API in g-i instead of using libffi directly.

Maybe the g-i maintainers will accept adding variadic support to g-i,
maybe they will tell us that it's time to stop using that API and do
our own libffi stuff.

Regards,

Tomeu


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]