aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/man.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-06-27 15:52:41 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-06-27 15:52:41 +0000
commitdc649a73f967c1a61e60d2495f16d56db82eac57 (patch)
tree219a85e24404486b7c0136c293975e680de9c05d /man.c
parent0d82fb509497f4929c0d0c2c4619f27aa7fc0052 (diff)
downloadmandoc-dc649a73f967c1a61e60d2495f16d56db82eac57.tar.gz
mandoc-dc649a73f967c1a61e60d2495f16d56db82eac57.tar.zst
mandoc-dc649a73f967c1a61e60d2495f16d56db82eac57.zip
Downstream maintainers: this removes UGLY! I don't want diverging
functionality and UGLY works quite well thanks to schwarze@'s careful attention. This also backs out function-prototype changes for struct regset, instead stuffing a pointer to the regset directly into struct mdoc/man/roff.
Diffstat (limited to 'man.c')
-rw-r--r--man.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/man.c b/man.c
index 3c1dbdad..0bdff790 100644
--- a/man.c
+++ b/man.c
@@ -1,4 +1,4 @@
-/* $Id: man.c,v 1.78 2010/06/26 16:07:08 kristaps Exp $ */
+/* $Id: man.c,v 1.79 2010/06/27 15:52:41 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -54,9 +54,7 @@ static void man_node_free(struct man_node *);
static void man_node_unlink(struct man *,
struct man_node *);
static int man_ptext(struct man *, int, char *, int);
-static int man_pmacro(struct man *,
- const struct regset *regs,
- int, char *, int);
+static int man_pmacro(struct man *, int, char *, int);
static void man_free1(struct man *);
static void man_alloc1(struct man *);
static int macrowarn(struct man *, int, const char *, int);
@@ -97,7 +95,8 @@ man_free(struct man *man)
struct man *
-man_alloc(void *data, int pflags, mandocmsg msg)
+man_alloc(const struct regset *regs,
+ void *data, int pflags, mandocmsg msg)
{
struct man *p;
@@ -107,6 +106,7 @@ man_alloc(void *data, int pflags, mandocmsg msg)
p->data = data;
p->pflags = pflags;
p->msg = msg;
+ p->regs = regs;
man_alloc1(p);
return(p);
@@ -127,15 +127,14 @@ man_endparse(struct man *m)
int
-man_parseln(struct man *m, const struct regset *regs,
- int ln, char *buf, int offs)
+man_parseln(struct man *m, int ln, char *buf, int offs)
{
if (MAN_HALT & m->flags)
return(0);
return(('.' == buf[offs] || '\'' == buf[offs]) ?
- man_pmacro(m, regs, ln, buf, offs) :
+ man_pmacro(m, ln, buf, offs) :
man_ptext(m, ln, buf, offs));
}
@@ -451,8 +450,7 @@ macrowarn(struct man *m, int ln, const char *buf, int offs)
int
-man_pmacro(struct man *m, const struct regset *regs,
- int ln, char *buf, int offs)
+man_pmacro(struct man *m, int ln, char *buf, int offs)
{
int i, j, ppos;
enum mant tok;
@@ -577,7 +575,7 @@ man_pmacro(struct man *m, const struct regset *regs,
/* Call to handler... */
assert(man_macros[tok].fp);
- if ( ! (*man_macros[tok].fp)(m, regs, tok, ln, ppos, &i, buf))
+ if ( ! (*man_macros[tok].fp)(m, tok, ln, ppos, &i, buf))
goto err;
out: