---
name: "SDL_EnumerateDirectoryCallback"
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_EnumerateDirectoryCallback"
---

# SDL\_EnumerateDirectoryCallback(3type)

Callback for directory enumeration.

## NAME

SDL\_EnumerateDirectoryCallback - Callback for directory enumeration.

## HEADER FILE

Defined in SDL3/SDL\_filesystem.h

## SYNOPSIS

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

**typedef SDL\_EnumerationResult (SDLCALL \*SDL\_EnumerateDirectoryCallback)(void \*userdata, const char \*dirname, const char \*fname);**

## DESCRIPTION

Enumeration of directory entries will continue until either all entries have been provided to the callback, or the callback has requested a stop through its return value.

Returning  **SDL\_ENUM\_CONTINUE**\
  will let enumeration proceed, calling the callback with further entries.

**SDL\_ENUM\_SUCCESS**\
  and

**SDL\_ENUM\_FAILURE**\
  will terminate the enumeration early, and dictate the return value of the enumeration function itself. **dirname** is guaranteed to end with a path separator ('\\' on Windows, '/' on most other platforms).

## FUNCTION PARAMETERS

- *userdata*

  an app-controlled pointer that is passed to the callback.

- *dirname*

  the directory that is being enumerated.

- *fname*

  the next entry in the enumeration.

## RETURN VALUE

Returns how the enumeration should proceed.

## AVAILABILITY

This datatype is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_EnumerateDirectory**(3)](/SDL_EnumerateDirectory/3.md)
