UCE Docs / unit_load

Signature

SharedUnit* unit_load(String file_name)

Parameters

file_name : unit source path
return value : native SharedUnit pointer (native runtime internals only)

native-only internal API. unit_load() returns a process-local SharedUnit*, which is not a valid value across the wasm membrane and is not exposed to wasm units.

Use unit-facing APIs such as unit_info(), unit_compile(), unit_call(), unit_render(), or component helpers instead.

Example

// unit_load() is a native/internal loader; from a unit, use unit_compile()
// to make sure a unit is built, then unit_call()/unit_render() to invoke it.
print(unit_compile("examples/sample_unit.uce") ? "sample unit is loaded and ready" : "load failed", "\n");
Output
sample unit is loaded and ready