[Pyrex] Private C fields for public extension types?

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Jul 3 01:23:59 UTC 2006


Stefan Behnel wrote:

> So I would like to have a way to, say, replace some of the extension type
> pointers (__pyx_obj_...) by void pointers to avoid having to make them
> publicly available. Or is there any other way to make the header file
> compilable without adding all type dependencies?

The right way to do this would be to provide opaque
declarations for the types pointed to, e.g. if there
is a field declared as

   foo *p;

then you need a declaration something like

   typedef struct _foo foo;

Pyrex should probably do this itself when generating
.h files for public classes, but in the meantime you
could manually put them in a .h file of your own.

--
Greg



More information about the Pyrex mailing list