aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tbl_data.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-01-01 17:10:20 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-01-01 17:10:20 +0000
commitdbd5746117cfc008d44b2e9e53c8f76c8d92673d (patch)
tree400e153ac05f7aa95ec6164d5295afc836e3556f /tbl_data.c
parent9ccd8b3e4376fa371cffa2cc59bb4e395f16bf6b (diff)
downloadmandoc-dbd5746117cfc008d44b2e9e53c8f76c8d92673d.tar.gz
mandoc-dbd5746117cfc008d44b2e9e53c8f76c8d92673d.tar.zst
mandoc-dbd5746117cfc008d44b2e9e53c8f76c8d92673d.zip
Make some bit-flags into enums as they should be. Make printing of -Ttree
tables a little bit smarter.
Diffstat (limited to 'tbl_data.c')
-rw-r--r--tbl_data.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/tbl_data.c b/tbl_data.c
index b04d8046..b4810767 100644
--- a/tbl_data.c
+++ b/tbl_data.c
@@ -1,4 +1,4 @@
-/* $Id: tbl_data.c,v 1.4 2011/01/01 13:37:40 kristaps Exp $ */
+/* $Id: tbl_data.c,v 1.5 2011/01/01 17:10:20 kristaps Exp $ */
/*
* Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -68,16 +68,16 @@ data(struct tbl *tbl, struct tbl_span *dp,
if (p[*pos])
(*pos)++;
- /* XXX: do the strcmps, then malloc(). */
-
if ( ! strcmp(dat->string, "_"))
- dat->flags |= TBL_DATA_HORIZ;
+ dat->pos = TBL_DATA_HORIZ;
else if ( ! strcmp(dat->string, "="))
- dat->flags |= TBL_DATA_DHORIZ;
+ dat->pos = TBL_DATA_DHORIZ;
else if ( ! strcmp(dat->string, "\\_"))
- dat->flags |= TBL_DATA_NHORIZ;
+ dat->pos = TBL_DATA_NHORIZ;
else if ( ! strcmp(dat->string, "\\="))
- dat->flags |= TBL_DATA_NDHORIZ;
+ dat->pos = TBL_DATA_NDHORIZ;
+ else
+ dat->pos = TBL_DATA_DATA;
}
int
@@ -119,13 +119,15 @@ tbl_data(struct tbl *tbl, int ln, const char *p)
tbl->last_span = tbl->first_span = dp;
if ( ! strcmp(p, "_")) {
- dp->flags |= TBL_SPAN_HORIZ;
+ dp->pos = TBL_SPAN_HORIZ;
return(1);
} else if ( ! strcmp(p, "=")) {
- dp->flags |= TBL_SPAN_DHORIZ;
+ dp->pos = TBL_SPAN_DHORIZ;
return(1);
}
+ dp->pos = TBL_SPAN_DATA;
+
while ('\0' != p[pos])
data(tbl, dp, ln, p, &pos);