SDL_EnumerateDirectoryCallback(3type)

SDL_EnumerateDirectoryCallback3type

Callback for directory enumeration.

Usage

#include "SDL3/SDL.h"

typedef SDL_EnumerationResult (SDLCALL *SDL_EnumerateDirectoryCallback)(void *userdata, const char *dirname, const char *fname);

Header file

Defined in SDL3/SDL_filesystem.h

Overview

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.

From libsdl3-doc 3.2.10+ds-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.