summaryrefslogtreecommitdiffstats
path: root/roff.c
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
commit8ab1f57b8dbe6a9799dafa1181cae85b1e51b101 (patch)
tree1b9ce5554777a29d2110ac56f793e070aac3dc51 /roff.c
parent3868c0e69fda640025525113006a7ab108fa0fef (diff)
downloadmandoc-8ab1f57b8dbe6a9799dafa1181cae85b1e51b101.tar.gz
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 'roff.c')
-rw-r--r--roff.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/roff.c b/roff.c
index ecfaad61..28e14528 100644
--- a/roff.c
+++ b/roff.c
@@ -103,9 +103,8 @@ struct roffreg {
};
struct roff {
- enum mparset parsetype; /* requested parse type */
struct mparse *parse; /* parse point */
- int quick; /* skip standard macro deletion */
+ int options; /* parse options */
struct roffnode *last; /* leaf of stack */
int rstack[RSTACK_MAX]; /* stack of !`ie' rules */
char control; /* control character */
@@ -463,14 +462,13 @@ roff_free(struct roff *r)
struct roff *
-roff_alloc(enum mparset type, struct mparse *parse, int quick)
+roff_alloc(struct mparse *parse, int options)
{
struct roff *r;
r = mandoc_calloc(1, sizeof(struct roff));
- r->parsetype = type;
r->parse = parse;
- r->quick = quick;
+ r->options = options;
r->rstackpos = -1;
roffhash_init();
@@ -1552,7 +1550,7 @@ roff_Dd(ROFF_ARGS)
{
const char *const *cp;
- if (0 == r->quick && MPARSE_MDOC != r->parsetype)
+ if (0 == ((MPARSE_MDOC | MPARSE_QUICK) & r->options))
for (cp = __mdoc_reserved; *cp; cp++)
roff_setstr(r, *cp, NULL, 0);
@@ -1565,7 +1563,7 @@ roff_TH(ROFF_ARGS)
{
const char *const *cp;
- if (0 == r->quick && MPARSE_MDOC != r->parsetype)
+ if (0 == (MPARSE_QUICK & r->options))
for (cp = __man_reserved; *cp; cp++)
roff_setstr(r, *cp, NULL, 0);