-/* $Id: man_validate.c,v 1.95 2014/07/02 05:52:24 schwarze Exp $ */
+/* $Id: man_validate.c,v 1.100 2014/07/07 21:36:20 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
check_root(CHKARGS)
{
- if (MAN_BLINE & man->flags)
- man_nmsg(man, n, MANDOCERR_SCOPEEXIT);
- else if (MAN_ELINE & man->flags)
- man_nmsg(man, n, MANDOCERR_SCOPEEXIT);
+ if ((MAN_BLINE | MAN_ELINE) & man->flags)
+ mandoc_msg(MANDOCERR_BLK_LINE, man->parse,
+ 0, 0, "at end of file");
man->flags &= ~MAN_BLINE;
man->flags &= ~MAN_ELINE;
cp = n->string;
for (p = cp; NULL != (p = strchr(p, '\t')); p++)
- man_pmsg(man, n->line, (int)(p - cp), MANDOCERR_BADTAB);
+ mandoc_msg(MANDOCERR_FI_TAB, man->parse,
+ n->line, n->pos + (p - cp), NULL);
}
#define INEQ_DEFINE(x, ineq, name) \
}
if (0 == ok) {
- mandoc_vmsg(MANDOCERR_BADFONT, man->parse, n->line,
- n->pos, "%s", cp);
+ mandoc_vmsg(MANDOCERR_FT_BAD, man->parse,
+ n->line, n->pos, "ft %s", cp);
*cp = '\0';
}
break;
case MAN_HEAD:
if (n->nchild)
- man_nmsg(man, n, MANDOCERR_ARGSLOST);
+ mandoc_vmsg(MANDOCERR_ARG_SKIP,
+ man->parse, n->line, n->pos,
+ "%s %s%s", man_macronames[n->tok],
+ n->child->string,
+ n->nchild > 1 ? " ..." : "");
break;
default:
break;
{
if (MAN_LITERAL & man->flags)
- man_nmsg(man, n, MANDOCERR_SCOPEREP);
+ man_nmsg(man, n, MANDOCERR_NF_SKIP);
man->flags |= MAN_LITERAL;
return(1);
{
if ( ! (MAN_LITERAL & man->flags))
- man_nmsg(man, n, MANDOCERR_WNOSCOPE);
+ man_nmsg(man, n, MANDOCERR_FI_SKIP);
man->flags &= ~MAN_LITERAL;
return(1);