]> git.saurik.com Git - apple/libc.git/blame - locale/FreeBSD/mblen.3.patch
Libc-594.9.5.tar.gz
[apple/libc.git] / locale / FreeBSD / mblen.3.patch
CommitLineData
224c7076
A
1--- _SB/Libc/locale/FreeBSD/mblen.3 2004-11-25 11:38:18.000000000 -0800
2+++ _SB/Libc/locale/FreeBSD/mblen.3.edit 2006-06-28 16:55:51.000000000 -0700
3@@ -41,33 +41,53 @@
3d9156a7
A
4 .Dt MBLEN 3
5 .Os
6 .Sh NAME
7-.Nm mblen
8+.Nm mblen ,
9+.Nm mblen_l
10 .Nd get number of bytes in a character
11 .Sh LIBRARY
12 .Lb libc
224c7076 13 .Sh SYNOPSIS
3d9156a7
A
14 .In stdlib.h
15 .Ft int
224c7076
A
16-.Fn mblen "const char *mbchar" "size_t nbytes"
17+.Fo mblen
18+.Fa "const char *s"
19+.Fa "size_t n"
20+.Fc
21+.In stdlib.h
3d9156a7
A
22+.In xlocale.h
23+.Ft int
224c7076
A
24+.Fo mblen_l
25+.Fa "const char *s"
26+.Fa "size_t n"
27+.Fa "locale_t loc"
28+.Fc
3d9156a7
A
29 .Sh DESCRIPTION
30 The
31 .Fn mblen
224c7076
A
32-function computes the length in bytes
33+function computes the length, in bytes,
34 of a multibyte character
35-.Fa mbchar
36+.Fa s ,
37 according to the current conversion state.
38 Up to
39-.Fa nbytes
40+.Fa n
41 bytes are examined.
42 .Pp
43 A call with a null
44-.Fa mbchar
45+.Fa s
3d9156a7 46 pointer returns nonzero if the current locale requires shift states,
224c7076
A
47-zero otherwise;
48-if shift states are required, the shift state is reset to the initial state.
49+zero otherwise.
50+If shift states are required, the shift state is reset to the initial state.
3d9156a7 51+.Pp
224c7076 52+Although the
3d9156a7
A
53+.Fn mblen
54+function uses the current locale, the
55+.Fn mblen_l
56+function may be passed a locale directly. See
57+.Xr xlocale 3
58+for more information.
59 .Sh RETURN VALUES
60 If
224c7076
A
61-.Fa mbchar
62+.Fa s
63 is
64 .Dv NULL ,
65 the
66@@ -76,14 +96,14 @@
67 zero otherwise.
68 .Pp
69 Otherwise, if
70-.Fa mbchar
71+.Fa s
72 is not a null pointer,
73 .Fn mblen
74 either returns 0 if
75-.Fa mbchar
76+.Fa s
77 represents the null wide character, or returns
78 the number of bytes processed in
79-.Fa mbchar ,
80+.Fa s ,
81 or returns \-1 if no multibyte character
82 could be recognized or converted.
83 In this case,
84@@ -102,7 +122,8 @@
3d9156a7
A
85 .Sh SEE ALSO
86 .Xr mbrlen 3 ,
87 .Xr mbtowc 3 ,
88-.Xr multibyte 3
89+.Xr multibyte 3 ,
90+.Xr xlocale 3
91 .Sh STANDARDS
92 The
93 .Fn mblen