|
DETLEF C SDK
Native embedding and package authoring
|
Functions | |
| DetlefStatus | detlef_with_protected_values (DetlefAccess *a, const DetlefHandle *handles, size_t count, DetlefAccessCallback callback, void *data) |
| DetlefStatus | detlef_variable_declare (DetlefAccess *a, DetlefSlice input, DetlefHandle type_handle, DetlefHandle initial) |
| DetlefStatus | detlef_variable_set (DetlefAccess *a, DetlefSlice input, DetlefHandle handle) |
| DetlefStatus | detlef_variable_unset (DetlefAccess *a, DetlefSlice input) |
| DetlefStatus | detlef_variable_get (DetlefAccess *a, DetlefSlice input, DetlefHandle *out) |
| DetlefStatus detlef_variable_declare | ( | DetlefAccess * | a, |
| DetlefSlice | input, | ||
| DetlefHandle | type_handle, | ||
| DetlefHandle | initial | ||
| ) |
Declare a mutable variable with a resolved type. A zero initial handle leaves the variable uninitialized.
| a | Borrowed callback access. Must not be freed, saved, or used outside its current callback. |
| input | Borrowed UTF-8 name, without a trailing NUL requirement. Storage may be released after the call. |
| type_handle | Borrowed resolved type descriptor for the variable's declared type. Not consumed. |
| initial | Borrowed initial value handle, or zero to leave the variable uninitialized. |
| DetlefStatus detlef_variable_get | ( | DetlefAccess * | a, |
| DetlefSlice | input, | ||
| DetlefHandle * | out | ||
| ) |
Read the current value of a mutable variable. Unknown and uninitialized variables fail.
| a | Borrowed callback access. Must not be freed, saved, or used outside its current callback. | |
| input | Borrowed UTF-8 name, without a trailing NUL requirement. Storage may be released after the call. | |
| [out] | out | On success, receives an owned runtime value handle for the variable's current value. Release with detlef_handle_release() unless transferred as a callback result. |
| DetlefStatus detlef_variable_set | ( | DetlefAccess * | a, |
| DetlefSlice | input, | ||
| DetlefHandle | handle | ||
| ) |
Assign an existing mutable variable. Its declared type is checked and the input handle is not consumed.
| a | Borrowed callback access. Must not be freed, saved, or used outside its current callback. |
| input | Borrowed UTF-8 name, without a trailing NUL requirement. Storage may be released after the call. |
| handle | Borrowed runtime value handle to assign. Not consumed. |
| DetlefStatus detlef_variable_unset | ( | DetlefAccess * | a, |
| DetlefSlice | input | ||
| ) |
Mark an existing variable uninitialized without removing its declaration.
| a | Borrowed callback access. Must not be freed, saved, or used outside its current callback. |
| input | Borrowed UTF-8 name, without a trailing NUL requirement. Storage may be released after the call. |
| DetlefStatus detlef_with_protected_values | ( | DetlefAccess * | a, |
| const DetlefHandle * | handles, | ||
| size_t | count, | ||
| DetlefAccessCallback | callback, | ||
| void * | data | ||
| ) |
Invoke a setup callback with the supplied object values protected from garbage collection for the duration of that callback. Existing handles are not consumed.
| a | Borrowed callback access. Must not be freed, saved, or used outside its current callback. |
| handles | Borrowed array of runtime value handles. Object values are protected during the callback; handles are not consumed. |
| count | Number of entries in the supplied array. |
| callback | Setup callback invoked synchronously with a fresh access pointer. It is not saved after this call. |
| data | Caller-owned data passed to callback. Must remain valid until the callback returns; DETLEF does not free it. |