1 .\" $Id: mandocdb.8,v 1.3 2011/07/15 17:59:29 kristaps Exp $
3 .\" Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
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.
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.
17 .Dd $Mdocdate: July 15 2011 $
22 .Nd index UNIX manuals
38 utility extracts keywords from
40 manuals and indexes them in a
45 The arguments are as follows:
53 Update (remove and re-add)
58 Recursively add files rooted at each
60 to the databases in the respective
62 Existing databases are truncated.
65 Use once to display all files added or removed and twice for keywords as
71 creates databases in each
73 using files rooted in that directory.
75 If fatal parse errors are encountered while parsing, the offending file
76 is printed to stderr, omitted from the index, and the parse continues
77 with the next input file.
83 database with record values consisting of
87 a nil-terminated filename,
89 a nil-terminated manual section,
91 a nil-terminated manual title,
93 a nil-terminated architecture
94 .Pq this is not often available
96 and a nil-terminated description.
99 Both the manual section and description may be zero-length if the record
101 Entries are sequentially-numbered, but the filenames are unordered.
103 The keyword database,
107 database of nil-terminated keywords (record length is non-zero string
108 length plus one) mapping to a 8-byte binary field consisting of the
109 keyword type and source
112 The type, a 32-bit bit-mask in host order, consists of the following
115 .Bl -tag -width Ds -offset indent -compact
117 The name of a manual page as given in the NAME section.
119 A function prototype name as given in the SYNOPSIS section.
121 A utility name as given in the SYNOPSIS section.
123 An include file as given in the SYNOPSIS section.
125 A variable name as given in the SYNOPSIS section.
127 A standard as given in the STANDARDS section.
129 An author as given in the AUTHORS section.
131 A configuration as given in the SYNOPSIS section.
133 Free-form descriptive text as given in the NAME section.
135 Cross-links between manuals.
136 Listed as the link name, then a period, then the link section.
137 If the link has no section, the period terminates the string.
139 Path reference as given in the FILES section.
141 Environment variable as given in the ENVIRONMENT section.
143 Error codes as given in the ERRORS section.
146 The last four bytes are a host-ordered record number within the
153 .Sh IMPLEMENTATION NOTES
154 The time to construct a new database pair grows linearly with the
155 number of keywords in the input files.
156 However, removing or updating entries with
160 respectively, grows as a multiple of the index length and input size.
166 keyword database mapping keywords to a type and file reference in
171 database of indexed file-names.
176 utility exits with one of the following values:
178 .Bl -tag -width Ds -compact
182 Invalid command line arguments were specified.
183 No input files have been read.
185 An operating system error occurred, for example memory exhaustion or an
186 error accessing input files.
189 to exit at once, possibly in the middle of parsing or formatting a file.
190 The output databases are corrupt and should be removed .
199 utility was written by
200 .An Kristaps Dzonsons Aq kristaps@bsd.lv .