X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fhash.h;h=ffacad8e19b8a8b47bcb17b4b254674c6b5a4c76;hb=e23e34e76e7e63fdfddf8a7dd22b963cd9e48cc1;hp=2b1ef1ad7c284c5bd94fd04bd919554ce55d721b;hpb=b18e1b9c95a478d434e9fcef9d8579d0b96b9a8d;p=pspp-builds.git diff --git a/src/hash.h b/src/hash.h index 2b1ef1ad..ffacad8e 100644 --- a/src/hash.h +++ b/src/hash.h @@ -14,17 +14,17 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. */ #if !hash_h #define hash_h 1 #include -typedef int hsh_compare_func (const void *, const void *, void *param); -typedef unsigned hsh_hash_func (const void *, void *param); -typedef void hsh_free_func (void *, void *param); +typedef int hsh_compare_func (const void *, const void *, void *aux); +typedef unsigned hsh_hash_func (const void *, void *aux); +typedef void hsh_free_func (void *, void *aux); /* Hash table iterator (opaque). */ struct hsh_iterator @@ -32,21 +32,28 @@ struct hsh_iterator size_t next; /* Index of next entry. */ }; -/* Prime numbers and hash functions. */ +/* Hash functions. */ unsigned hsh_hash_bytes (const void *, size_t); unsigned hsh_hash_string (const char *); +unsigned hsh_hash_case_string (const char *); unsigned hsh_hash_int (int); +unsigned hsh_hash_double (double); /* Hash tables. */ struct hsh_table *hsh_create (int m, hsh_compare_func *, hsh_hash_func *, hsh_free_func *, - void *param); + void *aux); void hsh_clear (struct hsh_table *); void hsh_destroy (struct hsh_table *); void **hsh_sort (struct hsh_table *); +void **hsh_data (struct hsh_table *); +void **hsh_sort_copy (struct hsh_table *); +void **hsh_data_copy (struct hsh_table *); /* Search and insertion. */ void **hsh_probe (struct hsh_table *, const void *); +void *hsh_insert (struct hsh_table *, void *); +void *hsh_replace (struct hsh_table *, void *); void *hsh_find (struct hsh_table *, const void *); int hsh_delete (struct hsh_table *, const void *);