/* Get the number of trackballs on a joystick  */
int SDL_JoystickNumBalls(SDL_Joystick *joystick)
/* Get the number of trackballs on a joystick  */
int SDL_JoystickNumBalls(SDL_Joystick *joystick)
{
    if (!SDL_PrivateJoystickValid(joystick)) {
        return -1;
    }
    return joystick->nballs;
}