1strcoll(3C)              Standard C Library Functions              strcoll(3C)
2
3
4

NAME

6       strcoll - string collation
7

SYNOPSIS

9       #include <string.h>
10
11       int strcoll(const char *s1, const char *s2);
12
13

DESCRIPTION

15       Both strcoll() and strxfrm(3C) provide for locale-specific string sort‐
16       ing.  strcoll() is intended for applications in  which  the  number  of
17       comparisons per string is small. When strings are to be compared a num‐
18       ber of times, strxfrm(3C) is a more appropriate  function  because  the
19       transformation process occurs only once.
20
21
22       The strcoll() function does not change the setting of errno if success‐
23       ful.
24
25
26       Since no return value is reserved to indicate an error, an  application
27       wishing  to check for error situations should set errno to 0, then call
28       strcoll(), then check errno.
29

RETURN VALUES

31       Upon successful completion, strcoll() returns an integer greater  than,
32       equal  to, or less than zero in direct correlation to whether string s1
33       is greater than, equal to, or less than the string s2.  The  comparison
34       is  based on strings interpreted as appropriate to the program's locale
35       for category LC_COLLATE (see setlocale(3C)).
36
37
38       On error, strcoll() may set errno, but no return value is  reserved  to
39       indicate an error.
40

ERRORS

42       The strcoll() function may fail if:
43
44       EINVAL    The  s1 or s2 arguments contain characters outside the domain
45                 of the collating sequence.
46
47

FILES

49       /usr/lib/locale/locale/locale.so.*
50
51           LC_COLLATE database for locale
52
53

ATTRIBUTES

55       See attributes(5) for descriptions of the following attributes:
56
57
58
59
60       ┌─────────────────────────────┬─────────────────────────────┐
61       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
62       ├─────────────────────────────┼─────────────────────────────┤
63       │CSI                          │Enabled                      │
64       ├─────────────────────────────┼─────────────────────────────┤
65       │Interface Stability          │Standard                     │
66       ├─────────────────────────────┼─────────────────────────────┤
67       │MT-Level                     │MT-Safe with exceptions      │
68       └─────────────────────────────┴─────────────────────────────┘
69
70
71       The strcoll() function can be used  safely  in  multithreaded  applica‐
72       tions,  as  long  as  setlocale(3C)  is  not being called to change the
73       locale.
74

SEE ALSO

76       localedef(1),  setlocale(3C),  string(3C),   strxfrm(3C),   wsxfrm(3C),
77       attributes(5), environ(5), standards(5)
78
79
80
81SunOS 5.11                        1 Nov 2003                       strcoll(3C)
Impressum