unicmp

Compares two Unicode strings for differences.

Library:LibC
Service:Characters and Strings

Syntax

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

Parameters

s1

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

s2

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

Return Values

Returns one of the following int values:

< 0

if s1 is less than s2

0

if s1 is equal to s2

>0

if s1 is greater than s2

Remarks

The unicmp function compares s1 to s2, starting with the first character in each string and continuing with subsequent characters until either the corresponding characters differ, 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 unicmp function is useful for comparing strings for equality. Do not call unicmp for sorting strings into collation order.

The unicmp function corresponds to the strcmp function.

See Also