SDL: Renamed SDL_SizeIO() SDL_GetIOSize()

From a1a01567563a05a9efd855e2ecb118d4b2341b35 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sun, 17 Mar 2024 17:13:39 -0700
Subject: [PATCH] Renamed SDL_SizeIO() SDL_GetIOSize()

---
 docs/README-migration.md          | 4 ++--
 include/SDL3/SDL_iostream.h       | 2 +-
 include/SDL3/SDL_oldnames.h       | 4 ++--
 src/dynapi/SDL_dynapi.sym         | 2 +-
 src/dynapi/SDL_dynapi_overrides.h | 2 +-
 src/dynapi/SDL_dynapi_procs.h     | 2 +-
 src/file/SDL_iostream.c           | 6 +++---
 src/test/SDL_test_common.c        | 2 +-
 test/testautomation_iostream.c    | 2 +-
 9 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/docs/README-migration.md b/docs/README-migration.md
index 4576c7d643d85..394c29c1c3562 100644
--- a/docs/README-migration.md
+++ b/docs/README-migration.md
@@ -1296,7 +1296,7 @@ SDL_IOStream *SDL_RWFromFP(FILE *fp, SDL_bool autoclose)
     }
 
     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.read = stdio_read;
     iface.write = stdio_write;
@@ -1325,7 +1325,7 @@ The following functions have been renamed:
 * SDL_RWclose() => SDL_CloseIO()
 * SDL_RWread() => SDL_ReadIO()
 * SDL_RWseek() => SDL_SeekIO()
-* SDL_RWsize() => SDL_SizeIO()
+* SDL_RWsize() => SDL_GetIOSize()
 * SDL_RWtell() => SDL_TellIO()
 * SDL_RWwrite() => SDL_WriteIO()
 * SDL_ReadBE16() => SDL_ReadU16BE()
diff --git a/include/SDL3/SDL_iostream.h b/include/SDL3/SDL_iostream.h
index 0e64e88936fc7..856f3ff2f3a68 100644
--- a/include/SDL3/SDL_iostream.h
+++ b/include/SDL3/SDL_iostream.h
@@ -385,7 +385,7 @@ extern DECLSPEC SDL_IOStatus SDLCALL SDL_GetIOStatus(SDL_IOStream *context);
  *
  * \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.
diff --git a/include/SDL3/SDL_oldnames.h b/include/SDL3/SDL_oldnames.h
index 98353aa6a33f6..b7b131dcf431e 100644
--- a/include/SDL3/SDL_oldnames.h
+++ b/include/SDL3/SDL_oldnames.h
@@ -464,7 +464,7 @@
 #define SDL_RWops SDL_IOStream
 #define SDL_RWread SDL_ReadIO
 #define SDL_RWseek SDL_SeekIO
-#define SDL_RWsize SDL_SizeIO
+#define SDL_RWsize SDL_GetIOSize
 #define SDL_RWtell SDL_TellIO
 #define SDL_RWwrite SDL_WriteIO
 #define SDL_ReadBE16 SDL_ReadU16BE
@@ -965,7 +965,7 @@
 #define SDL_RWops SDL_RWops_renamed_SDL_IOStream
 #define SDL_RWread SDL_RWread_renamed_SDL_ReadIO
 #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_RWwrite SDL_RWwrite_renamed_SDL_WriteIO
 #define SDL_ReadBE16 SDL_ReadBE16_renamed_SDL_ReadU16BE
diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym
index 9da8e0c8c661e..0af4fdc7d39e8 100644
--- a/src/dynapi/SDL_dynapi.sym
+++ b/src/dynapi/SDL_dynapi.sym
@@ -469,7 +469,7 @@ SDL3_0.0.0 {
     SDL_IOFromMem;
     SDL_ReadIO;
     SDL_SeekIO;
-    SDL_SizeIO;
+    SDL_GetIOSize;
     SDL_TellIO;
     SDL_WriteIO;
     SDL_RaiseWindow;
diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h
index c0dbb212fa0a0..489142e57aad9 100644
--- a/src/dynapi/SDL_dynapi_overrides.h
+++ b/src/dynapi/SDL_dynapi_overrides.h
@@ -493,7 +493,7 @@
 #define SDL_IOFromMem SDL_IOFromMem_REAL
 #define SDL_ReadIO SDL_ReadIO_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_WriteIO SDL_WriteIO_REAL
 #define SDL_RaiseWindow SDL_RaiseWindow_REAL
diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h
index ca2434ad053ce..52a39fa09ae29 100644
--- a/src/dynapi/SDL_dynapi_procs.h
+++ b/src/dynapi/SDL_dynapi_procs.h
@@ -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(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_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(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)
diff --git a/src/file/SDL_iostream.c b/src/file/SDL_iostream.c
index 5f726ca780f39..f40408222b45e 100644
--- a/src/file/SDL_iostream.c
+++ b/src/file/SDL_iostream.c
@@ -415,7 +415,7 @@ static SDL_IOStream *SDL_IOFromFP(FILE *fp, SDL_bool autoclose)
 
     SDL_IOStreamInterface 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.read = stdio_read;
     iface.write = stdio_write;
@@ -886,7 +886,7 @@ void *SDL_LoadFile_IO(SDL_IOStream *src, size_t *datasize, SDL_bool closeio)
         goto done;
     }
 
-    size = SDL_SizeIO(src);
+    size = SDL_GetIOSize(src);
     if (size < 0) {
         size = FILE_CHUNK_SIZE;
         loading_chunks = SDL_TRUE;
@@ -958,7 +958,7 @@ SDL_PropertiesID SDL_GetIOProperties(SDL_IOStream *context)
     return context->props;
 }
 
-Sint64 SDL_SizeIO(SDL_IOStream *context)
+Sint64 SDL_GetIOSize(SDL_IOStream *context)
 {
     if (!context) {
         return SDL_InvalidParamError("context");
diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c
index 00af25ecc418f..e8f33211e1e3b 100644
--- a/src/test/SDL_test_common.c
+++ b/src/test/SDL_test_common.c
@@ -1904,7 +1904,7 @@ static const void *SDLTest_ScreenShotClipboardProvider(void *context, const char
 
         file = SDL_IOFromFile(SCREENSHOT_FILE, "r");
         if (file) {
-            size_t length = (size_t)SDL_SizeIO(file);
+            size_t length = (size_t)SDL_GetIOSize(file);
             void *image = SDL_malloc(length);
             if (image) {
                 if (SDL_ReadIO(file, image, length) != length) {
diff --git a/test/testautomation_iostream.c b/test/testautomation_iostream.c
index 0fe3f8bf55163..b6a66ec2d6b5f 100644
--- a/test/testautomation_iostream.c
+++ b/test/testautomation_iostream.c
@@ -346,7 +346,7 @@ static int iostrm_testDynamicMem(void *arg)
     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_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");
 
     /* Take the memory and free it ourselves */