filename | test/include/ctype.h |
changeset | 185:6755a04c447f |
author | nkeynes |
date | Tue Jul 11 01:35:27 2006 +0000 (17 years ago) |
permissions | -rw-r--r-- |
last change | First commit of system test framework. 3 initial test cases (incomplete): testide, testmath, and testta |
file | annotate | diff | log | raw |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +00001.2 +++ b/test/include/ctype.h Tue Jul 11 01:35:27 2006 +00001.3 @@ -0,0 +1,73 @@1.4 +#ifndef _CTYPE_H_1.5 +#ifdef __cplusplus1.6 +extern "C" {1.7 +#endif1.8 +#define _CTYPE_H_1.9 +1.10 +#include "_ansi.h"1.11 +1.12 +int _EXFUN(isalnum, (int __c));1.13 +int _EXFUN(isalpha, (int __c));1.14 +int _EXFUN(iscntrl, (int __c));1.15 +int _EXFUN(isdigit, (int __c));1.16 +int _EXFUN(isgraph, (int __c));1.17 +int _EXFUN(islower, (int __c));1.18 +int _EXFUN(isprint, (int __c));1.19 +int _EXFUN(ispunct, (int __c));1.20 +int _EXFUN(isspace, (int __c));1.21 +int _EXFUN(isupper, (int __c));1.22 +int _EXFUN(isxdigit,(int __c));1.23 +int _EXFUN(tolower, (int __c));1.24 +int _EXFUN(toupper, (int __c));1.25 +1.26 +#ifndef __STRICT_ANSI__1.27 +int _EXFUN(isascii, (int __c));1.28 +int _EXFUN(toascii, (int __c));1.29 +int _EXFUN(_tolower, (int __c));1.30 +int _EXFUN(_toupper, (int __c));1.31 +#endif1.32 +1.33 +#define _U 011.34 +#define _L 021.35 +#define _N 041.36 +#define _S 0101.37 +#define _P 0201.38 +#define _C 0401.39 +#define _X 01001.40 +#define _B 02001.41 +1.42 +#if !defined(__CYGWIN32__) || defined(__INSIDE_CYGWIN__) || defined(_COMPILING_NEWLIB)1.43 +extern _CONST char _ctype_[];1.44 +#else1.45 +extern _CONST char _ctype_[] __declspec(dllimport);1.46 +#endif1.47 +1.48 +#define isalpha(c) ((_ctype_+1)[(unsigned)(c)]&(_U|_L))1.49 +#define isupper(c) ((_ctype_+1)[(unsigned)(c)]&_U)1.50 +#define islower(c) ((_ctype_+1)[(unsigned)(c)]&_L)1.51 +#define isdigit(c) ((_ctype_+1)[(unsigned)(c)]&_N)1.52 +#define isxdigit(c) ((_ctype_+1)[(unsigned)(c)]&(_X|_N))1.53 +#define isspace(c) ((_ctype_+1)[(unsigned)(c)]&_S)1.54 +#define ispunct(c) ((_ctype_+1)[(unsigned)(c)]&_P)1.55 +#define isalnum(c) ((_ctype_+1)[(unsigned)(c)]&(_U|_L|_N))1.56 +#define isprint(c) ((_ctype_+1)[(unsigned)(c)]&(_P|_U|_L|_N|_B))1.57 +#define isgraph(c) ((_ctype_+1)[(unsigned)(c)]&(_P|_U|_L|_N))1.58 +#define iscntrl(c) ((_ctype_+1)[(unsigned)(c)]&_C)1.59 +/* Non-gcc versions will get the library versions, and will be1.60 + slightly slower */1.61 +#ifdef __GNUC__1.62 +# define toupper(c) \1.63 + ({ int __x = (c); islower(__x) ? (__x - 'a' + 'A') : __x;})1.64 +# define tolower(c) \1.65 + ({ int __x = (c); isupper(__x) ? (__x - 'A' + 'a') : __x;})1.66 +#endif1.67 +1.68 +#ifndef __STRICT_ANSI__1.69 +#define isascii(c) ((unsigned)(c)<=0177)1.70 +#define toascii(c) ((c)&0177)1.71 +#endif1.72 +1.73 +#ifdef __cplusplus1.74 +}1.75 +#endif1.76 +#endif /* _CTYPE_H_ */
.