aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libroff.h
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-02-06 20:36:36 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-02-06 20:36:36 +0000
commit91ab27befd54e154790aa66b308e8be09659b580 (patch)
tree24cae421e50218e0c183605b729798a0146b75f0 /libroff.h
parent1a6d2f41dc5d79b1f83a510dbb34a2ac3357a651 (diff)
downloadmandoc-91ab27befd54e154790aa66b308e8be09659b580.tar.gz
mandoc-91ab27befd54e154790aa66b308e8be09659b580.tar.zst
mandoc-91ab27befd54e154790aa66b308e8be09659b580.zip
Add initial EQN support to mandoc. This parses, then throws away, data
between EQ and EN roff blocks. EQN is different from TBL in that data after .EQ is unilaterally considered an equation until an .EN. Thus, there's no need to jump through hoops in having table spans and so on. This is ONLY the parse code framework in libroff. EQN is not yet passed into the backends.
Diffstat (limited to 'libroff.h')
-rw-r--r--libroff.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/libroff.h b/libroff.h
index 500479e0..b03873a2 100644
--- a/libroff.h
+++ b/libroff.h
@@ -1,4 +1,4 @@
-/* $Id: libroff.h,v 1.17 2011/01/25 12:24:27 schwarze Exp $ */
+/* $Id: libroff.h,v 1.18 2011/02/06 20:36:36 kristaps Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -43,6 +43,13 @@ struct tbl_node {
struct tbl_node *next;
};
+struct eqn_node {
+ int pos; /* invocation column */
+ int line; /* invocation line */
+ struct eqn eqn;
+ struct eqn_node *next;
+};
+
#define TBL_MSG(tblp, type, line, col) \
(*(tblp)->msg)((type), (tblp)->data, (line), (col), NULL)
@@ -57,6 +64,10 @@ 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);
+void eqn_end(struct eqn_node *);
+void eqn_free(struct eqn_node *);
+enum rofferr eqn_read(struct eqn_node **, int, const char *, int);
__END_DECLS