]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/infocmp.1m
3c714e57c98d260df460934e98b5f491d365f598
[ncurses.git] / man / infocmp.1m
1 '\" t
2 .\" $Id: infocmp.1m,v 1.12 1997/01/05 00:47:22 tom Exp $
3 .TH infocmp 1M ""
4 .ds n 5
5 .ds d @DATADIR@/terminfo
6 .SH NAME
7 \fBinfocmp\fR - compare or print out \fIterminfo\fR descriptions
8 .SH SYNOPSIS
9 \fBinfocmp\fR [\fB-dcnpILCuV1\fR] [\fB-v\fR \fIn\fR] [\fB-s d\fR| \fBi\fR| \fBl\fR| \fBc\fR]
10 .br
11       [\fB-w\fR \fIwidth\fR] [\fB-A\fR \fIdirectory\fR] [\fB-B\fR \fIdirectory\fR] [\fItermname\fR...]
12 .SH DESCRIPTION
13 \fBinfocmp\fR can be used to compare a binary \fBterminfo\fR entry with other
14 terminfo entries, rewrite a \fBterminfo\fR description to take advantage of the
15 \fBuse=\fR terminfo field, or print out a \fBterminfo\fR description from the
16 binary file (\fBterm\fR) in a variety of formats.  In all cases, the boolean
17 fields will be printed first, followed by the numeric fields, followed by the
18 string fields.
19
20 .SS Default Options
21 If no options are specified and zero or one \fItermnames\fR are specified, the
22 \fB-I\fR option will be assumed.  If more than one \fItermname\fR is specified,
23 the \fB-d\fR option will be assumed.
24
25 .SS Comparison Options [-d] [-c] [-n]
26 \fBinfocmp\fR compares the \fBterminfo\fR description of the first terminal
27 \fItermname\fR with each of the descriptions given by the entries for the other
28 terminal's \fItermnames\fR.  If a capability is defined for only one of the
29 terminals, the value returned will depend on the type of the capability:
30 \fBF\fR for boolean variables, \fB-1\fR for integer variables, and \fBNULL\fR
31 for string variables.
32
33 The \fB-d\fR option produces a list of each capability that is different
34 between two entries.  This option is useful to show the difference between two
35 entries, created by different people, for the same or similar terminals.
36
37 The \fB-c\fR option produces a list of each capability that is common between
38 two entries.  Capabilities that are not set are ignored.  This option can be
39 used as a quick check to see if the \fB-u\fR option is worth using.
40
41 The \fB-n\fR option produces a list of each capability that is in neither
42 entry.  If no \fItermnames\fR are given, the environment variable \fBTERM\fR
43 will be used for both of the \fItermnames\fR.  This can be used as a quick
44 check to see if anything was left out of a description.
45
46 .SS Source Listing Options [-I] [-L] [-C] [-r]
47 The \fB-I\fR, \fB-L\fR, and \fB-C\fR options will produce a source listing for
48 each terminal named.
49
50 .TS
51 center tab(/) ;
52 l l .
53 \fB-I\fR/use the \fBterminfo\fR names
54 \fB-L\fR/use the long C variable name listed in <\fBterm.h\fR>
55 \fB-C\fR/use the \fBtermcap\fR names
56 \fB-r\fR/when using \fB-C\fR, put out all capabilities in \fBtermcap\fR form
57 .TE
58
59 If no \fItermnames\fR are given, the environment variable \fBTERM\fR will be
60 used for the terminal name.
61
62 The source produced by the \fB-C\fR option may be used directly as a
63 \fBtermcap\fR entry, but not all parameterized strings can be changed to
64 the \fBtermcap\fR format.  \fBinfocmp\fR will attempt to convert most of the
65 parameterized information, and anything not converted will be plainly marked in
66 the output and commented out.  These should be edited by hand.
67
68 All padding information for strings will be collected together and placed
69 at the beginning of the string where \fBtermcap\fR expects it.  Mandatory
70 padding (padding information with a trailing '/') will become optional.
71
72 All \fBtermcap\fR variables no longer supported by \fBterminfo\fR, but which
73 are derivable from other \fBterminfo\fR variables, will be output.  Not all
74 \fBterminfo\fR capabilities will be translated; only those variables which were
75 part of \fBtermcap\fR will normally be output.  Specifying the \fB-r\fR option
76 will take off this restriction, allowing all capabilities to be output in
77 \fItermcap\fR form.
78
79 Note that because padding is collected to the beginning of the capability, not
80 all capabilities are output.  Mandatory padding is not supported.  Because
81 \fBtermcap\fR strings are not as flexible, it is not always possible to convert
82 a \fBterminfo\fR string capability into an equivalent \fBtermcap\fR format.  A
83 subsequent conversion of the \fBtermcap\fR file back into \fBterminfo\fR format
84 will not necessarily reproduce the original \fBterminfo\fR
85 source.
86
87 Some common \fBterminfo\fR parameter sequences, their \fBtermcap\fR
88 equivalents, and some terminal types which commonly have such sequences, are:
89
90 .TS
91 center tab(/) ;
92 l c l
93 l l l.
94 \fBterminfo/termcap\fR/Representative Terminals
95 =
96 \fB%p1%c/%.\fR/adm
97 \fB%p1%d/%d\fR/hp, ANSI standard, vt100
98 \fB%p1%'x'%+%c/%+x\fR/concept
99 \fB%i/%i\fRq/ANSI standard, vt100
100 \fB%p1%?%'x'%>%t%p1%'y'%+%;/%>xy\fR/concept
101 \fB%p2\fR is printed before \fB%p1/%r\fR/hp
102 .TE
103 .SS Use= Option [-u]
104 The \fB-u\fR option produces a \fBterminfo\fR source description of the first
105 terminal \fItermname\fR which is relative to the sum of the descriptions given
106 by the entries for the other terminals \fItermnames\fR.  It does this by
107 analyzing the differences between the first \fItermname\fR and the other
108 \fItermnames\fR and producing a description with \fBuse=\fR fields for the
109 other terminals.  In this manner, it is possible to retrofit generic terminfo
110 entries into a terminal's description.  Or, if two similar terminals exist, but
111 were coded at different times or by different people so that each description
112 is a full description, using \fBinfocmp\fR will show what can be done to change
113 one description to be relative to the other.
114
115 A capability will get printed with an at-sign (@) if it no longer exists in the
116 first \fItermname\fR, but one of the other \fItermname\fR entries contains a
117 value for it.  A capability's value gets printed if the value in the first
118 \fItermname\fR is not found in any of the other \fItermname\fR entries, or if
119 the first of the other \fItermname\fR entries that has this capability gives a
120 different value for the capability than that in the first \fItermname\fR.
121
122 The order of the other \fItermname\fR entries is significant.  Since the
123 terminfo compiler \fBtic\fR does a left-to-right scan of the capabilities,
124 specifying two \fBuse=\fR entries that contain differing entries for the same
125 capabilities will produce different results depending on the order that the
126 entries are given in.  \fBinfocmp\fR will flag any such inconsistencies between
127 the other \fItermname\fR entries as they are found.
128
129 Alternatively, specifying a capability \fIafter\fR a \fBuse=\fR entry that
130 contains that capability will cause the second specification to be ignored.
131 Using \fBinfocmp\fR to recreate a description can be a useful check to make
132 sure that everything was specified correctly in the original source
133 description.
134
135 Another error that does not cause incorrect compiled files, but will slow down
136 the compilation time, is specifying extra \fBuse=\fR fields that are
137 superfluous.  \fBinfocmp\fR will flag any other \fItermname use=\fR fields that
138 were not needed.
139
140 .SS Other Options [-s d|i|l|c] [-v] [-V] [-1] [-T] [-w \fIwidth\fR]
141 The \fB-s\fR option sorts the fields within each type according to the argument
142 below:
143
144 .TP 5
145 \fBd\fR
146 leave fields in the order that they are stored in the \fIterminfo\fR database.
147 .TP 5
148 \fBi\fR
149 sort by \fIterminfo\fR name.
150 .TP 5
151 \fBl\fR
152 sort by the long C variable name.
153 .TP 5
154 \fBc\fR
155 sort by the \fItermcap\fR name.
156
157 If the \fB-s\fR option is not given, the fields printed out will be
158 sorted alphabetically by the \fBterminfo\fR name within each type,
159 except in the case of the \fB-C\fR or the \fB-L\fR options, which cause the
160 sorting to be done by the \fBtermcap\fR name or the long C variable
161 name, respectively.
162
163 .TP 5
164 \fB-F\fR
165 compare terminfo files.  This assumes that two following arguments are
166 filenames.  The files are searched for pairwise matches between
167 entries, with two entries considered to match if any of their names do.
168 The report printed to standard output lists entries with no matches in
169 the other file, and entries with more than one match.  For entries
170 with exactly one match it includes a difference report.
171 .TP 5
172 \fB-p\fR
173 Ignore padding specifications when comparing strings.
174 .TP 5
175 \fB-v\fR \fIn\fR
176 prints out tracing information on standard error as the program runs.
177 Higher values of n induce greater verbosity.
178 .TP 5
179 \fB-V\fR
180 prints out the version of the program in use on standard error and exits.
181 .TP 5
182 \fB-1\fR
183 causes the fields to be printed out one to a line.  Otherwise,
184 the fields will be printed several to a line to a maximum width
185 of 60 characters.
186 .TP 5
187 \fB-T\fR
188 eliminates size-restrictions on the generated text.
189 This is mainly useful for testing and analysis, since the compiled
190 descriptions are limited (e.g., 1023 for termcap, 4096 for terminfo).
191 .TP 5
192 \fB-w\fR
193 changes the output to \fIwidth\fR characters.
194 .TP 5
195 \fB-R\fR\fIsubset\fR
196 Restrict output to a given subset.  This option is for use with archaic
197 versions of terminfo like those on SVr1, Ultrix, or HP/UX that don't support
198 the full set of SVR4/XSI Curses terminfo; and outright broken ports like AIX
199 that have their own extensions incompatible with SVr4/XSI.  Available terminfo
200 subsets are "SVr1", "Ultrix", "HP", and "AIX"; see \fBterminfo\fR(\*n) for
201 details.  You can also choose the subset "BSD" which selects only capabilities
202 with termcap equivalents recognized by 4.4BSD.
203 .TP 5
204 \fB-e\fR
205 Dump the capabilities of the given terminal as a C initializer for a
206 TERMTYPE structure (the terminal capability structure in the \fB<term.h>\fR).
207 This option is useful for preparing versions of the curses library hardwired
208 for a given terminal type.
209 .SS Changing Databases [-A \fIdirectory\fR] [-B \fIdirectory\fR]
210 The location of the compiled \fBterminfo\fR database is taken from the
211 environment variable \fBTERMINFO\fR .  If the variable is not defined, or the
212 terminal is not found in that location, the system \fBterminfo\fR database,
213 in \fB@DATADIR@/terminfo\fR, will be used.  The options \fB-A\fR
214 and \fB-B\fR may be used to override this location.  The \fB-A\fR option will
215 set \fBTERMINFO\fR for the first \fItermname\fR and the \fB-B\fR option will
216 set \fBTERMINFO\fR for the other \fItermnames\fR.  With this, it is possible to
217 compare descriptions for a terminal with the same name located in two different
218 databases.  This is useful for comparing descriptions for the same terminal
219 created by different people.
220 .TP 5
221 \fB-i\fR
222 Analyze the initialization (\fBis1\fR, \fBis2\fR, \fBis3\fR), and reset
223 (\fBrs1\fR, \fBrs2\fR, \fBrs3\fR), strings in the entry.  For each string, the
224 code tries to analyze it into actions in terms of the other capabilities in the
225 entry, certain X3.64/ISO 6429/ECMA-48 capabilities, and certain DEC VT-series
226 private modes (the set of recognized special sequences has been selected for
227 completeness over the existing terminfo database).  Each report line consists
228 of the capability name, followed by a colon and space, followed by a printable
229 expansion of the capability string with sections matching recognized actions
230 translated into {}-bracketed descriptions.  Here is a list of the DEC/ANSI
231 special sequences recognized:
232
233 .TS
234 center tab(/) ;
235 l l
236 l l.
237 Action/Meaning
238 =
239 RIS/full reset
240 SC/save cursor
241 RC/restore cursor
242 LL/home-down
243 RSR/reset scroll region
244
245 ISO DEC G0/enable DEC graphics for G0
246 ISO UK G0/enable UK chars for G0
247 ISO US G0/enable US chars for G0
248 ISO DEC G1/enable DEC graphics for G1
249 ISO UK G1/enable UK chars for G1
250 ISO US G1/enable US chars for G1
251
252 DECPAM/application keypad mode
253 DECPNM/normal keypad mode
254 DECANSI/enter ANSI mode
255
256 DEC[+-]CKM/application cursor keys
257 DEC[+-]ANM/set VT52 mode
258 DEC[+-]COLM/132-column mode
259 DEC[+-]SCLM/smooth scroll
260 DEC[+-]SCNM/reverse video mode
261 DEC[+-]OM/origin mode
262 DEC[+-]AWM/wraparound mode
263 DEC[+-]ARM/auto-repeat mode
264 .TE
265 .sp
266 It also recognizes a SGR action corresponding to ANSI/ISO 6429/ECMA Set
267 Graphics Rendition, with the values NORMAL, BOLD, UNDERLINE, BLINK, and
268 REVERSE.  All but NORMAL may be prefixed with `+' (turn on) or `-' (turn off).
269 An SGR0 designates an empty highlight sequence (equivalent to {SGR:NORMAL}).
270 .SH FILES
271 .TP 20
272 \*d
273 Compiled terminal description database.
274 .SH EXTENSIONS
275 The \fB-F\fR option is not supported in SVr4 curses.  (It is primarily intended
276 to help infocmp's author, while wearing his terminfo/termcap maintainer hat,
277 merge termcap/terminfo files from various sources into the master.)
278
279 The \fB-R\fR, \fB-p\fR, \fB-e\fR, \fB-T\fR and \fB-i\fR options are not
280 supported in SVr4 curses.
281
282 The \fB-r\fR option's notion of `termcap' capabilities is System V Release 4's.
283 Actual BSD curses versions will have a more restricted set.  To see only the
284 4.4BSD set, use -r -RBSD.
285 .SH BUGS
286 The -F option of \fBinfocmp\fR(1m) should be a \fBtoe\fR(1m) mode.
287 .SH SEE ALSO
288 \fBinfocmp\fR(1m), \fBcaptoinfo\fR(1m), \fBinfotocap\fR(1m), 
289 \fBtic\fR(1m), \fBtoe\fR(1m),
290 \fBcurses\fR(3X), \fBterminfo\fR(\*n).
291 .SH AUTHOR
292 Eric S. Raymond <esr@snark.thyrsus.com>
293 .\"#
294 .\"# The following sets edit modes for GNU EMACS
295 .\"# Local Variables:
296 .\"# mode:nroff
297 .\"# fill-column:79
298 .\"# End: