diff --git a/build-scripts/SDL_migration.cocci b/build-scripts/SDL_migration.cocci index 673c2f4d4..997c8efef 100644 --- a/build-scripts/SDL_migration.cocci +++ b/build-scripts/SDL_migration.cocci @@ -1051,7 +1051,7 @@ typedef SDL_GameController, SDL_Gamepad; @@ @@ - SDL_GameControllerAddMappingsFromRW -+ SDL_AddGamepadMappingsFromRW ++ SDL_AddGamepadMappingsFromIO (...) @@ typedef SDL_GameControllerAxis, SDL_GamepadAxis; diff --git a/docs/README-migration.md b/docs/README-migration.md index d599f75fe..7c62e1845 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -526,7 +526,7 @@ The following structures have been renamed: The following functions have been renamed: * SDL_GameControllerAddMapping() => SDL_AddGamepadMapping() * SDL_GameControllerAddMappingsFromFile() => SDL_AddGamepadMappingsFromFile() -* SDL_GameControllerAddMappingsFromRW() => SDL_AddGamepadMappingsFromRW() +* SDL_GameControllerAddMappingsFromRW() => SDL_AddGamepadMappingsFromIO() * SDL_GameControllerClose() => SDL_CloseGamepad() * SDL_GameControllerFromInstanceID() => SDL_GetGamepadFromInstanceID() * SDL_GameControllerFromPlayerIndex() => SDL_GetGamepadFromPlayerIndex() diff --git a/include/SDL3/SDL_gamepad.h b/include/SDL3/SDL_gamepad.h index 7e0fdfd8f..2f348acd1 100644 --- a/include/SDL3/SDL_gamepad.h +++ b/include/SDL3/SDL_gamepad.h @@ -279,7 +279,7 @@ extern DECLSPEC int SDLCALL SDL_AddGamepadMapping(const char *mapping); * \sa SDL_AddGamepadMappingsFromFile * \sa SDL_GetGamepadMappingForGUID */ -extern DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromRW(SDL_IOStream *src, SDL_bool freesrc); +extern DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromIO(SDL_IOStream *src, SDL_bool freesrc); /** * Load a set of gamepad mappings from a file. @@ -301,7 +301,7 @@ extern DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromRW(SDL_IOStream *src, SDL_ * \since This function is available since SDL 3.0.0. * * \sa SDL_AddGamepadMapping - * \sa SDL_AddGamepadMappingsFromRW + * \sa SDL_AddGamepadMappingsFromIO * \sa SDL_GetGamepadMappingForGUID */ extern DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromFile(const char *file); diff --git a/include/SDL3/SDL_oldnames.h b/include/SDL3/SDL_oldnames.h index 0a1636594..a6b0f5bf3 100644 --- a/include/SDL3/SDL_oldnames.h +++ b/include/SDL3/SDL_oldnames.h @@ -205,7 +205,7 @@ #define SDL_GameController SDL_Gamepad #define SDL_GameControllerAddMapping SDL_AddGamepadMapping #define SDL_GameControllerAddMappingsFromFile SDL_AddGamepadMappingsFromFile -#define SDL_GameControllerAddMappingsFromRW SDL_AddGamepadMappingsFromRW +#define SDL_GameControllerAddMappingsFromRW SDL_AddGamepadMappingsFromIO #define SDL_GameControllerAxis SDL_GamepadAxis #define SDL_GameControllerBindType SDL_GamepadBindingType #define SDL_GameControllerButton SDL_GamepadButton @@ -701,7 +701,7 @@ #define SDL_GameController SDL_GameController_renamed_SDL_Gamepad #define SDL_GameControllerAddMapping SDL_GameControllerAddMapping_renamed_SDL_AddGamepadMapping #define SDL_GameControllerAddMappingsFromFile SDL_GameControllerAddMappingsFromFile_renamed_SDL_AddGamepadMappingsFromFile -#define SDL_GameControllerAddMappingsFromRW SDL_GameControllerAddMappingsFromRW_renamed_SDL_AddGamepadMappingsFromRW +#define SDL_GameControllerAddMappingsFromRW SDL_GameControllerAddMappingsFromRW_renamed_SDL_AddGamepadMappingsFromIO #define SDL_GameControllerAxis SDL_GameControllerAxis_renamed_SDL_GamepadAxis #define SDL_GameControllerBindType SDL_GameControllerBindType_renamed_SDL_GamepadBindingType #define SDL_GameControllerButton SDL_GameControllerButton_renamed_SDL_GamepadButton diff --git a/include/SDL3/SDL_rwops.h b/include/SDL3/SDL_rwops.h index f867d116e..bfd5b2cc9 100644 --- a/include/SDL3/SDL_rwops.h +++ b/include/SDL3/SDL_rwops.h @@ -548,7 +548,7 @@ extern DECLSPEC size_t SDLCALL SDL_IOvprintf(SDL_IOStream *context, SDL_PRINTF_F * * \since This function is available since SDL 3.0.0. */ -extern DECLSPEC void *SDLCALL SDL_LoadFile_RW(SDL_IOStream *src, size_t *datasize, SDL_bool freesrc); +extern DECLSPEC void *SDLCALL SDL_LoadFile_IO(SDL_IOStream *src, size_t *datasize, SDL_bool freesrc); /** * Load all the data from a file path. diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index b55332008..38a1bc742 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -4,7 +4,7 @@ SDL3_0.0.0 { SDL_DYNAPI_entry; SDL_AddEventWatch; SDL_AddGamepadMapping; - SDL_AddGamepadMappingsFromRW; + SDL_AddGamepadMappingsFromIO; SDL_AddHintCallback; SDL_AddTimer; SDL_AndroidBackButton; @@ -409,7 +409,7 @@ SDL3_0.0.0 { SDL_LoadBMP; SDL_LoadBMP_IO; SDL_LoadFile; - SDL_LoadFile_RW; + SDL_LoadFile_IO; SDL_LoadFunction; SDL_LoadObject; SDL_LockJoysticks; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 33f31e4f9..1e0b94474 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -28,7 +28,7 @@ #define SDL_AddEventWatch SDL_AddEventWatch_REAL #define SDL_AddGamepadMapping SDL_AddGamepadMapping_REAL -#define SDL_AddGamepadMappingsFromRW SDL_AddGamepadMappingsFromRW_REAL +#define SDL_AddGamepadMappingsFromIO SDL_AddGamepadMappingsFromIO_REAL #define SDL_AddHintCallback SDL_AddHintCallback_REAL #define SDL_AddTimer SDL_AddTimer_REAL #define SDL_AndroidBackButton SDL_AndroidBackButton_REAL @@ -433,7 +433,7 @@ #define SDL_LoadBMP SDL_LoadBMP_REAL #define SDL_LoadBMP_IO SDL_LoadBMP_IO_REAL #define SDL_LoadFile SDL_LoadFile_REAL -#define SDL_LoadFile_RW SDL_LoadFile_RW_REAL +#define SDL_LoadFile_IO SDL_LoadFile_IO_REAL #define SDL_LoadFunction SDL_LoadFunction_REAL #define SDL_LoadObject SDL_LoadObject_REAL #define SDL_LockJoysticks SDL_LockJoysticks_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 655e2b000..72010b411 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -103,7 +103,7 @@ SDL_DYNAPI_PROC(SDL_bool,SDL_IsDeXMode,(void),(),return) SDL_DYNAPI_PROC(int,SDL_AddEventWatch,(SDL_EventFilter a, void *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_AddGamepadMapping,(const char *a),(a),return) -SDL_DYNAPI_PROC(int,SDL_AddGamepadMappingsFromRW,(SDL_IOStream *a, SDL_bool b),(a,b),return) +SDL_DYNAPI_PROC(int,SDL_AddGamepadMappingsFromIO,(SDL_IOStream *a, SDL_bool b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_AddHintCallback,(const char *a, SDL_HintCallback b, void *c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_TimerID,SDL_AddTimer,(Uint32 a, SDL_TimerCallback b, void *c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_AtomicAdd,(SDL_AtomicInt *a, int b),(a,b),return) @@ -487,7 +487,7 @@ SDL_DYNAPI_PROC(SDL_bool,SDL_IsJoystickHaptic,(SDL_Joystick *a),(a),return) SDL_DYNAPI_PROC(SDL_Surface*,SDL_LoadBMP,(const char *a),(a),return) SDL_DYNAPI_PROC(SDL_Surface*,SDL_LoadBMP_IO,(SDL_IOStream *a, SDL_bool b),(a,b),return) SDL_DYNAPI_PROC(void*,SDL_LoadFile,(const char *a, size_t *b),(a,b),return) -SDL_DYNAPI_PROC(void*,SDL_LoadFile_RW,(SDL_IOStream *a, size_t *b, SDL_bool c),(a,b,c),return) +SDL_DYNAPI_PROC(void*,SDL_LoadFile_IO,(SDL_IOStream *a, size_t *b, SDL_bool c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_FunctionPointer,SDL_LoadFunction,(void *a, const char *b),(a,b),return) SDL_DYNAPI_PROC(void*,SDL_LoadObject,(const char *a),(a),return) SDL_DYNAPI_PROC(void,SDL_LockJoysticks,(void),(),) diff --git a/src/file/SDL_rwops.c b/src/file/SDL_rwops.c index 5ccaf4e2e..a3cfec774 100644 --- a/src/file/SDL_rwops.c +++ b/src/file/SDL_rwops.c @@ -763,7 +763,7 @@ int SDL_CloseIO(SDL_IOStream *iostr) } /* Load all the data from an SDL data stream */ -void *SDL_LoadFile_RW(SDL_IOStream *src, size_t *datasize, SDL_bool freesrc) +void *SDL_LoadFile_IO(SDL_IOStream *src, size_t *datasize, SDL_bool freesrc) { const int FILE_CHUNK_SIZE = 1024; Sint64 size, size_total = 0; @@ -832,7 +832,7 @@ done: void *SDL_LoadFile(const char *file, size_t *datasize) { - return SDL_LoadFile_RW(SDL_IOFromFile(file, "rb"), datasize, SDL_TRUE); + return SDL_LoadFile_IO(SDL_IOFromFile(file, "rb"), datasize, SDL_TRUE); } SDL_PropertiesID SDL_GetRWProperties(SDL_IOStream *context) diff --git a/src/joystick/SDL_gamepad.c b/src/joystick/SDL_gamepad.c index a09e3d8f2..c2b6315fc 100644 --- a/src/joystick/SDL_gamepad.c +++ b/src/joystick/SDL_gamepad.c @@ -1789,7 +1789,7 @@ static GamepadMapping_t *SDL_PrivateGetGamepadMapping(SDL_JoystickID instance_id /* * Add or update an entry into the Mappings Database */ -int SDL_AddGamepadMappingsFromRW(SDL_IOStream *src, SDL_bool freesrc) +int SDL_AddGamepadMappingsFromIO(SDL_IOStream *src, SDL_bool freesrc) { const char *platform = SDL_GetPlatform(); int gamepads = 0; @@ -1797,7 +1797,7 @@ int SDL_AddGamepadMappingsFromRW(SDL_IOStream *src, SDL_bool freesrc) size_t db_size; size_t platform_len; - buf = (char *)SDL_LoadFile_RW(src, &db_size, freesrc); + buf = (char *)SDL_LoadFile_IO(src, &db_size, freesrc); if (!buf) { return SDL_SetError("Could not allocate space to read DB into memory"); } @@ -1845,7 +1845,7 @@ int SDL_AddGamepadMappingsFromRW(SDL_IOStream *src, SDL_bool freesrc) int SDL_AddGamepadMappingsFromFile(const char *file) { - return SDL_AddGamepadMappingsFromRW(SDL_IOFromFile(file, "rb"), 1); + return SDL_AddGamepadMappingsFromIO(SDL_IOFromFile(file, "rb"), 1); } int SDL_ReloadGamepadMappings(void)