Lines Matching refs:table

54   struct hash_entry **table;  member
119 ret->table = obstack_alloc (&ret->memory, alloc); in hash_new()
120 memset (ret->table, 0, alloc); in hash_new()
138 hash_die (struct hash_control *table) in hash_die() argument
140 obstack_free (&table->memory, 0); in hash_die()
141 free (table); in hash_die()
154 hash_lookup (struct hash_control *table, const char *key, size_t len, in hash_lookup() argument
166 ++table->lookups; in hash_lookup()
182 index = hash % table->size; in hash_lookup()
183 list = table->table + index; in hash_lookup()
192 ++table->hash_compares; in hash_lookup()
198 ++table->string_compares; in hash_lookup()
226 hash_insert (struct hash_control *table, const char *key, PTR value) in hash_insert() argument
232 p = hash_lookup (table, key, strlen (key), &list, &hash); in hash_insert()
237 ++table->insertions; in hash_insert()
240 p = (struct hash_entry *) obstack_alloc (&table->memory, sizeof (*p)); in hash_insert()
256 hash_jam (struct hash_control *table, const char *key, PTR value) in hash_jam() argument
262 p = hash_lookup (table, key, strlen (key), &list, &hash); in hash_jam()
266 ++table->replacements; in hash_jam()
274 ++table->insertions; in hash_jam()
277 p = (struct hash_entry *) obstack_alloc (&table->memory, sizeof (*p)); in hash_jam()
294 hash_replace (struct hash_control *table, const char *key, PTR value) in hash_replace() argument
299 p = hash_lookup (table, key, strlen (key), NULL, NULL); in hash_replace()
304 ++table->replacements; in hash_replace()
318 hash_find (struct hash_control *table, const char *key) in hash_find() argument
322 p = hash_lookup (table, key, strlen (key), NULL, NULL); in hash_find()
333 hash_find_n (struct hash_control *table, const char *key, size_t len) in hash_find_n() argument
337 p = hash_lookup (table, key, len, NULL, NULL); in hash_find_n()
348 hash_delete (struct hash_control *table, const char *key) in hash_delete() argument
353 p = hash_lookup (table, key, strlen (key), &list, NULL); in hash_delete()
361 ++table->deletions; in hash_delete()
377 hash_traverse (struct hash_control *table, in hash_traverse() argument
382 for (i = 0; i < table->size; ++i) in hash_traverse()
386 for (p = table->table[i]; p != NULL; p = p->next) in hash_traverse()
397 struct hash_control *table ATTRIBUTE_UNUSED) in hash_print_statistics()
405 fprintf (f, "\t%lu lookups\n", table->lookups); in hash_print_statistics()
406 fprintf (f, "\t%lu hash comparisons\n", table->hash_compares); in hash_print_statistics()
407 fprintf (f, "\t%lu string comparisons\n", table->string_compares); in hash_print_statistics()
408 fprintf (f, "\t%lu insertions\n", table->insertions); in hash_print_statistics()
409 fprintf (f, "\t%lu replacements\n", table->replacements); in hash_print_statistics()
410 fprintf (f, "\t%lu deletions\n", table->deletions); in hash_print_statistics()
414 for (i = 0; i < table->size; ++i) in hash_print_statistics()
418 if (table->table[i] == NULL) in hash_print_statistics()
422 for (p = table->table[i]; p != NULL; p = p->next) in hash_print_statistics()
427 fprintf (f, "\t%g average chain length\n", (double) total / table->size); in hash_print_statistics()