aboutsummaryrefslogtreecommitdiff
path: root/bpt_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'bpt_test.c')
-rw-r--r--bpt_test.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/bpt_test.c b/bpt_test.c
index 9f57152..225baa0 100644
--- a/bpt_test.c
+++ b/bpt_test.c
@@ -6,13 +6,12 @@ void print_deallocation(bpt_key_t key, void *value) {
printf("Deallocated: %s\n", value);
}
+void print_mapping(bpt_key_t key, void *value, void *user_data) {
+ printf(" %d -> %s\n", key, value);
+}
+
void print_tree(bpt_t b) {
- int i;
- for (i = 0; i < 10; i++) {
- if (bpt_has_key(b, i)) {
- printf(" %d -> %s\n", i, bpt_get(b, i));
- }
- }
+ bpt_for_mappings(b, print_mapping, NULL);
}
bpt_t bpt_assoc_and_release(bpt_t bpt, bpt_key_t key, void *value) {