Realised I should ask this on the CFFI list, apologies for the noise.
On Saturday, March 16, 2019, 3:05:03 PM GMT, Stuart Axon <stuaxo2@yahoo.com> wrote:


PyCairo has a struct like

`
    typedef struct {
   PyObject_HEAD
     cairo_t *ctx;
    PyObject *base; /* base object used to create context, or NULL */
    } PycairoContext;

`

And a #define that you can use to get pointer to ctx:

`
    #define PycairoContext_GET(obj) (((PycairoContext *)(obj))->ctx)
`

How can I get hold of the pointer *ctx in Pypy ?


I had a bit of a look at CFFI, but couldn't find anything using structures with PyObject_HEAD in them.



S++