[Question]pass structure by reference

Anthony Green green@redhat.com
Fri Feb 4 16:21:00 GMT 2011


ivo f <ivo.fried@gmx.net> writes:

> Hello,
>
> I hope this question isn't too noobish, but I'm kind of stuck with libffi. I
> was trying around passing structures with libffi, which works perfectly
> well, but I couldn't figure out if and especially how I can pass pointers to
> structures. The only way i see to pass a pointer is to use the
> FFI_TYPE_POINTER definition which specifies exactly one argument. The
> structure definition allows me to wrap any number of arguments into a
> structure and pass them as such, but is there a way to combine both? So to
> pass a structure using libffi by reference?

libffi doesn't distinguish between different pointer types, since none
of the supported ABIs require this.  They are all just pointers.

AG


>
> Thanks in advance for your help!



More information about the Libffi-discuss mailing list