]> git.saurik.com Git - apple/libc.git/blame - locale/FreeBSD/iswctype.c
Libc-391.2.10.tar.gz
[apple/libc.git] / locale / FreeBSD / iswctype.c
CommitLineData
e9ce8d39
A
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
9385eb3d
A
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 $");
e9ce8d39 44
9385eb3d 45#include <wctype.h>
5b2abdfb 46
9385eb3d 47#undef iswalnum
e9ce8d39 48int
9385eb3d
A
49iswalnum(wc)
50 wint_t wc;
e9ce8d39 51{
9385eb3d 52 return (__istype(wc, _CTYPE_A|_CTYPE_D));
e9ce8d39
A
53}
54
9385eb3d 55#undef iswalpha
e9ce8d39 56int
9385eb3d
A
57iswalpha(wc)
58 wint_t wc;
e9ce8d39 59{
9385eb3d 60 return (__istype(wc, _CTYPE_A));
e9ce8d39
A
61}
62
9385eb3d 63#undef iswascii
e9ce8d39 64int
9385eb3d
A
65iswascii(wc)
66 wint_t wc;
e9ce8d39 67{
9385eb3d 68 return ((wc & ~0x7F) == 0);
e9ce8d39
A
69}
70
9385eb3d 71#undef iswblank
e9ce8d39 72int
9385eb3d
A
73iswblank(wc)
74 wint_t wc;
e9ce8d39 75{
9385eb3d 76 return (__istype(wc, _CTYPE_B));
e9ce8d39
A
77}
78
9385eb3d 79#undef iswcntrl
e9ce8d39 80int
9385eb3d
A
81iswcntrl(wc)
82 wint_t wc;
e9ce8d39 83{
9385eb3d 84 return (__istype(wc, _CTYPE_C));
e9ce8d39
A
85}
86
9385eb3d 87#undef iswdigit
e9ce8d39 88int
9385eb3d
A
89iswdigit(wc)
90 wint_t wc;
e9ce8d39 91{
9385eb3d 92 return (__isctype(wc, _CTYPE_D));
e9ce8d39
A
93}
94
9385eb3d 95#undef iswgraph
e9ce8d39 96int
9385eb3d
A
97iswgraph(wc)
98 wint_t wc;
e9ce8d39 99{
9385eb3d 100 return (__istype(wc, _CTYPE_G));
5b2abdfb
A
101}
102
9385eb3d 103#undef iswhexnumber
5b2abdfb 104int
9385eb3d
A
105iswhexnumber(wc)
106 wint_t wc;
5b2abdfb 107{
9385eb3d 108 return (__istype(wc, _CTYPE_X));
5b2abdfb
A
109}
110
9385eb3d 111#undef iswideogram
5b2abdfb 112int
9385eb3d
A
113iswideogram(wc)
114 wint_t wc;
5b2abdfb 115{
9385eb3d 116 return (__istype(wc, _CTYPE_I));
e9ce8d39
A
117}
118
9385eb3d 119#undef iswlower
e9ce8d39 120int
9385eb3d
A
121iswlower(wc)
122 wint_t wc;
e9ce8d39 123{
9385eb3d 124 return (__istype(wc, _CTYPE_L));
5b2abdfb
A
125}
126
9385eb3d 127#undef iswnumber
5b2abdfb 128int
9385eb3d
A
129iswnumber(wc)
130 wint_t wc;
5b2abdfb 131{
9385eb3d 132 return (__istype(wc, _CTYPE_D));
5b2abdfb
A
133}
134
9385eb3d 135#undef iswphonogram
5b2abdfb 136int
9385eb3d
A
137iswphonogram(wc)
138 wint_t wc;
5b2abdfb 139{
9385eb3d 140 return (__istype(wc, _CTYPE_Q));
e9ce8d39
A
141}
142
9385eb3d 143#undef iswprint
e9ce8d39 144int
9385eb3d
A
145iswprint(wc)
146 wint_t wc;
e9ce8d39 147{
9385eb3d 148 return (__istype(wc, _CTYPE_R));
e9ce8d39
A
149}
150
9385eb3d 151#undef iswpunct
e9ce8d39 152int
9385eb3d
A
153iswpunct(wc)
154 wint_t wc;
e9ce8d39 155{
9385eb3d 156 return (__istype(wc, _CTYPE_P));
5b2abdfb
A
157}
158
9385eb3d 159#undef iswrune
5b2abdfb 160int
9385eb3d
A
161iswrune(wc)
162 wint_t wc;
5b2abdfb 163{
9385eb3d 164 return (__istype(wc, 0xFFFFFF00L));
e9ce8d39
A
165}
166
9385eb3d 167#undef iswspace
e9ce8d39 168int
9385eb3d
A
169iswspace(wc)
170 wint_t wc;
e9ce8d39 171{
9385eb3d 172 return (__istype(wc, _CTYPE_S));
5b2abdfb
A
173}
174
9385eb3d 175#undef iswspecial
5b2abdfb 176int
9385eb3d
A
177iswspecial(wc)
178 wint_t wc;
5b2abdfb 179{
9385eb3d 180 return (__istype(wc, _CTYPE_T));
e9ce8d39
A
181}
182
9385eb3d 183#undef iswupper
e9ce8d39 184int
9385eb3d
A
185iswupper(wc)
186 wint_t wc;
e9ce8d39 187{
9385eb3d 188 return (__istype(wc, _CTYPE_U));
e9ce8d39
A
189}
190
9385eb3d 191#undef iswxdigit
e9ce8d39 192int
9385eb3d
A
193iswxdigit(wc)
194 wint_t wc;
e9ce8d39 195{
9385eb3d 196 return (__isctype(wc, _CTYPE_X));
e9ce8d39
A
197}
198
9385eb3d
A
199#undef towlower
200wint_t
201towlower(wc)
202 wint_t wc;
e9ce8d39 203{
9385eb3d 204 return (__tolower(wc));
e9ce8d39
A
205}
206
9385eb3d
A
207#undef towupper
208wint_t
209towupper(wc)
210 wint_t wc;
e9ce8d39 211{
9385eb3d 212 return (__toupper(wc));
e9ce8d39 213}
5b2abdfb 214