source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Put section and architecture info into the keys table, in
@ 2014-01-05  0:29 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2014-01-05  0:29 UTC (permalink / raw)
  To: source

Log Message:
-----------
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]

Modified Files:
--------------
    mdocml:
        mandocdb.c
        mansearch.c
        mansearch.h

Revision Data
-------------
Index: mansearch.h
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mansearch.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -Lmansearch.h -Lmansearch.h -u -p -r1.6 -r1.7
--- mansearch.h
+++ mansearch.h
@@ -58,6 +58,8 @@
 #define	TYPE_Va		 0x0000000800000000ULL
 #define	TYPE_Vt		 0x0000001000000000ULL
 #define	TYPE_Xr		 0x0000002000000000ULL
+#define	TYPE_sec	 0x0000004000000000ULL
+#define	TYPE_arch	 0x0000008000000000ULL
 
 __BEGIN_DECLS
 
Index: mansearch.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mansearch.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -Lmansearch.c -Lmansearch.c -u -p -r1.13 -r1.14
--- mansearch.c
+++ mansearch.c
@@ -120,6 +120,8 @@ static	const struct type types[] = {
 	{ TYPE_Va,  "Va" },
 	{ TYPE_Va,  "Vt" },
 	{ TYPE_Xr,  "Xr" },
+	{ TYPE_sec, "sec" },
+	{ TYPE_arch,"arch" },
 	{ ~0ULL,    "any" },
 	{ 0ULL, NULL }
 };
Index: mandocdb.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandocdb.c,v
retrieving revision 1.96
retrieving revision 1.97
diff -Lmandocdb.c -Lmandocdb.c -u -p -r1.96 -r1.97
--- mandocdb.c
+++ mandocdb.c
@@ -1024,9 +1024,17 @@ mpages_merge(struct mchars *mc, struct m
 			mpage->title =
 			    mandoc_strdup(mpage->mlinks->name);
 		}
+		putkey(mpage, mpage->sec, TYPE_sec);
+		putkey(mpage, mpage->arch, TYPE_arch);
 
-		for (mlink = mpage->mlinks; mlink; mlink = mlink->next)
+		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;
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-01-05  0:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-05  0:29 mdocml: Put section and architecture info into the keys table, in schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).