+ 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 = mwarn;
+
+ /* Defaults from mandoc.1. */
+
+ pflags = MAN_IGN_MACRO | MAN_IGN_ESCAPE | MAN_IGN_CHARS;
+
+ if (curp->fflags & NO_IGN_MACRO)
+ pflags &= ~MAN_IGN_MACRO;
+ if (curp->fflags & NO_IGN_CHARS)
+ pflags &= ~MAN_IGN_CHARS;
+ if (curp->fflags & NO_IGN_ESCAPE)
+ pflags &= ~MAN_IGN_ESCAPE;
+
+ 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_err = merr;
+ mdoccb.mdoc_warn = mwarn;
+
+ /* Defaults from mandoc.1. */
+
+ pflags = MDOC_IGN_MACRO | MDOC_IGN_ESCAPE | MDOC_IGN_CHARS;
+
+ 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);