sgs_SetScriptFSFunc [function]
void sgs_SetScriptFSFunc( sgs_Context* C, sgs_ScriptFSFunc func, void* ctx ).
Sets the virtual file system function.
- Default VFS function - sgs_StdScriptFSFunc.
- These operations have to be implemented by the callback:
- SGS_SFS_FILE_EXISTS: check if file
sgs_ScriptFSData::filename
exists;
- SGS_SFS_FILE_OPEN: open the file
sgs_ScriptFSData::filename
for reading;
- SGS_SFS_FILE_READ: read
sgs_ScriptFSData::size
bytes from beginning to sgs_ScriptFSData::output
;
- SGS_SFS_FILE_CLOSE: close the currently opened file;
- File handle can be stored in
sgs_ScriptFSData::userhandle
.