1WCSCOLL(3P) POSIX Programmer's Manual WCSCOLL(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 wcscoll, wcscoll_l — wide-character string comparison using collating
13 information
14
16 #include <wchar.h>
17
18 int wcscoll(const wchar_t *ws1, const wchar_t *ws2);
19 int wcscoll_l(const wchar_t *ws1, const wchar_t *ws2,
20 locale_t locale);
21
23 For wcscoll(): The functionality described on this reference page is
24 aligned with the ISO C standard. Any conflict between the requirements
25 described here and the ISO C standard is unintentional. This volume of
26 POSIX.1‐2017 defers to the ISO C standard.
27
28 The wcscoll() and wcscoll_l() functions shall compare the wide-charac‐
29 ter string pointed to by ws1 to the wide-character string pointed to by
30 ws2, both interpreted as appropriate to the LC_COLLATE category of the
31 current locale, or the locale represented by locale, respectively.
32
33 The wcscoll() and wcscoll_l() functions shall not change the setting of
34 errno if successful.
35
36 An application wishing to check for error situations should set errno
37 to 0 before calling wcscoll() or wcscoll_l(). If errno is non-zero on
38 return, an error has occurred.
39
40 The behavior is undefined if the locale argument to wcscoll_l() is the
41 special locale object LC_GLOBAL_LOCALE or is not a valid locale object
42 handle.
43
45 Upon successful completion, wcscoll() and wcscoll_l() shall return an
46 integer greater than, equal to, or less than 0, according to whether
47 the wide-character string pointed to by ws1 is greater than, equal to,
48 or less than the wide-character string pointed to by ws2, when both are
49 interpreted as appropriate to the current locale, or to the locale rep‐
50 resented by locale, respectively. On error, wcscoll() and wcscoll_l()
51 shall set errno, but no return value is reserved to indicate an error.
52
54 These functions may fail if:
55
56 EINVAL The ws1 or ws2 arguments contain wide-character codes outside
57 the domain of the collating sequence.
58
59 The following sections are informative.
60
62 None.
63
65 The wcsxfrm() and wcscmp() functions should be used for sorting large
66 lists.
67
69 None.
70
72 None.
73
75 wcscmp(), wcsxfrm()
76
77 The Base Definitions volume of POSIX.1‐2017, <wchar.h>
78
80 Portions of this text are reprinted and reproduced in electronic form
81 from IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
82 table Operating System Interface (POSIX), The Open Group Base Specifi‐
83 cations Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of
84 Electrical and Electronics Engineers, Inc and The Open Group. In the
85 event of any discrepancy between this version and the original IEEE and
86 The Open Group Standard, the original IEEE and The Open Group Standard
87 is the referee document. The original Standard can be obtained online
88 at http://www.opengroup.org/unix/online.html .
89
90 Any typographical or formatting errors that appear in this page are
91 most likely to have been introduced during the conversion of the source
92 files to man page format. To report such errors, see https://www.ker‐
93 nel.org/doc/man-pages/reporting_bugs.html .
94
95
96
97IEEE/The Open Group 2017 WCSCOLL(3P)