diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-01-01 17:10:20 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-01-01 17:10:20 +0000 |
commit | 34ce24843b2a8171fe592d29a7ef15c8322b18c5 (patch) | |
tree | dabb531c21d174bdea12196c0fc93edb4b0753ea /tbl_data.c | |
parent | 3592c989529bee1adce043bede9fbc1902993301 (diff) | |
download | mandoc-34ce24843b2a8171fe592d29a7ef15c8322b18c5.tar.gz |
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.c | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -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); |