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. --- main.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'main.h') diff --git a/main.h b/main.h index c3e09be6..772ea648 100644 --- a/main.h +++ b/main.h @@ -1,4 +1,4 @@ -/* $Id: main.h,v 1.28 2018/08/23 19:33:27 schwarze Exp $ */ +/* $Id: main.h,v 1.29 2018/12/30 00:49:55 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2014, 2015 Ingo Schwarze @@ -16,7 +16,7 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -struct roff_man; +struct roff_meta; struct manoutput; /* @@ -27,14 +27,14 @@ struct manoutput; */ void *html_alloc(const struct manoutput *); -void html_mdoc(void *, const struct roff_man *); -void html_man(void *, const struct roff_man *); +void html_mdoc(void *, const struct roff_meta *); +void html_man(void *, const struct roff_meta *); void html_free(void *); -void tree_mdoc(void *, const struct roff_man *); -void tree_man(void *, const struct roff_man *); +void tree_mdoc(void *, const struct roff_meta *); +void tree_man(void *, const struct roff_meta *); -void man_mdoc(void *, const struct roff_man *); +void man_mdoc(void *, const struct roff_meta *); void *locale_alloc(const struct manoutput *); void *utf8_alloc(const struct manoutput *); @@ -45,8 +45,8 @@ void *pdf_alloc(const struct manoutput *); void *ps_alloc(const struct manoutput *); void pspdf_free(void *); -void terminal_mdoc(void *, const struct roff_man *); -void terminal_man(void *, const struct roff_man *); +void terminal_mdoc(void *, const struct roff_meta *); +void terminal_man(void *, const struct roff_meta *); void terminal_sepline(void *); -void markdown_mdoc(void *, const struct roff_man *); +void markdown_mdoc(void *, const struct roff_meta *); -- cgit v1.2.3