summaryrefslogtreecommitdiffstats
path: root/read.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-07-18 07:46:41 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-07-18 07:46:41 +0000
commitfe200714381b9d81c222bda224df0dc6dfc61c8a (patch)
tree209bef8a4f53984c628091c1fad8b4817c290671 /read.c
parentbafe4939fd3c12ed13bf24cf2f317e39910722bb (diff)
downloadmandoc-fe200714381b9d81c222bda224df0dc6dfc61c8a.tar.gz
Make `struct roff' be passed into libmdoc and libman upon creation.
This is required for supporting in-line equations. While here, push registers properly into roff and add an set/get/mod interface.
Diffstat (limited to 'read.c')
-rw-r--r--read.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/read.c b/read.c
index 28d53acc..ae6d098e 100644
--- a/read.c
+++ b/read.c
@@ -59,7 +59,6 @@ struct mparse {
struct man *man; /* man parser */
struct mdoc *mdoc; /* mdoc parser */
struct roff *roff; /* roff parser (!NULL) */
- struct regset regs; /* roff registers */
int reparse_count; /* finite interp. stack */
mandocmsg mmsg; /* warning/error message handler */
void *arg; /* argument to mmsg */
@@ -243,13 +242,13 @@ pset(const char *buf, int pos, struct mparse *curp)
switch (curp->inttype) {
case (MPARSE_MDOC):
if (NULL == curp->pmdoc)
- curp->pmdoc = mdoc_alloc(&curp->regs, curp);
+ curp->pmdoc = mdoc_alloc(curp->roff, curp);
assert(curp->pmdoc);
curp->mdoc = curp->pmdoc;
return;
case (MPARSE_MAN):
if (NULL == curp->pman)
- curp->pman = man_alloc(&curp->regs, curp);
+ curp->pman = man_alloc(curp->roff, curp);
assert(curp->pman);
curp->man = curp->pman;
return;
@@ -259,14 +258,14 @@ pset(const char *buf, int pos, struct mparse *curp)
if (pos >= 3 && 0 == memcmp(buf, ".Dd", 3)) {
if (NULL == curp->pmdoc)
- curp->pmdoc = mdoc_alloc(&curp->regs, curp);
+ curp->pmdoc = mdoc_alloc(curp->roff, curp);
assert(curp->pmdoc);
curp->mdoc = curp->pmdoc;
return;
}
if (NULL == curp->pman)
- curp->pman = man_alloc(&curp->regs, curp);
+ curp->pman = man_alloc(curp->roff, curp);
assert(curp->pman);
curp->man = curp->pman;
}
@@ -687,7 +686,7 @@ mparse_alloc(enum mparset inttype, enum mandoclevel wlevel, mandocmsg mmsg, void
curp->arg = arg;
curp->inttype = inttype;
- curp->roff = roff_alloc(&curp->regs, curp);
+ curp->roff = roff_alloc(curp);
return(curp);
}
@@ -695,8 +694,6 @@ void
mparse_reset(struct mparse *curp)
{
- memset(&curp->regs, 0, sizeof(struct regset));
-
roff_reset(curp->roff);
if (curp->mdoc)