SDL_rtf: Updated for the SDL3 RW -> IO changes

From 4e84119e908eea72e951626cc2df8df4b874efed Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 18 Mar 2024 15:32:33 -0700
Subject: [PATCH] Updated for the SDL3 RW -> IO changes

---
 include/SDL3_rtf/SDL_rtf.h | 10 +++++-----
 src/SDL_rtf.c              | 12 ++++++------
 src/SDL_rtf.sym            |  2 +-
 src/SDL_rtfreadr.c         |  2 +-
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/include/SDL3_rtf/SDL_rtf.h b/include/SDL3_rtf/SDL_rtf.h
index e4c85f6..0b04b4b 100644
--- a/include/SDL3_rtf/SDL_rtf.h
+++ b/include/SDL3_rtf/SDL_rtf.h
@@ -160,24 +160,24 @@ extern DECLSPEC RTF_Context * SDLCALL RTF_CreateContext(SDL_Renderer *renderer,
 extern DECLSPEC int SDLCALL RTF_Load(RTF_Context *ctx, const char *file);
 
 /**
- * Set the text of an RTF context, with data loaded from an SDL_RWops.
+ * Set the text of an RTF context, with data loaded from an SDL_IOStream.
  *
  * This can be called multiple times to change the text displayed.
  *
- * If `freesrc` is non-zero, this function will close/free `src`, whether this
+ * If `closeio` is non-zero, this function will close `src`, whether this
  * function succeeded or not.
  *
  * On failure, call RTF_GetError() to get a human-readable text message
  * corresponding to the error.
  *
  * \param ctx the RTF context to update.
- * \param src the SDL_RWops to load RTF data from.
- * \param freesrc non-zero to close/free `src`, zero to leave open.
+ * \param src the SDL_IOStream to load RTF data from.
+ * \param closeio non-zero to close/free `src`, zero to leave open.
  * \returns 0 on success, -1 on failure.
  *
  * \since This function is available since SDL_rtf 3.0.0.
  */
-extern DECLSPEC int SDLCALL RTF_Load_RW(RTF_Context *ctx, SDL_RWops *src, int freesrc);
+extern DECLSPEC int SDLCALL RTF_Load_IO(RTF_Context *ctx, SDL_IOStream *src, int closeio);
 
 /**
  * Get the title of an RTF document.
diff --git a/src/SDL_rtf.c b/src/SDL_rtf.c
index 0836555..1f8ca3e 100644
--- a/src/SDL_rtf.c
+++ b/src/SDL_rtf.c
@@ -70,7 +70,7 @@ RTF_Context *RTF_CreateContext(SDL_Renderer *renderer, RTF_FontEngine *fontEngin
  * This function returns 0 if it succeeds or -1 if it fails.
  * Use RTF_GetError() to get a text message corresponding to the error.
  */
-int RTF_Load_RW(RTF_Context *ctx, SDL_RWops *src, int freesrc)
+int RTF_Load_IO(RTF_Context *ctx, SDL_IOStream *src, int closeio)
 {
     int retval;
 
@@ -131,19 +131,19 @@ int RTF_Load_RW(RTF_Context *ctx, SDL_RWops *src, int freesrc)
     }
     ctx->stream = NULL;
 
-    if ( freesrc ) {
-        SDL_RWclose(src);
+    if ( closeio ) {
+        SDL_CloseIO(src);
     }
     return(retval);
 }
 int RTF_Load(RTF_Context *ctx, const char *file)
 {
-    SDL_RWops *rw = SDL_RWFromFile(file, "rb");
-    if ( rw == NULL ) {
+    SDL_IOStream *src = SDL_IOFromFile(file, "rb");
+    if ( src == NULL ) {
         /*RTF_SetError(SDL_GetError());*/
         return -1;
     }
-    return RTF_Load_RW(ctx, rw, 1);
+    return RTF_Load_IO(ctx, src, 1);
 }
 
 /* Get the title of an RTF document */
diff --git a/src/SDL_rtf.sym b/src/SDL_rtf.sym
index dc3cdbd..58c47af 100644
--- a/src/SDL_rtf.sym
+++ b/src/SDL_rtf.sym
@@ -8,7 +8,7 @@ SDL3_rtf_0.0.0 {
     RTF_GetTitle;
     RTF_Linked_Version;
     RTF_Load;
-    RTF_Load_RW;
+    RTF_Load_IO;
     RTF_Render;
   local: *;
 };
diff --git a/src/SDL_rtfreadr.c b/src/SDL_rtfreadr.c
index ced4aec..3fbfd64 100644
--- a/src/SDL_rtfreadr.c
+++ b/src/SDL_rtfreadr.c
@@ -107,7 +107,7 @@ int RTF_GetCharacterOffsets(void *fontEngine, void *font,
  */
 int RTF_GetChar(void *stream, unsigned char *c)
 {
-    return ((SDL_RWops *) stream)->read((SDL_RWops *) stream, c, 1);
+    return SDL_ReadIO((SDL_IOStream *)stream, c, 1);
 }
 
 /*