From 9e6e3b6be0e9ffe29cf4876ce0b7ded2c3c386b9 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Thu, 2 Apr 2015 22:48:17 +0000 Subject: Second step towards parser unification: Replace struct mdoc_node and struct man_node by a unified struct roff_node. To be able to use the tok member for both mdoc(7) and man(7) without defining all the macros in roff.h, sacrifice a tiny bit of type safety and make tok an int rather than an enum. Almost mechanical, no functional change. Written on the Eurostar from Bruxelles to London on the way to p2k15. --- mdoc_term.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'mdoc_term.c') diff --git a/mdoc_term.c b/mdoc_term.c index e00b78b0..aa4aec31 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -44,7 +44,7 @@ struct termpair { #define DECL_ARGS struct termp *p, \ struct termpair *pair, \ const struct mdoc_meta *meta, \ - struct mdoc_node *n + struct roff_node *n struct termact { int (*pre)(DECL_ARGS); @@ -54,14 +54,14 @@ struct termact { static int a2width(const struct termp *, const char *); static void print_bvspace(struct termp *, - const struct mdoc_node *, - const struct mdoc_node *); + const struct roff_node *, + const struct roff_node *); static void print_mdoc_node(DECL_ARGS); static void print_mdoc_nodelist(DECL_ARGS); static void print_mdoc_head(struct termp *, const void *); static void print_mdoc_foot(struct termp *, const void *); static void synopsis_pre(struct termp *, - const struct mdoc_node *); + const struct roff_node *); static void termp____post(DECL_ARGS); static void termp__t_post(DECL_ARGS); @@ -254,7 +254,7 @@ void terminal_mdoc(void *arg, const struct mdoc *mdoc) { const struct mdoc_meta *meta; - struct mdoc_node *n; + struct roff_node *n; struct termp *p; p = (struct termp *)arg; @@ -549,10 +549,10 @@ a2width(const struct termp *p, const char *v) */ static void print_bvspace(struct termp *p, - const struct mdoc_node *bl, - const struct mdoc_node *n) + const struct roff_node *bl, + const struct roff_node *n) { - const struct mdoc_node *nn; + const struct roff_node *nn; assert(n); @@ -610,7 +610,7 @@ static int termp_it_pre(DECL_ARGS) { char buf[24]; - const struct mdoc_node *bl, *nn; + const struct roff_node *bl, *nn; size_t ncols, dcol; int i, offset, width; enum mdoc_list type; @@ -1267,7 +1267,7 @@ termp_xr_pre(DECL_ARGS) * macro combos). */ static void -synopsis_pre(struct termp *p, const struct mdoc_node *n) +synopsis_pre(struct termp *p, const struct roff_node *n) { /* * Obviously, if we're not in a SYNOPSIS or no prior macros @@ -1515,7 +1515,7 @@ termp_fn_pre(DECL_ARGS) static int termp_fa_pre(DECL_ARGS) { - const struct mdoc_node *nn; + const struct roff_node *nn; if (n->parent->tok != MDOC_Fo) { term_fontpush(p, TERMFONT_UNDER); @@ -1541,7 +1541,7 @@ static int termp_bd_pre(DECL_ARGS) { size_t tabwidth, lm, len, rm, rmax; - struct mdoc_node *nn; + struct roff_node *nn; int offset; if (n->type == ROFFT_BLOCK) { @@ -2170,7 +2170,7 @@ termp_li_pre(DECL_ARGS) static int termp_lk_pre(DECL_ARGS) { - const struct mdoc_node *link, *descr; + const struct roff_node *link, *descr; if (NULL == (link = n->child)) return(0); -- cgit