1WCSXFRM(3P) POSIX Programmer's Manual WCSXFRM(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 wcsxfrm, wcsxfrm_l — wide-character string transformation
13
15 #include <wchar.h>
16
17 size_t wcsxfrm(wchar_t *restrict ws1, const wchar_t *restrict ws2,
18 size_t n);
19 size_t wcsxfrm_l(wchar_t *restrict ws1, const wchar_t *restrict ws2,
20 size_t n, locale_t locale);
21
23 For wcsxfrm(): 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 wcsxfrm() and wcsxfrm_l() functions shall transform the wide-char‐
29 acter string pointed to by ws2 and place the resulting wide-character
30 string into the array pointed to by ws1. The transformation shall be
31 such that if wcscmp() is applied to two transformed wide strings, it
32 shall return a value greater than, equal to, or less than 0, corre‐
33 sponding to the result of wcscoll() and wcscoll_l() applied to the same
34 two original wide-character strings, and the same LC_COLLATE category
35 of the current locale or the locale object locale, respectively. No
36 more than n wide-character codes shall be placed into the resulting
37 array pointed to by ws1, including the terminating null wide-character
38 code. If n is 0, ws1 is permitted to be a null pointer. If copying
39 takes place between objects that overlap, the behavior is undefined.
40
41 The wcsxfrm() and wcsxfrm_l() functions shall not change the setting of
42 errno if successful.
43
44 Since no return value is reserved to indicate an error, an application
45 wishing to check for error situations should set errno to 0, then call
46 wcsxfrm() or wcsxfrm_l(), then check errno.
47
48 The behavior is undefined if the locale argument to wcsxfrm_l() is the
49 special locale object LC_GLOBAL_LOCALE or is not a valid locale object
50 handle.
51
53 The wcsxfrm() and wcsxfrm_l() functions shall return the length of the
54 transformed wide-character string (not including the terminating null
55 wide-character code). If the value returned is n or more, the contents
56 of the array pointed to by ws1 are unspecified.
57
58 On error, the wcsxfrm() and wcsxfrm_l() functions may set errno, but no
59 return value is reserved to indicate an error.
60
62 These functions may fail if:
63
64 EINVAL The wide-character string pointed to by ws2 contains wide-char‐
65 acter codes outside the domain of the collating sequence.
66
67 The following sections are informative.
68
70 None.
71
73 The transformation function is such that two transformed wide-character
74 strings can be ordered by wcscmp() as appropriate to collating sequence
75 information in the current locale (category LC_COLLATE).
76
77 The fact that when n is 0 ws1 is permitted to be a null pointer is use‐
78 ful to determine the size of the ws1 array prior to making the trans‐
79 formation.
80
82 None.
83
85 None.
86
88 wcscmp(), wcscoll()
89
90 The Base Definitions volume of POSIX.1‐2017, <wchar.h>
91
93 Portions of this text are reprinted and reproduced in electronic form
94 from IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
95 table Operating System Interface (POSIX), The Open Group Base Specifi‐
96 cations Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of
97 Electrical and Electronics Engineers, Inc and The Open Group. In the
98 event of any discrepancy between this version and the original IEEE and
99 The Open Group Standard, the original IEEE and The Open Group Standard
100 is the referee document. The original Standard can be obtained online
101 at http://www.opengroup.org/unix/online.html .
102
103 Any typographical or formatting errors that appear in this page are
104 most likely to have been introduced during the conversion of the source
105 files to man page format. To report such errors, see https://www.ker‐
106 nel.org/doc/man-pages/reporting_bugs.html .
107
108
109
110IEEE/The Open Group 2017 WCSXFRM(3P)