Next: , Previous: , Up: Basic C Types and Functions   [Contents][Index]


65.1.3 The function form

In 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-typeargn-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.