aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/main.c b/main.c
index b6a13f6e..949cddca 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.84 2010/06/07 10:52:44 kristaps Exp $ */
+/* $Id: main.c,v 1.85 2010/06/07 20:57:09 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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);