summaryrefslogtreecommitdiffstats
path: root/mdoc.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-02-09 09:05:52 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-02-09 09:05:52 +0000
commit31585348ea96dc3d531dd9a8fdbea4ad5ce4b927 (patch)
tree5ec5f6dd3a3a8484263747c3ea413fb5e90adf13 /mdoc.c
parent39f12eb291ae2c50f721965715032dae57e1162e (diff)
downloadmandoc-31585348ea96dc3d531dd9a8fdbea4ad5ce4b927.tar.gz
Allow EQN data to be pushed down into libmdoc via mdoc_addeqn(). Only
the adding itself is implemented; equation data is not yet shown.
Diffstat (limited to 'mdoc.c')
-rw-r--r--mdoc.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/mdoc.c b/mdoc.c
index 842baec0..ef8a3dc2 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -222,6 +222,30 @@ mdoc_endparse(struct mdoc *m)
}
int
+mdoc_addeqn(struct mdoc *m, const struct eqn *ep)
+{
+ struct mdoc_node *n;
+
+ assert( ! (MDOC_HALT & m->flags));
+
+ /* No text before an initial macro. */
+
+ if (SEC_NONE == m->lastnamed) {
+ mdoc_pmsg(m, ep->line, ep->pos, MANDOCERR_NOTEXT);
+ return(1);
+ }
+
+ n = node_alloc(m, ep->line, ep->pos, MDOC_MAX, MDOC_EQN);
+ n->eqn = ep;
+
+ if ( ! node_append(m, n))
+ return(0);
+
+ m->next = MDOC_NEXT_SIBLING;
+ return(1);
+}
+
+int
mdoc_addspan(struct mdoc *m, const struct tbl_span *sp)
{
struct mdoc_node *n;