aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/main.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-08-16 23:04:25 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-08-16 23:04:25 +0000
commit7d593fa69b20a5bf1d8d8b1280a0aacd5296026c (patch)
treef48d6790a69a5e93ab87beb96fc93e09c1fce5a3 /main.c
parentb2a9c33559ec13a867fe90dca3e869e33d088e15 (diff)
downloadmandoc-7d593fa69b20a5bf1d8d8b1280a0aacd5296026c.tar.gz
mandoc-7d593fa69b20a5bf1d8d8b1280a0aacd5296026c.tar.zst
mandoc-7d593fa69b20a5bf1d8d8b1280a0aacd5296026c.zip
When BUILD_DB is active, link apropos(1) into the mandoc binary.
This is the first step on the way to a man(1) implementation. The new ./configure is flexible enough to make this step quite easy.
Diffstat (limited to 'main.c')
-rw-r--r--main.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/main.c b/main.c
index 32ed232c..623c9810 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.178 2014/08/10 23:54:41 schwarze Exp $ */
+/* $Id: main.c,v 1.179 2014/08/16 23:04:25 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011, 2012, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -68,6 +68,10 @@ struct curparse {
char outopts[BUFSIZ]; /* buf of output opts */
};
+#if HAVE_SQLITE3
+int apropos(int, char**);
+#endif
+
static int moptions(int *, char *);
static void mmsg(enum mandocerr, enum mandoclevel,
const char *, int, int, const char *);
@@ -96,6 +100,12 @@ main(int argc, char *argv[])
else
++progname;
+#if HAVE_SQLITE3
+ if (0 == strncmp(progname, "apropos", 7) ||
+ 0 == strncmp(progname, "whatis", 6))
+ return(apropos(argc, argv));
+#endif
+
memset(&curp, 0, sizeof(struct curparse));
options = MPARSE_SO;