hsearch.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
*
* Copyright Sun Microsystems, Inc.
* All Rights Reserved
*
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#ident "@(#)hsearch.h 1.3 07/23/97 SMI"
typedef struct { /* Hash table entry */
char * key;
char * data;
int dsize;
int modified;
} HASH_ENTRY;
typedef struct node { /* Part of the linked list of entries */
} NODE;
typedef enum {
FIND, /* Find, if present */
ENTER, /* Find; enter if not present */
REPLACE, /* replace */
DELETE, /* delete */
} ACTION;
/* define everything that a hash table needs to drag around */
typedef struct hash_table {
unsigned int length; /* Size of the hash table */
unsigned int m; /* Log base 2 of length */
unsigned int count; /* nb entries in the hash table */
int alloc_data; /* true if data is allocated and copied in the hast table */
int clean; /* to force cleanup of the hash table */
int size; /* Max size of the hast table, defaulted 5000 */
} HASH_TABLE;
/* convenience functions for adding and find things */