From 68183e3516ca405d803db497157cd8246b9b8bad Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 30 Dec 2018 00:49:54 +0000 Subject: Cleanup, no functional change: The struct roff_man used to be a bad mixture of internal parser state and public parsing results. Move the public results to the parsing result struct roff_meta, which is already public. Move the rest of struct roff_man to the parser-internal header roff_int.h. Since the validators need access to the parser state, call them from the top level parser during mparse_result() rather than from the main programs, also reducing code duplication. This keeps parser internal state out of thee main programs (five in mandoc portable) and out of eight formatters. --- tree.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tree.c') diff --git a/tree.c b/tree.c index 67358243..7888b40f 100644 --- a/tree.c +++ b/tree.c @@ -1,4 +1,4 @@ -/* $Id: tree.c,v 1.82 2018/12/13 05:23:38 schwarze Exp $ */ +/* $Id: tree.c,v 1.83 2018/12/30 00:49:56 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2011, 2014 Kristaps Dzonsons * Copyright (c) 2013,2014,2015,2017,2018 Ingo Schwarze @@ -41,18 +41,18 @@ static void print_span(const struct tbl_span *, int); void -tree_mdoc(void *arg, const struct roff_man *mdoc) +tree_mdoc(void *arg, const struct roff_meta *mdoc) { - print_meta(&mdoc->meta); + print_meta(mdoc); putchar('\n'); print_mdoc(mdoc->first->child, 0); } void -tree_man(void *arg, const struct roff_man *man) +tree_man(void *arg, const struct roff_meta *man) { - print_meta(&man->meta); - if (man->meta.hasbody == 0) + print_meta(man); + if (man->hasbody == 0) puts("body = empty"); putchar('\n'); print_man(man->first->child, 0); -- cgit v1.2.3