Is there any way to use cffi to extract the contents of a capsule and convert it into a voidptr which I can send into C code?
Background info -- numpy arrays can give you a capsule containing a very handy struct, namely the PyArrayInterface. I don't think capsules exist for PyPy yet, so the answer is probably no, but I believe that the future contains capsules for all python versions, so I'm hoping the answer is yes :).
I don't think so. Capsules are a way for some CPython C extension modules to pass around pointers; typically, between two different C extension modules. If you replace one of these modules with a CFFI version, you loose: there is no official way to get the "void *" value from Python, with or without CFFI. It looks like it would be a valid enhancement. Feel free to open a feature request here:
https://bitbucket.org/cffi/cffi/issues?status=new&status=open