Lines Matching defs:tbl
1 /* Id: tbl.c,v 1.46 2018/12/14 06:33:14 schwarze Exp */
30 #include "tbl.h"
37 tbl_read(struct tbl_node *tbl, int ln, const char *p, int pos)
48 if (tbl->part == TBL_PART_OPTS) {
49 tbl->part = TBL_PART_LAYOUT;
69 tbl_option(tbl, ln, p, &pos);
77 switch (tbl->part) {
79 tbl_layout(tbl, ln, p, pos);
82 tbl_cdata(tbl, ln, p, pos);
85 tbl_data(tbl, ln, p, pos);
93 struct tbl_node *tbl;
95 tbl = mandoc_calloc(1, sizeof(*tbl));
97 last_tbl->next = tbl;
98 tbl->line = line;
99 tbl->pos = pos;
100 tbl->part = TBL_PART_OPTS;
101 tbl->opts.tab = '\t';
102 tbl->opts.decimal = '.';
103 return tbl;
107 tbl_free(struct tbl_node *tbl)
115 while (tbl != NULL) {
116 while ((rp = tbl->first_row) != NULL) {
117 tbl->first_row = rp->next;
126 while ((sp = tbl->first_span) != NULL) {
127 tbl->first_span = sp->next;
136 old_tbl = tbl;
137 tbl = tbl->next;
143 tbl_restart(int line, int pos, struct tbl_node *tbl)
145 if (tbl->part == TBL_PART_CDATA)
148 tbl->part = TBL_PART_LAYOUT;
149 tbl->line = line;
150 tbl->pos = pos;
154 tbl_span(struct tbl_node *tbl)
158 span = tbl->current_span ? tbl->current_span->next
159 : tbl->first_span;
161 tbl->current_span = span;
166 tbl_end(struct tbl_node *tbl, int still_open)
171 mandoc_msg(MANDOCERR_BLK_NOEND, tbl->line, tbl->pos, "TS");
172 else if (tbl->part == TBL_PART_CDATA)
173 mandoc_msg(MANDOCERR_TBLDATA_BLK, tbl->line, tbl->pos, "TE");
175 sp = tbl->first_span;
179 mandoc_msg(MANDOCERR_TBLDATA_NONE, tbl->line, tbl->pos, NULL);