Changeset 1009
- Timestamp:
- Jan 18, 2004, 11:34:15 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/include/ctype.h
-
Property cvs2svn:cvs-rev
changed from
1.11
to1.12
r1008 r1009 8 8 */ 9 9 10 #ifndef _CTYPE_H 11 #define _CTYPE_H10 #ifndef _CTYPE_H_ 11 #define _CTYPE_H_ 12 12 13 13 #include <sys/cdefs.h> … … 15 15 16 16 __BEGIN_DECLS 17 18 static inline int isalnum (int _c) 19 { return __locale_ctype.cflags [_c & 0xff] & (__UPPER|__LOWER|__DIGIT); } 20 21 static inline int isalpha (int _c) 22 { return __locale_ctype.cflags [_c & 0xff] & (__UPPER|__LOWER); } 23 24 static inline int iscntrl (int _c) 25 { return __locale_ctype.cflags [_c & 0xff] & (__CNTRL); } 26 27 static inline int isdigit (int _c) 28 { return __locale_ctype.cflags [_c & 0xff] & (__DIGIT); } 29 30 static inline int isgraph (int _c) 31 { return __locale_ctype.cflags [_c & 0xff] & (__PUNCT|__UPPER|__LOWER|__DIGIT); } 32 33 static inline int islower (int _c) 34 { return __locale_ctype.cflags [_c & 0xff] & (__LOWER); } 35 36 static inline int isprint (int _c) 37 { return __locale_ctype.cflags [_c & 0xff] & (__PRINT); } 38 39 static inline int ispunct (int _c) 40 { return __locale_ctype.cflags [_c & 0xff] & (__PUNCT); } 41 42 static inline int isspace (int _c) 43 { return __locale_ctype.cflags [_c & 0xff] & (__SPACE); } 44 45 static inline int isupper (int _c) 46 { return __locale_ctype.cflags [_c & 0xff] & (__UPPER); } 47 48 static inline int isxdigit (int _c) 49 { return __locale_ctype.cflags [_c & 0xff] & (__XDIGIT); } 50 51 static inline int toupper (int _c) 52 { return __locale_ctype.upcase [_c & 0xff]; } 53 54 static inline int tolower (int _c) 55 { return __locale_ctype.locase [_c & 0xff]; } 56 17 int isalnum(int); 18 int isalpha(int); 19 int iscntrl(int); 20 int isdigit(int); 21 int isgraph(int); 22 int islower(int); 23 int isprint(int); 24 int ispunct(int); 25 int isspace(int); 26 int isupper(int); 27 int isxdigit(int); 28 int toupper(int); 29 int tolower(int); 57 30 58 31 #if __XSI_VISIBLE 59 static inline int _toupper (int _c) 60 { return __locale_ctype.upcase [_c & 0xff]; } 61 static inline int _tolower (int _c) 62 { return __locale_ctype.locase [_c & 0xff]; } 63 static inline int isascii (int _c) 64 { return !(_c & 0x80); } 65 static inline int toascii (int _c) 66 { return (_c & 0x7f); } 32 int _toupper(int); 33 int _tolower(int); 34 int isascii(int); 35 int toascii(int); 67 36 #endif 68 37 69 38 #if __BSD_VISIBLE 70 39 /* @todo int digittoint(int); */ 71 static inline int isblank (int _c) 72 { return __locale_ctype.cflags [_c & 0xff] & (__BLANK); } 73 /* @todo int ishexnumber(int); */ 40 int isblank(int); 41 int ishexnumber(int); 74 42 /* @todo int isideogram(int); */ 75 /* @todo int isnumber(int); */ 43 int isnumber(int); 76 44 /* @todo int isphonogram(int); */ 77 45 /* @todo int isrune(int); */ 78 46 /* @todo int isspecial(int); */ 79 47 #endif 80 81 48 __END_DECLS 82 49 83 #endif /* not _CTYPE_H */ 50 #define isalnum(c) __istype((c), (__UPPER)|(__LOWER)|(__DIGIT)) 51 #define isalpha(c) __istype((c), (__UPPER)|(__LOWER)) 52 #define iscntrl(c) __istype((c), (__CNTRL)) 53 #define isdigit(c) __istype((c), (__DIGIT)) 54 #define isgraph(c) __istype((c), (__PUNCT)|(__UPPER)|(__LOWER)|(__DIGIT)) 55 #define islower(c) __istype((c), (__LOWER)) 56 #define isprint(c) __istype((c), (__PRINT)) 57 #define ispunct(c) __istype((c), (__PUNCT)) 58 #define isspace(c) __istype((c), (__SPACE)) 59 #define isupper(c) __istype((c), (__UPPER)) 60 #define isxdigit(c) __istype((c), (__XDIGIT)) 61 #define toupper(c) __toupper(c) 62 #define tolower(c) __tolower(c) 63 64 #if __XSI_VISIBLE 65 #define _toupper(_c) __toupper(c) 66 #define _tolower(_c) __tolower(c) 67 #define isascii(c) (((c) & ~0x7F) == 0) 68 #define toascii(c) ((c) & 0x7F) 69 #endif 70 71 #if __BSD_VISIBLE 72 #define isblank(c) __istype((c), (__BLANK)) 73 #define ishexnumber(c) __istype((c), (__XDIGIT)) 74 #define isnumber(c) __istype((c), (__DIGIT)) 75 #endif 76 77 78 #if !defined(_DONT_USE_CTYPE_INLINE_) && \ 79 (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus)) 80 81 __BEGIN_DECLS 82 static inline int __istype(int _c, unsigned _f) 83 { return __locale_ctype.cflags [_c & 0xff] & (_f); } 84 static inline int __toupper(int _c) 85 { return __locale_ctype.upcase [_c & 0xff]; } 86 static inline int __tolower(int _c) 87 { return __locale_ctype.locase [_c & 0xff]; } 88 __END_DECLS 89 90 #else 91 92 __BEGIN_DECLS 93 int __istype(int, unsigned); 94 int __toupper(int); 95 int __tolower(int); 96 __END_DECLS 97 98 #endif 99 100 #endif -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.