DETLEF C SDK
Native embedding and package authoring
Loading...
Searching...
No Matches
Package Types

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 }
 

Detailed Description

Macro Definition Documentation

◆ DETLEF_SDK_COUNT

#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.

Parameters
itemsArray whose element count is required.
Returns
Number of elements in the array.

Definition at line 168 of file detlef_sdk.h.

Typedef Documentation

◆ DetlefSdkCall

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.

◆ 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.

◆ DetlefSdkCallback

typedef DetlefSdkStatus(* DetlefSdkCallback) (DetlefSdkCall *call, DetlefSdkValue *result)

A shared native/Wasm package callback.

Parameters
callBorrowed callback access. Must not be saved or freed.
[out]resultReceives the result handle, or zero for no result. Returning a retained value does not consume its retained copy.
Returns
DETLEF_SDK_OK on success, or a failing status from an SDK operation.

Definition at line 207 of file detlef_sdk.h.

◆ DetlefSdkField

A named parameter or record field with a borrowed type specification. Function parameters support recursive types; record fields currently require named types.

◆ 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.

◆ DetlefSdkRecord

One record definition. Records are registered in table order before callables; referenced record types must already exist. Fields use named types.

◆ DetlefSdkValue

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.

Enumeration Type Documentation

◆ 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.

◆ DetlefSdkCallableKind

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.

◆ 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.

◆ 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.