- (void)fprintf(stderr, "usage: %s [-V] [-foption...] "
- "[-mformat] [-Toutput] [-Werr...]\n",
- __progname);
- exit(EXIT_FAILURE);
-}
-
-
-static struct man *
-man_init(struct curparse *curp)
-{
- int pflags;
- struct man *man;
- struct man_cb mancb;
-
- mancb.man_err = merr;
- mancb.man_warn = manwarn;
-
- /*
- * Default behaviour is to ignore unknown macros. This is
- * specified in mandoc.1.
- */
-
- pflags = MAN_IGN_MACRO;
-
- /* Override default behaviour... */
-
- if (curp->fflags & NO_IGN_MACRO)
- pflags &= ~MAN_IGN_MACRO;
-
- if (NULL == (man = man_alloc(curp, pflags, &mancb)))
- warnx("memory exhausted");
-
- return(man);
-}
-
-
-static struct mdoc *
-mdoc_init(struct curparse *curp)
-{
- int pflags;
- struct mdoc *mdoc;
- struct mdoc_cb mdoccb;
-
- mdoccb.mdoc_msg = NULL;
- mdoccb.mdoc_err = merr;
- mdoccb.mdoc_warn = mdocwarn;
-
- /*
- * Default behaviour is to ignore unknown macros, escape
- * sequences and characters (very liberal). This is specified
- * in mandoc.1.
- */
-
- pflags = MDOC_IGN_MACRO | MDOC_IGN_ESCAPE | MDOC_IGN_CHARS;
-
- /* Override default behaviour... */
-
- if (curp->fflags & IGN_SCOPE)
- pflags |= MDOC_IGN_SCOPE;
- if (curp->fflags & NO_IGN_ESCAPE)
- pflags &= ~MDOC_IGN_ESCAPE;
- if (curp->fflags & NO_IGN_MACRO)
- pflags &= ~MDOC_IGN_MACRO;
- if (curp->fflags & NO_IGN_CHARS)
- pflags &= ~MDOC_IGN_CHARS;
-
- if (NULL == (mdoc = mdoc_alloc(curp, pflags, &mdoccb)))
- warnx("memory exhausted");
-
- return(mdoc);
-}
-
-
-static int
-fstdin(struct buf *blk, struct buf *ln, struct curparse *curp)
-{
-
- curp->file = "<stdin>";
- curp->fd = STDIN_FILENO;
- return(fdesc(blk, ln, curp));