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 * 4. Neither the name of the University nor the names of its contributors
22 *    may be used to endorse or promote products derived from this software
23 *    without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38#include <sys/cdefs.h>
39__FBSDID("$FreeBSD: releng/10.3/lib/libc/locale/iswctype.c 172909 2007-10-23 17:39:28Z ache $");
40
41#include <wctype.h>
42
43#undef iswalnum
44int
45iswalnum(wc)
46	wint_t wc;
47{
48	return (__istype(wc, _CTYPE_A|_CTYPE_D));
49}
50
51#undef iswalpha
52int
53iswalpha(wc)
54	wint_t wc;
55{
56	return (__istype(wc, _CTYPE_A));
57}
58
59#undef iswascii
60int
61iswascii(wc)
62	wint_t wc;
63{
64	return ((wc & ~0x7F) == 0);
65}
66
67#undef iswblank
68int
69iswblank(wc)
70	wint_t wc;
71{
72	return (__istype(wc, _CTYPE_B));
73}
74
75#undef iswcntrl
76int
77iswcntrl(wc)
78	wint_t wc;
79{
80	return (__istype(wc, _CTYPE_C));
81}
82
83#undef iswdigit
84int
85iswdigit(wc)
86	wint_t wc;
87{
88	return (__isctype(wc, _CTYPE_D));
89}
90
91#undef iswgraph
92int
93iswgraph(wc)
94	wint_t wc;
95{
96	return (__istype(wc, _CTYPE_G));
97}
98
99#undef iswhexnumber
100int
101iswhexnumber(wc)
102	wint_t wc;
103{
104	return (__istype(wc, _CTYPE_X));
105}
106
107#undef iswideogram
108int
109iswideogram(wc)
110	wint_t wc;
111{
112	return (__istype(wc, _CTYPE_I));
113}
114
115#undef iswlower
116int
117iswlower(wc)
118	wint_t wc;
119{
120	return (__istype(wc, _CTYPE_L));
121}
122
123#undef iswnumber
124int
125iswnumber(wc)
126	wint_t wc;
127{
128	return (__istype(wc, _CTYPE_D));
129}
130
131#undef iswphonogram
132int
133iswphonogram(wc)
134	wint_t wc;
135{
136	return (__istype(wc, _CTYPE_Q));
137}
138
139#undef iswprint
140int
141iswprint(wc)
142	wint_t wc;
143{
144	return (__istype(wc, _CTYPE_R));
145}
146
147#undef iswpunct
148int
149iswpunct(wc)
150	wint_t wc;
151{
152	return (__istype(wc, _CTYPE_P));
153}
154
155#undef iswrune
156int
157iswrune(wc)
158	wint_t wc;
159{
160	return (__istype(wc, 0xFFFFFF00L));
161}
162
163#undef iswspace
164int
165iswspace(wc)
166	wint_t wc;
167{
168	return (__istype(wc, _CTYPE_S));
169}
170
171#undef iswspecial
172int
173iswspecial(wc)
174	wint_t wc;
175{
176	return (__istype(wc, _CTYPE_T));
177}
178
179#undef iswupper
180int
181iswupper(wc)
182	wint_t wc;
183{
184	return (__istype(wc, _CTYPE_U));
185}
186
187#undef iswxdigit
188int
189iswxdigit(wc)
190	wint_t wc;
191{
192	return (__isctype(wc, _CTYPE_X));
193}
194
195#undef towlower
196wint_t
197towlower(wc)
198	wint_t wc;
199{
200        return (__tolower(wc));
201}
202
203#undef towupper
204wint_t
205towupper(wc)
206	wint_t wc;
207{
208        return (__toupper(wc));
209}
210
211