|
DETLEF C SDK
Native embedding and package authoring
|
Functions | |
| DetlefStatus | detlef_array_create (DetlefAccess *a, DetlefHandle type_handle, const DetlefHandle *items, size_t count, DetlefHandle *out) |
| DetlefStatus | detlef_array_length (DetlefAccess *a, DetlefHandle handle, size_t *out) |
| DetlefStatus | detlef_array_get (DetlefAccess *a, DetlefHandle handle, size_t index, DetlefHandle *out) |
| DetlefStatus | detlef_array_set (DetlefAccess *a, DetlefHandle handle, size_t index, DetlefHandle new_value) |
| DetlefStatus | detlef_array_push (DetlefAccess *a, DetlefHandle handle, DetlefHandle new_value) |
| DetlefStatus | detlef_array_remove (DetlefAccess *a, DetlefHandle handle, size_t index, DetlefHandle *out) |
| DetlefStatus | detlef_record_create (DetlefAccess *a, DetlefHandle type_handle, const DetlefHandle *items, size_t count, DetlefHandle *out) |
| DetlefStatus | detlef_record_get (DetlefAccess *a, DetlefHandle handle, DetlefSlice input, DetlefHandle *out) |
| DetlefStatus | detlef_record_set (DetlefAccess *a, DetlefHandle handle, DetlefSlice input, DetlefHandle new_value) |
| DetlefStatus detlef_array_create | ( | DetlefAccess * | a, |
| DetlefHandle | type_handle, | ||
| const DetlefHandle * | items, | ||
| size_t | count, | ||
| DetlefHandle * | out | ||
| ) |
Create an array using a resolved array type and borrowed element handles. Input values are copied and their types are checked.
| a | Borrowed callback access. Must not be freed, saved, or used outside its current callback. | |
| type_handle | Borrowed resolved array type descriptor from detlef_type_array(), not its element type. Not consumed. | |
| items | Borrowed array of runtime value handles in element order. Values are copied into the array; handles are not consumed. | |
| count | Number of entries in the supplied array. | |
| [out] | out | On success, receives an owned array value handle. Release with detlef_handle_release() unless transferred as a callback result. |
| DetlefStatus detlef_array_get | ( | DetlefAccess * | a, |
| DetlefHandle | handle, | ||
| size_t | index, | ||
| DetlefHandle * | out | ||
| ) |
Read one array element by zero-based index. The returned handle must be released separately from the array handle.
| a | Borrowed callback access. Must not be freed, saved, or used outside its current callback. | |
| handle | Borrowed array value handle. Not consumed. | |
| index | Zero-based element index. | |
| [out] | out | On success, receives an owned value handle for the selected array element. Release with detlef_handle_release() unless transferred as a callback result. |
| DetlefStatus detlef_array_length | ( | DetlefAccess * | a, |
| DetlefHandle | handle, | ||
| size_t * | out | ||
| ) |
Read the number of elements in an array object.
| a | Borrowed callback access. Must not be freed, saved, or used outside its current callback. | |
| handle | Borrowed array value handle. Not consumed. | |
| [out] | out | Receives the number of elements in the array. |
| DetlefStatus detlef_array_push | ( | DetlefAccess * | a, |
| DetlefHandle | handle, | ||
| DetlefHandle | new_value | ||
| ) |
Append a value to an array after checking its element type. The input handle is not consumed.
| a | Borrowed callback access. Must not be freed, saved, or used outside its current callback. |
| handle | Borrowed array value handle. Not consumed. |
| new_value | Borrowed value handle to append; its type must match the array's element type. Not consumed. |
| DetlefStatus detlef_array_remove | ( | DetlefAccess * | a, |
| DetlefHandle | handle, | ||
| size_t | index, | ||
| DetlefHandle * | out | ||
| ) |
Remove and return an array element by zero-based index. The array is mutated and the removed value receives a new owned handle.
| a | Borrowed callback access. Must not be freed, saved, or used outside its current callback. | |
| handle | Borrowed array value handle. Not consumed. | |
| index | Zero-based element index. | |
| [out] | out | On success, receives an owned value handle for the removed array element. Release with detlef_handle_release() unless transferred as a callback result. |
| DetlefStatus detlef_array_set | ( | DetlefAccess * | a, |
| DetlefHandle | handle, | ||
| size_t | index, | ||
| DetlefHandle | new_value | ||
| ) |
Replace one array element. The array element type is checked; the supplied value handle is not consumed.
| a | Borrowed callback access. Must not be freed, saved, or used outside its current callback. |
| handle | Borrowed array value handle. Not consumed. |
| index | Zero-based element index. |
| new_value | Borrowed replacement value handle; its type must match the array's element type. Not consumed. |
| DetlefStatus detlef_record_create | ( | DetlefAccess * | a, |
| DetlefHandle | type_handle, | ||
| const DetlefHandle * | items, | ||
| size_t | count, | ||
| DetlefHandle * | out | ||
| ) |
Create a record instance using a resolved record type and field values in declaration order. Inputs are copied and type-checked.
| a | Borrowed callback access. Must not be freed, saved, or used outside its current callback. | |
| type_handle | Borrowed defined record type descriptor. Not consumed. | |
| items | Borrowed array of runtime value handles in field declaration order. Values are copied into the record; handles are not consumed. | |
| count | Number of entries in the supplied array. | |
| [out] | out | On success, receives an owned record value handle. Release with detlef_handle_release() unless transferred as a callback result. |
| DetlefStatus detlef_record_get | ( | DetlefAccess * | a, |
| DetlefHandle | handle, | ||
| DetlefSlice | input, | ||
| DetlefHandle * | out | ||
| ) |
Read a named field from a record instance. The input record handle is not consumed.
| a | Borrowed callback access. Must not be freed, saved, or used outside its current callback. | |
| handle | Borrowed record value handle. Not consumed. | |
| input | Borrowed UTF-8 name, without a trailing NUL requirement. Storage may be released after the call. | |
| [out] | out | On success, receives an owned value handle for the selected record field. Release with detlef_handle_release() unless transferred as a callback result. |
| DetlefStatus detlef_record_set | ( | DetlefAccess * | a, |
| DetlefHandle | handle, | ||
| DetlefSlice | input, | ||
| DetlefHandle | new_value | ||
| ) |
Replace a named record field after checking its declared type. Neither input handle is consumed.
| a | Borrowed callback access. Must not be freed, saved, or used outside its current callback. |
| handle | Borrowed record value handle. Not consumed. |
| input | Borrowed UTF-8 name, without a trailing NUL requirement. Storage may be released after the call. |
| new_value | Borrowed replacement value handle; its type must match the named field's type. Not consumed. |