diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-04-19 14:57:38 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-04-19 14:57:38 +0000 |
commit | b6f6b7ee15f64b3ab129ecfa179af940f18a258d (patch) | |
tree | 2e3be34aef7c6069bc290a0118a73baca9db498a /roff.c | |
parent | ccc10e57fbb135c2fc3114a4d642963527f2fbc5 (diff) | |
download | mandoc-b6f6b7ee15f64b3ab129ecfa179af940f18a258d.tar.gz mandoc-b6f6b7ee15f64b3ab129ecfa179af940f18a258d.tar.zst mandoc-b6f6b7ee15f64b3ab129ecfa179af940f18a258d.zip |
Unify trickier node handling functions.
* man_elem_alloc() -> roff_elem_alloc()
* man_block_alloc() -> roff_block_alloc()
The functions mdoc_elem_alloc() and mdoc_block_alloc() remain for
now because they need to do mdoc(7)-specific argument processing.
Diffstat (limited to 'roff.c')
-rw-r--r-- | roff.c | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.267 2015/04/19 14:25:41 schwarze Exp $ */ +/* $Id: roff.c,v 1.268 2015/04/19 14:57:38 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org> @@ -1096,6 +1096,27 @@ roff_word_append(struct roff_man *man, const char *word) man->next = ROFF_NEXT_SIBLING; } +void +roff_elem_alloc(struct roff_man *man, int line, int pos, int tok) +{ + struct roff_node *n; + + n = roff_node_alloc(man, line, pos, ROFFT_ELEM, tok); + roff_node_append(man, n); + man->next = ROFF_NEXT_CHILD; +} + +struct roff_node * +roff_block_alloc(struct roff_man *man, int line, int pos, int tok) +{ + struct roff_node *n; + + n = roff_node_alloc(man, line, pos, ROFFT_BLOCK, tok); + roff_node_append(man, n); + man->next = ROFF_NEXT_CHILD; + return(n); +} + struct roff_node * roff_head_alloc(struct roff_man *man, int line, int pos, int tok) { |