1: /*
2: * Copyright (c) 1980 Regents of the University of California.
3: * All rights reserved. The Berkeley Software License Agreement
4: * specifies the terms and conditions for redistribution.
5: *
6: * @(#)sh.char.h 5.3 (Berkeley) 3/29/86
7: */
8:
9: /*
10: * Table for spotting special characters quickly
11: *
12: * Makes for very obscure but efficient coding.
13: */
14:
15: extern unsigned short _cmap[];
16:
17: #define _Q 0x01 /* '" */
18: #define _Q1 0x02 /* ` */
19: #define _SP 0x04 /* space and tab */
20: #define _NL 0x08 /* \n */
21: #define _META 0x10 /* lex meta characters, sp #'`";&<>()|\t\n */
22: #define _GLOB 0x20 /* glob characters, *?{[` */
23: #define _ESC 0x40 /* \ */
24: #define _DOL 0x80 /* $ */
25: #define _DIG 0x100 /* 0-9 */
26: #define _LET 0x200 /* a-z, A-Z, _ */
27:
28: #define cmap(c, bits) (_cmap[(unsigned char)(c)] & (bits))
29:
30: #define isglob(c) cmap(c, _GLOB)
31: #define isspace(c) cmap(c, _SP)
32: #define isspnl(c) cmap(c, _SP|_NL)
33: #define ismeta(c) cmap(c, _META)
34: #define digit(c) cmap(c, _DIG)
35: #define letter(c) cmap(c, _LET)
36: #define alnum(c) (digit(c) || letter(c))
Defined macros
_DIG
defined in line
25; used 11 times
_DOL
defined in line
24; used 2 times
_ESC
defined in line
23; used 4 times
_GLOB
defined in line
22; used 6 times
_LET
defined in line
26; used 54 times
_META
defined in line
21; used 15 times
_NL
defined in line
20; used 3 times
_Q
defined in line
17; used 7 times
_Q1
defined in line
18; used 6 times
_SP
defined in line
19; used 5 times
alnum
defined in line
36; used 4 times
cmap
defined in line
28; used 15 times
digit
defined in line
34; used 28 times
- in line 36
- in /usr/src/bin/csh/sh.dir.c line
261
- in /usr/src/bin/csh/sh.dol.c line
351,
358,
428-431(2),
450-452(2)
- in /usr/src/bin/csh/sh.exp.c line
568
- in /usr/src/bin/csh/sh.func.c line
862,
940
- in /usr/src/bin/csh/sh.glob.c line
136
- in /usr/src/bin/csh/sh.hist.c line
32
- in /usr/src/bin/csh/sh.lex.c line
364,
370,
570,
854-856(2),
932,
978
- in /usr/src/bin/csh/sh.misc.c line
324-327(2)
- in /usr/src/bin/csh/sh.proc.c line
791,
851,
932
- in /usr/src/bin/csh/sh.set.c line
105,
311-315(2)
Usage of this include