MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / SDL_strncasecmp

Function SDL_strncasecmp

deps/SDL2/src/stdlib/SDL_string.c:1037–1064  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1035}
1036
1037int
1038SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen)
1039{
1040#ifdef HAVE_STRNCASECMP
1041 return strncasecmp(str1, str2, maxlen);
1042#elif defined(HAVE__STRNICMP)
1043 return _strnicmp(str1, str2, maxlen);
1044#else
1045 char a = 0;
1046 char b = 0;
1047 while (*str1 && *str2 && maxlen) {
1048 a = SDL_tolower((unsigned char) *str1);
1049 b = SDL_tolower((unsigned char) *str2);
1050 if (a != b)
1051 break;
1052 ++str1;
1053 ++str2;
1054 --maxlen;
1055 }
1056 if (maxlen == 0) {
1057 return 0;
1058 } else {
1059 a = SDL_tolower((unsigned char) *str1);
1060 b = SDL_tolower((unsigned char) *str2);
1061 return (int) ((unsigned char) a - (unsigned char) b);
1062 }
1063#endif /* HAVE_STRNCASECMP */
1064}
1065
1066int
1067SDL_sscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, ...)

Callers 6

SDL_AudioInitFunction · 0.85
SDL_VideoInitFunction · 0.85
GetDeviceInfoFunction · 0.85
HIDAPI_AddDeviceFunction · 0.85

Calls 1

SDL_tolowerFunction · 0.85

Tested by

no test coverage detected