alien-invoke ( args... return library function parameters varargs? -- return... )
Factor handbook » C library interface » Calling C from Factor

Prev:FUNCTION-ALIAS:
Next:alien-indirect ( args... funcptr return parameters abi -- return... )


Vocabulary
alien

Inputs
args...zero or more objects passed to the C function
returna C return type
librarya logical library name
functiona C function name
parametersa sequence of C parameter types
varargs?a boolean


Outputs
return...the return value of the function, if not void


Word description
Calls a C library function with the given name. Input parameters are taken from the data stack, and the return value is pushed on the data stack after the function returns. A return type of void indicates that no value is to be expected.

Notes
C type names are documented in C type specifiers.

Errors
Throws an callsite-not-compiled if the word calling alien-invoke was not compiled with the optimizing compiler.

See also
alien-indirect, alien-assembly, alien-callback

Definition

: alien-invoke
( args... return library function parameters varargs? -- return... )
\ alien-invoke callsite-not-compiled ;