diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2017-04-29 12:45:41 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2017-04-29 12:45:41 +0000 |
commit | 45a0a327d5183355d3878057425e8aa9935d70db (patch) | |
tree | 448aed7c4693391cdd674fdd7257a4435fdc216e /roff.h | |
parent | 882c99984a5b562bef7d6cb4685a04fba62a7852 (diff) | |
download | mandoc-45a0a327d5183355d3878057425e8aa9935d70db.tar.gz mandoc-45a0a327d5183355d3878057425e8aa9935d70db.tar.zst mandoc-45a0a327d5183355d3878057425e8aa9935d70db.zip |
Parser unification: use nice ohashes for all three request and macro tables;
no functional change, minus two source files, minus 200 lines of code.
Diffstat (limited to 'roff.h')
-rw-r--r-- | roff.h | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $Id: roff.h,v 1.41 2017/04/24 23:06:18 schwarze Exp $ */ +/* $Id: roff.h,v 1.42 2017/04/29 12:45:42 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2013, 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org> @@ -16,6 +16,7 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +struct ohash; struct mdoc_arg; union mdoc_data; @@ -538,6 +539,8 @@ struct roff_man { struct roff_meta meta; /* Document meta-data. */ struct mparse *parse; /* Parse pointer. */ struct roff *roff; /* Roff parser state data. */ + struct ohash *mdocmac; /* Mdoc macro lookup table. */ + struct ohash *manmac; /* Man macro lookup table. */ const char *defos; /* Default operating system. */ struct roff_node *first; /* The first node parsed. */ struct roff_node *last; /* The last node parsed. */ @@ -569,4 +572,8 @@ struct roff_man { extern const char *const *roff_name; + void deroff(char **, const struct roff_node *); +struct ohash *roffhash_alloc(enum roff_tok, enum roff_tok); +enum roff_tok roffhash_find(struct ohash *, const char *, size_t); +void roffhash_free(struct ohash *); |