Re: GObject Introspection: array type too unspecific?



On 07/07/2011 01:07 AM, Florian Müllner wrote:
2011/7/6 Michael Kappert
    g_type_info_get_array_type returns a GIArrayType which only
    distinguishes "C", ptr, byte and nested arrays. This does not seem
    to be enough to generate wrappers automatically. The exact array
    element type needs to be known.  (Or doesn't it? I'm using CLISP's
    FFI that does the wrapping for me, I'm not too familiar with C.)

I think you are misunderstanding GIArrayType.
To determine the actual element type, you can use something along the
lines of

GITypeInfo *element_info = g_type_info_get_param_type (type_info, 0);
GITypeTag element_type = g_type_info_get_tag (element_info);

Thanks!
I didn't think of parameterized types and so I couldn't make any sense of g_info_type_get_param_type(info, n) ...

But now I wonder, how do you determine the number of parameters?


Michael



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