comparison src/hash.h @ 394:7d59cb494b73 r21-2-12

Import from CVS: tag r21-2-12
author cvs
date Mon, 13 Aug 2007 11:11:37 +0200
parents 8626e4521993
children 74fd4e045ea6
comparison
equal deleted inserted replaced
393:2e030b8965b1 394:7d59cb494b73
48 struct hash_table * 48 struct hash_table *
49 make_general_hash_table (hash_size_t size, 49 make_general_hash_table (hash_size_t size,
50 hash_table_hash_function hash_function, 50 hash_table_hash_function hash_function,
51 hash_table_test_function test_function); 51 hash_table_test_function test_function);
52 52
53 struct hash_table *make_strings_hash_table (hash_size_t size);
54
55 /* Clear HASH-TABLE. A freshly created hash table is already cleared up. */ 53 /* Clear HASH-TABLE. A freshly created hash table is already cleared up. */
56 void clrhash (struct hash_table *hash_table); 54 void clrhash (struct hash_table *hash_table);
57 55
58 /* Free HASH-TABLE and its substructures */ 56 /* Free HASH-TABLE and its substructures */
59 void free_hash_table (struct hash_table *hash_table); 57 void free_hash_table (struct hash_table *hash_table);
71 typedef int (*maphash_function) (CONST void* key, void* contents, void* arg); 69 typedef int (*maphash_function) (CONST void* key, void* contents, void* arg);
72 70
73 typedef int (*remhash_predicate) (CONST void* key, CONST void* contents, 71 typedef int (*remhash_predicate) (CONST void* key, CONST void* contents,
74 void* arg); 72 void* arg);
75 73
76 typedef void (*generic_hash_table_op) (struct hash_table *hash_table,
77 void *arg1, void *arg2, void *arg3);
78
79 /* Call MF (key, contents, arg) for every entry in HASH-TABLE */ 74 /* Call MF (key, contents, arg) for every entry in HASH-TABLE */
80 void maphash (maphash_function mf, struct hash_table *hash_table, void* arg); 75 void maphash (maphash_function mf, struct hash_table *hash_table, void* arg);
81 76
82 /* Delete all objects from HASH-TABLE satisfying PREDICATE */ 77 /* Delete all objects from HASH-TABLE satisfying PREDICATE */
83 void map_remhash (remhash_predicate predicate, 78 void map_remhash (remhash_predicate predicate,
84 struct hash_table *hash_table, void *arg); 79 struct hash_table *hash_table, void *arg);
85 80
86 /* Copy all the entries from SRC into DEST -- DEST is modified as needed
87 so it is as big as SRC. */
88 void copy_hash (struct hash_table *dest, struct hash_table *src);
89
90 /* Make sure HASH-TABLE can hold at least NEEDED_SIZE entries */
91 void expand_hash_table (struct hash_table *hash_table, hash_size_t needed_size);
92
93 #endif /* _HASH_H_ */ 81 #endif /* _HASH_H_ */