SDL: io: Renamed src/file to src/io

From 4d63a2b882687d2018f9fdbee0a8ac7a8b2639b0 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Thu, 16 Jan 2025 00:56:49 -0500
Subject: [PATCH] io: Renamed src/file to src/io

Fixes #11980.
---
 Android.mk                                    |  4 +--
 CMakeLists.txt                                |  8 ++---
 VisualC-GDK/SDL/SDL.vcxproj                   | 12 ++++----
 VisualC-GDK/SDL/SDL.vcxproj.filters           | 12 ++++----
 VisualC/SDL/SDL.vcxproj                       | 12 ++++----
 VisualC/SDL/SDL.vcxproj.filters               | 30 +++++++++----------
 Xcode/SDL/SDL.xcodeproj/project.pbxproj       |  6 ++--
 src/SDL.c                                     |  2 +-
 src/{file => io}/SDL_asyncio.c                |  0
 src/{file => io}/SDL_asyncio_c.h              |  0
 src/{file => io}/SDL_iostream.c               |  0
 src/{file => io}/SDL_iostream_c.h             |  0
 src/{file => io}/SDL_sysasyncio.h             |  0
 .../generic/SDL_asyncio_generic.c             |  0
 .../io_uring/SDL_asyncio_liburing.c           |  0
 src/{file => io}/n3ds/SDL_iostreamromfs.c     |  0
 src/{file => io}/n3ds/SDL_iostreamromfs.h     |  0
 .../windows/SDL_asyncio_windows_ioring.c      |  0
 src/process/posix/SDL_posixprocess.c          |  2 +-
 src/process/windows/SDL_windowsprocess.c      |  2 +-
 20 files changed, 45 insertions(+), 45 deletions(-)
 rename src/{file => io}/SDL_asyncio.c (100%)
 rename src/{file => io}/SDL_asyncio_c.h (100%)
 rename src/{file => io}/SDL_iostream.c (100%)
 rename src/{file => io}/SDL_iostream_c.h (100%)
 rename src/{file => io}/SDL_sysasyncio.h (100%)
 rename src/{file => io}/generic/SDL_asyncio_generic.c (100%)
 rename src/{file => io}/io_uring/SDL_asyncio_liburing.c (100%)
 rename src/{file => io}/n3ds/SDL_iostreamromfs.c (100%)
 rename src/{file => io}/n3ds/SDL_iostreamromfs.h (100%)
 rename src/{file => io}/windows/SDL_asyncio_windows_ioring.c (100%)

diff --git a/Android.mk b/Android.mk
index 9e79ee0bc9492..b5fe8955f9a1c 100644
--- a/Android.mk
+++ b/Android.mk
@@ -35,8 +35,8 @@ LOCAL_SRC_FILES := \
 	$(LOCAL_PATH)/src/dialog/android/SDL_androiddialog.c \
 	$(wildcard $(LOCAL_PATH)/src/dynapi/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/events/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/file/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/file/generic/*.c) \
+	$(wildcard $(LOCAL_PATH)/src/io/*.c) \
+	$(wildcard $(LOCAL_PATH)/src/io/generic/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/gpu/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/gpu/vulkan/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/haptic/*.c) \
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 129b6267b32d3..eb4fc9574102d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1158,8 +1158,8 @@ sdl_glob_sources(
   "${SDL3_SOURCE_DIR}/src/cpuinfo/*.c"
   "${SDL3_SOURCE_DIR}/src/dynapi/*.c"
   "${SDL3_SOURCE_DIR}/src/events/*.c"
-  "${SDL3_SOURCE_DIR}/src/file/*.c"
-  "${SDL3_SOURCE_DIR}/src/file/generic/*.c"
+  "${SDL3_SOURCE_DIR}/src/io/*.c"
+  "${SDL3_SOURCE_DIR}/src/io/generic/*.c"
   "${SDL3_SOURCE_DIR}/src/filesystem/*.c"
   "${SDL3_SOURCE_DIR}/src/gpu/*.c"
   "${SDL3_SOURCE_DIR}/src/joystick/*.c"
@@ -1774,7 +1774,7 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
     endif()
 
     if(HAVE_LIBURING_H)
-      sdl_sources("${SDL3_SOURCE_DIR}/src/file/io_uring/SDL_asyncio_liburing.c")
+      sdl_sources("${SDL3_SOURCE_DIR}/src/io/io_uring/SDL_asyncio_liburing.c")
     endif()
 
     # Always compiled for Linux, unconditionally:
@@ -2912,7 +2912,7 @@ elseif(N3DS)
   sdl_glob_sources("${SDL3_SOURCE_DIR}/src/locale/n3ds/*.c")
   set(HAVE_SDL_LOCALE TRUE)
 
-  sdl_glob_sources("${SDL3_SOURCE_DIR}/src/file/n3ds/*.c")
+  sdl_glob_sources("${SDL3_SOURCE_DIR}/src/io/n3ds/*.c")
 endif()
 
 sdl_sources(${SDL3_SOURCE_DIR}/src/dialog/SDL_dialog.c)
diff --git a/VisualC-GDK/SDL/SDL.vcxproj b/VisualC-GDK/SDL/SDL.vcxproj
index 2422201d23f56..07a9b3be36f2c 100644
--- a/VisualC-GDK/SDL/SDL.vcxproj
+++ b/VisualC-GDK/SDL/SDL.vcxproj
@@ -441,8 +441,8 @@
     <ClInclude Include="..\..\src\events\SDL_windowevents_c.h" />
     <ClInclude Include="..\..\src\filesystem\SDL_sysfilesystem.h" />
     <ClInclude Include="..\..\src\gpu\SDL_sysgpu.h" />
-    <ClInclude Include="..\..\src\file\SDL_asyncio_c.h" />
-    <ClInclude Include="..\..\src\file\SDL_sysasyncio.h" />
+    <ClInclude Include="..\..\src\io\SDL_asyncio_c.h" />
+    <ClInclude Include="..\..\src\io\SDL_sysasyncio.h" />
     <ClInclude Include="..\..\src\haptic\SDL_haptic_c.h" />
     <ClInclude Include="..\..\src\haptic\SDL_syshaptic.h" />
     <ClInclude Include="..\..\src\haptic\windows\SDL_dinputhaptic_c.h" />
@@ -529,9 +529,9 @@
     <ClCompile Include="..\..\src\dialog\SDL_dialog_utils.c" />
     <ClCompile Include="..\..\src\filesystem\SDL_filesystem.c" />
     <ClCompile Include="..\..\src\filesystem\windows\SDL_sysfsops.c" />
-    <ClCompile Include="..\..\src\file\generic\SDL_asyncio_generic.c" />
-    <ClCompile Include="..\..\src\file\SDL_asyncio.c" />
-    <ClCompile Include="..\..\src\file\windows\SDL_asyncio_windows_ioring.c" />
+    <ClCompile Include="..\..\src\io\generic\SDL_asyncio_generic.c" />
+    <ClCompile Include="..\..\src\io\SDL_asyncio.c" />
+    <ClCompile Include="..\..\src\io\windows\SDL_asyncio_windows_ioring.c" />
     <ClCompile Include="..\..\src\main\gdk\SDL_sysmain_runapp.cpp" />
     <ClCompile Include="..\..\src\main\generic\SDL_sysmain_callbacks.c" />
     <ClCompile Include="..\..\src\main\SDL_main_callbacks.c" />
@@ -673,7 +673,7 @@
     <ClCompile Include="..\..\src\events\SDL_quit.c" />
     <ClCompile Include="..\..\src\events\SDL_touch.c" />
     <ClCompile Include="..\..\src\events\SDL_windowevents.c" />
-    <ClCompile Include="..\..\src\file\SDL_iostream.c" />
+    <ClCompile Include="..\..\src\io\SDL_iostream.c" />
     <ClCompile Include="..\..\src\filesystem\gdk\SDL_sysfilesystem.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">true</ExcludedFromBuild>
diff --git a/VisualC-GDK/SDL/SDL.vcxproj.filters b/VisualC-GDK/SDL/SDL.vcxproj.filters
index 7efaf3abe3fef..247bbdc0b034a 100644
--- a/VisualC-GDK/SDL/SDL.vcxproj.filters
+++ b/VisualC-GDK/SDL/SDL.vcxproj.filters
@@ -45,7 +45,7 @@
     <ClCompile Include="..\..\src\events\SDL_quit.c" />
     <ClCompile Include="..\..\src\events\SDL_touch.c" />
     <ClCompile Include="..\..\src\events\SDL_windowevents.c" />
-    <ClCompile Include="..\..\src\file\SDL_iostream.c" />
+    <ClCompile Include="..\..\src\io\SDL_iostream.c" />
     <ClCompile Include="..\..\src\filesystem\gdk\SDL_sysfilesystem.cpp" />
     <ClCompile Include="..\..\src\gpu\SDL_gpu.c" />
     <ClCompile Include="..\..\src\gpu\d3d12\SDL_gpu_d3d12.c" />
@@ -204,9 +204,9 @@
     <ClCompile Include="..\..\src\dialog\SDL_dialog_utils.c" />
     <ClCompile Include="..\..\src\filesystem\SDL_filesystem.c" />
     <ClCompile Include="..\..\src\filesystem\windows\SDL_sysfsops.c" />
-    <ClCompile Include="..\..\src\file\generic\SDL_asyncio_generic.c" />
-    <ClCompile Include="..\..\src\file\SDL_asyncio.c" />
-    <ClCompile Include="..\..\src\file\windows\SDL_asyncio_windows_ioring.c" />
+    <ClCompile Include="..\..\src\io\generic\SDL_asyncio_generic.c" />
+    <ClCompile Include="..\..\src\io\SDL_asyncio.c" />
+    <ClCompile Include="..\..\src\io\windows\SDL_asyncio_windows_ioring.c" />
     <ClCompile Include="..\..\src\dialog\dummy\SDL_dummydialog.c" />
     <ClCompile Include="..\..\src\dialog\windows\SDL_windowsdialog.c" />
     <ClCompile Include="..\..\src\render\gpu\SDL_pipeline_gpu.c" />
@@ -466,8 +466,8 @@
     <ClInclude Include="..\..\src\camera\SDL_camera_c.h" />
     <ClInclude Include="..\..\src\camera\SDL_syscamera.h" />
     <ClInclude Include="..\..\src\filesystem\SDL_sysfilesystem.h" />
-    <ClInclude Include="..\..\src\file\SDL_asyncio_c.h" />
-    <ClInclude Include="..\..\src\file\SDL_sysasyncio.h" />
+    <ClInclude Include="..\..\src\io\SDL_asyncio_c.h" />
+    <ClInclude Include="..\..\src\io\SDL_sysasyncio.h" />
     <ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_common.h" />
     <ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_internal.h" />
     <ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_lsx.h" />
diff --git a/VisualC/SDL/SDL.vcxproj b/VisualC/SDL/SDL.vcxproj
index 0221a54328aaf..134c730c30f71 100644
--- a/VisualC/SDL/SDL.vcxproj
+++ b/VisualC/SDL/SDL.vcxproj
@@ -356,8 +356,8 @@
     <ClInclude Include="..\..\src\filesystem\SDL_sysfilesystem.h" />
     <ClInclude Include="..\..\src\gpu\SDL_sysgpu.h" />
     <ClInclude Include="..\..\src\gpu\vulkan\SDL_gpu_vulkan_vkfuncs.h" />
-    <ClInclude Include="..\..\src\file\SDL_asyncio_c.h" />
-    <ClInclude Include="..\..\src\file\SDL_sysasyncio.h" />
+    <ClInclude Include="..\..\src\io\SDL_asyncio_c.h" />
+    <ClInclude Include="..\..\src\io\SDL_sysasyncio.h" />
     <ClInclude Include="..\..\src\haptic\SDL_haptic_c.h" />
     <ClInclude Include="..\..\src\haptic\SDL_syshaptic.h" />
     <ClInclude Include="..\..\src\haptic\windows\SDL_dinputhaptic_c.h" />
@@ -419,12 +419,12 @@
     <ClCompile Include="..\..\src\dialog\SDL_dialog_utils.c" />
     <ClCompile Include="..\..\src\filesystem\SDL_filesystem.c" />
     <ClCompile Include="..\..\src\filesystem\windows\SDL_sysfsops.c" />
-    <ClCompile Include="..\..\src\file\windows\SDL_asyncio_windows_ioring.c" />
+    <ClCompile Include="..\..\src\io\windows\SDL_asyncio_windows_ioring.c" />
     <ClCompile Include="..\..\src\gpu\SDL_gpu.c" />
     <ClCompile Include="..\..\src\gpu\d3d12\SDL_gpu_d3d12.c" />
     <ClCompile Include="..\..\src\gpu\vulkan\SDL_gpu_vulkan.c" />
-    <ClCompile Include="..\..\src\file\generic\SDL_asyncio_generic.c" />
-    <ClCompile Include="..\..\src\file\SDL_asyncio.c" />
+    <ClCompile Include="..\..\src\io\generic\SDL_asyncio_generic.c" />
+    <ClCompile Include="..\..\src\io\SDL_asyncio.c" />
     <ClCompile Include="..\..\src\main\generic\SDL_sysmain_callbacks.c" />
     <ClCompile Include="..\..\src\main\SDL_main_callbacks.c" />
     <ClCompile Include="..\..\src\main\SDL_runapp.c" />
@@ -557,7 +557,7 @@
     <ClCompile Include="..\..\src\events\SDL_quit.c" />
     <ClCompile Include="..\..\src\events\SDL_touch.c" />
     <ClCompile Include="..\..\src\events\SDL_windowevents.c" />
-    <ClCompile Include="..\..\src\file\SDL_iostream.c" />
+    <ClCompile Include="..\..\src\io\SDL_iostream.c" />
     <ClCompile Include="..\..\src\filesystem\windows\SDL_sysfilesystem.c" />
     <ClCompile Include="..\..\src\haptic\dummy\SDL_syshaptic.c" />
     <ClCompile Include="..\..\src\haptic\SDL_haptic.c" />
diff --git a/VisualC/SDL/SDL.vcxproj.filters b/VisualC/SDL/SDL.vcxproj.filters
index 111db56c2079e..176bea64c9c7d 100644
--- a/VisualC/SDL/SDL.vcxproj.filters
+++ b/VisualC/SDL/SDL.vcxproj.filters
@@ -25,7 +25,7 @@
     <Filter Include="events">
       <UniqueIdentifier>{5e27e19f-b3f8-4e2d-b323-b00b2040ec86}</UniqueIdentifier>
     </Filter>
-    <Filter Include="file">
+    <Filter Include="io">
       <UniqueIdentifier>{a3ab9cff-8495-4a5c-8af6-27e43199a712}</UniqueIdentifier>
     </Filter>
     <Filter Include="filesystem">
@@ -211,10 +211,10 @@
     <Filter Include="main\windows">
       <UniqueIdentifier>{00009d5ded166cc6c6680ec771a30000}</UniqueIdentifier>
     </Filter>
-    <Filter Include="file\generic">
+    <Filter Include="io\generic">
       <UniqueIdentifier>{00004d6806b6238cae0ed62db5440000}</UniqueIdentifier>
     </Filter>
-    <Filter Include="file\windows">
+    <Filter Include="io\windows">
       <UniqueIdentifier>{000028b2ea36d7190d13777a4dc70000}</UniqueIdentifier>
     </Filter>
   </ItemGroup>
@@ -447,11 +447,11 @@
     <ClInclude Include="..\..\src\filesystem\SDL_sysfilesystem.h">
       <Filter>filesystem</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\src\file\SDL_asyncio_c.h">
-      <Filter>file</Filter>
+    <ClInclude Include="..\..\src\io\SDL_asyncio_c.h">
+      <Filter>io</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\src\file\SDL_sysasyncio.h">
-      <Filter>file</Filter>
+    <ClInclude Include="..\..\src\io\SDL_sysasyncio.h">
+      <Filter>io</Filter>
     </ClInclude>
     <ClInclude Include="..\..\src\main\SDL_main_callbacks.h">
       <Filter>main</Filter>
@@ -965,14 +965,14 @@
     <ClCompile Include="..\..\src\filesystem\windows\SDL_sysfsops.c">
       <Filter>filesystem\windows</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\src\file\generic\SDL_asyncio_generic.c">
-      <Filter>file\generic</Filter>
+    <ClCompile Include="..\..\src\io\generic\SDL_asyncio_generic.c">
+      <Filter>io\generic</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\src\file\SDL_asyncio.c">
-      <Filter>file</Filter>
+    <ClCompile Include="..\..\src\io\SDL_asyncio.c">
+      <Filter>io</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\src\file\windows\SDL_asyncio_windows_ioring.c">
-      <Filter>file\windows</Filter>
+    <ClCompile Include="..\..\src\io\windows\SDL_asyncio_windows_ioring.c">
+      <Filter>io\windows</Filter>
     </ClCompile>
     <ClCompile Include="..\..\src\main\generic\SDL_sysmain_callbacks.c">
       <Filter>main\generic</Filter>
@@ -1085,8 +1085,8 @@
     <ClCompile Include="..\..\src\events\SDL_windowevents.c">
       <Filter>events</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\src\file\SDL_iostream.c">
-      <Filter>file</Filter>
+    <ClCompile Include="..\..\src\io\SDL_iostream.c">
+      <Filter>io</Filter>
     </ClCompile>
     <ClCompile Include="..\..\src\filesystem\windows\SDL_sysfilesystem.c">
       <Filter>filesystem\windows</Filter>
diff --git a/Xcode/SDL/SDL.xcodeproj/project.pbxproj b/Xcode/SDL/SDL.xcodeproj/project.pbxproj
index ffe36a0ec60b6..e1be7863f945d 100644
--- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj
+++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj
@@ -1331,7 +1331,7 @@
 				F37E18542BA50EB40098C111 /* dialog */,
 				A7D8A5D723E2513D00DCD162 /* dynapi */,
 				A7D8A92923E2514000DCD162 /* events */,
-				A7D8A7DA23E2513E00DCD162 /* file */,
+				A7D8A7DA23E2513E00DCD162 /* io */,
 				A7D8A7F623E2513F00DCD162 /* filesystem */,
 				E4F257872C81903800FCEAFC /* gpu */,
 				A7D8A5C223E2513D00DCD162 /* haptic */,
@@ -1918,7 +1918,7 @@
 			path = darwin;
 			sourceTree = "<group>";
 		};
-		A7D8A7DA23E2513E00DCD162 /* file */ = {
+		A7D8A7DA23E2513E00DCD162 /* io */ = {
 			isa = PBXGroup;
 			children = (
 				A7D8A7DB23E2513F00DCD162 /* SDL_iostream.c */,
@@ -1928,7 +1928,7 @@
 				000013C0F2EADC24ADC10000 /* generic */,
 				000064F9A2AAE947C1CD0000 /* windows */,
 			);
-			path = file;
+			path = io;
 			sourceTree = "<group>";
 		};
 		A7D8A7DF23E2513F00DCD162 /* power */ = {
diff --git a/src/SDL.c b/src/SDL.c
index 269a13028c382..90191d1b0c4d6 100644
--- a/src/SDL.c
+++ b/src/SDL.c
@@ -55,7 +55,7 @@
 #include "video/SDL_surface_c.h"
 #include "video/SDL_video_c.h"
 #include "filesystem/SDL_filesystem_c.h"
-#include "file/SDL_asyncio_c.h"
+#include "io/SDL_asyncio_c.h"
 #ifdef SDL_PLATFORM_ANDROID
 #include "core/android/SDL_android.h"
 #endif
diff --git a/src/file/SDL_asyncio.c b/src/io/SDL_asyncio.c
similarity index 100%
rename from src/file/SDL_asyncio.c
rename to src/io/SDL_asyncio.c
diff --git a/src/file/SDL_asyncio_c.h b/src/io/SDL_asyncio_c.h
similarity index 100%
rename from src/file/SDL_asyncio_c.h
rename to src/io/SDL_asyncio_c.h
diff --git a/src/file/SDL_iostream.c b/src/io/SDL_iostream.c
similarity index 100%
rename from src/file/SDL_iostream.c
rename to src/io/SDL_iostream.c
diff --git a/src/file/SDL_iostream_c.h b/src/io/SDL_iostream_c.h
similarity index 100%
rename from src/file/SDL_iostream_c.h
rename to src/io/SDL_iostream_c.h
diff --git a/src/file/SDL_sysasyncio.h b/src/io/SDL_sysasyncio.h
similarity index 100%
rename from src/file/SDL_sysasyncio.h
rename to src/io/SDL_sysasyncio.h
diff --git a/src/file/generic/SDL_asyncio_generic.c b/src/io/generic/SDL_asyncio_generic.c
similarity index 100%
rename from src/file/generic/SDL_asyncio_generic.c
rename to src/io/generic/SDL_asyncio_generic.c
diff --git a/src/file/io_uring/SDL_asyncio_liburing.c b/src/io/io_uring/SDL_asyncio_liburing.c
similarity index 100%
rename from src/file/io_uring/SDL_asyncio_liburing.c
rename to src/io/io_uring/SDL_asyncio_liburing.c
diff --git a/src/file/n3ds/SDL_iostreamromfs.c b/src/io/n3ds/SDL_iostreamromfs.c
similarity index 100%
rename from src/file/n3ds/SDL_iostreamromfs.c
rename to src/io/n3ds/SDL_iostreamromfs.c
diff --git a/src/file/n3ds/SDL_iostreamromfs.h b/src/io/n3ds/SDL_iostreamromfs.h
similarity index 100%
rename from src/file/n3ds/SDL_iostreamromfs.h
rename to src/io/n3ds/SDL_iostreamromfs.h
diff --git a/src/file/windows/SDL_asyncio_windows_ioring.c b/src/io/windows/SDL_asyncio_windows_ioring.c
similarity index 100%
rename from src/file/windows/SDL_asyncio_windows_ioring.c
rename to src/io/windows/SDL_asyncio_windows_ioring.c
diff --git a/src/process/posix/SDL_posixprocess.c b/src/process/posix/SDL_posixprocess.c
index 2964ab537d20a..8dc01603408d8 100644
--- a/src/process/posix/SDL_posixprocess.c
+++ b/src/process/posix/SDL_posixprocess.c
@@ -34,7 +34,7 @@
 #include <sys/wait.h>
 
 #include "../SDL_sysprocess.h"
-#include "../../file/SDL_iostream_c.h"
+#include "../../io/SDL_iostream_c.h"
 
 
 #define READ_END 0
diff --git a/src/process/windows/SDL_windowsprocess.c b/src/process/windows/SDL_windowsprocess.c
index 8c0a0a330c2c5..c1aee5c4ab2cb 100644
--- a/src/process/windows/SDL_windowsprocess.c
+++ b/src/process/windows/SDL_windowsprocess.c
@@ -24,7 +24,7 @@
 
 #include "../../core/windows/SDL_windows.h"
 #include "../SDL_sysprocess.h"
-#include "../../file/SDL_iostream_c.h"
+#include "../../io/SDL_iostream_c.h"
 
 #define READ_END 0
 #define WRITE_END 1