free(entry);
} else if (!strcmp("get", cmd) && p1) {
-
/* lookup entry in hashmap */
- entry = hashmap_get_from_hash(&map, hash, p1);
+ entry = hashmap_get_entry_from_hash(&map, hash, p1,
+ struct test_entry, ent);
/* print result */
if (!entry)
puts("NULL");
- while (entry) {
+ hashmap_for_each_entry_from(&map, entry,
+ struct test_entry, ent) {
puts(get_value(entry));
- entry = hashmap_get_next(&map, &entry->ent);
}
} else if (!strcmp("remove", cmd) && p1) {