summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/main.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2010-06-10 22:50:11 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2010-06-10 22:50:11 +0000
commitc1243dd3d425f1ed2e443ef64c366b6257899b39 (patch)
tree34680ff8ebd5a852446d0bd685577e2be50aba6d /usr.bin/mandoc/main.c
parentb075642d3aba8bbab0d253676dac4429a2db1be1 (diff)
minimal initial -Tps support, from kristaps@ GSOC
so far, monospace without font decoration, but it already has page headers and footers
Diffstat (limited to 'usr.bin/mandoc/main.c')
-rw-r--r--usr.bin/mandoc/main.c37
1 files changed, 27 insertions, 10 deletions
diff --git a/usr.bin/mandoc/main.c b/usr.bin/mandoc/main.c
index 37c0df0fec2..91566c31aa3 100644
--- a/usr.bin/mandoc/main.c
+++ b/usr.bin/mandoc/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.35 2010/06/08 00:11:47 schwarze Exp $ */
+/* $Id: main.c,v 1.36 2010/06/10 22:50:10 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -54,7 +54,8 @@ enum outt {
OUTT_TREE,
OUTT_HTML,
OUTT_XHTML,
- OUTT_LINT
+ OUTT_LINT,
+ OUTT_PS
};
struct curparse {
@@ -573,12 +574,26 @@ fdesc(struct curparse *curp)
switch (curp->outtype) {
case (OUTT_XHTML):
curp->outdata = xhtml_alloc(curp->outopts);
- curp->outman = html_man;
- curp->outmdoc = html_mdoc;
- curp->outfree = html_free;
break;
case (OUTT_HTML):
curp->outdata = html_alloc(curp->outopts);
+ break;
+ case (OUTT_ASCII):
+ curp->outdata = ascii_alloc(curp->outopts);
+ curp->outfree = ascii_free;
+ break;
+ case (OUTT_PS):
+ curp->outdata = ps_alloc();
+ curp->outfree = ps_free;
+ break;
+ default:
+ break;
+ }
+
+ switch (curp->outtype) {
+ case (OUTT_HTML):
+ /* FALLTHROUGH */
+ case (OUTT_XHTML):
curp->outman = html_man;
curp->outmdoc = html_mdoc;
curp->outfree = html_free;
@@ -587,13 +602,13 @@ fdesc(struct curparse *curp)
curp->outman = tree_man;
curp->outmdoc = tree_mdoc;
break;
- case (OUTT_LINT):
- break;
- default:
- curp->outdata = ascii_alloc(curp->outopts);
+ case (OUTT_ASCII):
+ /* FALLTHROUGH */
+ case (OUTT_PS):
curp->outman = terminal_man;
curp->outmdoc = terminal_mdoc;
- curp->outfree = terminal_free;
+ break;
+ default:
break;
}
}
@@ -718,6 +733,8 @@ toptions(struct curparse *curp, char *arg)
curp->outtype = OUTT_HTML;
else if (0 == strcmp(arg, "xhtml"))
curp->outtype = OUTT_XHTML;
+ else if (0 == strcmp(arg, "ps"))
+ curp->outtype = OUTT_PS;
else {
fprintf(stderr, "%s: Bad argument\n", arg);
return(0);