Renamed SDL_SizeIO() SDL_GetIOSize()

main
Sam Lantinga 2024-03-17 17:13:39 -07:00 committed by Ryan C. Gordon
parent df0f5deddf
commit a1a0156756
9 changed files with 13 additions and 13 deletions

View File

@ -1296,7 +1296,7 @@ SDL_IOStream *SDL_RWFromFP(FILE *fp, SDL_bool autoclose)
} }
SDL_zero(iface); SDL_zero(iface);
/* There's no stdio_size because SDL_SizeIO emulates it the same way we'd do it for stdio anyhow. */ /* There's no stdio_size because SDL_GetIOSize emulates it the same way we'd do it for stdio anyhow. */
iface.seek = stdio_seek; iface.seek = stdio_seek;
iface.read = stdio_read; iface.read = stdio_read;
iface.write = stdio_write; iface.write = stdio_write;
@ -1325,7 +1325,7 @@ The following functions have been renamed:
* SDL_RWclose() => SDL_CloseIO() * SDL_RWclose() => SDL_CloseIO()
* SDL_RWread() => SDL_ReadIO() * SDL_RWread() => SDL_ReadIO()
* SDL_RWseek() => SDL_SeekIO() * SDL_RWseek() => SDL_SeekIO()
* SDL_RWsize() => SDL_SizeIO() * SDL_RWsize() => SDL_GetIOSize()
* SDL_RWtell() => SDL_TellIO() * SDL_RWtell() => SDL_TellIO()
* SDL_RWwrite() => SDL_WriteIO() * SDL_RWwrite() => SDL_WriteIO()
* SDL_ReadBE16() => SDL_ReadU16BE() * SDL_ReadBE16() => SDL_ReadU16BE()

View File

@ -385,7 +385,7 @@ extern DECLSPEC SDL_IOStatus SDLCALL SDL_GetIOStatus(SDL_IOStream *context);
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC Sint64 SDLCALL SDL_SizeIO(SDL_IOStream *context); extern DECLSPEC Sint64 SDLCALL SDL_GetIOSize(SDL_IOStream *context);
/** /**
* Seek within an SDL_IOStream data stream. * Seek within an SDL_IOStream data stream.

View File

@ -464,7 +464,7 @@
#define SDL_RWops SDL_IOStream #define SDL_RWops SDL_IOStream
#define SDL_RWread SDL_ReadIO #define SDL_RWread SDL_ReadIO
#define SDL_RWseek SDL_SeekIO #define SDL_RWseek SDL_SeekIO
#define SDL_RWsize SDL_SizeIO #define SDL_RWsize SDL_GetIOSize
#define SDL_RWtell SDL_TellIO #define SDL_RWtell SDL_TellIO
#define SDL_RWwrite SDL_WriteIO #define SDL_RWwrite SDL_WriteIO
#define SDL_ReadBE16 SDL_ReadU16BE #define SDL_ReadBE16 SDL_ReadU16BE
@ -965,7 +965,7 @@
#define SDL_RWops SDL_RWops_renamed_SDL_IOStream #define SDL_RWops SDL_RWops_renamed_SDL_IOStream
#define SDL_RWread SDL_RWread_renamed_SDL_ReadIO #define SDL_RWread SDL_RWread_renamed_SDL_ReadIO
#define SDL_RWseek SDL_RWseek_renamed_SDL_SeekIO #define SDL_RWseek SDL_RWseek_renamed_SDL_SeekIO
#define SDL_RWsize SDL_RWsize_renamed_SDL_SizeIO #define SDL_RWsize SDL_RWsize_renamed_SDL_GetIOSize
#define SDL_RWtell SDL_RWtell_renamed_SDL_TellIO #define SDL_RWtell SDL_RWtell_renamed_SDL_TellIO
#define SDL_RWwrite SDL_RWwrite_renamed_SDL_WriteIO #define SDL_RWwrite SDL_RWwrite_renamed_SDL_WriteIO
#define SDL_ReadBE16 SDL_ReadBE16_renamed_SDL_ReadU16BE #define SDL_ReadBE16 SDL_ReadBE16_renamed_SDL_ReadU16BE

View File

@ -469,7 +469,7 @@ SDL3_0.0.0 {
SDL_IOFromMem; SDL_IOFromMem;
SDL_ReadIO; SDL_ReadIO;
SDL_SeekIO; SDL_SeekIO;
SDL_SizeIO; SDL_GetIOSize;
SDL_TellIO; SDL_TellIO;
SDL_WriteIO; SDL_WriteIO;
SDL_RaiseWindow; SDL_RaiseWindow;

View File

@ -493,7 +493,7 @@
#define SDL_IOFromMem SDL_IOFromMem_REAL #define SDL_IOFromMem SDL_IOFromMem_REAL
#define SDL_ReadIO SDL_ReadIO_REAL #define SDL_ReadIO SDL_ReadIO_REAL
#define SDL_SeekIO SDL_SeekIO_REAL #define SDL_SeekIO SDL_SeekIO_REAL
#define SDL_SizeIO SDL_SizeIO_REAL #define SDL_GetIOSize SDL_GetIOSize_REAL
#define SDL_TellIO SDL_TellIO_REAL #define SDL_TellIO SDL_TellIO_REAL
#define SDL_WriteIO SDL_WriteIO_REAL #define SDL_WriteIO SDL_WriteIO_REAL
#define SDL_RaiseWindow SDL_RaiseWindow_REAL #define SDL_RaiseWindow SDL_RaiseWindow_REAL

View File

@ -538,7 +538,7 @@ SDL_DYNAPI_PROC(SDL_IOStream*,SDL_IOFromFile,(const char *a, const char *b),(a,b
SDL_DYNAPI_PROC(SDL_IOStream*,SDL_IOFromMem,(void *a, size_t b),(a,b),return) SDL_DYNAPI_PROC(SDL_IOStream*,SDL_IOFromMem,(void *a, size_t b),(a,b),return)
SDL_DYNAPI_PROC(size_t,SDL_ReadIO,(SDL_IOStream *a, void *b, size_t c),(a,b,c),return) SDL_DYNAPI_PROC(size_t,SDL_ReadIO,(SDL_IOStream *a, void *b, size_t c),(a,b,c),return)
SDL_DYNAPI_PROC(Sint64,SDL_SeekIO,(SDL_IOStream *a, Sint64 b, int c),(a,b,c),return) SDL_DYNAPI_PROC(Sint64,SDL_SeekIO,(SDL_IOStream *a, Sint64 b, int c),(a,b,c),return)
SDL_DYNAPI_PROC(Sint64,SDL_SizeIO,(SDL_IOStream *a),(a),return) SDL_DYNAPI_PROC(Sint64,SDL_GetIOSize,(SDL_IOStream *a),(a),return)
SDL_DYNAPI_PROC(Sint64,SDL_TellIO,(SDL_IOStream *a),(a),return) SDL_DYNAPI_PROC(Sint64,SDL_TellIO,(SDL_IOStream *a),(a),return)
SDL_DYNAPI_PROC(size_t,SDL_WriteIO,(SDL_IOStream *a, const void *b, size_t c),(a,b,c),return) SDL_DYNAPI_PROC(size_t,SDL_WriteIO,(SDL_IOStream *a, const void *b, size_t c),(a,b,c),return)
SDL_DYNAPI_PROC(int,SDL_RaiseWindow,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(int,SDL_RaiseWindow,(SDL_Window *a),(a),return)

View File

@ -415,7 +415,7 @@ static SDL_IOStream *SDL_IOFromFP(FILE *fp, SDL_bool autoclose)
SDL_IOStreamInterface iface; SDL_IOStreamInterface iface;
SDL_zero(iface); SDL_zero(iface);
// There's no stdio_size because SDL_SizeIO emulates it the same way we'd do it for stdio anyhow. // There's no stdio_size because SDL_GetIOSize emulates it the same way we'd do it for stdio anyhow.
iface.seek = stdio_seek; iface.seek = stdio_seek;
iface.read = stdio_read; iface.read = stdio_read;
iface.write = stdio_write; iface.write = stdio_write;
@ -886,7 +886,7 @@ void *SDL_LoadFile_IO(SDL_IOStream *src, size_t *datasize, SDL_bool closeio)
goto done; goto done;
} }
size = SDL_SizeIO(src); size = SDL_GetIOSize(src);
if (size < 0) { if (size < 0) {
size = FILE_CHUNK_SIZE; size = FILE_CHUNK_SIZE;
loading_chunks = SDL_TRUE; loading_chunks = SDL_TRUE;
@ -958,7 +958,7 @@ SDL_PropertiesID SDL_GetIOProperties(SDL_IOStream *context)
return context->props; return context->props;
} }
Sint64 SDL_SizeIO(SDL_IOStream *context) Sint64 SDL_GetIOSize(SDL_IOStream *context)
{ {
if (!context) { if (!context) {
return SDL_InvalidParamError("context"); return SDL_InvalidParamError("context");

View File

@ -1904,7 +1904,7 @@ static const void *SDLTest_ScreenShotClipboardProvider(void *context, const char
file = SDL_IOFromFile(SCREENSHOT_FILE, "r"); file = SDL_IOFromFile(SCREENSHOT_FILE, "r");
if (file) { if (file) {
size_t length = (size_t)SDL_SizeIO(file); size_t length = (size_t)SDL_GetIOSize(file);
void *image = SDL_malloc(length); void *image = SDL_malloc(length);
if (image) { if (image) {
if (SDL_ReadIO(file, image, length) != length) { if (SDL_ReadIO(file, image, length) != length) {

View File

@ -346,7 +346,7 @@ static int iostrm_testDynamicMem(void *arg)
mem = (char *)SDL_GetProperty(props, SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL); mem = (char *)SDL_GetProperty(props, SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL);
SDLTest_AssertPass("Call to SDL_GetProperty(props, SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL) succeeded"); SDLTest_AssertPass("Call to SDL_GetProperty(props, SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL) succeeded");
SDLTest_AssertCheck(mem != NULL, "Verify memory value is not NULL"); SDLTest_AssertCheck(mem != NULL, "Verify memory value is not NULL");
mem[SDL_SizeIO(rw)] = '\0'; mem[SDL_GetIOSize(rw)] = '\0';
SDLTest_AssertCheck(SDL_strcmp(mem, IOStreamHelloWorldTestString) == 0, "Verify memory value is correct"); SDLTest_AssertCheck(SDL_strcmp(mem, IOStreamHelloWorldTestString) == 0, "Verify memory value is correct");
/* Take the memory and free it ourselves */ /* Take the memory and free it ourselves */