Back to index

tetex-bin  3.0
Defines | Functions
hash-string.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define HASHWORDBITS   32

Functions

static unsigned long int hash_string (const char *str_param)

Define Documentation

#define HASHWORDBITS   32

Definition at line 22 of file hash-string.h.


Function Documentation

static unsigned long int hash_string ( const char *  str_param) [inline, static]

Definition at line 29 of file hash-string.h.

{
  unsigned long int hval, g;
  const char *str = str_param;

  /* Compute the hash value for the given string.  */
  hval = 0;
  while (*str != '\0')
    {
      hval <<= 4;
      hval += (unsigned char) *str++;
      g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4));
      if (g != 0)
       {
         hval ^= g >> (HASHWORDBITS - 8);
         hval ^= g;
       }
    }
  return hval;
}

Here is the caller graph for this function: