Lines Matching refs:tbl

33 tbl_read(struct tbl_node *tbl, int ln, const char *p, int offs)  in tbl_read()  argument
48 if (TBL_PART_OPTS == tbl->part && len) in tbl_read()
50 tbl->part = TBL_PART_LAYOUT; in tbl_read()
54 switch (tbl->part) { in tbl_read()
56 return(tbl_option(tbl, ln, p) ? ROFF_IGN : ROFF_ERR); in tbl_read()
58 return(tbl_layout(tbl, ln, p) ? ROFF_IGN : ROFF_ERR); in tbl_read()
60 return(tbl_cdata(tbl, ln, p) ? ROFF_TBL : ROFF_IGN); in tbl_read()
69 return(tbl_data(tbl, ln, p) ? ROFF_TBL : ROFF_IGN); in tbl_read()
75 struct tbl_node *tbl; in tbl_alloc() local
77 tbl = mandoc_calloc(1, sizeof(struct tbl_node)); in tbl_alloc()
78 tbl->line = line; in tbl_alloc()
79 tbl->pos = pos; in tbl_alloc()
80 tbl->parse = parse; in tbl_alloc()
81 tbl->part = TBL_PART_OPTS; in tbl_alloc()
82 tbl->opts.tab = '\t'; in tbl_alloc()
83 tbl->opts.linesize = 12; in tbl_alloc()
84 tbl->opts.decimal = '.'; in tbl_alloc()
85 return(tbl); in tbl_alloc()
89 tbl_free(struct tbl_node *tbl) in tbl_free() argument
97 while (NULL != (rp = tbl->first_row)) { in tbl_free()
98 tbl->first_row = rp->next; in tbl_free()
107 while (NULL != (sp = tbl->first_span)) { in tbl_free()
108 tbl->first_span = sp->next; in tbl_free()
119 while (NULL != (hp = tbl->first_head)) { in tbl_free()
120 tbl->first_head = hp->next; in tbl_free()
124 free(tbl); in tbl_free()
128 tbl_restart(int line, int pos, struct tbl_node *tbl) in tbl_restart() argument
130 if (TBL_PART_CDATA == tbl->part) in tbl_restart()
131 mandoc_msg(MANDOCERR_TBLBLOCK, tbl->parse, in tbl_restart()
132 tbl->line, tbl->pos, NULL); in tbl_restart()
134 tbl->part = TBL_PART_LAYOUT; in tbl_restart()
135 tbl->line = line; in tbl_restart()
136 tbl->pos = pos; in tbl_restart()
138 if (NULL == tbl->first_span || NULL == tbl->first_span->first) in tbl_restart()
139 mandoc_msg(MANDOCERR_TBLNODATA, tbl->parse, in tbl_restart()
140 tbl->line, tbl->pos, NULL); in tbl_restart()
144 tbl_span(struct tbl_node *tbl) in tbl_span() argument
148 assert(tbl); in tbl_span()
149 span = tbl->current_span ? tbl->current_span->next in tbl_span()
150 : tbl->first_span; in tbl_span()
152 tbl->current_span = span; in tbl_span()
159 struct tbl_node *tbl; in tbl_end() local
161 tbl = *tblp; in tbl_end()
164 if (NULL == tbl->first_span || NULL == tbl->first_span->first) in tbl_end()
165 mandoc_msg(MANDOCERR_TBLNODATA, tbl->parse, in tbl_end()
166 tbl->line, tbl->pos, NULL); in tbl_end()
168 if (tbl->last_span) in tbl_end()
169 tbl->last_span->flags |= TBL_SPAN_LAST; in tbl_end()
171 if (TBL_PART_CDATA == tbl->part) in tbl_end()
172 mandoc_msg(MANDOCERR_TBLBLOCK, tbl->parse, in tbl_end()
173 tbl->line, tbl->pos, NULL); in tbl_end()