aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandocdb.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
commit79d152fe17d260ddca9686d56a71ecaa8d58ecd2 (patch)
tree67e99d2be668b0013c9877e147deb8a4e9483f07 /mandocdb.c
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 'mandocdb.c')
-rw-r--r--mandocdb.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/mandocdb.c b/mandocdb.c
index cea720ac..48d3deb3 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -1,4 +1,4 @@
-/* $Id: mandocdb.c,v 1.115 2014/03/18 16:56:10 schwarze Exp $ */
+/* $Id: mandocdb.c,v 1.116 2014/03/19 21:51:20 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -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);