summaryrefslogtreecommitdiffstats
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
commit9e6e3b6be0e9ffe29cf4876ce0b7ded2c3c386b9 (patch)
tree1a2bb3465096bc77a000c55dc5753148f39484ad /mdoc_man.c
parentdd569c39747096c781c1cbec49b48a85ba29f23d (diff)
downloadmandoc-9e6e3b6be0e9ffe29cf4876ce0b7ded2c3c386b9.tar.gz
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.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/mdoc_man.c b/mdoc_man.c
index 005a5784..011f1efc 100644
--- a/mdoc_man.c
+++ b/mdoc_man.c
@@ -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);