aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_man.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_man.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_man.c')
-rw-r--r--mdoc_man.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/mdoc_man.c b/mdoc_man.c
index 484268ac..e1068ace 100644
--- a/mdoc_man.c
+++ b/mdoc_man.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_man.c,v 1.89 2015/04/02 21:36:50 schwarze Exp $ */
+/* $Id: mdoc_man.c,v 1.90 2015/04/02 22:48:17 schwarze Exp $ */
/*
* Copyright (c) 2011-2015 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -30,7 +30,7 @@
#include "out.h"
#include "main.h"
-#define DECL_ARGS const struct mdoc_meta *meta, struct mdoc_node *n
+#define DECL_ARGS const struct mdoc_meta *meta, struct roff_node *n
struct manact {
int (*cond)(DECL_ARGS); /* DON'T run actions */
@@ -108,7 +108,7 @@ static int pre_sm(DECL_ARGS);
static int pre_sp(DECL_ARGS);
static int pre_sect(DECL_ARGS);
static int pre_sy(DECL_ARGS);
-static void pre_syn(const struct mdoc_node *);
+static void pre_syn(const struct roff_node *);
static int pre_vt(DECL_ARGS);
static int pre_ux(DECL_ARGS);
static int pre_xr(DECL_ARGS);
@@ -117,7 +117,7 @@ static void print_line(const char *, int);
static void print_block(const char *, int);
static void print_offs(const char *, int);
static void print_width(const struct mdoc_bl *,
- const struct mdoc_node *);
+ const struct roff_node *);
static void print_count(int *);
static void print_node(DECL_ARGS);
@@ -468,7 +468,7 @@ print_offs(const char *v, int keywords)
* Set up the indentation for a list item; used from pre_it().
*/
static void
-print_width(const struct mdoc_bl *bl, const struct mdoc_node *child)
+print_width(const struct mdoc_bl *bl, const struct roff_node *child)
{
char buf[24];
struct roffsu su;
@@ -548,7 +548,7 @@ void
man_mdoc(void *arg, const struct mdoc *mdoc)
{
const struct mdoc_meta *meta;
- struct mdoc_node *n;
+ struct roff_node *n;
meta = mdoc_meta(mdoc);
n = mdoc_node(mdoc)->child;
@@ -578,7 +578,7 @@ static void
print_node(DECL_ARGS)
{
const struct manact *act;
- struct mdoc_node *sub;
+ struct roff_node *sub;
int cond, do_sub;
/*
@@ -808,7 +808,7 @@ post_sect(DECL_ARGS)
/* See mdoc_term.c, synopsis_pre() for comments. */
static void
-pre_syn(const struct mdoc_node *n)
+pre_syn(const struct roff_node *n)
{
if (NULL == n->prev || ! (MDOC_SYNPRETTY & n->flags))
@@ -1366,7 +1366,7 @@ post_in(DECL_ARGS)
static int
pre_it(DECL_ARGS)
{
- const struct mdoc_node *bln;
+ const struct roff_node *bln;
switch (n->type) {
case ROFFT_HEAD:
@@ -1463,7 +1463,7 @@ mid_it(void)
static void
post_it(DECL_ARGS)
{
- const struct mdoc_node *bln;
+ const struct roff_node *bln;
bln = n->parent->parent;
@@ -1533,7 +1533,7 @@ post_lb(DECL_ARGS)
static int
pre_lk(DECL_ARGS)
{
- const struct mdoc_node *link, *descr;
+ const struct roff_node *link, *descr;
if (NULL == (link = n->child))
return(0);