[Pyrex] Idea for imporving "C name specifications"

Greg Ewing greg at cosc.canterbury.ac.nz
Tue Apr 29 07:58:39 CEST 2003


"Edward C. Jones" <edcjones at erols.com>:

> cdef extern from "astruct.h":
>      ctypedef struct c_ABC "ABC":
>          int abc
>          int* xyz
> 
> cdef extern from "astruct.h":
>      ctypedef struct c_DEF "DEF":
>          c_ABC* abcp
> 
> Note the "c_ABC" in the last line. When I wrap "DEF", I need to know 
> that "ABC" is wrapped in the same Pyrex file. This can be done by 
> processing the header file twice.

I haven't had much experience using this feature yet, so
it's possible that its design is not optimal. I'm open
to suggestions.

> It would be nicer if I could do something like:
> 
> use c_ABC for ABC:
>      cdef extern from "astruct.h":
>          ctypedef struct c_ABC:
>              int abc
>              int* xyz
> 
> use c_DEF for DEF:
>      cdef extern from "astruct.h":
>          ctypedef struct c_DEF:
>              ABC* abcp

I'm not sure of the semantics you intend here. Presumably
you're trying to decouple the renaming from the declarations,
but I don't quite see how it works in this example.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+




More information about the Pyrex mailing list