OSDN Git Service

* lib/target-libpath.exp (restore_ld_library_path_env_vars):
[pf3gnuchains/gcc-fork.git] / include / hashtab.h
index 7acb5eb..de24ded 100644 (file)
@@ -1,5 +1,5 @@
 /* An expandable hash tables datatype.  
-   Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
    Contributed by Vladimir Makarov (vmakarov@cygnus.com).
 
 This program is free software; you can redistribute it and/or modify
@@ -99,15 +99,15 @@ struct htab GTY(())
   htab_del del_f;
 
   /* Table itself.  */
-  PTR * GTY ((use_param (""), length ("%h.size"))) entries;
+  PTR * GTY ((use_param, length ("%h.size"))) entries;
 
-  /* Current size (in entries) of the hash table */
+  /* Current size (in entries) of the hash table */
   size_t size;
 
-  /* Current number of elements including also deleted elements */
+  /* Current number of elements including also deleted elements */
   size_t n_elements;
 
-  /* Current number of deleted elements in the table */
+  /* Current number of deleted elements in the table */
   size_t n_deleted;
 
   /* The following member is used for debugging. Its value is number
@@ -123,9 +123,13 @@ struct htab GTY(())
   htab_free free_f;
 
   /* Alternate allocate/free functions, which take an extra argument.  */
-  PTR GTY((skip (""))) alloc_arg;
+  PTR GTY((skip)) alloc_arg;
   htab_alloc_with_arg alloc_with_arg_f;
   htab_free_with_arg free_with_arg_f;
+
+  /* Current size (in entries) of the hash table, as an index into the
+     table of primes.  */
+  unsigned int size_prime_index;
 };
 
 typedef struct htab *htab_t;
@@ -166,6 +170,7 @@ extern PTR     *htab_find_slot_with_hash  PARAMS ((htab_t, const void *,
                                                   enum insert_option));
 extern void    htab_clear_slot PARAMS ((htab_t, void **));
 extern void    htab_remove_elt PARAMS ((htab_t, void *));
+extern void    htab_remove_elt_with_hash PARAMS ((htab_t, void *, hashval_t));
 
 extern void    htab_traverse   PARAMS ((htab_t, htab_trav, void *));
 extern void    htab_traverse_noresize  PARAMS ((htab_t, htab_trav, void *));
@@ -183,6 +188,11 @@ extern htab_eq htab_eq_pointer;
 /* A hash function for null-terminated strings.  */
 extern hashval_t htab_hash_string PARAMS ((const PTR));
 
+/* An iterative hash function for arbitrary data.  */
+extern hashval_t iterative_hash PARAMS ((const PTR, size_t, hashval_t));
+/* Shorthand for hashing something with an intrinsic size.  */
+#define iterative_hash_object(OB,INIT) iterative_hash (&OB, sizeof (OB), INIT)
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */