1101369Stjr/*
2101369Stjr * Copyright (c) 1989, 1993
3101369Stjr *	The Regents of the University of California.  All rights reserved.
4101369Stjr * (c) UNIX System Laboratories, Inc.
5101369Stjr * All or some portions of this file are derived from material licensed
6101369Stjr * to the University of California by American Telephone and Telegraph
7101369Stjr * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8101369Stjr * the permission of UNIX System Laboratories, Inc.
9101369Stjr *
10101369Stjr * This code is derived from software contributed to Berkeley by
11101369Stjr * Paul Borman at Krystal Technologies.
12101369Stjr *
13101369Stjr * Redistribution and use in source and binary forms, with or without
14101369Stjr * modification, are permitted provided that the following conditions
15101369Stjr * are met:
16101369Stjr * 1. Redistributions of source code must retain the above copyright
17101369Stjr *    notice, this list of conditions and the following disclaimer.
18101369Stjr * 2. Redistributions in binary form must reproduce the above copyright
19101369Stjr *    notice, this list of conditions and the following disclaimer in the
20101369Stjr *    documentation and/or other materials provided with the distribution.
21101369Stjr * 4. Neither the name of the University nor the names of its contributors
22101369Stjr *    may be used to endorse or promote products derived from this software
23101369Stjr *    without specific prior written permission.
24101369Stjr *
25101369Stjr * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26101369Stjr * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27101369Stjr * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28101369Stjr * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29101369Stjr * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30101369Stjr * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31101369Stjr * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32101369Stjr * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33101369Stjr * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34101369Stjr * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35101369Stjr * SUCH DAMAGE.
36101369Stjr */
37101369Stjr
38101369Stjr#include <sys/cdefs.h>
39101369Stjr__FBSDID("$FreeBSD$");
40101369Stjr
41101369Stjr#include <wctype.h>
42101369Stjr
43101369Stjr#undef iswalnum
44101369Stjrint
45101369Stjriswalnum(wc)
46101369Stjr	wint_t wc;
47101369Stjr{
48102030Sache	return (__istype(wc, _CTYPE_A|_CTYPE_D));
49101369Stjr}
50101369Stjr
51101369Stjr#undef iswalpha
52101369Stjrint
53101369Stjriswalpha(wc)
54101369Stjr	wint_t wc;
55101369Stjr{
56102030Sache	return (__istype(wc, _CTYPE_A));
57101369Stjr}
58101369Stjr
59101369Stjr#undef iswascii
60101369Stjrint
61101369Stjriswascii(wc)
62101369Stjr	wint_t wc;
63101369Stjr{
64172909Sache	return ((wc & ~0x7F) == 0);
65101369Stjr}
66101369Stjr
67101369Stjr#undef iswblank
68101369Stjrint
69101369Stjriswblank(wc)
70101369Stjr	wint_t wc;
71101369Stjr{
72102030Sache	return (__istype(wc, _CTYPE_B));
73101369Stjr}
74101369Stjr
75101369Stjr#undef iswcntrl
76101369Stjrint
77101369Stjriswcntrl(wc)
78101369Stjr	wint_t wc;
79101369Stjr{
80102030Sache	return (__istype(wc, _CTYPE_C));
81101369Stjr}
82101369Stjr
83101369Stjr#undef iswdigit
84101369Stjrint
85101369Stjriswdigit(wc)
86101369Stjr	wint_t wc;
87101369Stjr{
88102030Sache	return (__isctype(wc, _CTYPE_D));
89101369Stjr}
90101369Stjr
91101369Stjr#undef iswgraph
92101369Stjrint
93101369Stjriswgraph(wc)
94101369Stjr	wint_t wc;
95101369Stjr{
96102030Sache	return (__istype(wc, _CTYPE_G));
97101369Stjr}
98101369Stjr
99101369Stjr#undef iswhexnumber
100101369Stjrint
101101369Stjriswhexnumber(wc)
102101369Stjr	wint_t wc;
103101369Stjr{
104102030Sache	return (__istype(wc, _CTYPE_X));
105101369Stjr}
106101369Stjr
107101369Stjr#undef iswideogram
108101369Stjrint
109101369Stjriswideogram(wc)
110101369Stjr	wint_t wc;
111101369Stjr{
112102030Sache	return (__istype(wc, _CTYPE_I));
113101369Stjr}
114101369Stjr
115101369Stjr#undef iswlower
116101369Stjrint
117101369Stjriswlower(wc)
118101369Stjr	wint_t wc;
119101369Stjr{
120102030Sache	return (__istype(wc, _CTYPE_L));
121101369Stjr}
122101369Stjr
123101369Stjr#undef iswnumber
124101369Stjrint
125101369Stjriswnumber(wc)
126101369Stjr	wint_t wc;
127101369Stjr{
128102030Sache	return (__istype(wc, _CTYPE_D));
129101369Stjr}
130101369Stjr
131101369Stjr#undef iswphonogram
132101369Stjrint
133101369Stjriswphonogram(wc)
134101369Stjr	wint_t wc;
135101369Stjr{
136102030Sache	return (__istype(wc, _CTYPE_Q));
137101369Stjr}
138101369Stjr
139101369Stjr#undef iswprint
140101369Stjrint
141101369Stjriswprint(wc)
142101369Stjr	wint_t wc;
143101369Stjr{
144102030Sache	return (__istype(wc, _CTYPE_R));
145101369Stjr}
146101369Stjr
147101369Stjr#undef iswpunct
148101369Stjrint
149101369Stjriswpunct(wc)
150101369Stjr	wint_t wc;
151101369Stjr{
152102030Sache	return (__istype(wc, _CTYPE_P));
153101369Stjr}
154101369Stjr
155101369Stjr#undef iswrune
156101369Stjrint
157101369Stjriswrune(wc)
158101369Stjr	wint_t wc;
159101369Stjr{
160102030Sache	return (__istype(wc, 0xFFFFFF00L));
161101369Stjr}
162101369Stjr
163101369Stjr#undef iswspace
164101369Stjrint
165101369Stjriswspace(wc)
166101369Stjr	wint_t wc;
167101369Stjr{
168102030Sache	return (__istype(wc, _CTYPE_S));
169101369Stjr}
170101369Stjr
171101369Stjr#undef iswspecial
172101369Stjrint
173101369Stjriswspecial(wc)
174101369Stjr	wint_t wc;
175101369Stjr{
176102030Sache	return (__istype(wc, _CTYPE_T));
177101369Stjr}
178101369Stjr
179101369Stjr#undef iswupper
180101369Stjrint
181101369Stjriswupper(wc)
182101369Stjr	wint_t wc;
183101369Stjr{
184102030Sache	return (__istype(wc, _CTYPE_U));
185101369Stjr}
186101369Stjr
187101369Stjr#undef iswxdigit
188101369Stjrint
189101369Stjriswxdigit(wc)
190101369Stjr	wint_t wc;
191101369Stjr{
192102030Sache	return (__isctype(wc, _CTYPE_X));
193101369Stjr}
194101369Stjr
195101369Stjr#undef towlower
196101369Stjrwint_t
197101369Stjrtowlower(wc)
198101369Stjr	wint_t wc;
199101369Stjr{
200101369Stjr        return (__tolower(wc));
201101369Stjr}
202101369Stjr
203101369Stjr#undef towupper
204101369Stjrwint_t
205101369Stjrtowupper(wc)
206101369Stjr	wint_t wc;
207101369Stjr{
208101369Stjr        return (__toupper(wc));
209101369Stjr}
210101985Skeichii
211