Deleted Added
full compact
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.

--- 97 unchanged lines hidden (view full) ---

106#define isblank(c) __istype((c), _B)
107#define toascii(c) ((c) & 0x7F)
108
109/* XXX the following macros are not backed up by functions. */
110#define digittoint(c) __istype((c), 0xFF)
111#define ishexnumber(c) __istype((c), _X)
112#define isideogram(c) __istype((c), _I)
113#define isnumber(c) __istype((c), _D)
114#define isphonogram(c) __istype((c), _T)
115#define isrune(c) __istype((c), 0xFFFFFF00L)
116#define isspecial(c) __istype((c), _Q)
117#endif
118
119/* See comments in <machine/ansi.h> about _BSD_RUNE_T_. */
120__BEGIN_DECLS
121unsigned long ___runetype __P((_BSD_RUNE_T_));
122_BSD_RUNE_T_ ___tolower __P((_BSD_RUNE_T_));
123_BSD_RUNE_T_ ___toupper __P((_BSD_RUNE_T_));
124__END_DECLS

--- 11 unchanged lines hidden (view full) ---

136/*
137 * Use inline functions if we are allowed to and the compiler supports them.
138 */
139#if !defined(_DONT_USE_CTYPE_INLINE_) && \
140 (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))
141static __inline int
142__istype(_BSD_RUNE_T_ _c, unsigned long _f)
143{
144 if (_c < 0)
145 _c = (unsigned char) _c;
146 return((((_c & _CRMASK) ? ___runetype(_c) :
147 _CurrentRuneLocale->runetype[_c]) & _f) ? 1 : 0);
148}
149
150static __inline int
151__isctype(_BSD_RUNE_T_ _c, unsigned long _f)
152{
153 if (_c < 0)
154 _c = (unsigned char) _c;
155 return((((_c & _CRMASK) ? 0 :
156 _DefaultRuneLocale.runetype[_c]) & _f) ? 1 : 0);
157}
158
159static __inline _BSD_RUNE_T_
160__toupper(_BSD_RUNE_T_ _c)
161{
162 if (_c < 0)
163 _c = (unsigned char) _c;
164 return((_c & _CRMASK) ?
165 ___toupper(_c) : _CurrentRuneLocale->mapupper[_c]);
166}
167
168static __inline _BSD_RUNE_T_
169__tolower(_BSD_RUNE_T_ _c)
170{
171 if (_c < 0)
172 _c = (unsigned char) _c;
173 return((_c & _CRMASK) ?
174 ___tolower(_c) : _CurrentRuneLocale->maplower[_c]);
175}
176
177#else /* not using inlines */
178
179__BEGIN_DECLS
180int __istype __P((_BSD_RUNE_T_, unsigned long));
181int __isctype __P((_BSD_RUNE_T_, unsigned long));
182_BSD_RUNE_T_ __toupper __P((_BSD_RUNE_T_));
183_BSD_RUNE_T_ __tolower __P((_BSD_RUNE_T_));
184__END_DECLS
185#endif /* using inlines */
186
187#endif /* !_CTYPE_H_ */