]> git.saurik.com Git - apple/libc.git/blob - locale/FreeBSD/mblen.3.patch
193f5763cad52d84bda35bfd31cb2dd6bcffca91
[apple/libc.git] / locale / FreeBSD / mblen.3.patch
1 --- mblen.3.orig 2009-11-09 15:05:25.000000000 -0800
2 +++ mblen.3 2009-11-09 15:05:26.000000000 -0800
3 @@ -37,33 +37,53 @@
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
13 .Sh SYNOPSIS
14 .In stdlib.h
15 .Ft int
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
22 +.In xlocale.h
23 +.Ft int
24 +.Fo mblen_l
25 +.Fa "const char *s"
26 +.Fa "size_t n"
27 +.Fa "locale_t loc"
28 +.Fc
29 .Sh DESCRIPTION
30 The
31 .Fn mblen
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
46 pointer returns nonzero if the current locale requires shift states,
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.
51 +.Pp
52 +Although the
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
61 -.Fa mbchar
62 +.Fa s
63 is
64 .Dv NULL ,
65 the
66 @@ -72,14 +92,14 @@ function returns nonzero if shift states
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 @@ -98,7 +118,8 @@ The internal conversion state is not val
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