diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-01-04 12:06:21 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-01-04 12:06:21 +0000 |
commit | 543980ff972d5b50a51593a306420bb65fbf6b61 (patch) | |
tree | a080fdde4da2d2ee8bef446c09ee6825a6215293 /tbl_term.c | |
parent | be25abe332d021e7a5092c3596a6ffc11e352da9 (diff) | |
download | mandoc-543980ff972d5b50a51593a306420bb65fbf6b61.tar.gz mandoc-543980ff972d5b50a51593a306420bb65fbf6b61.tar.zst mandoc-543980ff972d5b50a51593a306420bb65fbf6b61.zip |
Fix to make horizontal spanners in the layout be properly printed.
mandoc also now warns (so does tbl(1)) if a horizontal spanner is
specified along with data.
While here, fix up some documentation and uncomment the tbl reference.
Diffstat (limited to 'tbl_term.c')
-rw-r--r-- | tbl_term.c | 39 |
1 files changed, 10 insertions, 29 deletions
@@ -1,4 +1,4 @@ -/* $Id: tbl_term.c,v 1.6 2011/01/03 16:04:41 kristaps Exp $ */ +/* $Id: tbl_term.c,v 1.7 2011/01/04 12:06:21 kristaps Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -40,9 +40,6 @@ static void tbl_data_number(struct termp *, static void tbl_data_literal(struct termp *, const struct tbl_dat *, const struct termp_tbl *); -static void tbl_data_spanner(struct termp *, - const struct tbl_dat *, - const struct termp_tbl *); static void tbl_data(struct termp *, const struct tbl *, const struct tbl_dat *, const struct termp_tbl *); @@ -261,8 +258,13 @@ tbl_data(struct termp *tp, const struct tbl *tbl, switch (dp->pos) { case (TBL_DATA_HORIZ): /* FALLTHROUGH */ + case (TBL_DATA_NHORIZ): + tbl_char(tp, '-', tbp->width); + return; + case (TBL_DATA_NDHORIZ): + /* FALLTHROUGH */ case (TBL_DATA_DHORIZ): - tbl_data_spanner(tp, dp, tbp); + tbl_char(tp, '=', tbp->width); return; default: break; @@ -272,10 +274,10 @@ tbl_data(struct termp *tp, const struct tbl *tbl, switch (pos) { case (TBL_CELL_HORIZ): - /* FALLTHROUGH */ + tbl_char(tp, '-', tbp->width); + break; case (TBL_CELL_DHORIZ): - /* FIXME: THIS IS WRONG. */ - tbl_data_spanner(tp, dp, tbp); + tbl_char(tp, '=', tbp->width); break; case (TBL_CELL_LONG): /* FALLTHROUGH */ @@ -319,7 +321,6 @@ tbl_vframe(struct termp *tp, const struct tbl *tbl) term_word(tp, "|"); } - static inline void tbl_char(struct termp *tp, char c, int len) { @@ -336,26 +337,6 @@ tbl_char(struct termp *tp, char c, int len) } static void -tbl_data_spanner(struct termp *tp, - const struct tbl_dat *dp, - const struct termp_tbl *tblp) -{ - - switch (dp->pos) { - case (TBL_DATA_HORIZ): - case (TBL_DATA_NHORIZ): - tbl_char(tp, '-', tblp->width); - break; - case (TBL_DATA_DHORIZ): - case (TBL_DATA_NDHORIZ): - tbl_char(tp, '=', tblp->width); - break; - default: - break; - } -} - -static void tbl_data_literal(struct termp *tp, const struct tbl_dat *dp, const struct termp_tbl *tblp) |