diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2018-12-30 00:49:54 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2018-12-30 00:49:54 +0000 |
commit | 0cd2663fe9e76ba0ad357a566dc3416eccab70e5 (patch) | |
tree | bdd4ce48b3029984474e5d53e3fdbca949b317c9 /mandoc_parse.h | |
parent | cf618db57fee5de46ee351c83eeb03292758f546 (diff) | |
download | mandoc-0cd2663fe9e76ba0ad357a566dc3416eccab70e5.tar.gz |
Cleanup, no functional change:
The struct roff_man used to be a bad mixture of internal parser
state and public parsing results. Move the public results to the
parsing result struct roff_meta, which is already public. Move the
rest of struct roff_man to the parser-internal header roff_int.h.
Since the validators need access to the parser state, call them
from the top level parser during mparse_result() rather than from
the main programs, also reducing code duplication.
This keeps parser internal state out of thee main programs (five
in mandoc portable) and out of eight formatters.
Diffstat (limited to 'mandoc_parse.h')
-rw-r--r-- | mandoc_parse.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mandoc_parse.h b/mandoc_parse.h index ee9bfd0b..ce55ce16 100644 --- a/mandoc_parse.h +++ b/mandoc_parse.h @@ -28,10 +28,11 @@ #define MPARSE_QUICK (1 << 3) /* abort the parse early */ #define MPARSE_UTF8 (1 << 4) /* accept UTF-8 input */ #define MPARSE_LATIN1 (1 << 5) /* accept ISO-LATIN-1 input */ +#define MPARSE_VALIDATE (1 << 6) /* call validation functions */ +struct roff_meta; struct mparse; -struct roff_man; struct mparse *mparse_alloc(int, enum mandoc_os, const char *); void mparse_copy(const struct mparse *); @@ -39,5 +40,4 @@ void mparse_free(struct mparse *); int mparse_open(struct mparse *, const char *); void mparse_readfd(struct mparse *, int, const char *); void mparse_reset(struct mparse *); -void mparse_result(struct mparse *, - struct roff_man **, char **); +struct roff_meta *mparse_result(struct mparse *); |