X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/3d9156a7a519a5e3aa1b92e9d9d4b991f1aed7ff..2be56ee90c5c5bee77895b8787a43e894249002b:/locale/FreeBSD/mblen.3 diff --git a/locale/FreeBSD/mblen.3 b/locale/FreeBSD/mblen.3 index fbe01a9..c3530e1 100644 --- a/locale/FreeBSD/mblen.3 +++ b/locale/FreeBSD/mblen.3 @@ -13,10 +13,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. @@ -35,39 +31,59 @@ .\" .\" From @(#)multibyte.3 8.1 (Berkeley) 6/4/93 .\" From FreeBSD: src/lib/libc/locale/multibyte.3,v 1.22 2003/11/08 03:23:11 tjr Exp -.\" $FreeBSD: src/lib/libc/locale/mblen.3,v 1.5 2004/07/05 06:36:36 ru Exp $ +.\" $FreeBSD: src/lib/libc/locale/mblen.3,v 1.6 2007/01/09 00:28:00 imp Exp $ .\" .Dd April 11, 2004 .Dt MBLEN 3 .Os .Sh NAME -.Nm mblen +.Nm mblen , +.Nm mblen_l .Nd get number of bytes in a character .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In stdlib.h .Ft int -.Fn mblen "const char *mbchar" "size_t nbytes" +.Fo mblen +.Fa "const char *s" +.Fa "size_t n" +.Fc +.In stdlib.h +.In xlocale.h +.Ft int +.Fo mblen_l +.Fa "const char *s" +.Fa "size_t n" +.Fa "locale_t loc" +.Fc .Sh DESCRIPTION The .Fn mblen -function computes the length in bytes +function computes the length, in bytes, of a multibyte character -.Fa mbchar +.Fa s , according to the current conversion state. Up to -.Fa nbytes +.Fa n bytes are examined. .Pp A call with a null -.Fa mbchar +.Fa s pointer returns nonzero if the current locale requires shift states, -zero otherwise; -if shift states are required, the shift state is reset to the initial state. +zero otherwise. +If shift states are required, the shift state is reset to the initial state. +.Pp +Although the +.Fn mblen +function uses the current locale, the +.Fn mblen_l +function may be passed a locale directly. See +.Xr xlocale 3 +for more information. .Sh RETURN VALUES If -.Fa mbchar +.Fa s is .Dv NULL , the @@ -76,14 +92,14 @@ function returns nonzero if shift states are supported, zero otherwise. .Pp Otherwise, if -.Fa mbchar +.Fa s is not a null pointer, .Fn mblen either returns 0 if -.Fa mbchar +.Fa s represents the null wide character, or returns the number of bytes processed in -.Fa mbchar , +.Fa s , or returns \-1 if no multibyte character could be recognized or converted. In this case, @@ -102,7 +118,8 @@ The internal conversion state is not valid. .Sh SEE ALSO .Xr mbrlen 3 , .Xr mbtowc 3 , -.Xr multibyte 3 +.Xr multibyte 3 , +.Xr xlocale 3 .Sh STANDARDS The .Fn mblen