| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 2.11

 

lexwcmp

#include "sflstr.h"
int
lexwcmp (
    const char *string1,
    const char *pattern)

Synopsis

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

Source Code - (sflstr.c)

{
    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);
}

| << | < | > | >> iMatix Copyright © 1996-2000 iMatix Corporation