From b6f6b7ee15f64b3ab129ecfa179af940f18a258d Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 19 Apr 2015 14:57:38 +0000 Subject: 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. --- man.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'man.c') diff --git a/man.c b/man.c index 6c0b1787..e65e8c8c 100644 --- a/man.c +++ b/man.c @@ -1,4 +1,4 @@ -/* $Id: man.c,v 1.160 2015/04/19 14:25:41 schwarze Exp $ */ +/* $Id: man.c,v 1.161 2015/04/19 14:57:38 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2013, 2014, 2015 Ingo Schwarze @@ -74,26 +74,6 @@ man_parseln(struct roff_man *man, int ln, char *buf, int offs) man_ptext(man, ln, buf, offs)); } -void -man_elem_alloc(struct roff_man *man, int line, int pos, int tok) -{ - struct roff_node *p; - - p = roff_node_alloc(man, line, pos, ROFFT_ELEM, tok); - roff_node_append(man, p); - man->next = ROFF_NEXT_CHILD; -} - -void -man_block_alloc(struct roff_man *man, int line, int pos, int tok) -{ - struct roff_node *p; - - p = roff_node_alloc(man, line, pos, ROFFT_BLOCK, tok); - roff_node_append(man, p); - man->next = ROFF_NEXT_CHILD; -} - static void man_descope(struct roff_man *man, int line, int offs) { @@ -139,7 +119,7 @@ man_ptext(struct roff_man *man, int line, char *buf, int offs) /* Allocate a blank entry. */ if (man->last->tok != MAN_SH && man->last->tok != MAN_SS) { - man_elem_alloc(man, line, offs, MAN_sp); + roff_elem_alloc(man, line, offs, MAN_sp); man->next = ROFF_NEXT_SIBLING; } return(1); -- cgit v1.2.3-56-ge451