SDL: SDL API renaming: internal functions

From 36d4395c97e73f8a67d8c984830beb609d3c5439 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 27 Dec 2022 15:05:51 -0800
Subject: [PATCH] SDL API renaming: internal functions

---
 src/SDL.c                                     | 108 +++----
 src/SDL_dataqueue.c                           |   6 +-
 src/SDL_dataqueue.h                           |   8 +-
 src/SDL_log.c                                 |   4 +-
 src/SDL_log_c.h                               |   4 +-
 src/audio/SDL_audio.c                         |  24 +-
 src/audio/SDL_audio_c.h                       |  12 +-
 src/audio/SDL_audiocvt.c                      |  40 +--
 src/audio/SDL_wave.c                          |   2 +-
 src/audio/alsa/SDL_alsa_audio.c               |   2 +-
 src/audio/android/SDL_androidaudio.c          |   2 +-
 src/audio/coreaudio/SDL_coreaudio.m           |   2 +-
 src/audio/directsound/SDL_directsound.c       |   2 +-
 src/audio/dsp/SDL_dspaudio.c                  |   4 +-
 src/audio/emscripten/SDL_emscriptenaudio.c    |   2 +-
 src/audio/haiku/SDL_haikuaudio.cc             |   2 +-
 src/audio/n3ds/SDL_n3dsaudio.c                |   4 +-
 src/audio/netbsd/SDL_netbsdaudio.c            |   2 +-
 src/audio/openslES/SDL_openslES.c             |   2 +-
 src/audio/pipewire/SDL_pipewire.c             |   8 +-
 src/audio/pulseaudio/SDL_pulseaudio.c         |   2 +-
 src/audio/sndio/SDL_sndioaudio.c              |   2 +-
 src/audio/vita/SDL_vitaaudio.c                |   2 +-
 src/audio/wasapi/SDL_wasapi.c                 |   2 +-
 src/core/freebsd/SDL_evdev_kbd_freebsd.c      |   2 +-
 src/core/linux/SDL_evdev_kbd.c                |   2 +-
 src/events/SDL_events.c                       |   6 +-
 src/events/SDL_events_c.h                     |   6 +-
 src/events/SDL_keyboard.c                     |   4 +-
 src/events/SDL_keyboard_c.h                   |   4 +-
 src/events/SDL_mouse.c                        |   8 +-
 src/events/SDL_mouse_c.h                      |   4 +-
 src/events/SDL_quit.c                         |   2 +-
 src/events/SDL_touch.c                        |   4 +-
 src/events/SDL_touch_c.h                      |   4 +-
 src/haptic/SDL_haptic.c                       |  10 +-
 src/haptic/SDL_haptic_c.h                     |   4 +-
 src/joystick/SDL_gamepad.c                    | 282 +++++++++---------
 src/joystick/SDL_gamepad_c.h                  |   8 +-
 src/joystick/SDL_gamepad_db.h                 |   2 +-
 src/joystick/SDL_joystick.c                   |  42 +--
 src/joystick/SDL_joystick_c.h                 |  18 +-
 src/joystick/android/SDL_sysjoystick.c        |  26 +-
 src/joystick/apple/SDL_mfijoystick.m          |  36 +--
 src/joystick/bsd/SDL_bsdjoystick.c            |  34 +--
 src/joystick/darwin/SDL_iokitjoystick.c       |   6 +-
 src/joystick/emscripten/SDL_sysjoystick.c     |   4 +-
 src/joystick/haiku/SDL_haikujoystick.cc       |   6 +-
 src/joystick/hidapi/SDL_hidapi_gamecube.c     |   8 +-
 src/joystick/hidapi/SDL_hidapi_luna.c         |  96 +++---
 src/joystick/hidapi/SDL_hidapi_ps3.c          | 132 ++++----
 src/joystick/hidapi/SDL_hidapi_ps4.c          |  62 ++--
 src/joystick/hidapi/SDL_hidapi_ps5.c          | 120 ++++----
 src/joystick/hidapi/SDL_hidapi_shield.c       | 100 +++----
 src/joystick/hidapi/SDL_hidapi_stadia.c       |  46 +--
 src/joystick/hidapi/SDL_hidapi_steam.c        |  48 +--
 src/joystick/hidapi/SDL_hidapi_switch.c       | 248 +++++++--------
 src/joystick/hidapi/SDL_hidapi_wii.c          |  40 +--
 src/joystick/hidapi/SDL_hidapi_xbox360.c      |  42 +--
 src/joystick/hidapi/SDL_hidapi_xbox360w.c     |  50 ++--
 src/joystick/hidapi/SDL_hidapi_xboxone.c      | 152 +++++-----
 src/joystick/linux/SDL_sysjoystick.c          |  28 +-
 src/joystick/n3ds/SDL_sysjoystick.c           |  12 +-
 src/joystick/ps2/SDL_sysjoystick.c            |   4 +-
 src/joystick/psp/SDL_sysjoystick.c            |   6 +-
 src/joystick/virtual/SDL_virtualjoystick.c    |  12 +-
 src/joystick/virtual/SDL_virtualjoystick_c.h  |   6 +-
 src/joystick/vita/SDL_sysjoystick.c           |  14 +-
 src/joystick/windows/SDL_dinputjoystick.c     |  26 +-
 src/joystick/windows/SDL_rawinputjoystick.c   |  48 +--
 .../windows/SDL_windows_gaming_input.c        |   6 +-
 src/joystick/windows/SDL_xinputjoystick.c     |  32 +-
 src/render/SDL_render.c                       |  36 +--
 src/render/SDL_sysrender.h                    |   4 +-
 src/render/software/SDL_render_sw.c           |   8 +-
 src/sensor/SDL_sensor.c                       |  20 +-
 src/sensor/SDL_sensor_c.h                     |   6 +-
 src/sensor/SDL_syssensor.h                    |   2 +-
 src/sensor/android/SDL_androidsensor.c        |   2 +-
 src/sensor/coremotion/SDL_coremotionsensor.m  |   4 +-
 src/sensor/n3ds/SDL_n3dssensor.c              |   4 +-
 src/sensor/vita/SDL_vitasensor.c              |   4 +-
 src/sensor/windows/SDL_windowssensor.c        |   4 +-
 src/stdlib/SDL_string.c                       |   4 +-
 src/timer/SDL_timer.c                         |  20 +-
 src/timer/SDL_timer_c.h                       |   8 +-
 src/video/SDL_surface.c                       |  10 +-
 src/video/SDL_video.c                         |  54 ++--
 src/video/wayland/SDL_waylandwindow.c         |   8 +-
 src/video/x11/SDL_x11mouse.c                  |   8 +-
 src/video/x11/SDL_x11touch.c                  |   2 +-
 src/video/x11/SDL_x11window.c                 |  12 +-
 92 files changed, 1165 insertions(+), 1165 deletions(-)

diff --git a/src/SDL.c b/src/SDL.c
index 42a8ea273d7b..006e840149c5 100644
--- a/src/SDL.c
+++ b/src/SDL.c
@@ -112,7 +112,7 @@ static SDL_bool SDL_bInMainQuit = SDL_FALSE;
 static Uint8 SDL_SubsystemRefCount[32];
 
 /* Private helper to increment a subsystem's ref counter. */
-static void SDL_PrivateSubsystemRefCountIncr(Uint32 subsystem)
+static void SDL_IncrementSubsystemRefCount(Uint32 subsystem)
 {
     const int subsystem_index = SDL_MostSignificantBitIndex32(subsystem);
     SDL_assert((subsystem_index < 0) || (SDL_SubsystemRefCount[subsystem_index] < 255));
@@ -122,7 +122,7 @@ static void SDL_PrivateSubsystemRefCountIncr(Uint32 subsystem)
 }
 
 /* Private helper to decrement a subsystem's ref counter. */
-static void SDL_PrivateSubsystemRefCountDecr(Uint32 subsystem)
+static void SDL_DecrementSubsystemRefCount(Uint32 subsystem)
 {
     const int subsystem_index = SDL_MostSignificantBitIndex32(subsystem);
     if ((subsystem_index >= 0) && (SDL_SubsystemRefCount[subsystem_index] > 0)) {
@@ -131,7 +131,7 @@ static void SDL_PrivateSubsystemRefCountDecr(Uint32 subsystem)
 }
 
 /* Private helper to check if a system needs init. */
-static SDL_bool SDL_PrivateShouldInitSubsystem(Uint32 subsystem)
+static SDL_bool SDL_ShouldInitSubsystem(Uint32 subsystem)
 {
     const int subsystem_index = SDL_MostSignificantBitIndex32(subsystem);
     SDL_assert((subsystem_index < 0) || (SDL_SubsystemRefCount[subsystem_index] < 255));
@@ -139,7 +139,7 @@ static SDL_bool SDL_PrivateShouldInitSubsystem(Uint32 subsystem)
 }
 
 /* Private helper to check if a system needs to be quit. */
-static SDL_bool SDL_PrivateShouldQuitSubsystem(Uint32 subsystem)
+static SDL_bool SDL_ShouldQuitSubsystem(Uint32 subsystem)
 {
     const int subsystem_index = SDL_MostSignificantBitIndex32(subsystem);
     if ((subsystem_index >= 0) && (SDL_SubsystemRefCount[subsystem_index] == 0)) {
@@ -165,7 +165,7 @@ int SDL_InitSubSystem(Uint32 flags)
         return SDL_SetError("Application didn't initialize properly, did you include SDL_main.h in the file containing your main() function?");
     }
 
-    SDL_LogInit();
+    SDL_InitLog();
 
     /* Clear the error message */
     SDL_ClearError();
@@ -193,18 +193,18 @@ int SDL_InitSubSystem(Uint32 flags)
 #endif
 
 #if !SDL_TIMERS_DISABLED
-    SDL_TicksInit();
+    SDL_InitTicks();
 #endif
 
     /* Initialize the event subsystem */
     if ((flags & SDL_INIT_EVENTS)) {
 #if !SDL_EVENTS_DISABLED
-        if (SDL_PrivateShouldInitSubsystem(SDL_INIT_EVENTS)) {
-            if (SDL_EventsInit() < 0) {
+        if (SDL_ShouldInitSubsystem(SDL_INIT_EVENTS)) {
+            if (SDL_InitEvents() < 0) {
                 goto quit_and_error;
             }
         }
-        SDL_PrivateSubsystemRefCountIncr(SDL_INIT_EVENTS);
+        SDL_IncrementSubsystemRefCount(SDL_INIT_EVENTS);
         flags_initialized |= SDL_INIT_EVENTS;
 #else
         SDL_SetError("SDL not built with events support");
@@ -215,12 +215,12 @@ int SDL_InitSubSystem(Uint32 flags)
     /* Initialize the timer subsystem */
     if ((flags & SDL_INIT_TIMER)) {
 #if !SDL_TIMERS_DISABLED && !SDL_TIMER_DUMMY
-        if (SDL_PrivateShouldInitSubsystem(SDL_INIT_TIMER)) {
-            if (SDL_TimerInit() < 0) {
+        if (SDL_ShouldInitSubsystem(SDL_INIT_TIMER)) {
+            if (SDL_InitTimers() < 0) {
                 goto quit_and_error;
             }
         }
-        SDL_PrivateSubsystemRefCountIncr(SDL_INIT_TIMER);
+        SDL_IncrementSubsystemRefCount(SDL_INIT_TIMER);
         flags_initialized |= SDL_INIT_TIMER;
 #else
         SDL_SetError("SDL not built with timer support");
@@ -231,12 +231,12 @@ int SDL_InitSubSystem(Uint32 flags)
     /* Initialize the video subsystem */
     if ((flags & SDL_INIT_VIDEO)) {
 #if !SDL_VIDEO_DISABLED
-        if (SDL_PrivateShouldInitSubsystem(SDL_INIT_VIDEO)) {
+        if (SDL_ShouldInitSubsystem(SDL_INIT_VIDEO)) {
             if (SDL_VideoInit(NULL) < 0) {
                 goto quit_and_error;
             }
         }
-        SDL_PrivateSubsystemRefCountIncr(SDL_INIT_VIDEO);
+        SDL_IncrementSubsystemRefCount(SDL_INIT_VIDEO);
         flags_initialized |= SDL_INIT_VIDEO;
 #else
         SDL_SetError("SDL not built with video support");
@@ -247,12 +247,12 @@ int SDL_InitSubSystem(Uint32 flags)
     /* Initialize the audio subsystem */
     if ((flags & SDL_INIT_AUDIO)) {
 #if !SDL_AUDIO_DISABLED
-        if (SDL_PrivateShouldInitSubsystem(SDL_INIT_AUDIO)) {
-            if (SDL_AudioInit(NULL) < 0) {
+        if (SDL_ShouldInitSubsystem(SDL_INIT_AUDIO)) {
+            if (SDL_InitAudio(NULL) < 0) {
                 goto quit_and_error;
             }
         }
-        SDL_PrivateSubsystemRefCountIncr(SDL_INIT_AUDIO);
+        SDL_IncrementSubsystemRefCount(SDL_INIT_AUDIO);
         flags_initialized |= SDL_INIT_AUDIO;
 #else
         SDL_SetError("SDL not built with audio support");
@@ -263,12 +263,12 @@ int SDL_InitSubSystem(Uint32 flags)
     /* Initialize the joystick subsystem */
     if ((flags & SDL_INIT_JOYSTICK)) {
 #if !SDL_JOYSTICK_DISABLED
-        if (SDL_PrivateShouldInitSubsystem(SDL_INIT_JOYSTICK)) {
-            if (SDL_JoystickInit() < 0) {
+        if (SDL_ShouldInitSubsystem(SDL_INIT_JOYSTICK)) {
+            if (SDL_InitJoysticks() < 0) {
                 goto quit_and_error;
             }
         }
-        SDL_PrivateSubsystemRefCountIncr(SDL_INIT_JOYSTICK);
+        SDL_IncrementSubsystemRefCount(SDL_INIT_JOYSTICK);
         flags_initialized |= SDL_INIT_JOYSTICK;
 #else
         SDL_SetError("SDL not built with joystick support");
@@ -278,12 +278,12 @@ int SDL_InitSubSystem(Uint32 flags)
 
     if ((flags & SDL_INIT_GAMEPAD)) {
 #if !SDL_JOYSTICK_DISABLED
-        if (SDL_PrivateShouldInitSubsystem(SDL_INIT_GAMEPAD)) {
-            if (SDL_GamepadInit() < 0) {
+        if (SDL_ShouldInitSubsystem(SDL_INIT_GAMEPAD)) {
+            if (SDL_InitGamepads() < 0) {
                 goto quit_and_error;
             }
         }
-        SDL_PrivateSubsystemRefCountIncr(SDL_INIT_GAMEPAD);
+        SDL_IncrementSubsystemRefCount(SDL_INIT_GAMEPAD);
         flags_initialized |= SDL_INIT_GAMEPAD;
 #else
         SDL_SetError("SDL not built with joystick support");
@@ -294,12 +294,12 @@ int SDL_InitSubSystem(Uint32 flags)
     /* Initialize the haptic subsystem */
     if ((flags & SDL_INIT_HAPTIC)) {
 #if !SDL_HAPTIC_DISABLED
-        if (SDL_PrivateShouldInitSubsystem(SDL_INIT_HAPTIC)) {
-            if (SDL_HapticInit() < 0) {
+        if (SDL_ShouldInitSubsystem(SDL_INIT_HAPTIC)) {
+            if (SDL_InitHaptics() < 0) {
                 goto quit_and_error;
             }
         }
-        SDL_PrivateSubsystemRefCountIncr(SDL_INIT_HAPTIC);
+        SDL_IncrementSubsystemRefCount(SDL_INIT_HAPTIC);
         flags_initialized |= SDL_INIT_HAPTIC;
 #else
         SDL_SetError("SDL not built with haptic (force feedback) support");
@@ -310,12 +310,12 @@ int SDL_InitSubSystem(Uint32 flags)
     /* Initialize the sensor subsystem */
     if ((flags & SDL_INIT_SENSOR)) {
 #if !SDL_SENSOR_DISABLED
-        if (SDL_PrivateShouldInitSubsystem(SDL_INIT_SENSOR)) {
-            if (SDL_SensorInit() < 0) {
+        if (SDL_ShouldInitSubsystem(SDL_INIT_SENSOR)) {
+            if (SDL_InitSensors() < 0) {
                 goto quit_and_error;
             }
         }
-        SDL_PrivateSubsystemRefCountIncr(SDL_INIT_SENSOR);
+        SDL_IncrementSubsystemRefCount(SDL_INIT_SENSOR);
         flags_initialized |= SDL_INIT_SENSOR;
 #else
         SDL_SetError("SDL not built with sensor support");
@@ -342,10 +342,10 @@ void SDL_QuitSubSystem(Uint32 flags)
     /* Shut down requested initialized subsystems */
 #if !SDL_SENSOR_DISABLED
     if ((flags & SDL_INIT_SENSOR)) {
-        if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_SENSOR)) {
-            SDL_SensorQuit();
+        if (SDL_ShouldQuitSubsystem(SDL_INIT_SENSOR)) {
+            SDL_QuitSensors();
         }
-        SDL_PrivateSubsystemRefCountDecr(SDL_INIT_SENSOR);
+        SDL_DecrementSubsystemRefCount(SDL_INIT_SENSOR);
     }
 #endif
 
@@ -354,29 +354,29 @@ void SDL_QuitSubSystem(Uint32 flags)
         /* game controller implies joystick */
         flags |= SDL_INIT_JOYSTICK;
 
-        if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_GAMEPAD)) {
-            SDL_GamepadQuit();
+        if (SDL_ShouldQuitSubsystem(SDL_INIT_GAMEPAD)) {
+            SDL_QuitGamepads();
         }
-        SDL_PrivateSubsystemRefCountDecr(SDL_INIT_GAMEPAD);
+        SDL_DecrementSubsystemRefCount(SDL_INIT_GAMEPAD);
     }
 
     if ((flags & SDL_INIT_JOYSTICK)) {
         /* joystick implies events */
         flags |= SDL_INIT_EVENTS;
 
-        if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_JOYSTICK)) {
-            SDL_JoystickQuit();
+        if (SDL_ShouldQuitSubsystem(SDL_INIT_JOYSTICK)) {
+            SDL_QuitJoysticks();
         }
-        SDL_PrivateSubsystemRefCountDecr(SDL_INIT_JOYSTICK);
+        SDL_DecrementSubsystemRefCount(SDL_INIT_JOYSTICK);
     }
 #endif
 
 #if !SDL_HAPTIC_DISABLED
     if ((flags & SDL_INIT_HAPTIC)) {
-        if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_HAPTIC)) {
-            SDL_HapticQuit();
+        if (SDL_ShouldQuitSubsystem(SDL_INIT_HAPTIC)) {
+            SDL_QuitHaptics();
         }
-        SDL_PrivateSubsystemRefCountDecr(SDL_INIT_HAPTIC);
+        SDL_DecrementSubsystemRefCount(SDL_INIT_HAPTIC);
     }
 #endif
 
@@ -385,10 +385,10 @@ void SDL_QuitSubSystem(Uint32 flags)
         /* audio implies events */
         flags |= SDL_INIT_EVENTS;
 
-        if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_AUDIO)) {
-            SDL_AudioQuit();
+        if (SDL_ShouldQuitSubsystem(SDL_INIT_AUDIO)) {
+            SDL_QuitAudio();
         }
-        SDL_PrivateSubsystemRefCountDecr(SDL_INIT_AUDIO);
+        SDL_DecrementSubsystemRefCount(SDL_INIT_AUDIO);
     }
 #endif
 
@@ -397,28 +397,28 @@ void SDL_QuitSubSystem(Uint32 flags)
         /* video implies events */
         flags |= SDL_INIT_EVENTS;
 
-        if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_VIDEO)) {
+        if (SDL_ShouldQuitSubsystem(SDL_INIT_VIDEO)) {
             SDL_VideoQuit();
         }
-        SDL_PrivateSubsystemRefCountDecr(SDL_INIT_VIDEO);
+        SDL_DecrementSubsystemRefCount(SDL_INIT_VIDEO);
     }
 #endif
 
 #if !SDL_TIMERS_DISABLED && !SDL_TIMER_DUMMY
     if ((flags & SDL_INIT_TIMER)) {
-        if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_TIMER)) {
-            SDL_TimerQuit();
+        if (SDL_ShouldQuitSubsystem(SDL_INIT_TIMER)) {
+            SDL_QuitTimers();
         }
-        SDL_PrivateSubsystemRefCountDecr(SDL_INIT_TIMER);
+        SDL_DecrementSubsystemRefCount(SDL_INIT_TIMER);
     }
 #endif
 
 #if !SDL_EVENTS_DISABLED
     if ((flags & SDL_INIT_EVENTS)) {
-        if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_EVENTS)) {
-            SDL_EventsQuit();
+        if (SDL_ShouldQuitSubsystem(SDL_INIT_EVENTS)) {
+            SDL_QuitEvents();
         }
-        SDL_PrivateSubsystemRefCountDecr(SDL_INIT_EVENTS);
+        SDL_DecrementSubsystemRefCount(SDL_INIT_EVENTS);
     }
 #endif
 }
@@ -465,7 +465,7 @@ void SDL_Quit(void)
     SDL_QuitSubSystem(SDL_INIT_EVERYTHING);
 
 #if !SDL_TIMERS_DISABLED
-    SDL_TicksQuit();
+    SDL_QuitTicks();
 #endif
 
     SDL_ClearHints();
@@ -475,7 +475,7 @@ void SDL_Quit(void)
     SDL_DBus_Quit();
 #endif
 
-    SDL_LogQuit();
+    SDL_QuitLog();
 
     /* Now that every subsystem has been quit, we reset the subsystem refcount
      * and the list of initialized subsystems.
diff --git a/src/SDL_dataqueue.c b/src/SDL_dataqueue.c
index eb36cd243eca..dbac0a5b25ea 100644
--- a/src/SDL_dataqueue.c
+++ b/src/SDL_dataqueue.c
@@ -51,7 +51,7 @@ static void SDL_FreeDataQueueList(SDL_DataQueuePacket *packet)
 /* this all expects that you managed thread safety elsewhere. */
 
 SDL_DataQueue *
-SDL_NewDataQueue(const size_t _packetlen, const size_t initialslack)
+SDL_CreateDataQueue(const size_t _packetlen, const size_t initialslack)
 {
     SDL_DataQueue *queue = (SDL_DataQueue *)SDL_malloc(sizeof(SDL_DataQueue));
 
@@ -80,7 +80,7 @@ SDL_NewDataQueue(const size_t _packetlen, const size_t initialslack)
     return queue;
 }
 
-void SDL_FreeDataQueue(SDL_DataQueue *queue)
+void SDL_DestroyDataQueue(SDL_DataQueue *queue)
 {
     if (queue) {
         SDL_FreeDataQueueList(queue->head);
@@ -282,7 +282,7 @@ SDL_ReadFromDataQueue(SDL_DataQueue *queue, void *_buf, const size_t _len)
 }
 
 size_t
-SDL_CountDataQueue(SDL_DataQueue *queue)
+SDL_GetDataQueueSize(SDL_DataQueue *queue)
 {
     return queue ? queue->queued_bytes : 0;
 }
diff --git a/src/SDL_dataqueue.h b/src/SDL_dataqueue.h
index 9e8a53698133..96fb2d1f4e3c 100644
--- a/src/SDL_dataqueue.h
+++ b/src/SDL_dataqueue.h
@@ -26,13 +26,13 @@
 struct SDL_DataQueue;
 typedef struct SDL_DataQueue SDL_DataQueue;
 
-SDL_DataQueue *SDL_NewDataQueue(const size_t packetlen, const size_t initialslack);
-void SDL_FreeDataQueue(SDL_DataQueue *queue);
+SDL_DataQueue *SDL_CreateDataQueue(const size_t packetlen, const size_t initialslack);
+void SDL_DestroyDataQueue(SDL_DataQueue *queue);
 void SDL_ClearDataQueue(SDL_DataQueue *queue, const size_t slack);
 int SDL_WriteToDataQueue(SDL_DataQueue *queue, const void *data, const size_t len);
 size_t SDL_ReadFromDataQueue(SDL_DataQueue *queue, void *buf, const size_t len);
 size_t SDL_PeekIntoDataQueue(SDL_DataQueue *queue, void *buf, const size_t len);
-size_t SDL_CountDataQueue(SDL_DataQueue *queue);
+size_t SDL_GetDataQueueSize(SDL_DataQueue *queue);
 
 /* this sets a section of the data queue aside (possibly allocating memory for it)
    as if it's been written to, but returns a pointer to that space. You may write
@@ -41,7 +41,7 @@ size_t SDL_CountDataQueue(SDL_DataQueue *queue);
    be in flight at the same time. There is no thread safety.
    If there isn't an existing block of memory that can contain the reserved
    space, one will be allocated for it. You can not (currently) allocate
-   a space larger than the packetlen requested in SDL_NewDataQueue.
+   a space larger than the packetlen requested in SDL_CreateDataQueue.
    Returned buffer is uninitialized.
    This lets you avoid an extra copy in some cases, but it's safer to use
    SDL_WriteToDataQueue() unless you know what you're doing.
diff --git a/src/SDL_log.c b/src/SDL_log.c
index 31a129833b83..c4081ecd7779 100644
--- a/src/SDL_log.c
+++ b/src/SDL_log.c
@@ -101,7 +101,7 @@ static int SDL_android_priority[SDL_NUM_LOG_PRIORITIES] = {
 };
 #endif /* __ANDROID__ */
 
-void SDL_LogInit(void)
+void SDL_InitLog(void)
 {
     if (log_function_mutex == NULL) {
         /* if this fails we'll try to continue without it. */
@@ -109,7 +109,7 @@ void SDL_LogInit(void)
     }
 }
 
-void SDL_LogQuit(void)
+void SDL_QuitLog(void)
 {
     SDL_LogResetPriorities();
     if (log_function_mutex) {
diff --git a/src/SDL_log_c.h b/src/SDL_log_c.h
index 65f5df19286d..be07d69f3525 100644
--- a/src/SDL_log_c.h
+++ b/src/SDL_log_c.h
@@ -25,7 +25,7 @@
 #ifndef SDL_log_c_h_
 #define SDL_log_c_h_
 
-extern void SDL_LogInit(void);
-extern void SDL_LogQuit(void);
+extern void SDL_InitLog(void);
+extern void SDL_QuitLog(void);
 
 #endif /* SDL_log_c_h_ */
diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c
index 91f8bb4fa631..880975eee77b 100644
--- a/src/audio/SDL_audio.c
+++ b/src/audio/SDL_audio.c
@@ -527,7 +527,7 @@ static void SDLCALL SDL_BufferQueueDrainCallback(void *userdata, Uint8 *stream,
     len -= (int)dequeued;
 
     if (len > 0) { /* fill any remaining space in the stream with silence. */
-        SDL_assert(SDL_CountDataQueue(device->buffer_queue) == 0);
+        SDL_assert(SDL_GetDataQueueSize(device->buffer_queue) == 0);
         SDL_memset(stream, device->callbackspec.silence, len);
     }
 }
@@ -602,7 +602,7 @@ SDL_GetQueuedAudioSize(SDL_AudioDeviceID devid)
     if (device->callbackspec.callback == SDL_BufferQueueDrainCallback ||
         device->callbackspec.callback == SDL_BufferQueueFillCallback) {
         current_audio.impl.LockDevice(device);
-        retval = (Uint32)SDL_CountDataQueue(device->buffer_queue);
+        retval = (Uint32)SDL_GetDataQueueSize(device->buffer_queue);
         current_audio.impl.UnlockDevice(device);
     }
 
@@ -879,13 +879,13 @@ SDL_GetAudioDriver(int index)
     return NULL;
 }
 
-int SDL_AudioInit(const char *driver_name)
+int SDL_InitAudio(const char *driver_name)
 {
     int i;
     SDL_bool initialized = SDL_FALSE, tried_to_init = SDL_FALSE;
 
     if (SDL_GetCurrentAudioDriver()) {
-        SDL_AudioQuit(); /* shutdown driver if already running. */
+        SDL_QuitAudio(); /* shutdown driver if already running. */
     }
 
     SDL_zeroa(open_devices);
@@ -1152,7 +1152,7 @@ static void close_audio_device(SDL_AudioDevice *device)
         current_audio.impl.CloseDevice(device);
     }
 
-    SDL_FreeDataQueue(device->buffer_queue);
+    SDL_DestroyDataQueue(device->buffer_queue);
 
     SDL_free(device);
 }
@@ -1441,7 +1441,7 @@ static SDL_AudioDeviceID open_audio_device(const char *devname, int iscapture,
 
     if (device->spec.callback == NULL) { /* use buffer queueing? */
         /* pool a few packets to start. Enough for two callbacks. */
-        device->buffer_queue = SDL_NewDataQueue(SDL_AUDIOBUFFERQUEUE_PACKETLEN, obtained->size * 2);
+        device->buffer_queue = SDL_CreateDataQueue(SDL_AUDIOBUFFERQUEUE_PACKETLEN, obtained->size * 2);
         if (!device->buffer_queue) {
             close_audio_device(device);
             SDL_UnlockMutex(current_audio.detectionLock);
@@ -1609,7 +1609,7 @@ void SDL_CloseAudio(void)
     SDL_CloseAudioDevice(1);
 }
 
-void SDL_AudioQuit(void)
+void SDL_QuitAudio(void)
 {
     SDL_AudioDeviceID i;
 
@@ -1664,7 +1664,7 @@ static SDL_AudioFormat format_list[NUM_FORMATS][NUM_FORMATS] = {
 };
 
 SDL_AudioFormat
-SDL_FirstAudioFormat(SDL_AudioFormat format)
+SDL_GetFirstAudioFormat(SDL_AudioFormat format)
 {
     for (format_idx = 0; format_idx < NUM_FORMATS; ++format_idx) {
         if (format_list[format_idx][0] == format) {
@@ -1672,11 +1672,11 @@ SDL_FirstAudioFormat(SDL_AudioFormat format)
         }
     }
     format_idx_sub = 0;
-    return SDL_NextAudioFormat();
+    return SDL_GetNextAudioFormat();
 }
 
 SDL_AudioFormat
-SDL_NextAudioFormat(void)
+SDL_GetNextAudioFormat(void)
 {
     if ((format_idx == NUM_FORMATS) || (format_idx_sub == NUM_FORMATS)) {
         return 0;
@@ -1684,7 +1684,7 @@ SDL_NextAudioFormat(void)
     return format_list[format_idx][format_idx_sub++];
 }
 
-Uint8 SDL_SilenceValueForFormat(const SDL_AudioFormat format)
+Uint8 SDL_GetSilenceValueForFormat(const SDL_AudioFormat format)
 {
     switch (format) {
     /* !!! FIXME: 0x80 isn't perfect for U16, but we can't fit 0x8000 in a
@@ -1704,7 +1704,7 @@ Uint8 SDL_SilenceValueForFormat(const SDL_AudioFormat format)
 
 void SDL_CalculateAudioSpec(SDL_AudioSpec *spec)
 {
-    spec->silence = SDL_SilenceValueForFormat(spec->format);
+    spec->silence = SDL_GetSilenceValueForFormat(spec->format);
     spec->size = SDL_AUDIO_BITSIZE(spec->format) / 8;
     spec->size *= spec->channels;
     spec->size *= spec->samples;
diff --git a/src/audio/SDL_audio_c.h b/src/audio/SDL_audio_c.h
index 2af78384ef13..217b3ffe7c96 100644
--- a/src/audio/SDL_audio_c.h
+++ b/src/audio/SDL_audio_c.h
@@ -49,11 +49,11 @@ extern int (*SRC_src_simple)(SRC_DATA *data, int converter_type, int channels);
 #endif
 
 /* Functions to get a list of "close" audio formats */
-extern SDL_AudioFormat SDL_FirstAudioFormat(SDL_AudioFormat format);
-extern SDL_AudioFormat SDL_NextAudioFormat(void);
+extern SDL_AudioFormat SDL_GetFirstAudioFormat(SDL_AudioFormat format);
+extern SDL_AudioFormat SDL_GetNextAudioFormat(void);
 
 /* Function to calculate the size and silence for a SDL_AudioSpec */
-extern Uint8 SDL_SilenceValueForFormat(const SDL_AudioFormat format);
+extern Uint8 SDL_GetSilenceValueForFormat(const SDL_AudioFormat format);
 extern void SDL_CalculateAudioSpec(SDL_AudioSpec *spec);
 
 /* Choose the audio filter functions below */
@@ -82,15 +82,15 @@ extern SDL_AudioFilter SDL_Convert_F32_to_S32;
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  */
-extern int SDL_AudioInit(const char *driver_name);
+extern int SDL_InitAudio(const char *driver_name);
 
 /**
- * Use this function to shut down audio if you initialized it with SDL_AudioInit().
+ * Use this function to shut down audio if you initialized it with SDL_InitAudio().
  *
  * This function is used internally, and should not be used unless you have a
  * specific need to specify the audio driver you want to use. You should
  * normally use SDL_Quit() or SDL_QuitSubSystem().
  */
-extern void SDL_AudioQuit(void);
+extern void SDL_QuitAudio(void);
 
 #endif /* SDL_audio_c_h_ */
diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c
index 4bfece365468..630897fd012a 100644
--- a/src/audio/SDL_audiocvt.c
+++ b/src/audio/SDL_audiocvt.c
@@ -178,7 +178,7 @@ static void SDLCALL SDL_ConvertMonoToStereo_SSE(SDL_AudioCVT *cvt, SDL_AudioForm
 
 #include "SDL_audio_resampler_filter.h"
 
-static int ResamplerPadding(const int inrate, const int outrate)
+static int GetResamplerPadding(const int inrate, const int outrate)
 {
     if (inrate == outrate) {
         return 0;
@@ -202,7 +202,7 @@ static int SDL_ResampleAudio(const int chans, const int inrate, const int outrat
 
     const ResampleFloatType finrate = (ResampleFloatType)inrate;
     const ResampleFloatType ratio = ((float)outrate) / ((float)inrate);
-    const int paddinglen = ResamplerPadding(inrate, outrate);
+    const int paddinglen = GetResamplerPadding(inrate, outrate);
     const int framelen = chans * (int)sizeof(float);
     const int inframes = inbuflen / framelen;
     const int wantedoutframes = (int)(inframes * ratio); /* outbuflen isn't total to write, it's total available. */
@@ -495,7 +495,7 @@ static void SDL_ResampleCVT(SDL_AudioCVT *cvt, const int chans, const SDL_AudioF
     /* !!! FIXME: remove this if we can get the resampler to work in-place again. */
     float *dst = (float *)(cvt->buf + srclen);
     const int dstlen = (cvt->len * cvt->len_mult) - srclen;
-    const int requestedpadding = ResamplerPadding(inrate, outrate);
+    const int requestedpadding = GetResamplerPadding(inrate, outrate);
     int paddingsamples;
     float *padding;
 
@@ -639,7 +639,7 @@ static int SDL_BuildAudioResampleCVT(SDL_AudioCVT *cvt, const int dst_channels,
     return 1; /* added a converter. */
 }
 
-static SDL_bool SDL_SupportedAudioFormat(const SDL_AudioFormat fmt)
+static SDL_bool SDL_IsSupportedAudioFormat(const SDL_AudioFormat fmt)
 {
     switch (fmt) {
     case AUDIO_U8:
@@ -661,7 +661,7 @@ static SDL_bool SDL_SupportedAudioFormat(const SDL_AudioFormat fmt)
     return SDL_FALSE; /* unsupported. */
 }
 
-static SDL_bool SDL_SupportedChannelCount(const int channels)
+static SDL_bool SDL_IsSupportedChannelCount(const int channels)
 {
     return ((channels >= 1) && (channels <= 8)) ? SDL_TRUE : SDL_FALSE;
 }
@@ -685,16 +685,16 @@ int SDL_BuildAudioCVT(SDL_AudioCVT *cvt,
     /* Make sure we zero out the audio conversion before error checking */
     SDL_zerop(cvt);
 
-    if (!SDL_SupportedAudioFormat(src_format)) {
+    if (!SDL_IsSupportedAudioFormat(src_format)) {
         return SDL_SetError("Invalid source format");
     }
-    if (!SDL_SupportedAudioFormat(dst_format)) {
+    if (!SDL_IsSupportedAudioFormat(dst_format)) {
         return SDL_SetError("Invalid destination format");
     }
-    if (!SDL_SupportedChannelCount(src_channels)) {
+    if (!SDL_IsSupportedChannelCount(src_channels)) {
         return SDL_SetError("Invalid source channels");
     }
-    if (!SDL_SupportedChannelCount(dst_channels)) {
+    if (!SDL_IsSupportedChannelCount(dst_channels)) {
         return SDL_SetError("Invalid destination channels");
     }
     if (src_rate <= 0) {
@@ -768,7 +768,7 @@ int SDL_BuildAudioCVT(SDL_AudioCVT *cvt,
 
     /* Channel conversion */
 
-    /* SDL_SupportedChannelCount should have caught these asserts, or we added a new format and forgot to update the table. */
+    /* SDL_IsSupportedChannelCount should have caught these asserts, or we added a new format and forgot to update the table. */
     SDL_assert(src_channels <= SDL_arraysize(channel_converters));
     SDL_assert(dst_channels <= SDL_arraysize(channel_converters[0]));
 
@@ -1032,7 +1032,7 @@ SDL_CreateAudioStream(SDL_AudioFormat src_format,
     retval->pre_resample_channels = pre_resample_channels;
     retval->packetlen = packetlen;
     retval->rate_incr = ((double)dst_rate) / ((double)src_rate);
-    retval->resampler_padding_samples = ResamplerPadding(retval->src_rate, retval->dst_rate) * pre_resample_channels;
+    retval->resampler_padding_samples = GetResamplerPadding(retval->src_rate, retval->dst_rate) * pre_resample_channels;
     retval->resampler_padding = (float *)SDL_calloc(retval->resampler_padding_samples ? retval->resampler_padding_samples : 1, sizeof(float));
 
     if (retval->resampler_padding == NULL) {
@@ -1090,16 +1090,16 @@ SDL_CreateAudioStream(SDL_AudioFormat src_format,
         }
     }
 
-    retval->queue = SDL_NewDataQueue(packetlen, (size_t)packetlen * 2);
+    retval->queue = SDL_CreateDataQueue(packetlen, (size_t)packetlen * 2);
     if (!retval->queue) {
         SDL_DestroyAudioStream(retval);
-        return NULL; /* SDL_NewDataQueue should have called SDL_SetError. */
+        return NULL; /* SDL_CreateDataQueue should have called SDL_SetError. */
     }
 
     return retval;
 }
 
-static int SDL_AudioStreamPutInternal(SDL_AudioStream *stream, const void *buf, int len, int *maxputbytes)
+static int SDL_PutAudioStreamInternal(SDL_AudioStream *stream, const void *buf, int len, int *maxputbytes)
 {
     int buflen = len;
     int workbuflen;
@@ -1271,7 +1271,7 @@ int SDL_PutAudioStreamData(SDL_AudioStream *stream, const void *buf, int len)
            we don't need to store it for later, skip the staging process.
          */
         if (!stream->staging_buffer_filled && len >= stream->staging_buffer_size) {
-            return SDL_AudioStreamPutInternal(stream, buf, len, NULL);
+            return SDL_PutAudioStreamInternal(stream, buf, len, NULL);
    

(Patch may be truncated, please check the link at the top of this post.)