Annotation of src/usr.bin/cap_mkdb/cap_mkdb.1, Revision 1.13
1.13 ! millert 1: .\" $OpenBSD: cap_mkdb.1,v 1.12 2000/11/09 17:52:04 aaron 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.9 aaron 33: .Dd June 6, 1993
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.7 tholo 41: .Op Fl i
1.1 deraadt 42: .Op Fl v
43: .Op Fl f Ar outfile
44: .Ar file1
45: .Op Ar file2 ...
46: .Sh DESCRIPTION
1.8 aaron 47: .Nm
1.1 deraadt 48: builds a hashed database out of the
1.8 aaron 49: .Xr getcap 3
1.7 tholo 50: or
51: .Xr terminfo 5
1.1 deraadt 52: logical database constructed by the concatenation of the specified
1.5 aaron 53: files.
1.1 deraadt 54: .Pp
55: The database is named by the basename of the first file argument and
56: the string
1.8 aaron 57: .Dq .db .
1.1 deraadt 58: The
59: .Xr getcap 3
60: routines can access the database in this form much more quickly
61: than they can the original text file(s).
62: .Pp
1.8 aaron 63: The
64: .Dq tc
65: capabilities of the records are expanded before the
1.1 deraadt 66: record is stored into the database.
67: .Pp
1.5 aaron 68: The options are as follows:
1.12 aaron 69: .Bl -tag -width Ds
1.1 deraadt 70: .It Fl f Ar outfile
71: Specify a different database basename.
1.7 tholo 72: .It Fl i
73: Expect the capability records to be parsed to be in
74: .Xr terminfo 5
75: format.
1.1 deraadt 76: .It Fl v
77: Print out the number of capability records in the database.
78: .El
1.11 aaron 79: .Pp
1.1 deraadt 80: Each record is stored in the database using two different types of keys.
81: .Pp
82: The first type is a key which consists of the first capability of
1.6 aaron 83: the record (not including the trailing colon
1.10 aaron 84: .Pq Ql \&: )
1.6 aaron 85: with a data
1.1 deraadt 86: field consisting of a special byte followed by the rest of the record.
87: The special byte is either a 0 or 1, where a 0 means that the record
1.8 aaron 88: is okay, and a 1 means that there was a
89: .Dq tc
90: capability in the record
1.1 deraadt 91: that couldn't be expanded.
92: .Pp
93: The second type is a key which consists of one of the names from the
94: first capability of the record with a data field consisting a special
1.3 deraadt 95: byte followed by the first capability of the record.
1.1 deraadt 96: The special byte is a 2.
97: .Pp
98: In normal operation names are looked up in the database, resulting
99: in a key/data pair of the second type.
100: The data field of this key/data pair is used to look up a key/data
101: pair of the first type which has the real data associated with the
102: name.
1.11 aaron 103: .Pp
1.1 deraadt 104: The
1.8 aaron 105: .Nm
1.6 aaron 106: utility exits 0 on success or >0 if an error occurred.
1.11 aaron 107: .Sh FILES
108: .Bl -tag -width /usr/share/misc/terminfo.db -compact
109: .It Pa /usr/share/misc/termcap
110: uncompiled terminal capabilities file
111: .It Pa /usr/share/misc/termcap.db
112: terminal capabilities database
113: .It Pa /usr/share/misc/terminfo.db
114: terminal information database
115: .It Pa /etc/termcap
116: symbolic link to
117: .Pa /usr/share/misc/termcap
118: .El
1.1 deraadt 119: .Sh SEE ALSO
120: .Xr dbopen 3 ,
121: .Xr getcap 3 ,
1.7 tholo 122: .Xr termcap 5 ,
123: .Xr terminfo 5