Annotation of mandoc/mandoc-db.1, Revision 1.2
1.2 ! kristaps 1: .\" $Id: mandoc-db.1,v 1.1 2011/04/04 10:53:15 kristaps Exp $
1.1 kristaps 2: .\"
3: .\" Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
4: .\"
5: .\" Permission to use, copy, modify, and distribute this software for any
6: .\" purpose with or without fee is hereby granted, provided that the above
7: .\" copyright notice and this permission notice appear in all copies.
8: .\"
9: .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10: .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11: .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12: .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13: .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14: .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15: .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16: .\"
1.2 ! kristaps 17: .Dd $Mdocdate: April 4 2011 $
1.1 kristaps 18: .Dt MANDOC-DB 1
19: .Os
20: .Sh NAME
21: .Nm mandoc-db
22: .Nd index UNIX manuals
23: .Sh SYNOPSIS
24: .Nm
25: .Op Fl d Ar dir
26: .Ar
27: .Sh DESCRIPTION
28: The
29: .Nm
30: utility extracts keywords from
31: .Ux
32: manuals and indexes them for fast retrieval.
33: The arguments are as follows:
34: .Bl -tag -width Ds
35: .It Fl d Ar dir
36: The directory into which to write the keyword and index databases.
37: .It Ar
38: Read input from zero or more files in
39: .Xr mdoc 7
40: or
41: .Xr man 7
42: .Ux
43: manual format.
44: .El
45: .Pp
46: By default,
47: .Nm
48: constructs the
49: .Sx Index Database
50: and
51: .Sx Keyword Database
52: in the current working directory.
53: .Pp
54: If fatal parse errors are encountered, the offending file is printed to
55: stderr, omitted from the index, and the parse continues with the next
56: input file.
57: .Ss Index Database
58: The index database,
59: .Pa mandoc.index ,
60: is a
61: .Xr recno 3
1.2 ! kristaps 62: database with record values consisting of
! 63: .Pp
! 64: .Bl -enum -compact
! 65: .It
! 66: a nil-terminated filename,
! 67: .It
! 68: a nil-terminated manual section,
! 69: .It
! 70: and a nil-terminated description.
! 71: .El
! 72: .Pp
! 73: Both the manual section and description may be zero-length.
1.1 kristaps 74: Entries are sequentially-numbered, but the filenames are unordered.
75: .Ss Keyword Database
76: The keyword database,
77: .Pa mandoc.db ,
78: is a
79: .Xr btree 3
80: database of nil-terminated keywords (record length is non-zero string
81: length plus one) mapping to a 8-byte binary field consisting of the
82: keyword type and source
83: .Sx Index Database
84: record number.
85: The type, an unsigned 32-bit integer in host order, is one of the
86: following:
87: .Pp
88: .Bl -tag -width Ds -offset indent -compact
89: .It Li 0x01
90: The name of a manual page as given in the NAME section.
91: .It Li 0x02
92: A function prototype name as given in the SYNOPSIS section.
93: .It Li 0x03
94: A utility name as given in the SYNOPSIS section.
95: .It Li 0x04
96: An include file as given in the SYNOPSIS section.
97: .It Li 0x05
98: A variable name as given in the SYNOPSIS section.
99: .El
100: .Pp
101: If a value is encountered outside of this range, the database is
102: corrupt.
103: .Pp
104: The latter four bytes are a host-ordered record number within the
105: .Sx Index Database .
106: .Pp
107: The
108: .Nm
109: utility is
110: .Ud
111: .Sh FILES
112: .Bl -tag -width Ds
113: .It Pa mandoc.db
114: A
115: .Xr btree 3
116: keyword database mapping keywords to a type and file reference in
117: .Pa mandoc.index .
118: .It Pa mandoc.db~
119: Working copy of
120: .Pa mandoc.db .
121: .It Pa mandoc.index
122: A
123: .Xr recno 3
124: database of indexed file-names.
125: .It Pa mandoc.index~
126: Working copy of
127: .Pa mandoc.index .
128: .El
129: .Sh EXIT STATUS
130: .Ex -std
131: .Sh SEE ALSO
132: .Xr mandoc 1
133: .Sh AUTHORS
134: The
135: .Nm
136: utility was written by
137: .An Kristaps Dzonsons Aq kristaps@bsd.lv .
138: .Sh CAVEATS
139: Only
140: .Xr mdoc 7
141: manuals are processed.
CVSweb