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
misses defined in line 22; used 4 times
xhash defined in line 17; used 5 times

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
bis defined in line 20; used 1 times
bit defined in line 19; used 2 times
hash defined in line 18; used 4 times

Usage of this include

Last modified: 1996-09-20
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2384
Valid CSS Valid XHTML 1.0 Strict