/*
*    MC 68000 C Library - Copyright 1985, 1986, Microtec Research, Inc.
*    This program is the property of Microtec Research, Inc,
*
*   CTYPE.H
*/

#define	_U	01
#define	_L	02
#define	_N	04
#define	_S	010
#define _P	020
#define _C	040
#define _X	0100

extern const char _ctype_[];

#define isupper(ch) (_ctype_[1+(ch)]&(_U))
#define islower(ch) (_ctype_[1+(ch)]&(_L))
#define isdigit(ch) (_ctype_[1+(ch)]&(_N))
#define isxdigit(ch) (_ctype_[1+(ch)]&(_N|_X))
#define isalpha(ch) (_ctype_[1+(ch)]&(_U|_L))
#define isalnum(ch) (_ctype_[1+(ch)]&(_U|_L|_N))
#define isspace(ch) (_ctype_[1+(ch)]&(_S))
#define ispunct(ch) (_ctype_[1+(ch)]&(_P))
#define isprint(ch) (!(_ctype_[1+(ch)]&(_C)))
#define isgraph(ch) (_ctype_[1+(ch)]&(_U|_L|_N|_P))
#define iscntl(ch)  (_ctype_[1+(ch)]&(_C))
#define isascii(ch) ((unsigned)(ch)<=0x7f)

#define toupper(ch) (islower(ch)?(ch)+('A'-'a'):(ch))
#define tolower(ch) (isupper(ch)?(ch)+('a'-'A'):(ch))
#define _toupper(ch) ((ch)+('A'-'a'))
#define _tolower(ch) ((ch)+('a'-'A'))
#define toascii(ch) ((ch)&0x7f)
#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) < (b) ? (a) : (b))
