From 04d794422a19264dc0a985a9b145b3748fc69862 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Thu, 6 Oct 2011 22:29:12 +0000 Subject: If -Tman is specified and input is -man, echo the preprocessed (`so' replaced by file) input. This replaces earlier behaviour of doing nothing, which I found unexpected (mandoc should always output). This requires a buffer in read.c that saves the input lines before being parsed, with a special hook if `so' is invoked. This buffer is just flushed to output if -mman is the input. While mucking around doing this, I also alpha-ordered the mandoc.h functions. Ok schwarze@, with no screaming when the polished patch was published. --- man.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'man.c') diff --git a/man.c b/man.c index 52592d4a..17e002b4 100644 --- a/man.c +++ b/man.c @@ -1,4 +1,4 @@ -/* $Id: man.c,v 1.111 2011/07/28 14:17:11 kristaps Exp $ */ +/* $Id: man.c,v 1.112 2011/10/06 22:29:12 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * @@ -648,3 +648,11 @@ man_node_unlink(struct man *m, struct man_node *n) if (m && m->first == n) m->first = NULL; } + +const struct mparse * +man_mparse(const struct man *m) +{ + + assert(m && m->parse); + return(m->parse); +} -- cgit v1.2.3