Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

inthash.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "inthash.h"

Go to the source code of this file.

Compounds

struct  inthash_node_t

Defines

#define HASH_LIMIT   0.5

Typedefs

typedef inthash_node_t inthash_node_t

Functions

int inthash (const inthash_t *tptr, int key)
VMDEXTERNSTATIC void inthash_init (inthash_t *tptr, int buckets)
void rebuild_table (inthash_t *tptr)
VMDEXTERNSTATIC int inthash_lookup (const inthash_t *tptr, int key)
VMDEXTERNSTATIC int inthash_insert (inthash_t *tptr, int key, int data)
VMDEXTERNSTATIC int inthash_delete (inthash_t *tptr, int key)
VMDEXTERNSTATIC void inthash_destroy (inthash_t *tptr)
float alos (inthash_t *tptr)
VMDEXTERNSTATIC char * inthash_stats (inthash_t *tptr)


Define Documentation

#define HASH_LIMIT   0.5
 

Definition at line 27 of file inthash.c.

Referenced by inthash_insert.


Typedef Documentation

typedef struct inthash_node_t inthash_node_t
 

hash table node data structure


Function Documentation

float alos inthash_t   tptr [static]
 

Definition at line 245 of file inthash.c.

References alos, inthash_t::bucket, inthash_t::entries, inthash_node_t::next, NULL, and inthash_t::size.

Referenced by alos, and inthash_stats.

int inthash const inthash_t   tptr,
int    key
[static]
 

Definition at line 42 of file inthash.c.

References inthash_t::downshift, and inthash_t::mask.

Referenced by inthash_delete, inthash_insert, inthash_lookup, and rebuild_table.

VMDEXTERNSTATIC int inthash_delete inthash_t  ,
int   
 

delete an string from the hash table, given its string name

Definition at line 179 of file inthash.c.

References inthash_t::bucket, inthash_node_t::data, data, inthash, inthash_node_t::key, inthash_node_t::next, and NULL.

VMDEXTERNSTATIC void inthash_destroy inthash_t  
 

destroy the hash table completely, deallocate memory

Definition at line 220 of file inthash.c.

References inthash_t::bucket, inthash_node_t::next, NULL, and inthash_t::size.

VMDEXTERNSTATIC void inthash_init inthash_t  ,
int   
 

initialize hash table for first use

Definition at line 59 of file inthash.c.

References inthash_t::bucket, inthash_t::downshift, inthash_t::entries, inthash_t::mask, and inthash_t::size.

VMDEXTERNSTATIC int inthash_insert inthash_t  ,
int   ,
int   
 

insert a string into the hash table, along with an integer key

Definition at line 147 of file inthash.c.

References inthash_t::bucket, inthash_node_t::data, data, inthash_t::entries, HASH_LIMIT, inthash, inthash_lookup, inthash_node_t::key, inthash_node_t::next, rebuild_table, and inthash_t::size.

VMDEXTERNSTATIC int inthash_lookup const inthash_t  ,
int   
 

lookup a string key in the hash table returning its integer key

Definition at line 123 of file inthash.c.

References inthash_t::bucket, inthash_node_t::data, inthash, inthash_node_t::key, inthash_node_t::next, and NULL.

VMDEXTERNSTATIC char* inthash_stats inthash_t  
 

print hash table vital stats

Definition at line 266 of file inthash.c.

References alos, inthash_t::entries, and inthash_t::size.

void rebuild_table inthash_t   tptr [static]
 

Definition at line 89 of file inthash.c.

References inthash_t::bucket, inthash_t::entries, inthash, inthash_init, inthash_node_t::key, inthash_node_t::next, and inthash_t::size.

Referenced by hash_insert, and inthash_insert.


Generated on Sun Jul 6 01:28:04 2008 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002