From 1e728c2455fdc696e260f87d0d523a3de6d43a00 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 7 Jun 2023 15:54:59 +0200 Subject: Parenting is still needed I was certainly dumb. This reverts commit ec2be68120e48c75b0acd2bdfb5cc8d931c70cfd. --- src/map.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/map.c') diff --git a/src/map.c b/src/map.c index e37217d..c36354d 100644 --- a/src/map.c +++ b/src/map.c @@ -7,7 +7,6 @@ #include #include #include -#include static struct hashmap *all_terms; @@ -61,7 +60,16 @@ void map_dump(struct hashmap *map) struct term *term = *(struct term **)iter_val; fprintf(stderr, "%d\t%ld\t", term->type, term->refs); term_print(term); - fprintf(stderr, "\n"); + fprintf(stderr, "\t{"); + + size_t jiter = 0; + void *jiter_val; + while (hashmap_iter(term->parents, &jiter, &jiter_val)) { + struct term *parent = *(struct term **)jiter_val; + term_print(parent); + fprintf(stderr, ", "); + } + fprintf(stderr, "}\n"); } fprintf(stderr, "---\n\n"); } -- cgit v1.2.3