Hi, David. Did you tried latest release,
http://cython.org/Cython-0.10.2.tar.gz ? It contains fixes for
recursive typedef struct. Please, give a try a let us know of any
problem.


On Mon, Dec 1, 2008 at 4:27 AM, David Cournapeau <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am using cython to wrap some fairly large C API, with a big numbers
> of enumerations. Those API are big enough so that I got tired of
> manually declaring the definitions (in particular enum), and start
> working on a code generator based on gccxml. It almost works for some
> non trivial headers (CoreAudio framework, Alsa headers), but I have a
> problem with the following kind of C declaration:
>
> typedef struct foo foo_t;
>
> struct foo {
>    foo_t *foo;
> }
>
> AFAIK, cython does support typedefing a struct directly, and you
> should use something like that instead:
>
> cdef struct foo:
>    foo_t *foo
> ctypdef foo foo_t
>
> Which does not work as the recursive reference uses the typedef'd type
> name. The following works, though:
>
> cdef struct foo:
>    foo *foo
> ctypdef foo foo_t
>
> For now, I can get away by modifying on the fly the gccxml parsed tree
> when I detect a recursive reference, but this feels hackish. Is there
> a better way ?
>
> David
> _______________________________________________
> 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

Reply via email to