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. --- mdoc_man.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'mdoc_man.c') diff --git a/mdoc_man.c b/mdoc_man.c index 99485507..c6849b1f 100644 --- a/mdoc_man.c +++ b/mdoc_man.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_man.c,v 1.3 2011/09/30 00:13:28 schwarze Exp $ */ +/* $Id: mdoc_man.c,v 1.4 2011/10/06 22:29:12 kristaps Exp $ */ /* * Copyright (c) 2011 Ingo Schwarze * @@ -18,6 +18,7 @@ #include #include "mandoc.h" +#include "man.h" #include "mdoc.h" #include "main.h" @@ -218,6 +219,13 @@ print_word(const char *s) } } +void +man_man(void *arg, const struct man *man) +{ + + fputs(mparse_getkeep(man_mparse(man)), stdout); +} + void man_mdoc(void *arg, const struct mdoc *mdoc) { -- cgit v1.2.3