]> git.saurik.com Git - apple/libc.git/blob - locale/FreeBSD/btowc.3
Libc-1082.50.1.tar.gz
[apple/libc.git] / locale / FreeBSD / btowc.3
1 .\" Copyright (c) 2002 Tim J. Robbins
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD: src/lib/libc/locale/btowc.3,v 1.2 2002/11/10 11:14:58 tjr Exp $
26 .\"
27 .Dd August 3, 2002
28 .Dt BTOWC 3
29 .Os
30 .Sh NAME
31 .Nm btowc ,
32 .Nm btowc_l ,
33 .Nm wctob ,
34 .Nm wctob_l
35 .Nd "convert between wide and single-byte characters"
36 .Sh LIBRARY
37 .Lb libc
38 .Sh SYNOPSIS
39 .In stdio.h
40 .In wchar.h
41 .Ft wint_t
42 .Fo btowc
43 .Fa "int c"
44 .Fc
45 .Ft int
46 .Fo wctob
47 .Fa "wint_t c"
48 .Fc
49 .In wchar.h
50 .In xlocale.h
51 .Ft wint_t
52 .Fo btowc_l
53 .Fa "int c"
54 .Fa "locale_t loc"
55 .Fc
56 .Ft int
57 .Fo wctob_l
58 .Fa "wint_t c"
59 .Fa "locale_t loc"
60 .Fc
61 .Sh DESCRIPTION
62 The
63 .Fn btowc
64 function converts a single-byte character into a corresponding wide character.
65 If the character is
66 .Dv EOF
67 or not valid in the initial shift state,
68 .Fn btowc
69 returns
70 .Dv WEOF .
71 .Pp
72 The
73 .Fn wctob
74 function converts a wide character into a corresponding single-byte character.
75 If the wide character is
76 .Dv WEOF
77 or not able to be represented as a single byte in the initial shift state,
78 .Fn wctob
79 returns
80 .Dv WEOF .
81 .Pp
82 While the
83 .Fn btowc
84 and
85 .Fn wctob
86 functions use the current locale, the
87 .Fn btowc_l
88 and
89 .Fn wctob_l
90 functions may be passed locales directly. See
91 .Xr xlocale 3
92 for more information.
93 .Sh LEGACY SYNOPSIS
94 .Pp
95 The include file
96 .In stdio.h
97 is not necessary for these functions.
98 .Sh SEE ALSO
99 .Xr mbrtowc 3 ,
100 .Xr multibyte 3 ,
101 .Xr wcrtomb 3 ,
102 .Xr xlocale 3 ,
103 .Xr compat 5
104 .Sh STANDARDS
105 The
106 .Fn btowc
107 and
108 .Fn wctob
109 functions conform to
110 .St -p1003.1-2001 .
111 .Sh HISTORY
112 The
113 .Fn btowc
114 and
115 .Fn wctob
116 functions first appeared in
117 .Fx 5.0 .