[Cython] typedef struct FOO *FOO

Stefan Behnel stefan_ml at behnel.de
Mon Apr 27 16:34:33 CEST 2009


Mohamed Lrhazi wrote:
> On Mon, Apr 27, 2009 at 10:17 AM, Mohamed Lrhazi <lrhazi at gmail.com> wrote:
>> cdef extern from "mylib.h":
>>  cdef struct struct_FOO "FOO":
>>    pass
>>  ctypedef struct_FOO* FOO
>>  int mylib_func(FOO* c)
>>
>> cdef FOO s_foo
>> s_foo=NULL
>> mylib_func(&s_foo)
>>
>
> Also, cdef static FOO s_foo
> gives me: Syntax error in C variable declaration

That's because everything that you do not declare "public" is static by
default, so there is no special "static" modifier.

Stefan



More information about the Cython-dev mailing list