hsearch.h revision 5e45752a44935a6b2445ae1c763867d868fa3fbb
/*
* Copyright 1998 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#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 */