natiny_script_to_string

C
const char* natiny_script_to_string(NatinyScriptValue value);

Returns the byte pointer stored in a script-string value.

Parameters

Name Type Description
value NatinyScriptValue Value to inspect

Returns

Type Description
const char* Stored pointer for NATINY_SCRIPT_STRING, or NULL for every other type; ownership and lifetime are unchanged

Example

C
NatinyScriptValue title = natiny_script_get(script, "game.title");
if (title.type == NATINY_SCRIPT_STRING)
    printf("%.*s\n", (int)title.string.size, natiny_script_to_string(title));