---
name: "SDL_StorageInterface"
section: "3type"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_StorageInterface"
---

# SDL\_StorageInterface(3type)

Function interface for SDL\_Storage .

## NAME

SDL\_StorageInterface - Function interface for  **SDL\_Storage** .

## HEADER FILE

Defined in SDL3/SDL\_storage.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**typedef struct SDL\_StorageInterface** **{**     **/\* The version of this interface \*/**     **Uint32 version;**     **/\* Called when the storage is closed \*/**     **bool (SDLCALL \*close)(void \*userdata);**     **/\* Optional, returns whether the storage is currently ready for access \*/**     **bool (SDLCALL \*ready)(void \*userdata);**     **/\* Enumerate a directory, optional for write-only storage \*/**     **bool (SDLCALL \*enumerate)(void \*userdata, const char \*path, SDL\_EnumerateDirectoryCallback callback, void \*callback\_userdata);**     **/\* Get path information, optional for write-only storage \*/**     **bool (SDLCALL \*info)(void \*userdata, const char \*path, SDL\_PathInfo \*info);**     **/\* Read a file from storage, optional for write-only storage \*/**     **bool (SDLCALL \*read\_file)(void \*userdata, const char \*path, void \*destination, Uint64 length);**     **/\* Write a file to storage, optional for read-only storage \*/**     **bool (SDLCALL \*write\_file)(void \*userdata, const char \*path, const void \*source, Uint64 length);**     **/\* Create a directory, optional for read-only storage \*/**     **bool (SDLCALL \*mkdir)(void \*userdata, const char \*path);**     **/\* Remove a file or empty directory, optional for read-only storage \*/**     **bool (SDLCALL \*remove)(void \*userdata, const char \*path);**     **/\* Rename a path, optional for read-only storage \*/**     **bool (SDLCALL \*rename)(void \*userdata, const char \*oldpath, const char \*newpath);**     **/\* Copy a file, optional for read-only storage \*/**     **bool (SDLCALL \*copy)(void \*userdata, const char \*oldpath, const char \*newpath);**     **/\* Get the space remaining, optional for read-only storage \*/**     **Uint64 (SDLCALL \*space\_remaining)(void \*userdata);** **} SDL\_StorageInterface;**

## 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** ()

## AVAILABILITY

This struct is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_INIT\_INTERFACE**(3)](/SDL_INIT_INTERFACE/3.md)
