Search
lxdream.org :: lxdream/test/include/ctype.h
lxdream 0.9.1
released Jun 29
Download Now
filename test/include/ctype.h
changeset 185:6755a04c447f
author nkeynes
date Tue Feb 28 18:22:52 2012 +1000 (12 years ago)
permissions -rw-r--r--
last change Add a GL-only video driver for android usage (since the Java code is
responsible for creating the context)
view annotate diff log raw
     1 #ifndef _CTYPE_H_
     2 #ifdef __cplusplus
     3 extern "C" {
     4 #endif
     5 #define _CTYPE_H_
     7 #include "_ansi.h"
     9 int _EXFUN(isalnum, (int __c));
    10 int _EXFUN(isalpha, (int __c));
    11 int _EXFUN(iscntrl, (int __c));
    12 int _EXFUN(isdigit, (int __c));
    13 int _EXFUN(isgraph, (int __c));
    14 int _EXFUN(islower, (int __c));
    15 int _EXFUN(isprint, (int __c));
    16 int _EXFUN(ispunct, (int __c));
    17 int _EXFUN(isspace, (int __c));
    18 int _EXFUN(isupper, (int __c));
    19 int _EXFUN(isxdigit,(int __c));
    20 int _EXFUN(tolower, (int __c));
    21 int _EXFUN(toupper, (int __c));
    23 #ifndef __STRICT_ANSI__
    24 int _EXFUN(isascii, (int __c));
    25 int _EXFUN(toascii, (int __c));
    26 int _EXFUN(_tolower, (int __c));
    27 int _EXFUN(_toupper, (int __c));
    28 #endif
    30 #define	_U	01
    31 #define	_L	02
    32 #define	_N	04
    33 #define	_S	010
    34 #define _P	020
    35 #define _C	040
    36 #define _X	0100
    37 #define	_B	0200
    39 #if !defined(__CYGWIN32__) || defined(__INSIDE_CYGWIN__) || defined(_COMPILING_NEWLIB)
    40 extern	_CONST char	_ctype_[];
    41 #else
    42 extern	_CONST char	_ctype_[] __declspec(dllimport);
    43 #endif
    45 #define	isalpha(c)	((_ctype_+1)[(unsigned)(c)]&(_U|_L))
    46 #define	isupper(c)	((_ctype_+1)[(unsigned)(c)]&_U)
    47 #define	islower(c)	((_ctype_+1)[(unsigned)(c)]&_L)
    48 #define	isdigit(c)	((_ctype_+1)[(unsigned)(c)]&_N)
    49 #define	isxdigit(c)	((_ctype_+1)[(unsigned)(c)]&(_X|_N))
    50 #define	isspace(c)	((_ctype_+1)[(unsigned)(c)]&_S)
    51 #define ispunct(c)	((_ctype_+1)[(unsigned)(c)]&_P)
    52 #define isalnum(c)	((_ctype_+1)[(unsigned)(c)]&(_U|_L|_N))
    53 #define isprint(c)	((_ctype_+1)[(unsigned)(c)]&(_P|_U|_L|_N|_B))
    54 #define	isgraph(c)	((_ctype_+1)[(unsigned)(c)]&(_P|_U|_L|_N))
    55 #define iscntrl(c)	((_ctype_+1)[(unsigned)(c)]&_C)
    56 /* Non-gcc versions will get the library versions, and will be
    57    slightly slower */
    58 #ifdef __GNUC__
    59 # define toupper(c) \
    60 	({ int __x = (c); islower(__x) ? (__x - 'a' + 'A') : __x;})
    61 # define tolower(c) \
    62 	({ int __x = (c); isupper(__x) ? (__x - 'A' + 'a') : __x;})
    63 #endif
    65 #ifndef __STRICT_ANSI__
    66 #define isascii(c)	((unsigned)(c)<=0177)
    67 #define toascii(c)	((c)&0177)
    68 #endif
    70 #ifdef __cplusplus
    71 }
    72 #endif
    73 #endif /* _CTYPE_H_ */
.