comparison src/hash.h @ 647:b39c14581166

[xemacs-hg @ 2001-08-13 04:45:47 by ben] removal of unsigned, size_t, etc.
author ben
date Mon, 13 Aug 2001 04:46:48 +0000
parents abe6d1db359e
children fdefd0186b75
comparison
equal deleted inserted replaced
646:00c54252fe4f 647:b39c14581166
25 const void *key; 25 const void *key;
26 void *contents; 26 void *contents;
27 } hentry; 27 } hentry;
28 28
29 typedef int (*hash_table_test_function) (const void *, const void *); 29 typedef int (*hash_table_test_function) (const void *, const void *);
30 typedef unsigned long (*hash_table_hash_function) (const void *); 30 typedef Hash_Code (*hash_table_hash_function) (const void *);
31 typedef size_t hash_size_t;
32 31
33 struct hash_table 32 struct hash_table
34 { 33 {
35 hentry *harray; 34 hentry *harray;
36 long zero_set; 35 long zero_set;
37 void *zero_entry; 36 void *zero_entry;
38 hash_size_t size; /* size of the hasharray */ 37 Element_Count size; /* size of the hasharray */
39 hash_size_t fullness; /* number of entries in the hash table */ 38 Element_Count fullness; /* number of entries in the hash table */
40 hash_table_hash_function hash_function; 39 hash_table_hash_function hash_function;
41 hash_table_test_function test_function; 40 hash_table_test_function test_function;
42 }; 41 };
43 42
44 /* SIZE is the number of initial entries. The hash table will be grown 43 /* SIZE is the number of initial entries. The hash table will be grown
45 automatically if the number of entries approaches the size */ 44 automatically if the number of entries approaches the size */
46 struct hash_table *make_hash_table (hash_size_t size); 45 struct hash_table *make_hash_table (Element_Count size);
47 46
48 struct hash_table * 47 struct hash_table *
49 make_general_hash_table (hash_size_t size, 48 make_general_hash_table (Element_Count size,
50 hash_table_hash_function hash_function, 49 hash_table_hash_function hash_function,
51 hash_table_test_function test_function); 50 hash_table_test_function test_function);
52 51
53 /* Clear HASH-TABLE. A freshly created hash table is already cleared up. */ 52 /* Clear HASH-TABLE. A freshly created hash table is already cleared up. */
54 void clrhash (struct hash_table *hash_table); 53 void clrhash (struct hash_table *hash_table);
55 54
56 /* Free HASH-TABLE and its substructures */ 55 /* Free HASH-TABLE and its substructures */