dos_compilers/Zortech C++ v206/SOURCE/CLIB/IS.C
2024-07-02 07:30:38 -07:00

81 lines
1.5 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*_ is.c Sat Sep 10 1988 Modified by: Walter Bright */
/* Copyright (C) 1985-1989 by Walter Bright */
/* All rights reserved */
#include <ctype.h>
#undef toascii
#undef isprint
#undef isgraph
#undef isascii
#undef isupper
#undef ispunct
#undef islower
#undef isdigit
#undef isxdigit
#undef isalnum
#undef isspace
#undef isalpha
#undef iscntrl
#ifdef Atoascii
toascii(c) { return c & 0x7F; }
#endif
#ifdef Atoupper
toupper(c) { return (c >= 'a' && c <= 'z') ? c - ('a' - 'A') : c; }
#endif
#ifdef Atolower
tolower(c) { return (c >= 'A' && c <= 'Z') ? c + ('a' - 'A') : c; }
#endif
#ifdef Aisprint
isprint(c) { return _ctype[c + 1] & (_UC|_LC|_DIG|_PNC|_BLK); }
#endif
#ifdef Aisgraph
isgraph(c) { return _ctype[c + 1] & (_UC|_LC|_DIG|_PNC); }
#endif
#ifdef Aisascii
isascii(c) { return (unsigned) c < 0x80; }
#endif
#ifdef Aisupper
isupper(c) { return _ctype[c + 1] & _UC; }
#endif
#ifdef Aispunct
ispunct(c) { return _ctype[c + 1] & _PNC; }
#endif
#ifdef Aislower
islower(c) { return _ctype[c + 1] & _LC; }
#endif
#ifdef Aisdigit
isdigit(c) { return _ctype[c + 1] & _DIG; }
#endif
#ifdef Aisxdigit
isxdigit(c) { return _ctype[c + 1] & _HEX; }
#endif
#ifdef Aisalnum
isalnum(c) { return _ctype[c + 1] & (_UC|_LC|_DIG); }
#endif
#ifdef Aisspace
isspace(c) { return _ctype[c + 1] & _SPC; }
#endif
#ifdef Aisalpha
isalpha(c) { return _ctype[c + 1] & (_UC|_LC); }
#endif
#ifdef Aiscntrl
iscntrl(c) { return _ctype[c + 1] & _CTL; }
#endif