# 2.11BSD#431 - /usr/src/bin/csh/sh.exec.h

##### Variables

    hits              X
    misses            X
    xhash             X

##### Macros

    HSHMASK           X
    HSHMUL            X
    HSHSIZ            X
    bis               X
    bit               X
    hash              X

       1: /*
       2:  * Xhash is an array of HSHSIZ bits (HSHSIZ / 8 chars), which are used
       3:  * to hash execs.  If it is allocated (havhash true), then to tell
       4:  * whether ``name'' is (possibly) present in the i'th component
       5:  * of the variable path, you look at the bit in xhash indexed by
       6:  * hash(hashname("name"), i).  This is setup automatically
       7:  * after .login is executed, and recomputed whenever ``path'' is
       8:  * changed.
       9:  * The two part hash function is designed to let texec() call the
      10:  * more expensive hashname() only once and the simple hash() several
      11:  * times (once for each path component checked).
      12:  * Byte size is assumed to be 8.
      13:  */
      14: #define HSHSIZ      8192            /* 1k bytes */
      15: #define HSHMASK     (HSHSIZ - 1)
      16: #define HSHMUL      243
      17: char    xhash[HSHSIZ / 8];
      18: #define hash(a, b)  ((a) * HSHMUL + (b) & HSHMASK)
      19: #define bit(h, b)   ((h)[(b) >> 3] & 1 << ((b) & 7))    /* bit test */
      20: #define bis(h, b)   ((h)[(b) >> 3] |= 1 << ((b) & 7))   /* bit set */
      21: #ifdef VFORK
      22: int hits, misses;
      23: #endif

#### Defined variables

hits defined in line 22; used 6 times

- in /usr/src/bin/csh/sh.exec.c line 115, 144, 306-309(4)

misses defined in line 22; used 4 times

- in /usr/src/bin/csh/sh.exec.c line 137, 306-309(3)

xhash defined in line 17; used 5 times

- in /usr/src/bin/csh/sh.exec.c line 120, 268-269(2), 290
- in /usr/src/bin/csh/sh.exec2.c line 40

#### Defined macros

HSHMASK defined in line 15; used 1 times

- in line 18

HSHMUL defined in line 16; used 1 times

- in line 18

HSHSIZ defined in line 14; used 2 times

- in line 15-17(2)

bis defined in line 20; used 1 times

- in /usr/src/bin/csh/sh.exec.c line 290

bit defined in line 19; used 2 times

- in /usr/src/bin/csh/sh.exec.c line 120
- in /usr/src/bin/csh/sh.exec2.c line 40

hash defined in line 18; used 4 times

- in /usr/src/bin/csh/sh.exec.c line 119, 289, 322
- in /usr/src/bin/csh/sh.exec2.c line 39

#### Usage of this include

sh.exec.h used 2 times

- in /usr/src/bin/csh/sh.exec.c line 36
- in /usr/src/bin/csh/sh.exec2.c line 14

Last modified: 1996-09-20 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 991 |