Re: [Vala] GLib.List


2011/5/17 Jan Spurný <JSpurny seznam cz>:

I'm writing a new library in vala, and that library uses our old library which is written in c. Until now I 
was able to write VAPI files for everything in the old library, but now I stumbled on a big problem - some 
functions in the old library returns GLib.List with some dynamicaly allocated structs ("Compact class in 
vala terminology) as data members. Something like this:


But now I'm trying to use the result of "old_lib_make_x_list" in vala and there it all fails.

The VAPI file looks something like this:

Now I have probably two, equaly wrong possibilities. Either let vala manage things (it can't of course..):

Another possibility is to let vala actually manage things ;-)

Did you have any problem with the following? it should be the first
thing you try (and is likely the correct thing):

[CCode (cheader_filename = "oldlib.h")]
public static GLib.List<X> old_lib_make_x_list();


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