]> git.saurik.com Git - apple/libc.git/blob - locale/FreeBSD/mbrtowc.3.patch
Libc-498.tar.gz
[apple/libc.git] / locale / FreeBSD / mbrtowc.3.patch
1 --- _SB/Libc/locale/FreeBSD/mbrtowc.3 2004-11-25 11:38:18.000000000 -0800
2 +++ _SB/Libc/locale/FreeBSD/mbrtowc.3.edit 2006-06-29 11:10:29.000000000 -0700
3 @@ -28,7 +28,8 @@
4 .Dt MBRTOWC 3
5 .Os
6 .Sh NAME
7 -.Nm mbrtowc
8 +.Nm mbrtowc ,
9 +.Nm mbrtowc_l
10 .Nd "convert a character to a wide-character code (restartable)"
11 .Sh LIBRARY
12 .Lb libc
13 @@ -36,16 +37,28 @@
14 .In wchar.h
15 .Ft size_t
16 .Fo mbrtowc
17 -.Fa "wchar_t * restrict pwc" "const char * restrict s" "size_t n"
18 -.Fa "mbstate_t * restrict ps"
19 +.Fa "wchar_t *restrict pwc"
20 +.Fa "const char *restrict s"
21 +.Fa "size_t n"
22 +.Fa "mbstate_t *restrict ps"
23 +.Fc
24 +.In wchar.h
25 +.In xlocale.h
26 +.Ft size_t
27 +.Fo mbrtowc_l
28 +.Fa "wchar_t *restrict pwc"
29 +.Fa "const char *restrict s"
30 +.Fa "size_t n"
31 +.Fa "mbstate_t *restrict ps"
32 +.Fa "locale_t loc"
33 .Fc
34 .Sh DESCRIPTION
35 The
36 .Fn mbrtowc
37 function inspects at most
38 .Fa n
39 -bytes pointed to by
40 -.Fa s
41 +bytes, pointed to by
42 +.Fa s ,
43 to determine the number of bytes needed to complete the next multibyte
44 character.
45 If a character can be completed, and
46 @@ -65,14 +78,14 @@
47 .Fn mbrtowc
48 behaves as if
49 .Fa pwc
50 -was
51 +were
52 .Dv NULL ,
53 .Fa s
54 -was an empty string
55 -.Pq Qq
56 +were an empty string
57 +.Pq Qq ,
58 and
59 .Fa n
60 -was 1.
61 +were 1.
62 .Pp
63 The
64 .Vt mbstate_t
65 @@ -86,6 +99,14 @@
66 .Vt mbstate_t
67 object, which is initialized to the initial conversion state
68 at program startup.
69 +.Pp
70 +While the
71 +.Fn mbrtowc
72 +function uses the current locale, the
73 +.Fn mbrtowc_l
74 +function may be passed a locale directly. See
75 +.Xr xlocale 3
76 +for more information.
77 .Sh RETURN VALUES
78 The
79 .Fn mbrtowc
80 @@ -131,7 +152,8 @@
81 .Xr mbtowc 3 ,
82 .Xr multibyte 3 ,
83 .Xr setlocale 3 ,
84 -.Xr wcrtomb 3
85 +.Xr wcrtomb 3 ,
86 +.Xr xlocale 3
87 .Sh STANDARDS
88 The
89 .Fn mbrtowc