+ if (mdoc && ! mdoc_endparse(mdoc))
+ return(0);
+ if (man && ! man_endparse(man))
+ return(0);
+
+ /* If unset, allocate output dev now (if applicable). */
+
+ if ( ! (curp->outman && curp->outmdoc)) {
+ switch (curp->outtype) {
+ case (OUTT_TREE):
+ curp->outman = tree_man;
+ curp->outmdoc = tree_mdoc;
+ break;
+ case (OUTT_LINT):
+ break;
+ default:
+ curp->outdata = ascii_alloc();
+ curp->outman = terminal_man;
+ curp->outmdoc = terminal_mdoc;
+ curp->outfree = terminal_free;
+ break;
+ }
+ }
+
+ /* Execute the out device, if it exists. */
+
+ if (man && curp->outman)
+ if ( ! (*curp->outman)(curp->outdata, man))
+ return(0);
+ if (mdoc && curp->outmdoc)
+ if ( ! (*curp->outmdoc)(curp->outdata, mdoc))
+ return(0);
+
+ return(1);