sgs_Compile [function]
SGSRESULT sgs_Compile( sgs_Context* C, const char* buf, size_t size, char** outbuf, size_t* outsize )
Compile a buffer of SGScript code, returning the compiled code buffer on success.
- A C version of compile_sgs SGS function.
outbuf
must be freed after usage with one of the relevant memory handling functions.
outbuf
and outsize
will only contain valid buffer (pointer and size) on success.
- All info/warning/error messages are passed to the Messaging system.
Error codes:
- SGS_ECOMP: compiler error
- SGS_EINVAL: passed data was too big
- SGS_EINPROC: failed to serialize bytecode