diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2012-01-21 10:29:24 +0100 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2012-01-21 10:29:24 +0100 |
commit | 13fd2c5e21425e27411299081d5b4102f5855179 (patch) | |
tree | a7c9f10b52aa1bb8f364a8eb14a7b6383fbf5ffa /bpt_test.c | |
parent | d4b7b491099cc9633422dad6687a94392faeece1 (diff) |
Add public function bpt_for_mappings.
Diffstat (limited to 'bpt_test.c')
-rw-r--r-- | bpt_test.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -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) { |