cdef extern ...

   ctypedef union Foo_Inner: # fake name !
        int Bar

   struct Foo:
      int step
      Foo_Inner data

Perhaps it works, never tried ... :-)

On Thu, May 21, 2009 at 7:09 PM, Chris Colbert <[email protected]> wrote:
> Hi,
>
> I'm trying to write a wrapper for a C library.
>
> The C header from which I am making declaration has this:
>
>
> struct Foo
> {
>      int blah;
>
>      union
>      {
>           int Bar;
>      } data;
> }
>
>
>
> can this be wrapped in Cython?
>
> I've tried:
>
>
> cdef extern from "c.h":
>
>     ctypedef struct Foo:
>
>             int step
>
>         union data:
>             int Bar
>
>
>
> but that doesnt compile.
>
> Chris
>
>
>
>
>
>
> _______________________________________________
> 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