1e6188e58Smrg/* 2e6188e58Smrg * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. 3e6188e58Smrg * All Rights Reserved. 4e6188e58Smrg * 5e6188e58Smrg * Permission is hereby granted, free of charge, to any person obtaining a 6e6188e58Smrg * copy of this software and associated documentation files (the "Software"), 7e6188e58Smrg * to deal in the Software without restriction, including without limitation 8e6188e58Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9e6188e58Smrg * and/or sell copies of the Software, and to permit persons to whom the 10e6188e58Smrg * Software is furnished to do so, subject to the following conditions: 11e6188e58Smrg * 12e6188e58Smrg * The above copyright notice and this permission notice (including the next 13e6188e58Smrg * paragraph) shall be included in all copies or substantial portions of the 14e6188e58Smrg * Software. 15e6188e58Smrg * 16e6188e58Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17e6188e58Smrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18e6188e58Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19e6188e58Smrg * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20e6188e58Smrg * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21e6188e58Smrg * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22e6188e58Smrg * DEALINGS IN THE SOFTWARE. 23e6188e58Smrg * 24e6188e58Smrg * Authors: Rickard E. (Rik) Faith <faith@valinux.com> 25e6188e58Smrg */ 26e6188e58Smrg 27e6188e58Smrg#define HASH_SIZE 512 /* Good for about 100 entries */ 28e6188e58Smrg /* If you change this value, you probably 29e6188e58Smrg have to change the HashHash hashing 30e6188e58Smrg function! */ 31e6188e58Smrg 32e6188e58Smrgtypedef struct HashBucket { 33e6188e58Smrg unsigned long key; 34e6188e58Smrg void *value; 35e6188e58Smrg struct HashBucket *next; 36e6188e58Smrg} HashBucket, *HashBucketPtr; 37e6188e58Smrg 38e6188e58Smrgtypedef struct HashTable { 39e6188e58Smrg unsigned long magic; 40e6188e58Smrg unsigned long entries; 41e6188e58Smrg unsigned long hits; /* At top of linked list */ 42e6188e58Smrg unsigned long partials; /* Not at top of linked list */ 43e6188e58Smrg unsigned long misses; /* Not in table */ 44e6188e58Smrg HashBucketPtr buckets[HASH_SIZE]; 45e6188e58Smrg int p0; 46e6188e58Smrg HashBucketPtr p1; 47e6188e58Smrg} HashTable, *HashTablePtr; 48