aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc.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 /mdoc.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 'mdoc.c')
-rw-r--r--mdoc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mdoc.c b/mdoc.c
index ea3fda26..a648e9a5 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc.c,v 1.188 2011/03/28 23:52:13 kristaps Exp $ */
+/* $Id: mdoc.c,v 1.189 2011/07/18 07:46:41 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -193,14 +193,14 @@ mdoc_free(struct mdoc *mdoc)
* Allocate volatile and non-volatile parse resources.
*/
struct mdoc *
-mdoc_alloc(struct regset *regs, struct mparse *parse)
+mdoc_alloc(struct roff *roff, struct mparse *parse)
{
struct mdoc *p;
p = mandoc_calloc(1, sizeof(struct mdoc));
p->parse = parse;
- p->regs = regs;
+ p->roff = roff;
mdoc_hash_init();
mdoc_alloc1(p);
@@ -290,8 +290,8 @@ mdoc_parseln(struct mdoc *m, int ln, char *buf, int offs)
* whether this mode is on or off.
* Note that this mode is also switched by the Sh macro.
*/
- if (m->regs->regs[(int)REG_nS].set) {
- if (m->regs->regs[(int)REG_nS].v.u)
+ if (roff_regisset(m->roff, REG_nS)) {
+ if (roff_regget(m->roff, REG_nS))
m->flags |= MDOC_SYNOPSIS;
else
m->flags &= ~MDOC_SYNOPSIS;