|
DETLEF C SDK
Native embedding and package authoring
|
Data Structures | |
| struct | DetlefText |
| struct | DetlefSlice |
| struct | DetlefNamed |
| struct | DetlefSpan |
Typedefs | |
| typedef struct DetlefRuntime | DetlefRuntime |
| typedef struct DetlefAccess | DetlefAccess |
| typedef struct DetlefFunctionAccess | DetlefFunctionAccess |
| typedef struct DetlefText | DetlefText |
| typedef struct DetlefSlice | DetlefSlice |
| typedef uint64_t | DetlefHandle |
| typedef struct DetlefNamed | DetlefNamed |
| typedef struct DetlefSpan | DetlefSpan |
| typedef DetlefStatus(* | DetlefAccessCallback) (void *user_data, DetlefAccess *access) |
| typedef DetlefStatus(* | DetlefCallback) (void *user_data, DetlefAccess *access, DetlefHandle *result) |
| typedef DetlefStatus(* | DetlefFunctionCallback) (void *user_data, DetlefFunctionAccess *access, DetlefHandle *result) |
| typedef void(* | DetlefOutput) (void *user_data, const uint8_t *text, size_t len) |
| typedef DetlefStatus(* | DetlefLineInput) (void *user_data, DetlefSlice *line, DetlefBool *present) |
| typedef struct DetlefAccess DetlefAccess |
| typedef DetlefStatus(* DetlefAccessCallback) (void *user_data, DetlefAccess *access) |
| typedef DetlefStatus(* DetlefCallback) (void *user_data, DetlefAccess *access, DetlefHandle *result) |
Controls receive expressions and full context access. A handle written to *result must not be released by the callback: DETLEF consumes it on return, even on failure. Clone to keep the original handle. Do not free access, result, or user_data; user_data stays with its supplier. Zero returns no value.
| typedef struct DetlefFunctionAccess DetlefFunctionAccess |
| typedef DetlefStatus(* DetlefFunctionCallback) (void *user_data, DetlefFunctionAccess *access, DetlefHandle *result) |
Functions receive evaluated arguments and limited value/object access. A handle written to *result must not be released by the callback; DETLEF consumes it on return, even on failure. Clone to keep the original handle. Do not free access or result. DETLEF never frees user_data. Zero means no value.
| typedef uint64_t DetlefHandle |
Returned handles must be released once with detlef_handle_release() (detlef_function_handle_release() in Functions), unless transferred as a callback result. Never use C free(). Input handles remain the caller's. Copying an ID creates no new handle; cloning creates a separate release duty. Zero means no result or an omitted argument, not the language value none.
| typedef DetlefStatus(* DetlefLineInput) (void *user_data, DetlefSlice *line, DetlefBool *present) |
| typedef struct DetlefNamed DetlefNamed |
A borrowed name paired with a handle. Direct registration uses resolved type handles; package signatures use TypeRefs. Storage and handles are not consumed.
| typedef void(* DetlefOutput) (void *user_data, const uint8_t *text, size_t len) |
| typedef struct DetlefRuntime DetlefRuntime |
Must be destroyed with detlef_runtime_free(), never C free(). Use only on its creating thread.
| typedef struct DetlefSlice DetlefSlice |
Borrowed UTF-8 bytes. DETLEF never frees this storage. It must remain valid through the consuming operation; input callback storage must remain valid until copied immediately after callback return.
| typedef struct DetlefSpan DetlefSpan |
A half-open source range in UTF-8 byte offsets, not Unicode characters or JavaScript UTF-16 offsets.
| typedef struct DetlefText DetlefText |
Owned UTF-8 bytes without a trailing NUL. Must be freed once with detlef_text_free(), never C free(). Copying the struct does not duplicate ownership.
| enum DetlefBool |
Boolean values and flags, stored as uint32_t at the ABI boundary. Boolean constructors and line-input callbacks require zero or one. The require_value and has_span input flags also accept any nonzero value as true. API outputs are always zero or one.
| Enumerator | |
|---|---|
| DETLEF_FALSE | False or absent. |
| DETLEF_TRUE | True or present. |
| enum DetlefDescriptorKind |
Named descriptors accepted by detlef_descriptor_create(). Stored as uint32_t; values also identify the corresponding handle kinds.
| enum DetlefExpressionKind |
Expression node categories. Stored as uint32_t.
| enum DetlefHandleKind |
Handle categories returned by detlef_handle_kind() and detlef_function_handle_kind(). Stored as uint32_t at the ABI boundary.
| enum DetlefPackageSection |
Package sections selected by package inspection operations. Stored as uint32_t.
| enum DetlefStatus |
Operation status codes, stored as int32_t at the ABI boundary.
| enum DetlefTypeKind |
Resolved type categories. Stored as uint32_t.
| enum DetlefTypeRefKind |