Function libffi::low::prep_cif_var
[−]
[src]
pub unsafe fn prep_cif_var(
cif: *mut ffi_cif,
abi: ffi_abi,
nfixedargs: usize,
ntotalargs: usize,
rtype: *mut ffi_type,
atypes: *mut *mut ffi_type
) -> Result<()>
Initalizes a CIF (Call Interface) for a varargs function.
We need to initialize a CIF before we can use it to call a function
or create a closure. This function lets us specify the calling
convention to use and the argument and result types. For non-varargs
CIF initialization, see prep_cif.
Safety
The CIF cif retains references to rtype and atypes, so if
they are no longer live when the CIF is used then the behavior is
undefined.
Arguments
cif— the CIF to initializeabi— the calling convention to usenfixedargs— the number of fixed argumentsntotalargs— the total number of arguments, including fixed and var argsrtype— the result typeatypes— the argument types (length must be at leastnargs)
Result
Ok(()) for success or Err(e) for failure.