#include"SDL3/SDL.h"typedefstructSDL_IOStreamInterface{/*Theversionofthisinterface*/Uint32version;/***ReturnthenumberofbytesinthisSDL_IOStream*eturnthetotalsizeofthedatastream,or-1onerror.**/Sint64(SDLCALL*size)(void*userdata);/***Seekto`offset`relativeto`whence`,oneofstdio'swhencevalues:*SDL_IO_SEEK_SET,SDL_IO_SEEK_CUR,SDL_IO_SEEK_END*eturnthefinaloffsetinthedatastream,or-1onerror.**/Sint64(SDLCALL*seek)(void*userdata,Sint64offset,SDL_IOWhencewhence);/***Readupto`size`bytesfromthedatastreamtotheareapointed*atby`ptr`.**Onanincompleteread,youshouldset`*status`toavaluefromthe*SDL_IOStatusenum.Youdonothavetoexplicitlysetthison*acomplete,successfulread.*eturnthenumberofbytesread**/size_t(SDLCALL*read)(void*userdata,void*ptr,size_tsize,SDL_IOStatus*status);/***Writeexactly`size`bytesfromtheareapointedatby`ptr`*todatastream.**Onanincompletewrite,youshouldset`*status`toavaluefromthe*SDL_IOStatusenum.Youdonothavetoexplicitlysetthison*acomplete,successfulwrite.*eturnthenumberofbyteswritten**/size_t(SDLCALL*write)(void*userdata,constvoid*ptr,size_tsize,SDL_IOStatus*status);/***Ifthestreamisbuffering,makesurethedataiswrittenout.**Onfailure,youshouldset`*status`toavaluefromthe*SDL_IOStatusenum.Youdonothavetoexplicitlysetthison*asuccessfulflush.*eturntrueifsuccessfulorfalseonwriteerrorwhenflushingdata.**/bool(SDLCALL*flush)(void*userdata,SDL_IOStatus*status);/***Closeandfreeanyallocatedresources.**Thisdoesnotguaranteefilewriteswillsynctophysicalmedia;they*canbeinthesystem'sfilecache,waitingtogotodisk.**TheSDL_IOStreamisstilldestroyedevenifthisfails,socleanupanything*evenifflushingbuffers,etc,returnsanerror.*eturntrueifsuccessfulorfalseonwriteerrorwhenflushingdata.**/bool(SDLCALL*close)(void*userdata);}SDL_IOStreamInterface;