zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SDL_string.c File Reference
#include "SDL_config.h"
#include "SDL_stdinc.h"

Go to the source code of this file.

Macros

#define SDL_islowerhex(X)   (((X) >= 'a') && ((X) <= 'f'))
 
#define SDL_isupperhex(X)   (((X) >= 'A') && ((X) <= 'F'))
 
#define UTF8_IsLeadByte(c)   ((c) >= 0xC0 && (c) <= 0xF4)
 
#define UTF8_IsTrailingByte(c)   ((c) >= 0x80 && (c) <= 0xBF)
 

Enumerations

enum  SDL_letter_case { SDL_CASE_NOCHANGE, SDL_CASE_LOWER, SDL_CASE_UPPER }
 

Functions

double SDL_atof (const char *string)
 
int SDL_atoi (const char *string)
 
char * SDL_itoa (int value, char *string, int radix)
 
char * SDL_lltoa (Sint64 value, char *string, int radix)
 
char * SDL_ltoa (long value, char *string, int radix)
 
int SDL_memcmp (const void *s1, const void *s2, size_t len)
 
voidSDL_memcpy (void *dst, const void *src, size_t len)
 
voidSDL_memmove (void *dst, const void *src, size_t len)
 
voidSDL_memset (void *dst, int c, size_t len)
 
static size_t SDL_PrintFloat (char *text, size_t maxlen, SDL_FormatInfo *info, double arg)
 
static size_t SDL_PrintLong (char *text, size_t maxlen, SDL_FormatInfo *info, long value)
 
static size_t SDL_PrintLongLong (char *text, size_t maxlen, SDL_FormatInfo *info, Sint64 value)
 
static size_t SDL_PrintString (char *text, size_t maxlen, SDL_FormatInfo *info, const char *string)
 
static size_t SDL_PrintUnsignedLong (char *text, size_t maxlen, SDL_FormatInfo *info, unsigned long value)
 
static size_t SDL_PrintUnsignedLongLong (char *text, size_t maxlen, SDL_FormatInfo *info, Uint64 value)
 
static size_t SDL_ScanFloat (const char *text, double *valuep)
 
static size_t SDL_ScanLong (const char *text, int radix, long *valuep)
 
static size_t SDL_ScanLongLong (const char *text, int radix, Sint64 *valuep)
 
static size_t SDL_ScanUintPtrT (const char *text, int radix, uintptr_t *valuep)
 
static size_t SDL_ScanUnsignedLong (const char *text, int radix, unsigned long *valuep)
 
static size_t SDL_ScanUnsignedLongLong (const char *text, int radix, Uint64 *valuep)
 
int SDL_snprintf (char *text, size_t maxlen, const char *fmt,...)
 
int SDL_sscanf (const char *text, const char *fmt,...)
 
int SDL_strcasecmp (const char *str1, const char *str2)
 
char * SDL_strchr (const char *string, int c)
 
int SDL_strcmp (const char *str1, const char *str2)
 
char * SDL_strdup (const char *string)
 
size_t SDL_strlcat (char *dst, const char *src, size_t maxlen)
 
size_t SDL_strlcpy (char *dst, const char *src, size_t maxlen)
 
size_t SDL_strlen (const char *string)
 
char * SDL_strlwr (char *string)
 
int SDL_strncasecmp (const char *str1, const char *str2, size_t maxlen)
 
int SDL_strncmp (const char *str1, const char *str2, size_t maxlen)
 
char * SDL_strrchr (const char *string, int c)
 
char * SDL_strrev (char *string)
 
char * SDL_strstr (const char *haystack, const char *needle)
 
double SDL_strtod (const char *string, char **endp)
 
long SDL_strtol (const char *string, char **endp, int base)
 
Sint64 SDL_strtoll (const char *string, char **endp, int base)
 
unsigned long SDL_strtoul (const char *string, char **endp, int base)
 
Uint64 SDL_strtoull (const char *string, char **endp, int base)
 
char * SDL_strupr (char *string)
 
char * SDL_uitoa (unsigned int value, char *string, int radix)
 
char * SDL_ulltoa (Uint64 value, char *string, int radix)
 
char * SDL_ultoa (unsigned long value, char *string, int radix)
 
size_t SDL_utf8strlcpy (char *dst, const char *src, size_t dst_bytes)
 
int SDL_vsnprintf (char *text, size_t maxlen, const char *fmt, va_list ap)
 
size_t SDL_wcslcat (wchar_t *dst, const wchar_t *src, size_t maxlen)
 
size_t SDL_wcslcpy (wchar_t *dst, const wchar_t *src, size_t maxlen)
 
size_t SDL_wcslen (const wchar_t *string)
 
static int UTF8_TrailingBytes (unsigned char c)
 

Variables

static const char ntoa_table []
 

Macro Definition Documentation

#define SDL_islowerhex (   X)    (((X) >= 'a') && ((X) <= 'f'))
#define SDL_isupperhex (   X)    (((X) >= 'A') && ((X) <= 'F'))
#define UTF8_IsLeadByte (   c)    ((c) >= 0xC0 && (c) <= 0xF4)

Definition at line 31 of file SDL_string.c.

Referenced by SDL_utf8strlcpy().

#define UTF8_IsTrailingByte (   c)    ((c) >= 0x80 && (c) <= 0xBF)

Definition at line 32 of file SDL_string.c.

Referenced by SDL_utf8strlcpy().

Enumeration Type Documentation

Enumerator
SDL_CASE_NOCHANGE 
SDL_CASE_LOWER 
SDL_CASE_UPPER 

Definition at line 1296 of file SDL_string.c.

Function Documentation

double SDL_atof ( const char *  string)

Definition at line 783 of file SDL_string.c.

References NULL, and SDL_strtod().

Referenced by SDLTest_CommonArg().

int SDL_atoi ( const char *  string)
char* SDL_itoa ( int  value,
char *  string,
int  radix 
)

Definition at line 639 of file SDL_string.c.

References Zeni::itoa(), and SDL_ltoa().

Referenced by SDL_AddVideoDisplay().

char* SDL_lltoa ( Sint64  value,
char *  string,
int  radix 
)

Definition at line 717 of file SDL_string.c.

References ntoa_table, and SDL_strrev().

Referenced by SDL_PrintLongLong().

char* SDL_ltoa ( long  value,
char *  string,
int  radix 
)

Definition at line 659 of file SDL_string.c.

References ntoa_table, and SDL_strrev().

Referenced by SDL_itoa(), and SDL_PrintLong().

void* SDL_memmove ( void dst,
const void src,
size_t  len 
)

Definition at line 346 of file SDL_string.c.

References memmove.

Referenced by SDL_BlitCopy().

static size_t SDL_PrintFloat ( char *  text,
size_t  maxlen,
SDL_FormatInfo *  info,
double  arg 
)
static

Definition at line 1379 of file SDL_string.c.

References int, NULL, SDL_min, and SDL_PrintUnsignedLong().

Referenced by SDL_vsnprintf().

static size_t SDL_PrintLong ( char *  text,
size_t  maxlen,
SDL_FormatInfo *  info,
long  value 
)
static

Definition at line 1343 of file SDL_string.c.

References SDL_ltoa(), and SDL_PrintString().

Referenced by SDL_vsnprintf().

static size_t SDL_PrintLongLong ( char *  text,
size_t  maxlen,
SDL_FormatInfo *  info,
Sint64  value 
)
static

Definition at line 1361 of file SDL_string.c.

References SDL_lltoa(), and SDL_PrintString().

Referenced by SDL_vsnprintf().

static size_t SDL_PrintString ( char *  text,
size_t  maxlen,
SDL_FormatInfo *  info,
const char *  string 
)
static
static size_t SDL_PrintUnsignedLong ( char *  text,
size_t  maxlen,
SDL_FormatInfo *  info,
unsigned long  value 
)
static

Definition at line 1352 of file SDL_string.c.

References SDL_PrintString(), and SDL_ultoa().

Referenced by SDL_PrintFloat(), and SDL_vsnprintf().

static size_t SDL_PrintUnsignedLongLong ( char *  text,
size_t  maxlen,
SDL_FormatInfo *  info,
Uint64  value 
)
static

Definition at line 1370 of file SDL_string.c.

References SDL_PrintString(), and SDL_ulltoa().

Referenced by SDL_vsnprintf().

static size_t SDL_ScanFloat ( const char *  text,
double *  valuep 
)
static

Definition at line 226 of file SDL_string.c.

References SDL_FALSE, SDL_isdigit(), SDL_ScanUnsignedLong(), and SDL_TRUE.

Referenced by SDL_sscanf(), and SDL_strtod().

static size_t SDL_ScanLong ( const char *  text,
int  radix,
long *  valuep 
)
static

Definition at line 48 of file SDL_string.c.

References SDL_FALSE, SDL_isdigit(), SDL_islowerhex, SDL_isupperhex, SDL_strncmp(), and SDL_TRUE.

Referenced by SDL_sscanf(), and SDL_strtol().

static size_t SDL_ScanLongLong ( const char *  text,
int  radix,
Sint64 valuep 
)
static

Definition at line 153 of file SDL_string.c.

References SDL_FALSE, SDL_isdigit(), SDL_islowerhex, SDL_isupperhex, SDL_strncmp(), and SDL_TRUE.

Referenced by SDL_sscanf(), and SDL_strtoll().

static size_t SDL_ScanUintPtrT ( const char *  text,
int  radix,
uintptr_t valuep 
)
static

Definition at line 121 of file SDL_string.c.

References SDL_isdigit(), SDL_islowerhex, SDL_isupperhex, and SDL_strncmp().

Referenced by SDL_sscanf().

static size_t SDL_ScanUnsignedLong ( const char *  text,
int  radix,
unsigned long *  valuep 
)
static

Definition at line 89 of file SDL_string.c.

References SDL_isdigit(), SDL_islowerhex, SDL_isupperhex, and SDL_strncmp().

Referenced by SDL_ScanFloat(), SDL_sscanf(), and SDL_strtoul().

static size_t SDL_ScanUnsignedLongLong ( const char *  text,
int  radix,
Uint64 valuep 
)
static

Definition at line 194 of file SDL_string.c.

References SDL_isdigit(), SDL_islowerhex, SDL_isupperhex, and SDL_strncmp().

Referenced by SDL_sscanf(), and SDL_strtoull().

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

Definition at line 496 of file SDL_string.c.

References SDL_strlcpy(), and SDL_strlen().

size_t SDL_strlcpy ( char *  dst,
const char *  src,
size_t  maxlen 
)
char* SDL_strlwr ( char *  string)

Definition at line 560 of file SDL_string.c.

References SDL_tolower().

Referenced by SDL_PrintString().

int SDL_strncasecmp ( const char *  str1,
const char *  str2,
size_t  maxlen 
)

Definition at line 970 of file SDL_string.c.

References SDL_tolower().

Referenced by SDL_AudioInit(), and SDL_VideoInit().

char* SDL_strrchr ( const char *  string,
int  c 
)

Definition at line 593 of file SDL_string.c.

References NULL, SDL_const_cast, and SDL_strlen().

char* SDL_strrev ( char *  string)

Definition at line 526 of file SDL_string.c.

References SDL_strlen().

Referenced by SDL_lltoa(), SDL_ltoa(), SDL_ulltoa(), and SDL_ultoa().

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

Definition at line 612 of file SDL_string.c.

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

Referenced by SDL_GL_ExtensionSupported(), and ShouldUseTextureFramebuffer().

double SDL_strtod ( const char *  string,
char **  endp 
)

Definition at line 893 of file SDL_string.c.

References SDL_ScanFloat().

Referenced by SDL_atof().

long SDL_strtol ( const char *  string,
char **  endp,
int  base 
)

Definition at line 793 of file SDL_string.c.

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

Referenced by SDL_atoi(), and SDL_vsnprintf().

Sint64 SDL_strtoll ( const char *  string,
char **  endp,
int  base 
)

Definition at line 843 of file SDL_string.c.

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

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

Definition at line 818 of file SDL_string.c.

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

Uint64 SDL_strtoull ( const char *  string,
char **  endp,
int  base 
)

Definition at line 868 of file SDL_string.c.

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

char* SDL_strupr ( char *  string)

Definition at line 545 of file SDL_string.c.

References SDL_toupper().

Referenced by SDL_PrintString().

char* SDL_uitoa ( unsigned int  value,
char *  string,
int  radix 
)

Definition at line 649 of file SDL_string.c.

References SDL_ultoa().

char* SDL_ulltoa ( Uint64  value,
char *  string,
int  radix 
)

Definition at line 750 of file SDL_string.c.

References ntoa_table, and SDL_strrev().

Referenced by SDL_PrintUnsignedLongLong().

char* SDL_ultoa ( unsigned long  value,
char *  string,
int  radix 
)

Definition at line 692 of file SDL_string.c.

References ntoa_table, and SDL_strrev().

Referenced by SDL_PrintUnsignedLong(), and SDL_uitoa().

size_t SDL_utf8strlcpy ( char *  dst,
const char *  src,
size_t  dst_bytes 
)
size_t SDL_wcslcat ( wchar_t *  dst,
const wchar_t *  src,
size_t  maxlen 
)

Definition at line 433 of file SDL_string.c.

References SDL_wcslcpy(), and SDL_wcslen().

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

Definition at line 417 of file SDL_string.c.

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

Referenced by SDL_wcslcat().

size_t SDL_wcslen ( const wchar_t *  string)

Definition at line 403 of file SDL_string.c.

Referenced by SDL_wcslcat(), and SDL_wcslcpy().

static int UTF8_TrailingBytes ( unsigned char  c)
static

Definition at line 34 of file SDL_string.c.

Referenced by SDL_utf8strlcpy().

Variable Documentation

const char ntoa_table[]
static
Initial value:
= {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
'U', 'V', 'W', 'X', 'Y', 'Z'
}

Definition at line 630 of file SDL_string.c.

Referenced by SDL_lltoa(), SDL_ltoa(), SDL_ulltoa(), and SDL_ultoa().