Debian Codegraph @

upstream/debian-trixie/man3/strcoll.3

raw
1 '\" t
2 .\" Copyright 1993 David Metcalfe ([email protected])
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .\" References consulted:
7 .\" Linux libc source code
8 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
9 .\" 386BSD man pages
10 .\" Modified Sun Jul 25 10:40:44 1993 by Rik Faith ([email protected])
11 .TH strcoll 3 2024-05-02 "Linux man-pages 6.9.1"
12 .SH NAME
13 strcoll \- compare two strings using the current locale
14 .SH LIBRARY
15 Standard C library
16 .RI ( libc ", " \-lc )
17 .SH SYNOPSIS
18 .nf
19 .B #include <string.h>
20 .P
21 .BI "int strcoll(const char *" s1 ", const char *" s2 );
22 .fi
23 .SH DESCRIPTION
24 The
25 .BR strcoll ()
26 function compares the two strings
27 .I s1
28 and
29 .IR s2 .
30 It returns an integer less than, equal to, or greater
31 than zero if
32 .I s1
33 is found, respectively, to be less than,
34 to match, or be greater than
35 .IR s2 .
36 The comparison is based on
37 strings interpreted as appropriate for the program's current locale
38 for category
39 .BR LC_COLLATE .
40 (See
41 .BR setlocale (3).)
42 .SH RETURN VALUE
43 The
44 .BR strcoll ()
45 function returns an integer less than, equal to,
46 or greater than zero if
47 .I s1
48 is found, respectively, to be less
49 than, to match, or be greater than
50 .IR s2 ,
51 when both are interpreted
52 as appropriate for the current locale.
53 .SH ATTRIBUTES
54 For an explanation of the terms used in this section, see
55 .BR attributes (7).
56 .TS
57 allbox;
58 lbx lb lb
59 l l l.
60 Interface Attribute Value
61 T{
62 .na
63 .nh
64 .BR strcoll ()
65 T} Thread safety MT-Safe locale
66 .TE
67 .SH STANDARDS
68 C11, POSIX.1-2008.
69 .SH HISTORY
70 POSIX.1-2001, C89, SVr4, 4.3BSD.
71 .SH NOTES
72 In the
73 .I "POSIX"
74 or
75 .I "C"
76 locales
77 .BR strcoll ()
78 is equivalent to
79 .BR strcmp (3).
80 .SH SEE ALSO
81 .BR memcmp (3),
82 .BR setlocale (3),
83 .BR strcasecmp (3),
84 .BR strcmp (3),
85 .BR string (3),
86 .BR strxfrm (3)