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 /man.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 'man.c')
-rw-r--r-- | man.c | 26 |
1 files changed, 8 insertions, 18 deletions
@@ -48,8 +48,6 @@ static struct man_node *man_node_alloc(struct man *, int, int, enum man_type, enum mant); static int man_node_append(struct man *, struct man_node *); -static int man_span_alloc(struct man *, - const struct tbl_span *); static void man_node_free(struct man_node *); static void man_node_unlink(struct man *, struct man_node *); @@ -300,21 +298,6 @@ man_block_alloc(struct man *m, int line, int pos, enum mant tok) return(1); } -static int -man_span_alloc(struct man *m, const struct tbl_span *span) -{ - struct man_node *n; - - n = man_node_alloc(m, span->line, 0, MAN_TBL, MAN_MAX); - n->span = span; - - if ( ! man_node_append(m, n)) - return(0); - - m->next = MAN_NEXT_SIBLING; - return(1); -} - int man_word_alloc(struct man *m, int line, int pos, const char *word) { @@ -367,10 +350,17 @@ man_node_delete(struct man *m, struct man_node *p) int man_addspan(struct man *m, const struct tbl_span *sp) { + struct man_node *n; assert( ! (MAN_HALT & m->flags)); - if ( ! man_span_alloc(m, sp)) + + n = man_node_alloc(m, sp->line, 0, MAN_TBL, MAN_MAX); + n->span = sp; + + if ( ! man_node_append(m, n)) return(0); + + m->next = MAN_NEXT_SIBLING; return(man_descope(m, sp->line, 0)); } |