SDL: Renamed storage functions to match SDL 3.0 naming convention

From fe5c34d4bdcb42821b04e6a1d1799042d23fd208 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sat, 16 Mar 2024 07:40:01 -0700
Subject: [PATCH] Renamed storage functions to match SDL 3.0 naming convention

---
 include/SDL3/SDL_storage.h        | 76 +++++++++++++++----------------
 src/dynapi/SDL_dynapi.sym         |  6 +--
 src/dynapi/SDL_dynapi_overrides.h |  6 +--
 src/dynapi/SDL_dynapi_procs.h     |  6 +--
 src/storage/SDL_storage.c         |  8 ++--
 5 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/include/SDL3/SDL_storage.h b/include/SDL3/SDL_storage.h
index 963b03deeebe1..b57832cae006c 100644
--- a/include/SDL3/SDL_storage.h
+++ b/include/SDL3/SDL_storage.h
@@ -73,10 +73,10 @@ typedef struct SDL_Storage SDL_Storage;
  * \sa SDL_TitleStorageReady
  * \sa SDL_CloseStorage
  * \sa SDL_StorageReady
- * \sa SDL_StorageFileSize
- * \sa SDL_StorageReadFile
- * \sa SDL_StorageWriteFile
- * \sa SDL_StorageSpaceRemaining
+ * \sa SDL_GetStorageFileSize
+ * \sa SDL_ReadStorageFile
+ * \sa SDL_WriteStorageFile
+ * \sa SDL_GetStorageSpaceRemaining
  */
 extern DECLSPEC SDL_Storage *SDLCALL SDL_OpenTitleStorage(const char *override, SDL_PropertiesID props);
 
@@ -100,10 +100,10 @@ extern DECLSPEC SDL_Storage *SDLCALL SDL_OpenTitleStorage(const char *override,
  * \sa SDL_OpenStorage
  * \sa SDL_CloseStorage
  * \sa SDL_StorageReady
- * \sa SDL_StorageFileSize
- * \sa SDL_StorageReadFile
- * \sa SDL_StorageWriteFile
- * \sa SDL_StorageSpaceRemaining
+ * \sa SDL_GetStorageFileSize
+ * \sa SDL_ReadStorageFile
+ * \sa SDL_WriteStorageFile
+ * \sa SDL_GetStorageSpaceRemaining
  */
 extern DECLSPEC SDL_Storage *SDLCALL SDL_OpenUserStorage(const char *org, const char *app, SDL_PropertiesID props);
 
@@ -126,10 +126,10 @@ extern DECLSPEC SDL_Storage *SDLCALL SDL_OpenUserStorage(const char *org, const
  * \sa SDL_OpenUserStorage
  * \sa SDL_CloseStorage
  * \sa SDL_StorageReady
- * \sa SDL_StorageFileSize
- * \sa SDL_StorageReadFile
- * \sa SDL_StorageWriteFile
- * \sa SDL_StorageSpaceRemaining
+ * \sa SDL_GetStorageFileSize
+ * \sa SDL_ReadStorageFile
+ * \sa SDL_WriteStorageFile
+ * \sa SDL_GetStorageSpaceRemaining
  */
 extern DECLSPEC SDL_Storage *SDLCALL SDL_OpenStorage(const SDL_StorageInterface *iface, void *userdata);
 
@@ -148,10 +148,10 @@ extern DECLSPEC SDL_Storage *SDLCALL SDL_OpenStorage(const SDL_StorageInterface
  * \sa SDL_OpenUserStorage
  * \sa SDL_OpenStorage
  * \sa SDL_StorageReady
- * \sa SDL_StorageFileSize
- * \sa SDL_StorageReadFile
- * \sa SDL_StorageWriteFile
- * \sa SDL_StorageSpaceRemaining
+ * \sa SDL_GetStorageFileSize
+ * \sa SDL_ReadStorageFile
+ * \sa SDL_WriteStorageFile
+ * \sa SDL_GetStorageSpaceRemaining
  */
 extern DECLSPEC int SDLCALL SDL_CloseStorage(SDL_Storage *storage);
 
@@ -171,10 +171,10 @@ extern DECLSPEC int SDLCALL SDL_CloseStorage(SDL_Storage *storage);
  * \sa SDL_OpenUserStorage
  * \sa SDL_OpenStorage
  * \sa SDL_CloseStorage
- * \sa SDL_StorageFileSize
- * \sa SDL_StorageReadFile
- * \sa SDL_StorageWriteFile
- * \sa SDL_StorageSpaceRemaining
+ * \sa SDL_GetStorageFileSize
+ * \sa SDL_ReadStorageFile
+ * \sa SDL_WriteStorageFile
+ * \sa SDL_GetStorageSpaceRemaining
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_StorageReady(SDL_Storage *storage);
 
@@ -194,11 +194,11 @@ extern DECLSPEC SDL_bool SDLCALL SDL_StorageReady(SDL_Storage *storage);
  * \sa SDL_OpenStorage
  * \sa SDL_CloseStorage
  * \sa SDL_StorageReady
- * \sa SDL_StorageReadFile
- * \sa SDL_StorageWriteFile
- * \sa SDL_StorageSpaceRemaining
+ * \sa SDL_ReadStorageFile
+ * \sa SDL_WriteStorageFile
+ * \sa SDL_GetStorageSpaceRemaining
  */
-extern DECLSPEC int SDLCALL SDL_StorageFileSize(SDL_Storage *storage, const char *path, Uint64 *length);
+extern DECLSPEC int SDLCALL SDL_GetStorageFileSize(SDL_Storage *storage, const char *path, Uint64 *length);
 
 /**
  * Synchronously read a file from a storage container into a client-provided
@@ -218,11 +218,11 @@ extern DECLSPEC int SDLCALL SDL_StorageFileSize(SDL_Storage *storage, const char
  * \sa SDL_OpenStorage
  * \sa SDL_CloseStorage
  * \sa SDL_StorageReady
- * \sa SDL_StorageFileSize
- * \sa SDL_StorageWriteFile
- * \sa SDL_StorageSpaceRemaining
+ * \sa SDL_GetStorageFileSize
+ * \sa SDL_WriteStorageFile
+ * \sa SDL_GetStorageSpaceRemaining
  */
-extern DECLSPEC int SDLCALL SDL_StorageReadFile(SDL_Storage *storage, const char *path, void *destination, Uint64 length);
+extern DECLSPEC int SDLCALL SDL_ReadStorageFile(SDL_Storage *storage, const char *path, void *destination, Uint64 length);
 
 /**
  * Synchronously write a file from client memory into a storage container.
@@ -241,11 +241,11 @@ extern DECLSPEC int SDLCALL SDL_StorageReadFile(SDL_Storage *storage, const char
  * \sa SDL_OpenStorage
  * \sa SDL_CloseStorage
  * \sa SDL_StorageReady
- * \sa SDL_StorageFileSize
- * \sa SDL_StorageReadFile
- * \sa SDL_StorageSpaceRemaining
+ * \sa SDL_GetStorageFileSize
+ * \sa SDL_ReadStorageFile
+ * \sa SDL_GetStorageSpaceRemaining
  */
-extern DECLSPEC int SDL_StorageWriteFile(SDL_Storage *storage, const char *path, const void *source, Uint64 length);
+extern DECLSPEC int SDL_WriteStorageFile(SDL_Storage *storage, const char *path, const void *source, Uint64 length);
 
 /**
  * Queries the remaining space in a storage container.
@@ -260,13 +260,13 @@ extern DECLSPEC int SDL_StorageWriteFile(SDL_Storage *storage, const char *path,
  * \sa SDL_OpenStorage
  * \sa SDL_CloseStorage
  * \sa SDL_StorageReady
- * \sa SDL_StorageFileSize
- * \sa SDL_StorageReadFile
- * \sa SDL_StorageReadFileAsync
- * \sa SDL_StorageWriteFile
- * \sa SDL_StorageWriteFileAsync
+ * \sa SDL_GetStorageFileSize
+ * \sa SDL_ReadStorageFile
+ * \sa SDL_ReadStorageFileAsync
+ * \sa SDL_WriteStorageFile
+ * \sa SDL_WriteStorageFileAsync
  */
-extern DECLSPEC Uint64 SDLCALL SDL_StorageSpaceRemaining(SDL_Storage *storage);
+extern DECLSPEC Uint64 SDLCALL SDL_GetStorageSpaceRemaining(SDL_Storage *storage);
 
 /* Ends C function definitions when using C++ */
 #ifdef __cplusplus
diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym
index b623877d81a2d..5ab6162200389 100644
--- a/src/dynapi/SDL_dynapi.sym
+++ b/src/dynapi/SDL_dynapi.sym
@@ -984,9 +984,9 @@ SDL3_0.0.0 {
     SDL_OpenStorage;
     SDL_CloseStorage;
     SDL_StorageReady;
-    SDL_StorageFileSize;
-    SDL_StorageReadFile;
-    SDL_StorageSpaceRemaining;
+    SDL_GetStorageFileSize;
+    SDL_ReadStorageFile;
+    SDL_GetStorageSpaceRemaining;
     # extra symbols go here (don't modify this line)
   local: *;
 };
diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h
index 16eec6028d9c4..9f55177bead48 100644
--- a/src/dynapi/SDL_dynapi_overrides.h
+++ b/src/dynapi/SDL_dynapi_overrides.h
@@ -1009,6 +1009,6 @@
 #define SDL_OpenStorage SDL_OpenStorage_REAL
 #define SDL_CloseStorage SDL_CloseStorage_REAL
 #define SDL_StorageReady SDL_StorageReady_REAL
-#define SDL_StorageFileSize SDL_StorageFileSize_REAL
-#define SDL_StorageReadFile SDL_StorageReadFile_REAL
-#define SDL_StorageSpaceRemaining SDL_StorageSpaceRemaining_REAL
+#define SDL_GetStorageFileSize SDL_GetStorageFileSize_REAL
+#define SDL_ReadStorageFile SDL_ReadStorageFile_REAL
+#define SDL_GetStorageSpaceRemaining SDL_GetStorageSpaceRemaining_REAL
diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h
index 00a2718ff8b50..86263add1f9e8 100644
--- a/src/dynapi/SDL_dynapi_procs.h
+++ b/src/dynapi/SDL_dynapi_procs.h
@@ -1034,6 +1034,6 @@ SDL_DYNAPI_PROC(SDL_Storage*,SDL_OpenUserStorage,(const char *a, const char *b,
 SDL_DYNAPI_PROC(SDL_Storage*,SDL_OpenStorage,(const SDL_StorageInterface *a, void *b),(a,b),return)
 SDL_DYNAPI_PROC(int,SDL_CloseStorage,(SDL_Storage *a),(a),return)
 SDL_DYNAPI_PROC(SDL_bool,SDL_StorageReady,(SDL_Storage *a),(a),return)
-SDL_DYNAPI_PROC(int,SDL_StorageFileSize,(SDL_Storage *a, const char *b, Uint64 *c),(a,b,c),return)
-SDL_DYNAPI_PROC(int,SDL_StorageReadFile,(SDL_Storage *a, const char *b, void *c, Uint64 d),(a,b,c,d),return)
-SDL_DYNAPI_PROC(Uint64,SDL_StorageSpaceRemaining,(SDL_Storage *a),(a),return)
+SDL_DYNAPI_PROC(int,SDL_GetStorageFileSize,(SDL_Storage *a, const char *b, Uint64 *c),(a,b,c),return)
+SDL_DYNAPI_PROC(int,SDL_ReadStorageFile,(SDL_Storage *a, const char *b, void *c, Uint64 d),(a,b,c,d),return)
+SDL_DYNAPI_PROC(Uint64,SDL_GetStorageSpaceRemaining,(SDL_Storage *a),(a),return)
diff --git a/src/storage/SDL_storage.c b/src/storage/SDL_storage.c
index 877db6c7ead62..36671064dd452 100644
--- a/src/storage/SDL_storage.c
+++ b/src/storage/SDL_storage.c
@@ -180,14 +180,14 @@ SDL_bool SDL_StorageReady(SDL_Storage *storage)
     return storage->iface.ready(storage->userdata);
 }
 
-int SDL_StorageFileSize(SDL_Storage *storage, const char *path, Uint64 *length)
+int SDL_GetStorageFileSize(SDL_Storage *storage, const char *path, Uint64 *length)
 {
     CHECK_STORAGE_MAGIC()
 
     return storage->iface.fileSize(storage->userdata, path, length);
 }
 
-int SDL_StorageReadFile(SDL_Storage *storage, const char *path, void *destination, Uint64 length)
+int SDL_ReadStorageFile(SDL_Storage *storage, const char *path, void *destination, Uint64 length)
 {
     CHECK_STORAGE_MAGIC()
 
@@ -198,7 +198,7 @@ int SDL_StorageReadFile(SDL_Storage *storage, const char *path, void *destinatio
     return storage->iface.readFile(storage->userdata, path, destination, length);
 }
 
-int SDL_StorageWriteFile(SDL_Storage *storage, const char *path, const void *source, Uint64 length)
+int SDL_WriteStorageFile(SDL_Storage *storage, const char *path, const void *source, Uint64 length)
 {
     CHECK_STORAGE_MAGIC()
 
@@ -209,7 +209,7 @@ int SDL_StorageWriteFile(SDL_Storage *storage, const char *path, const void *sou
     return storage->iface.writeFile(storage->userdata, path, source, length);
 }
 
-Uint64 SDL_StorageSpaceRemaining(SDL_Storage *storage)
+Uint64 SDL_GetStorageSpaceRemaining(SDL_Storage *storage)
 {
     CHECK_STORAGE_MAGIC_RET(0)