Search
lxdream.org :: lxdream/test/include/ctype.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename test/include/ctype.h
changeset 185:6755a04c447f
author nkeynes
date Sat Aug 05 00:18:21 2006 +0000 (17 years ago)
permissions -rw-r--r--
last change Add error lines to tests with incomplete polys
Split clip tests to separate data file
Add tests for cmd bit 23 ("use list size field")
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/test/include/ctype.h Sat Aug 05 00:18:21 2006 +0000
1.3 @@ -0,0 +1,73 @@
1.4 +#ifndef _CTYPE_H_
1.5 +#ifdef __cplusplus
1.6 +extern "C" {
1.7 +#endif
1.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 +#endif
1.32 +
1.33 +#define _U 01
1.34 +#define _L 02
1.35 +#define _N 04
1.36 +#define _S 010
1.37 +#define _P 020
1.38 +#define _C 040
1.39 +#define _X 0100
1.40 +#define _B 0200
1.41 +
1.42 +#if !defined(__CYGWIN32__) || defined(__INSIDE_CYGWIN__) || defined(_COMPILING_NEWLIB)
1.43 +extern _CONST char _ctype_[];
1.44 +#else
1.45 +extern _CONST char _ctype_[] __declspec(dllimport);
1.46 +#endif
1.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 be
1.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 +#endif
1.67 +
1.68 +#ifndef __STRICT_ANSI__
1.69 +#define isascii(c) ((unsigned)(c)<=0177)
1.70 +#define toascii(c) ((c)&0177)
1.71 +#endif
1.72 +
1.73 +#ifdef __cplusplus
1.74 +}
1.75 +#endif
1.76 +#endif /* _CTYPE_H_ */
.