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_voidThe type void. This cannot be used for argument types, only
for return values.
ffi_type_uint8An unsigned, 8-bit integer type.
ffi_type_sint8A signed, 8-bit integer type.
ffi_type_uint16An unsigned, 16-bit integer type.
ffi_type_sint16A signed, 16-bit integer type.
ffi_type_uint32An unsigned, 32-bit integer type.
ffi_type_sint32A signed, 32-bit integer type.
ffi_type_uint64An unsigned, 64-bit integer type.
ffi_type_sint64A signed, 64-bit integer type.
ffi_type_floatThe C float type.
ffi_type_doubleThe C double type.
ffi_type_ucharThe C unsigned char type.
ffi_type_scharThe 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_ushortThe C unsigned short type.
ffi_type_sshortThe C short type.
ffi_type_uintThe C unsigned int type.
ffi_type_sintThe C int type.
ffi_type_ulongThe C unsigned long type.
ffi_type_slongThe C long type.
ffi_type_longdoubleOn platforms that have a C long double type, this is defined.
On other platforms, it is not.
ffi_type_pointerA generic void * pointer. You should use this for all
pointers, regardless of their real type.
ffi_type_complex_floatThe C _Complex float type.
ffi_type_complex_doubleThe C _Complex double type.
ffi_type_complex_longdoubleThe 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]