ctypes accessing functions with double pointers

Eleftherios Garyfallidis garyfallidis at gmail.com
Tue Nov 8 08:21:29 EST 2011


Thank you Chris :-)

On Mon, Nov 7, 2011 at 11:29 PM, Chris Rebert <clp2 at rebertia.com> wrote:

> On Mon, Nov 7, 2011 at 2:06 PM, Eleftherios Garyfallidis
> <garyfallidis at gmail.com> wrote:
> > Hello,
> >
> > Is it possible using ctypes to call C functions from a shared object
> > containing double pointers e.g. int foo(float **i) and if yes how?
>
> (Untested conjecture:)
>
> import ctypes
> # ...create ctypes_wrapped_foo...
> the_float = ctypes.c_float(42.1)
> float_ptr = ctypes.byref(the_float)
> i = ctypes.byref(float_ptr)
> result_integer = ctypes_wrapped_foo(i)
>
> Cheers,
> Chris
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20111108/a2b059f7/attachment-0001.html>


More information about the Python-list mailing list