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

# SDL\_OpenIO(3)

Create a custom SDL\_IOStream .

## NAME

SDL\_OpenIO - Create a custom  **SDL\_IOStream** .

## HEADER FILE

Defined in SDL3/SDL\_iostream.h

## SYNOPSIS

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

**SDL\_IOStream \* SDL\_OpenIO(const SDL\_IOStreamInterface \*iface, void \*userdata);**

## DESCRIPTION

Applications do not need to use this function unless they are providing their own  **SDL\_IOStream**\
  implementation. If you just need an

**SDL\_IOStream**\
  to read/write a common data source, you should use the built-in implementations in SDL, like

**SDL\_IOFromFile** () or  **SDL\_IOFromMem** (), etc.

This function makes a copy of **iface** and the caller does not need to keep it around after this call.

## FUNCTION PARAMETERS

- *iface*

  the interface that implements this  **SDL\_IOStream** , initialized using  **SDL\_INIT\_INTERFACE** ().

- *userdata*

  the pointer that will be passed to the interface functions.

## RETURN VALUE

( **SDL\_IOStream**\
  \*) Returns a pointer to the allocated memory on success or NULL on failure; call  **SDL\_GetError** () for more information.

## THREAD SAFETY

It is safe to call this function from any thread.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_CloseIO**(3)](/SDL_CloseIO/3.md), **•**(3), [**SDL\_INIT\_INTERFACE**(3)](/SDL_INIT_INTERFACE/3.md), **•**(3), [**SDL\_IOFromConstMem**(3)](/SDL_IOFromConstMem/3.md), **•**(3), [**SDL\_IOFromFile**(3)](/SDL_IOFromFile/3.md), **•**(3), [**SDL\_IOFromMem**(3)](/SDL_IOFromMem/3.md)
