=================================================================== RCS file: /cvs/mandoc/mdoc.c,v retrieving revision 1.268 retrieving revision 1.270 diff -u -p -r1.268 -r1.270 --- mandoc/mdoc.c 2017/08/11 16:56:21 1.268 +++ mandoc/mdoc.c 2018/12/04 02:53:51 1.270 @@ -1,7 +1,7 @@ -/* $Id: mdoc.c,v 1.268 2017/08/11 16:56:21 schwarze Exp $ */ +/* $Id: mdoc.c,v 1.270 2018/12/04 02:53:51 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons - * Copyright (c) 2010, 2012-2017 Ingo Schwarze + * Copyright (c) 2010, 2012-2018 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -80,13 +80,6 @@ mdoc_parseln(struct roff_man *mdoc, int ln, char *buf, } void -mdoc_macro(MACRO_PROT_ARGS) -{ - assert(tok >= MDOC_Dd && tok < MDOC_MAX); - (*mdoc_macros[tok].fp)(mdoc, tok, line, ppos, pos, buf); -} - -void mdoc_tail_alloc(struct roff_man *mdoc, int line, int pos, enum roff_tok tok) { struct roff_node *p; @@ -162,15 +155,6 @@ mdoc_elem_alloc(struct roff_man *mdoc, int line, int p mdoc->next = ROFF_NEXT_CHILD; } -void -mdoc_node_relink(struct roff_man *mdoc, struct roff_node *p) -{ - - roff_node_unlink(mdoc, p); - p->prev = p->next = NULL; - roff_node_append(mdoc, p); -} - /* * Parse free-form text, that is, a line that does not begin with the * control character. @@ -196,7 +180,8 @@ mdoc_ptext(struct roff_man *mdoc, int line, char *buf, (n->parent != NULL && n->parent->tok == MDOC_Bl && n->parent->norm->Bl.type == LIST_column)) { mdoc->flags |= MDOC_FREECOL; - mdoc_macro(mdoc, MDOC_It, line, offs, &offs, buf); + (*mdoc_macro(MDOC_It)->fp)(mdoc, MDOC_It, + line, offs, &offs, buf); return 1; } @@ -378,7 +363,7 @@ mdoc_pmacro(struct roff_man *mdoc, int ln, char *buf, n = mdoc->last; if (n == NULL || tok == MDOC_It || tok == MDOC_El) { - mdoc_macro(mdoc, tok, ln, sv, &offs, buf); + (*mdoc_macro(tok)->fp)(mdoc, tok, ln, sv, &offs, buf); return 1; } @@ -394,13 +379,13 @@ mdoc_pmacro(struct roff_man *mdoc, int ln, char *buf, (n->parent != NULL && n->parent->tok == MDOC_Bl && n->parent->norm->Bl.type == LIST_column)) { mdoc->flags |= MDOC_FREECOL; - mdoc_macro(mdoc, MDOC_It, ln, sv, &sv, buf); + (*mdoc_macro(MDOC_It)->fp)(mdoc, MDOC_It, ln, sv, &sv, buf); return 1; } /* Normal processing of a macro. */ - mdoc_macro(mdoc, tok, ln, sv, &offs, buf); + (*mdoc_macro(tok)->fp)(mdoc, tok, ln, sv, &offs, buf); /* In quick mode (for mandocdb), abort after the NAME section. */