strcoll(), strcoll_l()

compare two strings using LC_COLLATE 

Function


SYNOPSIS

#include <string.h>

int strcoll(const char *s1, const char *s2);

#include <string.h>

#include <locale.h>

int strcoll_l(const char *s1, const char *s2, locale_t locale);


DESCRIPTION

The strcoll() function compares the string pointed to by s1 to the string pointed to by s2. Both s1 and s2 are interpreted as appropriate for the LC_COLLATE category of the current locale.

strcoll_l() behaves in the same way as strcoll() without the _l suffix, but uses the specified locale rather than the global or per-thread locale. A locale_t is returned by newlocale().


PARAMETERS

s1 

Is the null-terminated string to compare.

s2 

Is the null-terminated string to compare.

locale 

Is a locale_t perhaps returned by newlocale() or LC_GLOBAL_LOCALE or 0 for the current thread locale set with uselocale().


RETURN VALUES

The function strcoll() and strcoll_l() return a positive integer if string s1 is lexically greater than string s2; zero if the two strings are identical; and a negative integer if string s1 is lexically less than string s2, as defined by the process, thread or specified locale.


CONFORMANCE

strcoll() conforms to ANSI/ISO 9899:1990 'ISO C90'

strcoll_l() conforms to IEEE Std 1003.1-2008 'POSIX.1'


MULTITHREAD SAFETY LEVEL

MT-Safe, with exceptions.

The function strcoll() is MT-Safe as long as no thread calls setlocale() while this function is executing.

The function strcoll_l() is MT-Safe as long as no thread calls freelocale() on locale while this function is executing.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
memcmp(), strcasecmp(), strcasecmp_l(), strcmp(), strcmp_l(), strncasecmp(), strncasecmp_l(), strncmp(), strncmp_l()


PTC MKS Toolkit 10.5 Documentation Build 40.