diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-06-07 20:57:09 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-06-07 20:57:09 +0000 |
commit | 7506d04e28e759651e3b7cf0f671282cfb8ab4fd (patch) | |
tree | dcc0c1b0d2b0b05ca3f50a2766c7e15cd07d3718 /main.c | |
parent | 1ce42efc4cb4b55e9e64a347176288d71b9d5cc5 (diff) | |
download | mandoc-7506d04e28e759651e3b7cf0f671282cfb8ab4fd.tar.gz |
First check-in of PostScript output. This does not change any logic
within term.c, but does add a small shim over putchar() that switches on
the output engine. Prints, for this initial version, only monospace and
without font decorations. It's a start.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 32 |
1 files changed, 24 insertions, 8 deletions
@@ -65,7 +65,8 @@ enum outt { OUTT_TREE, OUTT_HTML, OUTT_XHTML, - OUTT_LINT + OUTT_LINT, + OUTT_PS }; struct curparse { @@ -584,12 +585,24 @@ 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); + break; + case (OUTT_PS): + curp->outdata = ps_alloc(); + 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; @@ -598,14 +611,15 @@ 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; } } @@ -729,6 +743,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); |