source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: move mandocdb(1) to mandocdb(8) "please make this change"
@ 2011-07-14 14:36 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2011-07-14 14:36 UTC (permalink / raw)
  To: source

Log Message:
-----------
move mandocdb(1) to mandocdb(8)
"please make this change" kristaps@

Modified Files:
--------------
    mdocml:
        Makefile
        index.sgml
        mandocdb.c

Added Files:
-----------
    mdocml:
        mandocdb.8

Removed Files:
-------------
    mdocml:
        mandocdb.1

Revision Data
-------------
--- /dev/null
+++ mandocdb.8
@@ -0,0 +1,191 @@
+.\"	$Id: mandocdb.8,v 1.1 2011/07/14 14:36:37 schwarze Exp $
+.\"
+.\" Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
+.\"
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\"
+.Dd $Mdocdate: July 14 2011 $
+.Dt MANDOCDB 8
+.Os
+.Sh NAME
+.Nm mandocdb
+.Nd index UNIX manuals
+.Sh SYNOPSIS
+.Nm
+.Op Fl ruv
+.Op Fl d Ar dir
+.Ar
+.Sh DESCRIPTION
+The
+.Nm
+utility extracts keywords from
+.Ux
+manuals and indexes them for fast retrieval.
+The arguments are as follows:
+.Bl -tag -width Ds
+.It Fl d Ar dir
+The directory into which to write the keyword and index databases.
+.It Ar
+Read input from zero or more files in
+.Xr mdoc 7
+or
+.Xr man 7
+.Ux
+manual format.
+.It Fl r
+Remove entries.
+This will remove the index and keyword references.
+If the record is not found, it is ignored.
+.It Fl u
+Update the record.
+This will first remove the record (as in
+.Fl r )
+then re-add it.
+.It Fl v
+Verbose output.
+If specified once, prints the name of each indexed file.
+If twice, prints keywords for each file.
+.El
+.Pp
+By default,
+.Nm
+constructs a new
+.Sx Index Database
+and
+.Sx Keyword Database
+in the current working directory.
+Existing databases are truncated.
+.Pp
+If fatal parse errors are encountered, the offending file is printed to
+stderr, omitted from the index, and the parse continues with the next
+input file.
+.Ss Index Database
+The index database,
+.Pa mandoc.index ,
+is a
+.Xr recno 3
+database with record values consisting of
+.Pp
+.Bl -enum -compact
+.It
+a nil-terminated filename,
+.It
+a nil-terminated manual section,
+.It
+a nil-terminated manual title,
+.It
+a nil-terminated architecture
+.Pq this is not often available
+.It
+and a nil-terminated description.
+.El
+.Pp
+Both the manual section and description may be zero-length.
+Entries are sequentially-numbered, but the filenames are unordered.
+.Ss Keyword Database
+The keyword database,
+.Pa mandoc.db ,
+is a
+.Xr btree 3
+database of nil-terminated keywords (record length is non-zero string
+length plus one) mapping to a 8-byte binary field consisting of the
+keyword type and source
+.Sx Index Database
+record number.
+The type, a 32-bit bit-mask in host order, consists of the following
+fields:
+.Pp
+.Bl -tag -width Ds -offset indent -compact
+.It Li 0x01
+The name of a manual page as given in the NAME section.
+.It Li 0x02
+A function prototype name as given in the SYNOPSIS section.
+.It Li 0x04
+A utility name as given in the SYNOPSIS section.
+.It Li 0x08
+An include file as given in the SYNOPSIS section.
+.It Li 0x10
+A variable name as given in the SYNOPSIS section.
+.It Li 0x20
+A standard as given in the STANDARDS section.
+.It Li 0x40
+An author as given in the AUTHORS section.
+.It Li 0x80
+A configuration as given in the SYNOPSIS section.
+.It Li 0x100
+Free-form descriptive text as given in the NAME section.
+.It Li 0x200
+Cross-links between manuals.
+Listed as the link name, then a period, then the link section.
+If the link has no section, the period terminates the string.
+.It Li 0x400
+Path reference as given in the FILES section.
+.It Li 0x800
+Environment variable as given in the ENVIRONMENT section.
+.It Li 0x1000
+Error codes as given in the ERRORS section.
+.El
+.Pp
+The last four bytes are a host-ordered record number within the
+.Sx Index Database .
+.Pp
+The
+.Nm
+utility is
+.Ud
+.Sh IMPLEMENTATION NOTES
+The time to construct a new database pair grows linearly with the
+number of keywords in the input.
+However, removing or updating entries with
+.Fl r
+or
+.Fl u ,
+respectively, grows as a multiple of the index length and input size.
+.Sh FILES
+.Bl -tag -width Ds
+.It Pa mandoc.db
+A
+.Xr btree 3
+keyword database mapping keywords to a type and file reference in
+.Pa mandoc.index .
+.It Pa mandoc.index
+A
+.Xr recno 3
+database of indexed file-names.
+.El
+.Sh EXIT STATUS
+The
+.Nm
+utility exits with one of the following values:
+.Pp
+.Bl -tag -width Ds -compact
+.It 0
+No errors occurred.
+.It 5
+Invalid command line arguments were specified.
+No input files have been read.
+.It 6
+An operating system error occurred, for example memory exhaustion or an
+error accessing input files.
+Such errors cause
+.Nm
+to exit at once, possibly in the middle of parsing or formatting a file.
+The output databases are corrupt and should be removed .
+.El
+.Sh SEE ALSO
+.Xr mandoc 1
+.Sh AUTHORS
+The
+.Nm
+utility was written by
+.An Kristaps Dzonsons Aq kristaps@bsd.lv .
--- mandocdb.1
+++ /dev/null
@@ -1,191 +0,0 @@
-.\"	$Id: mandocdb.1,v 1.1 2011/07/14 10:57:02 kristaps Exp $
-.\"
-.\" Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
-.\"
-.\" Permission to use, copy, modify, and distribute this software for any
-.\" purpose with or without fee is hereby granted, provided that the above
-.\" copyright notice and this permission notice appear in all copies.
-.\"
-.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-.\"
-.Dd $Mdocdate: July 14 2011 $
-.Dt MANDOCDB 1
-.Os
-.Sh NAME
-.Nm mandocdb
-.Nd index UNIX manuals
-.Sh SYNOPSIS
-.Nm
-.Op Fl ruv
-.Op Fl d Ar dir
-.Ar
-.Sh DESCRIPTION
-The
-.Nm
-utility extracts keywords from
-.Ux
-manuals and indexes them for fast retrieval.
-The arguments are as follows:
-.Bl -tag -width Ds
-.It Fl d Ar dir
-The directory into which to write the keyword and index databases.
-.It Ar
-Read input from zero or more files in
-.Xr mdoc 7
-or
-.Xr man 7
-.Ux
-manual format.
-.It Fl r
-Remove entries.
-This will remove the index and keyword references.
-If the record is not found, it is ignored.
-.It Fl u
-Update the record.
-This will first remove the record (as in
-.Fl r )
-then re-add it.
-.It Fl v
-Verbose output.
-If specified once, prints the name of each indexed file.
-If twice, prints keywords for each file.
-.El
-.Pp
-By default,
-.Nm
-constructs a new
-.Sx Index Database
-and
-.Sx Keyword Database
-in the current working directory.
-Existing databases are truncated.
-.Pp
-If fatal parse errors are encountered, the offending file is printed to
-stderr, omitted from the index, and the parse continues with the next
-input file.
-.Ss Index Database
-The index database,
-.Pa mandoc.index ,
-is a
-.Xr recno 3
-database with record values consisting of
-.Pp
-.Bl -enum -compact
-.It
-a nil-terminated filename,
-.It
-a nil-terminated manual section,
-.It
-a nil-terminated manual title,
-.It
-a nil-terminated architecture
-.Pq this is not often available
-.It
-and a nil-terminated description.
-.El
-.Pp
-Both the manual section and description may be zero-length.
-Entries are sequentially-numbered, but the filenames are unordered.
-.Ss Keyword Database
-The keyword database,
-.Pa mandoc.db ,
-is a
-.Xr btree 3
-database of nil-terminated keywords (record length is non-zero string
-length plus one) mapping to a 8-byte binary field consisting of the
-keyword type and source
-.Sx Index Database
-record number.
-The type, a 32-bit bit-mask in host order, consists of the following
-fields:
-.Pp
-.Bl -tag -width Ds -offset indent -compact
-.It Li 0x01
-The name of a manual page as given in the NAME section.
-.It Li 0x02
-A function prototype name as given in the SYNOPSIS section.
-.It Li 0x04
-A utility name as given in the SYNOPSIS section.
-.It Li 0x08
-An include file as given in the SYNOPSIS section.
-.It Li 0x10
-A variable name as given in the SYNOPSIS section.
-.It Li 0x20
-A standard as given in the STANDARDS section.
-.It Li 0x40
-An author as given in the AUTHORS section.
-.It Li 0x80
-A configuration as given in the SYNOPSIS section.
-.It Li 0x100
-Free-form descriptive text as given in the NAME section.
-.It Li 0x200
-Cross-links between manuals.
-Listed as the link name, then a period, then the link section.
-If the link has no section, the period terminates the string.
-.It Li 0x400
-Path reference as given in the FILES section.
-.It Li 0x800
-Environment variable as given in the ENVIRONMENT section.
-.It Li 0x1000
-Error codes as given in the ERRORS section.
-.El
-.Pp
-The last four bytes are a host-ordered record number within the
-.Sx Index Database .
-.Pp
-The
-.Nm
-utility is
-.Ud
-.Sh IMPLEMENTATION NOTES
-The time to construct a new database pair grows linearly with the
-number of keywords in the input.
-However, removing or updating entries with
-.Fl r
-or
-.Fl u ,
-respectively, grows as a multiple of the index length and input size.
-.Sh FILES
-.Bl -tag -width Ds
-.It Pa mandoc.db
-A
-.Xr btree 3
-keyword database mapping keywords to a type and file reference in
-.Pa mandoc.index .
-.It Pa mandoc.index
-A
-.Xr recno 3
-database of indexed file-names.
-.El
-.Sh EXIT STATUS
-The
-.Nm
-utility exits with one of the following values:
-.Pp
-.Bl -tag -width Ds -compact
-.It 0
-No errors occurred.
-.It 5
-Invalid command line arguments were specified.
-No input files have been read.
-.It 6
-An operating system error occurred, for example memory exhaustion or an
-error accessing input files.
-Such errors cause
-.Nm
-to exit at once, possibly in the middle of parsing or formatting a file.
-The output databases are corrupt and should be removed .
-.El
-.Sh SEE ALSO
-.Xr mandoc 1
-.Sh AUTHORS
-The
-.Nm
-utility was written by
-.An Kristaps Dzonsons Aq kristaps@bsd.lv .
Index: mandocdb.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandocdb.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -Lmandocdb.c -Lmandocdb.c -u -p -r1.1 -r1.2
--- mandocdb.c
+++ mandocdb.c
@@ -44,7 +44,7 @@
 #define	MANDOC_FLAGS	  O_CREAT|O_TRUNC|O_RDWR
 #define	MANDOC_SLOP	  1024
 
-/* Bit-fields.  See makewhatis.1. */
+/* Bit-fields.  See mandocdb.8. */
 
 #define TYPE_NAME	  0x01
 #define TYPE_FUNCTION	  0x02
Index: index.sgml
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/index.sgml,v
retrieving revision 1.127
retrieving revision 1.128
diff -Lindex.sgml -Lindex.sgml -u -p -r1.127 -r1.128
--- index.sgml
+++ index.sgml
@@ -29,7 +29,7 @@
 			HREF="mandoc.1.html">mandoc</A>, which interfaces with the compiler library to format output for UNIX terminals (with
 			support for wide-character locales), XHTML, HTML, PostScript, and PDF.  
 			It also includes <A HREF="preconv.1.html">preconv</A>, for recoding multibyte manuals; and <A
-			HREF="mandocdb.1.html">mandocdb</A>, for indexing manuals.
+			HREF="mandocdb.8.html">mandocdb</A>, for indexing manuals.
 			It is a <A CLASS="external" HREF="http://bsd.lv/">BSD.lv</A> project.  
 		</P>
 		<P>
@@ -40,14 +40,14 @@
 		</H1>
 		<P>
 			<SPAN CLASS="nm">mdocml</SPAN> is in plain-old ANSI C and should build and run on any UNIX system, although <A
-			HREF="mandocdb.1.html">mandocdb</A> requires <A CLASS="external"
+			HREF="mandocdb.8.html">mandocdb</A> requires <A CLASS="external"
 			HREF="http://www.oracle.com/technetwork/database/berkeleydb/overview/index.html">Berkeley Database</A> (this is
 			installed by default on all BSD operating systems).  
 			To compile <SPAN CLASS="nm">mdocml</SPAN>, run <CODE>make</CODE>, then <CODE>make install</CODE> to install into
 			<I>/usr/local</I>.
 			Be aware: if you have an existing <A HREF="http://www.gnu.org/software/groff/" CLASS="external">groff</A> installation,
 			this may overwrite its <B>preconv</B> binary.
-			The <A HREF="mandocdb.1.html">mandocdb</A> utility is not yet linked to the build.  You must run <CODE>make
+			The <A HREF="mandocdb.8.html">mandocdb</A> utility is not yet linked to the build.  You must run <CODE>make
 			mandocdb</CODE> to build it (it does not install).
 		</P>
 		<P>
@@ -152,14 +152,14 @@
 					</TD>
 				</TR>
 				<TR>
-					<TD VALIGN="top"><A HREF="mandocdb.1.html">mandocdb(1)</A></TD>
+					<TD VALIGN="top"><A HREF="mandocdb.8.html">mandocdb(8)</A></TD>
 					<TD VALIGN="top">
 						index UNIX manuals
 						<SMALL>
-							(<A HREF="mandocdb.1.txt">text</A> | 
-							<A HREF="mandocdb.1.xhtml">xhtml</A> |
-							<A HREF="mandocdb.1.pdf">pdf</A> |
-							<A HREF="mandocdb.1.ps">postscript</A>)
+							(<A HREF="mandocdb.8.txt">text</A> | 
+							<A HREF="mandocdb.8.xhtml">xhtml</A> |
+							<A HREF="mandocdb.8.pdf">pdf</A> |
+							<A HREF="mandocdb.8.ps">postscript</A>)
 						</SMALL>
 					</TD>
 				</TR>
@@ -314,7 +314,7 @@
 			12-07-2011: version 1.11.4
 		</P>
 		<P>
-			Bug-fixes and clean-ups across all systems, especially in <INS><A HREF="mandocdb.1.html">mandocdb</A></INS> <DEL>makewhatis</DEL> (note: still not
+			Bug-fixes and clean-ups across all systems, especially in <INS><A HREF="mandocdb.8.html">mandocdb</A></INS> <DEL>makewhatis</DEL> (note: still not
 			connected to the general build and must be compiled with <INS><CODE>make mandocdb</CODE></INS> <DEL><CODE>make makewhatis</CODE></DEL>) and the <A
 			HREF="man.7.html">man</A> parser.  This release was significantly assisted by participants in <A CLASS="external"
 			HREF="http://www.openbsd.org">OpenBSD</A>'s c2k11.  Thanks!
@@ -341,7 +341,7 @@
 		<P>
 			Corrected some installation issues in version 1.11.1.
 			Further migration to <A HREF="mandoc.3.html">libmandoc</A>.
-			Initial public release (this utility is very much under development) of <INS><A HREF="mandocdb.1.html">mandocdb</A></INS><DEL>makewhatis</DEL>,
+			Initial public release (this utility is very much under development) of <INS><A HREF="mandocdb.8.html">mandocdb</A></INS><DEL>makewhatis</DEL>,
 			initially named mandoc-db.
 			This utility produces keyword databases of manual content
 			<DEL>mandoc-cgi</DEL>, 
Index: Makefile
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/Makefile,v
retrieving revision 1.355
retrieving revision 1.356
diff -LMakefile -LMakefile -u -p -r1.355 -r1.356
--- Makefile
+++ Makefile
@@ -1,11 +1,11 @@
 .PHONY: 	 clean install installwww
 .SUFFIXES:	 .sgml .html .md5 .h .h.html
-.SUFFIXES:	 .1       .3       .7
-.SUFFIXES:	 .1.txt   .3.txt   .7.txt
-.SUFFIXES:	 .1.pdf   .3.pdf   .7.pdf
-.SUFFIXES:	 .1.ps    .3.ps    .7.ps
-.SUFFIXES:	 .1.html  .3.html  .7.html 
-.SUFFIXES:	 .1.xhtml .3.xhtml .7.xhtml 
+.SUFFIXES:	 .1       .3       .7       .8
+.SUFFIXES:	 .1.txt   .3.txt   .7.txt   .8.txt
+.SUFFIXES:	 .1.pdf   .3.pdf   .7.pdf   .8.pdf
+.SUFFIXES:	 .1.ps    .3.ps    .7.ps    .8.ps
+.SUFFIXES:	 .1.html  .3.html  .7.html  .8.html
+.SUFFIXES:	 .1.xhtml .3.xhtml .7.xhtml .8.xhtml
 
 # Specify this if you want to hard-code the operating system to appear
 # in the lower-left hand corner of -mdoc manuals.
@@ -73,7 +73,7 @@ SRCS		 = Makefile \
 		   mandoc.3 \
 		   mandoc.c \
 		   mandoc.h \
-		   mandocdb.1 \
+		   mandocdb.8 \
 		   mandocdb.c \
 		   mandoc_char.7 \
 		   mdoc.h \
@@ -237,12 +237,7 @@ PRECONV_LNS	 = preconv.ln
 
 $(PRECONV_OBJS) $(PRECONV_LNS): config.h
 
-INDEX_MANS	 = mandocdb.1.html \
-		   mandocdb.1.xhtml \
-		   mandocdb.1.ps \
-		   mandocdb.1.pdf \
-		   mandocdb.1.txt \
-		   mandoc.1.html \
+INDEX_MANS	 = mandoc.1.html \
 		   mandoc.1.xhtml \
 		   mandoc.1.ps \
 		   mandoc.1.pdf \
@@ -286,7 +281,12 @@ INDEX_MANS	 = mandocdb.1.html \
 		   tbl.7.xhtml \
 		   tbl.7.ps \
 		   tbl.7.pdf \
-		   tbl.7.txt
+		   tbl.7.txt \
+		   mandocdb.8.html \
+		   mandocdb.8.xhtml \
+		   mandocdb.8.ps \
+		   mandocdb.8.pdf \
+		   mandocdb.8.txt
 
 $(INDEX_MANS): mandoc
 
@@ -322,6 +322,7 @@ install: all
 	mkdir -p $(DESTDIR)$(MANDIR)/man1
 	mkdir -p $(DESTDIR)$(MANDIR)/man3
 	mkdir -p $(DESTDIR)$(MANDIR)/man7
+	mkdir -p $(DESTDIR)$(MANDIR)/man8
 	$(INSTALL_PROGRAM) mandoc preconv $(DESTDIR)$(BINDIR)
 	$(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR)
 	$(INSTALL_LIB) man.h mdoc.h mandoc.h $(DESTDIR)$(INCLUDEDIR)
@@ -399,19 +400,19 @@ config.h: config.h.pre config.h.post
 .h.h.html:
 	highlight -I $< >$@
 
-.1.1.txt .3.3.txt .7.7.txt:
+.1.1.txt .3.3.txt .7.7.txt .8.8.txt:
 	./mandoc -Tascii -Wall,stop $< | col -b >$@
 
-.1.1.html .3.3.html .7.7.html:
+.1.1.html .3.3.html .7.7.html .8.8.html:
 	./mandoc -Thtml -Wall,stop -Ostyle=style.css,man=%N.%S.html,includes=%I.html $< >$@
 
-.1.1.ps .3.3.ps .7.7.ps:
+.1.1.ps .3.3.ps .7.7.ps .8.8.ps:
 	./mandoc -Tps -Wall,stop $< >$@
 
-.1.1.xhtml .3.3.xhtml .7.7.xhtml:
+.1.1.xhtml .3.3.xhtml .7.7.xhtml .8.8.xhtml:
 	./mandoc -Txhtml -Wall,stop -Ostyle=style.css,man=%N.%S.xhtml,includes=%I.html $< >$@
 
-.1.1.pdf .3.3.pdf .7.7.pdf:
+.1.1.pdf .3.3.pdf .7.7.pdf .8.8.pdf:
 	./mandoc -Tpdf -Wall,stop $< >$@
 
 .sgml.html:
--
 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:[~2011-07-14 14:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-14 14:36 mdocml: move mandocdb(1) to mandocdb(8) "please make this change" 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).