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 MBSNRTOWCS 3 2014-03-18 "GNU" "Linux Programmer's Manual"
17 mbsnrtowcs \- convert a multibyte string to a wide-character string
22 .BI "size_t mbsnrtowcs(wchar_t *" dest ", const char **" src ,
23 .BI " size_t " nms ", size_t " len ", mbstate_t *" ps );
27 Feature Test Macro Requirements for glibc (see
28 .BR feature_test_macros (7)):
37 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
50 the number of bytes to be converted, starting at
65 to a wide-character string starting at
69 wide characters are written to
74 The conversion is effectively performed by repeatedly
76 .I "mbrtowc(dest, *src, n, ps)"
80 positive number, as long as this call succeeds, and then incrementing
84 by the number of bytes consumed.
86 conversion can stop for three reasons:
88 An invalid multibyte sequence has been encountered.
91 is left pointing to the invalid multibyte sequence,
104 non-L\(aq\\0\(aq wide characters
109 is left pointing to the
110 next multibyte sequence to be converted, and the number of wide characters
115 The multibyte string has been completely converted, including the
116 terminating null wide character (\(aq\\0\(aq)
117 (which has the side effect of bringing back
123 is set to NULL, and the number of wide
124 characters written to
126 excluding the terminating null wide character,
133 is ignored, and the conversion proceeds as
134 above, except that the converted wide characters
135 are not written out to memory,
136 and that no destination length limit exists.
138 In both of the above cases, if
140 is NULL, a static anonymous
141 state known only to the
143 function is used instead.
145 The programmer must ensure that there is room for at least
153 function returns the number of wide characters
154 that make up the converted part of the wide-character string,
155 not including the terminating null wide character.
156 If an invalid multibyte sequence was
175 is not multithread safe.
182 This page is part of release 3.79 of the Linux
185 A description of the project,
186 information about reporting bugs,
187 and the latest version of this page,
189 \%http://www.kernel.org/doc/man\-pages/.