From b3ea03504ba905470ba5c486ba69062c89034488 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Mon, 10 Jan 2011 14:40:30 +0000 Subject: First, make extra data cells be thrown away. This makes "dp->layout" always hold, which cleans up the table stuff a bit. Second, set a "spans" value per data cell consisting of the number of skipped TBL_CELL_SPAN layout cells. Third, make tbl_term.c understand how to skip over spanned sections when iterating over the header queue. What remains is to calculate the widths of spanned cells. --- tree.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tree.c') diff --git a/tree.c b/tree.c index 70bd73d9..427a9d41 100644 --- a/tree.c +++ b/tree.c @@ -1,4 +1,4 @@ -/* $Id: tree.c,v 1.31 2011/01/03 13:59:21 kristaps Exp $ */ +/* $Id: tree.c,v 1.32 2011/01/10 14:40:30 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -282,7 +282,12 @@ print_span(const struct tbl_span *sp, int indent) default: break; } - printf("[%s%s]", dp->string, dp->layout ? "" : "*"); + printf("[\"%s\"", dp->string ? dp->string : ""); + if (dp->spans) + printf("(%d)", dp->spans); + if (NULL == dp->layout) + putchar('*'); + putchar(']'); if (dp->next) putchar(' '); } -- cgit v1.2.3