1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
3 .\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA)
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
10 .\" References consulted:
11 .\" GNU glibc-2 source code and manual
12 .\" Dinkumware C library reference http://www.dinkumware.com/
13 .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
15 .TH WCSNRTOMBS 3 2017-09-15 "GNU" "Linux Programmer's Manual"
17 wcsnrtombs \- convert a wide-character string to a multibyte string
22 .BI "size_t wcsnrtombs(char *" dest ", const wchar_t **" src ", size_t " nwc ,
23 .BI " size_t " len ", mbstate_t *" ps );
27 Feature Test Macro Requirements for glibc (see
28 .BR feature_test_macros (7)):
37 _POSIX_C_SOURCE\ >=\ 200809L
50 except that the number of wide characters to be converted,
65 the wide-character string
67 to a multibyte string starting at
76 The conversion is effectively performed by repeatedly
78 .IR "wcrtomb(dest, *src, ps)" ,
79 as long as this call succeeds,
83 number of bytes written and
86 The conversion can stop for three reasons:
88 A wide character has been encountered that can not be represented as a
89 multibyte sequence (according to the current locale).
92 is left pointing to the invalid wide character,
101 wide characters have been
102 converted without encountering a null wide character (L\(aq\e0\(aq),
103 or the length limit forces a stop.
107 to the next wide character to be converted, and the number of bytes written
112 The wide-character string has been completely converted, including the
113 terminating null wide character (which has the side effect of bringing back
115 to the initial state).
118 is set to NULL, and the number
121 excluding the terminating null byte (\(aq\e0\(aq), is
129 and the conversion proceeds as above,
130 except that the converted bytes are not written out to memory, and that
131 no destination length limit exists.
133 In both of the above cases,
136 is NULL, a static anonymous
137 state known only to the
139 function is used instead.
141 The programmer must ensure that there is room for at least
150 the number of bytes that make up the
151 converted part of multibyte sequence,
152 not including the terminating null byte.
153 If a wide character was encountered which
154 could not be converted,
161 For an explanation of the terms used in this section, see
167 Interface Attribute Value
170 T} Thread safety MT-Unsafe race:wcsnrtombs/!ps
185 is not multithread safe.