aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandoc.h
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-03-19 21:51:20 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-03-19 21:51:20 +0000
commit79d152fe17d260ddca9686d56a71ecaa8d58ecd2 (patch)
tree67e99d2be668b0013c9877e147deb8a4e9483f07 /mandoc.h
parent4f76006bc436b161a057a905ad55d9b213a6a141 (diff)
downloadmandoc-79d152fe17d260ddca9686d56a71ecaa8d58ecd2.tar.gz
mandoc-79d152fe17d260ddca9686d56a71ecaa8d58ecd2.tar.zst
mandoc-79d152fe17d260ddca9686d56a71ecaa8d58ecd2.zip
Generalize the mparse_alloc() and roff_alloc() functions by giving
them an "options" argument, replacing the existing "inttype" and "quick" arguments, preparing for a future MPARSE_SO option. Store this argument in struct mparse and struct roff, replacing the existing "inttype", "parsetype", and "quick" members. No functional change except one tiny cosmetic fix in roff_TH().
Diffstat (limited to 'mandoc.h')
-rw-r--r--mandoc.h18
1 files changed, 7 insertions, 11 deletions
diff --git a/mandoc.h b/mandoc.h
index 99b1ff81..1f13db78 100644
--- a/mandoc.h
+++ b/mandoc.h
@@ -1,4 +1,4 @@
-/* $Id: mandoc.h,v 1.115 2014/01/22 20:58:39 schwarze Exp $ */
+/* $Id: mandoc.h,v 1.116 2014/03/19 21:51:20 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -372,15 +372,12 @@ struct eqn {
};
/*
- * The type of parse sequence. This value is usually passed via the
- * mandoc(1) command line of -man and -mdoc. It's almost exclusively
- * -mandoc but the others have been retained for compatibility.
+ * Parse options.
*/
-enum mparset {
- MPARSE_AUTO, /* magically determine the document type */
- MPARSE_MDOC, /* assume -mdoc */
- MPARSE_MAN /* assume -man */
-};
+#define MPARSE_MDOC 1 /* assume -mdoc */
+#define MPARSE_MAN 2 /* assume -man */
+#define MPARSE_SO 4 /* honour .so requests */
+#define MPARSE_QUICK 8 /* abort the parse early */
enum mandoc_esc {
ESCAPE_ERROR = 0, /* bail! unparsable escape */
@@ -422,8 +419,7 @@ int mchars_spec2cp(const struct mchars *,
const char *, size_t);
const char *mchars_spec2str(const struct mchars *,
const char *, size_t, size_t *);
-struct mparse *mparse_alloc(enum mparset, enum mandoclevel,
- mandocmsg, char *, int);
+struct mparse *mparse_alloc(int, enum mandoclevel, mandocmsg, char *);
void mparse_free(struct mparse *);
void mparse_keep(struct mparse *);
enum mandoclevel mparse_readfd(struct mparse *, int, const char *);