home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.ee.lbl.gov
/
2014.05.ftp.ee.lbl.gov.tar
/
ftp.ee.lbl.gov
/
mrdebug.tar.Z
/
mrdebug.tar
/
mrhash.h
< prev
next >
Wrap
Text File
|
1993-10-25
|
2KB
|
71 lines
/*
**++
**
** ABSTRACT:
**
** This header file is for the name mapping hash functions.
**
** AUTHOR:
**
** Deb Agarwal (original by: Paul W. Ciarfella)
**
** CREATION DATE: 14June93
**
** MODIFICATION HISTORY:
**--
**/
#define NAMEMAP_HTABLE_SIZE 127
/*
** HENTRY_t: Hash table entry
*/
typedef struct HENTRY_t
{
/*
** Slot index in table for this entry
*/
int hidx;
/*
** Link for collision chaining
*/
struct HENTRY_t *next_p;
struct HENTRY_t *prev_p;
/*
** Data
*/
NAME key_p; /* IP name, used as search key */
long index; /* adjacency list index */
long *subnet; /* pointer to the subnet ifc */
NAME name; /* filled in if the entry is an ip_name */
} HENTRY_t;
/*
** HTABLE_t: Hash table
*/
typedef struct htable
{
int slots; /* Number of slots in table */
int entries; /* Number of entries in the table */
HENTRY_t **htbl_p; /* Pointer to the slots (which are created */
/* dynamically in create_htable) */
} HTABLE_t;
/*
** FUNCTION PROTOTYPES
*/
void create_htable( HTABLE_t *table_p, int slots );
long hash_index( char *key_p, long tbl_length );
HENTRY_t *lookup_htable( HTABLE_t *table_p, char *key_p );
void delete_htable( HTABLE_t *table_p, char *key_p );
void insert_htable( HTABLE_t *table_p, char *key_p, long index, long *subnet, char *name );
void update_htable( HTABLE_t *table_p, char *key_p, long index );
void print_htable( HTABLE_t *table_p );
/*
**
** END: hash.h
**
*/