1.Dd February 15, 2008 2.Dt ffi_prep_cif 3 3.Sh NAME 4.Nm ffi_prep_cif 5.Nd Prepare a 6.Nm ffi_cif 7structure for use with 8.Nm ffi_call 9. 10.Sh SYNOPSIS 11.In ffi.h 12.Ft ffi_status 13.Fo ffi_prep_cif 14.Fa "ffi_cif *cif" 15.Fa "ffi_abi abi" 16.Fa "unsigned int nargs" 17.Fa "ffi_type *rtype" 18.Fa "ffi_type **atypes" 19.Fc 20.Sh DESCRIPTION 21The 22.Nm ffi_prep_cif 23function prepares a 24.Nm ffi_cif 25structure for use with 26.Nm ffi_call 27. 28.Fa abi 29specifies a set of calling conventions to use. 30.Fa atypes 31is an array of 32.Fa nargs 33pointers to 34.Nm ffi_type 35structs that describe the data type, size and alignment of each argument. 36.Fa rtype 37points to an 38.Nm ffi_type 39that describes the data type, size and alignment of the 40return value. 41.Sh RETURN VALUES 42Upon successful completion, 43.Nm ffi_prep_cif 44returns 45.Nm FFI_OK . 46It will return 47.Nm FFI_BAD_TYPEDEF 48if 49.Fa cif 50is 51.Nm NULL 52or 53.Fa atypes 54or 55.Fa rtype 56is malformed. If 57.Fa abi 58does not refer to a valid ABI, 59.Nm FFI_BAD_ABI 60will be returned. Available ABIs are 61defined in 62.Nm <ffitarget.h> 63. 64.Sh SEE ALSO 65.Xr ffi 3 , 66.Xr ffi_call 3 67