| 40 | ph_gen(static, heap_, heap_t, node_t, link, node_cmp_magic); |
| 41 | |
| 42 | static void |
| 43 | node_print(const node_t *node, unsigned depth) { |
| 44 | unsigned i; |
| 45 | node_t *leftmost_child, *sibling; |
| 46 | |
| 47 | for (i = 0; i < depth; i++) { |
| 48 | malloc_printf("\t"); |
| 49 | } |
| 50 | malloc_printf("%2"FMTu64"\n", node->key); |
| 51 | |
| 52 | leftmost_child = phn_lchild_get(node_t, link, node); |
| 53 | if (leftmost_child == NULL) { |
| 54 | return; |
| 55 | } |
| 56 | node_print(leftmost_child, depth + 1); |
| 57 | |
| 58 | for (sibling = phn_next_get(node_t, link, leftmost_child); sibling != |
| 59 | NULL; sibling = phn_next_get(node_t, link, sibling)) { |
| 60 | node_print(sibling, depth + 1); |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | static void |
| 65 | heap_print(const heap_t *heap) { |
no test coverage detected