diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-02-08 07:40:23 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-02-08 07:40:23 +0000 |
commit | 39f12eb291ae2c50f721965715032dae57e1162e (patch) | |
tree | 68e4fb562bd446add35d93469585b15282d8b48a /mdoc.c | |
parent | bea884e67a09ab188814eef3116085166e42c444 (diff) | |
download | mandoc-39f12eb291ae2c50f721965715032dae57e1162e.tar.gz |
Put tbl_alloc function right into the addspan() one, as this is the only
place that it's called.
Diffstat (limited to 'mdoc.c')
-rw-r--r-- | mdoc.c | 29 |
1 files changed, 9 insertions, 20 deletions
@@ -98,9 +98,6 @@ static int node_append(struct mdoc *, struct mdoc_node *); static int mdoc_ptext(struct mdoc *, int, char *, int); static int mdoc_pmacro(struct mdoc *, int, char *, int); -static int mdoc_span_alloc(struct mdoc *, - const struct tbl_span *); - const struct mdoc_node * mdoc_node(const struct mdoc *m) @@ -227,6 +224,7 @@ mdoc_endparse(struct mdoc *m) int mdoc_addspan(struct mdoc *m, const struct tbl_span *sp) { + struct mdoc_node *n; assert( ! (MDOC_HALT & m->flags)); @@ -237,7 +235,14 @@ mdoc_addspan(struct mdoc *m, const struct tbl_span *sp) return(1); } - return(mdoc_span_alloc(m, sp)); + n = node_alloc(m, sp->line, 0, MDOC_MAX, MDOC_TBL); + n->span = sp; + + if ( ! node_append(m, n)) + return(0); + + m->next = MDOC_NEXT_SIBLING; + return(1); } @@ -545,22 +550,6 @@ mdoc_elem_alloc(struct mdoc *m, int line, int pos, return(1); } -static int -mdoc_span_alloc(struct mdoc *m, const struct tbl_span *sp) -{ - struct mdoc_node *n; - - n = node_alloc(m, sp->line, 0, MDOC_MAX, MDOC_TBL); - n->span = sp; - - if ( ! node_append(m, n)) - return(0); - - m->next = MDOC_NEXT_SIBLING; - return(1); -} - - int mdoc_word_alloc(struct mdoc *m, int line, int pos, const char *p) { |