summaryrefslogtreecommitdiffstats
path: root/upstream/opensuse-tumbleweed/man3/mbstowcs.3
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-17 10:52:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-17 10:52:03 +0000
commit932e4432596447eb9331cc2a2bb74a26a35b4efc (patch)
tree95161711ea07fd64f0c82d6e7943024c033dd5a8 /upstream/opensuse-tumbleweed/man3/mbstowcs.3
parentAdding debian version 4.22.0-1. (diff)
downloadmanpages-l10n-932e4432596447eb9331cc2a2bb74a26a35b4efc.tar.xz
manpages-l10n-932e4432596447eb9331cc2a2bb74a26a35b4efc.zip
Merging upstream version 4.23.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'upstream/opensuse-tumbleweed/man3/mbstowcs.3')
-rw-r--r--upstream/opensuse-tumbleweed/man3/mbstowcs.343
1 files changed, 19 insertions, 24 deletions
diff --git a/upstream/opensuse-tumbleweed/man3/mbstowcs.3 b/upstream/opensuse-tumbleweed/man3/mbstowcs.3
index c66b9c2d..f1c4ea58 100644
--- a/upstream/opensuse-tumbleweed/man3/mbstowcs.3
+++ b/upstream/opensuse-tumbleweed/man3/mbstowcs.3
@@ -10,7 +10,7 @@
.\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
.\" ISO/IEC 9899:1999
.\"
-.TH mbstowcs 3 2023-07-20 "Linux man-pages 6.05.01"
+.TH mbstowcs 3 2024-05-02 "Linux man-pages (unreleased)"
.SH NAME
mbstowcs \- convert a multibyte string to a wide-character string
.SH LIBRARY
@@ -19,24 +19,22 @@ Standard C library
.SH SYNOPSIS
.nf
.B #include <stdlib.h>
-.PP
-.BI "size_t mbstowcs(wchar_t " dest "[restrict ." n "], \
+.P
+.BI "size_t mbstowcs(wchar_t " dest "[restrict ." dsize "], \
const char *restrict " src ,
-.BI " size_t " n );
+.BI " size_t " dsize );
.fi
.SH DESCRIPTION
If
.I dest
is not NULL,
-the
-.BR mbstowcs ()
-function converts the
+convert the
multibyte string
.I src
to a wide-character string starting at
.IR dest .
At most
-.I n
+.I dsize
wide characters are written to
.IR dest .
The sequence of characters in the string
@@ -49,7 +47,7 @@ In this case,
.I (size_t)\ \-1
is returned.
.IP \[bu]
-.I n
+.I dsize
non-L\[aq]\e0\[aq] wide characters have been stored at
.IR dest .
In this case, the number of wide characters written to
@@ -62,30 +60,28 @@ terminating null character (\[aq]\e0\[aq]).
In this case, the number of wide characters written to
.IR dest ,
excluding the terminating null wide character, is returned.
-.PP
-The programmer must ensure that there is room for at least
-.I n
-wide
-characters at
-.IR dest .
-.PP
+.P
If
.I dest
is NULL,
-.I n
+.I dsize
is ignored, and the conversion proceeds as
above, except that the converted wide characters are not written out to memory,
and that no length limit exists.
-.PP
+.P
In order to avoid the case 2 above, the programmer should make sure
-.I n
+.I dsize
is
greater than or equal to
.IR "mbstowcs(NULL,src,0)+1" .
+.P
+The programmer must ensure that there is room for at least
+.I dsize
+wide
+characters at
+.IR dest .
.SH RETURN VALUE
-The
-.BR mbstowcs ()
-function returns the number of wide characters that make
+The number of wide characters that make
up the converted part of the wide-character string, not including the
terminating null wide character.
If an invalid multibyte sequence was
@@ -106,7 +102,6 @@ T{
.BR mbstowcs ()
T} Thread safety MT-Safe
.TE
-.sp 1
.SH VERSIONS
The function
.BR mbsrtowcs (3)
@@ -128,7 +123,7 @@ The program below illustrates the use of
.BR mbstowcs (),
as well as some of the wide character classification functions.
An example run is the following:
-.PP
+.P
.in +4n
.EX
$ ./t_mbstowcs de_DE.UTF\-8 Grüße!