filesystem: Added SDL_GetCurrentDirectory().

Fixes #11531.
This commit is contained in:
Ryan C. Gordon 2024-11-27 19:41:37 -05:00
parent 16113374ff
commit f852038384
10 changed files with 101 additions and 2 deletions

View file

@ -447,6 +447,22 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetPathInfo(const char *path, SDL_PathInfo
*/
extern SDL_DECLSPEC char ** SDLCALL SDL_GlobDirectory(const char *path, const char *pattern, SDL_GlobFlags flags, int *count);
/**
* Get what the system believes is the "current working directory."
*
* For systems without a concept of a current working directory, this will
* still attempt to provide something reasonable.
*
* SDL does not provide a means to _change_ the current working directory;
* for platforms without this concept, this would cause surprises with file
* access outside of SDL.
*
* \returns a UTF-8 string of the current working directory in
* platform-dependent notation. NULL if there's a problem. This
* should be freed with SDL_free() when it is no longer needed.
*/
extern SDL_DECLSPEC char * SDLCALL SDL_GetCurrentDirectory(void);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}