ApplesauceOS
Read Markdown ↗Download .md

CFunction.invoke

Invoke a function returned by bind or bindAddress.

js
boundFunction(...args)

Arguments

ArgumentTypeMeaning
argsanyExactly the arguments declared in signature.args.

Returns

Scalar/structure/proxy/pointer result, null for void; captureErrno wraps it as {value, errno}.

Example

js
const power = C.bind("pow", {returns: "double", args: ["double", "double"]});
console.log(power(2, 10)); // 1024
power.release();

Notes

Advanced API: the declared types must match the real native function. Wrong signatures/addresses can crash the target. No variadic functions, callbacks or arbitrary custom structures. Calls run on the target main thread. See C functions and memory for types and ownership.

All JavaScript APIs · Automation playbook