diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-03-19 21:51:20 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-03-19 21:51:20 +0000 |
commit | 8ab1f57b8dbe6a9799dafa1181cae85b1e51b101 (patch) | |
tree | 1b9ce5554777a29d2110ac56f793e070aac3dc51 /mandocdb.c | |
parent | 3868c0e69fda640025525113006a7ab108fa0fef (diff) | |
download | mandoc-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 'mandocdb.c')
-rw-r--r-- | mandocdb.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -172,7 +172,7 @@ static size_t utf8(unsigned int, char [7]); static char tempfilename[32]; static char *progname; static int nodb; /* no database changes */ -static int quick; /* abort the parse early */ +static int mparse_options; /* abort the parse early */ static int use_all; /* use all found files */ static int verb; /* print what we're doing */ static int warnings; /* warn about crap */ @@ -351,6 +351,7 @@ main(int argc, char *argv[]) path_arg = NULL; op = OP_DEFAULT; + mparse_options = MPARSE_SO; while (-1 != (ch = getopt(argc, argv, "aC:d:nQT:tu:vW"))) switch (ch) { @@ -371,7 +372,7 @@ main(int argc, char *argv[]) nodb = 1; break; case ('Q'): - quick = 1; + mparse_options |= MPARSE_QUICK; break; case ('T'): if (strcmp(optarg, "utf8")) { @@ -411,8 +412,7 @@ main(int argc, char *argv[]) } exitcode = (int)MANDOCLEVEL_OK; - mp = mparse_alloc(MPARSE_AUTO, - MANDOCLEVEL_FATAL, NULL, NULL, quick); + mp = mparse_alloc(mparse_options, MANDOCLEVEL_FATAL, NULL, NULL); mc = mchars_alloc(); ohash_init(&mpages, 6, &mpages_info); @@ -1985,7 +1985,7 @@ dbopen(int real) rc = sqlite3_open_v2(MANDOC_DB "~", &db, ofl, NULL); if (SQLITE_OK == rc) goto create_tables; - if (quick) { + if (MPARSE_QUICK & mparse_options) { exitcode = (int)MANDOCLEVEL_SYSERR; say(MANDOC_DB "~", "%s", sqlite3_errmsg(db)); return(0); |