summaryrefslogtreecommitdiff
path: root/man
diff options
context:
space:
mode:
authorAnthony Green <green@moxielogic.com>2011-11-12 17:18:51 -0500
committerAnthony Green <green@moxielogic.com>2011-11-12 17:18:51 -0500
commitff9454da44859716a5bd4eaa344499288c79694f (patch)
treed5ad99ea8bc87ff986f91db1401383d89aa49cc8 /man
parentea14ae85e8f54ff046b7fb8a9cfe349475272044 (diff)
downloadlibffi-ff9454da44859716a5bd4eaa344499288c79694f.tar.gz
Add David Gilbert's variadic function call support
Diffstat (limited to 'man')
-rw-r--r--man/Makefile.am4
-rw-r--r--man/ffi.310
-rw-r--r--man/ffi_prep_cif.38
-rw-r--r--man/ffi_prep_cif_var.373
4 files changed, 91 insertions, 4 deletions
diff --git a/man/Makefile.am b/man/Makefile.am
index 2519277..afcbfb6 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -2,7 +2,7 @@
AUTOMAKE_OPTIONS=foreign
-EXTRA_DIST = ffi.3 ffi_call.3 ffi_prep_cif.3
+EXTRA_DIST = ffi.3 ffi_call.3 ffi_prep_cif.3 ffi_prep_cif_var.3
-man_MANS = ffi.3 ffi_call.3 ffi_prep_cif.3
+man_MANS = ffi.3 ffi_call.3 ffi_prep_cif.3 ffi_prep_cif_var.3
diff --git a/man/ffi.3 b/man/ffi.3
index 18b5d5d..1f1d303 100644
--- a/man/ffi.3
+++ b/man/ffi.3
@@ -16,6 +16,15 @@ libffi, -lffi
.Fa "ffi_type **atypes"
.Fc
.Ft void
+.Fo ffi_prep_cif_var
+.Fa "ffi_cif *cif"
+.Fa "ffi_abi abi"
+.Fa "unsigned int nfixedargs"
+.Fa "unsigned int ntotalargs"
+.Fa "ffi_type *rtype"
+.Fa "ffi_type **atypes"
+.Fc
+.Ft void
.Fo ffi_call
.Fa "ffi_cif *cif"
.Fa "void (*fn)(void)"
@@ -28,4 +37,5 @@ generate a call to another function at runtime without requiring knowledge of
the called function's interface at compile time.
.Sh SEE ALSO
.Xr ffi_prep_cif 3 ,
+.Xr ffi_prep_cif_var 3 ,
.Xr ffi_call 3
diff --git a/man/ffi_prep_cif.3 b/man/ffi_prep_cif.3
index 9436b31..e1bdbd7 100644
--- a/man/ffi_prep_cif.3
+++ b/man/ffi_prep_cif.3
@@ -37,7 +37,9 @@ structs that describe the data type, size and alignment of each argument.
points to an
.Nm ffi_type
that describes the data type, size and alignment of the
-return value.
+return value. Note that to call a variadic function
+.Nm ffi_prep_cif_var
+must be used instead.
.Sh RETURN VALUES
Upon successful completion,
.Nm ffi_prep_cif
@@ -63,4 +65,6 @@ defined in
.
.Sh SEE ALSO
.Xr ffi 3 ,
-.Xr ffi_call 3
+.Xr ffi_call 3 ,
+.Xr ffi_prep_cif_var 3
+
diff --git a/man/ffi_prep_cif_var.3 b/man/ffi_prep_cif_var.3
new file mode 100644
index 0000000..7e19d0b
--- /dev/null
+++ b/man/ffi_prep_cif_var.3
@@ -0,0 +1,73 @@
+.Dd January 25, 2011
+.Dt ffi_prep_cif_var 3
+.Sh NAME
+.Nm ffi_prep_cif_var
+.Nd Prepare a
+.Nm ffi_cif
+structure for use with
+.Nm ffi_call
+for variadic functions.
+.Sh SYNOPSIS
+.In ffi.h
+.Ft ffi_status
+.Fo ffi_prep_cif_var
+.Fa "ffi_cif *cif"
+.Fa "ffi_abi abi"
+.Fa "unsigned int nfixedargs"
+.Fa "unsigned int ntotalargs"
+.Fa "ffi_type *rtype"
+.Fa "ffi_type **atypes"
+.Fc
+.Sh DESCRIPTION
+The
+.Nm ffi_prep_cif_var
+function prepares a
+.Nm ffi_cif
+structure for use with
+.Nm ffi_call
+for variadic functions.
+.Fa abi
+specifies a set of calling conventions to use.
+.Fa atypes
+is an array of
+.Fa ntotalargs
+pointers to
+.Nm ffi_type
+structs that describe the data type, size and alignment of each argument.
+.Fa rtype
+points to an
+.Nm ffi_type
+that describes the data type, size and alignment of the
+return value.
+.Fa nfixedargs
+must contain the number of fixed (non-variadic) arguments.
+Note that to call a non-variadic function
+.Nm ffi_prep_cif
+must be used.
+.Sh RETURN VALUES
+Upon successful completion,
+.Nm ffi_prep_cif_var
+returns
+.Nm FFI_OK .
+It will return
+.Nm FFI_BAD_TYPEDEF
+if
+.Fa cif
+is
+.Nm NULL
+or
+.Fa atypes
+or
+.Fa rtype
+is malformed. If
+.Fa abi
+does not refer to a valid ABI,
+.Nm FFI_BAD_ABI
+will be returned. Available ABIs are
+defined in
+.Nm <ffitarget.h>
+.
+.Sh SEE ALSO
+.Xr ffi 3 ,
+.Xr ffi_call 3 ,
+.Xr ffi_prep_cif 3