|
DETLEF C SDK
Native embedding and package authoring
|
Functions | |
| uint32_t | detlef_abi_version (void) |
| DetlefRuntime * | detlef_runtime_new (void) |
| void | detlef_runtime_free (DetlefRuntime *runtime) |
| void | detlef_text_free (DetlefText text) |
| DetlefStatus | detlef_runtime_access (DetlefRuntime *runtime, DetlefAccessCallback callback, void *user_data) |
| DetlefStatus | detlef_last_error (DetlefRuntime *runtime, DetlefText *error) |
| DetlefStatus | detlef_runtime_load_package (DetlefRuntime *runtime, DetlefSlice archive) |
| DetlefStatus | detlef_native_target (DetlefText *out) |
| uint32_t detlef_abi_version | ( | void | ) |
Read the experimental native ABI version. A matching version must be checked before using a separately compiled package; it is not automatic compatibility negotiation.
| DetlefStatus detlef_last_error | ( | DetlefRuntime * | runtime, |
| DetlefText * | error | ||
| ) |
Copy the last runtime diagnostic without clearing it. Busy and invalid-argument statuses need not set a new diagnostic.
| runtime | Borrowed live runtime. | |
| [out] | error | Receives owned UTF-8 text without a trailing NUL. Must be freed once with detlef_text_free(). Must not already own unreleased text. |
| DetlefStatus detlef_native_target | ( | DetlefText * | out | ) |
Read the native target triple used to select archive artifacts.
| [out] | out | Receives owned UTF-8 target text. Must be freed once with detlef_text_free(). |
| DetlefStatus detlef_runtime_access | ( | DetlefRuntime * | runtime, |
| DetlefAccessCallback | callback, | ||
| void * | user_data | ||
| ) |
Invoke a synchronous setup callback immediately with borrowed context access. The callback is not registered for later execution.
| runtime | Borrowed live runtime, which must not already be executing. |
| callback | Synchronous callback. Access expires on return and must not be saved or freed. |
| user_data | Borrowed callback data, valid through the invocation. Never freed by DETLEF. |
| void detlef_runtime_free | ( | DetlefRuntime * | runtime | ) |
Destroy a runtime, its remaining handles, callbacks, and loaded package state. Must not be called while the runtime or one of its callbacks is active.
| runtime | Owned runtime to destroy. NULL has no effect. The pointer and its handles must not be used afterwards. |
| DetlefStatus detlef_runtime_load_package | ( | DetlefRuntime * | runtime, |
| DetlefSlice | archive | ||
| ) |
Load a trusted native .dtfpkg archive from a UTF-8 filesystem path and initialize its registrations. The library and state remain loaded until runtime destruction, including after partial initialization failure. Loading a duplicate package name fails.
| runtime | Borrowed idle runtime. |
| archive | Borrowed UTF-8 archive path. File access and native code loading occur immediately. |
| DetlefRuntime * detlef_runtime_new | ( | void | ) |
Create a bare runtime without stdlib. It must remain on its creating thread.
| void detlef_text_free | ( | DetlefText | text | ) |
Free one unchanged owned text buffer using the runtime allocator. Copying a DetlefText struct does not create a second owned buffer.
| text | Owned text to free exactly once. Must not be passed to C free() or freed twice. |