diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-01-05 00:29:54 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-01-05 00:29:54 +0000 |
commit | 42e809e6f89c835d55a7d3f2046e28b6a227122a (patch) | |
tree | 5270ab617b11463346a9b75a3f4d3eaa334789b5 /mandocdb.c | |
parent | 0a2a9ae852ecb58b204286332fb79bf1c2fdc161 (diff) | |
download | mandoc-42e809e6f89c835d55a7d3f2046e28b6a227122a.tar.gz mandoc-42e809e6f89c835d55a7d3f2046e28b6a227122a.tar.zst mandoc-42e809e6f89c835d55a7d3f2046e28b6a227122a.zip |
Put section and architecture info into the keys table,
in preparation for removing them from the mpages table,
aiming for cleaner and more uniform interfaces.
Database growth is below 4%, part of which will be reclaimed.
As a bonus, this allows searches like:
./obj/apropos An=kettenis -a arch=ppc
./obj/apropos An=kettenis -a sec~[^4]
Diffstat (limited to 'mandocdb.c')
-rw-r--r-- | mandocdb.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -1,4 +1,4 @@ -/* $Id: mandocdb.c,v 1.96 2014/01/02 22:44:10 schwarze Exp $ */ +/* $Id: mandocdb.c,v 1.97 2014/01/05 00:29:54 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org> @@ -1024,9 +1024,17 @@ mpages_merge(struct mchars *mc, struct mparse *mp, int check_reachable) mpage->title = mandoc_strdup(mpage->mlinks->name); } - - for (mlink = mpage->mlinks; mlink; mlink = mlink->next) + putkey(mpage, mpage->sec, TYPE_sec); + putkey(mpage, mpage->arch, TYPE_arch); + + for (mlink = mpage->mlinks; mlink; mlink = mlink->next) { + if ('\0' != *mlink->dsec) + putkey(mpage, mlink->dsec, TYPE_sec); + if ('\0' != *mlink->fsec) + putkey(mpage, mlink->fsec, TYPE_sec); + putkey(mpage, mlink->arch, TYPE_arch); putkey(mpage, mlink->name, TYPE_Nm); + } if (warnings && !use_all) { match = 0; |