Annotation of src/usr.bin/cap_mkdb/cap_mkdb.1, Revision 1.16
1.16 ! sobrado 1: .\" $OpenBSD: cap_mkdb.1,v 1.15 2007/05/31 19:20:08 jmc Exp $
1.1 deraadt 2: .\" $NetBSD: cap_mkdb.1,v 1.4 1995/03/26 03:59:36 glass Exp $
3: .\"
4: .\" Copyright (c) 1992, 1993
5: .\" The Regents of the University of California. All rights reserved.
6: .\"
7: .\" Redistribution and use in source and binary forms, with or without
8: .\" modification, are permitted provided that the following conditions
9: .\" are met:
10: .\" 1. Redistributions of source code must retain the above copyright
11: .\" notice, this list of conditions and the following disclaimer.
12: .\" 2. Redistributions in binary form must reproduce the above copyright
13: .\" notice, this list of conditions and the following disclaimer in the
14: .\" documentation and/or other materials provided with the distribution.
1.13 millert 15: .\" 3. Neither the name of the University nor the names of its contributors
1.1 deraadt 16: .\" may be used to endorse or promote products derived from this software
17: .\" without specific prior written permission.
18: .\"
19: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22: .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29: .\" SUCH DAMAGE.
30: .\"
31: .\" @(#)cap_mkdb.1 8.1 (Berkeley) 6/6/93
32: .\"
1.16 ! sobrado 33: .Dd $Mdocdate: May 31 2007 $
1.1 deraadt 34: .Dt CAP_MKDB 1
35: .Os
36: .Sh NAME
37: .Nm cap_mkdb
38: .Nd create capability database
39: .Sh SYNOPSIS
40: .Nm cap_mkdb
1.14 jmc 41: .Op Fl iv
1.1 deraadt 42: .Op Fl f Ar outfile
43: .Ar file1
44: .Op Ar file2 ...
45: .Sh DESCRIPTION
1.8 aaron 46: .Nm
1.1 deraadt 47: builds a hashed database out of the
1.8 aaron 48: .Xr getcap 3
1.7 tholo 49: or
50: .Xr terminfo 5
1.1 deraadt 51: logical database constructed by the concatenation of the specified
1.5 aaron 52: files.
1.1 deraadt 53: .Pp
54: The database is named by the basename of the first file argument and
55: the string
1.8 aaron 56: .Dq .db .
1.1 deraadt 57: The
58: .Xr getcap 3
59: routines can access the database in this form much more quickly
60: than they can the original text file(s).
61: .Pp
1.8 aaron 62: The
63: .Dq tc
64: capabilities of the records are expanded before the
1.1 deraadt 65: record is stored into the database.
66: .Pp
1.5 aaron 67: The options are as follows:
1.12 aaron 68: .Bl -tag -width Ds
1.1 deraadt 69: .It Fl f Ar outfile
70: Specify a different database basename.
1.7 tholo 71: .It Fl i
72: Expect the capability records to be parsed to be in
73: .Xr terminfo 5
74: format.
1.1 deraadt 75: .It Fl v
76: Print out the number of capability records in the database.
77: .El
1.11 aaron 78: .Pp
1.1 deraadt 79: Each record is stored in the database using two different types of keys.
80: .Pp
81: The first type is a key which consists of the first capability of
1.6 aaron 82: the record (not including the trailing colon
1.10 aaron 83: .Pq Ql \&: )
1.6 aaron 84: with a data
1.1 deraadt 85: field consisting of a special byte followed by the rest of the record.
86: The special byte is either a 0 or 1, where a 0 means that the record
1.8 aaron 87: is okay, and a 1 means that there was a
88: .Dq tc
89: capability in the record
1.1 deraadt 90: that couldn't be expanded.
91: .Pp
92: The second type is a key which consists of one of the names from the
93: first capability of the record with a data field consisting a special
1.3 deraadt 94: byte followed by the first capability of the record.
1.1 deraadt 95: The special byte is a 2.
96: .Pp
97: In normal operation names are looked up in the database, resulting
98: in a key/data pair of the second type.
99: The data field of this key/data pair is used to look up a key/data
100: pair of the first type which has the real data associated with the
101: name.
1.11 aaron 102: .Pp
1.16 ! sobrado 103: .Ex -std cap_mkdb
1.11 aaron 104: .Sh FILES
105: .Bl -tag -width /usr/share/misc/terminfo.db -compact
106: .It Pa /usr/share/misc/termcap
107: uncompiled terminal capabilities file
108: .It Pa /usr/share/misc/termcap.db
109: terminal capabilities database
110: .It Pa /usr/share/misc/terminfo.db
111: terminal information database
112: .It Pa /etc/termcap
113: symbolic link to
114: .Pa /usr/share/misc/termcap
115: .El
1.1 deraadt 116: .Sh SEE ALSO
117: .Xr dbopen 3 ,
118: .Xr getcap 3 ,
1.7 tholo 119: .Xr termcap 5 ,
120: .Xr terminfo 5