/* lwrcmpz.c */ /* Copyright 1997 by Eberhard Mattes Donated to the public domain. No warranty. 1997-09-09 Initial version */ #include #include "libemfw.h" /* Compare the null-terminated strings pointed to by S1 and S2, ignoring case. Return a positive value (S1 compares greater than S2), zero (S1 compares equal to S2), or a negative value (S1 compares less than S2). Characters are converted to lower case for comparison. */ int lower_cmpz (const char *s1, const char *s2) { int d; DEBUG_ASSERT (s1 != NULL); DEBUG_ASSERT (s2 != NULL); DEBUG_ASSERT (lower_table[0] == 0); for (;;) { d = lower_table[(unsigned char)*s1] - lower_table[(unsigned char)*s2]; if (d != 0 || *s1 == 0 || *s2 == 0) return d; ++s1; ++s2; } }