-int
-mdoc_endparse(struct mdoc *m)
-{
-
- if (MDOC_HALT & m->flags)
- return(0);
- else if (mdoc_macroend(m))
- return(1);
- m->flags |= MDOC_HALT;
- return(0);
-}
-
-
-/*
- * Main parse routine. Parses a single line -- really just hands off to
- * the macro or text parser.
- */
-int
-mdoc_parseln(struct mdoc *m, int ln, char *buf)
-{
-
- /* If in error-mode, then we parse no more. */
-
- if (MDOC_HALT & m->flags)
- return(0);
-
- return('.' == *buf ? parsemacro(m, ln, buf) :
- parsetext(m, ln, buf));
-}
-
-
-int
-mdoc_verr(struct mdoc *mdoc, int ln, int pos,
- const char *fmt, ...)
-{
- char buf[256];
- va_list ap;
-
- if (NULL == mdoc->cb.mdoc_err)
- return(0);
-
- va_start(ap, fmt);
- (void)vsnprintf(buf, sizeof(buf) - 1, fmt, ap);
- va_end(ap);
- return((*mdoc->cb.mdoc_err)(mdoc->data, ln, pos, buf));
-}
-
-
-int
-mdoc_vwarn(struct mdoc *mdoc, int ln, int pos,
- enum mdoc_warn type, const char *fmt, ...)
-{
- char buf[256];
- va_list ap;
-
- if (NULL == mdoc->cb.mdoc_warn)
- return(0);
-
- va_start(ap, fmt);
- (void)vsnprintf(buf, sizeof(buf) - 1, fmt, ap);
- va_end(ap);
- return((*mdoc->cb.mdoc_warn)(mdoc->data, ln, pos, type, buf));
-}
-
-
-int
-mdoc_nerr(struct mdoc *mdoc, const struct mdoc_node *node, const char *fmt, ...)