Re: [Vala] array of function pointer





2008/8/14 picca <picca synchrotron-soleil fr>
Hello

I am playing with the Gsl.vapi file.

Great!! I think i was the only one..


here the definition of a delegate type in this vapi file (no CCode for now)

static delegate int MultirootF (Vector x, void* params, Vector f);
 
PS: The real c type of the MultiRootF is
int (*f)(gsl_vector const *x, void* params, gsl_vector *f);

In the binding I have to create a delegate because is the only way that vala point to a function.
MultirootF was the only name that occurred me to use. The importat think is the parameters (Vector, void*, Vector ) and the returned type (int)...


In one of my classes I want an array of this MultirootF

struct my_func {
       MultirootF[] fs;
}

For now the c code generated is as simple as
MultiRootF *f;
but the gsl headers do not define this MultirootF type.

I Think vala do not handle array of delegate, see http://bugzilla.gnome.org/show_bug.cgi?id=521688
 

So how can I tweak the vapi with CCode to obtain the right result.


I Think in the near future a static delegate will desappear, see http://bugzilla.gnome.org/show_bug.cgi?id=526549
I still don't know how will be implemented the static delegates, but i will change the gsl vapi file with the proper code...
 

Thanks
 
You are welcome, any opinion is welcome
 

Frederic.


Matias

PS: you are f7 in the irc?


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