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