32 #define HASH_TABLE_SIZE 253 // works better when not a power of 2, and is prime
86 if(Hash_table_fred[idx] != NULL){
87 moveup = Hash_table_fred[
idx];
88 while(moveup != NULL){
91 moveup = moveup->
next;
94 if(backup->
str != NULL){
101 Hash_table_fred[
idx] = NULL;
144 if(Hash_table_fred[hash_index] == NULL){
149 moveup = Hash_table_fred[hash_index];
150 while(moveup != NULL){
153 if(moveup->
str != NULL){
154 if(!strcmp(moveup->
str, str)){
160 moveup = moveup->
next;
180 str_len = strlen(str);
181 for(idx=0; idx<str_len; idx++){
185 ret = abs(accum) % 253;
198 if(new_node == NULL){
205 new_node->
next = NULL;
206 new_node->
prev = NULL;
209 if(Hash_table_fred[n] == NULL){
210 Hash_table_fred[
n] = new_node;
212 moveup = Hash_table_fred[
n];
213 while(moveup->
next != NULL){
214 moveup = moveup->
next;
216 new_node->
prev = moveup;
217 moveup->
next = new_node;
int fhash_string_exists(const char *str)
fhash_node * Hash_table_fred[HASH_TABLE_SIZE]
int fhash_get_hash_index(const char *str)
struct fhash_node fhash_node
void fhash_add_str(const char *str, int id)
void fhash_insert(const char *str, int id, int n)