keyword hash tables More...
Go to the source code of this file.
Functions | |
ptr_hash_table | hash_create (int size) |
HASH_CREATE. More... | |
void | hash_expand (ptr_hash_table table, int new_size) |
HASH_EXPAND. More... | |
int | hash_code (ptr_hash_table table, char *symbol) |
HASH_CODE. More... | |
int | hash_find (ptr_hash_table table, char *symbol) |
hash_find More... | |
ptr_keyword | hash_lookup (ptr_hash_table table, char *symbol) |
HASH_LOOKUP. More... | |
void | hash_insert (ptr_hash_table table, char *symbol, ptr_keyword keyword) |
HASH_INSERT. More... | |
void | hash_display (ptr_hash_table table) |
HASH_DISPLAY. More... | |
Variables | |
ptr_definition | first_definition =NULL |
long | rand_array [256] |
keyword hash tables
KEYWORDS RM: Feb 3 1993 New version of the keyword table and related routines. The keyword table will not NOT be sorted, however, access will be hashed. Each module has its own hash table of symbols. All definition are stores in a linked list starting at first_definition.
Definition in file hash_table.c.
int hash_code | ( | ptr_hash_table | table, |
char * | symbol | ||
) |
HASH_CODE.
table | - ptr_hash_table table |
symbol | - char *symbol |
Return the hash code for a symbol
Definition at line 79 of file hash_table.c.
References rand_array, and wl_hash_table::size.
ptr_hash_table hash_create | ( | int | size | ) |
HASH_CREATE.
size | - int size |
Create a hash-table for max size keywords.
Definition at line 25 of file hash_table.c.
References NULL, and wl_hash_table::size.
void hash_display | ( | ptr_hash_table | table | ) |
HASH_DISPLAY.
table | - ptr_hash_table table |
Display a symbol table (for debugging).
Definition at line 174 of file hash_table.c.
References hash_code().
void hash_expand | ( | ptr_hash_table | table, |
int | new_size | ||
) |
HASH_EXPAND.
table | - ptr_hash_table table |
new_size | - int new_size |
Allocate a bigger hash table.
Definition at line 47 of file hash_table.c.
References wl_hash_table::data, hash_insert(), NULL, wl_hash_table::size, and wl_hash_table::used.
int hash_find | ( | ptr_hash_table | table, |
char * | symbol | ||
) |
hash_find
table | - ptr_hash_table table |
symbol | - char *symbol |
Definition at line 106 of file hash_table.c.
References wl_hash_table::data, hash_code(), wl_hash_table::size, and wl_keyword::symbol.
void hash_insert | ( | ptr_hash_table | table, |
char * | symbol, | ||
ptr_keyword | keyword | ||
) |
HASH_INSERT.
table | - ptr_hash_table table |
symbol | - char *symbol |
keyword | - ptr_keyword keyword |
Add a symbol and data to a table. Overwrite previous data.
Definition at line 151 of file hash_table.c.
References wl_hash_table::data, hash_expand(), hash_find(), wl_hash_table::size, and wl_hash_table::used.
ptr_keyword hash_lookup | ( | ptr_hash_table | table, |
char * | symbol | ||
) |
HASH_LOOKUP.
table | - ptr_hash_table table |
symbol | - char *symbol |
Look up a symbol in the symbol table.
Definition at line 131 of file hash_table.c.
References wl_hash_table::data, and hash_find().
ptr_definition first_definition =NULL |
Definition at line 14 of file hash_table.c.
long rand_array[256] |
Definition at line 16 of file hash_table.c.