summaryrefslogtreecommitdiffstats
path: root/roff.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-04-19 14:57:38 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-04-19 14:57:38 +0000
commitc599b29874a76cbd98a6af0d536d744e679bb1f5 (patch)
tree2b4131d196075429d0256ae87e29735403934586 /roff.c
parentb41835362693d09c3eff29cb37f2217b9dca8cc3 (diff)
downloadmandoc-c599b29874a76cbd98a6af0d536d744e679bb1f5.tar.gz
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.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/roff.c b/roff.c
index 15189f27..b3f5752a 100644
--- a/roff.c
+++ b/roff.c
@@ -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)
{