diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-07-18 07:46:41 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-07-18 07:46:41 +0000 |
commit | fe200714381b9d81c222bda224df0dc6dfc61c8a (patch) | |
tree | 209bef8a4f53984c628091c1fad8b4817c290671 /read.c | |
parent | bafe4939fd3c12ed13bf24cf2f317e39910722bb (diff) | |
download | mandoc-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.c | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -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) |