]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/infocmp.1m
ncurses 5.2
[ncurses.git] / man / infocmp.1m
1 '\" t
2 .\"***************************************************************************
3 .\" Copyright (c) 1998,2000 Free Software Foundation, Inc.                   *
4 .\"                                                                          *
5 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
6 .\" copy of this software and associated documentation files (the            *
7 .\" "Software"), to deal in the Software without restriction, including      *
8 .\" without limitation the rights to use, copy, modify, merge, publish,      *
9 .\" distribute, distribute with modifications, sublicense, and/or sell       *
10 .\" copies of the Software, and to permit persons to whom the Software is    *
11 .\" furnished to do so, subject to the following conditions:                 *
12 .\"                                                                          *
13 .\" The above copyright notice and this permission notice shall be included  *
14 .\" in all copies or substantial portions of the Software.                   *
15 .\"                                                                          *
16 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
17 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
18 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
19 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
20 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
21 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
22 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
23 .\"                                                                          *
24 .\" Except as contained in this notice, the name(s) of the above copyright   *
25 .\" holders shall not be used in advertising or otherwise to promote the     *
26 .\" sale, use or other dealings in this Software without prior written       *
27 .\" authorization.                                                           *
28 .\"***************************************************************************
29 .\"
30 .\" $Id: infocmp.1m,v 1.27 2000/08/19 18:51:05 tom Exp $
31 .TH infocmp 1M ""
32 .ds n 5
33 .ds d @TERMINFO@
34 .SH NAME
35 \fBinfocmp\fR - compare or print out \fIterminfo\fR descriptions
36 .SH SYNOPSIS
37 \fBinfocmp\fR [\fB-dceEGgnpqrILCuV1\fR] [\fB-v\fR \fIn\fR] [\fB-s d\fR| \fBi\fR| \fBl\fR| \fBc\fR]
38 .br
39       [\fB-w\fR\ \fIwidth\fR] [\fB-A\fR\ \fIdirectory\fR] [\fB-B\fR\ \fIdirectory\fR]
40 .br
41       [\fItermname\fR...]
42 .SH DESCRIPTION
43 \fBinfocmp\fR can be used to compare a binary \fBterminfo\fR entry with other
44 terminfo entries, rewrite a \fBterminfo\fR description to take advantage of the
45 \fBuse=\fR terminfo field, or print out a \fBterminfo\fR description from the
46 binary file (\fBterm\fR) in a variety of formats.  In all cases, the boolean
47 fields will be printed first, followed by the numeric fields, followed by the
48 string fields.
49 ..
50 .SS Default Options
51 If no options are specified and zero or one \fItermnames\fR are specified, the
52 \fB-I\fR option will be assumed.  If more than one \fItermname\fR is specified,
53 the \fB-d\fR option will be assumed.
54 ..
55 .SS Comparison Options [-d] [-c] [-n]
56 \fBinfocmp\fR compares the \fBterminfo\fR description of the first terminal
57 \fItermname\fR with each of the descriptions given by the entries for the other
58 terminal's \fItermnames\fR.  If a capability is defined for only one of the
59 terminals, the value returned will depend on the type of the capability:
60 \fBF\fR for boolean variables, \fB-1\fR for integer variables, and \fBNULL\fR
61 for string variables.
62
63 The \fB-d\fR option produces a list of each capability that is different
64 between two entries.  This option is useful to show the difference between two
65 entries, created by different people, for the same or similar terminals.
66
67 The \fB-c\fR option produces a list of each capability that is common between
68 two entries.  Capabilities that are not set are ignored.  This option can be
69 used as a quick check to see if the \fB-u\fR option is worth using.
70
71 The \fB-n\fR option produces a list of each capability that is in neither
72 entry.  If no \fItermnames\fR are given, the environment variable \fBTERM\fR
73 will be used for both of the \fItermnames\fR.  This can be used as a quick
74 check to see if anything was left out of a description.
75 ..
76 .SS Source Listing Options [-I] [-L] [-C] [-r]
77 The \fB-I\fR, \fB-L\fR, and \fB-C\fR options will produce a source listing for
78 each terminal named.
79
80 .TS
81 center tab(/) ;
82 l l .
83 \fB-I\fR/use the \fBterminfo\fR names
84 \fB-L\fR/use the long C variable name listed in <\fBterm.h\fR>
85 \fB-C\fR/use the \fBtermcap\fR names
86 \fB-r\fR/when using \fB-C\fR, put out all capabilities in \fBtermcap\fR form
87 .TE
88
89 If no \fItermnames\fR are given, the environment variable \fBTERM\fR will be
90 used for the terminal name.
91
92 The source produced by the \fB-C\fR option may be used directly as a
93 \fBtermcap\fR entry, but not all parameterized strings can be changed to
94 the \fBtermcap\fR format.  \fBinfocmp\fR will attempt to convert most of the
95 parameterized information, and anything not converted will be plainly marked in
96 the output and commented out.  These should be edited by hand.
97
98 All padding information for strings will be collected together and placed
99 at the beginning of the string where \fBtermcap\fR expects it.  Mandatory
100 padding (padding information with a trailing '/') will become optional.
101
102 All \fBtermcap\fR variables no longer supported by \fBterminfo\fR, but which
103 are derivable from other \fBterminfo\fR variables, will be output.  Not all
104 \fBterminfo\fR capabilities will be translated; only those variables which were
105 part of \fBtermcap\fR will normally be output.  Specifying the \fB-r\fR option
106 will take off this restriction, allowing all capabilities to be output in
107 \fItermcap\fR form.
108
109 Note that because padding is collected to the beginning of the capability, not
110 all capabilities are output.  Mandatory padding is not supported.  Because
111 \fBtermcap\fR strings are not as flexible, it is not always possible to convert
112 a \fBterminfo\fR string capability into an equivalent \fBtermcap\fR format.  A
113 subsequent conversion of the \fBtermcap\fR file back into \fBterminfo\fR format
114 will not necessarily reproduce the original \fBterminfo\fR
115 source.
116
117 Some common \fBterminfo\fR parameter sequences, their \fBtermcap\fR
118 equivalents, and some terminal types which commonly have such sequences, are:
119
120 .TS
121 center tab(/) ;
122 l c l
123 l l l.
124 \fBterminfo/termcap\fR/Representative Terminals
125 =
126 \fB%p1%c/%.\fR/adm
127 \fB%p1%d/%d\fR/hp, ANSI standard, vt100
128 \fB%p1%'x'%+%c/%+x\fR/concept
129 \fB%i/%i\fRq/ANSI standard, vt100
130 \fB%p1%?%'x'%>%t%p1%'y'%+%;/%>xy\fR/concept
131 \fB%p2\fR is printed before \fB%p1/%r\fR/hp
132 .TE
133 .SS Use= Option [-u]
134 The \fB-u\fR option produces a \fBterminfo\fR source description of the first
135 terminal \fItermname\fR which is relative to the sum of the descriptions given
136 by the entries for the other terminals \fItermnames\fR.  It does this by
137 analyzing the differences between the first \fItermname\fR and the other
138 \fItermnames\fR and producing a description with \fBuse=\fR fields for the
139 other terminals.  In this manner, it is possible to retrofit generic terminfo
140 entries into a terminal's description.  Or, if two similar terminals exist, but
141 were coded at different times or by different people so that each description
142 is a full description, using \fBinfocmp\fR will show what can be done to change
143 one description to be relative to the other.
144
145 A capability will get printed with an at-sign (@) if it no longer exists in the
146 first \fItermname\fR, but one of the other \fItermname\fR entries contains a
147 value for it.  A capability's value gets printed if the value in the first
148 \fItermname\fR is not found in any of the other \fItermname\fR entries, or if
149 the first of the other \fItermname\fR entries that has this capability gives a
150 different value for the capability than that in the first \fItermname\fR.
151
152 The order of the other \fItermname\fR entries is significant.  Since the
153 terminfo compiler \fBtic\fR does a left-to-right scan of the capabilities,
154 specifying two \fBuse=\fR entries that contain differing entries for the same
155 capabilities will produce different results depending on the order that the
156 entries are given in.  \fBinfocmp\fR will flag any such inconsistencies between
157 the other \fItermname\fR entries as they are found.
158
159 Alternatively, specifying a capability \fIafter\fR a \fBuse=\fR entry that
160 contains that capability will cause the second specification to be ignored.
161 Using \fBinfocmp\fR to recreate a description can be a useful check to make
162 sure that everything was specified correctly in the original source
163 description.
164
165 Another error that does not cause incorrect compiled files, but will slow down
166 the compilation time, is specifying extra \fBuse=\fR fields that are
167 superfluous.  \fBinfocmp\fR will flag any other \fItermname use=\fR fields that
168 were not needed.
169 ..
170 .SS Changing Databases [-A \fIdirectory\fR] [-B \fIdirectory\fR]
171 The location of the compiled \fBterminfo\fR database is taken from the
172 environment variable \fBTERMINFO\fR .  If the variable is not defined, or the
173 terminal is not found in that location, the system \fBterminfo\fR database,
174 in \fB@TERMINFO@\fR, will be used.  The options \fB-A\fR
175 and \fB-B\fR may be used to override this location.  The \fB-A\fR option will
176 set \fBTERMINFO\fR for the first \fItermname\fR and the \fB-B\fR option will
177 set \fBTERMINFO\fR for the other \fItermnames\fR.  With this, it is possible to
178 compare descriptions for a terminal with the same name located in two different
179 databases.  This is useful for comparing descriptions for the same terminal
180 created by different people.
181 ..
182 .SS Other Options [-s d|i|l|c] [-1FTVefip] [-Rsubset] [-v \fIn\fR] [-w \fIwidth\fR]
183 The \fB-s\fR option sorts the fields within each type according to the argument
184 below:
185 ..
186 .TP 5
187 \fBd\fR
188 leave fields in the order that they are stored in the \fIterminfo\fR database.
189 .TP 5
190 \fBi\fR
191 sort by \fIterminfo\fR name.
192 .TP 5
193 \fBl\fR
194 sort by the long C variable name.
195 .TP 5
196 \fBc\fR
197 sort by the \fItermcap\fR name.
198
199 If the \fB-s\fR option is not given, the fields printed out will be
200 sorted alphabetically by the \fBterminfo\fR name within each type,
201 except in the case of the \fB-C\fR or the \fB-L\fR options, which cause the
202 sorting to be done by the \fBtermcap\fR name or the long C variable
203 name, respectively.
204 .TP 5
205 \fB-1\fR
206 causes the fields to be printed out one to a line.  Otherwise,
207 the fields will be printed several to a line to a maximum width
208 of 60 characters.
209 .TP 5
210 \fB-F\fR
211 compare terminfo files.  This assumes that two following arguments are
212 filenames.  The files are searched for pairwise matches between
213 entries, with two entries considered to match if any of their names do.
214 The report printed to standard output lists entries with no matches in
215 the other file, and entries with more than one match.  For entries
216 with exactly one match it includes a difference report.  Normally,
217 to reduce the volume of the report, use references are
218 not resolved before looking for differences, but resolution can be forced
219 by also specifying \fB-r\fR.
220 .TP
221 \fB-G\fR
222 Display constant literals in decimal form
223 rather than their character equivalents.
224 .TP
225 \fB-a\fR
226 tells \fBinfocmp\fP to retain commented-out capabilities rather than discarding
227 them.  Capabilities are commented by prefixing them with a period.
228 .TP 5
229 \fB-q\fR
230 Make the comparison listing shorter by omitting subheadings, and using
231 "-" for absent capabilities, "@" for canceled rather than "NULL".
232 .TP 5
233 \fB-R\fR\fIsubset\fR
234 Restrict output to a given subset.  This option is for use with archaic
235 versions of terminfo like those on SVr1, Ultrix, or HP/UX that do not support
236 the full set of SVR4/XSI Curses terminfo; and variants such as AIX
237 that have their own extensions incompatible with SVr4/XSI.  Available terminfo
238 subsets are "SVr1", "Ultrix", "HP", and "AIX"; see \fBterminfo\fR(\*n) for
239 details.  You can also choose the subset "BSD" which selects only capabilities
240 with termcap equivalents recognized by 4.4BSD.
241 .TP 5
242 \fB-T\fR
243 eliminates size-restrictions on the generated text.
244 This is mainly useful for testing and analysis, since the compiled
245 descriptions are limited (e.g., 1023 for termcap, 4096 for terminfo).
246 .TP 5
247 \fB-V\fR
248 reports the version of ncurses which was used in this program, and exits.
249 .TP 5
250 \fB-e\fR
251 Dump the capabilities of the given terminal as a C initializer for a
252 TERMTYPE structure (the terminal capability structure in the \fB<term.h>\fR).
253 This option is useful for preparing versions of the curses library hardwired
254 for a given terminal type.
255 .TP 5
256 \fB-E\fR
257 Dump the capabilities of the given terminal as tables, needed in
258 the C initializer for a
259 TERMTYPE structure (the terminal capability structure in the \fB<term.h>\fR).
260 This option is useful for preparing versions of the curses library hardwired
261 for a given terminal type.
262 The tables are all declared static, and are named according to the type
263 and the name of the corresponding terminal entry.
264 .sp
265 Before ncurses 5.0, the split between the \fB\-e\fP and \fB\-E\fP 
266 options was not needed; but support for extended names required making
267 the arrays of terminal capabilities separate from the TERMTYPE structure.
268 .TP
269 \fB-f\fR
270 Display complex terminfo strings which contain if/then/else/endif expressions
271 indented for readability.
272 .TP
273 \fB-g\fR
274 Display constant character literals in quoted form
275 rather than their decimal equivalents.
276 .TP 5
277 \fB-i\fR
278 Analyze the initialization (\fBis1\fR, \fBis2\fR, \fBis3\fR), and reset
279 (\fBrs1\fR, \fBrs2\fR, \fBrs3\fR), strings in the entry.  For each string, the
280 code tries to analyze it into actions in terms of the other capabilities in the
281 entry, certain X3.64/ISO 6429/ECMA-48 capabilities, and certain DEC VT-series
282 private modes (the set of recognized special sequences has been selected for
283 completeness over the existing terminfo database).  Each report line consists
284 of the capability name, followed by a colon and space, followed by a printable
285 expansion of the capability string with sections matching recognized actions
286 translated into {}-bracketed descriptions.  Here is a list of the DEC/ANSI
287 special sequences recognized:
288
289 .TS
290 center tab(/) ;
291 l l
292 l l.
293 Action/Meaning
294 =
295 RIS/full reset
296 SC/save cursor
297 RC/restore cursor
298 LL/home-down
299 RSR/reset scroll region
300
301 ISO DEC G0/enable DEC graphics for G0
302 ISO UK G0/enable UK chars for G0
303 ISO US G0/enable US chars for G0
304 ISO DEC G1/enable DEC graphics for G1
305 ISO UK G1/enable UK chars for G1
306 ISO US G1/enable US chars for G1
307
308 DECPAM/application keypad mode
309 DECPNM/normal keypad mode
310 DECANSI/enter ANSI mode
311
312 DEC[+-]CKM/application cursor keys
313 DEC[+-]ANM/set VT52 mode
314 DEC[+-]COLM/132-column mode
315 DEC[+-]SCLM/smooth scroll
316 DEC[+-]SCNM/reverse video mode
317 DEC[+-]OM/origin mode
318 DEC[+-]AWM/wraparound mode
319 DEC[+-]ARM/auto-repeat mode
320 .TE
321 .sp
322 It also recognizes a SGR action corresponding to ANSI/ISO 6429/ECMA Set
323 Graphics Rendition, with the values NORMAL, BOLD, UNDERLINE, BLINK, and
324 REVERSE.  All but NORMAL may be prefixed with `+' (turn on) or `-' (turn off).
325
326 An SGR0 designates an empty highlight sequence (equivalent to {SGR:NORMAL}).
327 .TP 5
328 \fB-p\fR
329 Ignore padding specifications when comparing strings.
330 .TP 5
331 \fB-v\fR \fIn\fR
332 prints out tracing information on standard error as the program runs.
333 Higher values of n induce greater verbosity.
334 .TP 5
335 \fB-w\fR \fIwidth\fR
336 changes the output to \fIwidth\fR characters.
337 ..
338 .SH FILES
339 .TP 20
340 \*d
341 Compiled terminal description database.
342 ..
343 .SH EXTENSIONS
344 The
345 \fB-E\fR,
346 \fB-F\fR,
347 \fB-G\fR,
348 \fB-R\fR,
349 \fB-T\fR,
350 \fB-V\fR,
351 \fB-a\fR,
352 \fB-e\fR,
353 \fB-f\fR,
354 \fB-g\fR,
355 \fB-i\fR,
356 \fB-p\fR, and
357 \fB-q\fR
358 options are not supported in SVr4 curses.
359
360 The \fB-r\fR option's notion of `termcap' capabilities is System V Release 4's.
361 Actual BSD curses versions will have a more restricted set.  To see only the
362 4.4BSD set, use -r -RBSD.
363 .SH BUGS
364 The -F option of \fBinfocmp\fR(1M) should be a \fBtoe\fR(1M) mode.
365 .SH SEE ALSO
366 \fBinfocmp\fR(1M), \fBcaptoinfo\fR(1M), \fBinfotocap\fR(1M),
367 \fBtic\fR(1M), \fBtoe\fR(1M),
368 \fBcurses\fR(3X), \fBterminfo\fR(\*n).
369 .SH AUTHOR
370 Eric S. Raymond <esr@snark.thyrsus.com>
371 and
372 Thomas E. Dickey <dickey@herndon4.his.com>
373 .\"#
374 .\"# The following sets edit modes for GNU EMACS
375 .\"# Local Variables:
376 .\"# mode:nroff
377 .\"# fill-column:79
378 .\"# End: