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 | 71ddcd873082a3c68ed2be7b7661075fb09d5849 (patch) | |
tree | 7eb75a067079e8a591b76791b56f0b7673b109d5 /tbl_layout.c | |
parent | 58ca7d3112e5d39b93ab732cf103b4b0b834b106 (diff) | |
download | mandoc-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 'tbl_layout.c')
-rw-r--r-- | tbl_layout.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/tbl_layout.c b/tbl_layout.c index dd30e5ea..8245003b 100644 --- a/tbl_layout.c +++ b/tbl_layout.c @@ -1,4 +1,4 @@ -/* $Id: tbl_layout.c,v 1.16 2011/01/11 14:12:01 kristaps Exp $ */ +/* $Id: tbl_layout.c,v 1.17 2011/03/20 16:02:05 kristaps Exp $ */ /* * Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -100,7 +100,8 @@ mod: (*pos)++; goto mod; } - TBL_MSG(tbl, MANDOCERR_TBLLAYOUT, ln, *pos); + mandoc_msg(MANDOCERR_TBLLAYOUT, + tbl->parse, ln, *pos, NULL); return(0); } @@ -117,7 +118,8 @@ mod: /* No greater than 4 digits. */ if (4 == i) { - TBL_MSG(tbl, MANDOCERR_TBLLAYOUT, ln, *pos); + mandoc_msg(MANDOCERR_TBLLAYOUT, tbl->parse, + ln, *pos, NULL); return(0); } @@ -156,7 +158,8 @@ mod: (*pos)--; break; default: - TBL_MSG(tbl, MANDOCERR_TBLLAYOUT, ln, *pos - 1); + mandoc_msg(MANDOCERR_TBLLAYOUT, tbl->parse, + ln, *pos - 1, NULL); return(0); } @@ -171,7 +174,8 @@ mod: break; } - TBL_MSG(tbl, MANDOCERR_TBLLAYOUT, ln, *pos - 1); + mandoc_msg(MANDOCERR_TBLLAYOUT, tbl->parse, + ln, *pos - 1, NULL); return(0); } @@ -189,7 +193,8 @@ cell(struct tbl_node *tbl, struct tbl_row *rp, break; if (KEYS_MAX == i) { - TBL_MSG(tbl, MANDOCERR_TBLLAYOUT, ln, *pos); + mandoc_msg(MANDOCERR_TBLLAYOUT, tbl->parse, + ln, *pos, NULL); return(0); } @@ -205,7 +210,8 @@ cell(struct tbl_node *tbl, struct tbl_row *rp, if (TBL_CELL_SPAN == c) { if (NULL == rp->first) { - TBL_MSG(tbl, MANDOCERR_TBLLAYOUT, ln, *pos); + mandoc_msg(MANDOCERR_TBLLAYOUT, tbl->parse, + ln, *pos, NULL); return(0); } else if (rp->last) switch (rp->last->pos) { @@ -213,7 +219,8 @@ cell(struct tbl_node *tbl, struct tbl_row *rp, case (TBL_CELL_DVERT): case (TBL_CELL_HORIZ): case (TBL_CELL_DHORIZ): - TBL_MSG(tbl, MANDOCERR_TBLLAYOUT, ln, *pos); + mandoc_msg(MANDOCERR_TBLLAYOUT, tbl->parse, + ln, *pos, NULL); return(0); default: break; @@ -226,7 +233,7 @@ cell(struct tbl_node *tbl, struct tbl_row *rp, */ if (TBL_CELL_DOWN == c && rp == tbl->first_row) { - TBL_MSG(tbl, MANDOCERR_TBLLAYOUT, ln, *pos); + mandoc_msg(MANDOCERR_TBLLAYOUT, tbl->parse, ln, *pos, NULL); return(0); } @@ -244,7 +251,7 @@ cell(struct tbl_node *tbl, struct tbl_row *rp, if (rp->last && (TBL_CELL_VERT == c || TBL_CELL_DVERT == c) && (TBL_CELL_VERT == rp->last->pos || TBL_CELL_DVERT == rp->last->pos)) { - TBL_MSG(tbl, MANDOCERR_TBLLAYOUT, ln, *pos - 1); + mandoc_msg(MANDOCERR_TBLLAYOUT, tbl->parse, ln, *pos - 1, NULL); return(0); } @@ -285,7 +292,8 @@ cell: if ('.' == p[*pos]) { tbl->part = TBL_PART_DATA; if (NULL == tbl->first_row) - TBL_MSG(tbl, MANDOCERR_TBLNOLAYOUT, ln, *pos); + mandoc_msg(MANDOCERR_TBLNOLAYOUT, tbl->parse, + ln, *pos, NULL); (*pos)++; return; } |