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

Functions

static DetlefSdkStatus detlef_sdk_array (DetlefSdkCall *call, const DetlefSdkType *type, const DetlefSdkValue *items, size_t count, DetlefSdkValue *out)
 
static DetlefSdkStatus detlef_sdk_record (DetlefSdkCall *call, const char *name, const DetlefSdkValue *fields, size_t count, DetlefSdkValue *out)
 
static DetlefSdkStatus detlef_sdk_array_length (DetlefSdkCall *call, DetlefSdkValue value, size_t *out)
 
static DetlefSdkStatus detlef_sdk_array_get (DetlefSdkCall *call, DetlefSdkValue value, size_t index, DetlefSdkValue *out)
 
static DetlefSdkStatus detlef_sdk_array_set (DetlefSdkCall *call, DetlefSdkValue value, size_t index, DetlefSdkValue item)
 
static DetlefSdkStatus detlef_sdk_record_get (DetlefSdkCall *call, DetlefSdkValue value, const char *field, DetlefSdkValue *out)
 
static DetlefSdkStatus detlef_sdk_record_set (DetlefSdkCall *call, DetlefSdkValue value, const char *field, DetlefSdkValue item)
 

Detailed Description

Function Documentation

◆ detlef_sdk_array()

static DetlefSdkStatus detlef_sdk_array ( DetlefSdkCall *  call,
const DetlefSdkType *  type,
const DetlefSdkValue *  items,
size_t  count,
DetlefSdkValue *  out 
)
inlinestatic

Create an array by copying values and checking the declared element type. Input handles are not consumed.

Parameters
callBorrowed callback access. Must not be saved or freed.
typeBorrowed element type specification, not the enclosing array type.
itemsBorrowed element handles; NULL when count is zero.
countNumber of elements.
[out]outReceives a callback-local handle, released automatically at callback exit. Must be retained before being saved beyond the callback.
Returns
DETLEF_SDK_OK on success; a native failure returns a status and a Wasm host failure aborts the callback with an exception.

◆ detlef_sdk_array_get()

static DetlefSdkStatus detlef_sdk_array_get ( DetlefSdkCall *  call,
DetlefSdkValue  value,
size_t  index,
DetlefSdkValue *  out 
)
inlinestatic

Read one array element. The array itself is not consumed.

Parameters
callBorrowed callback access. Must not be saved or freed.
valueBorrowed array value handle. Not consumed.
indexZero-based element index.
[out]outReceives a callback-local handle, released automatically at callback exit. Must be retained before being saved beyond the callback.
Returns
DETLEF_SDK_OK on success; a native failure returns a status and a Wasm host failure aborts the callback with an exception.

◆ detlef_sdk_array_length()

static DetlefSdkStatus detlef_sdk_array_length ( DetlefSdkCall *  call,
DetlefSdkValue  value,
size_t *  out 
)
inlinestatic

Read the number of elements in an array.

Parameters
callBorrowed callback access. Must not be saved or freed.
valueBorrowed array value handle. Not consumed.
[out]outReceives the element count. No cleanup is required.
Returns
DETLEF_SDK_OK on success; a native failure returns a status and a Wasm host failure aborts the callback with an exception.

◆ detlef_sdk_array_set()

static DetlefSdkStatus detlef_sdk_array_set ( DetlefSdkCall *  call,
DetlefSdkValue  value,
size_t  index,
DetlefSdkValue  item 
)
inlinestatic

Replace an array element after checking its declared type. Neither input handle is consumed.

Parameters
callBorrowed callback access. Must not be saved or freed.
valueBorrowed array handle.
indexZero-based element index.
itemBorrowed replacement value.
Returns
DETLEF_SDK_OK on success; a native failure returns a status and a Wasm host failure aborts the callback with an exception.

◆ detlef_sdk_record()

static DetlefSdkStatus detlef_sdk_record ( DetlefSdkCall *  call,
const char *  name,
const DetlefSdkValue *  fields,
size_t  count,
DetlefSdkValue *  out 
)
inlinestatic

Create an instance of an already defined record. Input handles are borrowed and not consumed.

Parameters
callBorrowed callback access. Must not be saved or freed.
nameBorrowed NUL-terminated record type name.
fieldsBorrowed field values in declaration order.
countNumber of field values.
[out]outReceives a callback-local handle, released automatically at callback exit. Must be retained before being saved beyond the callback.
Returns
DETLEF_SDK_OK on success; a native failure returns a status and a Wasm host failure aborts the callback with an exception.

◆ detlef_sdk_record_get()

static DetlefSdkStatus detlef_sdk_record_get ( DetlefSdkCall *  call,
DetlefSdkValue  value,
const char *  field,
DetlefSdkValue *  out 
)
inlinestatic

Read one named field from a record.

Parameters
callBorrowed callback access. Must not be saved or freed.
valueBorrowed record handle.
fieldBorrowed NUL-terminated field name.
[out]outReceives a callback-local handle, released automatically at callback exit. Must be retained before being saved beyond the callback.
Returns
DETLEF_SDK_OK on success; a native failure returns a status and a Wasm host failure aborts the callback with an exception.

◆ detlef_sdk_record_set()

static DetlefSdkStatus detlef_sdk_record_set ( DetlefSdkCall *  call,
DetlefSdkValue  value,
const char *  field,
DetlefSdkValue  item 
)
inlinestatic

Replace a record field after checking its declared type. Neither input handle is consumed.

Parameters
callBorrowed callback access. Must not be saved or freed.
valueBorrowed record handle.
fieldBorrowed NUL-terminated field name.
itemBorrowed replacement value.
Returns
DETLEF_SDK_OK on success; a native failure returns a status and a Wasm host failure aborts the callback with an exception.