summaryrefslogtreecommitdiffstats
path: root/lib/libc/locale/mbsrtowcs.3
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/locale/mbsrtowcs.3')
-rw-r--r--lib/libc/locale/mbsrtowcs.331
1 files changed, 27 insertions, 4 deletions
diff --git a/lib/libc/locale/mbsrtowcs.3 b/lib/libc/locale/mbsrtowcs.3
index 9963d85..f54e419 100644
--- a/lib/libc/locale/mbsrtowcs.3
+++ b/lib/libc/locale/mbsrtowcs.3
@@ -23,11 +23,12 @@
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD$
-.Dd April 8, 2004
+.Dd July 21, 2004
.Dt MBSRTOWCS 3
.Os
.Sh NAME
-.Nm mbsrtowcs
+.Nm mbsrtowcs ,
+.Nm mbsnrtowcs
.Nd "convert a character string to a wide-character string (restartable)"
.Sh LIBRARY
.Lb libc
@@ -38,6 +39,11 @@
.Fa "wchar_t * restrict dst" "const char ** restrict src" "size_t len"
.Fa "mbstate_t * restrict ps"
.Fc
+.Ft size_t
+.Fo mbsnrtowcs
+.Fa "wchar_t * restrict dst" "const char ** restrict src" "size_t nms"
+.Fa "size_t len" "mbstate_t * restrict ps"
+.Fc
.Sh DESCRIPTION
The
.Fn mbsrtowcs
@@ -82,10 +88,21 @@ uses an internal, static
.Vt mbstate_t
object, which is initialized to the initial conversion state
at program startup.
+.Pp
+The
+.Fn mbsnrtowcs
+function behaves identically to
+.Fn mbsrtowcs ,
+except that conversion stops after reading at most
+.Fa nms
+bytes from the buffer pointed to by
+.Fa src .
.Sh RETURN VALUES
The
.Fn mbsrtowcs
-function returns the number of wide characters stored in
+and
+.Fn mbsnrtowcs
+functions return the number of wide characters stored in
the array pointed to by
.Fa dst
if successful, otherwise it returns
@@ -93,7 +110,9 @@ if successful, otherwise it returns
.Sh ERRORS
The
.Fn mbsrtowcs
-function will fail if:
+and
+.Fn mbsnrtowcs
+functions will fail if:
.Bl -tag -width Er
.It Bq Er EILSEQ
An invalid multibyte character sequence was encountered.
@@ -110,3 +129,7 @@ The
.Fn mbsrtowcs
function conforms to
.St -isoC-99 .
+.Pp
+The
+.Fn mbsnrtowcs
+function is an extension to the standard.
OpenPOWER on IntegriCloud