SDL_stdinc.h File Reference
`#include "SDL_config.h"`
`#include <sys/types.h>`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <stddef.h>`
`#include <stdarg.h>`
`#include <string.h>`
`#include <strings.h>`
`#include <wchar.h>`
`#include <inttypes.h>`
`#include <ctype.h>`
`#include <math.h>`
`#include <float.h>`
`#include <alloca.h>`
`#include "begin_code.h"`
`#include "close_code.h"`
Include dependency graph for SDL_stdinc.h:

Go to the source code of this file.

## Macros

#define | SDL_arraysize(array) (sizeof(array)/sizeof(array[0]))
#define | SDL_TABLESIZE(table) SDL_arraysize(table)
#define | SDL_STRINGIFY_ARG(arg) #arg
Cast operators
Use proper C++ casts when compiled as C++ to be compatible with the option -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above).
#define | SDL_reinterpret_cast(type, expression) ((type)(expression))
#define | SDL_static_cast(type, expression) ((type)(expression))
#define | SDL_const_cast(type, expression) ((type)(expression))
#define | SDL_FOURCC(A, B, C, D)

## Basic data types

#define | SDL_MAX_SINT8 ((Sint8)0x7F) /* 127 */
| A signed 8-bit integer type. More...
#define | SDL_MIN_SINT8 ((Sint8)(~0x7F)) /* -128 */
#define | SDL_MAX_UINT8 ((Uint8)0xFF) /* 255 */
| An unsigned 8-bit integer type. More...
#define | SDL_MIN_UINT8 ((Uint8)0x00) /* 0 */
#define | SDL_MAX_SINT16 ((Sint16)0x7FFF) /* 32767 */
| A signed 16-bit integer type. More...
#define | SDL_MIN_SINT16 ((Sint16)(~0x7FFF)) /* -32768 */
#define | SDL_MAX_UINT16 ((Uint16)0xFFFF) /* 65535 */
| An unsigned 16-bit integer type. More...
#define | SDL_MIN_UINT16 ((Uint16)0x0000) /* 0 */
#define | SDL_MAX_SINT32 ((Sint32)0x7FFFFFFF) /* 2147483647 */
| A signed 32-bit integer type. More...
#define | SDL_MIN_SINT32 ((Sint32)(~0x7FFFFFFF)) /* -2147483648 */
#define | SDL_MAX_UINT32 ((Uint32)0xFFFFFFFFu) /* 4294967295 */
| An unsigned 32-bit integer type. More...
#define | SDL_MIN_UINT32 ((Uint32)0x00000000) /* 0 */
#define | SDL_MAX_SINT64 ((Sint64)0x7FFFFFFFFFFFFFFFll) /* 9223372036854775807 */
| A signed 64-bit integer type. More...
#define | SDL_MIN_SINT64 ((Sint64)(~0x7FFFFFFFFFFFFFFFll)) /* -9223372036854775808 */
#define | SDL_MAX_UINT64 ((Uint64)0xFFFFFFFFFFFFFFFFull) /* 18446744073709551615 */
| An unsigned 64-bit integer type. More...
#define | SDL_MIN_UINT64 ((Uint64)(0x0000000000000000ull)) /* 0 */
#define | SDL_PRIs64 "I64d"
#define | SDL_PRIu64 "I64u"
#define | SDL_PRIx64 "I64x"
#define | SDL_PRIX64 "I64X"
#define | SDL_IN_BYTECAP(x)
#define | SDL_INOUT_Z_CAP(x)
#define | SDL_OUT_Z_CAP(x)
#define | SDL_OUT_CAP(x)
#define | SDL_OUT_BYTECAP(x)
#define | SDL_OUT_Z_BYTECAP(x)
#define | SDL_PRINTF_FORMAT_STRING
#define | SDL_SCANF_FORMAT_STRING
#define | SDL_PRINTF_VARARG_FUNC(fmtargnumber)
#define | SDL_SCANF_VARARG_FUNC(fmtargnumber)
#define | SDL_COMPILE_TIME_ASSERT(name, x) typedef int SDL_compile_time_assert_ ## name[(x) * 2 - 1]
#define | SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count))
#define | SDL_stack_free(data)
#define | SDL_min(x, y) (((x) < (y)) ? (x) : (y))
#define | SDL_max(x, y) (((x) > (y)) ? (x) : (y))
#define | SDL_zero(x) SDL_memset(&(x), 0, sizeof((x)))
#define | SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x)))
#define | SDL_ICONV_ERROR (size_t)-1
#define | SDL_ICONV_E2BIG (size_t)-2
#define | SDL_ICONV_EILSEQ (size_t)-3
#define | SDL_ICONV_EINVAL (size_t)-4
#define | SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1)
#define | SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", S, SDL_strlen(S)+1)
#define | SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4-INTERNAL", "UTF-8", S, SDL_strlen(S)+1)
enum | SDL_bool { SDL_FALSE = 0, SDL_TRUE = 1 }
typedef int8_t | Sint8
typedef uint8_t | Uint8
typedef int16_t | Sint16
typedef uint16_t | Uint16
typedef int32_t | Sint32
typedef uint32_t | Uint32
typedef int64_t | Sint64
typedef uint64_t | Uint64
typedef void *(* | SDL_malloc_func) (size_t size)
typedef void *(* | SDL_calloc_func) (size_t nmemb, size_t size)
typedef void *(* | SDL_realloc_func) (void *mem, size_t size)
typedef void(* | SDL_free_func) (void *mem)
void * | SDL_malloc (size_t size)
void * | SDL_calloc (size_t nmemb, size_t size)
void * | SDL_realloc (void *mem, size_t size)
void | SDL_free (void *mem)
void | SDL_GetMemoryFunctions (SDL_malloc_func *malloc_func, SDL_calloc_func *calloc_func, SDL_realloc_func *realloc_func, SDL_free_func *free_func)
| Get the current set of SDL memory functions. More...
int | SDL_SetMemoryFunctions (SDL_malloc_func malloc_func, SDL_calloc_func calloc_func, SDL_realloc_func realloc_func, SDL_free_func free_func)
| Replace SDL's memory allocation functions with a custom set. More...
int | SDL_GetNumAllocations (void)
| Get the number of outstanding (unfreed) allocations. More...
char * | SDL_getenv (const char *name)
int | SDL_setenv (const char *name, const char *value, int overwrite)
void | SDL_qsort (void *base, size_t nmemb, size_t size, int(*compare)(const void *, const void *))
int | SDL_abs (int x)
int | SDL_isdigit (int x)
int | SDL_isspace (int x)
int | SDL_toupper (int x)
int | SDL_tolower (int x)
void * | SDL_memset (SDL_OUT_BYTECAP(len) void *dst, int c, size_t len)
SDL_FORCE_INLINE void | SDL_memset4 (void *dst, Uint32 val, size_t dwords)
void * | SDL_memcpy (SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len)
void * | SDL_memmove (SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len)
int | SDL_memcmp (const void *s1, const void *s2, size_t len)
wchar_t * | SDL_wcsdup (const wchar_t *wstr)
size_t | SDL_wcslen (const wchar_t *wstr)
size_t | SDL_wcslcpy (SDL_OUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen)
size_t | SDL_wcslcat (SDL_INOUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen)
int | SDL_wcscmp (const wchar_t *str1, const wchar_t *str2)
size_t | SDL_strlen (const char *str)
size_t | SDL_strlcpy (SDL_OUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen)
size_t | SDL_utf8strlcpy (SDL_OUT_Z_CAP(dst_bytes) char *dst, const char *src, size_t dst_bytes)
size_t | SDL_strlcat (SDL_INOUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen)
char * | SDL_strdup (const char *str)
char * | SDL_strrev (char *str)
char * | SDL_strupr (char *str)
char * | SDL_strlwr (char *str)
char * | SDL_strchr (const char *str, int c)
char * | SDL_strrchr (const char *str, int c)
char * | SDL_strstr (const char *haystack, const char *needle)
size_t | SDL_utf8strlen (const char *str)
char * | SDL_itoa (int value, char *str, int radix)
char * | SDL_uitoa (unsigned int value, char *str, int radix)
char * | SDL_ltoa (long value, char *str, int radix)
char * | SDL_ultoa (unsigned long value, char *str, int radix)
char * | SDL_lltoa (Sint64 value, char *str, int radix)
char * | SDL_ulltoa (Uint64 value, char *str, int radix)
int | SDL_atoi (const char *str)
double | SDL_atof (const char *str)
long | SDL_strtol (const char *str, char **endp, int base)
unsigned long | SDL_strtoul (const char *str, char **endp, int base)
Sint64 | SDL_strtoll (const char *str, char **endp, int base)
Uint64 | SDL_strtoull (const char *str, char **endp, int base)
double | SDL_strtod (const char *str, char **endp)
int | SDL_strcmp (const char *str1, const char *str2)
int | SDL_strncmp (const char *str1, const char *str2, size_t maxlen)
int | SDL_strcasecmp (const char *str1, const char *str2)
int | SDL_strncasecmp (const char *str1, const char *str2, size_t len)
int | SDL_sscanf (const char *text, SDL_SCANF_FORMAT_STRING const char *fmt,...) SDL_SCANF_VARARG_FUNC(2)
int | SDL_vsscanf (const char *text, const char *fmt, va_list ap)
int | SDL_snprintf (SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt,...) SDL_PRINTF_VARARG_FUNC(3)
int | SDL_vsnprintf (SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, va_list ap)
double | SDL_acos (double x)
float | SDL_acosf (float x)
double | SDL_asin (double x)
float | SDL_asinf (float x)
double | SDL_atan (double x)
float | SDL_atanf (float x)
double | SDL_atan2 (double x, double y)
float | SDL_atan2f (float x, float y)
double | SDL_ceil (double x)
float | SDL_ceilf (float x)
double | SDL_copysign (double x, double y)
float | SDL_copysignf (float x, float y)
double | SDL_cos (double x)
float | SDL_cosf (float x)
double | SDL_exp (double x)
float | SDL_expf (float x)
double | SDL_fabs (double x)
float | SDL_fabsf (float x)
double | SDL_floor (double x)
float | SDL_floorf (float x)
double | SDL_fmod (double x, double y)
float | SDL_fmodf (float x, float y)
double | SDL_log (double x)
float | SDL_logf (float x)
double | SDL_log10 (double x)
float | SDL_log10f (float x)
double | SDL_pow (double x, double y)
float | SDL_powf (float x, float y)
double | SDL_scalbn (double x, int n)
float | SDL_scalbnf (float x, int n)
double | SDL_sin (double x)
float | SDL_sinf (float x)
double | SDL_sqrt (double x)
float | SDL_sqrtf (float x)
double | SDL_tan (double x)
float | SDL_tanf (float x)
SDL_iconv_t | SDL_iconv_open (const char *tocode, const char *fromcode)
int | SDL_iconv_close (SDL_iconv_t cd)
size_t | SDL_iconv (SDL_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
char * | SDL_iconv_string (const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft)
SDL_FORCE_INLINE void * | SDL_memcpy4 (SDL_OUT_BYTECAP(dwords *4) void *dst, SDL_IN_BYTECAP(dwords *4) const void *src, size_t dwords)

## Detailed Description

This is a general header that includes C language support.

Definition in file SDL_stdinc.h.

## Macro Definition Documentation

## SDL_arraysize

#define SDL_arraysize | ( |  | array | ) | (sizeof(array)/sizeof(array[0]))

The number of elements in an array.

Definition at line 115 of file SDL_stdinc.h.

## SDL_COMPILE_TIME_ASSERT

#define SDL_COMPILE_TIME_ASSERT | ( |  | name,
|  |  | x
| ) |  | typedef int SDL_compile_time_assert_ ## name[(x) * 2 - 1]

Definition at line 312 of file SDL_stdinc.h.

## SDL_const_cast

#define SDL_const_cast | ( |  | type,
|  |  | expression
| ) |  | ((type)(expression))

Definition at line 139 of file SDL_stdinc.h.

## SDL_FOURCC

#define SDL_FOURCC | ( |  | A,
|  |  | B,
|  |  | C,
|  |  | D
| ) |  |

Value:
((SDL_static_cast(Uint32, SDL_static_cast(Uint8, (A))) << 0) | \
(SDL_static_cast(Uint32, SDL_static_cast(Uint8, (B))) << 8) | \
(SDL_static_cast(Uint32, SDL_static_cast(Uint8, (C))) << 16) | \
(SDL_static_cast(Uint32, SDL_static_cast(Uint8, (D))) << 24))

Definition at line 144 of file SDL_stdinc.h.

## SDL_ICONV_E2BIG

#define SDL_ICONV_E2BIG (size_t)-2

Definition at line 542 of file SDL_stdinc.h.

## SDL_ICONV_EILSEQ

#define SDL_ICONV_EILSEQ (size_t)-3

Definition at line 543 of file SDL_stdinc.h.

## SDL_ICONV_EINVAL

#define SDL_ICONV_EINVAL (size_t)-4

Definition at line 544 of file SDL_stdinc.h.

## SDL_ICONV_ERROR

#define SDL_ICONV_ERROR (size_t)-1

Definition at line 541 of file SDL_stdinc.h.

## SDL_iconv_utf8_locale

#define SDL_iconv_utf8_locale | ( |  | S | ) | SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1)

Definition at line 562 of file SDL_stdinc.h.

## SDL_iconv_utf8_ucs2

#define SDL_iconv_utf8_ucs2 | ( |  | S | ) | (Uint16 *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", S, SDL_strlen(S)+1)

Definition at line 563 of file SDL_stdinc.h.

## SDL_iconv_utf8_ucs4

#define SDL_iconv_utf8_ucs4 | ( |  | S | ) | (Uint32 *)SDL_iconv_string("UCS-4-INTERNAL", "UTF-8", S, SDL_strlen(S)+1)

Definition at line 564 of file SDL_stdinc.h.

## SDL_IN_BYTECAP

#define SDL_IN_BYTECAP | ( |  | x | ) |

Definition at line 294 of file SDL_stdinc.h.

## SDL_INOUT_Z_CAP

#define SDL_INOUT_Z_CAP | ( |  | x | ) |

Definition at line 295 of file SDL_stdinc.h.

## SDL_max

#define SDL_max | ( |  | x,
|  |  | y
| ) |  | (((x) > (y)) ? (x) : (y))

Definition at line 407 of file SDL_stdinc.h.

## SDL_MAX_SINT16

#define SDL_MAX_SINT16 ((Sint16)0x7FFF) /* 32767 */

A signed 16-bit integer type.

Definition at line 183 of file SDL_stdinc.h.

## SDL_MAX_SINT32

#define SDL_MAX_SINT32 ((Sint32)0x7FFFFFFF) /* 2147483647 */

A signed 32-bit integer type.

Definition at line 195 of file SDL_stdinc.h.

## SDL_MAX_SINT64

#define SDL_MAX_SINT64 ((Sint64)0x7FFFFFFFFFFFFFFFll) /* 9223372036854775807 */

A signed 64-bit integer type.

Definition at line 208 of file SDL_stdinc.h.

## SDL_MAX_SINT8

#define SDL_MAX_SINT8 ((Sint8)0x7F) /* 127 */

A signed 8-bit integer type.

Definition at line 171 of file SDL_stdinc.h.

## SDL_MAX_UINT16

#define SDL_MAX_UINT16 ((Uint16)0xFFFF) /* 65535 */

An unsigned 16-bit integer type.

Definition at line 189 of file SDL_stdinc.h.

## SDL_MAX_UINT32

#define SDL_MAX_UINT32 ((Uint32)0xFFFFFFFFu) /* 4294967295 */

An unsigned 32-bit integer type.

Definition at line 201 of file SDL_stdinc.h.

## SDL_MAX_UINT64

#define SDL_MAX_UINT64 ((Uint64)0xFFFFFFFFFFFFFFFFull) /* 18446744073709551615 */

An unsigned 64-bit integer type.

Definition at line 214 of file SDL_stdinc.h.

## SDL_MAX_UINT8

#define SDL_MAX_UINT8 ((Uint8)0xFF) /* 255 */

An unsigned 8-bit integer type.

Definition at line 177 of file SDL_stdinc.h.

## SDL_min

#define SDL_min | ( |  | x,
|  |  | y
| ) |  | (((x) < (y)) ? (x) : (y))

Definition at line 406 of file SDL_stdinc.h.

## SDL_MIN_SINT16

#define SDL_MIN_SINT16 ((Sint16)(~0x7FFF)) /* -32768 */

Definition at line 184 of file SDL_stdinc.h.

## SDL_MIN_SINT32

#define SDL_MIN_SINT32 ((Sint32)(~0x7FFFFFFF)) /* -2147483648 */

Definition at line 196 of file SDL_stdinc.h.

## SDL_MIN_SINT64

#define SDL_MIN_SINT64 ((Sint64)(~0x7FFFFFFFFFFFFFFFll)) /* -9223372036854775808 */

Definition at line 209 of file SDL_stdinc.h.

## SDL_MIN_SINT8

#define SDL_MIN_SINT8 ((Sint8)(~0x7F)) /* -128 */

Definition at line 172 of file SDL_stdinc.h.

## SDL_MIN_UINT16

#define SDL_MIN_UINT16 ((Uint16)0x0000) /* 0 */

Definition at line 190 of file SDL_stdinc.h.

## SDL_MIN_UINT32

#define SDL_MIN_UINT32 ((Uint32)0x00000000) /* 0 */

Definition at line 202 of file SDL_stdinc.h.

## SDL_MIN_UINT64

#define SDL_MIN_UINT64 ((Uint64)(0x0000000000000000ull)) /* 0 */

Definition at line 215 of file SDL_stdinc.h.

## SDL_MIN_UINT8

#define SDL_MIN_UINT8 ((Uint8)0x00) /* 0 */

Definition at line 178 of file SDL_stdinc.h.

## SDL_OUT_BYTECAP

#define SDL_OUT_BYTECAP | ( |  | x | ) |

Definition at line 298 of file SDL_stdinc.h.

## SDL_OUT_CAP

#define SDL_OUT_CAP | ( |  | x | ) |

Definition at line 297 of file SDL_stdinc.h.

## SDL_OUT_Z_BYTECAP

#define SDL_OUT_Z_BYTECAP | ( |  | x | ) |

Definition at line 299 of file SDL_stdinc.h.

## SDL_OUT_Z_CAP

#define SDL_OUT_Z_CAP | ( |  | x | ) |

Definition at line 296 of file SDL_stdinc.h.

## SDL_PRINTF_FORMAT_STRING

#define SDL_PRINTF_FORMAT_STRING

Definition at line 300 of file SDL_stdinc.h.

## SDL_PRINTF_VARARG_FUNC

#define SDL_PRINTF_VARARG_FUNC | ( |  | fmtargnumber | ) |

Definition at line 307 of file SDL_stdinc.h.

## SDL_PRIs64

#define SDL_PRIs64 "I64d"

Definition at line 227 of file SDL_stdinc.h.

## SDL_PRIu64

#define SDL_PRIu64 "I64u"

Definition at line 238 of file SDL_stdinc.h.

## SDL_PRIx64

#define SDL_PRIx64 "I64x"

Definition at line 249 of file SDL_stdinc.h.

## SDL_PRIX64

#define SDL_PRIX64 "I64X"

Definition at line 260 of file SDL_stdinc.h.

## SDL_reinterpret_cast

#define SDL_reinterpret_cast | ( |  | type,
|  |  | expression
| ) |  | ((type)(expression))

Definition at line 137 of file SDL_stdinc.h.

## SDL_SCANF_FORMAT_STRING

#define SDL_SCANF_FORMAT_STRING

Definition at line 301 of file SDL_stdinc.h.

## SDL_SCANF_VARARG_FUNC

#define SDL_SCANF_VARARG_FUNC | ( |  | fmtargnumber | ) |

Definition at line 308 of file SDL_stdinc.h.

## SDL_stack_alloc

#define SDL_stack_alloc | ( |  | type,
|  |  | count
| ) |  | (type*)alloca(sizeof(type)*(count))

Definition at line 354 of file SDL_stdinc.h.

## SDL_stack_free

#define SDL_stack_free | ( |  | data | ) |

Definition at line 355 of file SDL_stdinc.h.

## SDL_static_cast

#define SDL_static_cast | ( |  | type,
|  |  | expression
| ) |  | ((type)(expression))

Definition at line 138 of file SDL_stdinc.h.

## SDL_STRINGIFY_ARG

#define SDL_STRINGIFY_ARG | ( |  | arg | ) | #arg

Macro useful for building other macros with strings in them

e.g. #define LOG_ERROR(X) OutputDebugString(SDL_STRINGIFY_ARG(FUNCTION) ": " X "\n")

Definition at line 123 of file SDL_stdinc.h.

## SDL_TABLESIZE

#define SDL_TABLESIZE | ( |  | table | ) | SDL_arraysize(table)

Definition at line 116 of file SDL_stdinc.h.

## SDL_zero

#define SDL_zero | ( |  | x | ) | SDL_memset(&(x), 0, sizeof((x)))

Definition at line 416 of file SDL_stdinc.h.

## SDL_zerop

#define SDL_zerop | ( |  | x | ) | SDL_memset((x), 0, sizeof(*(x)))

Definition at line 417 of file SDL_stdinc.h.

## Typedef Documentation

## SDL_calloc_func

typedef void*( * SDL_calloc_func) (size_t nmemb, size_t size)

Definition at line 367 of file SDL_stdinc.h.

## SDL_free_func

const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char const char const SDL_SCANF_FORMAT_STRING char return SDL_ThreadFunction const char void return Uint32 return Uint32 SDL_AssertionHandler void SDL_SpinLock SDL_atomic_t int int return SDL_atomic_t return void void void return void return int return SDL_AudioSpec SDL_AudioSpec return int int return return int SDL_RWops int SDL_AudioSpec Uint8 Uint32 return SDL_AudioCVT SDL_AudioFormat Uint8 int SDL_AudioFormat Uint8 int return Uint8 const Uint8 Uint32 int const char return return return return return return return return Uint32 return Uint32 SDL_Event return SDL_Event int return SDL_EventFilter void SDL_EventFilter void SDL_EventFilter void int return const char const char return SDL_JoystickGUID return int return int return SDL_GameController return int return const char return SDL_GameController SDL_GameControllerAxis return const char return SDL_GameController SDL_GameControllerButton return SDL_GameController SDL_RWops return SDL_TouchID SDL_RWops return int return int return return SDL_Joystick return SDL_Haptic SDL_Haptic return SDL_Haptic return SDL_Haptic SDL_HapticEffect return SDL_Haptic int Uint32 return SDL_Haptic int SDL_Haptic int return SDL_Haptic return SDL_Haptic return SDL_Haptic return SDL_Haptic return const char const char return const char SDL_HintCallback void int return SDL_Joystick return SDL_Joystick return const char return SDL_Joystick return SDL_Joystick return SDL_Joystick return int return SDL_Joystick int return SDL_Joystick int return return return SDL_Scancode return SDL_Scancode return SDL_Keycode return return const char return void int SDL_LogPriority SDL_LogOutputFunction void Uint32 const char const char SDL_Window return int int return SDL_Window int int return SDL_Surface int int return SDL_Cursor return int return SDL_mutex return SDL_mutex return Uint32 return SDL_sem return SDL_sem Uint32 return SDL_sem return SDL_cond SDL_cond return SDL_cond SDL_mutex Uint32 return Uint32 int Uint32 Uint32 Uint32 Uint32 return Uint32 return int return SDL_Palette const SDL_Color int int return const SDL_PixelFormat Uint8 Uint8 Uint8 return Uint32 const SDL_PixelFormat Uint8 Uint8 Uint8 float Uint16 int int return const SDL_Rect const SDL_Rect SDL_Rect return const SDL_Point int const SDL_Rect SDL_Rect return return int int Uint32 SDL_Window SDL_Renderer return SDL_Surface return SDL_Renderer SDL_RendererInfo return SDL_Renderer Uint32 int int int return SDL_Texture Uint32 int int int return SDL_Texture Uint8 Uint8 Uint8 return SDL_Texture Uint8 return SDL_Texture SDL_BlendMode return SDL_Texture const SDL_Rect const Uint8 int const Uint8 int const Uint8 int return SDL_Texture SDL_Renderer SDL_Texture return SDL_Renderer int int return SDL_Renderer const SDL_Rect return SDL_Renderer const SDL_Rect return SDL_Renderer float float return SDL_Renderer Uint8 Uint8 Uint8 Uint8 return SDL_Renderer SDL_BlendMode return SDL_Renderer return SDL_Renderer const SDL_Point int return SDL_Renderer const SDL_Point int return SDL_Renderer const SDL_Rect int return SDL_Renderer const SDL_Rect int return SDL_Renderer SDL_Texture const SDL_Rect const SDL_Rect const double const SDL_Point const SDL_RendererFlip return SDL_Renderer SDL_Renderer SDL_Texture return void int return return SDL_RWops return SDL_RWops return SDL_RWops return SDL_RWops return SDL_RWops Uint16 return SDL_RWops Uint32 return SDL_RWops Uint64 return const char unsigned int unsigned int unsigned int unsigned int Uint32 return SDL_Window SDL_Surface SDL_WindowShapeMode return size_t return void size_t return const char return void size_t size_t int(*) void int return int return int size_t return size_t return const wchar_t return const wchar_t size_t return const char size_t return const char size_t return char return char return const char int return int char int return long char int return Sint64 char int return const char return const char char int return const char char int return const char char return const char const char size_t return const char const char size_t return double return double return double return double return double return double return double int return float return const char const char return SDL_iconv_t const char size_t char size_t return Uint32 int int int Uint32 Uint32 Uint32 Uint32 return SDL_Surface SDL_Surface return SDL_RWops int return SDL_Surface int return SDL_Surface Uint32 return SDL_Surface Uint8 Uint8 Uint8 return SDL_Surface Uint8 return SDL_Surface SDL_BlendMode return SDL_Surface SDL_Rect SDL_Surface Uint32 Uint32 return SDL_Surface const SDL_Rect Uint32 return SDL_Surface const SDL_Rect SDL_Surface SDL_Rect return SDL_Surface const SDL_Rect SDL_Surface const SDL_Rect return SDL_Surface SDL_Rect SDL_Surface SDL_Rect return SDL_Thread return SDL_Thread return SDL_Thread int return SDL_TLSID const void void(*) return return Uint32 SDL_TimerID return int return SDL_TouchID int return return return const char return return int return int return int SDL_DisplayMode return int const SDL_DisplayMode SDL_DisplayMode return SDL_Window const SDL_DisplayMode return SDL_Window return const void return Uint32 return SDL_Window const char SDL_Window SDL_Surface SDL_Window const char return SDL_Window int int SDL_Window int int SDL_Window int int SDL_Window int int SDL_Window SDL_Window SDL_Window SDL_Window Uint32 return SDL_Window return SDL_Window SDL_bool SDL_Window float return SDL_Window const Uint16 const Uint16 const Uint16 return SDL_Window const char return SDL_GLattr int return SDL_Window return return SDL_Window int int return SDL_GLContext SDL_RWops int return return void return int int return double return SDL_bool return int int return SDL_AudioDeviceID const void Uint32 return SDL_AudioDeviceID int float float float return SDL_JoystickID return int SDL_Rect return SDL_Window float return SDL_Window return SDL_Renderer SDL_bool return SDL_AudioDeviceID void Uint32 return Uint32 int int int Uint32 return const char SDL_bool return int return SDL_Joystick return SDL_Joystick return SDL_GameController return return int return int return int return SDL_RWops size_t int return SDL_BlendFactor SDL_BlendFactor SDL_BlendOperation SDL_BlendFactor SDL_BlendFactor SDL_BlendOperation return const char return SDL_Window VkInstance VkSurfaceKHR return SDL_malloc_func SDL_calloc_func SDL_realloc_func SDL_free_func

Definition at line 369 of file SDL_stdinc.h.

## SDL_malloc_func

typedef void*( * SDL_malloc_func) (size_t size)

Definition at line 366 of file SDL_stdinc.h.

## SDL_realloc_func

typedef void*( * SDL_realloc_func) (void *mem, size_t size)

Definition at line 368 of file SDL_stdinc.h.

## Sint16

typedef int16_t Sint16

Definition at line 185 of file SDL_stdinc.h.

## Sint32

typedef int32_t Sint32

Definition at line 197 of file SDL_stdinc.h.

## Sint64

const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char const char const SDL_SCANF_FORMAT_STRING char return SDL_ThreadFunction const char void return Uint32 return Uint32 SDL_AssertionHandler void SDL_SpinLock SDL_atomic_t int int return SDL_atomic_t return void void void return void return int return SDL_AudioSpec SDL_AudioSpec return int int return return int SDL_RWops int SDL_AudioSpec Uint8 Uint32 return SDL_AudioCVT SDL_AudioFormat Uint8 int SDL_AudioFormat Uint8 int return Uint8 const Uint8 Uint32 int const char return return return return return return return return Uint32 return Uint32 SDL_Event return SDL_Event int return SDL_EventFilter void SDL_EventFilter void SDL_EventFilter void int return const char const char return SDL_JoystickGUID return int return int return SDL_GameController return int return const char return SDL_GameController SDL_GameControllerAxis return const char return SDL_GameController SDL_GameControllerButton return SDL_GameController SDL_RWops return SDL_TouchID SDL_RWops return int return int return return SDL_Joystick return SDL_Haptic SDL_Haptic return SDL_Haptic return SDL_Haptic SDL_HapticEffect return SDL_Haptic int Uint32 return SDL_Haptic int SDL_Haptic int return SDL_Haptic return SDL_Haptic return SDL_Haptic return SDL_Haptic return const char const char return const char SDL_HintCallback void int return SDL_Joystick return SDL_Joystick return const char return SDL_Joystick return SDL_Joystick return SDL_Joystick return int return SDL_Joystick int return SDL_Joystick int return return return SDL_Scancode return SDL_Scancode return SDL_Keycode return return const char return void int SDL_LogPriority SDL_LogOutputFunction void Uint32 const char const char SDL_Window return int int return SDL_Window int int return SDL_Surface int int return SDL_Cursor return int return SDL_mutex return SDL_mutex return Uint32 return SDL_sem return SDL_sem Uint32 return SDL_sem return SDL_cond SDL_cond return SDL_cond SDL_mutex Uint32 return Uint32 int Uint32 Uint32 Uint32 Uint32 return Uint32 return int return SDL_Palette const SDL_Color int int return const SDL_PixelFormat Uint8 Uint8 Uint8 return Uint32 const SDL_PixelFormat Uint8 Uint8 Uint8 float Uint16 int int return const SDL_Rect const SDL_Rect SDL_Rect return const SDL_Point int const SDL_Rect SDL_Rect return return int int Uint32 SDL_Window SDL_Renderer return SDL_Surface return SDL_Renderer SDL_RendererInfo return SDL_Renderer Uint32 int int int return SDL_Texture Uint32 int int int return SDL_Texture Uint8 Uint8 Uint8 return SDL_Texture Uint8 return SDL_Texture SDL_BlendMode return SDL_Texture const SDL_Rect const Uint8 int const Uint8 int const Uint8 int return SDL_Texture SDL_Renderer SDL_Texture return SDL_Renderer int int return SDL_Renderer const SDL_Rect return SDL_Renderer const SDL_Rect return SDL_Renderer float float return SDL_Renderer Uint8 Uint8 Uint8 Uint8 return SDL_Renderer SDL_BlendMode return SDL_Renderer return SDL_Renderer const SDL_Point int return SDL_Renderer const SDL_Point int return SDL_Renderer const SDL_Rect int return SDL_Renderer const SDL_Rect int return SDL_Renderer SDL_Texture const SDL_Rect const SDL_Rect const double const SDL_Point const SDL_RendererFlip return SDL_Renderer SDL_Renderer SDL_Texture return void int return return SDL_RWops return SDL_RWops return SDL_RWops return SDL_RWops return SDL_RWops Uint16 return SDL_RWops Uint32 return SDL_RWops Uint64 return const char unsigned int unsigned int unsigned int unsigned int Uint32 return SDL_Window SDL_Surface SDL_WindowShapeMode return size_t return void size_t return const char return void size_t size_t int(*) b int return int return int size_t return size_t return const wchar_t return const wchar_t size_t return const char size_t return const char size_t return char return char return const char int return int char int return long char int return Sint64 char int return const char return const char char int return const char char int return const char char return const char const char size_t return const char const char size_t return double return double return double return double return double return double return double int return float return const char const char return SDL_iconv_t const char size_t char size_t return Uint32 int int int Uint32 Uint32 Uint32 Uint32 return SDL_Surface SDL_Surface return SDL_RWops int return SDL_Surface int return SDL_Surface Uint32 return SDL_Surface Uint8 Uint8 Uint8 return SDL_Surface Uint8 return SDL_Surface SDL_BlendMode return SDL_Surface SDL_Rect SDL_Surface Uint32 Uint32 return SDL_Surface const SDL_Rect Uint32 return SDL_Surface const SDL_Rect SDL_Surface SDL_Rect return SDL_Surface const SDL_Rect SDL_Surface const SDL_Rect return SDL_Surface SDL_Rect SDL_Surface SDL_Rect return SDL_Thread return SDL_Thread return SDL_Thread int return SDL_TLSID const void void(*) return return Uint32 SDL_TimerID return int return SDL_TouchID int return return return const char return return int return int return int SDL_DisplayMode return int const SDL_DisplayMode SDL_DisplayMode return SDL_Window const SDL_DisplayMode return SDL_Window return const void return Uint32 return SDL_Window const char SDL_Window SDL_Surface SDL_Window const char return SDL_Window int int SDL_Window int int SDL_Window int int SDL_Window int int SDL_Window SDL_Window SDL_Window SDL_Window Uint32 return SDL_Window return SDL_Window SDL_bool SDL_Window float return SDL_Window const Uint16 const Uint16 const Uint16 return SDL_Window const char return SDL_GLattr int return SDL_Window return return SDL_Window int int return SDL_GLContext SDL_RWops int return return void return int int return double return SDL_bool return int int return SDL_AudioDeviceID const void Uint32 return SDL_AudioDeviceID int float float float return SDL_JoystickID return int SDL_Rect return SDL_Window float return SDL_Window return SDL_Renderer SDL_bool return SDL_AudioDeviceID void Uint32 return Uint32 int int int Uint32 return const char SDL_bool return int return SDL_Joystick return SDL_Joystick return SDL_GameController return return int return int return int return SDL_RWops size_t int return SDL_BlendFactor SDL_BlendFactor SDL_BlendOperation SDL_BlendFactor SDL_BlendFactor SDL_BlendOperation return const char return SDL_Window VkInstance VkSurfaceKHR return SDL_malloc_func SDL_calloc_func SDL_realloc_func SDL_free_func return SDL_AudioStream const void int return SDL_AudioStream SDL_AudioStream float return float return float return float return float return float int return float float return return SDL_Renderer return double return int return double return const wchar_t return SDL_Joystick Uint16 Uint16 Uint32 return int return int return int return SDL_Sensor return SDL_Sensor return SDL_Sensor float int return int return SDL_ThreadFunction const char const size_t void return SDL_Joystick return SDL_Renderer return SDL_Renderer const SDL_FPoint int return SDL_Renderer const SDL_FPoint int return SDL_Renderer const SDL_FRect int return SDL_Renderer const SDL_FRect int return SDL_Renderer SDL_Texture const SDL_Rect const SDL_FRect const double const SDL_FPoint const SDL_RendererFlip return return void SDL_RWops Sint64

Definition at line 210 of file SDL_stdinc.h.

## Sint8

typedef int8_t Sint8

Definition at line 173 of file SDL_stdinc.h.

## Uint16

const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char const char const SDL_SCANF_FORMAT_STRING char return SDL_ThreadFunction const char void return Uint32 return Uint32 SDL_AssertionHandler void SDL_SpinLock SDL_atomic_t int int return SDL_atomic_t return void void void return void return int return SDL_AudioSpec SDL_AudioSpec return int int return return int SDL_RWops int SDL_AudioSpec Uint8 Uint32 return SDL_AudioCVT SDL_AudioFormat Uint8 int SDL_AudioFormat Uint8 int return Uint8 const Uint8 Uint32 int const char return return return return return return return return Uint32 return Uint32 SDL_Event return SDL_Event int return SDL_EventFilter void SDL_EventFilter void SDL_EventFilter void int return const char const char return SDL_JoystickGUID return int return int return SDL_GameController return int return const char return SDL_GameController SDL_GameControllerAxis return const char return SDL_GameController SDL_GameControllerButton return SDL_GameController SDL_RWops return SDL_TouchID SDL_RWops return int return int return return SDL_Joystick return SDL_Haptic SDL_Haptic return SDL_Haptic return SDL_Haptic SDL_HapticEffect return SDL_Haptic int Uint32 return SDL_Haptic int SDL_Haptic int return SDL_Haptic return SDL_Haptic return SDL_Haptic return SDL_Haptic return const char const char return const char SDL_HintCallback void int return SDL_Joystick return SDL_Joystick return const char return SDL_Joystick return SDL_Joystick return SDL_Joystick return int return SDL_Joystick int return SDL_Joystick int return return return SDL_Scancode return SDL_Scancode return SDL_Keycode return return const char return void int SDL_LogPriority SDL_LogOutputFunction void Uint32 const char const char SDL_Window return int int return SDL_Window int int return SDL_Surface int int return SDL_Cursor return int return SDL_mutex return SDL_mutex return Uint32 return SDL_sem return SDL_sem Uint32 return SDL_sem return SDL_cond SDL_cond return SDL_cond SDL_mutex Uint32 return Uint32 int Uint32 Uint32 Uint32 Uint32 return Uint32 return int return SDL_Palette const SDL_Color int int return const SDL_PixelFormat Uint8 Uint8 Uint8 return Uint32 const SDL_PixelFormat Uint8 Uint8 Uint8 float Uint16 int int return const SDL_Rect const SDL_Rect SDL_Rect return const SDL_Point int const SDL_Rect SDL_Rect return return int int Uint32 SDL_Window SDL_Renderer return SDL_Surface return SDL_Renderer SDL_RendererInfo return SDL_Renderer Uint32 int int int return SDL_Texture Uint32 int int int return SDL_Texture Uint8 Uint8 Uint8 return SDL_Texture Uint8 return SDL_Texture SDL_BlendMode return SDL_Texture const SDL_Rect const Uint8 int const Uint8 int const Uint8 int return SDL_Texture SDL_Renderer SDL_Texture return SDL_Renderer int int return SDL_Renderer const SDL_Rect return SDL_Renderer const SDL_Rect return SDL_Renderer float float return SDL_Renderer Uint8 Uint8 Uint8 Uint8 return SDL_Renderer SDL_BlendMode return SDL_Renderer return SDL_Renderer const SDL_Point int return SDL_Renderer const SDL_Point int return SDL_Renderer const SDL_Rect int return SDL_Renderer const SDL_Rect int return SDL_Renderer SDL_Texture const SDL_Rect const SDL_Rect const double const SDL_Point const SDL_RendererFlip return SDL_Renderer SDL_Renderer SDL_Texture return void int return return SDL_RWops return SDL_RWops return SDL_RWops return SDL_RWops return SDL_RWops Uint16 return SDL_RWops Uint32 return SDL_RWops Uint64 return const char unsigned int unsigned int unsigned int unsigned int Uint32 return SDL_Window SDL_Surface SDL_WindowShapeMode return size_t return void size_t return const char return void size_t size_t int(*) c int return int return int size_t return size_t return const wchar_t return const wchar_t size_t return const char size_t return const char size_t return char return char return const char int return int char int return long char int return Sint64 char int return const char return const char char int return const char char int return const char char return const char const char size_t return const char const char size_t return double return double return double return double return double return double return double int return float return const char const char return SDL_iconv_t const char size_t char size_t return Uint32 int int int Uint32 Uint32 Uint32 Uint32 return SDL_Surface SDL_Surface return SDL_RWops int return SDL_Surface int return SDL_Surface Uint32 return SDL_Surface Uint8 Uint8 Uint8 return SDL_Surface Uint8 return SDL_Surface SDL_BlendMode return SDL_Surface SDL_Rect SDL_Surface Uint32 Uint32 return SDL_Surface const SDL_Rect Uint32 return SDL_Surface const SDL_Rect SDL_Surface SDL_Rect return SDL_Surface const SDL_Rect SDL_Surface const SDL_Rect return SDL_Surface SDL_Rect SDL_Surface SDL_Rect return SDL_Thread return SDL_Thread return SDL_Thread int return SDL_TLSID const void void(*) return return Uint32 SDL_TimerID return int return SDL_TouchID int return return return const char return return int return int return int SDL_DisplayMode return int const SDL_DisplayMode SDL_DisplayMode return SDL_Window const SDL_DisplayMode return SDL_Window return const void return Uint32 return SDL_Window const char SDL_Window SDL_Surface SDL_Window const char return SDL_Window int int SDL_Window int int SDL_Window int int SDL_Window int int SDL_Window SDL_Window SDL_Window SDL_Window Uint32 return SDL_Window return SDL_Window SDL_bool SDL_Window float return SDL_Window const Uint16 const Uint16 const Uint16 return SDL_Window const char return SDL_GLattr int return SDL_Window return return SDL_Window int int return SDL_GLContext SDL_RWops int return return void return int int return double return SDL_bool return int int return SDL_AudioDeviceID const void Uint32 return SDL_AudioDeviceID int float float float return SDL_JoystickID return int SDL_Rect return SDL_Window float return SDL_Window return SDL_Renderer SDL_bool return SDL_AudioDeviceID void Uint32 return Uint32 int int int Uint32 return const char SDL_bool return int return SDL_Joystick return SDL_Joystick return SDL_GameController return return int return int return int return SDL_RWops size_t int return SDL_BlendFactor SDL_BlendFactor SDL_BlendOperation SDL_BlendFactor SDL_BlendFactor SDL_BlendOperation return const char return SDL_Window VkInstance VkSurfaceKHR return SDL_malloc_func SDL_calloc_func SDL_realloc_func SDL_free_func return SDL_AudioStream const void int return SDL_AudioStream SDL_AudioStream float return float return float return float return float return float int return float float return return SDL_Renderer return double return int return double return const wchar_t return SDL_Joystick Uint16 Uint16

Definition at line 191 of file SDL_stdinc.h.

## Uint32

const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char const char const SDL_SCANF_FORMAT_STRING char return SDL_ThreadFunction const char void return Uint32 return Uint32 SDL_AssertionHandler void SDL_SpinLock SDL_atomic_t int int return SDL_atomic_t return void void void return void return int return SDL_AudioSpec SDL_AudioSpec return int int return return int SDL_RWops int SDL_AudioSpec Uint8 Uint32 return SDL_AudioCVT SDL_AudioFormat Uint8 int SDL_AudioFormat Uint8 int return Uint8 const Uint8 Uint32 int const char return return return return return return return return Uint32 return Uint32 SDL_Event return SDL_Event int return SDL_EventFilter void SDL_EventFilter void SDL_EventFilter void int return const char const char return SDL_JoystickGUID return int return int return SDL_GameController return int return const char return SDL_GameController SDL_GameControllerAxis return const char return SDL_GameController SDL_GameControllerButton return SDL_GameController SDL_RWops return SDL_TouchID SDL_RWops return int return int return return SDL_Joystick return SDL_Haptic SDL_Haptic return SDL_Haptic return SDL_Haptic SDL_HapticEffect return SDL_Haptic int Uint32 return SDL_Haptic int SDL_Haptic int return SDL_Haptic return SDL_Haptic return SDL_Haptic return SDL_Haptic return const char const char return const char SDL_HintCallback void int return SDL_Joystick return SDL_Joystick return const char return SDL_Joystick return SDL_Joystick return SDL_Joystick return int return SDL_Joystick int return SDL_Joystick int return return return SDL_Scancode return SDL_Scancode return SDL_Keycode return return const char return void int SDL_LogPriority SDL_LogOutputFunction void Uint32 const char const char SDL_Window return int int return SDL_Window int int return SDL_Surface int int return SDL_Cursor return int return SDL_mutex return SDL_mutex return Uint32 return SDL_sem return SDL_sem Uint32 return SDL_sem return SDL_cond SDL_cond return SDL_cond SDL_mutex Uint32 return Uint32 int Uint32 Uint32 Uint32 Uint32 return Uint32 return int return SDL_Palette const SDL_Color int int return const SDL_PixelFormat Uint8 Uint8 Uint8 return Uint32 const SDL_PixelFormat Uint8 Uint8 Uint8 float Uint16 int int return const SDL_Rect const SDL_Rect SDL_Rect return const SDL_Point int const SDL_Rect SDL_Rect return return int int Uint32 SDL_Window SDL_Renderer return SDL_Surface return SDL_Renderer SDL_RendererInfo return SDL_Renderer Uint32 int int int return SDL_Texture Uint32 int int int return SDL_Texture Uint8 Uint8 Uint8 return SDL_Texture Uint8 return SDL_Texture SDL_BlendMode return SDL_Texture const SDL_Rect const Uint8 int const Uint8 int const Uint8 int return SDL_Texture SDL_Renderer SDL_Texture return SDL_Renderer int int return SDL_Renderer const SDL_Rect return SDL_Renderer const SDL_Rect return SDL_Renderer float float return SDL_Renderer Uint8 Uint8 Uint8 Uint8 return SDL_Renderer SDL_BlendMode return SDL_Renderer return SDL_Renderer const SDL_Point int return SDL_Renderer const SDL_Point int return SDL_Renderer const SDL_Rect int return SDL_Renderer const SDL_Rect int return SDL_Renderer SDL_Texture const SDL_Rect const SDL_Rect const double const SDL_Point const SDL_RendererFlip return SDL_Renderer SDL_Renderer SDL_Texture return void int return return SDL_RWops return SDL_RWops return SDL_RWops return SDL_RWops return SDL_RWops Uint16 return SDL_RWops Uint32 return SDL_RWops Uint64 return const char unsigned int unsigned int unsigned int unsigned int Uint32 return SDL_Window SDL_Surface SDL_WindowShapeMode return size_t return void size_t return const char return void size_t size_t int(*) d int return int return int size_t return size_t return const wchar_t return const wchar_t size_t return const char size_t return const char size_t return char return char return const char int return int char int return long char int return Sint64 char int return const char return const char char int return const char char int return const char char return const char const char size_t return const char const char size_t return double return double return double return double return double return double return double int return float return const char const char return SDL_iconv_t const char size_t char size_t return Uint32 int int int Uint32 Uint32 Uint32 Uint32 return SDL_Surface SDL_Surface return SDL_RWops int return SDL_Surface int return SDL_Surface Uint32 return SDL_Surface Uint8 Uint8 Uint8 return SDL_Surface Uint8 return SDL_Surface SDL_BlendMode return SDL_Surface SDL_Rect SDL_Surface Uint32 Uint32 return SDL_Surface const SDL_Rect Uint32 return SDL_Surface const SDL_Rect SDL_Surface SDL_Rect return SDL_Surface const SDL_Rect SDL_Surface const SDL_Rect return SDL_Surface SDL_Rect SDL_Surface SDL_Rect return SDL_Thread return SDL_Thread return SDL_Thread int return SDL_TLSID const void void(*) return return Uint32 SDL_TimerID return int return SDL_TouchID int return return return const char return return int return int return int SDL_DisplayMode return int const SDL_DisplayMode SDL_DisplayMode return SDL_Window const SDL_DisplayMode return SDL_Window return const void return Uint32 return SDL_Window const char SDL_Window SDL_Surface SDL_Window const char return SDL_Window int int SDL_Window int int SDL_Window int int SDL_Window int int SDL_Window SDL_Window SDL_Window SDL_Window Uint32 return SDL_Window return SDL_Window SDL_bool SDL_Window float return SDL_Window const Uint16 const Uint16 const Uint16 return SDL_Window const char return SDL_GLattr int return SDL_Window return return SDL_Window int int return SDL_GLContext SDL_RWops int return return void return int int return double return SDL_bool return int int return SDL_AudioDeviceID const void Uint32 return SDL_AudioDeviceID int float float float return SDL_JoystickID return int SDL_Rect return SDL_Window float return SDL_Window return SDL_Renderer SDL_bool return SDL_AudioDeviceID void Uint32 return Uint32 int int int Uint32 return const char SDL_bool return int return SDL_Joystick return SDL_Joystick return SDL_GameController return return int return int return int return SDL_RWops size_t int return SDL_BlendFactor SDL_BlendFactor SDL_BlendOperation SDL_BlendFactor SDL_BlendFactor SDL_BlendOperation return const char return SDL_Window VkInstance VkSurfaceKHR return SDL_malloc_func SDL_calloc_func SDL_realloc_func SDL_free_func return SDL_AudioStream const void int return SDL_AudioStream SDL_AudioStream float return float return float return float return float return float int return float float return return SDL_Renderer return double return int return double return const wchar_t return SDL_Joystick Uint16 Uint16 Uint32

Definition at line 203 of file SDL_stdinc.h.

## Uint64

typedef uint64_t Uint64

Definition at line 216 of file SDL_stdinc.h.

## Uint8

const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char const char const SDL_SCANF_FORMAT_STRING char return SDL_ThreadFunction const char void return Uint32 return Uint32 SDL_AssertionHandler void SDL_SpinLock SDL_atomic_t int int return SDL_atomic_t return void void void return void return int return SDL_AudioSpec SDL_AudioSpec return int int return return int SDL_RWops int SDL_AudioSpec Uint8 Uint32 return SDL_AudioCVT SDL_AudioFormat Uint8 int SDL_AudioFormat Uint8 int return Uint8 const Uint8 Uint32 int const char return return return return return return return return Uint32 return Uint32 SDL_Event return SDL_Event int return SDL_EventFilter void SDL_EventFilter void SDL_EventFilter void int return const char const char return SDL_JoystickGUID return int return int return SDL_GameController return int return const char return SDL_GameController SDL_GameControllerAxis return const char return SDL_GameController SDL_GameControllerButton return SDL_GameController SDL_RWops return SDL_TouchID SDL_RWops return int return int return return SDL_Joystick return SDL_Haptic SDL_Haptic return SDL_Haptic return SDL_Haptic SDL_HapticEffect return SDL_Haptic int Uint32 return SDL_Haptic int SDL_Haptic int return SDL_Haptic return SDL_Haptic return SDL_Haptic return SDL_Haptic return const char const char return const char SDL_HintCallback void int return SDL_Joystick return SDL_Joystick return const char return SDL_Joystick return SDL_Joystick return SDL_Joystick return int return SDL_Joystick int return SDL_Joystick int return return return SDL_Scancode return SDL_Scancode return SDL_Keycode return return const char return void int SDL_LogPriority SDL_LogOutputFunction void Uint32 const char const char SDL_Window return int int return SDL_Window int int return SDL_Surface int int return SDL_Cursor return int return SDL_mutex return SDL_mutex return Uint32 return SDL_sem return SDL_sem Uint32 return SDL_sem return SDL_cond SDL_cond return SDL_cond SDL_mutex Uint32 return Uint32 int Uint32 Uint32 Uint32 Uint32 return Uint32 return int return SDL_Palette const SDL_Color int int return const SDL_PixelFormat Uint8 Uint8 Uint8 return Uint32 const SDL_PixelFormat Uint8 Uint8 Uint8 float Uint16 int int return const SDL_Rect const SDL_Rect SDL_Rect return const SDL_Point int const SDL_Rect SDL_Rect return return int int Uint32 SDL_Window SDL_Renderer return SDL_Surface return SDL_Renderer SDL_RendererInfo return SDL_Renderer Uint32 int int int return SDL_Texture Uint32 int int int return SDL_Texture Uint8 Uint8 Uint8 return SDL_Texture Uint8 return SDL_Texture SDL_BlendMode return SDL_Texture const SDL_Rect const Uint8 int const Uint8 int const Uint8 int return SDL_Texture SDL_Renderer SDL_Texture return SDL_Renderer int int return SDL_Renderer const SDL_Rect return SDL_Renderer const SDL_Rect return SDL_Renderer float float return SDL_Renderer Uint8 Uint8 Uint8 Uint8 return SDL_Renderer SDL_BlendMode return SDL_Renderer return SDL_Renderer const SDL_Point int return SDL_Renderer const SDL_Point int return SDL_Renderer const SDL_Rect int return SDL_Renderer const SDL_Rect int return SDL_Renderer SDL_Texture const SDL_Rect const SDL_Rect const double const SDL_Point const SDL_RendererFlip return SDL_Renderer SDL_Renderer SDL_Texture return void int return return SDL_RWops return SDL_RWops return SDL_RWops return SDL_RWops return SDL_RWops Uint16 return SDL_RWops Uint32 return SDL_RWops Uint64 return const char unsigned int unsigned int unsigned int unsigned int Uint32 return SDL_Window SDL_Surface SDL_WindowShapeMode return size_t return void size_t return const char return void size_t size_t int(*) b int return int return int size_t return size_t return const wchar_t return const wchar_t size_t return const char size_t return const char size_t return char return char return const char int return int char int return long char int return Sint64 char int return const char return const char char int return const char char int return const char char return const char const char size_t return const char const char size_t return double return double return double return double return double return double return double int return float return const char const char return SDL_iconv_t const char size_t char size_t return Uint32 int int int Uint32 Uint32 Uint32 Uint32 return SDL_Surface SDL_Surface return SDL_RWops int return SDL_Surface int return SDL_Surface Uint32 return SDL_Surface Uint8 Uint8 Uint8 return SDL_Surface Uint8

Definition at line 179 of file SDL_stdinc.h.

## Enumeration Type Documentation

## SDL_bool

enum const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char const char const SDL_SCANF_FORMAT_STRING char return SDL_ThreadFunction const char void return Uint32 return Uint32 SDL_AssertionHandler void SDL_SpinLock SDL_atomic_t int int return SDL_atomic_t return void void void return void return int return SDL_AudioSpec SDL_AudioSpec return int int return return int SDL_RWops int SDL_AudioSpec Uint8 Uint32 return SDL_AudioCVT SDL_AudioFormat Uint8 int SDL_AudioFormat Uint8 int return Uint8 const Uint8 Uint32 int const char return return return return return return return return Uint32 return Uint32 SDL_Event return SDL_Event int return SDL_EventFilter void SDL_EventFilter void SDL_EventFilter void int return const char const char return SDL_JoystickGUID return int return int return SDL_GameController return int return const char return SDL_GameController SDL_GameControllerAxis return const char return SDL_GameController SDL_GameControllerButton return SDL_GameController SDL_RWops return SDL_TouchID SDL_RWops return int return int return return SDL_Joystick return SDL_Haptic SDL_Haptic return SDL_Haptic return SDL_Haptic SDL_HapticEffect return SDL_Haptic int Uint32 return SDL_Haptic int SDL_Haptic int return SDL_Haptic return SDL_Haptic return SDL_Haptic return SDL_Haptic return const char const char return const char SDL_HintCallback void int return SDL_Joystick return SDL_Joystick return const char return SDL_Joystick return SDL_Joystick return SDL_Joystick return int return SDL_Joystick int return SDL_Joystick int return return return SDL_Scancode return SDL_Scancode return SDL_Keycode return return const char return void int SDL_LogPriority SDL_LogOutputFunction void Uint32 const char const char SDL_Window return int int return SDL_Window int int return SDL_Surface int int return SDL_Cursor return int return SDL_mutex return SDL_mutex return Uint32 return SDL_sem return SDL_sem Uint32 return SDL_sem return SDL_cond SDL_cond return SDL_cond SDL_mutex Uint32 return Uint32 int Uint32 Uint32 Uint32 Uint32 return Uint32 return int return SDL_Palette const SDL_Color int int return const SDL_PixelFormat Uint8 Uint8 Uint8 return Uint32 const SDL_PixelFormat Uint8 Uint8 Uint8 float Uint16 int int return const SDL_Rect const SDL_Rect SDL_Rect return const SDL_Point int const SDL_Rect SDL_Rect return return int int Uint32 SDL_Window SDL_Renderer return SDL_Surface return SDL_Renderer SDL_RendererInfo return SDL_Renderer Uint32 int int int return SDL_Texture Uint32 int int int return SDL_Texture Uint8 Uint8 Uint8 return SDL_Texture Uint8 return SDL_Texture SDL_BlendMode return SDL_Texture const SDL_Rect const Uint8 int const Uint8 int const Uint8 int return SDL_Texture SDL_Renderer SDL_Texture return SDL_Renderer int int return SDL_Renderer const SDL_Rect return SDL_Renderer const SDL_Rect return SDL_Renderer float float return SDL_Renderer Uint8 Uint8 Uint8 Uint8 return SDL_Renderer SDL_BlendMode return SDL_Renderer return SDL_Renderer const SDL_Point int return SDL_Renderer const SDL_Point int return SDL_Renderer const SDL_Rect int return SDL_Renderer const SDL_Rect int return SDL_Renderer SDL_Texture const SDL_Rect const SDL_Rect const double const SDL_Point const SDL_RendererFlip return SDL_Renderer SDL_Renderer SDL_Texture return void int return return SDL_RWops return SDL_RWops return SDL_RWops return SDL_RWops return SDL_RWops Uint16 return SDL_RWops Uint32 return SDL_RWops Uint64 return const char unsigned int unsigned int unsigned int unsigned int Uint32 return SDL_Window SDL_Surface SDL_WindowShapeMode return size_t return void size_t return const char return void size_t size_t int(*) b int return int return int size_t return size_t return const wchar_t return const wchar_t size_t return const char size_t return const char size_t return char return char return const char int return int char int return long char int return Sint64 char int return const char return const char char int return const char char int return const char char return const char const char size_t return const char const char size_t return double return double return double return double return double return double return double int return float return const char const char return SDL_iconv_t const char size_t char size_t return Uint32 int int int Uint32 Uint32 Uint32 Uint32 return SDL_Surface SDL_Surface return SDL_RWops int return SDL_Surface int return SDL_Surface Uint32 return SDL_Surface Uint8 Uint8 Uint8 return SDL_Surface Uint8 return SDL_Surface SDL_BlendMode return SDL_Surface SDL_Rect SDL_Surface Uint32 Uint32 return SDL_Surface const SDL_Rect Uint32 return SDL_Surface const SDL_Rect SDL_Surface SDL_Rect return SDL_Surface const SDL_Rect SDL_Surface const SDL_Rect return SDL_Surface SDL_Rect SDL_Surface SDL_Rect return SDL_Thread return SDL_Thread return SDL_Thread int return SDL_TLSID const void void(*) return return Uint32 SDL_TimerID return int return SDL_TouchID int return return return const char return return int return int return int SDL_DisplayMode return int const SDL_DisplayMode SDL_DisplayMode return SDL_Window const SDL_DisplayMode return SDL_Window return const void return Uint32 return SDL_Window const char SDL_Window SDL_Surface SDL_Window const char return SDL_Window int int SDL_Window int int SDL_Window int int SDL_Window int int SDL_Window SDL_Window SDL_Window SDL_Window Uint32 return SDL_Window return SDL_Window SDL_bool SDL_Window float return SDL_Window const Uint16 const Uint16 const Uint16 return SDL_Window const char return SDL_GLattr int return SDL_Window return return SDL_Window int int return SDL_GLContext SDL_RWops int return return void return int int return double return SDL_bool return int int return SDL_AudioDeviceID const void Uint32 return SDL_AudioDeviceID int float float float return SDL_JoystickID return int SDL_Rect return SDL_Window float return SDL_Window return SDL_Renderer SDL_bool return SDL_AudioDeviceID void Uint32 return Uint32 int int int Uint32 return const char SDL_bool

Enumerator
SDL_FALSE |
SDL_TRUE |

Definition at line 161 of file SDL_stdinc.h.

{
SDL_FALSE = 0,
SDL_TRUE = 1
} SDL_bool;

## Function Documentation

## SDL_abs()

int SDL_abs | ( | int | x | ) |

Definition at line 429 of file SDL_stdlib.c.

{
#if defined(HAVE_ABS)
return abs(x);
#else
return ((x) < 0 ? -(x) : (x));
#endif
}

## SDL_acos()

double SDL_acos | ( | double | x | ) |

Definition at line 75 of file SDL_stdlib.c.

{
#if defined(HAVE_ACOS)
return acos(val);
#else
double result;
if (val == -1.0) {
result = M_PI;
} else {
result = SDL_atan(SDL_sqrt(1.0 - val * val) / val);
if (result < 0.0)
{
result += M_PI;
}
}
return result;
#endif
}

References SDL_atan(), and SDL_sqrt().

Referenced by SDL_acosf(), and SDL_asin().

## SDL_acosf()

float SDL_acosf | ( | float | x | ) |

Definition at line 95 of file SDL_stdlib.c.

{
#if defined(HAVE_ACOSF)
return acosf(val);
#else
return (float)SDL_acos((double)val);
#endif
}

References SDL_acos().

## SDL_asin()

double SDL_asin | ( | double | x | ) |

Definition at line 105 of file SDL_stdlib.c.

{
#if defined(HAVE_ASIN)
return asin(val);
#else
double result;
if (val == -1.0) {
result = -(M_PI / 2.0);
} else {
result = (M_PI / 2.0) - SDL_acos(val);
}
return result;
#endif
}

References SDL_acos().

Referenced by SDL_asinf().

## SDL_asinf()

float SDL_asinf | ( | float | x | ) |

Definition at line 121 of file SDL_stdlib.c.

{
#if defined(HAVE_ASINF)
return asinf(val);
#else
return (float)SDL_asin((double)val);
#endif
}

References SDL_asin().

## SDL_atan()

double SDL_atan | ( | double | x | ) |

Definition at line 35 of file SDL_stdlib.c.

{
#if defined(HAVE_ATAN)
return atan(x);
#else
return SDL_uclibc_atan(x);
#endif
}

References atan(), and SDL_uclibc_atan().

Referenced by SDL_acos(), and SDL_atanf().

## SDL_atan2()

double SDL_atan2 | ( | double | x,
|  | double | y
| ) |  |

Definition at line 55 of file SDL_stdlib.c.

{
#if defined(HAVE_ATAN2)
return atan2(x, y);
#else
return SDL_uclibc_atan2(x, y);
#endif
}

References SDL_uclibc_atan2().

Referenced by SDL_atan2f().

## SDL_atan2f()

float SDL_atan2f | ( | float | x,
|  | float | y
| ) |  |

Definition at line 65 of file SDL_stdlib.c.

{
#if defined(HAVE_ATAN2F)
return atan2f(x, y);
#else
return (float)SDL_atan2((double)x, (double)y);
#endif
}

References SDL_atan2().

## SDL_atanf()

float SDL_atanf | ( | float | x | ) |

Definition at line 45 of file SDL_stdlib.c.

{
#if defined(HAVE_ATANF)
return atanf(x);
#else
return (float)SDL_atan((double)x);
#endif
}

References SDL_atan().

## SDL_atof()

double SDL_atof | ( | const char * | str | ) |

Definition at line 818 of file SDL_string.c.

{
#ifdef HAVE_ATOF
return (double) atof(string);
#else
return SDL_strtod(string, NULL);
#endif /* HAVE_ATOF */
}

References NULL, and SDL_strtod().

## SDL_atoi()

int SDL_atoi | ( | const char * | str | ) |

Definition at line 809 of file SDL_string.c.

{
#ifdef HAVE_ATOI
return atoi(string);
#else
return SDL_strtol(string, NULL, 0);
#endif /* HAVE_ATOI */
}

References NULL, and SDL_strtol().

## SDL_calloc()

void* SDL_calloc | ( | size_t | nmemb,
|  | size_t | size
| ) |  |

Definition at line 5394 of file SDL_malloc.c.

{
void *mem;
if (!nmemb || !size) {
nmemb = 1;
size = 1;
}
mem = s_mem.calloc_func(nmemb, size);
if (mem) {
SDL_AtomicIncRef(&s_mem.num_allocations);
}
return mem;
}

References s_mem, and SDL_AtomicIncRef.

## SDL_ceil()

double SDL_ceil | ( | double | x | ) |

Definition at line 131 of file SDL_stdlib.c.

{
#if defined(HAVE_CEIL)
return ceil(x);
#else
double integer = SDL_floor(x);
double fraction = x - integer;
if (fraction > 0.0) {
integer += 1.0;
}
return integer;
#endif /* HAVE_CEIL */
}

References SDL_floor().

Referenced by SDL_ceilf().

## SDL_ceilf()

float SDL_ceilf | ( | float | x | ) |

Definition at line 146 of file SDL_stdlib.c.

{
#if defined(HAVE_CEILF)
return ceilf(x);
#else
return (float)SDL_ceil((float)x);
#endif
}

References SDL_ceil().

## SDL_copysign()

double SDL_copysign | ( | double | x,
|  | double | y
| ) |  |

Definition at line 156 of file SDL_stdlib.c.

{
#if defined(HAVE_COPYSIGN)
return copysign(x, y);
#elif defined(HAVE__COPYSIGN)
return _copysign(x, y);
#elif defined(__WATCOMC__) && defined(__386__)
/* this is nasty as hell, but it works.. */
unsigned int *xi = (unsigned int *) &x,
*yi = (unsigned int *) &y;
xi[1] = (yi[1] & 0x80000000) | (xi[1] & 0x7fffffff);
return x;
#else
return SDL_uclibc_copysign(x, y);
#endif /* HAVE_COPYSIGN */
}

References copysign(), and SDL_uclibc_copysign().

Referenced by SDL_copysignf().

## SDL_copysignf()

float SDL_copysignf | ( | float | x,
|  | float | y
| ) |  |

Definition at line 174 of file SDL_stdlib.c.

{
#if defined(HAVE_COPYSIGNF)
return copysignf(x, y);
#else
return (float)SDL_copysign((double)x, (double)y);
#endif
}

References SDL_copysign().

## SDL_cos()

double SDL_cos | ( | double | x | ) |

Definition at line 184 of file SDL_stdlib.c.

{
#if defined(HAVE_COS)
return cos(x);
#else
return SDL_uclibc_cos(x);
#endif
}

References cos(), and SDL_uclibc_cos().

Referenced by SDL_cosf().

## SDL_cosf()

float SDL_cosf | ( | float | x | ) |

Definition at line 194 of file SDL_stdlib.c.

{
#if defined(HAVE_COSF)
return cosf(x);
#else
return (float)SDL_cos((double)x);
#endif
}

References SDL_cos().

## SDL_exp()

double SDL_exp | ( | double | x | ) |

Definition at line 204 of file SDL_stdlib.c.

{
#if defined(HAVE_EXP)
return exp(x);
#else
return SDL_uclibc_exp(x);
#endif
}

References SDL_uclibc_exp().

Referenced by SDL_expf().

## SDL_expf()

float SDL_expf | ( | float | x | ) |

Definition at line 214 of file SDL_stdlib.c.

{
#if defined(HAVE_EXPF)
return expf(x);
#else
return (float)SDL_exp((double)x);
#endif
}

References SDL_exp().

## SDL_fabs()

double SDL_fabs | ( | double | x | ) |

Definition at line 224 of file SDL_stdlib.c.

{
#if defined(HAVE_FABS)
return fabs(x);
#else
return SDL_uclibc_fabs(x);
#endif
}

References fabs(), and SDL_uclibc_fabs().

Referenced by SDL_fabsf().

## SDL_fabsf()

float SDL_fabsf | ( | float | x | ) |

Definition at line 234 of file SDL_stdlib.c.

{
#if defined(HAVE_FABSF)
return fabsf(x);
#else
return (float)SDL_fabs((double)x);
#endif
}

References SDL_fabs().

## SDL_floor()

double SDL_floor | ( | double | x | ) |

Definition at line 244 of file SDL_stdlib.c.

{
#if defined(HAVE_FLOOR)
return floor(x);
#else
return SDL_uclibc_floor(x);
#endif
}

References floor(), and SDL_uclibc_floor().

Referenced by SDL_ceil(), and SDL_floorf().

## SDL_floorf()

float SDL_floorf | ( | float | x | ) |

Definition at line 254 of file SDL_stdlib.c.

{
#if defined(HAVE_FLOORF)
return floorf(x);
#else
return (float)SDL_floor((double)x);
#endif
}

References SDL_floor().

## SDL_fmod()

double SDL_fmod | ( | double | x,
|  | double | y
| ) |  |

Definition at line 264 of file SDL_stdlib.c.

{
#if defined(HAVE_FMOD)
return fmod(x, y);
#else
return SDL_uclibc_fmod(x, y);
#endif
}

References SDL_uclibc_fmod().

Referenced by SDL_fmodf().

## SDL_fmodf()

float SDL_fmodf | ( | float | x,
|  | float | y
| ) |  |

Definition at line 274 of file SDL_stdlib.c.

{
#if defined(HAVE_FMODF)
return fmodf(x, y);
#else
return (float)SDL_fmod((double)x, (double)y);
#endif
}

References SDL_fmod().

## SDL_free()

void SDL_free | ( | void * | mem | ) |

Definition at line 5425 of file SDL_malloc.c.

{
if (!ptr) {
return;
}
s_mem.free_func(ptr);
(void)SDL_AtomicDecRef(&s_mem.num_allocations);
}

References s_mem, SDL_AtomicDecRef, and void.

## SDL_getenv()

char* SDL_getenv | ( | const char * | name | ) |

Definition at line 219 of file SDL_getenv.c.

{
int len, i;
char *value;
/* Input validation */
if (!name || SDL_strlen(name)==0) {
return NULL;
}
value = (char *) 0;
if (SDL_env) {
len = SDL_strlen(name);
for (i = 0; SDL_env[i] && !value; ++i) {
if ((SDL_strncmp(SDL_env[i], name, len) == 0) &&
(SDL_env[i][len] == '=')) {
value = &SDL_env[i][len + 1];
}
}
}
return value;
}

References i, NULL, SDL_env, SDL_strlen, and SDL_strncmp.

Referenced by SDL_setenv().

## SDL_GetMemoryFunctions()

void SDL_GetMemoryFunctions | ( | SDL_malloc_func * | malloc_func,
|  | SDL_calloc_func * | calloc_func,
|  | SDL_realloc_func * | realloc_func,
|  | SDL_free_func * | free_func
| ) |  |

Get the current set of SDL memory functions.

Definition at line 5330 of file SDL_malloc.c.

{
if (malloc_func) {
*malloc_func = s_mem.malloc_func;
}
if (calloc_func) {
*calloc_func = s_mem.calloc_func;
}
if (realloc_func) {
*realloc_func = s_mem.realloc_func;
}
if (free_func) {
*free_func = s_mem.free_func;
}
}

References calloc_func, free_func, malloc_func, realloc_func, and s_mem.

## SDL_GetNumAllocations()

int SDL_GetNumAllocations | ( | void |  | ) |

Get the number of outstanding (unfreed) allocations.

Definition at line 676 of file SDL_dynapi_procs.h.

References s_mem, and SDL_AtomicGet.

## SDL_iconv()

size_t SDL_iconv | ( | SDL_iconv_t | cd,
|  | const char ** | inbuf,
|  | size_t * | inbytesleft,
|  | char ** | outbuf,
|  | size_t * | outbytesleft
| ) |  |

Definition at line 248 of file SDL_iconv.c.

{
/* For simplicity, we'll convert everything to and from UCS-4 */
const char *src;
char *dst;
size_t srclen, dstlen;
Uint32 ch = 0;
size_t total;
if (!inbuf || !*inbuf) {
/* Reset the context */
return 0;
}
if (!outbuf || !*outbuf || !outbytesleft || !*outbytesleft) {
return SDL_ICONV_E2BIG;
}
src = *inbuf;
srclen = (inbytesleft ? *inbytesleft : 0);
dst = *outbuf;
dstlen = *outbytesleft;
switch (cd->src_fmt) {
case ENCODING_UTF16:
/* Scan for a byte order marker */
{
Uint8 *p = (Uint8 *) src;
size_t n = srclen / 2;
while (n) {
if (p[0] == 0xFF && p[1] == 0xFE) {
cd->src_fmt = ENCODING_UTF16BE;
break;
} else if (p[0] == 0xFE && p[1] == 0xFF) {
cd->src_fmt = ENCODING_UTF16LE;
break;
}
p += 2;
--n;
}
if (n == 0) {
/* We can't tell, default to host order */
cd->src_fmt = ENCODING_UTF16NATIVE;
}
}
break;
case ENCODING_UTF32:
/* Scan for a byte order marker */
{
Uint8 *p = (Uint8 *) src;
size_t n = srclen / 4;
while (n) {
if (p[0] == 0xFF && p[1] == 0xFE &&
p[2] == 0x00 && p[3] == 0x00) {
cd->src_fmt = ENCODING_UTF32BE;
break;
} else if (p[0] == 0x00 && p[1] == 0x00 &&
p[2] == 0xFE && p[3] == 0xFF) {
cd->src_fmt = ENCODING_UTF32LE;
break;
}
p += 4;
--n;
}
if (n == 0) {
/* We can't tell, default to host order */
cd->src_fmt = ENCODING_UTF32NATIVE;
}
}
break;
}
switch (cd->dst_fmt) {
case ENCODING_UTF16:
/* Default to host order, need to add byte order marker */
if (dstlen < 2) {
return SDL_ICONV_E2BIG;
}
*(Uint16 *) dst = UNICODE_BOM;
dst += 2;
dstlen -= 2;
cd->dst_fmt = ENCODING_UTF16NATIVE;
break;
case ENCODING_UTF32:
/* Default to host order, need to add byte order marker */
if (dstlen < 4) {
return SDL_ICONV_E2BIG;
}
*(Uint32 *) dst = UNICODE_BOM;
dst += 4;
dstlen -= 4;
cd->dst_fmt = ENCODING_UTF32NATIVE;
break;
}
total = 0;
while (srclen > 0) {
/* Decode a character */
switch (cd->src_fmt) {
case ENCODING_ASCII:
{
Uint8 *p = (Uint8 *) src;
ch = (Uint32) (p[0] & 0x7F);
++src;
--srclen;
}
break;
case ENCODING_LATIN1:
{
Uint8 *p = (Uint8 *) src;
ch = (Uint32) p[0];
++src;
--srclen;
}
break;
case ENCODING_UTF8: /* RFC 3629 */
{
Uint8 *p = (Uint8 *) src;
size_t left = 0;
SDL_bool overlong = SDL_FALSE;
if (p[0] >= 0xFC) {
if ((p[0] & 0xFE) != 0xFC) {
/* Skip illegal sequences
return SDL_ICONV_EILSEQ;
*/
ch = UNKNOWN_UNICODE;
} else {
if (p[0] == 0xFC && srclen > 1 && (p[1] & 0xFC) == 0x80) {
overlong = SDL_TRUE;
}
ch = (Uint32) (p[0] & 0x01);
left = 5;
}
} else if (p[0] >= 0xF8) {
if ((p[0] & 0xFC) != 0xF8) {
/* Skip illegal sequences
return SDL_ICONV_EILSEQ;
*/
ch = UNKNOWN_UNICODE;
} else {
if (p[0] == 0xF8 && srclen > 1 && (p[1] & 0xF8) == 0x80) {
overlong = SDL_TRUE;
}
ch = (Uint32) (p[0] & 0x03);
left = 4;
}
} else if (p[0] >= 0xF0) {
if ((p[0] & 0xF8) != 0xF0) {
/* Skip illegal sequences
return SDL_ICONV_EILSEQ;
*/
ch = UNKNOWN_UNICODE;
} else {
if (p[0] == 0xF0 && srclen > 1 && (p[1] & 0xF0) == 0x80) {
overlong = SDL_TRUE;
}
ch = (Uint32) (p[0] & 0x07);
left = 3;
}
} else if (p[0] >= 0xE0) {
if ((p[0] & 0xF0) != 0xE0) {
/* Skip illegal sequences
return SDL_ICONV_EILSEQ;
*/
ch = UNKNOWN_UNICODE;
} else {
if (p[0] == 0xE0 && srclen > 1 && (p[1] & 0xE0) == 0x80) {
overlong = SDL_TRUE;
}
ch = (Uint32) (p[0] & 0x0F);
left = 2;
}
} else if (p[0] >= 0xC0) {
if ((p[0] & 0xE0) != 0xC0) {
/* Skip illegal sequences
return SDL_ICONV_EILSEQ;
*/
ch = UNKNOWN_UNICODE;
} else {
if ((p[0] & 0xDE) == 0xC0) {
overlong = SDL_TRUE;
}
ch = (Uint32) (p[0] & 0x1F);
left = 1;
}
} else {
if ((p[0] & 0x80) != 0x00) {
/* Skip illegal sequences
return SDL_ICONV_EILSEQ;
*/
ch = UNKNOWN_UNICODE;
} else {
ch = (Uint32) p[0];
}
}
++src;
--srclen;
if (srclen < left) {
return SDL_ICONV_EINVAL;
}
while (left--) {
++p;
if ((p[0] & 0xC0) != 0x80) {
/* Skip illegal sequences
return SDL_ICONV_EILSEQ;
*/
ch = UNKNOWN_UNICODE;
break;
}
ch <<= 6;
ch |= (p[0] & 0x3F);
++src;
--srclen;
}
if (overlong) {
/* Potential security risk
return SDL_ICONV_EILSEQ;
*/
ch = UNKNOWN_UNICODE;
}
if ((ch >= 0xD800 && ch <= 0xDFFF) ||
(ch == 0xFFFE || ch == 0xFFFF) || ch > 0x10FFFF) {
/* Skip illegal sequences
return SDL_ICONV_EILSEQ;
*/
ch = UNKNOWN_UNICODE;
}
}
break;
case ENCODING_UTF16BE: /* RFC 2781 */
{
Uint8 *p = (Uint8 *) src;
Uint16 W1, W2;
if (srclen < 2) {
return SDL_ICONV_EINVAL;
}
W1 = ((Uint16) p[0] << 8) | (Uint16) p[1];
src += 2;
srclen -= 2;
if (W1 < 0xD800 || W1 > 0xDFFF) {
ch = (Uint32) W1;
break;
}
if (W1 > 0xDBFF) {
/* Skip illegal sequences
return SDL_ICONV_EILSEQ;
*/
ch = UNKNOWN_UNICODE;
break;
}
if (srclen < 2) {
return SDL_ICONV_EINVAL;
}
p = (Uint8 *) src;
W2 = ((Uint16) p[0] << 8) | (Uint16) p[1];
src += 2;
srclen -= 2;
if (W2 < 0xDC00 || W2 > 0xDFFF) {
/* Skip illegal sequences
return SDL_ICONV_EILSEQ;
*/
ch = UNKNOWN_UNICODE;
break;
}
ch = (((Uint32) (W1 & 0x3FF) << 10) |
(Uint32) (W2 & 0x3FF)) + 0x10000;
}
break;
case ENCODING_UTF16LE: /* RFC 2781 */
{
Uint8 *p = (Uint8 *) src;
Uint16 W1, W2;
if (srclen < 2) {
return SDL_ICONV_EINVAL;
}
W1 = ((Uint16) p[1] << 8) | (Uint16) p[0];
src += 2;
srclen -= 2;
if (W1 < 0xD800 || W1 > 0xDFFF) {
ch = (Uint32) W1;
break;
}
if (W1 > 0xDBFF) {
/* Skip illegal sequences
return SDL_ICONV_EILSEQ;
*/
ch = UNKNOWN_UNICODE;
break;
}
if (srclen < 2) {
return SDL_ICONV_EINVAL;
}
p = (Uint8 *) src;
W2 = ((Uint16) p[1] << 8) | (Uint16) p[0];
src += 2;
srclen -= 2;
if (W2 < 0xDC00 || W2 > 0xDFFF) {
/* Skip illegal sequences
return SDL_ICONV_EILSEQ;
*/
ch = UNKNOWN_UNICODE;
break;
}
ch = (((Uint32) (W1 & 0x3FF) << 10) |
(Uint32) (W2 & 0x3FF)) + 0x10000;
}
break;
case ENCODING_UCS2LE:
{
Uint8 *p = (Uint8 *) src;
if (srclen < 2) {
return SDL_ICONV_EINVAL;
}
ch = ((Uint32) p[1] << 8) | (Uint32) p[0];
src += 2;
srclen -= 2;
}
break;
case ENCODING_UCS2BE:
{
Uint8 *p = (Uint8 *) src;
if (srclen < 2) {
return SDL_ICONV_EINVAL;
}
ch = ((Uint32) p[0] << 8) | (Uint32) p[1];
src += 2;
srclen -= 2;
}
break;
case ENCODING_UCS4BE:
case ENCODING_UTF32BE:
{
Uint8 *p = (Uint8 *) src;
if (srclen < 4) {
return SDL_ICONV_EINVAL;
}
ch = ((Uint32) p[0] << 24) |
((Uint32) p[1] << 16) |
((Uint32) p[2] << 8) | (Uint32) p[3];
src += 4;
srclen -= 4;
}
break;
case ENCODING_UCS4LE:
case ENCODING_UTF32LE:
{
Uint8 *p = (Uint8 *) src;
if (srclen < 4) {
return SDL_ICONV_EINVAL;
}
ch = ((Uint32) p[3] << 24) |
((Uint32) p[2] << 16) |
((Uint32) p[1] << 8) | (Uint32) p[0];
src += 4;
srclen -= 4;
}
break;
}
/* Encode a character */
switch (cd->dst_fmt) {
case ENCODING_ASCII:
{
Uint8 *p = (Uint8 *) dst;
if (dstlen < 1) {
return SDL_ICONV_E2BIG;
}
if (ch > 0x7F) {
*p = UNKNOWN_ASCII;
} else {
*p = (Uint8) ch;
}
++dst;
--dstlen;
}
break;
case ENCODING_LATIN1:
{
Uint8 *p = (Uint8 *) dst;
if (dstlen < 1) {
return SDL_ICONV_E2BIG;
}
if (ch > 0xFF) {
*p = UNKNOWN_ASCII;
} else {
*p = (Uint8) ch;
}
++dst;
--dstlen;
}
break;
case ENCODING_UTF8: /* RFC 3629 */
{
Uint8 *p = (Uint8 *) dst;
if (ch > 0x10FFFF) {
ch = UNKNOWN_UNICODE;
}
if (ch <= 0x7F) {
if (dstlen < 1) {
return SDL_ICONV_E2BIG;
}
*p = (Uint8) ch;
++dst;
--dstlen;
} else if (ch <= 0x7FF) {
if (dstlen < 2) {
return SDL_ICONV_E2BIG;
}
p[0] = 0xC0 | (Uint8) ((ch >> 6) & 0x1F);
p[1] = 0x80 | (Uint8) (ch & 0x3F);
dst += 2;
dstlen -= 2;
} else if (ch <= 0xFFFF) {
if (dstlen < 3) {
return SDL_ICONV_E2BIG;
}
p[0] = 0xE0 | (Uint8) ((ch >> 12) & 0x0F);
p[1] = 0x80 | (Uint8) ((ch >> 6) & 0x3F);
p[2] = 0x80 | (Uint8) (ch & 0x3F);
dst += 3;
dstlen -= 3;
} else if (ch <= 0x1FFFFF) {
if (dstlen < 4) {
return SDL_ICONV_E2BIG;
}
p[0] = 0xF0 | (Uint8) ((ch >> 18) & 0x07);
p[1] = 0x80 | (Uint8) ((ch >> 12) & 0x3F);
p[2] = 0x80 | (Uint8) ((ch >> 6) & 0x3F);
p[3] = 0x80 | (Uint8) (ch & 0x3F);
dst += 4;
dstlen -= 4;
} else if (ch <= 0x3FFFFFF) {
if (dstlen < 5) {
return SDL_ICONV_E2BIG;
}
p[0] = 0xF8 | (Uint8) ((ch >> 24) & 0x03);
p[1] = 0x80 | (Uint8) ((ch >> 18) & 0x3F);
p[2] = 0x80 | (Uint8) ((ch >> 12) & 0x3F);
p[3] = 0x80 | (Uint8) ((ch >> 6) & 0x3F);
p[4] = 0x80 | (Uint8) (ch & 0x3F);
dst += 5;
dstlen -= 5;
} else {
if (dstlen < 6) {
return SDL_ICONV_E2BIG;
}
p[0] = 0xFC | (Uint8) ((ch >> 30) & 0x01);
p[1] = 0x80 | (Uint8) ((ch >> 24) & 0x3F);
p[2] = 0x80 | (Uint8) ((ch >> 18) & 0x3F);
p[3] = 0x80 | (Uint8) ((ch >> 12) & 0x3F);
p[4] = 0x80 | (Uint8) ((ch >> 6) & 0x3F);
p[5] = 0x80 | (Uint8) (ch & 0x3F);
dst += 6;
dstlen -= 6;
}
}
break;
case ENCODING_UTF16BE: /* RFC 2781 */
{
Uint8 *p = (Uint8 *) dst;
if (ch > 0x10FFFF) {
ch = UNKNOWN_UNICODE;
}
if (ch < 0x10000) {
if (dstlen < 2) {
return SDL_ICONV_E2BIG;
}
p[0] = (Uint8) (ch >> 8);
p[1] = (Uint8) ch;
dst += 2;
dstlen -= 2;
} else {
Uint16 W1, W2;
if (dstlen < 4) {
return SDL_ICONV_E2BIG;
}
ch = ch - 0x10000;
W1 = 0xD800 | (Uint16) ((ch >> 10) & 0x3FF);
W2 = 0xDC00 | (Uint16) (ch & 0x3FF);
p[0] = (Uint8) (W1 >> 8);
p[1] = (Uint8) W1;
p[2] = (Uint8) (W2 >> 8);
p[3] = (Uint8) W2;
dst += 4;
dstlen -= 4;
}
}
break;
case ENCODING_UTF16LE: /* RFC 2781 */
{
Uint8 *p = (Uint8 *) dst;
if (ch > 0x10FFFF) {
ch = UNKNOWN_UNICODE;
}
if (ch < 0x10000) {
if (dstlen < 2) {
return SDL_ICONV_E2BIG;
}
p[1] = (Uint8) (ch >> 8);
p[0] = (Uint8) ch;
dst += 2;
dstlen -= 2;
} else {
Uint16 W1, W2;
if (dstlen < 4) {
return SDL_ICONV_E2BIG;
}
ch = ch - 0x10000;
W1 = 0xD800 | (Uint16) ((ch >> 10) & 0x3FF);
W2 = 0xDC00 | (Uint16) (ch & 0x3FF);
p[1] = (Uint8) (W1 >> 8);
p[0] = (Uint8) W1;
p[3] = (Uint8) (W2 >> 8);
p[2] = (Uint8) W2;
dst += 4;
dstlen -= 4;
}
}
break;
case ENCODING_UCS2BE:
{
Uint8 *p = (Uint8 *) dst;
if (ch > 0xFFFF) {
ch = UNKNOWN_UNICODE;
}
if (dstlen < 2) {
return SDL_ICONV_E2BIG;
}
p[0] = (Uint8) (ch >> 8);
p[1] = (Uint8) ch;
dst += 2;
dstlen -= 2;
}
break;
case ENCODING_UCS2LE:
{
Uint8 *p = (Uint8 *) dst;
if (ch > 0xFFFF) {
ch = UNKNOWN_UNICODE;
}
if (dstlen < 2) {
return SDL_ICONV_E2BIG;
}
p[1] = (Uint8) (ch >> 8);
p[0] = (Uint8) ch;
dst += 2;
dstlen -= 2;
}
break;
case ENCODING_UTF32BE:
if (ch > 0x10FFFF) {
ch = UNKNOWN_UNICODE;
}
/* fallthrough */
case ENCODING_UCS4BE:
if (ch > 0x7FFFFFFF) {
ch = UNKNOWN_UNICODE;
}
{
Uint8 *p = (Uint8 *) dst;
if (dstlen < 4) {
return SDL_ICONV_E2BIG;
}
p[0] = (Uint8) (ch >> 24);
p[1] = (Uint8) (ch >> 16);
p[2] = (Uint8) (ch >> 8);
p[3] = (Uint8) ch;
dst += 4;
dstlen -= 4;
}
break;
case ENCODING_UTF32LE:
if (ch > 0x10FFFF) {
ch = UNKNOWN_UNICODE;
}
/* fallthrough */
case ENCODING_UCS4LE:
if (ch > 0x7FFFFFFF) {
ch = UNKNOWN_UNICODE;
}
{
Uint8 *p = (Uint8 *) dst;
if (dstlen < 4) {
return SDL_ICONV_E2BIG;
}
p[3] = (Uint8) (ch >> 24);
p[2] = (Uint8) (ch >> 16);
p[1] = (Uint8) (ch >> 8);
p[0] = (Uint8) ch;
dst += 4;
dstlen -= 4;
}
break;
}
/* Update state */
*inbuf = src;
*inbytesleft = srclen;
*outbuf = dst;
*outbytesleft = dstlen;
++total;
}
return total;
}

References ENCODING_ASCII, ENCODING_LATIN1, ENCODING_UCS2BE, ENCODING_UCS2LE, ENCODING_UCS4BE, ENCODING_UCS4LE, ENCODING_UTF16, ENCODING_UTF16BE, ENCODING_UTF16LE, ENCODING_UTF16NATIVE, ENCODING_UTF32, ENCODING_UTF32BE, ENCODING_UTF32LE, ENCODING_UTF32NATIVE, ENCODING_UTF8, SDL_FALSE, SDL_ICONV_E2BIG, SDL_ICONV_EINVAL, SDL_TRUE, UNICODE_BOM, UNKNOWN_ASCII, and UNKNOWN_UNICODE.

Referenced by SDL_iconv_string().

## SDL_iconv_close()

int SDL_iconv_close | ( | SDL_iconv_t | cd | ) |

Definition at line 854 of file SDL_iconv.c.

{
if (cd != (SDL_iconv_t)-1) {
SDL_free(cd);
}
return 0;
}

References SDL_free.

Referenced by SDL_iconv_string().

## SDL_iconv_open()

SDL_iconv_t SDL_iconv_open | ( | const char * | tocode,
|  | const char * | fromcode
| ) |  |

Definition at line 208 of file SDL_iconv.c.

{
int src_fmt = ENCODING_UNKNOWN;
int dst_fmt = ENCODING_UNKNOWN;
int i;
char fromcode_buffer[64];
char tocode_buffer[64];
if (!fromcode || !*fromcode) {
fromcode = getlocale(fromcode_buffer, sizeof(fromcode_buffer));
}
if (!tocode || !*tocode) {
tocode = getlocale(tocode_buffer, sizeof(tocode_buffer));
}
for (i = 0; i < SDL_arraysize(encodings); ++i) {
if (SDL_strcasecmp(fromcode, encodings[i].name) == 0) {
src_fmt = encodings[i].format;
if (dst_fmt != ENCODING_UNKNOWN) {
break;
}
}
if (SDL_strcasecmp(tocode, encodings[i].name) == 0) {
dst_fmt = encodings[i].format;
if (src_fmt != ENCODING_UNKNOWN) {
break;
}
}
}
if (src_fmt != ENCODING_UNKNOWN && dst_fmt != ENCODING_UNKNOWN) {
SDL_iconv_t cd = (SDL_iconv_t) SDL_malloc(sizeof(*cd));
if (cd) {
cd->src_fmt = src_fmt;
cd->dst_fmt = dst_fmt;
return cd;
}
}
return (SDL_iconv_t) - 1;
}

References ENCODING_UNKNOWN, encodings, getlocale(), i, SDL_arraysize, SDL_malloc, and SDL_strcasecmp.

Referenced by SDL_iconv_string().

## SDL_iconv_string()

char* SDL_iconv_string | ( | const char * | tocode,
|  | const char * | fromcode,
|  | const char * | inbuf,
|  | size_t | inbytesleft
| ) |  |

This function converts a string between encodings in one pass, returning a string that must be freed with SDL_free() or NULL on error.

Definition at line 865 of file SDL_iconv.c.

{
SDL_iconv_t cd;
char *string;
size_t stringsize;
char *outbuf;
size_t outbytesleft;
size_t retCode = 0;
cd = SDL_iconv_open(tocode, fromcode);
if (cd == (SDL_iconv_t) - 1) {
/* See if we can recover here (fixes iconv on Solaris 11) */
if (!tocode || !*tocode) {
tocode = "UTF-8";
}
if (!fromcode || !*fromcode) {
fromcode = "UTF-8";
}
cd = SDL_iconv_open(tocode, fromcode);
}
if (cd == (SDL_iconv_t) - 1) {
return NULL;
}
stringsize = inbytesleft > 4 ? inbytesleft : 4;
string = SDL_malloc(stringsize);
if (!string) {
SDL_iconv_close(cd);
return NULL;
}
outbuf = string;
outbytesleft = stringsize;
SDL_memset(outbuf, 0, 4);
while (inbytesleft > 0) {
retCode = SDL_iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
switch (retCode) {
case SDL_ICONV_E2BIG:
{
char *oldstring = string;
stringsize *= 2;
string = SDL_realloc(string, stringsize);
if (!string) {
SDL_iconv_close(cd);
return NULL;
}
outbuf = string + (outbuf - oldstring);
outbytesleft = stringsize - (outbuf - string);
SDL_memset(outbuf, 0, 4);
}
break;
case SDL_ICONV_EILSEQ:
/* Try skipping some input data - not perfect, but... */
++inbuf;
--inbytesleft;
break;
case SDL_ICONV_EINVAL:
case SDL_ICONV_ERROR:
/* We can't continue... */
inbytesleft = 0;
break;
}
}
SDL_iconv_close(cd);
return string;
}

References NULL, SDL_iconv(), SDL_iconv_close(), SDL_ICONV_E2BIG, SDL_ICONV_EILSEQ, SDL_ICONV_EINVAL, SDL_ICONV_ERROR, SDL_iconv_open(), SDL_malloc, SDL_memset, and SDL_realloc.

## SDL_isdigit()

int SDL_isdigit | ( | int | x | ) |

Definition at line 444 of file SDL_stdlib.c.

{ return ((x) >= '0') && ((x) <= '9'); }

## SDL_isspace()

int SDL_isspace | ( | int | x | ) |

Definition at line 445 of file SDL_stdlib.c.

{ return ((x) == ' ') || ((x) == '\t') || ((x) == '\r') || ((x) == '\n') || ((x) == '\f') || ((x) == '\v'); }

## SDL_itoa()

char* SDL_itoa | ( | int | value,
|  | char * | str,
|  | int | radix
| ) |  |

Definition at line 702 of file SDL_string.c.

{
#ifdef HAVE_ITOA
return itoa(value, string, radix);
#else
return SDL_ltoa((long)value, string, radix);
#endif /* HAVE_ITOA */
}

References SDL_ltoa().

## SDL_lltoa()

char* SDL_lltoa | ( | Sint64 | value,
|  | char * | str,
|  | int | radix
| ) |  |

Definition at line 766 of file SDL_string.c.

{
#if defined(HAVE__I64TOA)
return _i64toa(value, string, radix);
#else
char *bufp = string;
if (value < 0) {
*bufp++ = '-';
SDL_ulltoa(-value, bufp, radix);
} else {
SDL_ulltoa(value, bufp, radix);
}
return string;
#endif /* HAVE__I64TOA */
}

References SDL_ulltoa().

Referenced by SDL_PrintLongLong().

## SDL_log()

double SDL_log | ( | double | x | ) |

Definition at line 284 of file SDL_stdlib.c.

{
#if defined(HAVE_LOG)
return log(x);
#else
return SDL_uclibc_log(x);
#endif
}

References SDL_uclibc_log().

Referenced by SDL_logf().

## SDL_log10()

double SDL_log10 | ( | double | x | ) |

Definition at line 304 of file SDL_stdlib.c.

{
#if defined(HAVE_LOG10)
return log10(x);
#else
return SDL_uclibc_log10(x);
#endif
}

References SDL_uclibc_log10().

Referenced by SDL_log10f().

## SDL_log10f()

float SDL_log10f | ( | float | x | ) |

Definition at line 314 of file SDL_stdlib.c.

{
#if defined(HAVE_LOG10F)
return log10f(x);
#else
return (float)SDL_log10((double)x);
#endif
}

References SDL_log10().

## SDL_logf()

float SDL_logf | ( | float | x | ) |

Definition at line 294 of file SDL_stdlib.c.

{
#if defined(HAVE_LOGF)
return logf(x);
#else
return (float)SDL_log((double)x);
#endif
}

References SDL_log().

## SDL_ltoa()

char* SDL_ltoa | ( | long | value,
|  | char * | str,
|  | int | radix
| ) |  |

Definition at line 722 of file SDL_string.c.

{
#if defined(HAVE__LTOA)
return _ltoa(value, string, radix);
#else
char *bufp = string;
if (value < 0) {
*bufp++ = '-';
SDL_ultoa(-value, bufp, radix);
} else {
SDL_ultoa(value, bufp, radix);
}
return string;
#endif /* HAVE__LTOA */
}

References SDL_ultoa().

Referenced by SDL_itoa(), and SDL_PrintLong().

## SDL_malloc()

void* SDL_malloc | ( | size_t | size | ) |

Definition at line 5379 of file SDL_malloc.c.

{
void *mem;
if (!size) {
size = 1;
}
mem = s_mem.malloc_func(size);
if (mem) {
SDL_AtomicIncRef(&s_mem.num_allocations);
}
return mem;
}

References s_mem, and SDL_AtomicIncRef.

## SDL_memcmp()

int SDL_memcmp | ( | const void * | s1,
|  | const void * | s2,
|  | size_t | len
| ) |  |

Definition at line 392 of file SDL_string.c.

{
#if defined(HAVE_MEMCMP)
return memcmp(s1, s2, len);
#else
char *s1p = (char *) s1;
char *s2p = (char *) s2;
while (len--) {
if (*s1p != *s2p) {
return (*s1p - *s2p);
}
++s1p;
++s2p;
}
return 0;
#endif /* HAVE_MEMCMP */
}

## SDL_memcpy()

void* SDL_memcpy | ( | SDL_OUT_BYTECAP(len) void * | dst,
|  | SDL_IN_BYTECAP(len) const void * | src,
|  | size_t | len
| ) |  |

Definition at line 315 of file SDL_string.c.

{
#ifdef __GNUC__
/* Presumably this is well tuned for speed.
On my machine this is twice as fast as the C code below.
*/
return __builtin_memcpy(dst, src, len);
#elif defined(HAVE_MEMCPY)
return memcpy(dst, src, len);
#elif defined(HAVE_BCOPY)
bcopy(src, dst, len);
return dst;
#else
/* GCC 4.9.0 with -O3 will generate movaps instructions with the loop
using Uint32* pointers, so we need to make sure the pointers are
aligned before we loop using them.
*/
if (((intptr_t)src & 0x3) || ((intptr_t)dst & 0x3)) {
/* Do an unaligned byte copy */
Uint8 *srcp1 = (Uint8 *)src;
Uint8 *dstp1 = (Uint8 *)dst;
while (len--) {
*dstp1++ = *srcp1++;
}
} else {
size_t left = (len % 4);
Uint32 *srcp4, *dstp4;
Uint8 *srcp1, *dstp1;
srcp4 = (Uint32 *) src;
dstp4 = (Uint32 *) dst;
len /= 4;
while (len--) {
*dstp4++ = *srcp4++;
}
srcp1 = (Uint8 *) srcp4;
dstp1 = (Uint8 *) dstp4;
switch (left) {
case 3:
*dstp1++ = *srcp1++;
case 2:
*dstp1++ = *srcp1++;
case 1:
*dstp1++ = *srcp1++;
}
}
return dst;
#endif /* __GNUC__ */
}

References memcpy.

Referenced by SDL_memcpy4(), SDL_strdup(), SDL_strlcpy(), SDL_utf8strlcpy(), SDL_wcsdup(), and SDL_wcslcpy().

## SDL_memcpy4()

SDL_FORCE_INLINE void* SDL_memcpy4 | ( | SDL_OUT_BYTECAP(dwords *4) void * | dst,
|  | SDL_IN_BYTECAP(dwords *4) const void * | src,
|  | size_t | dwords
| ) |  |

Definition at line 594 of file SDL_stdinc.h.

{
return SDL_memcpy(dst, src, dwords * 4);
}

References SDL_memcpy().

## SDL_memmove()

void* SDL_memmove | ( | SDL_OUT_BYTECAP(len) void * | dst,
|  | SDL_IN_BYTECAP(len) const void * | src,
|  | size_t | len
| ) |  |

Definition at line 368 of file SDL_string.c.

{
#if defined(HAVE_MEMMOVE)
return memmove(dst, src, len);
#else
char *srcp = (char *) src;
char *dstp = (char *) dst;
if (src < dst) {
srcp += len - 1;
dstp += len - 1;
while (len--) {
*dstp-- = *srcp--;
}
} else {
while (len--) {
*dstp++ = *srcp++;
}
}
return dst;
#endif /* HAVE_MEMMOVE */
}

References memmove.

Referenced by SDL_IntPrecisionAdjust().

## SDL_memset()

void* SDL_memset | ( | SDL_OUT_BYTECAP(len) void * | dst,
|  | int | c,
|  | size_t | len
| ) |  |

Definition at line 266 of file SDL_string.c.

{
#if defined(HAVE_MEMSET)
return memset(dst, c, len);
#else
size_t left;
Uint32 *dstp4;
Uint8 *dstp1 = (Uint8 *) dst;
Uint8 value1;
Uint32 value4;
/* The value used in memset() is a byte, passed as an int */
c &= 0xff;
/* The destination pointer needs to be aligned on a 4-byte boundary to
* execute a 32-bit set. Set first bytes manually if needed until it is
* aligned. */
value1 = (Uint8)c;
while ((intptr_t)dstp1 & 0x3) {
if (len--) {
*dstp1++ = value1;
} else {
return dst;
}
}
value4 = (c | (c << 8) | (c << 16) | (c << 24));
dstp4 = (Uint32 *) dstp1;
left = (len % 4);
len /= 4;
while (len--) {
*dstp4++ = value4;
}
dstp1 = (Uint8 *) dstp4;
switch (left) {
case 3:
*dstp1++ = value1;
case 2:
*dstp1++ = value1;
case 1:
*dstp1++ = value1;
}
return dst;
#endif /* HAVE_MEMSET */
}

References memset.

Referenced by SDL_IntPrecisionAdjust().

## SDL_memset4()

SDL_FORCE_INLINE void SDL_memset4 | ( | void * | dst,
|  | Uint32 | val,
|  | size_t | dwords
| ) |  |

Definition at line 420 of file SDL_stdinc.h.

{
#if defined(__GNUC__) && defined(i386)
int u0, u1, u2;
__asm__ __volatile__ (
"cld \n\t"
"rep ; stosl \n\t"
: "=&D" (u0), "=&a" (u1), "=&c" (u2)
: "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, dwords))
: "memory"
);
#else
size_t _n = (dwords + 3) / 4;
Uint32 *_p = SDL_static_cast(Uint32 *, dst);
Uint32 _val = (val);
if (dwords == 0)
return;
switch (dwords % 4)
{
case 0: do { *_p++ = _val; /* fallthrough */
case 3: *_p++ = _val; /* fallthrough */
case 2: *_p++ = _val; /* fallthrough */
case 1: *_p++ = _val; /* fallthrough */
} while ( --_n );
}
#endif
}

References SDL_static_cast.

Referenced by SDL_FillRect1(), SDL_FillRect2(), and SDL_FillRect4().

## SDL_pow()

double SDL_pow | ( | double | x,
|  | double | y
| ) |  |

Definition at line 324 of file SDL_stdlib.c.

{
#if defined(HAVE_POW)
return pow(x, y);
#else
return SDL_uclibc_pow(x, y);
#endif
}

References SDL_uclibc_pow().

Referenced by SDL_powf().

## SDL_powf()

float SDL_powf | ( | float | x,
|  | float | y
| ) |  |

Definition at line 334 of file SDL_stdlib.c.

{
#if defined(HAVE_POWF)
return powf(x, y);
#else
return (float)SDL_pow((double)x, (double)y);
#endif
}

References SDL_pow().

## SDL_qsort()

void SDL_qsort | ( | void * | base,
|  | size_t | nmemb,
|  | size_t | size,
|  | int(*)(const void *, const void *) | compare
| ) |  |

## SDL_realloc()

void* SDL_realloc | ( | void * | mem,
|  | size_t | size
| ) |  |

Definition at line 5410 of file SDL_malloc.c.

{
void *mem;
if (!ptr && !size) {
size = 1;
}
mem = s_mem.realloc_func(ptr, size);
if (mem && !ptr) {
SDL_AtomicIncRef(&s_mem.num_allocations);
}
return mem;
}

References s_mem, and SDL_AtomicIncRef.

## SDL_scalbn()

double SDL_scalbn | ( | double | x,
|  | int | n
| ) |  |

Definition at line 344 of file SDL_stdlib.c.

{
#if defined(HAVE_SCALBN)
return scalbn(x, n);
#elif defined(HAVE__SCALB)
return _scalb(x, n);
#elif defined(HAVE_LIBC) && defined(HAVE_FLOAT_H) && (FLT_RADIX == 2)
/* from scalbn(3): If FLT_RADIX equals 2 (which is
* usual), then scalbn() is equivalent to ldexp(3). */
return ldexp(x, n);
#else
return SDL_uclibc_scalbn(x, n);
#endif
}

References scalbn, and SDL_uclibc_scalbn().

Referenced by SDL_scalbnf().

## SDL_scalbnf()

float SDL_scalbnf | ( | float | x,
|  | int | n
| ) |  |

Definition at line 360 of file SDL_stdlib.c.

{
#if defined(HAVE_SCALBNF)
return scalbnf(x, n);
#else
return (float)SDL_scalbn((double)x, n);
#endif
}

References SDL_scalbn().

## SDL_setenv()

int SDL_setenv | ( | const char * | name,
|  | const char * | value,
|  | int | overwrite
| ) |  |

Definition at line 110 of file SDL_getenv.c.

{
int added;
int len, i;
char **new_env;
char *new_variable;
/* Input validation */
if (!name || SDL_strlen(name) == 0 || SDL_strchr(name, '=') != NULL || !value) {
return (-1);
}
/* See if it already exists */
if (!overwrite && SDL_getenv(name)) {
return 0;
}
/* Allocate memory for the variable */
len = SDL_strlen(name) + SDL_strlen(value) + 2;
new_variable = (char *) SDL_malloc(len);
if (!new_variable) {
return (-1);
}
SDL_snprintf(new_variable, len, "%s=%s", name, value);
value = new_variable + SDL_strlen(name) + 1;
name = new_variable;
/* Actually put it into the environment */
added = 0;
i = 0;
if (SDL_env) {
/* Check to see if it's already there... */
len = (value - name);
for (; SDL_env[i]; ++i) {
if (SDL_strncmp(SDL_env[i], name, len) == 0) {
break;
}
}
/* If we found it, just replace the entry */
if (SDL_env[i]) {
SDL_free(SDL_env[i]);
SDL_env[i] = new_variable;
added = 1;
}
}
/* Didn't find it in the environment, expand and add */
if (!added) {
new_env = SDL_realloc(SDL_env, (i + 2) * sizeof(char *));
if (new_env) {
SDL_env = new_env;
SDL_env[i++] = new_variable;
SDL_env[i++] = (char *) 0;
added = 1;
} else {
SDL_free(new_variable);
}
}
return (added ? 0 : -1);
}

References i, NULL, SDL_env, SDL_free, SDL_getenv(), SDL_malloc, SDL_realloc, SDL_snprintf, SDL_strchr, SDL_strlen, and SDL_strncmp.

## SDL_SetMemoryFunctions()

int SDL_SetMemoryFunctions | ( | SDL_malloc_func | malloc_func,
|  | SDL_calloc_func | calloc_func,
|  | SDL_realloc_func | realloc_func,
|  | SDL_free_func | free_func
| ) |  |

Replace SDL's memory allocation functions with a custom set.

Note
  If you are replacing SDL's memory functions, you should call SDL_GetNumAllocations() and be very careful if it returns non-zero. That means that your free function will be called with memory allocated by the previous memory allocation functions.

Definition at line 5349 of file SDL_malloc.c.

{
if (!malloc_func) {
return SDL_InvalidParamError("malloc_func");
}
if (!calloc_func) {
return SDL_InvalidParamError("calloc_func");
}
if (!realloc_func) {
return SDL_InvalidParamError("realloc_func");
}
if (!free_func) {
return SDL_InvalidParamError("free_func");
}
s_mem.malloc_func = malloc_func;
s_mem.calloc_func = calloc_func;
s_mem.realloc_func = realloc_func;
s_mem.free_func = free_func;
return 0;
}

References calloc_func, free_func, malloc_func, realloc_func, s_mem, and SDL_InvalidParamError.

## SDL_sin()

double SDL_sin | ( | double | x | ) |

Definition at line 370 of file SDL_stdlib.c.

{
#if defined(HAVE_SIN)
return sin(x);
#else
return SDL_uclibc_sin(x);
#endif
}

References SDL_uclibc_sin(), and sin().

Referenced by SDL_sinf().

## SDL_sinf()

float SDL_sinf | ( | float | x | ) |

Definition at line 380 of file SDL_stdlib.c.

{
#if defined(HAVE_SINF)
return sinf(x);
#else
return (float)SDL_sin((double)x);
#endif
}

References SDL_sin().

## SDL_snprintf()

int SDL_snprintf | ( | SDL_OUT_Z_CAP(maxlen) char * | text,
|  | size_t | maxlen,
|  | SDL_PRINTF_FORMAT_STRING const char * | fmt,
|  |  | ...
| ) |  |

Definition at line 1326 of file SDL_string.c.

{
va_list ap;
int retval;
va_start(ap, fmt);
retval = SDL_vsnprintf(text, maxlen, fmt, ap);
va_end(ap);
return retval;
}

References retval, SDL_vsnprintf(), and text.

## SDL_sqrt()

double SDL_sqrt | ( | double | x | ) |

Definition at line 390 of file SDL_stdlib.c.

{
#if defined(HAVE_SQRT)
return sqrt(x);
#else
return SDL_uclibc_sqrt(x);
#endif
}

References SDL_uclibc_sqrt().

Referenced by SDL_acos(), and SDL_sqrtf().

## SDL_sqrtf()

float SDL_sqrtf | ( | float | x | ) |

Definition at line 400 of file SDL_stdlib.c.

{
#if defined(HAVE_SQRTF)
return sqrtf(x);
#else
return (float)SDL_sqrt((double)x);
#endif
}

References SDL_sqrt().

## SDL_sscanf()

int SDL_sscanf | ( | const char * | text,
|  | SDL_SCANF_FORMAT_STRING const char * | fmt,
|  |  | ...
| ) |  |

Definition at line 1034 of file SDL_string.c.

{
int rc;
va_list ap;
va_start(ap, fmt);
rc = SDL_vsscanf(text, fmt, ap);
va_end(ap);
return rc;
}

References SDL_vsscanf(), and text.

## SDL_strcasecmp()

int SDL_strcasecmp | ( | const char * | str1,
|  | const char * | str2
| ) |  |

Definition at line 981 of file SDL_string.c.

{
#ifdef HAVE_STRCASECMP
return strcasecmp(str1, str2);
#elif defined(HAVE__STRICMP)
return _stricmp(str1, str2);
#else
char a = 0;
char b = 0;
while (*str1 && *str2) {
a = SDL_toupper((unsigned char) *str1);
b = SDL_toupper((unsigned char) *str2);
if (a != b)
break;
++str1;
++str2;
}
a = SDL_toupper(*str1);
b = SDL_toupper(*str2);
return (int) ((unsigned char) a - (unsigned char) b);
#endif /* HAVE_STRCASECMP */
}

References SDL_toupper.

## SDL_strchr()

char* SDL_strchr | ( | const char * | str,
|  | int | c
| ) |  |

Definition at line 638 of file SDL_string.c.

{
#ifdef HAVE_STRCHR
return SDL_const_cast(char*,strchr(string, c));
#elif defined(HAVE_INDEX)
return SDL_const_cast(char*,index(string, c));
#else
while (*string) {
if (*string == c) {
return (char *) string;
}
++string;
}
return NULL;
#endif /* HAVE_STRCHR */
}

References NULL, and SDL_const_cast.

## SDL_strcmp()

int SDL_strcmp | ( | const char * | str1,
|  | const char * | str2
| ) |  |

Definition at line 945 of file SDL_string.c.

{
#if defined(HAVE_STRCMP)
return strcmp(str1, str2);
#else
while (*str1 && *str2) {
if (*str1 != *str2)
break;
++str1;
++str2;
}
return (int)((unsigned char) *str1 - (unsigned char) *str2);
#endif /* HAVE_STRCMP */
}

## SDL_strdup()

char* SDL_strdup | ( | const char * | str | ) |

Definition at line 578 of file SDL_string.c.

{
size_t len = SDL_strlen(string) + 1;
char *newstr = (char *)SDL_malloc(len);
if (newstr) {
SDL_memcpy(newstr, string, len);
}
return newstr;
}

References SDL_malloc, SDL_memcpy(), and SDL_strlen().

## SDL_strlcat()

size_t SDL_strlcat | ( | SDL_INOUT_Z_CAP(maxlen) char * | dst,
|  | const char * | src,
|  | size_t | maxlen
| ) |  |

Definition at line 563 of file SDL_string.c.

{
#if defined(HAVE_STRLCAT)
return strlcat(dst, src, maxlen);
#else
size_t dstlen = SDL_strlen(dst);
size_t srclen = SDL_strlen(src);
if (dstlen < maxlen) {
SDL_strlcpy(dst + dstlen, src, maxlen - dstlen);
}
return dstlen + srclen;
#endif /* HAVE_STRLCAT */
}

References SDL_strlcpy(), and SDL_strlen().

## SDL_strlcpy()

size_t SDL_strlcpy | ( | SDL_OUT_Z_CAP(maxlen) char * | dst,
|  | const char * | src,
|  | size_t | maxlen
| ) |  |

Definition at line 497 of file SDL_string.c.

{
#if defined(HAVE_STRLCPY)
return strlcpy(dst, src, maxlen);
#else
size_t srclen = SDL_strlen(src);
if (maxlen > 0) {
size_t len = SDL_min(srclen, maxlen - 1);
SDL_memcpy(dst, src, len);
dst[len] = '\0';
}
return srclen;
#endif /* HAVE_STRLCPY */
}

References SDL_memcpy(), SDL_min, and SDL_strlen().

Referenced by SDL_PrintString(), and SDL_strlcat().

## SDL_strlen()

size_t SDL_strlen | ( | const char * | str | ) |

Definition at line 411 of file SDL_string.c.

{
#if defined(HAVE_STRLEN)
return strlen(string);
#else
size_t len = 0;
while (*string++) {
++len;
}
return len;
#endif /* HAVE_STRLEN */
}

Referenced by SDL_IntPrecisionAdjust(), SDL_PrintString(), SDL_strdup(), SDL_strlcat(), SDL_strlcpy(), SDL_strrchr(), SDL_strrev(), SDL_strstr(), SDL_strtol(), SDL_strtoll(), SDL_strtoul(), SDL_strtoull(), and SDL_utf8strlcpy().

## SDL_strlwr()

char* SDL_strlwr | ( | char * | str | ) |

Definition at line 623 of file SDL_string.c.

{
#if defined(HAVE__STRLWR)
return _strlwr(string);
#else
char *bufp = string;
while (*bufp) {
*bufp = SDL_tolower((unsigned char) *bufp);
++bufp;
}
return string;
#endif /* HAVE__STRLWR */
}

References SDL_tolower.

Referenced by SDL_PrintString().

## SDL_strncasecmp()

int SDL_strncasecmp | ( | const char * | str1,
|  | const char * | str2,
|  | size_t | len
| ) |  |

Definition at line 1005 of file SDL_string.c.

{
#ifdef HAVE_STRNCASECMP
return strncasecmp(str1, str2, maxlen);
#elif defined(HAVE__STRNICMP)
return _strnicmp(str1, str2, maxlen);
#else
char a = 0;
char b = 0;
while (*str1 && *str2 && maxlen) {
a = SDL_tolower((unsigned char) *str1);
b = SDL_tolower((unsigned char) *str2);
if (a != b)
break;
++str1;
++str2;
--maxlen;
}
if (maxlen == 0) {
return 0;
} else {
a = SDL_tolower((unsigned char) *str1);
b = SDL_tolower((unsigned char) *str2);
return (int) ((unsigned char) a - (unsigned char) b);
}
#endif /* HAVE_STRNCASECMP */
}

References SDL_tolower.

## SDL_strncmp()

int SDL_strncmp | ( | const char * | str1,
|  | const char * | str2,
|  | size_t | maxlen
| ) |  |

Definition at line 961 of file SDL_string.c.

{
#if defined(HAVE_STRNCMP)
return strncmp(str1, str2, maxlen);
#else
while (*str1 && *str2 && maxlen) {
if (*str1 != *str2)
break;
++str1;
++str2;
--maxlen;
}
if (!maxlen) {
return 0;
}
return (int) ((unsigned char) *str1 - (unsigned char) *str2);
#endif /* HAVE_STRNCMP */
}

Referenced by SDL_ScanLong(), SDL_ScanLongLong(), SDL_ScanUintPtrT(), SDL_ScanUnsignedLong(), SDL_ScanUnsignedLongLong(), SDL_strstr(), SDL_strtol(), SDL_strtoll(), SDL_strtoul(), SDL_strtoull(), SDL_vsnprintf(), and SDL_vsscanf().

## SDL_strrchr()

char* SDL_strrchr | ( | const char * | str,
|  | int | c
| ) |  |

Definition at line 656 of file SDL_string.c.

{
#ifdef HAVE_STRRCHR
return SDL_const_cast(char*,strrchr(string, c));
#elif defined(HAVE_RINDEX)
return SDL_const_cast(char*,rindex(string, c));
#else
const char *bufp = string + SDL_strlen(string) - 1;
while (bufp >= string) {
if (*bufp == c) {
return (char *) bufp;
}
--bufp;
}
return NULL;
#endif /* HAVE_STRRCHR */
}

References NULL, SDL_const_cast, and SDL_strlen().

## SDL_strrev()

char* SDL_strrev | ( | char * | str | ) |

Definition at line 589 of file SDL_string.c.

{
#if defined(HAVE__STRREV)
return _strrev(string);
#else
size_t len = SDL_strlen(string);
char *a = &string[0];
char *b = &string[len - 1];
len /= 2;
while (len--) {
char c = *a;
*a++ = *b;
*b-- = c;
}
return string;
#endif /* HAVE__STRREV */
}

References SDL_strlen().

Referenced by SDL_ulltoa(), and SDL_ultoa().

## SDL_strstr()

char* SDL_strstr | ( | const char * | haystack,
|  | const char * | needle
| ) |  |

Definition at line 675 of file SDL_string.c.

{
#if defined(HAVE_STRSTR)
return SDL_const_cast(char*,strstr(haystack, needle));
#else
size_t length = SDL_strlen(needle);
while (*haystack) {
if (SDL_strncmp(haystack, needle, length) == 0) {
return (char *) haystack;
}
++haystack;
}
return NULL;
#endif /* HAVE_STRSTR */
}

References NULL, SDL_const_cast, SDL_strlen(), and SDL_strncmp().

## SDL_strtod()

double SDL_strtod | ( | const char * | str,
|  | char ** | endp
| ) |  |

Definition at line 928 of file SDL_string.c.

{
#if defined(HAVE_STRTOD)
return strtod(string, endp);
#else
size_t len;
double value = 0.0;
len = SDL_ScanFloat(string, &value);
if (endp) {
*endp = (char *) string + len;
}
return value;
#endif /* HAVE_STRTOD */
}

References SDL_ScanFloat().

Referenced by SDL_atof().

## SDL_strtol()

long SDL_strtol | ( | const char * | str,
|  | char ** | endp,
|  | int | base
| ) |  |

Definition at line 828 of file SDL_string.c.

{
#if defined(HAVE_STRTOL)
return strtol(string, endp, base);
#else
size_t len;
long value = 0;
if (!base) {
if ((SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0)) {
base = 16;
} else {
base = 10;
}
}
len = SDL_ScanLong(string, base, &value);
if (endp) {
*endp = (char *) string + len;
}
return value;
#endif /* HAVE_STRTOL */
}

References SDL_ScanLong(), SDL_strlen(), and SDL_strncmp().

Referenced by SDL_atoi(), and SDL_vsnprintf().

## SDL_strtoll()

Sint64 SDL_strtoll | ( | const char * | str,
|  | char ** | endp,
|  | int | base
| ) |  |

Definition at line 878 of file SDL_string.c.

{
#if defined(HAVE_STRTOLL)
return strtoll(string, endp, base);
#else
size_t len;
Sint64 value = 0;
if (!base) {
if ((SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0)) {
base = 16;
} else {
base = 10;
}
}
len = SDL_ScanLongLong(string, base, &value);
if (endp) {
*endp = (char *) string + len;
}
return value;
#endif /* HAVE_STRTOLL */
}

References SDL_ScanLongLong(), SDL_strlen(), and SDL_strncmp().

## SDL_strtoul()

unsigned long SDL_strtoul | ( | const char * | str,
|  | char ** | endp,
|  | int | base
| ) |  |

Definition at line 853 of file SDL_string.c.

{
#if defined(HAVE_STRTOUL)
return strtoul(string, endp, base);
#else
size_t len;
unsigned long value = 0;
if (!base) {
if ((SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0)) {
base = 16;
} else {
base = 10;
}
}
len = SDL_ScanUnsignedLong(string, base, &value);
if (endp) {
*endp = (char *) string + len;
}
return value;
#endif /* HAVE_STRTOUL */
}

References SDL_ScanUnsignedLong(), SDL_strlen(), and SDL_strncmp().

## SDL_strtoull()

Uint64 SDL_strtoull | ( | const char * | str,
|  | char ** | endp,
|  | int | base
| ) |  |

Definition at line 903 of file SDL_string.c.

{
#if defined(HAVE_STRTOULL)
return strtoull(string, endp, base);
#else
size_t len;
Uint64 value = 0;
if (!base) {
if ((SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0)) {
base = 16;
} else {
base = 10;
}
}
len = SDL_ScanUnsignedLongLong(string, base, &value);
if (endp) {
*endp = (char *) string + len;
}
return value;
#endif /* HAVE_STRTOULL */
}

References SDL_ScanUnsignedLongLong(), SDL_strlen(), and SDL_strncmp().

## SDL_strupr()

char* SDL_strupr | ( | char * | str | ) |

Definition at line 608 of file SDL_string.c.

{
#if defined(HAVE__STRUPR)
return _strupr(string);
#else
char *bufp = string;
while (*bufp) {
*bufp = SDL_toupper((unsigned char) *bufp);
++bufp;
}
return string;
#endif /* HAVE__STRUPR */
}

References SDL_toupper.

Referenced by SDL_PrintString().

## SDL_tan()

double SDL_tan | ( | double | x | ) |

Definition at line 410 of file SDL_stdlib.c.

{
#if defined(HAVE_TAN)
return tan(x);
#else
return SDL_uclibc_tan(x);
#endif
}

References SDL_uclibc_tan(), and tan().

Referenced by SDL_tanf().

## SDL_tanf()

float SDL_tanf | ( | float | x | ) |

Definition at line 420 of file SDL_stdlib.c.

{
#if defined(HAVE_TANF)
return tanf(x);
#else
return (float)SDL_tan((double)x);
#endif
}

References SDL_tan().

## SDL_tolower()

int SDL_tolower | ( | int | x | ) |

Definition at line 447 of file SDL_stdlib.c.

{ return ((x) >= 'A') && ((x) <= 'Z') ? ('a'+((x)-'A')) : (x); }

## SDL_toupper()

int SDL_toupper | ( | int | x | ) |

Definition at line 446 of file SDL_stdlib.c.

{ return ((x) >= 'a') && ((x) <= 'z') ? ('A'+((x)-'a')) : (x); }

## SDL_uitoa()

char* SDL_uitoa | ( | unsigned int | value,
|  | char * | str,
|  | int | radix
| ) |  |

Definition at line 712 of file SDL_string.c.

{
#ifdef HAVE__UITOA
return _uitoa(value, string, radix);
#else
return SDL_ultoa((unsigned long)value, string, radix);
#endif /* HAVE__UITOA */
}

References SDL_ultoa().

## SDL_ulltoa()

char* SDL_ulltoa | ( | Uint64 | value,
|  | char * | str,
|  | int | radix
| ) |  |

Definition at line 785 of file SDL_string.c.

{
#if defined(HAVE__UI64TOA)
return _ui64toa(value, string, radix);
#else
char *bufp = string;
if (value) {
while (value > 0) {
*bufp++ = ntoa_table[value % radix];
value /= radix;
}
} else {
*bufp++ = '0';
}
*bufp = '\0';
/* The numbers went into the string backwards. :) */
SDL_strrev(string);
return string;
#endif /* HAVE__UI64TOA */
}

References ntoa_table, and SDL_strrev().

Referenced by SDL_lltoa(), and SDL_PrintUnsignedLongLong().

## SDL_ultoa()

char* SDL_ultoa | ( | unsigned long | value,
|  | char * | str,
|  | int | radix
| ) |  |

Definition at line 741 of file SDL_string.c.

{
#if defined(HAVE__ULTOA)
return _ultoa(value, string, radix);
#else
char *bufp = string;
if (value) {
while (value > 0) {
*bufp++ = ntoa_table[value % radix];
value /= radix;
}
} else {
*bufp++ = '0';
}
*bufp = '\0';
/* The numbers went into the string backwards. :) */
SDL_strrev(string);
return string;
#endif /* HAVE__ULTOA */
}

References ntoa_table, and SDL_strrev().

Referenced by SDL_ltoa(), SDL_PrintUnsignedLong(), and SDL_uitoa().

## SDL_utf8strlcpy()

size_t SDL_utf8strlcpy | ( | SDL_OUT_Z_CAP(dst_bytes) char * | dst,
|  | const char * | src,
|  | size_t | dst_bytes
| ) |  |

Definition at line 513 of file SDL_string.c.

{
size_t src_bytes = SDL_strlen(src);
size_t bytes = SDL_min(src_bytes, dst_bytes - 1);
size_t i = 0;
char trailing_bytes = 0;
if (bytes)
{
unsigned char c = (unsigned char)src[bytes - 1];
if (UTF8_IsLeadByte(c))
--bytes;
else if (UTF8_IsTrailingByte(c))
{
for (i = bytes - 1; i != 0; --i)
{
c = (unsigned char)src[i];
trailing_bytes = UTF8_TrailingBytes(c);
if (trailing_bytes)
{
if (bytes - i != trailing_bytes + 1)
bytes = i;
break;
}
}
}
SDL_memcpy(dst, src, bytes);
}
dst[bytes] = '\0';
return bytes;
}

References i, SDL_memcpy(), SDL_min, SDL_strlen(), UTF8_IsLeadByte, UTF8_IsTrailingByte, and UTF8_TrailingBytes().

## SDL_utf8strlen()

size_t SDL_utf8strlen | ( | const char * | str | ) |

Definition at line 546 of file SDL_string.c.

{
size_t retval = 0;
const char *p = str;
char ch;
while ((ch = *(p++))) {
/* if top two bits are 1 and 0, it's a continuation byte. */
if ((ch & 0xc0) != 0x80) {
retval++;
}
}
return retval;
}

References retval.

## SDL_vsnprintf()

int SDL_vsnprintf | ( | SDL_OUT_Z_CAP(maxlen) char * | text,
|  | size_t | maxlen,
|  | const char * | fmt,
|  | va_list | ap
| ) |  |

Definition at line 1610 of file SDL_string.c.

{
size_t left = maxlen;
char *textstart = text;
if (!fmt) {
fmt = "";
}
while (*fmt && left > 1) {
if (*fmt == '%') {
SDL_bool done = SDL_FALSE;
size_t len = 0;
SDL_bool check_flag;
SDL_FormatInfo info;
enum
{
DO_INT,
DO_LONG,
DO_LONGLONG
} inttype = DO_INT;
SDL_zero(info);
info.radix = 10;
info.precision = -1;
check_flag = SDL_TRUE;
while (check_flag) {
++fmt;
switch (*fmt) {
case '-':
info.left_justify = SDL_TRUE;
break;
case '+':
info.force_sign = SDL_TRUE;
break;
case '#':
info.force_type = SDL_TRUE;
break;
case '0':
info.pad_zeroes = SDL_TRUE;
break;
default:
check_flag = SDL_FALSE;
break;
}
}
if (*fmt >= '0' && *fmt <= '9') {
info.width = SDL_strtol(fmt, (char **)&fmt, 0);
}
else if (*fmt == '*') {
++fmt;
info.width = va_arg(ap, int);
}
if (*fmt == '.') {
++fmt;
if (*fmt >= '0' && *fmt <= '9') {
info.precision = SDL_strtol(fmt, (char **)&fmt, 0);
} else if (*fmt == '*') {
++fmt;
info.precision = va_arg(ap, int);
} else {
info.precision = 0;
}
if (info.precision < 0) {
info.precision = 0;
}
}
while (!done) {
switch (*fmt) {
case '%':
if (left > 1) {
*text = '%';
}
len = 1;
done = SDL_TRUE;
break;
case 'c':
/* char is promoted to int when passed through (...) */
if (left > 1) {
*text = (char) va_arg(ap, int);
}
len = 1;
done = SDL_TRUE;
break;
case 'h':
/* short is promoted to int when passed through (...) */
break;
case 'l':
if (inttype < DO_LONGLONG) {
++inttype;
}
break;
case 'I':
if (SDL_strncmp(fmt, "I64", 3) == 0) {
fmt += 2;
inttype = DO_LONGLONG;
}
break;
case 'i':
case 'd':
if (info.precision >= 0) {
info.pad_zeroes = SDL_FALSE;
}
switch (inttype) {
case DO_INT:
len = SDL_PrintLong(text, left, &info,
(long) va_arg(ap, int));
break;
case DO_LONG:
len = SDL_PrintLong(text, left, &info,
va_arg(ap, long));
break;
case DO_LONGLONG:
len = SDL_PrintLongLong(text, left, &info,
va_arg(ap, Sint64));
break;
}
done = SDL_TRUE;
break;
case 'p':
case 'x':
info.force_case = SDL_CASE_LOWER;
/* Fall through to 'X' handling */
case 'X':
if (info.force_case == SDL_CASE_NOCHANGE) {
info.force_case = SDL_CASE_UPPER;
}
if (info.radix == 10) {
info.radix = 16;
}
if (*fmt == 'p') {
inttype = DO_LONG;
}
/* Fall through to unsigned handling */
case 'o':
if (info.radix == 10) {
info.radix = 8;
}
/* Fall through to unsigned handling */
case 'u':
info.force_sign = SDL_FALSE;
if (info.precision >= 0) {
info.pad_zeroes = SDL_FALSE;
}
switch (inttype) {
case DO_INT:
len = SDL_PrintUnsignedLong(text, left, &info,
(unsigned long)
va_arg(ap, unsigned int));
break;
case DO_LONG:
len = SDL_PrintUnsignedLong(text, left, &info,
va_arg(ap, unsigned long));
break;
case DO_LONGLONG:
len = SDL_PrintUnsignedLongLong(text, left, &info,
va_arg(ap, Uint64));
break;
}
done = SDL_TRUE;
break;
case 'f':
len = SDL_PrintFloat(text, left, &info, va_arg(ap, double));
done = SDL_TRUE;
break;
case 'S':
{
/* In practice this is used on Windows for WCHAR strings */
wchar_t *wide_arg = va_arg(ap, wchar_t *);
char *arg = SDL_iconv_string("UTF-8", "UTF-16LE", (char *)(wide_arg), (SDL_wcslen(wide_arg)+1)*sizeof(*wide_arg));
info.pad_zeroes = SDL_FALSE;
len = SDL_PrintString(text, left, &info, arg);
SDL_free(arg);
done = SDL_TRUE;
}
break;
case 's':
info.pad_zeroes = SDL_FALSE;
len = SDL_PrintString(text, left, &info, va_arg(ap, char *));
done = SDL_TRUE;
break;
default:
done = SDL_TRUE;
break;
}
++fmt;
}
if (len >= left) {
text += (left > 1) ? left - 1 : 0;
left = SDL_min(left, 1);
} else {
text += len;
left -= len;
}
} else {
*text++ = *fmt++;
--left;
}
}
if (left > 0) {
*text = '\0';
}
return (int)(text - textstart);
}

References done, SDL_FormatInfo::force_case, SDL_FormatInfo::force_sign, SDL_FormatInfo::force_type, SDL_FormatInfo::left_justify, SDL_FormatInfo::pad_zeroes, SDL_FormatInfo::precision, SDL_FormatInfo::radix, SDL_CASE_LOWER, SDL_CASE_NOCHANGE, SDL_CASE_UPPER, SDL_FALSE, SDL_free, SDL_iconv_string, SDL_min, SDL_PrintFloat(), SDL_PrintLong(), SDL_PrintLongLong(), SDL_PrintString(), SDL_PrintUnsignedLong(), SDL_PrintUnsignedLongLong(), SDL_strncmp(), SDL_strtol(), SDL_TRUE, SDL_wcslen(), SDL_zero, text, and SDL_FormatInfo::width.

Referenced by SDL_snprintf().

## SDL_vsscanf()

int SDL_vsscanf | ( | const char * | text,
|  | const char * | fmt,
|  | va_list | ap
| ) |  |

Definition at line 1052 of file SDL_string.c.

{
int retval = 0;
if (!text || !*text) {
return -1;
}
while (*fmt) {
if (*fmt == ' ') {
while (SDL_isspace((unsigned char) *text)) {
++text;
}
++fmt;
continue;
}
if (*fmt == '%') {
SDL_bool done = SDL_FALSE;
long count = 0;
int radix = 10;
enum
{
DO_SHORT,
DO_INT,
DO_LONG,
DO_LONGLONG
} inttype = DO_INT;
size_t advance;
SDL_bool suppress = SDL_FALSE;
++fmt;
if (*fmt == '%') {
if (*text == '%') {
++text;
++fmt;
continue;
}
break;
}
if (*fmt == '*') {
suppress = SDL_TRUE;
++fmt;
}
fmt += SDL_ScanLong(fmt, 10, &count);
if (*fmt == 'c') {
if (!count) {
count = 1;
}
if (suppress) {
while (count--) {
++text;
}
} else {
char *valuep = va_arg(ap, char *);
while (count--) {
*valuep++ = *text++;
}
++retval;
}
continue;
}
while (SDL_isspace((unsigned char) *text)) {
++text;
}
/* FIXME: implement more of the format specifiers */
while (!done) {
switch (*fmt) {
case '*':
suppress = SDL_TRUE;
break;
case 'h':
if (inttype > DO_SHORT) {
++inttype;
}
break;
case 'l':
if (inttype < DO_LONGLONG) {
++inttype;
}
break;
case 'I':
if (SDL_strncmp(fmt, "I64", 3) == 0) {
fmt += 2;
inttype = DO_LONGLONG;
}
break;
case 'i':
{
int index = 0;
if (text[index] == '-') {
++index;
}
if (text[index] == '0') {
if (SDL_tolower((unsigned char) text[index + 1]) == 'x') {
radix = 16;
} else {
radix = 8;
}
}
}
/* Fall through to %d handling */
case 'd':
if (inttype == DO_LONGLONG) {
Sint64 value;
advance = SDL_ScanLongLong(text, radix, &value);
text += advance;
if (advance && !suppress) {
Sint64 *valuep = va_arg(ap, Sint64 *);
*valuep = value;
++retval;
}
} else {
long value;
advance = SDL_ScanLong(text, radix, &value);
text += advance;
if (advance && !suppress) {
switch (inttype) {
case DO_SHORT:
{
short *valuep = va_arg(ap, short *);
*valuep = (short) value;
}
break;
case DO_INT:
{
int *valuep = va_arg(ap, int *);
*valuep = (int) value;
}
break;
case DO_LONG:
{
long *valuep = va_arg(ap, long *);
*valuep = value;
}
break;
case DO_LONGLONG:
/* Handled above */
break;
}
++retval;
}
}
done = SDL_TRUE;
break;
case 'o':
if (radix == 10) {
radix = 8;
}
/* Fall through to unsigned handling */
case 'x':
case 'X':
if (radix == 10) {
radix = 16;
}
/* Fall through to unsigned handling */
case 'u':
if (inttype == DO_LONGLONG) {
Uint64 value = 0;
advance = SDL_ScanUnsignedLongLong(text, radix, &value);
text += advance;
if (advance && !suppress) {
Uint64 *valuep = va_arg(ap, Uint64 *);
*valuep = value;
++retval;
}
} else {
unsigned long value = 0;
advance = SDL_ScanUnsignedLong(text, radix, &value);
text += advance;
if (advance && !suppress) {
switch (inttype) {
case DO_SHORT:
{
short *valuep = va_arg(ap, short *);
*valuep = (short) value;
}
break;
case DO_INT:
{
int *valuep = va_arg(ap, int *);
*valuep = (int) value;
}
break;
case DO_LONG:
{
long *valuep = va_arg(ap, long *);
*valuep = value;
}
break;
case DO_LONGLONG:
/* Handled above */
break;
}
++retval;
}
}
done = SDL_TRUE;
break;
case 'p':
{
uintptr_t value = 0;
advance = SDL_ScanUintPtrT(text, 16, &value);
text += advance;
if (advance && !suppress) {
void **valuep = va_arg(ap, void **);
*valuep = (void *) value;
++retval;
}
}
done = SDL_TRUE;
break;
case 'f':
{
double value;
advance = SDL_ScanFloat(text, &value);
text += advance;
if (advance && !suppress) {
float *valuep = va_arg(ap, float *);
*valuep = (float) value;
++retval;
}
}
done = SDL_TRUE;
break;
case 's':
if (suppress) {
while (!SDL_isspace((unsigned char) *text)) {
++text;
if (count) {
if (--count == 0) {
break;
}
}
}
} else {
char *valuep = va_arg(ap, char *);
while (!SDL_isspace((unsigned char) *text)) {
*valuep++ = *text++;
if (count) {
if (--count == 0) {
break;
}
}
}
*valuep = '\0';
++retval;
}
done = SDL_TRUE;
break;
default:
done = SDL_TRUE;
break;
}
++fmt;
}
continue;
}
if (*text == *fmt) {
++text;
++fmt;
continue;
}
/* Text didn't match format specifier */
break;
}
return retval;
}

References done, retval, SDL_FALSE, SDL_isspace, SDL_ScanFloat(), SDL_ScanLong(), SDL_ScanLongLong(), SDL_ScanUintPtrT(), SDL_ScanUnsignedLong(), SDL_ScanUnsignedLongLong(), SDL_strncmp(), SDL_tolower, SDL_TRUE, and text.

Referenced by SDL_sscanf().

## SDL_wcscmp()

int SDL_wcscmp | ( | const wchar_t * | str1,
|  | const wchar_t * | str2
| ) |  |

Definition at line 481 of file SDL_string.c.

{
#if defined(HAVE_WCSCMP)
return wcscmp(str1, str2);
#else
while (*str1 && *str2) {
if (*str1 != *str2)
break;
++str1;
++str2;
}
return (int)(*str1 - *str2);
#endif /* HAVE_WCSCMP */
}

## SDL_wcsdup()

wchar_t* SDL_wcsdup | ( | const wchar_t * | wstr | ) |

Definition at line 425 of file SDL_string.c.

{
size_t len = ((SDL_wcslen(string) + 1) * sizeof(wchar_t));
wchar_t *newstr = (wchar_t *)SDL_malloc(len);
if (newstr) {
SDL_memcpy(newstr, string, len);
}
return newstr;
}

References SDL_malloc, SDL_memcpy(), and SDL_wcslen().

## SDL_wcslcat()

size_t SDL_wcslcat | ( | SDL_INOUT_Z_CAP(maxlen) wchar_t * | dst,
|  | const wchar_t * | src,
|  | size_t | maxlen
| ) |  |

Definition at line 466 of file SDL_string.c.

{
#if defined(HAVE_WCSLCAT)
return wcslcat(dst, src, maxlen);
#else
size_t dstlen = SDL_wcslen(dst);
size_t srclen = SDL_wcslen(src);
if (dstlen < maxlen) {
SDL_wcslcpy(dst + dstlen, src, maxlen - dstlen);
}
return dstlen + srclen;
#endif /* HAVE_WCSLCAT */
}

References SDL_wcslcpy(), and SDL_wcslen().

## SDL_wcslcpy()

size_t SDL_wcslcpy | ( | SDL_OUT_Z_CAP(maxlen) wchar_t * | dst,
|  | const wchar_t * | src,
|  | size_t | maxlen
| ) |  |

Definition at line 450 of file SDL_string.c.

{
#if defined(HAVE_WCSLCPY)
return wcslcpy(dst, src, maxlen);
#else
size_t srclen = SDL_wcslen(src);
if (maxlen > 0) {
size_t len = SDL_min(srclen, maxlen - 1);
SDL_memcpy(dst, src, len * sizeof(wchar_t));
dst[len] = '\0';
}
return srclen;
#endif /* HAVE_WCSLCPY */
}

References SDL_memcpy(), SDL_min, and SDL_wcslen().

Referenced by SDL_wcslcat().

## SDL_wcslen()

size_t SDL_wcslen | ( | const wchar_t * | wstr | ) |

Definition at line 436 of file SDL_string.c.

{
#if defined(HAVE_WCSLEN)
return wcslen(string);
#else
size_t len = 0;
while (*string++) {
++len;
}
return len;
#endif /* HAVE_WCSLEN */
}

Referenced by SDL_vsnprintf(), SDL_wcsdup(), SDL_wcslcat(), and SDL_wcslcpy().

SDL_zero
#define SDL_zero(x)
Definition: SDL_stdinc.h:416
SDL_floor
double SDL_floor(double x)
Definition: SDL_stdlib.c:244
SDL_memset
#define SDL_memset
Definition: SDL_dynapi_overrides.h:386
c
const GLubyte * c
Definition: SDL_opengl_glext.h:11093
SDL_PrintUnsignedLongLong
static size_t SDL_PrintUnsignedLongLong(char *text, size_t maxlen, SDL_FormatInfo *info, Uint64 value)
Definition: SDL_string.c:1497
Uint32
uint32_t Uint32
Definition: SDL_stdinc.h:203
SDL_strlcpy
size_t SDL_strlcpy(SDL_OUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen)
Definition: SDL_string.c:497
SDL_static_cast
#define SDL_static_cast(type, expression)
Definition: SDL_stdinc.h:138
fabs
double fabs(double x)
Definition: s_fabs.c:22
SDL_ICONV_E2BIG
#define SDL_ICONV_E2BIG
Definition: SDL_stdinc.h:542
Sint64
int64_t Sint64
Definition: SDL_stdinc.h:210
SDL_log10
double SDL_log10(double x)
Definition: SDL_stdlib.c:304
calloc_func
SDL_calloc_func calloc_func
Definition: SDL_malloc.c:5322
ENCODING_LATIN1
@ ENCODING_LATIN1
Definition: SDL_iconv.c:104
SDL_scalbn
double SDL_scalbn(double x, int n)
Definition: SDL_stdlib.c:344
NULL
#define NULL
Definition: begin_code.h:167
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1109
SDL_PrintString
static size_t SDL_PrintString(char *text, size_t maxlen, SDL_FormatInfo *info, const char *string)
Definition: SDL_string.c:1379
SDL_PrintFloat
static size_t SDL_PrintFloat(char *text, size_t maxlen, SDL_FormatInfo *info, double arg)
Definition: SDL_string.c:1507
malloc_func
SDL_malloc_func malloc_func
Definition: SDL_malloc.c:5321
cos
double cos(double x)
Definition: s_cos.c:46
SDL_tolower
#define SDL_tolower
Definition: SDL_dynapi_overrides.h:385
SDL_FormatInfo::precision
int precision
Definition: SDL_string.c:1375
ENCODING_UTF16
@ ENCODING_UTF16
Definition: SDL_iconv.c:106
SDL_ScanUintPtrT
static size_t SDL_ScanUintPtrT(const char *text, int radix, uintptr_t *valuep)
Definition: SDL_string.c:126
SDL_FormatInfo::radix
int radix
Definition: SDL_string.c:1374
count
GLuint GLuint GLsizei count
Definition: SDL_opengl.h:1571
ENCODING_UCS4LE
@ ENCODING_UCS4LE
Definition: SDL_iconv.c:115
SDL_const_cast
#define SDL_const_cast(type, expression)
Definition: SDL_stdinc.h:139
SDL_PrintUnsignedLong
static size_t SDL_PrintUnsignedLong(char *text, size_t maxlen, SDL_FormatInfo *info, unsigned long value)
Definition: SDL_string.c:1473
SDL_uclibc_floor
double SDL_uclibc_floor(double x)
SDL_iconv_open
SDL_iconv_t SDL_iconv_open(const char *tocode, const char *fromcode)
Definition: SDL_iconv.c:208
SDL_realloc
#define SDL_realloc
Definition: SDL_dynapi_overrides.h:376
SDL_InvalidParamError
#define SDL_InvalidParamError(param)
Definition: SDL_error.h:54
SDL_AtomicIncRef
#define SDL_AtomicIncRef(a)
Increment an atomic variable used as a reference count.
Definition: SDL_atomic.h:252
memmove
#define memmove
Definition: SDL_qsort.c:59
SDL_uclibc_fmod
double SDL_uclibc_fmod(double x, double y)
UNKNOWN_UNICODE
#define UNKNOWN_UNICODE
Definition: SDL_iconv.c:98
SDL_ICONV_EILSEQ
#define SDL_ICONV_EILSEQ
Definition: SDL_stdinc.h:543
SDL_env
static char ** SDL_env
Definition: SDL_getenv.c:108
SDL_sqrt
double SDL_sqrt(double x)
Definition: SDL_stdlib.c:390
ENCODING_UTF32LE
@ ENCODING_UTF32LE
Definition: SDL_iconv.c:111
SDL_strncmp
#define SDL_strncmp
Definition: SDL_dynapi_overrides.h:418
SDL_uclibc_sqrt
double SDL_uclibc_sqrt(double x)
index
GLuint index
Definition: SDL_opengl_glext.h:660
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1109
SDL_uclibc_scalbn
double SDL_uclibc_scalbn(double x, int n)
memcpy
#define memcpy
Definition: SDL_malloc.c:630
length
GLuint GLsizei GLsizei * length
Definition: SDL_opengl_glext.h:669
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9432
SDL_uclibc_cos
double SDL_uclibc_cos(double x)
SDL_fmod
double SDL_fmod(double x, double y)
Definition: SDL_stdlib.c:264
n
GLdouble n
Definition: SDL_opengl_glext.h:1952
s1
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s1
Definition: SDL_opengl_glext.h:8583
SDL_strcasecmp
#define SDL_strcasecmp
Definition: SDL_dynapi_overrides.h:419
ENCODING_UTF16BE
@ ENCODING_UTF16BE
Definition: SDL_iconv.c:107
SDL_uclibc_exp
double SDL_uclibc_exp(double x)
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
ENCODING_UTF32
@ ENCODING_UTF32
Definition: SDL_iconv.c:109
SDL_sin
double SDL_sin(double x)
Definition: SDL_stdlib.c:370
SDL_AtomicDecRef
#define SDL_AtomicDecRef(a)
Decrement an atomic variable used as a reference count.
Definition: SDL_atomic.h:262
u2
GLfixed GLfixed u2
Definition: SDL_opengl_glext.h:4558
len
GLenum GLsizei len
Definition: SDL_opengl_glext.h:2926
SDL_FALSE
@ SDL_FALSE
Definition: SDL_stdinc.h:163
done
int done
Definition: checkkeys.c:28
scalbn
#define scalbn
Definition: math_private.h:46
SDL_strchr
#define SDL_strchr
Definition: SDL_dynapi_overrides.h:401
p
GLfloat GLfloat p
Definition: SDL_opengl_glext.h:11090
SDL_ICONV_EINVAL
#define SDL_ICONV_EINVAL
Definition: SDL_stdinc.h:544
ENCODING_UNKNOWN
@ ENCODING_UNKNOWN
Definition: SDL_iconv.c:102
ntoa_table
static const char ntoa_table[]
Definition: SDL_string.c:693
retval
SDL_bool retval
Definition: testgamecontroller.c:65
x
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
SDL_uclibc_fabs
double SDL_uclibc_fabs(double x)
SDL_uclibc_atan2
double SDL_uclibc_atan2(double y, double x)
SDL_FormatInfo::left_justify
SDL_bool left_justify
Definition: SDL_string.c:1368
SDL_free
#define SDL_free
Definition: SDL_dynapi_overrides.h:377
UNICODE_BOM
#define UNICODE_BOM
Definition: SDL_iconv.c:95
SDL_FormatInfo::force_type
SDL_bool force_type
Definition: SDL_string.c:1370
SDL_copysign
double SDL_copysign(double x, double y)
Definition: SDL_stdlib.c:156
SDL_uclibc_copysign
double SDL_uclibc_copysign(double x, double y)
SDL_asin
double SDL_asin(double val)
Definition: SDL_stdlib.c:105
name
GLuint const GLchar * name
Definition: SDL_opengl_glext.h:660
free_func
SDL_free_func free_func
Definition: SDL_malloc.c:5324
SDL_uclibc_pow
double SDL_uclibc_pow(double x, double y)
ENCODING_UTF8
@ ENCODING_UTF8
Definition: SDL_iconv.c:105
tan
double tan(double x)
Definition: s_tan.c:45
SDL_memcpy
void * SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len)
Definition: SDL_string.c:315
SDL_strtod
double SDL_strtod(const char *string, char **endp)
Definition: SDL_string.c:928
SDL_strlen
size_t SDL_strlen(const char *string)
Definition: SDL_string.c:411
SDL_atan
double SDL_atan(double x)
Definition: SDL_stdlib.c:35
s_mem
static struct @38 s_mem
Uint16
uint16_t Uint16
Definition: SDL_stdinc.h:191
SDL_strtol
long SDL_strtol(const char *string, char **endp, int base)
Definition: SDL_string.c:828
SDL_min
#define SDL_min(x, y)
Definition: SDL_stdinc.h:406
copysign
double copysign(double x, double y)
Definition: s_copysign.c:21
SDL_ScanLong
static size_t SDL_ScanLong(const char *text, int radix, long *valuep)
Definition: SDL_string.c:53
text
static char text[MAX_TEXT_LENGTH]
Definition: testime.c:47
SDL_isspace
#define SDL_isspace
Definition: SDL_dynapi_overrides.h:383
SDL_PrintLongLong
static size_t SDL_PrintLongLong(char *text, size_t maxlen, SDL_FormatInfo *info, Sint64 value)
Definition: SDL_string.c:1483
SDL_tan
double SDL_tan(double x)
Definition: SDL_stdlib.c:410
ENCODING_UTF32NATIVE
#define ENCODING_UTF32NATIVE
Definition: SDL_iconv.c:119
SDL_strrev
char * SDL_strrev(char *string)
Definition: SDL_string.c:589
SDL_PrintLong
static size_t SDL_PrintLong(char *text, size_t maxlen, SDL_FormatInfo *info, long value)
Definition: SDL_string.c:1459
SDL_FormatInfo::width
int width
Definition: SDL_string.c:1373
ENCODING_UCS2BE
@ ENCODING_UCS2BE
Definition: SDL_iconv.c:112
ENCODING_UCS4BE
@ ENCODING_UCS4BE
Definition: SDL_iconv.c:114
SDL_uclibc_atan
double SDL_uclibc_atan(double x)
SDL_ICONV_ERROR
#define SDL_ICONV_ERROR
Definition: SDL_stdinc.h:541
SDL_FormatInfo::force_sign
SDL_bool force_sign
Definition: SDL_string.c:1369
SDL_CASE_UPPER
@ SDL_CASE_UPPER
Definition: SDL_string.c:1363
SDL_ScanLongLong
static size_t SDL_ScanLongLong(const char *text, int radix, Sint64 *valuep)
Definition: SDL_string.c:158
size
GLsizeiptr size
Definition: SDL_opengl_glext.h:537
y
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
SDL_wcslcpy
size_t SDL_wcslcpy(SDL_OUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen)
Definition: SDL_string.c:450
SDL_ulltoa
char * SDL_ulltoa(Uint64 value, char *string, int radix)
Definition: SDL_string.c:785
SDL_toupper
#define SDL_toupper
Definition: SDL_dynapi_overrides.h:384
SDL_pow
double SDL_pow(double x, double y)
Definition: SDL_stdlib.c:324
SDL_arraysize
#define SDL_arraysize(array)
Definition: SDL_stdinc.h:115
SDL_memcpy
void * SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len)
Definition: SDL_string.c:315
atan
double atan(double x)
Definition: s_atan.c:71
SDL_fabs
double SDL_fabs(double x)
Definition: SDL_stdlib.c:224
ENCODING_UCS2LE
@ ENCODING_UCS2LE
Definition: SDL_iconv.c:113
SDL_FormatInfo::pad_zeroes
SDL_bool pad_zeroes
Definition: SDL_string.c:1371
src
GLenum src
Definition: SDL_opengl_glext.h:1737
SDL_getenv
char * SDL_getenv(const char *name)
Definition: SDL_getenv.c:219
SDL_TRUE
@ SDL_TRUE
Definition: SDL_stdinc.h:164
UTF8_IsTrailingByte
#define UTF8_IsTrailingByte(c)
Definition: SDL_string.c:37
memset
#define memset
Definition: SDL_malloc.c:627
UTF8_IsLeadByte
#define UTF8_IsLeadByte(c)
Definition: SDL_string.c:36
SDL_iconv_string
#define SDL_iconv_string
Definition: SDL_dynapi_overrides.h:441
value
GLsizei const GLfloat * value
Definition: SDL_opengl_glext.h:698
val
GLuint GLfloat * val
Definition: SDL_opengl_glext.h:1492
SDL_ltoa
char * SDL_ltoa(long value, char *string, int radix)
Definition: SDL_string.c:722
SDL_snprintf
#define SDL_snprintf
Definition: SDL_dynapi_overrides.h:40
Uint64
uint64_t Uint64
Definition: SDL_stdinc.h:216
SDL_ScanUnsignedLongLong
static size_t SDL_ScanUnsignedLongLong(const char *text, int radix, Uint64 *valuep)
Definition: SDL_string.c:199
SDL_CASE_LOWER
@ SDL_CASE_LOWER
Definition: SDL_string.c:1362
left
GLint left
Definition: SDL_opengl_glext.h:1949
SDL_vsscanf
int SDL_vsscanf(const char *text, const char *fmt, va_list ap)
Definition: SDL_string.c:1052
encodings
static struct @37 encodings[]
ENCODING_UTF32BE
@ ENCODING_UTF32BE
Definition: SDL_iconv.c:110
SDL_ultoa
char * SDL_ultoa(unsigned long value, char *string, int radix)
Definition: SDL_string.c:741
SDL_wcslen
size_t SDL_wcslen(const wchar_t *string)
Definition: SDL_string.c:436
SDL_ceil
double SDL_ceil(double x)
Definition: SDL_stdlib.c:131
SDL_strlen
#define SDL_strlen
Definition: SDL_dynapi_overrides.h:393
u1
GLfixed u1
Definition: SDL_opengl_glext.h:4558
SDL_ScanFloat
static size_t SDL_ScanFloat(const char *text, double *valuep)
Definition: SDL_string.c:231
SDL_ScanUnsignedLong
static size_t SDL_ScanUnsignedLong(const char *text, int radix, unsigned long *valuep)
Definition: SDL_string.c:94
getlocale
static const char * getlocale(char *buffer, size_t bufsize)
Definition: SDL_iconv.c:173
realloc_func
SDL_realloc_func realloc_func
Definition: SDL_malloc.c:5323
SDL_vsnprintf
int SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, va_list ap)
Definition: SDL_string.c:1610
SDL_acos
double SDL_acos(double val)
Definition: SDL_stdlib.c:75
SDL_FormatInfo
Definition: SDL_string.c:1366
SDL_uclibc_sin
double SDL_uclibc_sin(double x)
string
GLsizei const GLchar *const * string
Definition: SDL_opengl_glext.h:688
SDL_malloc
#define SDL_malloc
Definition: SDL_dynapi_overrides.h:374
SDL_uclibc_log
double SDL_uclibc_log(double x)
void
const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char const char const SDL_SCANF_FORMAT_STRING char return SDL_ThreadFunction const char void return Uint32 return Uint32 void
Definition: SDL_dynapi_procs.h:89
SDL_iconv_close
int SDL_iconv_close(SDL_iconv_t cd)
Definition: SDL_iconv.c:854
floor
double floor(double x)
Definition: s_floor.c:33
SDL_uclibc_log10
double SDL_uclibc_log10(double x)
ENCODING_UTF16NATIVE
#define ENCODING_UTF16NATIVE
Definition: SDL_iconv.c:118
SDL_exp
double SDL_exp(double x)
Definition: SDL_stdlib.c:204
SDL_strncmp
int SDL_strncmp(const char *str1, const char *str2, size_t maxlen)
Definition: SDL_string.c:961
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:50
sin
double sin(double x)
Definition: s_sin.c:46
UNKNOWN_ASCII
#define UNKNOWN_ASCII
Definition: SDL_iconv.c:97
SDL_CASE_NOCHANGE
@ SDL_CASE_NOCHANGE
Definition: SDL_string.c:1361
SDL_FormatInfo::force_case
SDL_letter_case force_case
Definition: SDL_string.c:1372
ENCODING_ASCII
@ ENCODING_ASCII
Definition: SDL_iconv.c:103
UTF8_TrailingBytes
static int UTF8_TrailingBytes(unsigned char c)
Definition: SDL_string.c:39
SDL_atan2
double SDL_atan2(double x, double y)
Definition: SDL_stdlib.c:55
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:161
uintptr_t
unsigned int uintptr_t
Definition: SDL_config_windows.h:70
SDL_cos
double SDL_cos(double x)
Definition: SDL_stdlib.c:184
SDL_log
double SDL_log(double x)
Definition: SDL_stdlib.c:284
SDL_uclibc_tan
double SDL_uclibc_tan(double x)
SDL_iconv
size_t SDL_iconv(SDL_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
Definition: SDL_iconv.c:248
ENCODING_UTF16LE
@ ENCODING_UTF16LE
Definition: SDL_iconv.c:108
Uint8
uint8_t Uint8
Definition: SDL_stdinc.h:179