summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorcrux <crux@138bc75d-0d04-0410-961f-82ee72b054a4>2000-03-14 18:28:45 +0000
committercrux <crux@138bc75d-0d04-0410-961f-82ee72b054a4>2000-03-14 18:28:45 +0000
commited26da85e5631cfea3739226f8c0fbfd9ec2e5c8 (patch)
tree60489c4e417b408a51b10fe79aaf66b0b4796d7b /include
parentd4ea3b1f6e99759a511e8a94f3f4200e30eb82cf (diff)
downloadppe42-gcc-ed26da85e5631cfea3739226f8c0fbfd9ec2e5c8.tar.gz
ppe42-gcc-ed26da85e5631cfea3739226f8c0fbfd9ec2e5c8.zip
Some cleanups/additions for hashtables
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32536 138bc75d-0d04-0410-961f-82ee72b054a4
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 be7061c6394..e36ba7070a3 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 e6e38e4d058..5fe239391ff 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 *));
OpenPOWER on IntegriCloud