]> git.saurik.com Git - apple/libc.git/blame - locale/FreeBSD/mbrlen.3.patch
Libc-763.11.tar.gz
[apple/libc.git] / locale / FreeBSD / mbrlen.3.patch
CommitLineData
1f2f436a
A
1--- mbrlen.3.orig 2009-11-09 15:05:25.000000000 -0800
2+++ mbrlen.3 2009-11-09 15:05:25.000000000 -0800
224c7076 3@@ -28,21 +28,35 @@
3d9156a7
A
4 .Dt MBRLEN 3
5 .Os
6 .Sh NAME
7-.Nm mbrlen
8+.Nm mbrlen ,
9+.Nm mbrlen_l
10 .Nd "get number of bytes in a character (restartable)"
11 .Sh LIBRARY
12 .Lb libc
224c7076 13 .Sh SYNOPSIS
3d9156a7
A
14 .In wchar.h
15 .Ft size_t
224c7076
A
16-.Fn mbrlen "const char * restrict s" "size_t n" "mbstate_t * restrict ps"
17+.Fo mbrlen
18+.Fa "const char *restrict s"
19+.Fa "size_t n"
20+.Fa "mbstate_t *restrict ps"
21+.Fc
22+.In wchar.h
3d9156a7
A
23+.In xlocale.h
24+.Ft size_t
224c7076
A
25+.Fo mbrlen_l
26+.Fa "const char *restrict s"
27+.Fa "size_t n"
28+.Fa "mbstate_t *restrict ps"
29+.Fa "locale_t loc"
30+.Fc
3d9156a7
A
31 .Sh DESCRIPTION
32 The
33 .Fn mbrlen
224c7076
A
34 function inspects at most
35 .Fa n
36-bytes pointed to by
37-.Fa s
38+bytes, pointed to by
39+.Fa s ,
40 to determine the number of bytes needed to complete the next
41 multibyte character.
42 .Pp
1f2f436a 43@@ -63,7 +77,7 @@ It is equivalent to:
224c7076
A
44 .Pp
45 .Dl "mbrtowc(NULL, s, n, ps);"
46 .Pp
47-Except that when
48+Except that, when
49 .Fa ps
50 is a
51 .Dv NULL
1f2f436a 52@@ -72,6 +86,14 @@ pointer,
3d9156a7
A
53 uses its own static, internal
54 .Vt mbstate_t
55 object to keep track of the shift state.
56+.Pp
224c7076 57+Although the
3d9156a7
A
58+.Fn mbrlen
59+function uses the current locale, the
60+.Fn mbrlen_l
61+function may be passed a locale directly. See
62+.Xr xlocale 3
63+for more information.
64 .Sh RETURN VALUES
65 The
66 .Fn mbrlen
1f2f436a 67@@ -137,7 +159,8 @@ The conversion state is invalid.
3d9156a7
A
68 .Sh SEE ALSO
69 .Xr mblen 3 ,
70 .Xr mbrtowc 3 ,
71-.Xr multibyte 3
72+.Xr multibyte 3 ,
73+.Xr xlocale 3
74 .Sh STANDARDS
75 The
76 .Fn mbrlen