Re: [Vala] Writing bindings as legacy

2014-11-23 Thread Andre Masella
Why not something like this: [CCode (cheader_filename = rados/librados.h, cname = rados_create2)] public static int from_config (out ClusterClient? client, string? cluster_name, string? user_name, Flags flags); Vala will ensure `client` is null before calling this function, if the result is a

[Vala] Writing bindings as legacy

2014-11-22 Thread Gonzalo Aguilar Delgado
Hi, I my case (rados lib) I found non standard anyway and trying hard to figure out how to do the binding. Maybe someone can help. I managed to create some kind of working stuff but I think is not really good with lot's of variable copying in generated code. [ The problem ] Rados want's a

Re: [Vala] Writing Bindings for Legacy C Libraries

2013-09-29 Thread Luca Bruno
Awesome! That was really a missing part of the docs. Thanks for your work, you have written so much and so good. A couple of things: The copy_function shouldn't be of any uses for classes (compact and not), if I'm not wrong. Vala does support multidimensional arrays very well: int[,] foo = new

Re: [Vala] Writing Bindings for Legacy C Libraries

2013-09-29 Thread Andre Masella
On 29 September 2013 01:45, Luca Bruno lethalma...@gmail.com wrote: Awesome! That was really a missing part of the docs. Thanks for your work, you have written so much and so good. Thanks. I'm happy to contribute. A couple of things: The copy_function shouldn't be of any uses for classes

Re: [Vala] Writing Bindings for Legacy C Libraries

2013-09-29 Thread Luca Bruno
Clarified. → Vala does not really do C-style stacked arrays (a.k.a. ragged multi-dimensional arrays), so binding them is nigh impossible without extra C code. Ok, also note a possible syntax is pointers, that in vala should have the same semantics as in C, thus are fine for bindings stacked

Re: [Vala] Writing Bindings for Legacy C Libraries

2013-09-29 Thread Tal Liron
Small comment: Do we really have to call them legacy C libraries? Legacy implies that these are old-style libraries that we eventually want to move away from, but in fact the culture of Vala is happy coexistence with C libraries now and in the future, so it's not a legacy at all. I suggest

[Vala] Writing Bindings for Legacy C Libraries

2013-09-28 Thread Andre Masella
After some discussion with nemequ, I've put together some documentation about writing bindings for non-GLib C code. http://wiki.gnome.org/Vala/LegacyBindings I'm sure there are many other situations that need to be covered, or alternatives to the ones proposed; please expand or let me know and