From ed38f5d5d8fdaf1c37e4242b203bb0c94191427c Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Sat, 23 Oct 1999 15:56:52 +0000 Subject: 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 * 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 --- include/hashtab.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include/hashtab.h') 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 } -- cgit v1.2.1