Re: [pypy-dev] Pypy friendly to get pointer enclosed in python object ?

2019-03-17 Thread Stuart Axon via pypy-dev
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  
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++  ___
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev


[pypy-dev] Pypy friendly to get pointer enclosed in python object ?

2019-03-16 Thread Stuart Axon via pypy-dev
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++___
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev