Make SDL_URIToLocal available to multiple platforms

Moves the functions out of core/unix into SDL_utils.c
This commit is contained in:
Frank Praznik
2024-07-19 11:42:53 -04:00
parent 6a62c54b93
commit 6a74ade73d
7 changed files with 127 additions and 182 deletions

View File

@@ -32,6 +32,19 @@ extern void SDL_CalculateFraction(float x, int *numerator, int *denominator);
extern SDL_bool SDL_endswith(const char *string, const char *suffix);
/** Convert URI to a local filename, stripping the "file://"
* preamble and hostname if present, and writes the result
* to the dst buffer. Since URI-encoded characters take
* three times the space of normal characters, src and dst
* can safely point to the same buffer for in situ conversion.
*
* Returns the number of decoded bytes that wound up in
* the destination buffer, excluding the terminating NULL byte.
*
* On error, -1 is returned.
*/
extern int SDL_URIToLocal(const char *src, char *dst);
typedef enum
{
SDL_OBJECT_TYPE_UNKNOWN,