Newer
Older
Scratch / mobius / src / libc / string / wcsicmp.c
@Christopher W. Olsen Christopher W. Olsen on 25 Oct 2019 306 bytes Scratch
#include <string.h>

#define isupper(ch)	((ch) >= L'A' && (ch) <= L'Z')
#define tolower(ch)	(isupper(ch) ? (ch) - L'A' + L'a' : (ch))

int wcsicmp(const wchar_t *str1, const wchar_t *str2)
{
	while((*str2 != L'\0') && (tolower(*str1) == tolower(*str2)))
	{
		str1++;
		str2++;
	}
	return *str1 -  *str2;
}