From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from krisdoz.my.domain (schwarze@localhost [127.0.0.1]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id pARNBbX8014251 for ; Sun, 27 Nov 2011 18:11:37 -0500 (EST) Received: (from schwarze@localhost) by krisdoz.my.domain (8.14.3/8.14.3/Submit) id pARNBbIN003742; Sun, 27 Nov 2011 18:11:37 -0500 (EST) Date: Sun, 27 Nov 2011 18:11:37 -0500 (EST) Message-Id: <201111272311.pARNBbIN003742@krisdoz.my.domain> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: Save the manual type (mdoc, man, or cat) in the index file of X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Save the manual type (mdoc, man, or cat) in the index file of the mandoc databases, as suggested by kristaps@. Given the well-structured code, this is surprisingly simple. This changes the mandoc.index database format. Run "sudo mandocdb" to regenerate your databases. Modified Files: -------------- mdocml: apropos_db.c apropos_db.h mandocdb.c Revision Data ------------- Index: apropos_db.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/apropos_db.c,v retrieving revision 1.13 retrieving revision 1.14 diff -Lapropos_db.c -Lapropos_db.c -u -p -r1.13 -r1.14 --- apropos_db.c +++ apropos_db.c @@ -366,6 +366,7 @@ index_read(const DBT *key, const DBT *va rec->res.rec = *(recno_t *)key->data; rec->res.volume = index; + INDEX_BREAD(rec->res.type); INDEX_BREAD(rec->res.file); INDEX_BREAD(rec->res.cat); INDEX_BREAD(rec->res.title); Index: mandocdb.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandocdb.c,v retrieving revision 1.14 retrieving revision 1.15 diff -Lmandocdb.c -Lmandocdb.c -u -p -r1.14 -r1.15 --- mandocdb.c +++ mandocdb.c @@ -592,6 +592,7 @@ index_merge(const struct of *of, struct */ dbuf->len = 0; + buf_append(dbuf, mdoc ? "mdoc" : (man ? "man" : "cat")); buf_appendb(dbuf, fn, strlen(fn) + 1); buf_appendb(dbuf, msec, strlen(msec) + 1); buf_appendb(dbuf, mtitle, strlen(mtitle) + 1); Index: apropos_db.h =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/apropos_db.h,v retrieving revision 1.9 retrieving revision 1.10 diff -Lapropos_db.h -Lapropos_db.h -u -p -r1.9 -r1.10 --- apropos_db.h +++ apropos_db.h @@ -18,6 +18,7 @@ #define APROPOS_H struct res { + char *type; /* file type: mdoc, man or cat */ char *file; /* file in file-system */ char *cat; /* category (3p, 3, etc.) */ char *title; /* title (FOO, etc.) */ -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv