aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandoc.h
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-06-08 18:11:22 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-06-08 18:11:22 +0000
commit487d956e07013bc929ab478a0503246df414b00a (patch)
tree22c2d5abff010bc035dd6d8ee6c0d64f46a9b627 /mandoc.h
parent789580a2a2366243d622766fdadd094931ca6596 (diff)
downloadmandoc-487d956e07013bc929ab478a0503246df414b00a.tar.gz
mandoc-487d956e07013bc929ab478a0503246df414b00a.tar.zst
mandoc-487d956e07013bc929ab478a0503246df414b00a.zip
Implement w layout specifier (minimum column width).
Improve width calculation of text blocks. Reduces the groff/mandoc diff in Base+Xenocara by about 800 lines.
Diffstat (limited to 'mandoc.h')
-rw-r--r--mandoc.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/mandoc.h b/mandoc.h
index 487ccff5..ec560887 100644
--- a/mandoc.h
+++ b/mandoc.h
@@ -1,4 +1,4 @@
-/* $Id: mandoc.h,v 1.225 2017/06/08 00:23:30 schwarze Exp $ */
+/* $Id: mandoc.h,v 1.226 2017/06/08 18:11:22 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -246,9 +246,10 @@ enum tbl_cellt {
*/
struct tbl_cell {
struct tbl_cell *next;
+ char *wstr; /* min width represented as a string */
+ size_t width; /* minimum column width */
+ size_t spacing; /* to the right of the column */
int vert; /* width of subsequent vertical line */
- enum tbl_cellt pos;
- size_t spacing;
int col; /* column number, starting from 0 */
int flags;
#define TBL_CELL_TALIGN (1 << 0) /* t, T */
@@ -259,6 +260,7 @@ struct tbl_cell {
#define TBL_CELL_UP (1 << 5) /* u, U */
#define TBL_CELL_WIGN (1 << 6) /* z, Z */
#define TBL_CELL_WMAX (1 << 7) /* x, X */
+ enum tbl_cellt pos;
};
/*
@@ -286,9 +288,10 @@ enum tbl_datt {
*/
struct tbl_dat {
struct tbl_cell *layout; /* layout cell */
- int spans; /* how many spans follow */
struct tbl_dat *next;
char *string; /* data (NULL if not TBL_DATA_DATA) */
+ int spans; /* how many spans follow */
+ int block; /* T{ text block T} */
enum tbl_datt pos;
};