Added UTF-8 <-> UTF-16 <-> UTF-32 <-> UCS-2 <-> UCS-4 conversion capability
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401505
This commit is contained in:
parent
5f71e5a774
commit
3750cb6c4d
8 changed files with 958 additions and 5 deletions
|
@ -661,12 +661,12 @@ int SDL_strncmp(const char *str1, const char *str2, size_t maxlen)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRCASECMP
|
||||
#if !defined(HAVE_STRCASECMP) && !defined(HAVE_STRICMP)
|
||||
int SDL_strcasecmp(const char *str1, const char *str2)
|
||||
{
|
||||
char a = 0;
|
||||
char b = 0;
|
||||
while (*str1 && *str2) {
|
||||
while ( *str1 && *str2 ) {
|
||||
a = SDL_tolower(*str1);
|
||||
b = SDL_tolower(*str2);
|
||||
if ( a != b )
|
||||
|
@ -678,6 +678,24 @@ int SDL_strcasecmp(const char *str1, const char *str2)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRNCASECMP
|
||||
int SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen)
|
||||
{
|
||||
char a = 0;
|
||||
char b = 0;
|
||||
while ( *str1 && *str2 && maxlen ) {
|
||||
a = SDL_tolower(*str1);
|
||||
b = SDL_tolower(*str2);
|
||||
if ( a != b )
|
||||
break;
|
||||
++str1;
|
||||
++str2;
|
||||
--maxlen;
|
||||
}
|
||||
return (int)((unsigned char)a - (unsigned char)b);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_SSCANF
|
||||
int SDL_sscanf(const char *text, const char *fmt, ...)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue