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

 

lexncmp

#include "sflstr.h"
int
lexncmp (
    const char *string1,
    const char *string2,
    const int   count)

Synopsis

Performs an unsigned comparison of two strings without regard to the case of specified number of letters in the strings. Returns a value that is
< 0 if string1 is less than string2
== 0 if string1 is equal to string2
> 0 if string1 is greater than string2

Source Code - (sflstr.c)

{
    int
        cmp;
    char
        *end;

    ASSERT (string1);
    ASSERT (string2);

    end = (char *)string1 + count;
    do
      {
        cmp = (byte) tolower (*string1) - (byte) tolower (*string2);
      }
    while (*string1++ && *string2++ && cmp == 0 && string1 < end);
    return (cmp);
}

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