Next: The array form, Previous: The pointer form, Up: Basic C Types and Functions [Contents][Index]
function
formIn addition to pointerised data, there is a special type modifier to represent function signatures. Such type-cells are needed to declare function objects.
The syntax for this is the form '(function return-type
arg1-type … argn-type)
, so for example
the FFI-type '(function int int unsigned-int)
would be
rewritten in C as ‘int some_undefined_name(int, unsigned int)’.
The return type and at least one argument type are mandatory! So the syntax for functions without return values, i.e. procedures, is to pass the type ‘void’ as return type. Similarly, pass a ‘void’ as arg1-type for functions without arguments.