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. --- mandoc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mandoc.c') diff --git a/mandoc.c b/mandoc.c index d1e7356b..fb9395a5 100644 --- a/mandoc.c +++ b/mandoc.c @@ -1,4 +1,4 @@ -/* $Id: mandoc.c,v 1.113 2018/12/18 22:00:02 schwarze Exp $ */ +/* $Id: mandoc.c,v 1.114 2018/12/30 00:49:55 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2011-2015, 2017, 2018 Ingo Schwarze @@ -32,6 +32,7 @@ #include "mandoc.h" #include "roff.h" #include "libmandoc.h" +#include "roff_int.h" static int a2time(time_t *, const char *, const char *); static char *time2a(time_t); @@ -563,7 +564,7 @@ mandoc_normdate(struct roff_man *man, char *in, int ln, int pos) mandoc_msg(MANDOCERR_DATE_BAD, ln, pos, "%s", in); else if (t > time(NULL) + 86400) mandoc_msg(MANDOCERR_DATE_FUTURE, ln, pos, "%s", in); - else if (man->macroset == MACROSET_MDOC) + else if (man->meta.macroset == MACROSET_MDOC) mandoc_msg(MANDOCERR_DATE_LEGACY, ln, pos, "Dd %s", in); /* Use any non-mdoc(7) date verbatim. */ -- cgit v1.2.3-56-ge451