SDL: SDL API renaming: SDL_joystick.h

From fc478c1bc0d31167e0ad6b31b143160d48bc45cd Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 27 Dec 2022 05:50:46 -0800
Subject: [PATCH] SDL API renaming: SDL_joystick.h

Fixes https://github.com/libsdl-org/SDL/issues/6881
---
 WhatsNew.txt                              |  50 +++++
 Xcode-iOS/Demos/README                    |   2 +-
 Xcode-iOS/Demos/src/accelerometer.c       |  16 +-
 docs/README-ios.md                        |   2 +-
 docs/README-migration.md                  |  54 +++++
 include/SDL3/SDL_gamecontroller.h         |  34 ++--
 include/SDL3/SDL_hints.h                  |   4 +-
 include/SDL3/SDL_joystick.h               | 228 +++++++++++-----------
 include/SDL3/SDL_oldnames.h               | 104 ++++++++++
 src/dynapi/SDL_dynapi.sym                 | 100 +++++-----
 src/dynapi/SDL_dynapi_overrides.h         | 100 +++++-----
 src/dynapi/SDL_dynapi_procs.h             | 100 +++++-----
 src/events/SDL_events.c                   |   6 +-
 src/haptic/windows/SDL_dinputhaptic.c     |   4 +-
 src/joystick/SDL_gamecontroller.c         |  82 ++++----
 src/joystick/SDL_joystick.c               | 150 +++++++-------
 src/joystick/SDL_joystick_c.h             |   2 +-
 src/joystick/hidapi/SDL_hidapi_gamecube.c |   4 +-
 src/joystick/hidapi/SDL_hidapi_luna.c     |   2 +-
 src/joystick/hidapi/SDL_hidapi_ps3.c      |   6 +-
 src/joystick/hidapi/SDL_hidapi_ps4.c      |   4 +-
 src/joystick/hidapi/SDL_hidapi_ps5.c      |   4 +-
 src/joystick/hidapi/SDL_hidapi_shield.c   |   2 +-
 src/joystick/hidapi/SDL_hidapi_stadia.c   |   2 +-
 src/joystick/hidapi/SDL_hidapi_steam.c    |   2 +-
 src/joystick/hidapi/SDL_hidapi_switch.c   |   4 +-
 src/joystick/hidapi/SDL_hidapi_wii.c      |   4 +-
 src/joystick/hidapi/SDL_hidapi_xbox360.c  |   4 +-
 src/joystick/hidapi/SDL_hidapi_xbox360w.c |   4 +-
 src/joystick/hidapi/SDL_hidapi_xboxone.c  |   2 +-
 src/joystick/hidapi/SDL_hidapijoystick.c  |   2 +-
 src/joystick/linux/SDL_sysjoystick.c      |   2 +-
 src/joystick/vita/SDL_sysjoystick.c       |   6 +-
 test/controllermap.c                      |  46 ++---
 test/testautomation_joystick.c            |  50 ++---
 test/testgamecontroller.c                 |  50 ++---
 test/testhotplug.c                        |  10 +-
 test/testjoystick.c                       |  46 ++---
 38 files changed, 751 insertions(+), 543 deletions(-)

diff --git a/WhatsNew.txt b/WhatsNew.txt
index fa08c7d090e8..95fba1d40030 100644
--- a/WhatsNew.txt
+++ b/WhatsNew.txt
@@ -23,7 +23,57 @@ General:
     * SDL_AudioStreamGet => SDL_GetAudioStreamData
     * SDL_AudioStreamPut => SDL_PutAudioStreamData
     * SDL_FreeAudioStream => SDL_DestroyAudioStream
+    * SDL_JoystickAttachVirtual => SDL_AttachVirtualJoystick
+    * SDL_JoystickAttachVirtualEx => SDL_AttachVirtualJoystickEx
+    * SDL_JoystickClose => SDL_CloseJoystick
+    * SDL_JoystickCurrentPowerLevel => SDL_GetJoystickPowerLevel
+    * SDL_JoystickDetachVirtual => SDL_DetachVirtualJoystick
+    * SDL_JoystickEventState => SDL_GetJoystickEventState
+    * SDL_JoystickFromInstanceID => SDL_GetJoystickFromInstanceID
+    * SDL_JoystickFromPlayerIndex => SDL_GetJoystickFromPlayerIndex
+    * SDL_JoystickGetAttached => SDL_IsJoystickConnected
+    * SDL_JoystickGetAxis => SDL_GetJoystickAxis
+    * SDL_JoystickGetAxisInitialState => SDL_GetJoystickAxisInitialState
+    * SDL_JoystickGetButton => SDL_GetJoystickButton
+    * SDL_JoystickGetDeviceGUID => SDL_GetJoystickDeviceGUID
+    * SDL_JoystickGetDeviceInstanceID => SDL_GetJoystickDeviceInstanceID
+    * SDL_JoystickGetDevicePlayerIndex => SDL_GetJoystickDevicePlayerIndex
+    * SDL_JoystickGetDeviceProduct => SDL_GetJoystickDeviceProduct
+    * SDL_JoystickGetDeviceProductVersion => SDL_GetJoystickDeviceProductVersion
+    * SDL_JoystickGetDeviceType => SDL_GetJoystickDeviceType
+    * SDL_JoystickGetDeviceVendor => SDL_GetJoystickDeviceVendor
+    * SDL_JoystickGetFirmwareVersion => SDL_GetJoystickFirmwareVersion
+    * SDL_JoystickGetGUID => SDL_GetJoystickGUID
+    * SDL_JoystickGetGUIDFromString => SDL_GetJoystickGUIDFromString
+    * SDL_JoystickGetGUIDString => SDL_GetJoystickGUIDString
+    * SDL_JoystickGetHat => SDL_GetJoystickHat
+    * SDL_JoystickGetPlayerIndex => SDL_GetJoystickPlayerIndex
+    * SDL_JoystickGetProduct => SDL_GetJoystickProduct
+    * SDL_JoystickGetProductVersion => SDL_GetJoystickProductVersion
+    * SDL_JoystickGetSerial => SDL_GetJoystickSerial
+    * SDL_JoystickGetType => SDL_GetJoystickType
+    * SDL_JoystickGetVendor => SDL_GetJoystickVendor
+    * SDL_JoystickInstanceID => SDL_GetJoystickInstanceID
+    * SDL_JoystickIsVirtual => SDL_IsJoystickVirtual
+    * SDL_JoystickName => SDL_GetJoystickName
+    * SDL_JoystickNameForIndex => SDL_GetJoystickNameForIndex
+    * SDL_JoystickNumAxes => SDL_GetNumJoystickAxes
+    * SDL_JoystickNumButtons => SDL_GetNumJoystickButtons
+    * SDL_JoystickNumHats => SDL_GetNumJoystickHats
+    * SDL_JoystickOpen => SDL_OpenJoystick
+    * SDL_JoystickPath => SDL_GetJoystickPath
+    * SDL_JoystickPathForIndex => SDL_GetJoystickPathForIndex
+    * SDL_JoystickRumble => SDL_RumbleJoystick
+    * SDL_JoystickRumbleTriggers => SDL_RumbleJoystickTriggers
+    * SDL_JoystickSendEffect => SDL_SendJoystickEffect
+    * SDL_JoystickSetLED => SDL_SetJoystickLED
+    * SDL_JoystickSetPlayerIndex => SDL_SetJoystickPlayerIndex
+    * SDL_JoystickSetVirtualAxis => SDL_SetJoystickVirtualAxis
+    * SDL_JoystickSetVirtualButton => SDL_SetJoystickVirtualButton
+    * SDL_JoystickSetVirtualHat => SDL_SetJoystickVirtualHat
+    * SDL_JoystickUpdate => SDL_UpdateJoysticks
     * SDL_NewAudioStream => SDL_CreateAudioStream
+    * SDL_NumJoysticks => SDL_GetNumJoysticks
 * Removed the following functions from the API, see docs/README-migration.md for details:
     * SDL_AudioInit()
     * SDL_AudioQuit()
diff --git a/Xcode-iOS/Demos/README b/Xcode-iOS/Demos/README
index 43825df706ba..c2cc92eb0a4b 100644
--- a/Xcode-iOS/Demos/README
+++ b/Xcode-iOS/Demos/README
@@ -18,7 +18,7 @@ Happy (happy.c):
 
 Accelerometer (accelerometer.c):
 
-	Uses the iPhone's accelerometer as a joystick device to move a spaceship around the screen.  Note the use of the macro SDL_IPHONE_MAX_GFORCE (normally defined in SDL_config_ios.h) which converts between the Sint16 number returned by SDL_JoystickGetAxis, and the floating point units of g-force reported natively by the iPhone. 
+	Uses the iPhone's accelerometer as a joystick device to move a spaceship around the screen.  Note the use of the macro SDL_IPHONE_MAX_GFORCE (normally defined in SDL_config_ios.h) which converts between the Sint16 number returned by SDL_GetJoystickAxis, and the floating point units of g-force reported natively by the iPhone. 
 
 Touch (touch.c):
 
diff --git a/Xcode-iOS/Demos/src/accelerometer.c b/Xcode-iOS/Demos/src/accelerometer.c
index 39ac012103fe..cf8a236b6c19 100644
--- a/Xcode-iOS/Demos/src/accelerometer.c
+++ b/Xcode-iOS/Demos/src/accelerometer.c
@@ -37,8 +37,8 @@ render(SDL_Renderer *renderer, int w, int h, double deltaTime)
     float speed;
 
     /* get joystick (accelerometer) axis values and normalize them */
-    float ax = SDL_JoystickGetAxis(accelerometer, 0);
-    float ay = SDL_JoystickGetAxis(accelerometer, 1);
+    float ax = SDL_GetJoystickAxis(accelerometer, 0);
+    float ay = SDL_GetJoystickAxis(accelerometer, 1);
 
     /* ship screen constraints */
     Uint32 minx = 0.0f;
@@ -177,18 +177,18 @@ main(int argc, char *argv[])
     SDL_RenderSetLogicalSize(renderer, w, h);
 
     /* print out some info about joysticks and try to open accelerometer for use */
-    printf("There are %d joysticks available\n", SDL_NumJoysticks());
-    printf("Default joystick (index 0) is %s\n", SDL_JoystickName(0));
-    accelerometer = SDL_JoystickOpen(0);
+    printf("There are %d joysticks available\n", SDL_GetNumJoysticks());
+    printf("Default joystick (index 0) is %s\n", SDL_GetJoystickName(0));
+    accelerometer = SDL_OpenJoystick(0);
     if (accelerometer == NULL) {
         fatalError("Could not open joystick (accelerometer)");
     }
     printf("joystick number of axis = %d\n",
-           SDL_JoystickNumAxes(accelerometer));
+           SDL_GetNumJoystickAxes(accelerometer));
     printf("joystick number of hats = %d\n",
-           SDL_JoystickNumHats(accelerometer));
+           SDL_GetNumJoystickHats(accelerometer));
     printf("joystick number of buttons = %d\n",
-           SDL_JoystickNumButtons(accelerometer));
+           SDL_GetNumJoystickButtons(accelerometer));
 
     /* load graphics */
     initializeTextures(renderer);
diff --git a/docs/README-ios.md b/docs/README-ios.md
index 595058e5f901..99e956af711c 100644
--- a/docs/README-ios.md
+++ b/docs/README-ios.md
@@ -126,7 +126,7 @@ Notes -- Accelerometer as Joystick
 
 SDL for iPhone supports polling the built in accelerometer as a joystick device.  For an example on how to do this, see the accelerometer.c in the demos directory.
 
-The main thing to note when using the accelerometer with SDL is that while the iPhone natively reports accelerometer as floating point values in units of g-force, SDL_JoystickGetAxis() reports joystick values as signed integers.  Hence, in order to convert between the two, some clamping and scaling is necessary on the part of the iPhone SDL joystick driver.  To convert SDL_JoystickGetAxis() reported values BACK to units of g-force, simply multiply the values by SDL_IPHONE_MAX_GFORCE / 0x7FFF.
+The main thing to note when using the accelerometer with SDL is that while the iPhone natively reports accelerometer as floating point values in units of g-force, SDL_GetJoystickAxis() reports joystick values as signed integers.  Hence, in order to convert between the two, some clamping and scaling is necessary on the part of the iPhone SDL joystick driver.  To convert SDL_GetJoystickAxis() reported values BACK to units of g-force, simply multiply the values by SDL_IPHONE_MAX_GFORCE / 0x7FFF.
 
 
 Notes -- OpenGL ES
diff --git a/docs/README-migration.md b/docs/README-migration.md
index cf61744d0d7e..911f4729c5b8 100644
--- a/docs/README-migration.md
+++ b/docs/README-migration.md
@@ -112,6 +112,60 @@ The following hints have been removed:
 * Renamed hints 'SDL_HINT_VIDEODRIVER' and 'SDL_HINT_AUDIODRIVER' to 'SDL_HINT_VIDEO_DRIVER' and 'SDL_HINT_AUDIO_DRIVER'
 * Renamed environment variables 'SDL_VIDEODRIVER' and 'SDL_AUDIODRIVER' to 'SDL_VIDEO_DRIVER' and 'SDL_AUDIO_DRIVER'
 
+## SDL_joystick.h
+
+The following functions have been renamed:
+* SDL_JoystickAttachVirtual => SDL_AttachVirtualJoystick
+* SDL_JoystickAttachVirtualEx => SDL_AttachVirtualJoystickEx
+* SDL_JoystickClose => SDL_CloseJoystick
+* SDL_JoystickCurrentPowerLevel => SDL_GetJoystickPowerLevel
+* SDL_JoystickDetachVirtual => SDL_DetachVirtualJoystick
+* SDL_JoystickEventState => SDL_GetJoystickEventState
+* SDL_JoystickFromInstanceID => SDL_GetJoystickFromInstanceID
+* SDL_JoystickFromPlayerIndex => SDL_GetJoystickFromPlayerIndex
+* SDL_JoystickGetAttached => SDL_IsJoystickConnected
+* SDL_JoystickGetAxis => SDL_GetJoystickAxis
+* SDL_JoystickGetAxisInitialState => SDL_GetJoystickAxisInitialState
+* SDL_JoystickGetButton => SDL_GetJoystickButton
+* SDL_JoystickGetDeviceGUID => SDL_GetJoystickDeviceGUID
+* SDL_JoystickGetDeviceInstanceID => SDL_GetJoystickDeviceInstanceID
+* SDL_JoystickGetDevicePlayerIndex => SDL_GetJoystickDevicePlayerIndex
+* SDL_JoystickGetDeviceProduct => SDL_GetJoystickDeviceProduct
+* SDL_JoystickGetDeviceProductVersion => SDL_GetJoystickDeviceProductVersion
+* SDL_JoystickGetDeviceType => SDL_GetJoystickDeviceType
+* SDL_JoystickGetDeviceVendor => SDL_GetJoystickDeviceVendor
+* SDL_JoystickGetFirmwareVersion => SDL_GetJoystickFirmwareVersion
+* SDL_JoystickGetGUID => SDL_GetJoystickGUID
+* SDL_JoystickGetGUIDFromString => SDL_GetJoystickGUIDFromString
+* SDL_JoystickGetGUIDString => SDL_GetJoystickGUIDString
+* SDL_JoystickGetHat => SDL_GetJoystickHat
+* SDL_JoystickGetPlayerIndex => SDL_GetJoystickPlayerIndex
+* SDL_JoystickGetProduct => SDL_GetJoystickProduct
+* SDL_JoystickGetProductVersion => SDL_GetJoystickProductVersion
+* SDL_JoystickGetSerial => SDL_GetJoystickSerial
+* SDL_JoystickGetType => SDL_GetJoystickType
+* SDL_JoystickGetVendor => SDL_GetJoystickVendor
+* SDL_JoystickInstanceID => SDL_GetJoystickInstanceID
+* SDL_JoystickIsVirtual => SDL_IsJoystickVirtual
+* SDL_JoystickName => SDL_GetJoystickName
+* SDL_JoystickNameForIndex => SDL_GetJoystickNameForIndex
+* SDL_JoystickNumAxes => SDL_GetNumJoystickAxes
+* SDL_JoystickNumButtons => SDL_GetNumJoystickButtons
+* SDL_JoystickNumHats => SDL_GetNumJoystickHats
+* SDL_JoystickOpen => SDL_OpenJoystick
+* SDL_JoystickPath => SDL_GetJoystickPath
+* SDL_JoystickPathForIndex => SDL_GetJoystickPathForIndex
+* SDL_JoystickRumble => SDL_RumbleJoystick
+* SDL_JoystickRumbleTriggers => SDL_RumbleJoystickTriggers
+* SDL_JoystickSendEffect => SDL_SendJoystickEffect
+* SDL_JoystickSetLED => SDL_SetJoystickLED
+* SDL_JoystickSetPlayerIndex => SDL_SetJoystickPlayerIndex
+* SDL_JoystickSetVirtualAxis => SDL_SetJoystickVirtualAxis
+* SDL_JoystickSetVirtualButton => SDL_SetJoystickVirtualButton
+* SDL_JoystickSetVirtualHat => SDL_SetJoystickVirtualHat
+* SDL_JoystickUpdate => SDL_UpdateJoysticks
+* SDL_NumJoysticks => SDL_GetNumJoysticks
+
 ## SDL_keycode.h
 
 The following enums have been renamed:
diff --git a/include/SDL3/SDL_gamecontroller.h b/include/SDL3/SDL_gamecontroller.h
index aa33361c3d4d..d7d3955c31a7 100644
--- a/include/SDL3/SDL_gamecontroller.h
+++ b/include/SDL3/SDL_gamecontroller.h
@@ -107,7 +107,7 @@ typedef struct SDL_GameControllerButtonBind
  *  To count the number of game controllers in the system for the following:
  *
  *  ```c
- *  int nJoysticks = SDL_NumJoysticks();
+ *  int nJoysticks = SDL_GetNumJoysticks();
  *  int nGameControllers = 0;
  *  for (int i = 0; i < nJoysticks; i++) {
  *      if (SDL_IsGameController(i)) {
@@ -119,7 +119,7 @@ typedef struct SDL_GameControllerButtonBind
  *  Using the SDL_HINT_GAMECONTROLLERCONFIG hint or the SDL_GameControllerAddMapping() you can add support for controllers SDL is unaware of or cause an existing controller to have a different binding. The format is:
  *  guid,name,mappings
  *
- *  Where GUID is the string value from SDL_JoystickGetGUIDString(), name is the human readable string for the device and mappings are controller mappings to joystick ones.
+ *  Where GUID is the string value from SDL_GetJoystickGUIDString(), name is the human readable string for the device and mappings are controller mappings to joystick ones.
  *  Under Windows there is a reserved GUID of "xinput" that covers any XInput devices.
  *  The mapping format for joystick is:
  *      bX - a joystick button, index X
@@ -176,7 +176,7 @@ extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw,
  * controller to have a different binding.
  *
  * The mapping string has the format "GUID,name,mapping", where GUID is the
- * string value from SDL_JoystickGetGUIDString(), name is the human readable
+ * string value from SDL_GetJoystickGUIDString(), name is the human readable
  * string for the device and mappings are controller mappings to joystick
  * ones. Under Windows there is a reserved GUID of "xinput" that covers all
  * XInput devices. The mapping format for joystick is: {| |bX |a joystick
@@ -230,8 +230,8 @@ extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForIndex(int mapping_ind
  *
  * \since This function is available since SDL 3.0.0.
  *
- * \sa SDL_JoystickGetDeviceGUID
- * \sa SDL_JoystickGetGUID
+ * \sa SDL_GetJoystickDeviceGUID
+ * \sa SDL_GetJoystickGUID
  */
 extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid);
 
@@ -258,10 +258,10 @@ extern DECLSPEC char * SDLCALL SDL_GameControllerMapping(SDL_GameController *gam
  * Check if the given joystick is supported by the game controller interface.
  *
  * `joystick_index` is the same as the `device_index` passed to
- * SDL_JoystickOpen().
+ * SDL_OpenJoystick().
  *
  * \param joystick_index the device_index of a device, up to
- *                       SDL_NumJoysticks()
+ *                       SDL_GetNumJoysticks()
  * \returns SDL_TRUE if the given joystick is supported by the game controller
  *          interface, SDL_FALSE if it isn't or it's an invalid index.
  *
@@ -278,10 +278,10 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index);
  * This function can be called before any controllers are opened.
  *
  * `joystick_index` is the same as the `device_index` passed to
- * SDL_JoystickOpen().
+ * SDL_OpenJoystick().
  *
  * \param joystick_index the device_index of a device, from zero to
- *                       SDL_NumJoysticks()-1
+ *                       SDL_GetNumJoysticks()-1
  * \returns the implementation-dependent name for the game controller, or NULL
  *          if there is no name or the index is invalid.
  *
@@ -299,10 +299,10 @@ extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_
  * This function can be called before any controllers are opened.
  *
  * `joystick_index` is the same as the `device_index` passed to
- * SDL_JoystickOpen().
+ * SDL_OpenJoystick().
  *
  * \param joystick_index the device_index of a device, from zero to
- *                       SDL_NumJoysticks()-1
+ *                       SDL_GetNumJoysticks()-1
  * \returns the implementation-dependent path for the game controller, or NULL
  *          if there is no path or the index is invalid.
  *
@@ -318,7 +318,7 @@ extern DECLSPEC const char *SDLCALL SDL_GameControllerPathForIndex(int joystick_
  * This can be called before any controllers are opened.
  *
  * \param joystick_index the device_index of a device, from zero to
- *                       SDL_NumJoysticks()-1
+ *                       SDL_GetNumJoysticks()-1
  * \returns the controller type.
  *
  * \since This function is available since SDL 3.0.0.
@@ -331,7 +331,7 @@ extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerTypeForIndex(in
  * This can be called before any controllers are opened.
  *
  * \param joystick_index the device_index of a device, from zero to
- *                       SDL_NumJoysticks()-1
+ *                       SDL_GetNumJoysticks()-1
  * \returns the mapping string. Must be freed with SDL_free(). Returns NULL if
  *          no mapping is available.
  *
@@ -343,7 +343,7 @@ extern DECLSPEC char *SDLCALL SDL_GameControllerMappingForDeviceIndex(int joysti
  * Open a game controller for use.
  *
  * `joystick_index` is the same as the `device_index` passed to
- * SDL_JoystickOpen().
+ * SDL_OpenJoystick().
  *
  * The index passed as an argument refers to the N'th game controller on the
  * system. This index is not the value which will identify this controller in
@@ -351,7 +351,7 @@ extern DECLSPEC char *SDLCALL SDL_GameControllerMappingForDeviceIndex(int joysti
  * be used there instead.
  *
  * \param joystick_index the device_index of a device, up to
- *                       SDL_NumJoysticks()
+ *                       SDL_GetNumJoysticks()
  * \returns a gamecontroller identifier or NULL if an error occurred; call
  *          SDL_GetError() for more information.
  *
@@ -548,7 +548,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerGetAttached(SDL_GameControlle
  * value).
  *
  * The pointer returned is owned by the SDL_GameController. You should not
- * call SDL_JoystickClose() on it, for example, since doing so will likely
+ * call SDL_CloseJoystick() on it, for example, since doing so will likely
  * cause SDL to crash.
  *
  * \param gamecontroller the game controller object that you want to get a
@@ -575,7 +575,7 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_GameControllerGetJoystick(SDL_GameCont
  *
  * \since This function is available since SDL 3.0.0.
  *
- * \sa SDL_JoystickEventState
+ * \sa SDL_GetJoystickEventState
  */
 extern DECLSPEC int SDLCALL SDL_GameControllerEventState(int state);
 
diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h
index 46d081b9fcef..5b900c8ce189 100644
--- a/include/SDL3/SDL_hints.h
+++ b/include/SDL3/SDL_hints.h
@@ -296,8 +296,8 @@ extern "C" {
  *
  *  This variable can be set to the following values:
  *
- *    "0"     - You'll call SDL_JoystickUpdate() manually
- *    "1"     - SDL will automatically call SDL_JoystickUpdate() (default)
+ *    "0"     - You'll call SDL_UpdateJoysticks() manually
+ *    "1"     - SDL will automatically call SDL_UpdateJoysticks() (default)
  *
  *  This hint can be toggled on and off at runtime.
  */
diff --git a/include/SDL3/SDL_joystick.h b/include/SDL3/SDL_joystick.h
index 0dd0f55f5830..ab38cf446376 100644
--- a/include/SDL3/SDL_joystick.h
+++ b/include/SDL3/SDL_joystick.h
@@ -24,7 +24,7 @@
  *
  *  Include file for SDL joystick event handling
  *
- * The term "device_index" identifies currently plugged in joystick devices between 0 and SDL_NumJoysticks(), with the exact joystick
+ * The term "device_index" identifies currently plugged in joystick devices between 0 and SDL_GetNumJoysticks(), with the exact joystick
  *   behind a device_index changing as joysticks are plugged and unplugged.
  *
  * The term "instance_id" is the current instantiation of a joystick device in the system, if the joystick is removed and then re-inserted
@@ -160,11 +160,11 @@ extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void) SDL_RELEASE(SDL_joystick_
  *
  * \since This function is available since SDL 3.0.0.
  *
- * \sa SDL_JoystickName
- * \sa SDL_JoystickPath
- * \sa SDL_JoystickOpen
+ * \sa SDL_GetJoystickName
+ * \sa SDL_GetJoystickPath
+ * \sa SDL_OpenJoystick
  */
-extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
+extern DECLSPEC int SDLCALL SDL_GetNumJoysticks(void);
 
 /**
  * Get the implementation dependent name of a joystick.
@@ -178,10 +178,10 @@ extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
  *
  * \since This function is available since SDL 3.0.0.
  *
- * \sa SDL_JoystickName
- * \sa SDL_JoystickOpen
+ * \sa SDL_GetJoystickName
+ * \sa SDL_OpenJoystick
  */
-extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index);
+extern DECLSPEC const char *SDLCALL SDL_GetJoystickNameForIndex(int device_index);
 
 /**
  * Get the implementation dependent path of a joystick.
@@ -195,10 +195,10 @@ extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index);
  *
  * \since This function is available since SDL 3.0.0.
  *
- * \sa SDL_JoystickPath
- * \sa SDL_JoystickOpen
+ * \sa SDL_GetJoystickPath
+ * \sa SDL_OpenJoystick
  */
-extern DECLSPEC const char *SDLCALL SDL_JoystickPathForIndex(int device_index);
+extern DECLSPEC const char *SDLCALL SDL_GetJoystickPathForIndex(int device_index);
 
 /**
  * Get the player index of a joystick, or -1 if it's not available This can be
@@ -206,7 +206,7 @@ extern DECLSPEC const char *SDLCALL SDL_JoystickPathForIndex(int device_index);
  *
  * \since This function is available since SDL 3.0.0.
  */
-extern DECLSPEC int SDLCALL SDL_JoystickGetDevicePlayerIndex(int device_index);
+extern DECLSPEC int SDLCALL SDL_GetJoystickDevicePlayerIndex(int device_index);
 
 /**
  * Get the implementation-dependent GUID for the joystick at a given device
@@ -221,10 +221,10 @@ extern DECLSPEC int SDLCALL SDL_JoystickGetDevicePlayerIndex(int device_index);
  *
  * \since This function is available since SDL 3.0.0.
  *
- * \sa SDL_JoystickGetGUID
- * \sa SDL_JoystickGetGUIDString
+ * \sa SDL_GetJoystickGUID
+ * \sa SDL_GetJoystickGUIDString
  */
-extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_index);
+extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickDeviceGUID(int device_index);
 
 /**
  * Get the USB vendor ID of a joystick, if available.
@@ -239,7 +239,7 @@ extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_in
  *
  * \since This function is available since SDL 3.0.0.
  */
-extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceVendor(int device_index);
+extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickDeviceVendor(int device_index);
 
 /**
  * Get the USB product ID of a joystick, if available.
@@ -254,7 +254,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceVendor(int device_index);
  *
  * \since This function is available since SDL 3.0.0.
  */
-extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProduct(int device_index);
+extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickDeviceProduct(int device_index);
 
 /**
  * Get the product version of a joystick, if available.
@@ -269,7 +269,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProduct(int device_index);
  *
  * \since This function is available since SDL 3.0.0.
  */
-extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProductVersion(int device_index);
+extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickDeviceProductVersion(int device_index);
 
 /**
  * Get the type of a joystick, if available.
@@ -283,7 +283,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProductVersion(int device_in
  *
  * \since This function is available since SDL 3.0.0.
  */
-extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetDeviceType(int device_index);
+extern DECLSPEC SDL_JoystickType SDLCALL SDL_GetJoystickDeviceType(int device_index);
 
 /**
  * Get the instance ID of a joystick.
@@ -298,7 +298,7 @@ extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetDeviceType(int device_in
  *
  * \since This function is available since SDL 3.0.0.
  */
-extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickGetDeviceInstanceID(int device_index);
+extern DECLSPEC SDL_JoystickID SDLCALL SDL_GetJoystickDeviceInstanceID(int device_index);
 
 /**
  * Open a joystick for use.
@@ -306,7 +306,7 @@ extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickGetDeviceInstanceID(int devic
  * The `device_index` argument refers to the N'th joystick presently
  * recognized by SDL on the system. It is **NOT** the same as the instance ID
  * used to identify the joystick in future events. See
- * SDL_JoystickInstanceID() for more details about instance IDs.
+ * SDL_GetJoystickInstanceID() for more details about instance IDs.
  *
  * The joystick subsystem must be initialized before a joystick can be opened
  * for use.
@@ -317,10 +317,10 @@ extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickGetDeviceInstanceID(int devic
  *
  * \since This function is available since SDL 3.0.0.
  *
- * \sa SDL_JoystickClose
- * \sa SDL_JoystickInstanceID
+ * \sa SDL_CloseJoystick
+ * \sa SDL_GetJoystickInstanceID
  */
-extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index);
+extern DECLSPEC SDL_Joystick *SDLCALL SDL_OpenJoystick(int device_index);
 
 /**
  * Get the SDL_Joystick associated with an instance id.
@@ -331,7 +331,7 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index);
  *
  * \since This function is available since SDL 3.0.0.
  */
-extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID instance_id);
+extern DECLSPEC SDL_Joystick *SDLCALL SDL_GetJoystickFromInstanceID(SDL_JoystickID instance_id);
 
 /**
  * Get the SDL_Joystick associated with a player index.
@@ -342,7 +342,7 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID
  *
  * \since This function is available since SDL 3.0.0.
  */
-extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromPlayerIndex(int player_index);
+extern DECLSPEC SDL_Joystick *SDLCALL SDL_GetJoystickFromPlayerIndex(int player_index);
 
 /**
  * Attach a new virtual joystick.
@@ -351,7 +351,7 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromPlayerIndex(int player_ind
  *
  * \since This function is available since SDL 3.0.0.
  */
-extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type,
+extern DECLSPEC int SDLCALL SDL_AttachVirtualJoystick(SDL_JoystickType type,
                                                       int naxes,
                                                       int nbuttons,
                                                       int nhats);
@@ -359,10 +359,10 @@ extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type,
 /**
  * The structure that defines an extended virtual joystick description
  *
- * The caller must zero the structure and then initialize the version with `SDL_VIRTUAL_JOYSTICK_DESC_VERSION` before passing it to SDL_JoystickAttachVirtualEx()
+ * The caller must zero the structure and then initialize the version with `SDL_VIRTUAL_JOYSTICK_DESC_VERSION` before passing it to SDL_AttachVirtualJoystickEx()
  *  All other elements of this structure are optional and can be left 0.
  *
- * \sa SDL_JoystickAttachVirtualEx
+ * \sa SDL_AttachVirtualJoystickEx
  */
 typedef struct SDL_VirtualJoystickDesc
 {
@@ -383,10 +383,10 @@ typedef struct SDL_VirtualJoystickDesc
     void *userdata;     /**< User data pointer passed to callbacks */
     void (SDLCALL *Update)(void *userdata); /**< Called when the joystick state should be updated */
     void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index); /**< Called when the player index is set */
-    int (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble); /**< Implements SDL_JoystickRumble() */
-    int (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble); /**< Implements SDL_JoystickRumbleTriggers() */
-    int (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue); /**< Implements SDL_JoystickSetLED() */
-    int (SDLCALL *SendEffect)(void *userdata, const void *data, int size); /**< Implements SDL_JoystickSendEffect() */
+    int (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble); /**< Implements SDL_RumbleJoystick() */
+    int (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble); /**< Implements SDL_RumbleJoystickTriggers() */
+    int (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue); /**< Implements SDL_SetJoystickLED() */
+    int (SDLCALL *SendEffect)(void *userdata, const void *data, int size); /**< Implements SDL_SendJoystickEffect() */
 
 } SDL_VirtualJoystickDesc;
 
@@ -402,18 +402,18 @@ typedef struct SDL_VirtualJoystickDesc
  *
  * \since This function is available since SDL 3.0.0.
  */
-extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtualEx(const SDL_VirtualJoystickDesc *desc);
+extern DECLSPEC int SDLCALL SDL_AttachVirtualJoystickEx(const SDL_VirtualJoystickDesc *desc);
 
 /**
  * Detach a virtual joystick.
  *
  * \param device_index a value previously returned from
- *                     SDL_JoystickAttachVirtual()
+ *                     SDL_AttachVirtualJoystick()
  * \returns 0 on success, or -1 if an error occurred.
  *
  * \since This function is available since SDL 3.0.0.
  */
-extern DECLSPEC int SDLCALL SDL_JoystickDetachVirtual(int device_index);
+extern DECLSPEC int SDLCALL SDL_DetachVirtualJoystick(int device_index);
 
 /**
  * Query whether or not the joystick at a given device index is virtual.
@@ -423,13 +423,13 @@ extern DECLSPEC int SDLCALL SDL_JoystickDetachVirtual(int device_index);
  *
  * \since This function is available since SDL 3.0.0.
  */
-extern DECLSPEC SDL_bool SDLCALL SDL_JoystickIsVirtual(int device_index);
+extern DECLSPEC SDL_bool SDLCALL SDL_IsJoystickVirtual(int device_index);
 
 /**
  * Set values on an opened, virtual-joystick's axis.
  *
  * Please note that values set here will not be applied until the next call to
- * SDL_JoystickUpdate, which can either be called directly, or can be called
+ * SDL_UpdateJoysticks, which can either be c

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