Re: return pointer to a struct

Greg Ewing <[email protected]> Fri, 29 May 2009 12:44:34 +1200
Newsgroups gmane.comp.python.pyrex
Message-ID <[email protected]>
horace wrote:

> i have a c library with a function which returns a pointer to a struct. 
> this struct should be exposed to python. it should be possible to modify 
> the variables of this struct from python and the c library should see 
> those changes.

Create an extension type that wraps your C pointer, and
give it appropriate methods or properties for accessing
the fields.

-- 
Greg