=================================================================== RCS file: /cvs/mandoc/main.c,v retrieving revision 1.10 retrieving revision 1.13 diff -u -p -r1.10 -r1.13 --- mandoc/main.c 2009/03/23 14:22:11 1.10 +++ mandoc/main.c 2009/03/23 21:20:24 1.13 @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.10 2009/03/23 14:22:11 kristaps Exp $ */ +/* $Id: main.c,v 1.13 2009/03/23 21:20:24 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -34,7 +34,7 @@ extern int getsubopt(char **, char * const *, char # ifndef __dead # define __dead __attribute__((__noreturn__)) # endif -#elif defined(__FreeBSD__) +#elif defined(__dead2) # ifndef __dead # define __dead __dead2 # endif @@ -67,7 +67,8 @@ enum outt { OUTT_LINT }; -typedef int (*out_run)(void *, const struct mdoc *); +typedef int (*out_run)(void *, const struct man *, + const struct mdoc *); typedef void (*out_free)(void *); extern char *__progname; @@ -75,8 +76,10 @@ extern char *__progname; extern void *ascii_alloc(void); extern void *latin1_alloc(void); extern void *utf8_alloc(void); -extern int terminal_run(void *, const struct mdoc *); -extern int tree_run(void *, const struct mdoc *); +extern int terminal_run(void *, const struct man *, + const struct mdoc *); +extern int tree_run(void *, const struct man *, + const struct mdoc *); extern void terminal_free(void *); static int foptions(int *, char *); @@ -219,20 +222,16 @@ main(int argc, char *argv[]) if (c && NULL == outrun) rc = 1; -#if 0 - else if (c && outrun && (*outrun)(outdata, mdoc)) + else if (c && outrun && (*outrun)(outdata, man, mdoc)) rc = 1; -#endif } else { while (*argv) { curp.file = *argv; c = file(&blk, &ln, *argv, man, mdoc); if ( ! c) break; -#if 0 - if (outrun && ! (*outrun)(outdata, mdoc)) + if (outrun && ! (*outrun)(outdata, man, mdoc)) break; -#endif if (man) man_reset(man); if (mdoc) @@ -272,7 +271,9 @@ __dead static void usage(void) { - (void)fprintf(stderr, "usage: %s\n", __progname); + (void)fprintf(stderr, "usage: %s [-V] [-foption...] " + "[-mformat] [-Toutput] [-Werr...]\n", + __progname); exit(1); /* NOTREACHED */ }