alien-indirect ( args... funcptr return parameters abi -- return... )
Factor handbook » C library interface » Calling C from Factor

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


Vocabulary
alien

Inputs
args...zero or more objects passed to the C function
funcptra C function pointer
returna C return type
parametersa sequence of C parameter types
abione of cdecl or stdcall


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


Word description
Invokes a C function pointer passed on the data stack. Input parameters are taken from the data stack following the function pointer, 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-indirect is not compiled.

See also
alien-invoke, alien-assembly, alien-callback

Definition

: alien-indirect
( args... funcptr return parameters abi -- return... )
\ alien-indirect callsite-not-compiled ;