|
DETLEF C SDK
Native embedding and package authoring
|
Data Structures | |
| struct | DetlefSdkType |
| struct | DetlefSdkField |
| struct | DetlefSdkCallable |
| struct | DetlefSdkRecord |
| struct | DetlefSdkPackage |
Macros | |
| #define | DETLEF_SDK_COUNT(items) (sizeof(items) / sizeof((items)[0])) |
Typedefs | |
| typedef uint64_t | DetlefSdkValue |
| typedef struct DetlefSdkCall | DetlefSdkCall |
| typedef struct DetlefSdkField | DetlefSdkField |
| typedef DetlefSdkStatus(* | DetlefSdkCallback) (DetlefSdkCall *call, DetlefSdkValue *result) |
| typedef struct DetlefSdkCallable | DetlefSdkCallable |
| typedef struct DetlefSdkRecord | DetlefSdkRecord |
| typedef struct DetlefSdkPackage | DetlefSdkPackage |
Enumerations | |
| enum | DetlefSdkStatus { DETLEF_SDK_OK = 0 , DETLEF_SDK_ERROR = 1 } |
| enum | DetlefSdkTypeKind { DETLEF_SDK_NAMED , DETLEF_SDK_ARRAY , DETLEF_SDK_OPTIONAL } |
| enum | DetlefSdkCallableKind { DETLEF_SDK_FUNCTION , DETLEF_SDK_CONTROL } |
| enum | DetlefSdkBool { DETLEF_SDK_FALSE = 0 , DETLEF_SDK_TRUE = 1 } |
| #define DETLEF_SDK_COUNT | ( | items | ) | (sizeof(items) / sizeof((items)[0])) |
Count the elements of a C array.
The argument must be an array, not a pointer to its first element.
| items | Array whose element count is required. |
Definition at line 168 of file detlef_sdk.h.
| typedef struct DetlefSdkCall DetlefSdkCall |
Borrowed callback access supplied by the SDK. Must not be constructed, saved, or freed. It expires when the callback returns.
Definition at line 36 of file detlef_sdk.h.
| typedef struct DetlefSdkCallable DetlefSdkCallable |
One callable registration shared by native and Wasm builds. The definition and its referenced data must remain valid until runtime destruction. Functions declare typed parameters; Controls must leave parameters and variadic empty.
| typedef DetlefSdkStatus(* DetlefSdkCallback) (DetlefSdkCall *call, DetlefSdkValue *result) |
A shared native/Wasm package callback.
| call | Borrowed callback access. Must not be saved or freed. | |
| [out] | result | Receives the result handle, or zero for no result. Returning a retained value does not consume its retained copy. |
Definition at line 207 of file detlef_sdk.h.
| typedef struct DetlefSdkField DetlefSdkField |
A named parameter or record field with a borrowed type specification. Function parameters support recursive types; record fields currently require named types.
| typedef struct DetlefSdkPackage DetlefSdkPackage |
Static package definitions consumed by DETLEF_SDK_PACKAGE(). Tables, strings, type specifications, callbacks, and data are borrowed and must remain valid until runtime destruction. The SDK does not free author-supplied data.
| typedef struct DetlefSdkRecord DetlefSdkRecord |
One record definition. Records are registered in table order before callables; referenced record types must already exist. Fields use named types.
| typedef uint64_t DetlefSdkValue |
An opaque value handle belonging to one runtime.
Callback-local handles are released automatically at callback exit. A copy of the numeric ID does not retain the value. An explicitly retained handle must be released with detlef_sdk_release(), or is released during runtime destruction.
Definition at line 29 of file detlef_sdk.h.
| enum DetlefSdkBool |
Boolean values, stored as uint32_t. Use DETLEF_SDK_FALSE or DETLEF_SDK_TRUE for inputs. Outputs are always zero or one.
| Enumerator | |
|---|---|
| DETLEF_SDK_FALSE | False. |
| DETLEF_SDK_TRUE | True. |
Definition at line 103 of file detlef_sdk.h.
Shared callable evaluation modes, stored as uint32_t.
| Enumerator | |
|---|---|
| DETLEF_SDK_FUNCTION | Eager callable with limited value/object access. |
| DETLEF_SDK_CONTROL | Lazy callable with explicit expression evaluation. |
Definition at line 85 of file detlef_sdk.h.
| enum DetlefSdkStatus |
Status returned by SDK operations and callbacks.
DETLEF_SDK_OK indicates success. Native failures return a nonzero status. Wasm host failures throw into JavaScript and abort the callback immediately. Stored as int32_t.
| Enumerator | |
|---|---|
| DETLEF_SDK_OK | Successful SDK operation. |
| DETLEF_SDK_ERROR | Failure status; Wasm host failures can throw instead. |
Definition at line 48 of file detlef_sdk.h.
| enum DetlefSdkTypeKind |
Shared package type specification categories, stored as uint32_t.
| Enumerator | |
|---|---|
| DETLEF_SDK_NAMED | Named type supplied through DetlefSdkType::name. |
| DETLEF_SDK_ARRAY | Array whose element type is supplied through DetlefSdkType::inner. |
| DETLEF_SDK_OPTIONAL | Optional type whose non-none type is supplied through DetlefSdkType::inner. |
Definition at line 65 of file detlef_sdk.h.