sgs_ToStringBuf(Fast)(P) [functions]
char* sgs_ToStringBuf( sgs_Context* C, sgs_StkIdx item, sgs_SizeVal* outsize )
char* sgs_ToStringBufFast( sgs_Context* C, sgs_StkIdx item, sgs_SizeVal* outsize )
Return an item from the current stack frame, converted in-place to string.
char* sgs_ToStringBufP( sgs_Context* C, sgs_Variable* var, sgs_SizeVal* outsize )
char* sgs_ToStringBufFastP( sgs_Context* C, sgs_Variable* var, sgs_SizeVal* outsize )
Return the value of the specified variable, converted in-place to string.
- In ***P functions previous variable is properly released before conversion takes place and reacquired afterwards.
- If
item
is out of bounds or conversion fails, NULL is returned.
- The 'fast' version uses type name conversion on object, instead of string conversion - this is to avoid recursion while generating a short description about object contents.
- Length of string is returned to the value that
outsize
points to.