sgs_Create*** [functions]
SGSONE sgs_CreateObject( sgs_Context* C, sgs_Variable* out, void* data, sgs_ObjInterface* iface )
void* sgs_CreateObjectIPA( sgs_Context* C, sgs_Variable* out, sgs_SizeVal added, sgs_ObjInterface* iface )
Creates a new object.
SGSONE sgs_CreateArray( sgs_Context* C, sgs_Variable* out, sgs_SizeVal numitems )
Creates an array from numitems
last items on the stack, pops those items.
SGSONE sgs_CreateDict( sgs_Context* C, sgs_Variable* out, sgs_SizeVal numitems )
Creates a dict from numitems
last items on the stack, pops those items.
SGSONE sgs_CreateMap( sgs_Context* C, sgs_Variable* out, sgs_SizeVal numitems )
Creates a map from numitems
last items on the stack, pops those items.
SGSONE sgs_CreateEvent( sgs_Context* C, sgs_Variable* out )
Initialize variable to a new event.
SGSONE sgs_CreatePooledEventBuf( sgs_Context* C, sgs_Variable* out, sgs_Variable dict, const char* str, sgs_SizeVal size )
Initialize variable to a new or existing pooled event (by name in buffer).
SGSONE sgs_CreatePooledEvent( sgs_Context* C, sgs_Variable* out, sgs_Variable dict, const char* str )
Initialize variable to a new or existing pooled event (by C-string name).
- If
out
is unspecified, the new variable is pushed on the stack instead.
- sgs_CreateObjectIPA stands for "initialize object, allocate memory in-place":
- it means that the
added
memory space will be appended to the end of object allocation;
- this allows to allocate all object data for most objects with just one allocation, instead of two;
- the allocated memory will be returned and also available via sgs_GetObjectData(P).