X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/3d9156a7a519a5e3aa1b92e9d9d4b991f1aed7ff..15de9d6b4ab2de27ae24b13b7b6c4d55fffe4aef:/locale/FreeBSD/mbrtowc.3?ds=sidebyside diff --git a/locale/FreeBSD/mbrtowc.3 b/locale/FreeBSD/mbrtowc.3 index ab7138e..4066184 100644 --- a/locale/FreeBSD/mbrtowc.3 +++ b/locale/FreeBSD/mbrtowc.3 @@ -28,7 +28,8 @@ .Dt MBRTOWC 3 .Os .Sh NAME -.Nm mbrtowc +.Nm mbrtowc , +.Nm mbrtowc_l .Nd "convert a character to a wide-character code (restartable)" .Sh LIBRARY .Lb libc @@ -36,16 +37,28 @@ .In wchar.h .Ft size_t .Fo mbrtowc -.Fa "wchar_t * restrict pwc" "const char * restrict s" "size_t n" -.Fa "mbstate_t * restrict ps" +.Fa "wchar_t *restrict pwc" +.Fa "const char *restrict s" +.Fa "size_t n" +.Fa "mbstate_t *restrict ps" +.Fc +.In wchar.h +.In xlocale.h +.Ft size_t +.Fo mbrtowc_l +.Fa "wchar_t *restrict pwc" +.Fa "const char *restrict s" +.Fa "size_t n" +.Fa "mbstate_t *restrict ps" +.Fa "locale_t loc" .Fc .Sh DESCRIPTION The .Fn mbrtowc function inspects at most .Fa n -bytes pointed to by -.Fa s +bytes, pointed to by +.Fa s , to determine the number of bytes needed to complete the next multibyte character. If a character can be completed, and @@ -65,14 +78,14 @@ is .Fn mbrtowc behaves as if .Fa pwc -was +were .Dv NULL , .Fa s -was an empty string -.Pq Qq +were an empty string +.Pq Qq , and .Fa n -was 1. +were 1. .Pp The .Vt mbstate_t @@ -86,6 +99,14 @@ uses an internal, static .Vt mbstate_t object, which is initialized to the initial conversion state at program startup. +.Pp +While the +.Fn mbrtowc +function uses the current locale, the +.Fn mbrtowc_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. .Sh RETURN VALUES The .Fn mbrtowc @@ -131,7 +152,8 @@ The conversion state is invalid. .Xr mbtowc 3 , .Xr multibyte 3 , .Xr setlocale 3 , -.Xr wcrtomb 3 +.Xr wcrtomb 3 , +.Xr xlocale 3 .Sh STANDARDS The .Fn mbrtowc