arsa  2.7
Macros | Typedefs | Functions
SDL_stdinc.h File Reference
#include "SDL_config.h"
#include <stddef.h>
#include <stdarg.h>
#include <stdint.h>
#include "begin_code.h"
#include "close_code.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
 
#define SDL_FOURCC(A, B, C, D)
 
#define SDL_PRIs64   "lld"
 
#define SDL_PRIu64   "llu"
 
#define SDL_PRIx64   "llx"
 
#define SDL_PRIX64   "llX"
 
#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*)SDL_malloc(sizeof(type)*(count))
 
#define SDL_stack_free(data)   SDL_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_zeroa(x)   SDL_memset((x), 0, sizeof((x)))
 
#define M_PI   3.14159265358979323846264338327950288
 
#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)
 
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))
 

Typedefs

typedef void *(SDLCALLSDL_malloc_func) (size_t size)
 
typedef void *(SDLCALLSDL_calloc_func) (size_t nmemb, size_t size)
 
typedef void *(SDLCALLSDL_realloc_func) (void *mem, size_t size)
 
typedef void(SDLCALLSDL_free_func) (void *mem)
 
typedef struct _SDL_iconv_t * SDL_iconv_t
 

Functions

DECLSPEC void *SDLCALL SDL_malloc (size_t size)
 
DECLSPEC void *SDLCALL SDL_calloc (size_t nmemb, size_t size)
 
DECLSPEC void *SDLCALL SDL_realloc (void *mem, size_t size)
 
DECLSPEC void SDLCALL SDL_free (void *mem)
 
DECLSPEC void SDLCALL 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...
 
DECLSPEC int SDLCALL 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...
 
DECLSPEC int SDLCALL SDL_GetNumAllocations (void)
 Get the number of outstanding (unfreed) allocations. More...
 
DECLSPEC char *SDLCALL SDL_getenv (const char *name)
 
DECLSPEC int SDLCALL SDL_setenv (const char *name, const char *value, int overwrite)
 
DECLSPEC void SDLCALL SDL_qsort (void *base, size_t nmemb, size_t size, int(*compare)(const void *, const void *))
 
DECLSPEC int SDLCALL SDL_abs (int x)
 
DECLSPEC int SDLCALL SDL_isdigit (int x)
 
DECLSPEC int SDLCALL SDL_isspace (int x)
 
DECLSPEC int SDLCALL SDL_toupper (int x)
 
DECLSPEC int SDLCALL SDL_tolower (int x)
 
DECLSPEC void *SDLCALL 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)
 
DECLSPEC void *SDLCALL SDL_memcpy (SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len)
 
DECLSPEC void *SDLCALL SDL_memmove (SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len)
 
DECLSPEC int SDLCALL SDL_memcmp (const void *s1, const void *s2, size_t len)
 
DECLSPEC wchar_t *SDLCALL SDL_wcsdup (const wchar_t *wstr)
 
DECLSPEC size_t SDLCALL SDL_wcslen (const wchar_t *wstr)
 
DECLSPEC size_t SDLCALL SDL_wcslcpy (SDL_OUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen)
 
DECLSPEC size_t SDLCALL SDL_wcslcat (SDL_INOUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen)
 
DECLSPEC int SDLCALL SDL_wcscmp (const wchar_t *str1, const wchar_t *str2)
 
DECLSPEC size_t SDLCALL SDL_strlen (const char *str)
 
DECLSPEC size_t SDLCALL SDL_strlcpy (SDL_OUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen)
 
DECLSPEC size_t SDLCALL SDL_utf8strlcpy (SDL_OUT_Z_CAP(dst_bytes) char *dst, const char *src, size_t dst_bytes)
 
DECLSPEC size_t SDLCALL SDL_strlcat (SDL_INOUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen)
 
DECLSPEC char *SDLCALL SDL_strdup (const char *str)
 
DECLSPEC char *SDLCALL SDL_strrev (char *str)
 
DECLSPEC char *SDLCALL SDL_strupr (char *str)
 
DECLSPEC char *SDLCALL SDL_strlwr (char *str)
 
DECLSPEC char *SDLCALL SDL_strchr (const char *str, int c)
 
DECLSPEC char *SDLCALL SDL_strrchr (const char *str, int c)
 
DECLSPEC char *SDLCALL SDL_strstr (const char *haystack, const char *needle)
 
DECLSPEC size_t SDLCALL SDL_utf8strlen (const char *str)
 
DECLSPEC char *SDLCALL SDL_itoa (int value, char *str, int radix)
 
DECLSPEC char *SDLCALL SDL_uitoa (unsigned int value, char *str, int radix)
 
DECLSPEC char *SDLCALL SDL_ltoa (long value, char *str, int radix)
 
DECLSPEC char *SDLCALL SDL_ultoa (unsigned long value, char *str, int radix)
 
DECLSPEC char *SDLCALL SDL_lltoa (Sint64 value, char *str, int radix)
 
DECLSPEC char *SDLCALL SDL_ulltoa (Uint64 value, char *str, int radix)
 
DECLSPEC int SDLCALL SDL_atoi (const char *str)
 
DECLSPEC double SDLCALL SDL_atof (const char *str)
 
DECLSPEC long SDLCALL SDL_strtol (const char *str, char **endp, int base)
 
DECLSPEC unsigned long SDLCALL SDL_strtoul (const char *str, char **endp, int base)
 
DECLSPEC Sint64 SDLCALL SDL_strtoll (const char *str, char **endp, int base)
 
DECLSPEC Uint64 SDLCALL SDL_strtoull (const char *str, char **endp, int base)
 
DECLSPEC double SDLCALL SDL_strtod (const char *str, char **endp)
 
DECLSPEC int SDLCALL SDL_strcmp (const char *str1, const char *str2)
 
DECLSPEC int SDLCALL SDL_strncmp (const char *str1, const char *str2, size_t maxlen)
 
DECLSPEC int SDLCALL SDL_strcasecmp (const char *str1, const char *str2)
 
DECLSPEC int SDLCALL SDL_strncasecmp (const char *str1, const char *str2, size_t len)
 
DECLSPEC int SDLCALL SDL_sscanf (const char *text, SDL_SCANF_FORMAT_STRING const char *fmt,...) SDL_SCANF_VARARG_FUNC(2)
 
DECLSPEC int SDLCALL SDL_vsscanf (const char *text, const char *fmt, va_list ap)
 
DECLSPEC int SDLCALL SDL_snprintf (SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt,...) SDL_PRINTF_VARARG_FUNC(3)
 
DECLSPEC int SDLCALL SDL_vsnprintf (SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, va_list ap)
 
DECLSPEC double SDLCALL SDL_acos (double x)
 
DECLSPEC float SDLCALL SDL_acosf (float x)
 
DECLSPEC double SDLCALL SDL_asin (double x)
 
DECLSPEC float SDLCALL SDL_asinf (float x)
 
DECLSPEC double SDLCALL SDL_atan (double x)
 
DECLSPEC float SDLCALL SDL_atanf (float x)
 
DECLSPEC double SDLCALL SDL_atan2 (double x, double y)
 
DECLSPEC float SDLCALL SDL_atan2f (float x, float y)
 
DECLSPEC double SDLCALL SDL_ceil (double x)
 
DECLSPEC float SDLCALL SDL_ceilf (float x)
 
DECLSPEC double SDLCALL SDL_copysign (double x, double y)
 
DECLSPEC float SDLCALL SDL_copysignf (float x, float y)
 
DECLSPEC double SDLCALL SDL_cos (double x)
 
DECLSPEC float SDLCALL SDL_cosf (float x)
 
DECLSPEC double SDLCALL SDL_exp (double x)
 
DECLSPEC float SDLCALL SDL_expf (float x)
 
DECLSPEC double SDLCALL SDL_fabs (double x)
 
DECLSPEC float SDLCALL SDL_fabsf (float x)
 
DECLSPEC double SDLCALL SDL_floor (double x)
 
DECLSPEC float SDLCALL SDL_floorf (float x)
 
DECLSPEC double SDLCALL SDL_fmod (double x, double y)
 
DECLSPEC float SDLCALL SDL_fmodf (float x, float y)
 
DECLSPEC double SDLCALL SDL_log (double x)
 
DECLSPEC float SDLCALL SDL_logf (float x)
 
DECLSPEC double SDLCALL SDL_log10 (double x)
 
DECLSPEC float SDLCALL SDL_log10f (float x)
 
DECLSPEC double SDLCALL SDL_pow (double x, double y)
 
DECLSPEC float SDLCALL SDL_powf (float x, float y)
 
DECLSPEC double SDLCALL SDL_scalbn (double x, int n)
 
DECLSPEC float SDLCALL SDL_scalbnf (float x, int n)
 
DECLSPEC double SDLCALL SDL_sin (double x)
 
DECLSPEC float SDLCALL SDL_sinf (float x)
 
DECLSPEC double SDLCALL SDL_sqrt (double x)
 
DECLSPEC float SDLCALL SDL_sqrtf (float x)
 
DECLSPEC double SDLCALL SDL_tan (double x)
 
DECLSPEC float SDLCALL SDL_tanf (float x)
 
DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open (const char *tocode, const char *fromcode)
 
DECLSPEC int SDLCALL SDL_iconv_close (SDL_iconv_t cd)
 
DECLSPEC size_t SDLCALL SDL_iconv (SDL_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
 
DECLSPEC char *SDLCALL SDL_iconv_string (const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft)
 
SDL_FORCE_INLINE voidSDL_memcpy4 (SDL_OUT_BYTECAP(dwords *4) void *dst, SDL_IN_BYTECAP(dwords *4) const void *src, size_t dwords)
 

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 */
 
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
 

Detailed Description

This is a general header that includes C language support.

Definition in file SDL_stdinc.h.

Macro Definition Documentation

◆ M_PI

#define M_PI   3.14159265358979323846264338327950288

pi

Definition at line 502 of file SDL_stdinc.h.

◆ 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,
 
)
Value:
uint32_t Uint32
Definition: SDL_stdinc.h:203
#define SDL_static_cast(type, expression)
Definition: SDL_stdinc.h:138
uint8_t Uint8
Definition: SDL_stdinc.h:179

Definition at line 144 of file SDL_stdinc.h.

◆ SDL_ICONV_E2BIG

#define SDL_ICONV_E2BIG   (size_t)-2

Definition at line 545 of file SDL_stdinc.h.

◆ SDL_ICONV_EILSEQ

#define SDL_ICONV_EILSEQ   (size_t)-3

Definition at line 546 of file SDL_stdinc.h.

◆ SDL_ICONV_EINVAL

#define SDL_ICONV_EINVAL   (size_t)-4

Definition at line 547 of file SDL_stdinc.h.

◆ SDL_ICONV_ERROR

#define SDL_ICONV_ERROR   (size_t)-1

Definition at line 544 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 565 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 566 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 567 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   "lld"

Definition at line 231 of file SDL_stdinc.h.

◆ SDL_PRIu64

#define SDL_PRIu64   "llu"

Definition at line 242 of file SDL_stdinc.h.

◆ SDL_PRIx64

#define SDL_PRIx64   "llx"

Definition at line 253 of file SDL_stdinc.h.

◆ SDL_PRIX64

#define SDL_PRIX64   "llX"

Definition at line 264 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*)SDL_malloc(sizeof(type)*(count))

Definition at line 357 of file SDL_stdinc.h.

◆ SDL_stack_free

#define SDL_stack_free (   data)    SDL_free(data)

Definition at line 358 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_zeroa

#define SDL_zeroa (   x)    SDL_memset((x), 0, sizeof((x)))

Definition at line 418 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*(SDLCALL * SDL_calloc_func) (size_t nmemb, size_t size)

Definition at line 367 of file SDL_stdinc.h.

◆ SDL_free_func

typedef void(SDLCALL * SDL_free_func) (void *mem)

Definition at line 369 of file SDL_stdinc.h.

◆ SDL_iconv_t

typedef struct _SDL_iconv_t* SDL_iconv_t

Definition at line 550 of file SDL_stdinc.h.

◆ SDL_malloc_func

typedef void*(SDLCALL * SDL_malloc_func) (size_t size)

Definition at line 366 of file SDL_stdinc.h.

◆ SDL_realloc_func

typedef void*(SDLCALL * 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

typedef int64_t 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

typedef uint16_t Uint16

Definition at line 191 of file SDL_stdinc.h.

◆ Uint32

typedef uint32_t 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

typedef uint8_t Uint8

Definition at line 179 of file SDL_stdinc.h.

Enumeration Type Documentation

◆ SDL_bool

enum SDL_bool
Enumerator
SDL_FALSE 
SDL_TRUE 

Definition at line 161 of file SDL_stdinc.h.

162 {
163  SDL_FALSE = 0,
164  SDL_TRUE = 1
165 } SDL_bool;
SDL_bool
Definition: SDL_stdinc.h:161

Function Documentation

◆ SDL_abs()

DECLSPEC int SDLCALL SDL_abs ( int  x)

◆ SDL_acos()

DECLSPEC double SDLCALL SDL_acos ( double  x)

◆ SDL_acosf()

DECLSPEC float SDLCALL SDL_acosf ( float  x)

◆ SDL_asin()

DECLSPEC double SDLCALL SDL_asin ( double  x)

◆ SDL_asinf()

DECLSPEC float SDLCALL SDL_asinf ( float  x)

◆ SDL_atan()

DECLSPEC double SDLCALL SDL_atan ( double  x)

◆ SDL_atan2()

DECLSPEC double SDLCALL SDL_atan2 ( double  x,
double  y 
)

◆ SDL_atan2f()

DECLSPEC float SDLCALL SDL_atan2f ( float  x,
float  y 
)

◆ SDL_atanf()

DECLSPEC float SDLCALL SDL_atanf ( float  x)

◆ SDL_atof()

DECLSPEC double SDLCALL SDL_atof ( const char *  str)

◆ SDL_atoi()

DECLSPEC int SDLCALL SDL_atoi ( const char *  str)

◆ SDL_calloc()

DECLSPEC void* SDLCALL SDL_calloc ( size_t  nmemb,
size_t  size 
)

◆ SDL_ceil()

DECLSPEC double SDLCALL SDL_ceil ( double  x)

◆ SDL_ceilf()

DECLSPEC float SDLCALL SDL_ceilf ( float  x)

◆ SDL_copysign()

DECLSPEC double SDLCALL SDL_copysign ( double  x,
double  y 
)

◆ SDL_copysignf()

DECLSPEC float SDLCALL SDL_copysignf ( float  x,
float  y 
)

◆ SDL_cos()

DECLSPEC double SDLCALL SDL_cos ( double  x)

◆ SDL_cosf()

DECLSPEC float SDLCALL SDL_cosf ( float  x)

◆ SDL_exp()

DECLSPEC double SDLCALL SDL_exp ( double  x)

◆ SDL_expf()

DECLSPEC float SDLCALL SDL_expf ( float  x)

◆ SDL_fabs()

DECLSPEC double SDLCALL SDL_fabs ( double  x)

◆ SDL_fabsf()

DECLSPEC float SDLCALL SDL_fabsf ( float  x)

◆ SDL_floor()

DECLSPEC double SDLCALL SDL_floor ( double  x)

◆ SDL_floorf()

DECLSPEC float SDLCALL SDL_floorf ( float  x)

◆ SDL_fmod()

DECLSPEC double SDLCALL SDL_fmod ( double  x,
double  y 
)

◆ SDL_fmodf()

DECLSPEC float SDLCALL SDL_fmodf ( float  x,
float  y 
)

◆ SDL_free()

DECLSPEC void SDLCALL SDL_free ( void mem)

◆ SDL_getenv()

DECLSPEC char* SDLCALL SDL_getenv ( const char *  name)

◆ SDL_GetMemoryFunctions()

DECLSPEC void SDLCALL 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.

◆ SDL_GetNumAllocations()

DECLSPEC int SDLCALL SDL_GetNumAllocations ( void  )

Get the number of outstanding (unfreed) allocations.

◆ SDL_iconv()

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

◆ SDL_iconv_close()

DECLSPEC int SDLCALL SDL_iconv_close ( SDL_iconv_t  cd)

◆ SDL_iconv_open()

DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open ( const char *  tocode,
const char *  fromcode 
)

◆ SDL_iconv_string()

DECLSPEC char* SDLCALL 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.

◆ SDL_isdigit()

DECLSPEC int SDLCALL SDL_isdigit ( int  x)

◆ SDL_isspace()

DECLSPEC int SDLCALL SDL_isspace ( int  x)

◆ SDL_itoa()

DECLSPEC char* SDLCALL SDL_itoa ( int  value,
char *  str,
int  radix 
)

◆ SDL_lltoa()

DECLSPEC char* SDLCALL SDL_lltoa ( Sint64  value,
char *  str,
int  radix 
)

◆ SDL_log()

DECLSPEC double SDLCALL SDL_log ( double  x)

◆ SDL_log10()

DECLSPEC double SDLCALL SDL_log10 ( double  x)

◆ SDL_log10f()

DECLSPEC float SDLCALL SDL_log10f ( float  x)

◆ SDL_logf()

DECLSPEC float SDLCALL SDL_logf ( float  x)

◆ SDL_ltoa()

DECLSPEC char* SDLCALL SDL_ltoa ( long  value,
char *  str,
int  radix 
)

◆ SDL_malloc()

DECLSPEC void* SDLCALL SDL_malloc ( size_t  size)

◆ SDL_memcmp()

DECLSPEC int SDLCALL SDL_memcmp ( const void s1,
const void s2,
size_t  len 
)

◆ SDL_memcpy()

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

◆ 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 597 of file SDL_stdinc.h.

598 {
599  return SDL_memcpy(dst, src, dwords * 4);
600 }
GLenum GLenum dst
GLenum src
DECLSPEC void *SDLCALL SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len)

◆ SDL_memmove()

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

◆ SDL_memset()

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

◆ SDL_memset4()

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

Definition at line 421 of file SDL_stdinc.h.

422 {
423 #ifdef __APPLE__
424  memset_pattern4(dst, &val, dwords * 4);
425 #elif defined(__GNUC__) && defined(i386)
426  int u0, u1, u2;
427  __asm__ __volatile__ (
428  "cld \n\t"
429  "rep ; stosl \n\t"
430  : "=&D" (u0), "=&a" (u1), "=&c" (u2)
431  : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, dwords))
432  : "memory"
433  );
434 #else
435  size_t _n = (dwords + 3) / 4;
436  Uint32 *_p = SDL_static_cast(Uint32 *, dst);
437  Uint32 _val = (val);
438  if (dwords == 0)
439  return;
440  switch (dwords % 4)
441  {
442  case 0: do { *_p++ = _val; /* fallthrough */
443  case 3: *_p++ = _val; /* fallthrough */
444  case 2: *_p++ = _val; /* fallthrough */
445  case 1: *_p++ = _val; /* fallthrough */
446  } while ( --_n );
447  }
448 #endif
449 }
GLenum GLenum dst
uint32_t Uint32
Definition: SDL_stdinc.h:203
GLuint GLfloat * val
#define SDL_static_cast(type, expression)
Definition: SDL_stdinc.h:138
GLfixed u1
GLfixed GLfixed u2

◆ SDL_pow()

DECLSPEC double SDLCALL SDL_pow ( double  x,
double  y 
)

◆ SDL_powf()

DECLSPEC float SDLCALL SDL_powf ( float  x,
float  y 
)

◆ SDL_qsort()

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

◆ SDL_realloc()

DECLSPEC void* SDLCALL SDL_realloc ( void mem,
size_t  size 
)

◆ SDL_scalbn()

DECLSPEC double SDLCALL SDL_scalbn ( double  x,
int  n 
)

◆ SDL_scalbnf()

DECLSPEC float SDLCALL SDL_scalbnf ( float  x,
int  n 
)

◆ SDL_setenv()

DECLSPEC int SDLCALL SDL_setenv ( const char *  name,
const char *  value,
int  overwrite 
)

◆ SDL_SetMemoryFunctions()

DECLSPEC int SDLCALL 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.

◆ SDL_sin()

DECLSPEC double SDLCALL SDL_sin ( double  x)

◆ SDL_sinf()

DECLSPEC float SDLCALL SDL_sinf ( float  x)

◆ SDL_snprintf()

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

◆ SDL_sqrt()

DECLSPEC double SDLCALL SDL_sqrt ( double  x)

◆ SDL_sqrtf()

DECLSPEC float SDLCALL SDL_sqrtf ( float  x)

◆ SDL_sscanf()

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

◆ SDL_strcasecmp()

DECLSPEC int SDLCALL SDL_strcasecmp ( const char *  str1,
const char *  str2 
)

◆ SDL_strchr()

DECLSPEC char* SDLCALL SDL_strchr ( const char *  str,
int  c 
)

◆ SDL_strcmp()

DECLSPEC int SDLCALL SDL_strcmp ( const char *  str1,
const char *  str2 
)

◆ SDL_strdup()

DECLSPEC char* SDLCALL SDL_strdup ( const char *  str)

◆ SDL_strlcat()

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

◆ SDL_strlcpy()

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

◆ SDL_strlen()

DECLSPEC size_t SDLCALL SDL_strlen ( const char *  str)

◆ SDL_strlwr()

DECLSPEC char* SDLCALL SDL_strlwr ( char *  str)

◆ SDL_strncasecmp()

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

◆ SDL_strncmp()

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

◆ SDL_strrchr()

DECLSPEC char* SDLCALL SDL_strrchr ( const char *  str,
int  c 
)

◆ SDL_strrev()

DECLSPEC char* SDLCALL SDL_strrev ( char *  str)

◆ SDL_strstr()

DECLSPEC char* SDLCALL SDL_strstr ( const char *  haystack,
const char *  needle 
)

◆ SDL_strtod()

DECLSPEC double SDLCALL SDL_strtod ( const char *  str,
char **  endp 
)

◆ SDL_strtol()

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

◆ SDL_strtoll()

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

◆ SDL_strtoul()

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

◆ SDL_strtoull()

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

◆ SDL_strupr()

DECLSPEC char* SDLCALL SDL_strupr ( char *  str)

◆ SDL_tan()

DECLSPEC double SDLCALL SDL_tan ( double  x)

◆ SDL_tanf()

DECLSPEC float SDLCALL SDL_tanf ( float  x)

◆ SDL_tolower()

DECLSPEC int SDLCALL SDL_tolower ( int  x)

◆ SDL_toupper()

DECLSPEC int SDLCALL SDL_toupper ( int  x)

◆ SDL_uitoa()

DECLSPEC char* SDLCALL SDL_uitoa ( unsigned int  value,
char *  str,
int  radix 
)

◆ SDL_ulltoa()

DECLSPEC char* SDLCALL SDL_ulltoa ( Uint64  value,
char *  str,
int  radix 
)

◆ SDL_ultoa()

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

◆ SDL_utf8strlcpy()

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

◆ SDL_utf8strlen()

DECLSPEC size_t SDLCALL SDL_utf8strlen ( const char *  str)

◆ SDL_vsnprintf()

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

◆ SDL_vsscanf()

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

◆ SDL_wcscmp()

DECLSPEC int SDLCALL SDL_wcscmp ( const wchar_t *  str1,
const wchar_t *  str2 
)

◆ SDL_wcsdup()

DECLSPEC wchar_t* SDLCALL SDL_wcsdup ( const wchar_t *  wstr)

◆ SDL_wcslcat()

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

◆ SDL_wcslcpy()

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

◆ SDL_wcslen()

DECLSPEC size_t SDLCALL SDL_wcslen ( const wchar_t *  wstr)