diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-03-20 16:02:05 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-03-20 16:02:05 +0000 |
commit | 80339b751a1833d9bbbf9856e7f48f56d91ba1d3 (patch) | |
tree | 4e59124e25202b7fa3543b670ae8434c1256cd45 /man_validate.c | |
parent | 7ff718a5d9d20e97b6431bb61dc4cb34a1f431c7 (diff) | |
download | mandoc-80339b751a1833d9bbbf9856e7f48f56d91ba1d3.tar.gz |
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.
Diffstat (limited to 'man_validate.c')
-rw-r--r-- | man_validate.c | 21 |
1 files changed, 12 insertions, 9 deletions
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 */ |