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:
Sam Lantinga 2006-03-13 01:08:00 +00:00
parent 5f71e5a774
commit 3750cb6c4d
8 changed files with 958 additions and 5 deletions

View file

@ -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, ...)
{