diff --git a/src/interpret.c b/src/interpret.c index 43fad93..17880cf 100644 --- a/src/interpret.c +++ b/src/interpret.c @@ -116,6 +116,9 @@ struct page { #define TREE_KEY union date32 #define TREE_VALUE struct page #define TREE_COMPARE &date_mixup +#define TREE_EXPECT_TRAIT +#include "tree.h" +#define TREE_TO_STRING &entry_to_string #include "tree.h" static void entry_to_string(const struct page_tree_entry_c entry, char (*const z)[12]) { date32_to_string(*entry.key, z); } @@ -249,6 +252,7 @@ int main(int argc, char **argv) { break; /* fixme */ } page_tree_bulk_finish(&journal); + printf("Journal has entries: %s\n", page_tree_to_string(&journal)); goto finally; catch: success = EXIT_FAILURE; @@ -268,12 +272,5 @@ finally: lex_array_(&page->lexx); char_array_(&page->entry); } - /* Got up to creating a page, but didn't add to the journal. */ - /*if(page) { lex_array_(&page->lexx); char_array(&page->entry); } - { - struct page *page; - while(page = page_array_pop(&journal)) - lex_array_(&page->lexx), char_array_(&page->entry); - } memory leak! */ return success; }