.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/lib/libc/locale/mbsrtowcs.3,v 1.5 2004/07/21 10:54:57 tjr Exp $
+.\" $FreeBSD: src/lib/libc/locale/mbsrtowcs.3,v 1.6 2005/01/11 20:50:49 ru Exp $
.Dd July 21, 2004
.Dt MBSRTOWCS 3
.Os
.Sh NAME
+.Nm mbsnrtowcs ,
+.Nm mbsnrtowcs_l ,
.Nm mbsrtowcs ,
-.Nm mbsnrtowcs
+.Nm mbsrtowcs_l
.Nd "convert a character string to a wide-character string (restartable)"
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
.In wchar.h
.Ft size_t
+.Fo mbsnrtowcs
+.Fa "wchar_t *restrict dst"
+.Fa "const char **restrict src"
+.Fa "size_t nms"
+.Fa "size_t len"
+.Fa "mbstate_t *restrict ps"
+.Fc
+.Ft size_t
.Fo mbsrtowcs
-.Fa "wchar_t * restrict dst" "const char ** restrict src" "size_t len"
-.Fa "mbstate_t * restrict ps"
+.Fa "wchar_t *restrict dst"
+.Fa "const char **restrict src"
+.Fa "size_t len"
+.Fa "mbstate_t *restrict ps"
.Fc
+.In wchar.h
+.In xlocale.h
.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"
+.Fo mbsrtowcs_l
+.Fa "wchar_t *restrict dst"
+.Fa "const char **restrict src"
+.Fa "size_t len"
+.Fa "mbstate_t *restrict ps"
+.Fa "locale_t loc"
+.Fc
+.Ft size_t
+.Fo mbsnrtowcs_l
+.Fa "wchar_t *restrict dst"
+.Fa "const char **restrict src"
+.Fa "size_t nms"
+.Fa "size_t len"
+.Fa "mbstate_t *restrict ps"
+.Fa "locale_t loc"
.Fc
.Sh DESCRIPTION
The
.Fn mbsrtowcs
-function converts a sequence of multibyte characters pointed to indirectly by
-.Fa src
-into a sequence of corresponding wide characters and stores at most
+function converts a sequence of multibyte characters, pointed to indirectly by
+.Fa src ,
+into a sequence of corresponding wide characters. It stores at most
.Fa len
of them in the
.Vt wchar_t
.Fn mbsrtowcs ,
except that conversion stops after reading at most
.Fa nms
-bytes from the buffer pointed to by
+bytes from the buffer pointed to by
.Fa src .
+.Pp
+While the
+.Fn mbsrtowcs
+and
+.Fn mbsnrtowcs
+functions use the current locale, the
+.Fn mbsrtowcs_l
+and
+.Fn mbsnrtowcs_l
+functions may be passed locales directly. See
+.Xr xlocale 3
+for more information.
.Sh RETURN VALUES
The
.Fn mbsrtowcs
.Xr mbrtowc 3 ,
.Xr mbstowcs 3 ,
.Xr multibyte 3 ,
-.Xr wcsrtombs 3
+.Xr wcsrtombs 3 ,
+.Xr xlocale 3
.Sh STANDARDS
The
.Fn mbsrtowcs