aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/man_validate.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-03-20 16:02:05 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-03-20 16:02:05 +0000
commit71ddcd873082a3c68ed2be7b7661075fb09d5849 (patch)
tree7eb75a067079e8a591b76791b56f0b7673b109d5 /man_validate.c
parent58ca7d3112e5d39b93ab732cf103b4b0b834b106 (diff)
downloadmandoc-71ddcd873082a3c68ed2be7b7661075fb09d5849.tar.gz
mandoc-71ddcd873082a3c68ed2be7b7661075fb09d5849.tar.zst
mandoc-71ddcd873082a3c68ed2be7b7661075fb09d5849.zip
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.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/man_validate.c b/man_validate.c
index e0e8e1cf..34f50fe4 100644
--- a/man_validate.c
+++ b/man_validate.c
@@ -1,4 +1,4 @@
-/* $Id: man_validate.c,v 1.64 2011/03/17 11:56:17 kristaps Exp $ */
+/* $Id: man_validate.c,v 1.65 2011/03/20 16:02:05 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -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 */