summaryrefslogtreecommitdiff
path: root/include/hashtab.h
diff options
context:
space:
mode:
authorZack Weinberg <zack@bitmover.com>1999-10-23 15:56:52 +0000
committerZack Weinberg <zack@gcc.gnu.org>1999-10-23 15:56:52 +0000
commited38f5d5d8fdaf1c37e4242b203bb0c94191427c (patch)
tree3ad8d02ae08a5e2403f87cba3849031590ae8f60 /include/hashtab.h
parent5e481b31ee1b68793b8c9b57ed1b946115584241 (diff)
downloadgcc-ed38f5d5d8fdaf1c37e4242b203bb0c94191427c.tar.gz
hashtab.c (find_hash_table_entry): When returning a DELETED_ENTRY slot, change it to EMPTY_ENTRY first.
1999-10-23 08:51 -0700 Zack Weinberg <zack@bitmover.com> * hashtab.c (find_hash_table_entry): When returning a DELETED_ENTRY slot, change it to EMPTY_ENTRY first. (clear_hash_table_slot): New function which deletes an entry by its position in the table, not its value. (traverse_hash_table): New function which calls a hook function for every live entry in the table. * hashtab.h: Give hash_table_t a struct tag. Add prototypes for clear_hash_table_slot and traverse_hash_table. Correct prototype of all_hash_table_collisions. From-SVN: r30138
Diffstat (limited to 'include/hashtab.h')
-rw-r--r--include/hashtab.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/hashtab.h b/include/hashtab.h
index 67c37a284f7..3990c14cbca 100644
--- a/include/hashtab.h
+++ b/include/hashtab.h
@@ -47,7 +47,7 @@ typedef const void *hash_table_entry_t;
tables. All work with hash table should be executed only through
functions mentioned below. */
-typedef struct
+typedef struct hash_table
{
/* Current size (in entries) of the hash table */
size_t size;
@@ -88,13 +88,19 @@ extern hash_table_entry_t *find_hash_table_entry
extern void remove_element_from_hash_table_entry PARAMS ((hash_table_t,
hash_table_entry_t));
+extern void clear_hash_table_slot PARAMS ((hash_table_t, hash_table_entry_t *));
+
+extern void traverse_hash_table PARAMS ((hash_table_t,
+ int (*) (hash_table_entry_t, void *),
+ void *));
+
extern size_t hash_table_size PARAMS ((hash_table_t));
extern size_t hash_table_elements_number PARAMS ((hash_table_t));
extern int hash_table_collisions PARAMS ((hash_table_t));
-extern int all_hash_table_collisions ();
+extern int all_hash_table_collisions PARAMS ((void));
#ifdef __cplusplus
}