aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit495895571c4a70fbf6e228700c3d58f4e7560839 (patch)
tree76be9f83a27d07a076566eb9b1c97c25ccd5db6c /read.c
parentf8842cd771b741905db8b54ed39c155f3a4ffa51 (diff)
downloadmandoc-495895571c4a70fbf6e228700c3d58f4e7560839.tar.gz
mandoc-495895571c4a70fbf6e228700c3d58f4e7560839.tar.zst
mandoc-495895571c4a70fbf6e228700c3d58f4e7560839.zip
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.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/read.c b/read.c
index 8066e87c..ee713705 100644
--- a/read.c
+++ b/read.c
@@ -1,4 +1,4 @@
-/* $Id: read.c,v 1.17 2011/07/17 14:08:49 kristaps Exp $ */
+/* $Id: read.c,v 1.18 2011/07/18 07:46:41 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -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)