- struct h_table *h_init(int size)
- void h_destroy (struct h_table *h)
- void * h_get (struct h_table *tb, register char *s)
- struct h_node * h_put (struct h_table *tb, register char *s, void * o)
- int h_del (struct h_table *tb, register char *s)
- int hash (struct h_table *tb, register char *s)
- void h_analyse (struct h_table * tb, int * sz, int * ptot, int * min, int * max, double * avg, int * nempty)
- void h_printstats (char * name, struct h_table * tb, int first)
- struct h_table *h_init(int size)
- Initilize a hash table to size. This expects a prime number as the simple minded hashing function hashes the key modulo table size. I usually use 2^n-1 sizes since they're (always?) prime.
- void h_destroy (struct h_table *h)
- Release all storage from the given hash table.
Note that any payload you attach to h_nodes is your responsibility. H_destroy assumes nothing.
- void * h_get (struct h_table *tb, register char *s)
- given the table and key s, return the value in h_obj. This can be any value at all, but is normally a pointer to your data structure.
- struct h_node * h_put (struct h_table *tb, register char *s, void * o)
- Put the payload in o into the hash table accessible by key s. The payload can be anything at all, but is normally a pointer to your own data structure.
- int h_del (struct h_table *tb, register char *s)
- Remove the node associated with key s.
- int hash (struct h_table *tb, register char *s)
- The internal hashing function. Ignore the man behind the curtain.
© (copyright) 1997 MTCC Last modified: Fri Apr 25 20:24:23 PDT 1997