/************************************************************************ * This program is Copyright (C) 1986 by Jonathan Payne. JOVE is * * provided to you without charge, and with no warranty. You may give * * away copies of JOVE, including sources, provided that this notice is * * included in all the files. * ************************************************************************/ #ifndef _CTYPE_H_ #define _CTYPE_H_ #ifndef TUNED # include "tune.h" #endif #ifdef _CTYPE_C_ RCS_H(ctype, "$Id: ctype.h,v 14.32 1993/04/09 00:46:26 tom Exp tom $") #endif /* The code in this file was snarfed from ctype.h and modified for JOVE. */ #if (BPC == 7) # define _Uc #else # define _Uc _UC_ #endif #define _U 01 #define _L 02 #define _N 04 #define _P 010 #define _C 020 #define _S 040 #define _Op 0100 #define _Cl 0200 extern int ModeMask; /* * Support for selectable character set tables; * enabled with compile-time option SELECTABLE (pun intended) */ #ifdef SELECTABLE # define Const #else # define Const const #endif extern Const char #if (BPC > 7) CaseEquiv[], #endif CharTable[], UpcTable[], LocTable[], WordTable[]; #ifndef _CTYPE_C_ # undef Const #endif #define iswhite(c) (isspace(c)) #define isword(c) (WordTable[_Uc(c)]&ModeMask) #define isalpha(c) (CharTable[_Uc(c)]&(_U|_L)) #define isupper(c) (CharTable[_Uc(c)]&_U) #define islower(c) (CharTable[_Uc(c)]&_L) #define isdigit(c) (CharTable[_Uc(c)]&_N) #define isspace(c) (CharTable[_Uc(c)]&_S) #define ispunct(c) (CharTable[_Uc(c)]&_P) #define toupper(c) (UpcTable[_Uc(c)]) #define tolower(c) (LocTable[_Uc(c)]) #if (BPC == 7) /* use 7-bits character set... */ # define toascii(c) ((c)&0177) #else /* ...and 8-bits chars for others */ # define toascii(c) _UC_(c) #endif #define isctrl(c) (CharTable[toascii(c)]&_C) #define isopenp(c) (CharTable[toascii(c)]&_Op) #define isclosep(c) (CharTable[toascii(c)]&_Cl) #define isoctal(c) ((unsigned)((c)-'0') < 8) #define ishex(c) (isdigit(c)||(unsigned)(toupper(c)-'A') < 6) #define has_syntax(c,s) (CharTable[_Uc(c)]&(s)) #if (BPC == 7) # define CEquiv(c) tolower(c) #else # define CEquiv(c) CaseEquiv[_Uc(c)] #endif #define SET_TABLE(x) (ModeMask=(1<<(x))) #define WITH_TABLE(x) \ { \ int _push=ModeMask; \ SET_TABLE(x); #define END_TABLE() \ ModeMask=_push; \ } /* check if input key is a printable character */ #define printable(c) ((c)<0200 && has_syntax(c,_U|_L|_N|_P)) /* Abbreviations for FUNDAMENTAL, TEXT, CMODE, LISPMODE bitmasks */ #define F (1<