aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBernd Schmidt <bernds@cygnus.co.uk>2000-03-14 18:28:45 +0000
committerBernd Schmidt <crux@gcc.gnu.org>2000-03-14 18:28:45 +0000
commit8c5d513f178482ba8bc655d2b5f42ac1bf7036a4 (patch)
tree60489c4e417b408a51b10fe79aaf66b0b4796d7b /include
parent3ac63d94884330d66adb4448f557bf06460b4293 (diff)
downloadgcc-8c5d513f178482ba8bc655d2b5f42ac1bf7036a4.zip
gcc-8c5d513f178482ba8bc655d2b5f42ac1bf7036a4.tar.gz
gcc-8c5d513f178482ba8bc655d2b5f42ac1bf7036a4.tar.bz2
Some cleanups/additions for hashtables
From-SVN: r32536
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog7
-rw-r--r--include/hashtab.h16
2 files changed, 19 insertions, 4 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index be7061c..e36ba70 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,10 @@
+2000-03-14 Bernd Schmidt <bernds@cygnus.co.uk>
+
+ * hashtab.h (htab_trav): Modify type so that first arg is of type
+ void **.
+ (htab_find_with_hash, htab_find_slot_with_hash): Declare new
+ functions.
+
2000-03-09 Alex Samuel <samuel@codesourcery.com>
* partition.h: New file.
diff --git a/include/hashtab.h b/include/hashtab.h
index e6e38e4..5fe2393 100644
--- a/include/hashtab.h
+++ b/include/hashtab.h
@@ -44,7 +44,10 @@ extern "C" {
typedef unsigned int (*htab_hash) PARAMS ((const void *));
/* Compare a table entry with a possible entry. The entry already in
- the table always comes first. */
+ the table always comes first, so the second element can be of a
+ different type (but in this case htab_find and htab_find_slot
+ cannot be used; instead the variants that accept a hash value
+ must be used). */
typedef int (*htab_eq) PARAMS ((const void *, const void *));
/* Cleanup function called whenever a live element is removed from
@@ -52,9 +55,10 @@ typedef int (*htab_eq) PARAMS ((const void *, const void *));
typedef void (*htab_del) PARAMS ((void *));
/* Function called by htab_traverse for each live element. The first
- arg is the element, the second arg is the auxiliary pointer handed
- to htab_traverse. Return 1 to continue scan, 0 to stop. */
-typedef int (*htab_trav) PARAMS ((void *, void *));
+ arg is the slot of the element (which can be passed to htab_clear_slot
+ if desired), the second arg is the auxiliary pointer handed to
+ htab_traverse. Return 1 to continue scan, 0 to stop. */
+typedef int (*htab_trav) PARAMS ((void **, void *));
/* Hash tables are of the following type. The structure
(implementation) of this type is not needed for using the hash
@@ -104,6 +108,10 @@ extern void htab_empty PARAMS ((htab_t));
extern void *htab_find PARAMS ((htab_t, const void *));
extern void **htab_find_slot PARAMS ((htab_t, const void *, int));
+extern void *htab_find_with_hash PARAMS ((htab_t, const void *,
+ unsigned int));
+extern void **htab_find_slot_with_hash PARAMS ((htab_t, const void *,
+ unsigned int, int));
extern void htab_clear_slot PARAMS ((htab_t, void **));
extern void htab_remove_elt PARAMS ((htab_t, void *));