summaryrefslogtreecommitdiffstatshomepage
path: root/main.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-09-21 13:06:13 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-09-21 13:06:13 +0000
commit665ccc57084126888487f5e77562f85fdb53fdfc (patch)
tree5c479a5a1473e20d4a07695a2b0510d78d6fbb1a /main.c
parent72d7121f0c1ef16558a100baca0e14260bdbbe9a (diff)
downloadmandoc-665ccc57084126888487f5e77562f85fdb53fdfc.tar.gz
mandoc-665ccc57084126888487f5e77562f85fdb53fdfc.tar.zst
mandoc-665ccc57084126888487f5e77562f85fdb53fdfc.zip
Removed new-born out.{h,c} (not a good idea).
Removed if 0 for HTML-mode output (why not). Added option -oxxxx for passing options to output devices.
Diffstat (limited to 'main.c')
-rw-r--r--main.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/main.c b/main.c
index 9a8c7f60..523be512 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.43 2009/09/16 22:17:27 kristaps Exp $ */
+/* $Id: main.c,v 1.44 2009/09/21 13:06:13 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -58,9 +58,7 @@ enum intt {
enum outt {
OUTT_ASCII = 0,
OUTT_TREE,
-#if 1
OUTT_HTML,
-#endif
OUTT_LINT
};
@@ -86,14 +84,13 @@ struct curparse {
out_man outman;
out_free outfree;
void *outdata;
+ char *outopts;
};
-#if 1
-extern void *html_alloc(void);
+extern void *html_alloc(char *);
extern void html_mdoc(void *, const struct mdoc *);
extern void html_man(void *, const struct man *);
extern void html_free(void *);
-#endif
extern void *ascii_alloc(void);
extern void tree_mdoc(void *, const struct mdoc *);
extern void tree_man(void *, const struct man *);
@@ -134,7 +131,7 @@ main(int argc, char *argv[])
curp.outtype = OUTT_ASCII;
/* LINTED */
- while (-1 != (c = getopt(argc, argv, "f:m:VW:T:")))
+ while (-1 != (c = getopt(argc, argv, "f:m:o:T:VW:")))
switch (c) {
case ('f'):
if ( ! foptions(&curp.fflags, optarg))
@@ -144,6 +141,9 @@ main(int argc, char *argv[])
if ( ! moptions(&curp.inttype, optarg))
return(EXIT_FAILURE);
break;
+ case ('o'):
+ curp.outopts = optarg;
+ break;
case ('T'):
if ( ! toptions(&curp.outtype, optarg))
return(EXIT_FAILURE);
@@ -441,14 +441,12 @@ fdesc(struct buf *blk, struct buf *ln, struct curparse *curp)
if ( ! (curp->outman && curp->outmdoc)) {
switch (curp->outtype) {
-#if 1
case (OUTT_HTML):
- curp->outdata = html_alloc();
+ curp->outdata = html_alloc(curp->outopts);
curp->outman = html_man;
curp->outmdoc = html_mdoc;
curp->outfree = html_free;
break;
-#endif
case (OUTT_TREE):
curp->outman = tree_man;
curp->outmdoc = tree_mdoc;
@@ -563,10 +561,8 @@ toptions(enum outt *tflags, char *arg)
*tflags = OUTT_LINT;
else if (0 == strcmp(arg, "tree"))
*tflags = OUTT_TREE;
-#if 1
else if (0 == strcmp(arg, "html"))
*tflags = OUTT_HTML;
-#endif
else {
warnx("bad argument: -T%s", arg);
return(0);