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