return 0;
}
+void hash_dump(struct hash *hash)
+{
+ unsigned int i _unused_;
+
+ fprintf(stderr, "#####\n");
+ fprintf(stderr, "%p %d %u\n", hash, hash->count, hash->n_buckets);
+ fprintf(stderr, "#####\n");
+ for (i = 0; i < hash->n_buckets; i++) {
+ struct hash_bucket *bucket = hash->buckets + i;
+ fprintf(stderr, "%u %d\n", i, bucket->used);
+ }
+ fprintf(stderr, "#####\n");
+ hash_dump_keys(hash);
+ fprintf(stderr, "#####\n");
+}
+
+void hash_dump_keys(struct hash *hash)
+{
+ unsigned int i;
+
+ for (i = 0; i < hash->n_buckets; i++) {
+ struct hash_bucket *bucket = hash->buckets + i;
+ struct hash_entry *entry, *entry_end;
+
+ entry = bucket->entries;
+ entry_end = entry + bucket->used;
+ for (; entry < entry_end; entry++)
+ fprintf(stderr, "%s\n", entry->key);
+ }
+}
+
/* similar to hash_add(), but fails if key already exists */
int hash_add_unique(struct hash *hash, const char *key, const void *value)
{
void hash_iter_init(const struct hash *hash, struct hash_iter *iter);
bool hash_iter_next(struct hash_iter *iter, const char **key,
const void **value);
+
+void hash_dump(struct hash *hash);
+void hash_dump_keys(struct hash *hash);
{
size_t i;
+ hash_dump(depmod->symbols);
+ hash_dump(depmod->modules_by_name);
+ hash_dump(depmod->modules_by_uncrelpath);
+
hash_free(depmod->symbols);
hash_free(depmod->modules_by_uncrelpath);