+ span = tbl->current_span ? tbl->current_span->next
+ : tbl->first_span;
+ if (span)
+ tbl->current_span = span;
+ return(span);
+}
+
+int
+tbl_end(struct tbl_node **tblp)
+{
+ struct tbl_node *tbl;
+ struct tbl_span *sp;
+
+ tbl = *tblp;
+ *tblp = NULL;
+
+ if (tbl->part == TBL_PART_CDATA)
+ mandoc_msg(MANDOCERR_TBLDATA_BLK, tbl->parse,
+ tbl->line, tbl->pos, "TE");
+
+ sp = tbl->first_span;
+ while (sp != NULL && sp->first == NULL)
+ sp = sp->next;
+ if (sp == NULL) {
+ mandoc_msg(MANDOCERR_TBLDATA_NONE, tbl->parse,
+ tbl->line, tbl->pos, NULL);
+ return(0);
+ }
+ return(1);