2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group. In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document. The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
25 .\" This notice shall appear on any product containing this material.
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
43 .\" Copyright 1989 AT&T
44 .\" Copyright (c) 2001, The IEEE and The Open Group. All Rights Reserved.
45 .\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved.
46 .\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
48 .TH STRCOLL 3C "Jun 23, 2014"
50 strcoll, strcoll_l \- string collation
56 \fBint\fR \fBstrcoll\fR(\fBconst char *\fR\fIs1\fR, \fBconst char *\fR\fIs2\fR);
60 \fBint\fR \fBstrcoll_l\fR(\fBconst char *\fR\fIs1\fR, \fBconst char *\fR\fIs2\fR, \fBlocale_t\fR \fIloc\fR);
65 Both \fBstrcoll()\fR and \fBstrxfrm\fR(3C) provide for locale-specific string
66 sorting. \fBstrcoll()\fR is intended for applications in which the number of
67 comparisons per string is small. When strings are to be compared a number of
68 times, \fBstrxfrm\fR(3C) is a more appropriate function because the
69 transformation process occurs only once.
71 The \fBstrcoll_l()\fR function behaves
72 identically to \fBstrcoll()\fR, except instead of operating in the current
73 locale, it operates in the locale specified by \fIloc\fR.
75 The \fBstrcoll()\fR function does not change the setting of \fBerrno\fR if
78 Since no return value is reserved to indicate an error, an application wishing
79 to check for error situations should set \fBerrno\fR to 0, then call
80 \fBstrcoll()\fR, then check \fBerrno\fR.
83 Upon successful completion, \fBstrcoll()\fR returns an integer greater than,
84 equal to, or less than zero in direct correlation to whether string \fIs1\fR is
85 greater than, equal to, or less than the string \fIs2\fR. The comparison is
86 based on strings interpreted as appropriate to the locale
87 category \fBLC_COLLATE\fR (see \fBsetlocale\fR(3C)).
89 On error, \fBstrcoll()\fR may set \fBerrno\fR, but no return value is reserved
94 The \fBstrcoll()\fR and \fBstrcoll_l()\fR functions may fail if:
101 The \fIs1\fR or \fIs2\fR arguments contain characters outside the domain of the
105 .IP \fB/usr/lib/locale/\fR\fIlocale\fR\fB/LC_COLLATE/*\fR
106 collation database for \fIlocale\fR
109 See \fBattributes\fR(5) for descriptions of the following attributes:
114 ATTRIBUTE TYPE ATTRIBUTE VALUE
118 Interface Stability Standard
126 \fBlocaledef\fR(1), \fBnewlocale\fR(3C), \fBsetlocale\fR(3C), \fBstring\fR(3C),
127 \fBstrxfrm\fR(3C), \fBuselocale\fR(3C),
128 \fBwsxfrm\fR(3C), \fBattributes\fR(5), \fBenviron\fR(5), \fBstandards\fR(5)