# ffi(3) - man - phpMan

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

## NAME
     **FFI** — Foreign Function Interface

## LIBRARY
     libffi, -lffi

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

     _ffi_status_
     **ffi**___**prep**___**cif**(_ffi_cif_ _*cif_, _ffi_abi_ _abi_, _unsigned_ _int_ _nargs_, _ffi_type_ _*rtype_,
         _ffi_type_ _**atypes_);

     _void_
     **ffi**___**prep**___**cif**___**var**(_ffi_cif_ _*cif_, _ffi_abi_ _abi_, _unsigned_ _int_ _nfixedargs_, _unsigned_ _int_ _ntotalargs_,
         _ffi_type_ _*rtype_, _ffi_type_ _**atypes_);

     _void_
     **ffi**___**call**(_ffi_cif_ _*cif_, _void_ _(*fn)(void)_, _void_ _*rvalue_, _void_ _**avalue_);

## DESCRIPTION
     The foreign function interface provides a mechanism by which a function can generate a call to
     another function at runtime without requiring knowledge of the called function's interface at
     compile time.

## SEE ALSO
     [ffi_prep_cif(3)](https://www.chedong.com/phpMan.php/man/ffiprepcif/3/markdown), [ffi_prep_cif_var(3)](https://www.chedong.com/phpMan.php/man/ffiprepcifvar/3/markdown), [ffi_call(3)](https://www.chedong.com/phpMan.php/man/fficall/3/markdown)

                               February 15, 2008
