The C part of the declarations is prefixed by \c, and the rest
of the line is ordinary C code. You can use as many lines of C
declarations as you like, and they are visible for all further
function declarations.

The Forth part declares each interface word with c-function,
followed by the Forth name of the word, the C name of the called
function, and the stack effect of the word. The stack effect contains
an arbitrary number of types of parameters, then --, and then
exactly one type for the return value. The possible types are:

n

single-cell integer

a

address (single-cell)

d

double-cell integer

r

floating-point value

func

C function pointer

void

no value (used as return type for void functions)

To deal with variadic C functions, you can declare one Forth word for
every pattern you want to use, e.g.:

Note that with C functions declared as variadic (or if you don't
provide a prototype), the C interface has no C type to convert to, so
no automatic conversion happens, which may lead to portability
problems in some cases. In such cases you can perform the conversion
explicitly on the C level, e.g., as follows:

In order to work, this C interface invokes GCC at run-time and uses
dynamic linking. If these features are not available, there are
other, less convenient and less portable C interfaces in lib.fs
and oldlib.fs. These interfaces are mostly undocumented and
mostly incompatible with each other and with the documented C
interface; you can find some examples for the lib.fs interface
in lib.fs.