source@mandoc.bsd.lv
 help / color / mirror / Atom feed
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
Date: Sun, 27 Nov 2011 18:11:37 -0500 (EST)	[thread overview]
Message-ID: <201111272311.pARNBbIN003742@krisdoz.my.domain> (raw)

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

                 reply	other threads:[~2011-11-27 23:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201111272311.pARNBbIN003742@krisdoz.my.domain \
    --to=schwarze@mdocml.bsd.lv \
    --cc=source@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).