| iMatix home page | << | < | > | >> |
![]() Version 1.91 |
#include "sflstr.h" int lexwcmp ( const char *string1, const char *pattern)
Compares two strings ignoring case, and allowing wildcards in the second string (the pattern). Two special characters are recognised in the pattern: '?' matches any character in the string, and '*' matches the remainder of the string. Returns a value that is:
< 0 | if string1 is less than pattern |
== 0 | if string1 is equal to pattern |
> 0 | if string1 is greater than pattern |
{ int cmp = 0; ASSERT (string1); ASSERT (pattern); do { if (*pattern != '?' && *pattern != '*') cmp = (byte) tolower (*string1) - (byte) tolower (*pattern); } while (*string1++ && *pattern++ && cmp == 0 && *pattern != '*'); return (cmp); }
| << | < | > | >> |
![]() |