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 Sat Aug 05 00:18:21 2006 +0000 (16 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
nkeynes@185
     1
#ifndef _CTYPE_H_
nkeynes@185
     2
#ifdef __cplusplus
nkeynes@185
     3
extern "C" {
nkeynes@185
     4
#endif
nkeynes@185
     5
#define _CTYPE_H_
nkeynes@185
     6
nkeynes@185
     7
#include "_ansi.h"
nkeynes@185
     8
nkeynes@185
     9
int _EXFUN(isalnum, (int __c));
nkeynes@185
    10
int _EXFUN(isalpha, (int __c));
nkeynes@185
    11
int _EXFUN(iscntrl, (int __c));
nkeynes@185
    12
int _EXFUN(isdigit, (int __c));
nkeynes@185
    13
int _EXFUN(isgraph, (int __c));
nkeynes@185
    14
int _EXFUN(islower, (int __c));
nkeynes@185
    15
int _EXFUN(isprint, (int __c));
nkeynes@185
    16
int _EXFUN(ispunct, (int __c));
nkeynes@185
    17
int _EXFUN(isspace, (int __c));
nkeynes@185
    18
int _EXFUN(isupper, (int __c));
nkeynes@185
    19
int _EXFUN(isxdigit,(int __c));
nkeynes@185
    20
int _EXFUN(tolower, (int __c));
nkeynes@185
    21
int _EXFUN(toupper, (int __c));
nkeynes@185
    22
nkeynes@185
    23
#ifndef __STRICT_ANSI__
nkeynes@185
    24
int _EXFUN(isascii, (int __c));
nkeynes@185
    25
int _EXFUN(toascii, (int __c));
nkeynes@185
    26
int _EXFUN(_tolower, (int __c));
nkeynes@185
    27
int _EXFUN(_toupper, (int __c));
nkeynes@185
    28
#endif
nkeynes@185
    29
nkeynes@185
    30
#define	_U	01
nkeynes@185
    31
#define	_L	02
nkeynes@185
    32
#define	_N	04
nkeynes@185
    33
#define	_S	010
nkeynes@185
    34
#define _P	020
nkeynes@185
    35
#define _C	040
nkeynes@185
    36
#define _X	0100
nkeynes@185
    37
#define	_B	0200
nkeynes@185
    38
nkeynes@185
    39
#if !defined(__CYGWIN32__) || defined(__INSIDE_CYGWIN__) || defined(_COMPILING_NEWLIB)
nkeynes@185
    40
extern	_CONST char	_ctype_[];
nkeynes@185
    41
#else
nkeynes@185
    42
extern	_CONST char	_ctype_[] __declspec(dllimport);
nkeynes@185
    43
#endif
nkeynes@185
    44
nkeynes@185
    45
#define	isalpha(c)	((_ctype_+1)[(unsigned)(c)]&(_U|_L))
nkeynes@185
    46
#define	isupper(c)	((_ctype_+1)[(unsigned)(c)]&_U)
nkeynes@185
    47
#define	islower(c)	((_ctype_+1)[(unsigned)(c)]&_L)
nkeynes@185
    48
#define	isdigit(c)	((_ctype_+1)[(unsigned)(c)]&_N)
nkeynes@185
    49
#define	isxdigit(c)	((_ctype_+1)[(unsigned)(c)]&(_X|_N))
nkeynes@185
    50
#define	isspace(c)	((_ctype_+1)[(unsigned)(c)]&_S)
nkeynes@185
    51
#define ispunct(c)	((_ctype_+1)[(unsigned)(c)]&_P)
nkeynes@185
    52
#define isalnum(c)	((_ctype_+1)[(unsigned)(c)]&(_U|_L|_N))
nkeynes@185
    53
#define isprint(c)	((_ctype_+1)[(unsigned)(c)]&(_P|_U|_L|_N|_B))
nkeynes@185
    54
#define	isgraph(c)	((_ctype_+1)[(unsigned)(c)]&(_P|_U|_L|_N))
nkeynes@185
    55
#define iscntrl(c)	((_ctype_+1)[(unsigned)(c)]&_C)
nkeynes@185
    56
/* Non-gcc versions will get the library versions, and will be
nkeynes@185
    57
   slightly slower */
nkeynes@185
    58
#ifdef __GNUC__
nkeynes@185
    59
# define toupper(c) \
nkeynes@185
    60
	({ int __x = (c); islower(__x) ? (__x - 'a' + 'A') : __x;})
nkeynes@185
    61
# define tolower(c) \
nkeynes@185
    62
	({ int __x = (c); isupper(__x) ? (__x - 'A' + 'a') : __x;})
nkeynes@185
    63
#endif
nkeynes@185
    64
nkeynes@185
    65
#ifndef __STRICT_ANSI__
nkeynes@185
    66
#define isascii(c)	((unsigned)(c)<=0177)
nkeynes@185
    67
#define toascii(c)	((c)&0177)
nkeynes@185
    68
#endif
nkeynes@185
    69
nkeynes@185
    70
#ifdef __cplusplus
nkeynes@185
    71
}
nkeynes@185
    72
#endif
nkeynes@185
    73
#endif /* _CTYPE_H_ */
.