aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandoc_parse.h
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-12-30 00:49:54 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-12-30 00:49:54 +0000
commit68183e3516ca405d803db497157cd8246b9b8bad (patch)
treed88411ec1f7435c594c8afcfc4b99cca3a0d5bdf /mandoc_parse.h
parentb4f47224dd1036f4d89f641195a444eea00a55e8 (diff)
downloadmandoc-68183e3516ca405d803db497157cd8246b9b8bad.tar.gz
mandoc-68183e3516ca405d803db497157cd8246b9b8bad.tar.zst
mandoc-68183e3516ca405d803db497157cd8246b9b8bad.zip
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.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/mandoc_parse.h b/mandoc_parse.h
index 5ad0f07b..61341f0d 100644
--- a/mandoc_parse.h
+++ b/mandoc_parse.h
@@ -1,4 +1,4 @@
-/* $Id: mandoc_parse.h,v 1.3 2018/12/14 01:24:49 schwarze Exp $ */
+/* $Id: mandoc_parse.h,v 1.4 2018/12/30 00:49:55 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014,2015,2016,2017,2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -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 *);