1 '\" te
2 .\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved.
3 .\" Copyright 1989 AT&T
4 .\" Portions Copyright (c) 2001, the Institute of Electrical and Electronics Engineers, Inc. and The Open Group. All Rights Reserved.
5 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
6 .\" http://www.opengroup.org/bookstore/.
7 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
8 .\" This notice shall appear on any product containing this material.
9 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
10 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
11 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
12 .TH STRCOLL 3C "Nov 1, 2003"
13 .SH NAME
14 strcoll, strcoll_l \- string collation
15 .SH SYNOPSIS
16 .LP
17 .nf
18 #include <string.h>
19
20 \fBint\fR \fBstrcoll\fR(\fBconst char *\fR\fIs1\fR, \fBconst char *\fR\fIs2\fR);
21 \fBint\fR \fBstrcoll_l\fR(\fBconst char *\fR\fIs1\fR, \fBconst char *\fR\fIs2\fR, \fBlocale_t\fR \fIloc\fR);
22 .fi
23
24 .SH DESCRIPTION
25 .sp
26 .LP
27 Both \fBstrcoll()\fR and \fBstrxfrm\fR(3C) provide for locale-specific string
28 sorting. \fBstrcoll()\fR is intended for applications in which the number of
29 comparisons per string is small. When strings are to be compared a number of
30 times, \fBstrxfrm\fR(3C) is a more appropriate function because the
31 transformation process occurs only once. The \fBstrcoll_l()\fR function behaves
32 identically to \fBstrcoll()\fR, except instead of operating in the current
33 locale, it operates in the locale specified by \fIloc\fR.
34 .sp
35 .LP
36 The \fBstrcoll()\fR function does not change the setting of \fBerrno\fR if
37 successful.
38 .sp
39 .LP
40 Since no return value is reserved to indicate an error, an application wishing
41 to check for error situations should set \fBerrno\fR to 0, then call
42 \fBstrcoll()\fR, then check \fBerrno\fR.
43 .SH RETURN VALUES
44 .sp
45 .LP
46 Upon successful completion, \fBstrcoll()\fR returns an integer greater than,
47 equal to, or less than zero in direct correlation to whether string \fIs1\fR is
48 greater than, equal to, or less than the string \fIs2\fR. The comparison is
49 based on strings interpreted as appropriate to the program's locale for
50 category \fBLC_COLLATE\fR (see \fBsetlocale\fR(3C)).
51 .sp
52 .LP
53 On error, \fBstrcoll()\fR may set \fBerrno\fR, but no return value is reserved
54 to indicate an error.
55 .SH ERRORS
56 .sp
57 .LP
58 The \fBstrcoll()\fR function may fail if:
59 .sp
60 .ne 2
61 .na
62 \fB\fBEINVAL\fR\fR
63 .ad
64 .RS 10n
65 The \fIs1\fR or \fIs2\fR arguments contain characters outside the domain of the
66 collating sequence.
67 .RE
68
69 .SH FILES
70 .sp
71 .ne 2
72 .na
73 \fB\fB/usr/lib/locale/\fIlocale\fR/\fIlocale\fR.so.*\fR\fR
74 .ad
75 .sp .6
76 .RS 4n
77 \fBLC_COLLATE\fR database for \fIlocale\fR
78 .RE
79
80 .SH ATTRIBUTES
81 .sp
82 .LP
83 See \fBattributes\fR(5) for descriptions of the following attributes:
84 .sp
85
86 .sp
87 .TS
88 box;
89 c | c
90 l | l .
91 ATTRIBUTE TYPE ATTRIBUTE VALUE
92 _
93 CSI Enabled
94 _
95 Interface Stability Standard
96 _
97 MT-Level MT-Safe with exceptions
98 .TE
99
100 .sp
101 .LP
102 The \fBstrcoll()\fR function can be used safely in multithreaded applications,
103 as long as \fBsetlocale\fR(3C) is not being called to change the locale.
104 .SH SEE ALSO
105 .sp
106 .LP
107 \fBlocaledef\fR(1), \fBsetlocale\fR(3C), \fBstring\fR(3C), \fBstrxfrm\fR(3C),
108 \fBwsxfrm\fR(3C), \fBattributes\fR(5), \fBenviron\fR(5), \fBstandards\fR(5)
|
1 '\" te
2 .\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
3 .\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved.
4 .\" Copyright 1989 AT&T
5 .\" Portions Copyright (c) 2001, the Institute of Electrical and Electronics Engineers, Inc. and The Open Group. All Rights Reserved.
6 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
7 .\" http://www.opengroup.org/bookstore/.
8 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
9 .\" This notice shall appear on any product containing this material.
10 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
11 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
12 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
13 .TH STRCOLL 3C "Jun 23, 2014"
14 .SH NAME
15 strcoll, strcoll_l \- string collation
16 .SH SYNOPSIS
17 .LP
18 .nf
19 #include <string.h>
20
21 \fBint\fR \fBstrcoll\fR(\fBconst char *\fR\fIs1\fR, \fBconst char *\fR\fIs2\fR);
22 .fi
23 .LP
24 .nf
25 \fBint\fR \fBstrcoll_l\fR(\fBconst char *\fR\fIs1\fR, \fBconst char *\fR\fIs2\fR, \fBlocale_t\fR \fIloc\fR);
26 .fi
27
28 .SH DESCRIPTION
29 .LP
30 Both \fBstrcoll()\fR and \fBstrxfrm\fR(3C) provide for locale-specific string
31 sorting. \fBstrcoll()\fR is intended for applications in which the number of
32 comparisons per string is small. When strings are to be compared a number of
33 times, \fBstrxfrm\fR(3C) is a more appropriate function because the
34 transformation process occurs only once.
35 .LP
36 The \fBstrcoll_l()\fR function behaves
37 identically to \fBstrcoll()\fR, except instead of operating in the current
38 locale, it operates in the locale specified by \fIloc\fR.
39 .LP
40 The \fBstrcoll()\fR function does not change the setting of \fBerrno\fR if
41 successful.
42 .LP
43 Since no return value is reserved to indicate an error, an application wishing
44 to check for error situations should set \fBerrno\fR to 0, then call
45 \fBstrcoll()\fR, then check \fBerrno\fR.
46 .SH RETURN VALUES
47 .LP
48 Upon successful completion, \fBstrcoll()\fR returns an integer greater than,
49 equal to, or less than zero in direct correlation to whether string \fIs1\fR is
50 greater than, equal to, or less than the string \fIs2\fR. The comparison is
51 based on strings interpreted as appropriate to the locale
52 category \fBLC_COLLATE\fR (see \fBsetlocale\fR(3C)).
53 .LP
54 On error, \fBstrcoll()\fR may set \fBerrno\fR, but no return value is reserved
55 to indicate an error.
56 .SH ERRORS
57 .sp
58 .LP
59 The \fBstrcoll()\fR and \fBstrcoll_l()\fR functions may fail if:
60 .sp
61 .ne 2
62 .na
63 \fB\fBEINVAL\fR\fR
64 .ad
65 .RS 10n
66 The \fIs1\fR or \fIs2\fR arguments contain characters outside the domain of the
67 collating sequence.
68 .RE
69 .SH FILES
70 .IP \fB/usr/lib/locale/\fR\fIlocale\fR\fB/LC_COLLATE/*\fR
71 collation database for \fIlocale\fR
72 .RE
73
74 .SH ATTRIBUTES
75 .LP
76 See \fBattributes\fR(5) for descriptions of the following attributes:
77 .TS
78 box;
79 c | c
80 l | l .
81 ATTRIBUTE TYPE ATTRIBUTE VALUE
82 _
83 CSI Enabled
84 _
85 Interface Stability Standard
86 _
87 MT-Level MT-Safe
88 .TE
89
90 .SH SEE ALSO
91 .sp
92 .LP
93 \fBlocaledef\fR(1), \fBnewlocale\fR(3C), \fBsetlocale\fR(3C), \fBstring\fR(3C),
94 \fBstrxfrm\fR(3C), \fBuselocale\fR(3C),
95 \fBwsxfrm\fR(3C), \fBattributes\fR(5), \fBenviron\fR(5), \fBstandards\fR(5)
|