Annotation of 43BSD/contrib/jove/ctype.h, revision 1.1.1.1

1.1       root        1: /*************************************************************************
                      2:  * This program is copyright (C) 1985, 1986 by Jonathan Payne.  It is    *
                      3:  * provided to you without charge for use only on a licensed Unix        *
                      4:  * system.  You may copy JOVE provided that this notice is included with *
                      5:  * the copy.  You may not sell copies of this program or versions        *
                      6:  * modified for use on microcomputer systems, unless the copies are      *
                      7:  * included with a Unix system distribution and the source is provided.  *
                      8:  *************************************************************************/
                      9: 
                     10: /* The code in this file was snarfed from ctype.h and modified for JOVE. */
                     11: 
                     12: #define        _U      01
                     13: #define        _L      02
                     14: #define        _N      04
                     15: #define _P     010
                     16: #define _C     020
                     17: #define _W     040
                     18: #define _Op    0100
                     19: #define _Cl    0200
                     20: 
                     21: extern int     SyntaxTable;
                     22: #define iswhite(c)     (isspace(c))
                     23: #define isword(c)      ((CharTable[SyntaxTable])[c]&(_W))
                     24: #define        isalpha(c)      ((CharTable[SyntaxTable])[c]&(_U|_L))
                     25: #define        isupper(c)      ((CharTable[SyntaxTable])[c]&_U)
                     26: #define        islower(c)      ((CharTable[SyntaxTable])[c]&_L)
                     27: #define        isdigit(c)      ((CharTable[SyntaxTable])[c]&_N)
                     28: #define        isspace(c)      (c == ' ' || c == '\t')
                     29: #define ispunct(c)     ((CharTable[SyntaxTable])[c]&_P)
                     30: #define toupper(c)     ((c)&~040)
                     31: #define tolower(c)     ((c)|040)
                     32: #define toascii(c)     ((c)&0177)
                     33: #define isctrl(c)      ((CharTable[0][c&0177])&_C)
                     34: #define isopenp(c)     ((CharTable[0][c&0177])&_Op)
                     35: #define isclosep(c)    ((CharTable[0][c&0177])&_Cl)
                     36: #define has_syntax(c,s)        ((CharTable[SyntaxTable][c&0177])&s)
                     37: #define WITH_TABLE(x) \
                     38: { \
                     39:        int     push = SyntaxTable; \
                     40:        SyntaxTable = x;
                     41: 
                     42: #define END_TABLE() \
                     43:        SyntaxTable = push; \
                     44: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.