summaryrefslogtreecommitdiffstats
path: root/mdoc_macro.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
commit80339b751a1833d9bbbf9856e7f48f56d91ba1d3 (patch)
tree4e59124e25202b7fa3543b670ae8434c1256cd45 /mdoc_macro.c
parent7ff718a5d9d20e97b6431bb61dc4cb34a1f431c7 (diff)
downloadmandoc-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 'mdoc_macro.c')
-rw-r--r--mdoc_macro.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/mdoc_macro.c b/mdoc_macro.c
index d1354c6e..aee2cad3 100644
--- a/mdoc_macro.c
+++ b/mdoc_macro.c
@@ -513,9 +513,9 @@ make_pending(struct mdoc_node *broken, enum mdoct tok,
taker->pending = broken->pending;
}
broken->pending = breaker;
- mdoc_vmsg(m, MANDOCERR_SCOPENEST, line, ppos,
- "%s breaks %s", mdoc_macronames[tok],
- mdoc_macronames[broken->tok]);
+ mandoc_vmsg(MANDOCERR_SCOPENEST, m->parse, line, ppos,
+ "%s breaks %s", mdoc_macronames[tok],
+ mdoc_macronames[broken->tok]);
return(1);
}
@@ -541,9 +541,10 @@ rew_sub(enum mdoc_type t, struct mdoc *m,
case (REWIND_THIS):
break;
case (REWIND_FORCE):
- mdoc_vmsg(m, MANDOCERR_SCOPEBROKEN, line, ppos,
- "%s breaks %s", mdoc_macronames[tok],
- mdoc_macronames[n->tok]);
+ mandoc_vmsg(MANDOCERR_SCOPEBROKEN, m->parse,
+ line, ppos, "%s breaks %s",
+ mdoc_macronames[tok],
+ mdoc_macronames[n->tok]);
/* FALLTHROUGH */
case (REWIND_MORE):
n = n->parent;
@@ -1298,7 +1299,7 @@ blk_part_imp(MACRO_PROT_ARGS)
* crufty use of `Op' breakage.
*/
if (n != body)
- mdoc_vmsg(m, MANDOCERR_SCOPENEST, line, ppos,
+ mandoc_vmsg(MANDOCERR_SCOPENEST, m->parse, line, ppos,
"%s broken", mdoc_macronames[tok]);
if (n && ! rew_sub(MDOC_BODY, m, tok, line, ppos))