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
16 .TH MBSRTOWCS 3 2014-03-18 "GNU" "Linux Programmer's Manual"
18 mbsrtowcs \- convert a multibyte string to a wide-character string
23 .BI "size_t mbsrtowcs(wchar_t *" dest ", const char **" src ,
24 .BI " size_t " len ", mbstate_t *" ps );
34 to a wide-character string starting at
38 wide characters are written to
43 The conversion is effectively performed by repeatedly
45 .I "mbrtowc(dest, *src, n, ps)"
49 positive number, as long as this call succeeds, and then incrementing
53 by the number of bytes consumed.
54 The conversion can stop for three reasons:
56 An invalid multibyte sequence has been encountered.
59 is left pointing to the invalid multibyte sequence,
68 non-L\(aq\\0\(aq wide characters have been stored at
73 is left pointing to the next
74 multibyte sequence to be converted,
75 and the number of wide characters written to
79 The multibyte string has been completely converted, including the
80 terminating null wide character (\(aq\\0\(aq), which has the side
81 effect of bringing back
87 is set to NULL, and the number of wide
90 excluding the terminating null wide character, is returned.
97 and the conversion proceeds as above,
98 except that the converted wide characters are not written out to memory,
99 and that no length limit exists.
101 In both of the above cases,
104 is NULL, a static anonymous
105 state known only to the
107 function is used instead.
109 The programmer must ensure that there is room for at least
117 function returns the number of wide characters that make
118 up the converted part of the wide-character string, not including the
119 terminating null wide character.
120 If an invalid multibyte sequence was
139 is not multithread safe.