My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Typedefs | Functions
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 <inttypes.h>
#include <ctype.h>
#include <math.h>
#include <iconv.h>
#include "begin_code.h"
#include <alloca.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_FOURCC(A, B, C, D)
 
#define SDL_COMPILE_TIME_ASSERT(name, x)   typedef int SDL_dummy_ ## 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)
 
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 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 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 (void *dst, int c, size_t len)
 
SDL_FORCE_INLINE void SDL_memset4 (void *dst, int val, size_t dwords)
 
DECLSPEC void *SDLCALL SDL_memcpy (void *dst, const void *src, size_t len)
 
SDL_FORCE_INLINE voidSDL_memcpy4 (void *dst, const void *src, size_t dwords)
 
DECLSPEC void *SDLCALL SDL_memmove (void *dst, const void *src, size_t len)
 
DECLSPEC int SDLCALL SDL_memcmp (const void *s1, const void *s2, size_t len)
 
DECLSPEC size_t SDLCALL SDL_wcslen (const wchar_t *wstr)
 
DECLSPEC size_t SDLCALL SDL_wcslcpy (wchar_t *dst, const wchar_t *src, size_t maxlen)
 
DECLSPEC size_t SDLCALL SDL_wcslcat (wchar_t *dst, const wchar_t *src, size_t maxlen)
 
DECLSPEC size_t SDLCALL SDL_strlen (const char *str)
 
DECLSPEC size_t SDLCALL SDL_strlcpy (char *dst, const char *src, size_t maxlen)
 
DECLSPEC size_t SDLCALL SDL_utf8strlcpy (char *dst, const char *src, size_t dst_bytes)
 
DECLSPEC size_t SDLCALL SDL_strlcat (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 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, const char *fmt,...)
 
DECLSPEC int SDLCALL SDL_snprintf (char *text, size_t maxlen, const char *fmt,...)
 
DECLSPEC int SDLCALL SDL_vsnprintf (char *text, size_t maxlen, const char *fmt, va_list ap)
 
DECLSPEC double SDLCALL SDL_atan (double x)
 
DECLSPEC double SDLCALL SDL_atan2 (double x, double y)
 
DECLSPEC double SDLCALL SDL_ceil (double x)
 
DECLSPEC double SDLCALL SDL_copysign (double x, double y)
 
DECLSPEC double SDLCALL SDL_cos (double x)
 
DECLSPEC float SDLCALL SDL_cosf (float x)
 
DECLSPEC double SDLCALL SDL_fabs (double x)
 
DECLSPEC double SDLCALL SDL_floor (double x)
 
DECLSPEC double SDLCALL SDL_log (double x)
 
DECLSPEC double SDLCALL SDL_pow (double x, double y)
 
DECLSPEC double SDLCALL SDL_scalbn (double 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 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)
 

Basic data types

enum  SDL_bool { SDL_FALSE = 0, SDL_TRUE = 1 }
 
typedef int8_t Sint8
 A signed 8-bit integer type.
 
typedef uint8_t Uint8
 An unsigned 8-bit integer type.
 
typedef int16_t Sint16
 A signed 16-bit integer type.
 
typedef uint16_t Uint16
 An unsigned 16-bit integer type.
 
typedef int32_t Sint32
 A signed 32-bit integer type.
 
typedef uint32_t Uint32
 An unsigned 32-bit integer type.
 
typedef int64_t Sint64
 A signed 64-bit integer type.
 
typedef uint64_t Uint64
 An unsigned 64-bit integer type.
 

Detailed Description

This is a general header that includes C language support.

Macro Definition Documentation

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

The number of elements in an array.

#define SDL_FOURCC (   A,
  B,
  C,
 
)
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))
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:129
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:145

Function Documentation

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.