Man page - sdl_globdirectory(3)
Packages contains this manual
Manual
SDL_GlobDirectory
NAMEHEADER FILE
SYNOPSIS
DESCRIPTION
FUNCTION PARAMETERS
RETURN VALUE
THREAD SAFETY
AVAILABILITY
NAME
SDL_GlobDirectory - Enumerate a directory tree, filtered by pattern, and return a list.
HEADER FILE
Defined in SDL3/SDL_filesystem.h
SYNOPSIS
#include "SDL3/SDL.h"
char ** SDL_GlobDirectory(const char *path, const char *pattern, SDL_GlobFlags flags, int *count);
DESCRIPTION
Files are filtered out if they donβt match the string in pattern , which may contain wildcard characters β.I β (match everything) and β?β (match one character). If pattern is NULL, no filtering is done and all results are returned. Subdirectories are permitted, and are specified with a path separator of β/β. Wildcard characters ββ and β?β never match a path separator. flags may be set to SDL_GLOB_CASEINSENSITIVE
to make the pattern matching case-insensitive.
The returned array is always NULL-terminated, for your iterating convenience, but if count is non-NULL, on return it will contain the number of items in the array, not counting the NULL terminator.
FUNCTION PARAMETERS
|
path |
the path of the directory to enumerate. |
pattern
the pattern that files in the directory must match. Can be NULL.
|
flags |
SDL_GLOB_* bitflags that affect this search.
|
count |
on return, will be set to the number of items in the returned array. Can be NULL. |
RETURN VALUE
(char ) Returns an array of strings on success or NULL on failure; call
SDL_GetError () for more information. This is a single allocation that should be freed with SDL_free () when it is no longer needed.
THREAD SAFETY
It is safe to call this function from any thread.
AVAILABILITY
This function is available since SDL 3.2.0.