From 80339b751a1833d9bbbf9856e7f48f56d91ba1d3 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Sun, 20 Mar 2011 16:02:05 +0000 Subject: Consolidate messages. Have all parse-time messages (in libmdoc, libroff, etc., etc.) route into mandoc_msg() and mandoc_vmsg(), for the time being in libmandoc.h. This requires struct mparse to be passed into the allocation routines instead of mandocmsg and a void pointer. Then, move some of the functionality of the old mmsg() into read.c's mparse_mmsg() (check against wlevel and setting of file_status) and use main.c's mmsg() as simply a printing tool. --- man_validate.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'man_validate.c') diff --git a/man_validate.c b/man_validate.c index eba9cf6d..ed8d2475 100644 --- a/man_validate.c +++ b/man_validate.c @@ -196,8 +196,8 @@ check_root(CHKARGS) m->meta.title = mandoc_strdup("unknown"); m->meta.msec = mandoc_strdup("1"); - m->meta.date = mandoc_normdate(NULL, - m->msg, m->data, n->line, n->pos); + m->meta.date = mandoc_normdate + (m->parse, NULL, n->line, n->pos); } return(1); @@ -247,7 +247,7 @@ check_##name(CHKARGS) \ { \ if (n->nchild ineq (x)) \ return(1); \ - man_vmsg(m, MANDOCERR_ARGCOUNT, n->line, n->pos, \ + mandoc_vmsg(MANDOCERR_ARGCOUNT, m->parse, n->line, n->pos, \ "line arguments %s %d (have %d)", \ #ineq, (x), n->nchild); \ return(1); \ @@ -299,14 +299,17 @@ check_ft(CHKARGS) } if (0 == ok) { - man_vmsg(m, MANDOCERR_BADFONT, - n->line, n->pos, "%s", cp); + mandoc_vmsg + (MANDOCERR_BADFONT, m->parse, + n->line, n->pos, "%s", cp); *cp = '\0'; } if (1 < n->nchild) - man_vmsg(m, MANDOCERR_ARGCOUNT, n->line, n->pos, - "want one child (have %d)", n->nchild); + mandoc_vmsg + (MANDOCERR_ARGCOUNT, m->parse, n->line, + n->pos, "want one child (have %d)", + n->nchild); return(1); } @@ -426,8 +429,8 @@ post_TH(CHKARGS) n = n->next; if (n) pos = n->pos; - m->meta.date = mandoc_normdate(n ? n->string : NULL, - m->msg, m->data, line, pos); + m->meta.date = mandoc_normdate + (m->parse, n ? n->string : NULL, line, pos); /* TITLE MSEC DATE ->SOURCE<- VOL */ -- cgit