version 1.2, 1996/06/26 05:36:31 |
version 1.3, 1996/11/30 21:08:55 |
|
|
/* $OpenBSD$ */ |
/* $OpenBSD$ */ |
/* $NetBSD: hash.h,v 1.4 1995/06/14 15:19:18 christos Exp $ */ |
/* $NetBSD: hash.h,v 1.5 1996/11/06 17:59:07 christos Exp $ */ |
|
|
/* |
/* |
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California. |
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California. |
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
* |
* |
* from: @(#)hash.h 5.4 (Berkeley) 12/28/90 |
* from: @(#)hash.h 8.1 (Berkeley) 6/6/93 |
*/ |
*/ |
|
|
/* hash.h -- |
/* hash.h -- |
|
|
#ifndef _HASH |
#ifndef _HASH |
#define _HASH |
#define _HASH |
|
|
/* |
/* |
* The following defines one entry in the hash table. |
* The following defines one entry in the hash table. |
*/ |
*/ |
|
|
|
|
int mask; /* Used to select bits for hashing. */ |
int mask; /* Used to select bits for hashing. */ |
} Hash_Table; |
} Hash_Table; |
|
|
/* |
/* |
* The following structure is used by the searching routines |
* The following structure is used by the searching routines |
* to record where we are in the search. |
* to record where we are in the search. |
*/ |
*/ |
|
|
*/ |
*/ |
|
|
/* |
/* |
* ClientData Hash_GetValue(h) |
* ClientData Hash_GetValue(h) |
* Hash_Entry *h; |
* Hash_Entry *h; |
*/ |
*/ |
|
|
#define Hash_GetValue(h) ((h)->clientData) |
#define Hash_GetValue(h) ((h)->clientData) |
|
|
/* |
/* |
* Hash_SetValue(h, val); |
* Hash_SetValue(h, val); |
* Hash_Entry *h; |
* Hash_Entry *h; |
* char *val; |
* char *val; |
*/ |
*/ |
|
|
#define Hash_SetValue(h, val) ((h)->clientData = (ClientData) (val)) |
#define Hash_SetValue(h, val) ((h)->clientData = (ClientData) (val)) |
|
|
/* |
/* |
* Hash_Size(n) returns the number of words in an object of n bytes |
* Hash_Size(n) returns the number of words in an object of n bytes |
*/ |
*/ |
|
|
#define Hash_Size(n) (((n) + sizeof (int) - 1) / sizeof (int)) |
#define Hash_Size(n) (((n) + sizeof (int) - 1) / sizeof (int)) |