summaryrefslogtreecommitdiffstats
path: root/libroff.h
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-07-17 12:13:37 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-07-17 12:13:37 +0000
commitc65bd324370683e30cc03e16fa78b9ee7059a19e (patch)
treec34b88eba1bd0d2dcc069e123f0195ac92ddbac0 /libroff.h
parente1668c2d072b1ff1b0f569174c78d672523280a2 (diff)
downloadmandoc-c65bd324370683e30cc03e16fa78b9ee7059a19e.tar.gz
Add initial `define' support for eqn(7).
This works by iterating over a simple list. It's a slow, auditable early implementation. Data is read (the reading function will be reused) then parsed, then the line re-run if remaining stuff exists. Note this function isn't the same as mandoc_getarg(), as eqn(7) uses a different system for reading quoted strings. This doesn't actually use the defines.
Diffstat (limited to 'libroff.h')
-rw-r--r--libroff.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/libroff.h b/libroff.h
index b0e36385..4691c2d1 100644
--- a/libroff.h
+++ b/libroff.h
@@ -42,10 +42,19 @@ struct tbl_node {
struct tbl_node *next;
};
+struct eqn_def {
+ char *key;
+ size_t keysz;
+ char *val;
+ size_t valsz;
+};
+
struct eqn_node {
+ struct eqn_def *defs;
+ size_t defsz;
struct eqn eqn;
- struct eqn_node *next;
struct mparse *parse;
+ struct eqn_node *next;
};
struct tbl_node *tbl_alloc(int, int, struct mparse *);
@@ -62,7 +71,8 @@ void tbl_end(struct tbl_node *);
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);
+enum rofferr eqn_read(struct eqn_node **, int,
+ const char *, int, int *);
__END_DECLS