ApplesauceOS
Read Markdown ↗Download .md

C.call

Bind through the cache and invoke immediately.

js
client.call(symbol, signature, ...args)

Arguments

ArgumentTypeMeaning
symbolstringExported symbol.
signatureobjectRequired returns and args (array of fixed type names). Optional library (absolute executable path), ownership (borrowed/retained for object results), captureErrno (boolean).
argsanyArguments matching signature.args.

Returns

Converted native result; with captureErrno:true, {value, errno}.

Example

js
console.log(C.call("strlen", {returns: "size_t", args: ["cstring"]}, "Hello"));

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