unincmp

Compares a specified number of characters of two Unicode strings.

Library:LibC
Service:Characters and Strings

Syntax

  #include <unilib.h> 
   
  int unincmp (
     const unicode_t   *s1,
     const unicode_t   *s2,
     size_t             n);
  

Parameters

s1

(IN) Points to the first string to be compared.

s2

(IN) Points to the second string to be compared.

n

(IN) Specifies the maximum number of characters (not bytes) to be compared.

Return Values

Returns one of the following values:

Remarks

The unincmp function compares s1 to s2, for a maximum length of n characters, starting with the first character in each string and continuing with subsequent characters until the corresponding characters differ, the number of characters specified is reached, or the end of the strings is reached. The comparison is done lexicographically, using the value of the Unicode character not the collation weight.

The unincmp function is useful for comparing strings for equality. Do not call unincmp for sorting strings into collation order.

The unincmp function corresponds to the strncmp function.

See Also