Next: Structures, Up: Types [Index]
Libffi
provides a number of built-in type descriptors that can
be used to describe argument and return types:
ffi_type_void
¶The type void
. This cannot be used for argument types, only
for return values.
ffi_type_uint8
¶An unsigned, 8-bit integer type.
ffi_type_sint8
¶A signed, 8-bit integer type.
ffi_type_uint16
¶An unsigned, 16-bit integer type.
ffi_type_sint16
¶A signed, 16-bit integer type.
ffi_type_uint32
¶An unsigned, 32-bit integer type.
ffi_type_sint32
¶A signed, 32-bit integer type.
ffi_type_uint64
¶An unsigned, 64-bit integer type.
ffi_type_sint64
¶A signed, 64-bit integer type.
ffi_type_float
¶The C float
type.
ffi_type_double
¶The C double
type.
ffi_type_uchar
¶The C unsigned char
type.
ffi_type_schar
¶The C signed char
type. (Note that there is not an exact
equivalent to the C char
type in libffi
; ordinarily you
should either use ffi_type_schar
or ffi_type_uchar
depending on whether char
is signed.)
ffi_type_ushort
¶The C unsigned short
type.
ffi_type_sshort
¶The C short
type.
ffi_type_uint
¶The C unsigned int
type.
ffi_type_sint
¶The C int
type.
ffi_type_ulong
¶The C unsigned long
type.
ffi_type_slong
¶The C long
type.
ffi_type_longdouble
¶On platforms that have a C long double
type, this is defined.
On other platforms, it is not.
ffi_type_pointer
¶A generic void *
pointer. You should use this for all
pointers, regardless of their real type.
ffi_type_complex_float
¶The C _Complex float
type.
ffi_type_complex_double
¶The C _Complex double
type.
ffi_type_complex_longdouble
¶The C _Complex long double
type.
On platforms that have a C long double
type, this is defined.
On other platforms, it is not.
Each of these is of type ffi_type
, so you must take the address
when passing to ffi_prep_cif
.
Next: Structures, Up: Types [Index]