sgs_Set(Err)OutputFunc [function]
void sgs_SetOutputFunc( sgs_Context* C, sgs_OutputFunc func, void* userdata )
void sgs_SetErrOutputFunc( sgs_Context* C, sgs_OutputFunc func, void* userdata )
Sets the function used in 'print'/'errprint' function family.
- Default output function can be set by passing SGSOUTPUTFN_DEFAULT to func with userdata as FILE*, allocated using the same C runtime that SGScript uses.
- Default implementation - sgs_StdOutputFunc - copies data to FILE* stream, specified in userdata.
- To use this function with non-default (stderr) stream, pass it explicity due to the possibility of having different runtime libraries linked to different binaries.