From 7d593fa69b20a5bf1d8d8b1280a0aacd5296026c Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 16 Aug 2014 23:04:25 +0000 Subject: 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. --- main.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'main.c') 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 * Copyright (c) 2010, 2011, 2012, 2014 Ingo Schwarze @@ -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; -- cgit v1.2.3-56-ge451