]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * Copyright (c) 1989, 1993 | |
3 | * The Regents of the University of California. All rights reserved. | |
4 | * (c) UNIX System Laboratories, Inc. | |
5 | * All or some portions of this file are derived from material licensed | |
6 | * to the University of California by American Telephone and Telegraph | |
7 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with | |
8 | * the permission of UNIX System Laboratories, Inc. | |
9 | * | |
10 | * This code is derived from software contributed to Berkeley by | |
11 | * Paul Borman at Krystal Technologies. | |
12 | * | |
13 | * Redistribution and use in source and binary forms, with or without | |
14 | * modification, are permitted provided that the following conditions | |
15 | * are met: | |
16 | * 1. Redistributions of source code must retain the above copyright | |
17 | * notice, this list of conditions and the following disclaimer. | |
18 | * 2. Redistributions in binary form must reproduce the above copyright | |
19 | * notice, this list of conditions and the following disclaimer in the | |
20 | * documentation and/or other materials provided with the distribution. | |
21 | * 3. All advertising materials mentioning features or use of this software | |
22 | * must display the following acknowledgement: | |
23 | * This product includes software developed by the University of | |
24 | * California, Berkeley and its contributors. | |
25 | * 4. Neither the name of the University nor the names of its contributors | |
26 | * may be used to endorse or promote products derived from this software | |
27 | * without specific prior written permission. | |
28 | * | |
29 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
30 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
33 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
34 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
35 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
36 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
37 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
38 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
39 | * SUCH DAMAGE. | |
40 | */ | |
41 | ||
42 | #include <sys/cdefs.h> | |
43 | __FBSDID("$FreeBSD: src/lib/libc/locale/iswctype.c,v 1.6 2002/08/17 20:30:34 ache Exp $"); | |
44 | ||
45 | #include <wctype.h> | |
46 | ||
47 | #undef iswalnum | |
48 | int | |
49 | iswalnum(wc) | |
50 | wint_t wc; | |
51 | { | |
52 | return (__istype(wc, _CTYPE_A|_CTYPE_D)); | |
53 | } | |
54 | ||
55 | #undef iswalpha | |
56 | int | |
57 | iswalpha(wc) | |
58 | wint_t wc; | |
59 | { | |
60 | return (__istype(wc, _CTYPE_A)); | |
61 | } | |
62 | ||
63 | #undef iswascii | |
64 | int | |
65 | iswascii(wc) | |
66 | wint_t wc; | |
67 | { | |
68 | return ((wc & ~0x7F) == 0); | |
69 | } | |
70 | ||
71 | #undef iswblank | |
72 | int | |
73 | iswblank(wc) | |
74 | wint_t wc; | |
75 | { | |
76 | return (__istype(wc, _CTYPE_B)); | |
77 | } | |
78 | ||
79 | #undef iswcntrl | |
80 | int | |
81 | iswcntrl(wc) | |
82 | wint_t wc; | |
83 | { | |
84 | return (__istype(wc, _CTYPE_C)); | |
85 | } | |
86 | ||
87 | #undef iswdigit | |
88 | int | |
89 | iswdigit(wc) | |
90 | wint_t wc; | |
91 | { | |
92 | return (__isctype(wc, _CTYPE_D)); | |
93 | } | |
94 | ||
95 | #undef iswgraph | |
96 | int | |
97 | iswgraph(wc) | |
98 | wint_t wc; | |
99 | { | |
100 | return (__istype(wc, _CTYPE_G)); | |
101 | } | |
102 | ||
103 | #undef iswhexnumber | |
104 | int | |
105 | iswhexnumber(wc) | |
106 | wint_t wc; | |
107 | { | |
108 | return (__istype(wc, _CTYPE_X)); | |
109 | } | |
110 | ||
111 | #undef iswideogram | |
112 | int | |
113 | iswideogram(wc) | |
114 | wint_t wc; | |
115 | { | |
116 | return (__istype(wc, _CTYPE_I)); | |
117 | } | |
118 | ||
119 | #undef iswlower | |
120 | int | |
121 | iswlower(wc) | |
122 | wint_t wc; | |
123 | { | |
124 | return (__istype(wc, _CTYPE_L)); | |
125 | } | |
126 | ||
127 | #undef iswnumber | |
128 | int | |
129 | iswnumber(wc) | |
130 | wint_t wc; | |
131 | { | |
132 | return (__istype(wc, _CTYPE_D)); | |
133 | } | |
134 | ||
135 | #undef iswphonogram | |
136 | int | |
137 | iswphonogram(wc) | |
138 | wint_t wc; | |
139 | { | |
140 | return (__istype(wc, _CTYPE_Q)); | |
141 | } | |
142 | ||
143 | #undef iswprint | |
144 | int | |
145 | iswprint(wc) | |
146 | wint_t wc; | |
147 | { | |
148 | return (__istype(wc, _CTYPE_R)); | |
149 | } | |
150 | ||
151 | #undef iswpunct | |
152 | int | |
153 | iswpunct(wc) | |
154 | wint_t wc; | |
155 | { | |
156 | return (__istype(wc, _CTYPE_P)); | |
157 | } | |
158 | ||
159 | #undef iswrune | |
160 | int | |
161 | iswrune(wc) | |
162 | wint_t wc; | |
163 | { | |
164 | return (__istype(wc, 0xFFFFFF00L)); | |
165 | } | |
166 | ||
167 | #undef iswspace | |
168 | int | |
169 | iswspace(wc) | |
170 | wint_t wc; | |
171 | { | |
172 | return (__istype(wc, _CTYPE_S)); | |
173 | } | |
174 | ||
175 | #undef iswspecial | |
176 | int | |
177 | iswspecial(wc) | |
178 | wint_t wc; | |
179 | { | |
180 | return (__istype(wc, _CTYPE_T)); | |
181 | } | |
182 | ||
183 | #undef iswupper | |
184 | int | |
185 | iswupper(wc) | |
186 | wint_t wc; | |
187 | { | |
188 | return (__istype(wc, _CTYPE_U)); | |
189 | } | |
190 | ||
191 | #undef iswxdigit | |
192 | int | |
193 | iswxdigit(wc) | |
194 | wint_t wc; | |
195 | { | |
196 | return (__isctype(wc, _CTYPE_X)); | |
197 | } | |
198 | ||
199 | #undef towlower | |
200 | wint_t | |
201 | towlower(wc) | |
202 | wint_t wc; | |
203 | { | |
204 | return (__tolower(wc)); | |
205 | } | |
206 | ||
207 | #undef towupper | |
208 | wint_t | |
209 | towupper(wc) | |
210 | wint_t wc; | |
211 | { | |
212 | return (__toupper(wc)); | |
213 | } | |
214 |