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), _Q) |
115#define isrune(c) __istype((c), 0xFFFFFF00L) |
116#define isspecial(c) __istype((c), _T) |
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 return (_c < 0 || _c & _CRMASK) ? !!(___runetype(_c) & _f) : 145 (_c >= _CACHED_RUNES) ? 0 : 146 !!(_CurrentRuneLocale->runetype[_c] & _f); |
147} 148 149static __inline int 150__isctype(_BSD_RUNE_T_ _c, unsigned long _f) 151{ |
152 return (_c < 0 || _c >= _CACHED_RUNES) ? 0 : 153 !!(_DefaultRuneLocale.runetype[_c] & _f); |
154} 155 156static __inline _BSD_RUNE_T_ 157__toupper(_BSD_RUNE_T_ _c) 158{ |
159 return (_c < 0 || _c & _CRMASK) ? ___toupper(_c) : 160 (_c >= _CACHED_RUNES) ? _c : 161 _CurrentRuneLocale->mapupper[_c]; |
162} 163 164static __inline _BSD_RUNE_T_ 165__tolower(_BSD_RUNE_T_ _c) 166{ |
167 return (_c < 0 || _c & _CRMASK) ? ___tolower(_c) : 168 (_c >= _CACHED_RUNES) ? _c : 169 _CurrentRuneLocale->maplower[_c]; |
170} 171 172#else /* not using inlines */ 173 174__BEGIN_DECLS 175int __istype __P((_BSD_RUNE_T_, unsigned long)); 176int __isctype __P((_BSD_RUNE_T_, unsigned long)); 177_BSD_RUNE_T_ __toupper __P((_BSD_RUNE_T_)); 178_BSD_RUNE_T_ __tolower __P((_BSD_RUNE_T_)); 179__END_DECLS 180#endif /* using inlines */ 181 182#endif /* !_CTYPE_H_ */ |