FUNCTION-ALIAS:
Factor handbook > C library interface > Calling C from Factor

Prev:FUNCTION:
Next:alien-invoke ( args... return library function parameters varargs? -- return... )


Vocabulary
alien.syntax

Syntax
FUNCTION-ALIAS: factor-name return c_name ( parameters ) ;


Inputs and outputs
factor-namea Factor word name
returna C return type
namea C function name
parametersa comma-separated sequence of type/name pairs; type1 arg1, type2 arg2, ...


Word description
Defines a new word factor-name which calls the C library function named c_name in the logical library given by the most recent LIBRARY: declaration.

The new word must be compiled before being executed.

Notes
Note that the parentheses and commas are only syntax sugar and can be omitted. They serve no purpose other than to make the declaration easier to read.

See also
FUNCTION:

Definition