# ffi_prep_cif - Prepare a ffi_cif structure for use with ffi_call - man(3) - [phpMan]


## NAME
       ffi_prep_cif — Prepare a ffi_cif structure for use with ffi_call

## SYNOPSIS
### #include <ffi.h>

       _ffi_status_
       **ffi_prep_cif**(_ffi_cif_ _*cif_,       _ffi_abi_ _abi_,       _unsigned_ _int_ _nargs_,      _ffi_type_ _*rtype_,
           _ffi_type_ _**atypes_);

## DESCRIPTION
       The **ffi_prep_cif **function prepares a **ffi_cif **structure for use with **ffi_call _**abi_ specifies  a
       set  of calling conventions to use.  _atypes_ is an array of _nargs_ pointers to **ffi_type **structs
       that describe the data type, size and  alignment  of  each  argument.   _rtype_  points  to  an
       **ffi_type  **that  describes the data type, size and alignment of the return value. Note that to
       call a variadic function **ffi_prep_cif_var **must be used instead.

## RETURN VALUES
       Upon successful completion, **ffi_prep_cif **returns **FFI_OK**.  It will return  **FFI_BAD_TYPEDEF  **if
       _cif_  is  **NULL  **or  _atypes_  or  _rtype_  is  malformed.  If  _abi_  does not refer to a valid ABI,
       **FFI_BAD_ABI **will be returned. Available ABIs are defined in **<ffitarget.h>**.

## SEE ALSO
       [_ffi_(3)](https://www.chedong.com/phpMan.php/man/ffi/3/markdown), [_ffi_call_(3)](https://www.chedong.com/phpMan.php/man/fficall/3/markdown), [_ffi_prep_cif_var_(3)](https://www.chedong.com/phpMan.php/man/ffiprepcifvar/3/markdown)

                                          February 15, 2008                          [_ffi_prep_cif_(3)](https://www.chedong.com/phpMan.php/man/ffiprepcif/3/markdown)
