text
stringlengths 0
234
|
---|
.i *ps |
is updated. |
the conversion is effectively performed by repeatedly |
calling |
.ir "wcrtomb(dest, *src, ps)" , |
as long as this call succeeds, |
and then incrementing |
.i dest |
by the |
number of bytes written and |
.i *src |
by one. |
the conversion can stop for three reasons: |
.ip 1. 3 |
a wide character has been encountered that can not be represented as a |
multibyte sequence (according to the current locale). |
in this case, |
.i *src |
is left pointing to the invalid wide character, |
.i (size_t)\ \-1 |
is returned, |
and |
.i errno |
is set to |
.br eilseq . |
.ip 2. |
the length limit forces a stop. |
in this case, |
.i *src |
is left pointing |
to the next wide character to be converted, |
and the number of bytes written to |
.i dest |
is returned. |
.ip 3. |
the wide-character string has been completely converted, including the |
terminating null wide character (l\(aq\e0\(aq), |
which has the side effect of bringing back |
.i *ps |
to the initial state. |
in this case, |
.i *src |
is set to null, and the number |
of bytes written to |
.ir dest , |
excluding the terminating null byte (\(aq\e0\(aq), |
is returned. |
.pp |
if |
.ir dest |
is null, |
.i len |
is ignored, |
and the conversion proceeds as above, except that the converted bytes |
are not written out to memory, and that |
no length limit exists. |
.pp |
in both of the above cases, |
if |
.i ps |
is null, a static anonymous |
state known only to the |
.br wcsrtombs () |
function is used instead. |
.pp |
the programmer must ensure that there is room for at least |
.i len |
bytes |
at |
.ir dest . |
.sh return value |
the |
.br wcsrtombs () |
function returns |
the number of bytes that make up the |
converted part of multibyte sequence, |
not including the terminating null byte. |
if a wide character was encountered |
which could not be converted, |
.i (size_t)\ \-1 |
is returned, and |
.i errno |
set to |
.br eilseq . |
.sh attributes |
for an explanation of the terms used in this section, see |
.br attributes (7). |
.ad l |
.nh |
.ts |
allbox; |
lb lb lbx |
l l l. |
interface attribute value |
t{ |
.br wcsrtombs () |
t} thread safety t{ |
mt-unsafe race:wcsrtombs/!ps |
t} |
.te |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.