xref: /openbsd-src/share/man/man5/mandoc.db.5 (revision 0b7734b3d77bb9b21afec6f4621cae6c805dbd45)
1.\"	$OpenBSD: mandoc.db.5,v 1.3 2014/12/30 21:34:32 schwarze Exp $
2.\"
3.\" Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
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.\"
17.Dd $Mdocdate: December 30 2014 $
18.Dt MANDOC.DB 5
19.Os
20.Sh NAME
21.Nm mandoc.db
22.Nd manual page database
23.Sh DESCRIPTION
24The
25.Nm
26SQLite3 file format is used to store information about installed manual
27pages to facilitate semantic searching for manuals.
28Each manual page tree contains its own
29.Nm
30file; see
31.Sx FILES
32for examples.
33.Pp
34Such database files are generated by
35.Xr makewhatis 8
36and used by
37.Xr apropos 1
38and
39.Xr whatis 1 .
40.Pp
41One line in the following tables describes:
42.Bl -tag -width Ds
43.It Sy mpages
44One physical manual page file, no matter how many times and under which
45names it may appear in the file system.
46.It Sy mlinks
47One entry in the file system, no matter which content it points to.
48.It Sy names
49One manual page name, no matter whether it appears in a page header,
50in a NAME or SYNOPSIS section, or as a file name.
51.It Sy keys
52One chunk of text from some macro invocation.
53.El
54.Pp
55Each record in the latter three tables uses its
56.Va pageid
57column to point to a record in the
58.Sy mpages
59table.
60.Pp
61The other columns are as follows; unless stated otherwise, they are
62of type
63.Vt TEXT .
64.Bl -tag -width mpages.desc
65.It Sy mpages.desc
66The description line
67.Pq Sq \&Nd
68of the page.
69.It Sy mpages.form
70An
71.Vt INTEGER
72bit field.
73If bit
74.Dv FORM_GZ
75is set, the page is compressed and requires
76.Xr gunzip 1
77for display.
78If bit
79.Dv FORM_SRC
80is set, the page is unformatted, that is in
81.Xr mdoc 7
82or
83.Xr man 7
84format, and requires
85.Xr mandoc 1
86for display.
87If bit
88.Dv FORM_SRC
89is not set, the page is formatted, i.e. a
90.Sq cat
91page.
92.It Sy mlinks.sec
93The manual section as found in the subdirectory name.
94.It Sy mlinks.arch
95The manual architecture as found in the subdirectory name, or
96.Qq any .
97.It Sy mlinks.name
98The manual name as found in the file name.
99.It Sy names.bits
100An
101.Vt INTEGER
102bit mask telling whether the name came from a header line, from the
103NAME or SYNOPSIS section, or from a file name.
104Bits are defined in
105.In mansearch.h .
106.It Sy names.name
107The name itself.
108.It Sy keys.bits
109An
110.Vt INTEGER
111bit mask telling which semantic contexts the key was found in;
112defined in
113.In mansearch.h ,
114documented in
115.Xr apropos 1 .
116.It Sy keys.key
117The string found in those contexts.
118.El
119.Sh FILES
120.Bl -tag -width /usr/share/man/mandoc.db -compact
121.It Pa /usr/share/man/mandoc.db
122The manual page database for the base system.
123.It Pa /usr/X11R6/man/mandoc.db
124The same for the
125.Xr X 7
126Window System.
127.It Pa /usr/local/man/mandoc.db
128The same for
129.Xr packages 7 .
130.El
131.Sh SEE ALSO
132.Xr apropos 1 ,
133.Xr man 1 ,
134.Xr sqlite3 1 ,
135.Xr whatis 1 ,
136.Xr makewhatis 8
137.Sh HISTORY
138A manual page database
139.Pa /usr/lib/whatis
140first appeared in
141.Bx 2 .
142The present format first appeared in
143.Ox 5.6 .
144.Sh AUTHORS
145.An -nosplit
146The original version of
147.Xr makewhatis 8
148was written by
149.An Bill Joy
150in 1979.
151An SQLite3 version was first implemented by
152.An Kristaps Dzonsons Aq Mt kristaps@bsd.lv
153in 2012.
154The present database format was designed by
155.An Ingo Schwarze Aq Mt schwarze@openbsd.org
156in 2014.
157