annotate libffi/man/ffi_prep_cif.3 @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 .Dd February 15, 2008
kono
parents:
diff changeset
2 .Dt ffi_prep_cif 3
kono
parents:
diff changeset
3 .Sh NAME
kono
parents:
diff changeset
4 .Nm ffi_prep_cif
kono
parents:
diff changeset
5 .Nd Prepare a
kono
parents:
diff changeset
6 .Nm ffi_cif
kono
parents:
diff changeset
7 structure for use with
kono
parents:
diff changeset
8 .Nm ffi_call
kono
parents:
diff changeset
9 .
kono
parents:
diff changeset
10 .Sh SYNOPSIS
kono
parents:
diff changeset
11 .In ffi.h
kono
parents:
diff changeset
12 .Ft ffi_status
kono
parents:
diff changeset
13 .Fo ffi_prep_cif
kono
parents:
diff changeset
14 .Fa "ffi_cif *cif"
kono
parents:
diff changeset
15 .Fa "ffi_abi abi"
kono
parents:
diff changeset
16 .Fa "unsigned int nargs"
kono
parents:
diff changeset
17 .Fa "ffi_type *rtype"
kono
parents:
diff changeset
18 .Fa "ffi_type **atypes"
kono
parents:
diff changeset
19 .Fc
kono
parents:
diff changeset
20 .Sh DESCRIPTION
kono
parents:
diff changeset
21 The
kono
parents:
diff changeset
22 .Nm ffi_prep_cif
kono
parents:
diff changeset
23 function prepares a
kono
parents:
diff changeset
24 .Nm ffi_cif
kono
parents:
diff changeset
25 structure for use with
kono
parents:
diff changeset
26 .Nm ffi_call
kono
parents:
diff changeset
27 .
kono
parents:
diff changeset
28 .Fa abi
kono
parents:
diff changeset
29 specifies a set of calling conventions to use.
kono
parents:
diff changeset
30 .Fa atypes
kono
parents:
diff changeset
31 is an array of
kono
parents:
diff changeset
32 .Fa nargs
kono
parents:
diff changeset
33 pointers to
kono
parents:
diff changeset
34 .Nm ffi_type
kono
parents:
diff changeset
35 structs that describe the data type, size and alignment of each argument.
kono
parents:
diff changeset
36 .Fa rtype
kono
parents:
diff changeset
37 points to an
kono
parents:
diff changeset
38 .Nm ffi_type
kono
parents:
diff changeset
39 that describes the data type, size and alignment of the
kono
parents:
diff changeset
40 return value. Note that to call a variadic function
kono
parents:
diff changeset
41 .Nm ffi_prep_cif_var
kono
parents:
diff changeset
42 must be used instead.
kono
parents:
diff changeset
43 .Sh RETURN VALUES
kono
parents:
diff changeset
44 Upon successful completion,
kono
parents:
diff changeset
45 .Nm ffi_prep_cif
kono
parents:
diff changeset
46 returns
kono
parents:
diff changeset
47 .Nm FFI_OK .
kono
parents:
diff changeset
48 It will return
kono
parents:
diff changeset
49 .Nm FFI_BAD_TYPEDEF
kono
parents:
diff changeset
50 if
kono
parents:
diff changeset
51 .Fa cif
kono
parents:
diff changeset
52 is
kono
parents:
diff changeset
53 .Nm NULL
kono
parents:
diff changeset
54 or
kono
parents:
diff changeset
55 .Fa atypes
kono
parents:
diff changeset
56 or
kono
parents:
diff changeset
57 .Fa rtype
kono
parents:
diff changeset
58 is malformed. If
kono
parents:
diff changeset
59 .Fa abi
kono
parents:
diff changeset
60 does not refer to a valid ABI,
kono
parents:
diff changeset
61 .Nm FFI_BAD_ABI
kono
parents:
diff changeset
62 will be returned. Available ABIs are
kono
parents:
diff changeset
63 defined in
kono
parents:
diff changeset
64 .Nm <ffitarget.h> .
kono
parents:
diff changeset
65 .Sh SEE ALSO
kono
parents:
diff changeset
66 .Xr ffi 3 ,
kono
parents:
diff changeset
67 .Xr ffi_call 3 ,
kono
parents:
diff changeset
68 .Xr ffi_prep_cif_var 3