+static void
+print_span(const struct tbl_span *sp, int indent)
+{
+ const struct tbl_dat *dp;
+ const struct tbl_cell *cp;
+ int i;
+
+ if (sp->prev == NULL) {
+ for (i = 0; i < indent; i++)
+ putchar(' ');
+ printf("%d", sp->opts->cols);
+ if (sp->opts->opts & TBL_OPT_CENTRE)
+ fputs(" center", stdout);
+ if (sp->opts->opts & TBL_OPT_EXPAND)
+ fputs(" expand", stdout);
+ if (sp->opts->opts & TBL_OPT_ALLBOX)
+ fputs(" allbox", stdout);
+ if (sp->opts->opts & TBL_OPT_BOX)
+ fputs(" box", stdout);
+ if (sp->opts->opts & TBL_OPT_DBOX)
+ fputs(" doublebox", stdout);
+ if (sp->opts->opts & TBL_OPT_NOKEEP)
+ fputs(" nokeep", stdout);
+ if (sp->opts->opts & TBL_OPT_NOSPACE)
+ fputs(" nospaces", stdout);
+ if (sp->opts->opts & TBL_OPT_NOWARN)
+ fputs(" nowarn", stdout);
+ printf(" (tbl options) %d:1\n", sp->line);
+ }
+
+ for (i = 0; i < indent; i++)
+ putchar(' ');
+
+ switch (sp->pos) {
+ case TBL_SPAN_HORIZ:
+ putchar('-');
+ putchar(' ');
+ break;
+ case TBL_SPAN_DHORIZ:
+ putchar('=');
+ putchar(' ');
+ break;
+ default:
+ for (cp = sp->layout->first; cp != NULL; cp = cp->next)
+ print_cellt(cp->pos);
+ putchar(' ');
+ for (dp = sp->first; dp; dp = dp->next) {
+ if ((cp = dp->layout) == NULL)
+ putchar('*');
+ else {
+ printf("%d", cp->col);
+ print_cellt(dp->layout->pos);
+ switch (cp->font) {
+ case ESCAPE_FONTROMAN:
+ break;
+ case ESCAPE_FONTBOLD:
+ putchar('b');
+ break;
+ case ESCAPE_FONTITALIC:
+ putchar('i');
+ break;
+ case ESCAPE_FONTBI:
+ fputs("bi", stdout);
+ break;
+ case ESCAPE_FONTCR:
+ putchar('c');
+ break;
+ case ESCAPE_FONTCB:
+ fputs("cb", stdout);
+ break;
+ case ESCAPE_FONTCI:
+ fputs("ci", stdout);
+ break;
+ default:
+ abort();
+ }
+ if (cp->flags & TBL_CELL_TALIGN)
+ putchar('t');
+ if (cp->flags & TBL_CELL_UP)
+ putchar('u');
+ if (cp->flags & TBL_CELL_BALIGN)
+ putchar('d');
+ if (cp->flags & TBL_CELL_WIGN)
+ putchar('z');
+ if (cp->flags & TBL_CELL_EQUAL)
+ putchar('e');
+ if (cp->flags & TBL_CELL_WMAX)
+ putchar('x');
+ }
+ switch (dp->pos) {
+ case TBL_DATA_HORIZ:
+ case TBL_DATA_NHORIZ:
+ putchar('-');
+ break;
+ case TBL_DATA_DHORIZ:
+ case TBL_DATA_NDHORIZ:
+ putchar('=');
+ break;
+ default:
+ putchar(dp->block ? '{' : '[');
+ if (dp->string != NULL)
+ fputs(dp->string, stdout);
+ putchar(dp->block ? '}' : ']');
+ break;
+ }
+ if (dp->hspans)
+ printf(">%d", dp->hspans);
+ if (dp->vspans)
+ printf("v%d", dp->vspans);