From 18eee2d9c65b7a339eca76bab2f6c525890a56fe Mon Sep 17 00:00:00 2001 From: schwarze Date: Mon, 19 Dec 2011 02:26:33 +0000 Subject: Improvements from kristaps@: (1) Make the database format simpler and smaller by - storing the file type as a single character and - storing paths relative to the dir containing the database. The latter allows to move trees around. Both together typically save 15-25% of the index size. (2) Make sure apropos(1) "any" really covers all search keys. (3) Make manpath_parseline() static, drop manpath_parseconf() completely. --- usr.bin/mandoc/manpath.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'usr.bin/mandoc/manpath.c') diff --git a/usr.bin/mandoc/manpath.c b/usr.bin/mandoc/manpath.c index 86084a7aca5..ed58c403ccf 100644 --- a/usr.bin/mandoc/manpath.c +++ b/usr.bin/mandoc/manpath.c @@ -1,4 +1,4 @@ -/* $Id: manpath.c,v 1.2 2011/12/12 01:59:13 schwarze Exp $ */ +/* $Id: manpath.c,v 1.3 2011/12/19 02:26:33 schwarze Exp $ */ /* * Copyright (c) 2011 Ingo Schwarze * Copyright (c) 2011 Kristaps Dzonsons @@ -16,7 +16,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include +#include + #include #include #include @@ -31,6 +32,7 @@ #define MAN_CONF_KEY "_whatdb" static void manpath_add(struct manpaths *, const char *); +static void manpath_parseline(struct manpaths *, char *); void manpath_parse(struct manpaths *dirs, const char *file, @@ -43,7 +45,7 @@ manpath_parse(struct manpaths *dirs, const char *file, defp = getenv("MANPATH"); if (NULL == defp) - manpath_parseconf(dirs, file); + manpath_manconf(dirs, file ? file : MAN_CONF_FILE); else manpath_parseline(dirs, defp); } @@ -51,7 +53,7 @@ manpath_parse(struct manpaths *dirs, const char *file, /* * Parse a FULL pathname from a colon-separated list of arrays. */ -void +static void manpath_parseline(struct manpaths *dirs, char *path) { char *dir; @@ -88,13 +90,6 @@ manpath_add(struct manpaths *dirs, const char *dir) dirs->paths[dirs->sz++] = mandoc_strdup(cp); } -void -manpath_parseconf(struct manpaths *dirs, const char *file) -{ - - manpath_manconf(dirs, file ? file : MAN_CONF_FILE); -} - void manpath_free(struct manpaths *p) { -- cgit v1.2.3-59-g8ed1b