Lines Matching defs:tbl
1 /* $Id: tbl.c,v 1.39 2015/01/30 17:32:16 schwarze Exp $ */
35 tbl_read(struct tbl_node *tbl, int ln, const char *p, int pos)
46 if (tbl->part == TBL_PART_OPTS) {
47 tbl->part = TBL_PART_LAYOUT;
67 tbl_option(tbl, ln, p, &pos);
75 switch (tbl->part) {
77 tbl_layout(tbl, ln, p, pos);
80 return(tbl_cdata(tbl, ln, p, pos) ? ROFF_TBL : ROFF_IGN);
85 tbl_data(tbl, ln, p, pos);
92 struct tbl_node *tbl;
94 tbl = mandoc_calloc(1, sizeof(*tbl));
95 tbl->line = line;
96 tbl->pos = pos;
97 tbl->parse = parse;
98 tbl->part = TBL_PART_OPTS;
99 tbl->opts.tab = '\t';
100 tbl->opts.decimal = '.';
101 return(tbl);
105 tbl_free(struct tbl_node *tbl)
112 while ((rp = tbl->first_row) != NULL) {
113 tbl->first_row = rp->next;
122 while ((sp = tbl->first_span) != NULL) {
123 tbl->first_span = sp->next;
133 free(tbl);
137 tbl_restart(int line, int pos, struct tbl_node *tbl)
139 if (tbl->part == TBL_PART_CDATA)
140 mandoc_msg(MANDOCERR_TBLDATA_BLK, tbl->parse,
143 tbl->part = TBL_PART_LAYOUT;
144 tbl->line = line;
145 tbl->pos = pos;
149 tbl_span(struct tbl_node *tbl)
153 assert(tbl);
154 span = tbl->current_span ? tbl->current_span->next
155 : tbl->first_span;
157 tbl->current_span = span;
164 struct tbl_node *tbl;
167 tbl = *tblp;
170 if (tbl->part == TBL_PART_CDATA)
171 mandoc_msg(MANDOCERR_TBLDATA_BLK, tbl->parse,
172 tbl->line, tbl->pos, "TE");
174 sp = tbl->first_span;
178 mandoc_msg(MANDOCERR_TBLDATA_NONE, tbl->parse,
179 tbl->line, tbl->pos, NULL);