summaryrefslogtreecommitdiffstats
path: root/mdoc_man.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-10-06 22:29:12 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-10-06 22:29:12 +0000
commit2835b2c808e87f26f06bd8ec3a2c581923777902 (patch)
tree4ecad31be3626da3f4f731014abab81403337a9a /mdoc_man.c
parent6f9df825574a6b5616f7b42b6687a5b608cc8717 (diff)
downloadmandoc-2835b2c808e87f26f06bd8ec3a2c581923777902.tar.gz
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.
Diffstat (limited to 'mdoc_man.c')
-rw-r--r--mdoc_man.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/mdoc_man.c b/mdoc_man.c
index 4f67753c..b025f563 100644
--- a/mdoc_man.c
+++ b/mdoc_man.c
@@ -18,6 +18,7 @@
#include <string.h>
#include "mandoc.h"
+#include "man.h"
#include "mdoc.h"
#include "main.h"
@@ -219,6 +220,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)
{
const struct mdoc_meta *m;