CFunction wraps a raw C function pointer as a callable TypeScript function.
Example
Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
def.args | string[] | C function argument type codes. Supports FFIType.callback (auto-extracts .ptr from JSCallback) |
def.returns | string | C function return type code |
def.ptr | number | Raw function pointer address |
Callback Type Arguments
When an argument type isFFIType.callback ('k'), the JSCallback instance is automatically unwrapped to its .ptr:
Obtaining Pointers
Useffi.getSymbolPtr(handle, name):