aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/locale/wcsrtombs.3
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/locale/wcsrtombs.3')
-rw-r--r--lib/libc/locale/wcsrtombs.331
1 files changed, 27 insertions, 4 deletions
diff --git a/lib/libc/locale/wcsrtombs.3 b/lib/libc/locale/wcsrtombs.3
index 91e61fde5086..ff607c2dad11 100644
--- a/lib/libc/locale/wcsrtombs.3
+++ b/lib/libc/locale/wcsrtombs.3
@@ -24,11 +24,12 @@
.\"
.\" $FreeBSD$
.\"
-.Dd April 8, 2004
+.Dd July 21, 2004
.Dt WCSRTOMBS 3
.Os
.Sh NAME
-.Nm wcsrtombs
+.Nm wcsrtombs ,
+.Nm wcsnrtombs
.Nd "convert a wide-character string to a character string (restartable)"
.Sh LIBRARY
.Lb libc
@@ -39,6 +40,11 @@
.Fa "char * restrict dst" "const wchar_t ** restrict src"
.Fa "size_t len" "mbstate_t * restrict ps"
.Fc
+.Ft size_t
+.Fo wcsnrtombs
+.Fa "char * restrict dst" "const wchar_t ** restrict src" "size_t nwc"
+.Fa "size_t len" "mbstate_t * restrict ps"
+.Fc
.Sh DESCRIPTION
The
.Fn wcsrtombs
@@ -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 wcsnrtombs
+function behaves identically to
+.Fn wcsrtombs ,
+except that conversion stops after reading at most
+.Fa nwc
+characters from the buffer pointed to by
+.Fa src .
.Sh RETURN VALUES
The
.Fn wcsrtombs
-function returns the number of bytes stored in
+and
+.Fn wcsnrtombs
+functions return the number of bytes stored in
the array pointed to by
.Fa dst
(not including any terminating null), if successful, otherwise it returns
@@ -93,7 +110,9 @@ the array pointed to by
.Sh ERRORS
The
.Fn wcsrtombs
-function will fail if:
+and
+.Fn wcsnrtombs
+functions will fail if:
.Bl -tag -width Er
.It Bq Er EILSEQ
An invalid wide character was encountered.
@@ -109,3 +128,7 @@ The
.Fn wcsrtombs
function conforms to
.St -isoC-99 .
+.Pp
+The
+.Fn wcsnrtombs
+function is an extension to the standard.