# phpman > man > ffi_prep_cif(3)

[ffi_prep_cif(3)](https://www.chedong.com/phpMan.php/man/ffiprepcif/3/markdown)          BSD Library Functions Manual          [ffi_prep_cif(3)](https://www.chedong.com/phpMan.php/man/ffiprepcif/3/markdown)

## 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 vari‐
     adic 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
