aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-07-12 21:32:43 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-07-12 21:32:43 +0000
commit512ce49526822961cde1cef8b80236afa5ddb4dc (patch)
treee2a635960dc9d24cf482ad4de15972ec33abfff4
parentf23f76a0eac229ba8c7c6bdbd9e0f474b32251d2 (diff)
downloadmandoc-512ce49526822961cde1cef8b80236afa5ddb4dc.tar.gz
mandoc-512ce49526822961cde1cef8b80236afa5ddb4dc.tar.zst
mandoc-512ce49526822961cde1cef8b80236afa5ddb4dc.zip
Have equation be allocated with mparse. Will be needed for logging of
messages.
-rw-r--r--eqn.c6
-rw-r--r--libroff.h5
-rw-r--r--roff.c4
3 files changed, 9 insertions, 6 deletions
diff --git a/eqn.c b/eqn.c
index 220f3f88..323b0442 100644
--- a/eqn.c
+++ b/eqn.c
@@ -1,4 +1,4 @@
-/* $Id: eqn.c,v 1.4 2011/03/22 09:48:13 kristaps Exp $ */
+/* $Id: eqn.c,v 1.5 2011/07/12 21:32:43 kristaps Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -53,11 +53,13 @@ eqn_read(struct eqn_node **epp, int ln, const char *p, int offs)
}
struct eqn_node *
-eqn_alloc(int pos, int line)
+eqn_alloc(int pos, int line, struct mparse *parse)
{
struct eqn_node *p;
p = mandoc_calloc(1, sizeof(struct eqn_node));
+ p->parse = parse;
+
p->eqn.line = line;
p->eqn.pos = pos;
diff --git a/libroff.h b/libroff.h
index d0136887..9831b19e 100644
--- a/libroff.h
+++ b/libroff.h
@@ -1,4 +1,4 @@
-/* $Id: libroff.h,v 1.20 2011/03/20 16:02:05 kristaps Exp $ */
+/* $Id: libroff.h,v 1.21 2011/07/12 21:32:43 kristaps Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -45,6 +45,7 @@ struct tbl_node {
struct eqn_node {
struct eqn eqn;
struct eqn_node *next;
+ struct mparse *parse;
};
struct tbl_node *tbl_alloc(int, int, struct mparse *);
@@ -58,7 +59,7 @@ int tbl_data(struct tbl_node *, int, const char *);
int tbl_cdata(struct tbl_node *, int, const char *);
const struct tbl_span *tbl_span(struct tbl_node *);
void tbl_end(struct tbl_node *);
-struct eqn_node *eqn_alloc(int, int);
+struct eqn_node *eqn_alloc(int, int, struct mparse *);
void eqn_end(struct eqn_node *);
void eqn_free(struct eqn_node *);
enum rofferr eqn_read(struct eqn_node **, int, const char *, int);
diff --git a/roff.c b/roff.c
index 79d0897e..b6fa4682 100644
--- a/roff.c
+++ b/roff.c
@@ -1,4 +1,4 @@
-/* $Id: roff.c,v 1.144 2011/07/08 09:28:33 kristaps Exp $ */
+/* $Id: roff.c,v 1.145 2011/07/12 21:32:43 kristaps Exp $ */
/*
* Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -1179,7 +1179,7 @@ roff_EQ(ROFF_ARGS)
struct eqn_node *e;
assert(NULL == r->eqn);
- e = eqn_alloc(ppos, ln);
+ e = eqn_alloc(ppos, ln, r->parse);
if (r->last_eqn)
r->last_eqn->next = e;