summaryrefslogtreecommitdiffstats
path: root/mandocdb.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-01-05 00:29:54 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-01-05 00:29:54 +0000
commit54a35af24eafe969f6b7acd3eb923ffa75bfb0ab (patch)
tree7c863df45c95f067bc73be88c8c3e15ddf0741bb /mandocdb.c
parent8281d16ab8523b1a8236af7e4319deff2c05090b (diff)
downloadmandoc-54a35af24eafe969f6b7acd3eb923ffa75bfb0ab.tar.gz
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.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/mandocdb.c b/mandocdb.c
index c6e8ff7c..c6680163 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -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;