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