Re: [Vala] function pointers?

I should probably have checked the test first :/

anyway, HashFunc and EqualFunc in glib-2.0.vapi is declared as empty
structs and not as callbacks as expected(?). in an earlier mail from
Jürg he said the glib vapi was handwritten so I'm attaching a patch to
change this.

On 3/28/07, Mathias Hasselmann <mathias hasselmann gmx de> wrote:
"grep call callback" revealed the following test-cases demonstrating
function pointer usage:


Am Dienstag, den 27.03.2007, 19:25 +0200 schrieb David Keijser:
> Hi.
> is it possible to use function pointers in vala at the moment. if so
> could you provide a small sample on how to use them?
> the reason i need them is because I'm writing a simple hash set and i
> thought it would be a good idea to use GHashFunc from the hash table
> in GLib.
> btw, while playing around trying to include C code in the vala source
> i found a way to break out of a comment. e.g
> //*/ hash = ((GHashFunc)self->priv->_hashMethod)(o);/*
> results in
> /**/ hash = ((GHashFunc)self->priv->_hashMethod)(o);/**/
> _______________________________________________
> Vala mailing list
> Vala paldo org

Attachment: glib-2.0.vala.diff
Description: Text Data

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