aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-04-02 22:48:17 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-04-02 22:48:17 +0000
commit8a1e7c36cb8b9ca64c677d1ff9d786c9e46fd7b0 (patch)
tree8875174fa99d2fb62fe97ec308a53905416a4e4f /mdoc_term.c
parent483afc5a7a52b601da9e854d5645cd4b0a140184 (diff)
downloadmandoc-8a1e7c36cb8b9ca64c677d1ff9d786c9e46fd7b0.tar.gz
mandoc-8a1e7c36cb8b9ca64c677d1ff9d786c9e46fd7b0.tar.zst
mandoc-8a1e7c36cb8b9ca64c677d1ff9d786c9e46fd7b0.zip
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.
Diffstat (limited to 'mdoc_term.c')
-rw-r--r--mdoc_term.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index 342ca5aa..410f941e 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.314 2015/04/02 21:36:50 schwarze Exp $ */
+/* $Id: mdoc_term.c,v 1.315 2015/04/02 22:48:17 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -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);