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
isglob defined in line 30; used 2 times
ismeta defined in line 33; never used
isspace defined in line 31; never used
isspnl defined in line 32; never used
letter defined in line 35; used 9 times

Usage of this include

Last modified: 1987-02-08
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2849
Valid CSS Valid XHTML 1.0 Strict