-
Notifications
You must be signed in to change notification settings - Fork 0
Wi API Reference
cyxigo edited this page Jul 17, 2026
·
3 revisions
If you're using Wi API to create a library, your library must have a wi_foreign_init function marked as WI_FOREIGN_INIT with wi_foreign_fn_t signature.
Wi's number type
Opaque Wi object handle
The result of running Wi code
-
WI_RUN_OK: No errors occurred -
WI_RUN_ERROR: A runtime error or a compile error occurred -
WI_RUN_ABORT: Execution was aborted early viawi_state_abort
Opaque Wi state handle
Foreign (C) function pointer, called from Wi scripts
Userdata finalizer - function called when the state is deleted (freed)
Define the standard library in a state
Parameters:
-
state: Wi state instance
Define a foreign (C) function in the state
Parameters:
-
state: Wi state instance -
name: Function name -
fn: Pointer to the C function implementation -
arity: Function's arity (number of arguments it expects), use-1for variable arguments
Define the standard library in a state
Parameters:
-
state: Wi state instance
Define the standard library in a state
Parameters:
-
state: Wi state instance
Define the standard library in a state
Parameters:
-
state: Wi state instance