natiny_script_make_bytes

C
NatinyScriptValue natiny_script_make_bytes(const char* data, uint32_t size);

Wraps an explicit byte range as a script string for a later script operation.

Parameters

Name Type Description
data const char* First byte; must remain valid until the value is consumed; NULL is sent to the script as nil
size uint32_t Number of bytes starting at data; embedded zero bytes are allowed

Returns

Type Description
NatinyScriptValue Value tagged NATINY_SCRIPT_STRING, with a borrowed pointer and explicit byte length

Example

C
const char label[] = {'A', '\0', 'B'};
natiny_script_set(script, "game.label", natiny_script_make_bytes(label, sizeof label));