logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_StorageInterface - Function interface for SDL_Storage.

Availability

       This struct is available since SDL 3.2.0.

Description

       Apps  that  want  to supply a custom implementation of SDL_Storage will fill in all the functions in this
       struct, and then pass it to SDL_OpenStorage to create a custom SDL_Storage object.

       It is not usually necessary to do this; SDL provides standard implementations for many things  you  might
       expect to do with an SDL_Storage.

       This structure should be initialized using SDL_INIT_INTERFACE()

Name

       SDL_StorageInterface - Function interface for SDL_Storage.

See Also

SDL_INIT_INTERFACE(3)

Simple Directmedia Layer                           SDL 3.2.20                        SDL_StorageInterface(3type)

Synopsis

#include<SDL3/SDL_storage.h>typedefstructSDL_StorageInterface{/*Theversionofthisinterface*/Uint32version;/*Calledwhenthestorageisclosed*/bool(SDLCALL*close)(void*userdata);/*Optional,returnswhetherthestorageiscurrentlyreadyforaccess*/bool(SDLCALL*ready)(void*userdata);/*Enumerateadirectory,optionalforwrite-onlystorage*/bool(SDLCALL*enumerate)(void*userdata,constchar*path,SDL_EnumerateDirectoryCallbackcallback,void*callback_userdata);/*Getpathinformation,optionalforwrite-onlystorage*/bool(SDLCALL*info)(void*userdata,constchar*path,SDL_PathInfo*info);/*Readafilefromstorage,optionalforwrite-onlystorage*/bool(SDLCALL*read_file)(void*userdata,constchar*path,void*destination,Uint64length);/*Writeafiletostorage,optionalforread-onlystorage*/bool(SDLCALL*write_file)(void*userdata,constchar*path,constvoid*source,Uint64length);/*Createadirectory,optionalforread-onlystorage*/bool(SDLCALL*mkdir)(void*userdata,constchar*path);/*Removeafileoremptydirectory,optionalforread-onlystorage*/bool(SDLCALL*remove)(void*userdata,constchar*path);/*Renameapath,optionalforread-onlystorage*/bool(SDLCALL*rename)(void*userdata,constchar*oldpath,constchar*newpath);/*Copyafile,optionalforread-onlystorage*/bool(SDLCALL*copy)(void*userdata,constchar*oldpath,constchar*newpath);/*Getthespaceremaining,optionalforread-onlystorage*/Uint64(SDLCALL*space_remaining)(void*userdata);}SDL_StorageInterface;

See Also