]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/infocmp.1m
446ff98d3ebf45a79991a37e6f83670e667e29b7
[ncurses.git] / man / infocmp.1m
1 '\" t
2 .\"***************************************************************************
3 .\" Copyright (c) 1998-2010,2011 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.48 2011/07/30 22:06:07 tom Exp $
31 .TH @INFOCMP@ 1M ""
32 .ds n 5
33 .ds d @TERMINFO@
34 .SH NAME
35 \fB@INFOCMP@\fR \- compare or print out \fIterminfo\fR descriptions
36 .SH SYNOPSIS
37 \fB@INFOCMP@\fR [\fB\-\
38 1\
39 C\
40 E\
41 F\
42 G\
43 I\
44 K\
45 L\
46 T\
47 U\
48 V\
49 c\
50 d\
51 e\
52 g\
53 i\
54 l\
55 n\
56 p\
57 q\
58 r\
59 t\
60 u\
61 x\
62 \fR]
63 .br
64       [\fB\-v\fR \fIn\fR] [\fB\-s d\fR| \fBi\fR| \fBl\fR| \fBc\fR] [\fB\-R \fR\fBsubset\fR]
65 .br
66       [\fB\-w\fR\ \fIwidth\fR] [\fB\-A\fR\ \fIdirectory\fR] [\fB\-B\fR\ \fIdirectory\fR]
67 .br
68       [\fItermname\fR...]
69 .SH DESCRIPTION
70 \fB@INFOCMP@\fR can be used to compare a binary \fBterminfo\fR entry with other
71 terminfo entries, rewrite a \fBterminfo\fR description to take advantage of the
72 \fBuse=\fR terminfo field, or print out a \fBterminfo\fR description from the
73 binary file (\fBterm\fR) in a variety of formats.  In all cases, the boolean
74 fields will be printed first, followed by the numeric fields, followed by the
75 string fields.
76 .SS Default Options
77 If no options are specified and zero or one \fItermnames\fR are specified, the
78 \fB\-I\fR option will be assumed.  If more than one \fItermname\fR is specified,
79 the \fB\-d\fR option will be assumed.
80 .SS Comparison Options [\-d] [\-c] [\-n]
81 \fB@INFOCMP@\fR compares the \fBterminfo\fR description of the first terminal
82 \fItermname\fR with each of the descriptions given by the entries for the other
83 terminal's \fItermnames\fR.  If a capability is defined for only one of the
84 terminals, the value returned will depend on the type of the capability:
85 \fBF\fR for boolean variables, \fB\-1\fR for integer variables, and \fBNULL\fR
86 for string variables.
87 .PP
88 The \fB\-d\fR option produces a list of each capability that is different
89 between two entries.  This option is useful to show the difference between two
90 entries, created by different people, for the same or similar terminals.
91 .PP
92 The \fB\-c\fR option produces a list of each capability that is common between
93 two entries.  Capabilities that are not set are ignored.  This option can be
94 used as a quick check to see if the \fB\-u\fR option is worth using.
95 .PP
96 The \fB\-n\fR option produces a list of each capability that is in neither
97 entry.  If no \fItermnames\fR are given, the environment variable \fBTERM\fR
98 will be used for both of the \fItermnames\fR.  This can be used as a quick
99 check to see if anything was left out of a description.
100 .SS Source Listing Options [\-I] [\-L] [\-C] [\-r]
101 The \fB\-I\fR, \fB\-L\fR, and \fB\-C\fR options will produce a source listing for
102 each terminal named.
103 .
104 .TS
105 center tab(/) ;
106 l l .
107 \fB\-I\fR/use the \fBterminfo\fR names
108 \fB\-L\fR/use the long C variable name listed in <\fBterm.h\fR>
109 \fB\-C\fR/use the \fBtermcap\fR names
110 \fB\-r\fR/when using \fB\-C\fR, put out all capabilities in \fBtermcap\fR form
111 \fB\-K\fR/modifies the \fB\-C\fP option, improving BSD-compatibility.
112 .TE
113 .PP
114 If no \fItermnames\fR are given, the environment variable \fBTERM\fR will be
115 used for the terminal name.
116 .PP
117 The source produced by the \fB\-C\fR option may be used directly as a
118 \fBtermcap\fR entry, but not all parameterized strings can be changed to
119 the \fBtermcap\fR format.  \fB@INFOCMP@\fR will attempt to convert most of the
120 parameterized information, and anything not converted will be plainly marked in
121 the output and commented out.  These should be edited by hand.
122 .PP
123 All padding information for strings will be collected together and placed
124 at the beginning of the string where \fBtermcap\fR expects it.  Mandatory
125 padding (padding information with a trailing '/') will become optional.
126 .PP
127 All \fBtermcap\fR variables no longer supported by \fBterminfo\fR, but which
128 are derivable from other \fBterminfo\fR variables, will be output.  Not all
129 \fBterminfo\fR capabilities will be translated; only those variables which were
130 part of \fBtermcap\fR will normally be output.  Specifying the \fB\-r\fR option
131 will take off this restriction, allowing all capabilities to be output in
132 \fItermcap\fR form.
133 Normally you would use both the \fB\-C\fP and \fB\-r\fP options.
134 The actual format used incorporates some improvements for escaped characters
135 from terminfo format.
136 For a stricter BSD-compatible translation, use the \fB\-K\fR option
137 rather than \fB\-C\fP.
138 .PP
139 Note that because padding is collected to the beginning of the capability, not
140 all capabilities are output.  Mandatory padding is not supported.  Because
141 \fBtermcap\fR strings are not as flexible, it is not always possible to convert
142 a \fBterminfo\fR string capability into an equivalent \fBtermcap\fR format.  A
143 subsequent conversion of the \fBtermcap\fR file back into \fBterminfo\fR format
144 will not necessarily reproduce the original \fBterminfo\fR
145 source.
146 .PP
147 Some common \fBterminfo\fR parameter sequences, their \fBtermcap\fR
148 equivalents, and some terminal types which commonly have such sequences, are:
149 .
150 .TS
151 center tab(/) ;
152 l c l
153 l l l.
154 \fBterminfo/termcap\fR/Representative Terminals
155 =
156 \fB%p1%c/%.\fR/adm
157 \fB%p1%d/%d\fR/hp, ANSI standard, vt100
158 \fB%p1%'x'%+%c/%+x\fR/concept
159 \fB%i/%i\fRq/ANSI standard, vt100
160 \fB%p1%?%'x'%>%t%p1%'y'%+%;/%>xy\fR/concept
161 \fB%p2\fR is printed before \fB%p1/%r\fR/hp
162 .TE
163 .SS Use= Option [\-u]
164 The \fB\-u\fR option produces a \fBterminfo\fR source description of the first
165 terminal \fItermname\fR which is relative to the sum of the descriptions given
166 by the entries for the other terminals \fItermnames\fR.  It does this by
167 analyzing the differences between the first \fItermname\fR and the other
168 \fItermnames\fR and producing a description with \fBuse=\fR fields for the
169 other terminals.  In this manner, it is possible to retrofit generic terminfo
170 entries into a terminal's description.  Or, if two similar terminals exist, but
171 were coded at different times or by different people so that each description
172 is a full description, using \fB@INFOCMP@\fR will show what can be done to change
173 one description to be relative to the other.
174 .PP
175 A capability will get printed with an at-sign (@) if it no longer exists in the
176 first \fItermname\fR, but one of the other \fItermname\fR entries contains a
177 value for it.  A capability's value gets printed if the value in the first
178 \fItermname\fR is not found in any of the other \fItermname\fR entries, or if
179 the first of the other \fItermname\fR entries that has this capability gives a
180 different value for the capability than that in the first \fItermname\fR.
181 .PP
182 The order of the other \fItermname\fR entries is significant.  Since the
183 terminfo compiler \fBtic\fR does a left-to-right scan of the capabilities,
184 specifying two \fBuse=\fR entries that contain differing entries for the same
185 capabilities will produce different results depending on the order that the
186 entries are given in.  \fB@INFOCMP@\fR will flag any such inconsistencies between
187 the other \fItermname\fR entries as they are found.
188 .PP
189 Alternatively, specifying a capability \fIafter\fR a \fBuse=\fR entry that
190 contains that capability will cause the second specification to be ignored.
191 Using \fB@INFOCMP@\fR to recreate a description can be a useful check to make
192 sure that everything was specified correctly in the original source
193 description.
194 .PP
195 Another error that does not cause incorrect compiled files, but will slow down
196 the compilation time, is specifying extra \fBuse=\fR fields that are
197 superfluous.  \fB@INFOCMP@\fR will flag any other \fItermname use=\fR fields that
198 were not needed.
199 .SS Changing Databases [\-A \fIdirectory\fR] [\-B \fIdirectory\fR]
200 The location of the compiled \fBterminfo\fR database is taken from the
201 environment variable \fBTERMINFO\fR .  If the variable is not defined, or the
202 terminal is not found in that location, the system \fBterminfo\fR database,
203 in \fB@TERMINFO@\fR, will be used.  The options \fB\-A\fR
204 and \fB\-B\fR may be used to override this location.  The \fB\-A\fR option will
205 set \fBTERMINFO\fR for the first \fItermname\fR and the \fB\-B\fR option will
206 set \fBTERMINFO\fR for the other \fItermnames\fR.  With this, it is possible to
207 compare descriptions for a terminal with the same name located in two different
208 databases.  This is useful for comparing descriptions for the same terminal
209 created by different people.
210 .SS Other Options
211 .TP 5
212 \fB\-1\fR
213 causes the fields to be printed out one to a line.  Otherwise,
214 the fields will be printed several to a line to a maximum width
215 of 60 characters.
216 .TP
217 \fB\-a\fR
218 tells \fB@INFOCMP@\fP to retain commented-out capabilities rather than discarding
219 them.  Capabilities are commented by prefixing them with a period.
220 .TP 5
221 \fB\-E\fR
222 Dump the capabilities of the given terminal as tables, needed in
223 the C initializer for a
224 TERMTYPE structure (the terminal capability structure in the \fB<term.h>\fR).
225 This option is useful for preparing versions of the curses library hardwired
226 for a given terminal type.
227 The tables are all declared static, and are named according to the type
228 and the name of the corresponding terminal entry.
229 .sp
230 Before ncurses 5.0, the split between the \fB\-e\fP and \fB\-E\fP
231 options was not needed; but support for extended names required making
232 the arrays of terminal capabilities separate from the TERMTYPE structure.
233 .TP 5
234 \fB\-e\fR
235 Dump the capabilities of the given terminal as a C initializer for a
236 TERMTYPE structure (the terminal capability structure in the \fB<term.h>\fR).
237 This option is useful for preparing versions of the curses library hardwired
238 for a given terminal type.
239 .TP 5
240 \fB\-F\fR
241 compare terminfo files.  This assumes that two following arguments are
242 filenames.  The files are searched for pairwise matches between
243 entries, with two entries considered to match if any of their names do.
244 The report printed to standard output lists entries with no matches in
245 the other file, and entries with more than one match.  For entries
246 with exactly one match it includes a difference report.  Normally,
247 to reduce the volume of the report, use references are
248 not resolved before looking for differences, but resolution can be forced
249 by also specifying \fB\-r\fR.
250 .TP 5
251 \fB\-f\fR
252 Display complex terminfo strings which contain if/then/else/endif expressions
253 indented for readability.
254 .TP 5
255 \fB\-G\fR
256 Display constant literals in decimal form
257 rather than their character equivalents.
258 .TP 5
259 \fB\-g\fR
260 Display constant character literals in quoted form
261 rather than their decimal equivalents.
262 .TP 5
263 \fB\-i\fR
264 Analyze the initialization (\fBis1\fR, \fBis2\fR, \fBis3\fR), and reset
265 (\fBrs1\fR, \fBrs2\fR, \fBrs3\fR), strings in the entry.  For each string, the
266 code tries to analyze it into actions in terms of the other capabilities in the
267 entry, certain X3.64/ISO 6429/ECMA\-48 capabilities, and certain DEC VT-series
268 private modes (the set of recognized special sequences has been selected for
269 completeness over the existing terminfo database).  Each report line consists
270 of the capability name, followed by a colon and space, followed by a printable
271 expansion of the capability string with sections matching recognized actions
272 translated into {}-bracketed descriptions.  Here is a list of the DEC/ANSI
273 special sequences recognized:
274 i.
275 .TS
276 center tab(/) ;
277 l l
278 l l.
279 Action/Meaning
280 =
281 RIS/full reset
282 SC/save cursor
283 RC/restore cursor
284 LL/home-down
285 RSR/reset scroll region
286 =
287 DECSTR/soft reset (VT320)
288 S7C1T/7-bit controls (VT220)
289 =
290 ISO DEC G0/enable DEC graphics for G0
291 ISO UK G0/enable UK chars for G0
292 ISO US G0/enable US chars for G0
293 ISO DEC G1/enable DEC graphics for G1
294 ISO UK G1/enable UK chars for G1
295 ISO US G1/enable US chars for G1
296 =
297 DECPAM/application keypad mode
298 DECPNM/normal keypad mode
299 DECANSI/enter ANSI mode
300 =
301 ECMA[+\-]AM/keyboard action mode
302 ECMA[+\-]IRM/insert replace mode
303 ECMA[+\-]SRM/send receive mode
304 ECMA[+\-]LNM/linefeed mode
305 =
306 DEC[+\-]CKM/application cursor keys
307 DEC[+\-]ANM/set VT52 mode
308 DEC[+\-]COLM/132-column mode
309 DEC[+\-]SCLM/smooth scroll
310 DEC[+\-]SCNM/reverse video mode
311 DEC[+\-]OM/origin mode
312 DEC[+\-]AWM/wraparound mode
313 DEC[+\-]ARM/auto-repeat mode
314 .TE
315 .sp
316 It also recognizes a SGR action corresponding to ANSI/ISO 6429/ECMA Set
317 Graphics Rendition, with the values NORMAL, BOLD, UNDERLINE, BLINK, and
318 REVERSE.  All but NORMAL may be prefixed with `+' (turn on) or `\-' (turn off).
319 .PP
320 An SGR0 designates an empty highlight sequence (equivalent to {SGR:NORMAL}).
321 .TP 5
322 \fB\-l\fR
323 Set output format to terminfo.
324 .TP 5
325 \fB\-p\fR
326 Ignore padding specifications when comparing strings.
327 .TP 5
328 \fB\-q\fR
329 Make the comparison listing shorter by omitting subheadings, and using
330 "\-" for absent capabilities, "@" for canceled rather than "NULL".
331 .TP 5
332 \fB\-R\fR\fIsubset\fR
333 Restrict output to a given subset.  This option is for use with archaic
334 versions of terminfo like those on SVr1, Ultrix, or HP/UX that do not support
335 the full set of SVR4/XSI Curses terminfo; and variants such as AIX
336 that have their own extensions incompatible with SVr4/XSI.  Available terminfo
337 subsets are "SVr1", "Ultrix", "HP", and "AIX"; see \fBterminfo\fR(\*n) for
338 details.  You can also choose the subset "BSD" which selects only capabilities
339 with termcap equivalents recognized by 4.4BSD.
340 .TP
341 \fB\-s \fR\fI[d|i|l|c]\fR
342 The \fB\-s\fR option sorts the fields within each type according to the argument
343 below:
344 .br
345 .RS 5
346 .TP 5
347 \fBd\fR
348 leave fields in the order that they are stored in the \fIterminfo\fR database.
349 .TP 5
350 \fBi\fR
351 sort by \fIterminfo\fR name.
352 .TP 5
353 \fBl\fR
354 sort by the long C variable name.
355 .TP 5
356 \fBc\fR
357 sort by the \fItermcap\fR name.
358 .RE
359 .IP
360 If the \fB\-s\fR option is not given, the fields printed out will be
361 sorted alphabetically by the \fBterminfo\fR name within each type,
362 except in the case of the \fB\-C\fR or the \fB\-L\fR options, which cause the
363 sorting to be done by the \fBtermcap\fR name or the long C variable
364 name, respectively.
365 .TP 5
366 \fB\-T\fR
367 eliminates size-restrictions on the generated text.
368 This is mainly useful for testing and analysis, since the compiled
369 descriptions are limited (e.g., 1023 for termcap, 4096 for terminfo).
370 .TP
371 \fB\-t\fR
372 tells \fBtic\fP to discard commented-out capabilities.
373 Normally when translating from terminfo to termcap,
374 untranslatable capabilities are commented-out.
375 .TP 5
376 \fB\-U\fR
377 tells \fB@INFOCMP@\fP to not post-process the data after parsing the source file.
378 This feature helps when comparing the actual contents of two source files,
379 since it excludes the inferences that \fB@INFOCMP@\fP makes to fill in missing
380 data.
381 .TP 5
382 \fB\-V\fR
383 reports the version of ncurses which was used in this program, and exits.
384 .TP 5
385 \fB\-v\fR \fIn\fR
386 prints out tracing information on standard error as the program runs.
387 Higher values of n induce greater verbosity.
388 .TP 5
389 \fB\-w\fR \fIwidth\fR
390 changes the output to \fIwidth\fR characters.
391 .TP
392 \fB\-x\fR
393 print information for user-defined capabilities.
394 These are extensions to the terminfo repertoire which can be loaded
395 using the \fB\-x\fR option of \fBtic\fP.
396 .SH FILES
397 .TP 20
398 \*d
399 Compiled terminal description database.
400 .SH EXTENSIONS
401 The
402 \fB\-E\fR,
403 \fB\-F\fR,
404 \fB\-G\fR,
405 \fB\-R\fR,
406 \fB\-T\fR,
407 \fB\-V\fR,
408 \fB\-a\fR,
409 \fB\-e\fR,
410 \fB\-f\fR,
411 \fB\-g\fR,
412 \fB\-i\fR,
413 \fB\-l\fR,
414 \fB\-p\fR,
415 \fB\-q\fR and
416 \fB\-t\fR
417 options are not supported in SVr4 curses.
418 .PP
419 The \fB\-r\fR option's notion of `termcap' capabilities is System V Release 4's.
420 Actual BSD curses versions will have a more restricted set.  To see only the
421 4.4BSD set, use \fB\-r\fR \fB\-RBSD\fR.
422 .SH BUGS
423 The \fB\-F\fR option of \fB@INFOCMP@\fR(1M) should be a \fB@TOE@\fR(1M) mode.
424 .SH SEE ALSO
425 \fB@CAPTOINFO@\fR(1M),
426 \fB@INFOTOCAP@\fR(1M),
427 \fB@TIC@\fR(1M),
428 \fB@TOE@\fR(1M),
429 \fBcurses\fR(3X),
430 \fBterminfo\fR(\*n).
431 .PP
432 This describes \fBncurses\fR
433 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
434 .SH AUTHOR
435 Eric S. Raymond <esr@snark.thyrsus.com>
436 and
437 .br
438 Thomas E. Dickey <dickey@invisible-island.net>