summaryrefslogtreecommitdiffstats
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
commit9e6e3b6be0e9ffe29cf4876ce0b7ded2c3c386b9 (patch)
tree1a2bb3465096bc77a000c55dc5753148f39484ad /mdoc_term.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_term.c')
-rw-r--r--mdoc_term.c26
1 files changed, 13 insertions, 13 deletions
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);