What does not work? Cython or the C compiler?
I really do not like these generic "ctypedef void* FOO". I would do this:
cdef extern from "header.h":
cdef struct struct_FOO "FOO":
pass
ctypedef struct_FOO* FOO
Now, you said the C example does "something like":
static FOO s_foo=NULL;
Are you sure it does that? In such case, it should work. If not,
please provide us more info about the Cython or C compiler failure...
On Mon, Apr 27, 2009 at 10:41 AM, Mohamed Lrhazi <[email protected]> wrote:
> On Mon, Apr 27, 2009 at 7:11 AM, Dag Sverre Seljebotn
> <[email protected]> wrote:
>> How about
>> cdef extern ...:
>> ctypedef void* FOO
>
> That makes more sense to me, since I dont know what the struct FOO is,
> anyways.
>
> Now, this lib requires me to create one such FOO, and initialize it to
> NULL, then pass a pointer to it around.
> The C example does something like this:
>
> static FOO s_foo=NULL;
>
> then:
>
> lib_func(&foo)
>
> How would I do this in Cython?
>
> cdef FOO s_foo=NULL
>
> Does not work.
> Thanks a lot,
> Mohamed.
> _______________________________________________
> Cython-dev mailing list
> [email protected]
> http://codespeak.net/mailman/listinfo/cython-dev
>
--
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev