diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-12-29 16:44:23 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-12-29 16:44:23 +0000 |
commit | e51d77577562e615c4d649d25b45dad6b6e81ac1 (patch) | |
tree | e7a812b4c396352451fed757dfc926b729fdcf1e /tbl.c | |
parent | 20a8ad68cff60805c5af1a8fb2d0685e853faf5b (diff) | |
download | mandoc-e51d77577562e615c4d649d25b45dad6b6e81ac1.tar.gz |
Initial check-in of table data-row processing. For the time being, this
parses table data then throws it away immediately. It does not yet try
to cross-check data rows against layout or anything. This copied more
or less completely from tbl.bsd.lv.
Diffstat (limited to 'tbl.c')
-rw-r--r-- | tbl.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -63,6 +63,8 @@ tbl_read(struct tbl *tbl, int ln, const char *p, int offs) { int len; const char *cp; + struct tbl_dat *dp; + struct tbl_span *sp; cp = &p[offs]; len = (int)strlen(cp); @@ -85,9 +87,20 @@ tbl_read(struct tbl *tbl, int ln, const char *p, int offs) return(tbl_option(tbl, ln, p) ? ROFF_IGN : ROFF_ERR); case (TBL_PART_LAYOUT): return(tbl_layout(tbl, ln, p) ? ROFF_IGN : ROFF_ERR); - default: + case (TBL_PART_DATA): break; } + + /* XXX: throw away data for now. */ + if (NULL != (sp = tbl_data(tbl, ln, p))) { + while (NULL != (dp = sp->first)) { + sp->first = sp->first->next; + if (dp->string) + free(dp->string); + free(dp); + } + free(sp); + } return(ROFF_CONT); } |