I need to dynamically invoke a function in C with the function name and the arguments (and their types) only known during runtime.
For that, I use libffi
(Foreign Function Interface library). I need to specify that the argument is double *
(pointer to double
value). However, I do not understand how to do this, as there is only ffi_type_double
and ffi_type_pointer
.
How to make a composite type?
UPDATE: As answered by @user20716902 in the comment below, the FFI docs state "You should use this [ffi_type_pointer
] for all pointers, regardless of their real type".