Name

wcsnicoll - wide-character string comparison using collating information

Library

libc.lib

Synopsis

  #include <wchar.h>
  int wcsnicoll (const wchar_t *s1, const wchar_t *s2, int n);

Return values

The wcsnicoll function returns an integer greater than, equal to, or less than 0, if s1 is greater than, equal to, or less than s2.

No return value is reserved to indicate errors; callers should set errno to 0 before calling wcsnicoll. If it is non-zero upon return from wcsnicoll, an error has occurred.


Detailed description

The wcsnicoll function compares the null-terminated strings s1 and s2 according to the current locale collation order. In the "C" locale, wcsnicoll is equivalent to wcsncasecmp.

Examples

#include <wchar.h>
/* Illustrates how to use wcsnicoll API */
int example_wcsnicoll (void)
{  
        /* compares the two strings */
  if( wcsnicoll(L"abcdef",L"abcdeg",7) != L’f’-L’g’)  
   return -1;
 return 0;
}

         


Errors

The wcsnicoll function will fail if:
[EILSEQ]
  An invalid wide character code was specified.
[ENOMEM]
  Cannot allocate enough memory for temporary buffers.

Limitations

The current implementation of wcsnicoll is not affected by the LC_CTYPE category of the current locale. It is equivalent to wcsncasecmp in this implementation.

See also

setlocale, strcoll, wcscmp, wcsxfrm, wcsncasecmp

Bugs

The current implementation of wcsnicoll only works in single-byte LC_CTYPE locales, and falls back to using wcsncoll in locales with extended character sets.

Feedback

For additional information or queries on this page send feedback

© 2005-2007 Nokia

Top