sgs_Serialize(Ext) [functions]
void sgs_Serialize( sgs_Context* C, sgs_Variable var )
Serialize the given variable (convert to a byte stream).
void sgs_SerializeExt( sgs_Context* C, sgs_Variable var, int mode )
Same as above, also allows to specify serialization mode.
sgs_Serialize
is alias of sgs_SerializeExt( C, var, SGS_SERIALIZE_DEFAULT )
- Function pushes a string variable on stack if serialization was at least minimally successful, otherwise
null
is pushed.
- Default serialization mode is 2 or the current mode inside object serialization callback.
- The following variable types can be serialized:
- symbols (variables that can be found in the symbol table);
- null, bool, int, real, string, func (SGS function);
- objects with the SERIALIZE interface function defined.