# 2.11BSD#431 - /usr/src/bin/tcsh/sh.char.h

##### Macros

    Isalnum           X
    Isalpha           X
    Iscntrl           X
    Isdigit           X
    Islower           X
    Isprint           X
    Isspace           X
    Isupper           X
    Isxdigit          X
    Tolower           X
    Toupper           X
    _CMD              X
    _CTR              X
    _DIG              X
    _DOL              X
    _ESC              X
    _GLOB             X
    _LET              X
    _LOW              X
    _META             X
    _NL               X
    _Q                X
    _Q1               X
    _SP               X
    _UP               X
    _XD               X
    _h_sh_char        X
    alnum             X
    cmap              X
    iscmdmeta         X
    isglob            X
    ismeta            X
    isspc             X
    letter            X

       1: /* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/sh.char.h,v 3.0 1991/07/04 21:49:28 christos Exp $ */
       2: /*
       3:  * sh.char.h: Table for spotting special characters quickly
       4:  * 	      Makes for very obscure but efficient coding.
       5:  */
       6: /*-
       7:  * Copyright (c) 1980, 1991 The Regents of the University of California.
       8:  * All rights reserved.
       9:  *
      10:  * Redistribution and use in source and binary forms, with or without
      11:  * modification, are permitted provided that the following conditions
      12:  * are met:
      13:  * 1. Redistributions of source code must retain the above copyright
      14:  *    notice, this list of conditions and the following disclaimer.
      15:  * 2. Redistributions in binary form must reproduce the above copyright
      16:  *    notice, this list of conditions and the following disclaimer in the
      17:  *    documentation and/or other materials provided with the distribution.
      18:  * 3. All advertising materials mentioning features or use of this software
      19:  *    must display the following acknowledgement:
      20:  *	This product includes software developed by the University of
      21:  *	California, Berkeley and its contributors.
      22:  * 4. Neither the name of the University nor the names of its contributors
      23:  *    may be used to endorse or promote products derived from this software
      24:  *    without specific prior written permission.
      25:  *
      26:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
      27:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      28:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      29:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
      30:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
      31:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
      32:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
      33:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
      34:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
      35:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
      36:  * SUCH DAMAGE.
      37:  */
      38: #ifndef _h_sh_char
      39: #define _h_sh_char
      40: #include <ctype.h>
      41:
      42: extern unsigned short _cmap[];
      43:
      44: #ifndef NLS
      45: extern unsigned char _cmap_lower[], _cmap_upper[];
      46:
      47: #endif
      48:
      49: #define _Q  0x0001      /* '" */
      50: #define _Q1 0x0002      /* ` */
      51: #define _SP 0x0004      /* space and tab */
      52: #define _NL 0x0008      /* \n */
      53: #define _META   0x0010      /* lex meta characters, sp #'`";&<>()|\t\n */
      54: #define _GLOB   0x0020      /* glob characters, *?{[` */
      55: #define _ESC    0x0040      /* \ */
      56: #define _DOL    0x0080      /* $ */
      57: #define _DIG    0x0100      /* 0-9 */
      58: #define _LET    0x0200      /* a-z, A-Z, _ */
      59: #define _UP     0x0400      /* A-Z */
      60: #define _LOW    0x0800      /* a-z */
      61: #define _XD     0x1000      /* 0-9, a-f, A-F */
      62: #define _CMD    0x2000      /* lex end of command chars, ;&(|` */
      63: #define _CTR    0x4000      /* control */
      64:
      65: #define cmap(c, bits)   \
      66:     (((c) & QUOTE) ? 0 : (_cmap[(unsigned char)(c)] & (bits)))
      67:
      68: #define isglob(c)   cmap(c, _GLOB)
      69: #define isspc(c)    cmap(c, _SP)
      70: #define ismeta(c)   cmap(c, _META)
      71: #define iscmdmeta(c)    cmap(c, _CMD)
      72: #define letter(c)   (((c) & QUOTE) ? 0 : \
      73:              (isalpha((unsigned char) (c)) || (c) == '_'))
      74: #define alnum(c)    (((c) & QUOTE) ? 0 : \
      75:                  (isalnum((unsigned char) (c)) || (c) == '_'))
      76: #ifdef NLS
      77: # define Isspace(c) (((c) & QUOTE) ? 0 : isspace((unsigned char) (c)))
      78: # define Isdigit(c) (((c) & QUOTE) ? 0 : isdigit((unsigned char) (c)))
      79: # define Isalpha(c) (((c) & QUOTE) ? 0 : isalpha((unsigned char) (c)))
      80: # define Islower(c) (((c) & QUOTE) ? 0 : islower((unsigned char) (c)))
      81: # define Isupper(c) (((c) & QUOTE) ? 0 : isupper((unsigned char) (c)))
      82: # define Tolower(c)     (((c) & QUOTE) ? 0 : tolower((unsigned char) (c)))
      83: # define Toupper(c)     (((c) & QUOTE) ? 0 : toupper((unsigned char) (c)))
      84: # define Isxdigit(c)    (((c) & QUOTE) ? 0 : isxdigit((unsigned char) (c)))
      85: # define Isalnum(c) (((c) & QUOTE) ? 0 : isalnum((unsigned char) (c)))
      86: # define Iscntrl(c)     (((c) & QUOTE) ? 0 : iscntrl((unsigned char) (c)))
      87: # define Isprint(c)     (((c) & QUOTE) ? 0 : isprint((unsigned char) (c)))
      88: #else
      89: # define Isspace(c) cmap(c, _SP|_NL)
      90: # define Isdigit(c) cmap(c, _DIG)
      91: # define Isalpha(c) (cmap(c,_LET) && !(((c) & META) && AsciiOnly))
      92: # define Islower(c) (cmap(c,_LOW) && !(((c) & META) && AsciiOnly))
      93: # define Isupper(c) (cmap(c, _UP) && !(((c) & META) && AsciiOnly))
      94: # define Tolower(c) (_cmap_lower[(unsigned char)(c)])
      95: # define Toupper(c) (_cmap_upper[(unsigned char)(c)])
      96: # define Isxdigit(c)    cmap(c, _XD)
      97: # define Isalnum(c) (cmap(c, _DIG|_LET) && !(((c) & META) && AsciiOnly))
      98: # define Iscntrl(c) (cmap(c,_CTR) && !(((c) & META) && AsciiOnly))
      99: # define Isprint(c) (!cmap(c,_CTR) && !(((c) & META) && AsciiOnly))
     100: #endif
     101:
     102: #endif /* _h_sh_char */

#### Defined macros

Isalnum defined in line 97; never used
Isalpha defined in line 91; used 1 times

- in /usr/src/bin/tcsh/ed.chared.c line 1634

Iscntrl defined in line 98; used 8 times

- in /usr/src/bin/tcsh/ed.refresh.c line 88, 899, 935, 996
- in /usr/src/bin/tcsh/ed.xmap.c line 613
- in /usr/src/bin/tcsh/sh.print.c line 137
- in /usr/src/bin/tcsh/tc.bind.c line 105, 614

Isdigit defined in line 90; used 46 times

- in /usr/src/bin/tcsh/ed.chared.c line 612, 644
- in /usr/src/bin/tcsh/sh.dir.c line 612
- in /usr/src/bin/tcsh/sh.dol.c line 452, 459, 532-535(2), 552-554(2)
- in /usr/src/bin/tcsh/sh.exp.c line 678
- in /usr/src/bin/tcsh/sh.func.c line 1217, 1396
- in /usr/src/bin/tcsh/sh.glob.c line 141
- in /usr/src/bin/tcsh/sh.hist.c line 72
- in /usr/src/bin/tcsh/sh.lex.c line 483, 496, 510, 756, 1049-1051(2), 1135
- in /usr/src/bin/tcsh/sh.misc.c line 392-396(2)
- in /usr/src/bin/tcsh/sh.proc.c line 1343, 1441, 1546
- in /usr/src/bin/tcsh/sh.set.c line 210, 431-435(2)
- in /usr/src/bin/tcsh/tc.bind.c line 238, 246-249(2), 256-259(3)
- in /usr/src/bin/tcsh/tc.os.c line 340, 470, 549
- in /usr/src/bin/tcsh/tc.printf.c line 98-100(2), 110-112(2)
- in /usr/src/bin/tcsh/tc.sched.c line 127
- in /usr/src/bin/tcsh/tc.who.c line 532
- in /usr/src/bin/tcsh/tw.parse.c line 984, 1224

Islower defined in line 92; used 4 times

- in /usr/src/bin/tcsh/ed.chared.c line 1614, 1635, 1835
- in /usr/src/bin/tcsh/tc.bind.c line 80

Isprint defined in line 99; used 15 times

- in /usr/src/bin/tcsh/ed.defns.c line 1472
- in /usr/src/bin/tcsh/ed.refresh.c line 70, 906, 942, 1001
- in /usr/src/bin/tcsh/ed.xmap.c line 628
- in /usr/src/bin/tcsh/sh.c line 201
- in /usr/src/bin/tcsh/sh.exec.c line 330
- in /usr/src/bin/tcsh/sh.func.c line 1051, 1114
- in /usr/src/bin/tcsh/sh.print.c line 146
- in /usr/src/bin/tcsh/tc.bind.c line 105-110(3), 625

Isspace defined in line 89; used 3 times

- in /usr/src/bin/tcsh/ed.chared.c line 1852
- in /usr/src/bin/tcsh/ed.xmap.c line 628
- in /usr/src/bin/tcsh/tc.bind.c line 625

Isupper defined in line 93; used 6 times

- in /usr/src/bin/tcsh/ed.chared.c line 1642, 1660, 1833
- in /usr/src/bin/tcsh/tc.printf.c line 128
- in /usr/src/bin/tcsh/tc.who.c line 539, 549

Isxdigit defined in line 96; used 1 times

- in /usr/src/bin/tcsh/tc.bind.c line 234

Tolower defined in line 94; used 6 times

- in /usr/src/bin/tcsh/ed.chared.c line 1643, 1661, 1834
- in /usr/src/bin/tcsh/tc.printf.c line 130
- in /usr/src/bin/tcsh/tc.who.c line 539, 549

Toupper defined in line 95; used 4 times

- in /usr/src/bin/tcsh/ed.chared.c line 1615, 1636, 1836
- in /usr/src/bin/tcsh/tc.bind.c line 81

_CMD defined in line 62; used 6 times

- in line 71
- in /usr/src/bin/tcsh/sh.char.c line 74-77(2), 89, 119, 140

_CTR defined in line 63; used 67 times

- in line 98-99(2)
- in /usr/src/bin/tcsh/sh.char.c line 47-68(32), 140, 147-168(32)

_DIG defined in line 57; used 12 times

- in line 90, 97
- in /usr/src/bin/tcsh/sh.char.c line 83-89(10)

_DOL defined in line 56; used 3 times

- in /usr/src/bin/tcsh/sh.char.c line 74
- in /usr/src/bin/tcsh/sh.dol.c line 107
- in /usr/src/bin/tcsh/tw.parse.c line 409

_ESC defined in line 55; used 5 times

- in /usr/src/bin/tcsh/sh.char.c line 116
- in /usr/src/bin/tcsh/sh.dol.c line 65
- in /usr/src/bin/tcsh/sh.lex.c line 256, 342
- in /usr/src/bin/tcsh/tw.parse.c line 409

_GLOB defined in line 54; used 7 times

- in line 68
- in /usr/src/bin/tcsh/sh.char.c line 77, 92, 113, 119, 137
- in /usr/src/bin/tcsh/tw.parse.c line 409

_LET defined in line 58; used 116 times

- in line 91, 97
- in /usr/src/bin/tcsh/sh.char.c line 95-113(26), 119-137(26), 195-240(62)

_LOW defined in line 60; used 59 times

- in line 92
- in /usr/src/bin/tcsh/sh.char.c line 119-137(26), 216-240(32)

_META defined in line 53; used 17 times

- in line 70
- in /usr/src/bin/tcsh/sh.char.c line 53(2), 71-77(5), 89-92(3), 119, 140
- in /usr/src/bin/tcsh/sh.lex.c line 256, 342, 393
- in /usr/src/bin/tcsh/tw.parse.c line 409

_NL defined in line 52; used 3 times

- in line 89
- in /usr/src/bin/tcsh/sh.char.c line 53
- in /usr/src/bin/tcsh/sh.dol.c line 190

_Q defined in line 49; used 8 times

- in /usr/src/bin/tcsh/sh.char.c line 71-74(2)
- in /usr/src/bin/tcsh/sh.dol.c line 65, 190
- in /usr/src/bin/tcsh/sh.lex.c line 342, 354, 393
- in /usr/src/bin/tcsh/tw.parse.c line 409

_Q1 defined in line 50; used 6 times

- in /usr/src/bin/tcsh/sh.char.c line 119
- in /usr/src/bin/tcsh/sh.dol.c line 65, 190
- in /usr/src/bin/tcsh/sh.lex.c line 342, 354, 393

_SP defined in line 51; used 6 times

- in line 69, 89
- in /usr/src/bin/tcsh/sh.char.c line 53, 71, 171
- in /usr/src/bin/tcsh/sh.dol.c line 190

_UP defined in line 59; used 57 times

- in line 93
- in /usr/src/bin/tcsh/sh.char.c line 95-113(26), 195-216(30)

_XD defined in line 61; used 23 times

- in line 96
- in /usr/src/bin/tcsh/sh.char.c line 83-89(10), 95-98(6), 119-122(6)

_h_sh_char defined in line 39; used 1 times

- in line 38

alnum defined in line 74; used 6 times

- in /usr/src/bin/tcsh/sh.dol.c line 485-490(2)
- in /usr/src/bin/tcsh/sh.func.c line 436
- in /usr/src/bin/tcsh/sh.set.c line 85, 262
- in /usr/src/bin/tcsh/tw.parse.c line 1168

cmap defined in line 65; used 23 times

- in line 68-71(4), 89-99(9)
- in /usr/src/bin/tcsh/sh.dol.c line 107, 190-192(2), 343, 679
- in /usr/src/bin/tcsh/sh.lex.c line 256, 342, 354, 393
- in /usr/src/bin/tcsh/tw.parse.c line 409

iscmdmeta defined in line 71; used 4 times

- in /usr/src/bin/tcsh/ed.inputl.c line 546-549(2)
- in /usr/src/bin/tcsh/tw.parse.c line 132, 533

isglob defined in line 68; used 3 times

- in /usr/src/bin/tcsh/sh.glob.c line 571
- in /usr/src/bin/tcsh/tw.parse.c line 253, 299

ismeta defined in line 70; used 5 times

- in /usr/src/bin/tcsh/ed.inputl.c line 546-549(2)
- in /usr/src/bin/tcsh/glob.c line 74, 469
- in /usr/src/bin/tcsh/tw.parse.c line 144

isspc defined in line 69; used 2 times

- in /usr/src/bin/tcsh/tc.func.c line 1201-1203(2)

letter defined in line 72; used 9 times

- in /usr/src/bin/tcsh/sh.func.c line 434
- in /usr/src/bin/tcsh/sh.lex.c line 504, 510, 669, 756
- in /usr/src/bin/tcsh/sh.set.c line 84-87(2), 261-264(2)

#### Usage of this include

sh.char.h used 2 times

- in /usr/src/bin/tcsh/sh.char.c line 43
- in /usr/src/bin/tcsh/sh.h line 258

Last modified: 1991-08-20 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 880 |