]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/infocmp.1m
ncurses 5.9 - patch 20110903
[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.49 2011/08/06 17:46:28 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\-0\fR
213 causes the fields to be printed on one line, without wrapping.
214 .TP 5
215 \fB\-1\fR
216 causes the fields to be printed out one to a line.  Otherwise,
217 the fields will be printed several to a line to a maximum width
218 of 60 characters.
219 .TP
220 \fB\-a\fR
221 tells \fB@INFOCMP@\fP to retain commented-out capabilities rather than discarding
222 them.  Capabilities are commented by prefixing them with a period.
223 .TP 5
224 \fB\-E\fR
225 Dump the capabilities of the given terminal as tables, needed in
226 the C initializer for a
227 TERMTYPE structure (the terminal capability structure in the \fB<term.h>\fR).
228 This option is useful for preparing versions of the curses library hardwired
229 for a given terminal type.
230 The tables are all declared static, and are named according to the type
231 and the name of the corresponding terminal entry.
232 .sp
233 Before ncurses 5.0, the split between the \fB\-e\fP and \fB\-E\fP
234 options was not needed; but support for extended names required making
235 the arrays of terminal capabilities separate from the TERMTYPE structure.
236 .TP 5
237 \fB\-e\fR
238 Dump the capabilities of the given terminal as a C initializer for a
239 TERMTYPE structure (the terminal capability structure in the \fB<term.h>\fR).
240 This option is useful for preparing versions of the curses library hardwired
241 for a given terminal type.
242 .TP 5
243 \fB\-F\fR
244 compare terminfo files.  This assumes that two following arguments are
245 filenames.  The files are searched for pairwise matches between
246 entries, with two entries considered to match if any of their names do.
247 The report printed to standard output lists entries with no matches in
248 the other file, and entries with more than one match.  For entries
249 with exactly one match it includes a difference report.  Normally,
250 to reduce the volume of the report, use references are
251 not resolved before looking for differences, but resolution can be forced
252 by also specifying \fB\-r\fR.
253 .TP 5
254 \fB\-f\fR
255 Display complex terminfo strings which contain if/then/else/endif expressions
256 indented for readability.
257 .TP 5
258 \fB\-G\fR
259 Display constant literals in decimal form
260 rather than their character equivalents.
261 .TP 5
262 \fB\-g\fR
263 Display constant character literals in quoted form
264 rather than their decimal equivalents.
265 .TP 5
266 \fB\-i\fR
267 Analyze the initialization (\fBis1\fR, \fBis2\fR, \fBis3\fR), and reset
268 (\fBrs1\fR, \fBrs2\fR, \fBrs3\fR), strings in the entry.  For each string, the
269 code tries to analyze it into actions in terms of the other capabilities in the
270 entry, certain X3.64/ISO 6429/ECMA\-48 capabilities, and certain DEC VT-series
271 private modes (the set of recognized special sequences has been selected for
272 completeness over the existing terminfo database).  Each report line consists
273 of the capability name, followed by a colon and space, followed by a printable
274 expansion of the capability string with sections matching recognized actions
275 translated into {}-bracketed descriptions.  Here is a list of the DEC/ANSI
276 special sequences recognized:
277 i.
278 .TS
279 center tab(/) ;
280 l l
281 l l.
282 Action/Meaning
283 =
284 RIS/full reset
285 SC/save cursor
286 RC/restore cursor
287 LL/home-down
288 RSR/reset scroll region
289 =
290 DECSTR/soft reset (VT320)
291 S7C1T/7-bit controls (VT220)
292 =
293 ISO DEC G0/enable DEC graphics for G0
294 ISO UK G0/enable UK chars for G0
295 ISO US G0/enable US chars for G0
296 ISO DEC G1/enable DEC graphics for G1
297 ISO UK G1/enable UK chars for G1
298 ISO US G1/enable US chars for G1
299 =
300 DECPAM/application keypad mode
301 DECPNM/normal keypad mode
302 DECANSI/enter ANSI mode
303 =
304 ECMA[+\-]AM/keyboard action mode
305 ECMA[+\-]IRM/insert replace mode
306 ECMA[+\-]SRM/send receive mode
307 ECMA[+\-]LNM/linefeed mode
308 =
309 DEC[+\-]CKM/application cursor keys
310 DEC[+\-]ANM/set VT52 mode
311 DEC[+\-]COLM/132-column mode
312 DEC[+\-]SCLM/smooth scroll
313 DEC[+\-]SCNM/reverse video mode
314 DEC[+\-]OM/origin mode
315 DEC[+\-]AWM/wraparound mode
316 DEC[+\-]ARM/auto-repeat mode
317 .TE
318 .sp
319 It also recognizes a SGR action corresponding to ANSI/ISO 6429/ECMA Set
320 Graphics Rendition, with the values NORMAL, BOLD, UNDERLINE, BLINK, and
321 REVERSE.  All but NORMAL may be prefixed with `+' (turn on) or `\-' (turn off).
322 .PP
323 An SGR0 designates an empty highlight sequence (equivalent to {SGR:NORMAL}).
324 .TP 5
325 \fB\-l\fR
326 Set output format to terminfo.
327 .TP 5
328 \fB\-p\fR
329 Ignore padding specifications when comparing strings.
330 .TP 5
331 \fB\-q\fR
332 Make the comparison listing shorter by omitting subheadings, and using
333 "\-" for absent capabilities, "@" for canceled rather than "NULL".
334 .TP 5
335 \fB\-R\fR\fIsubset\fR
336 Restrict output to a given subset.  This option is for use with archaic
337 versions of terminfo like those on SVr1, Ultrix, or HP/UX that do not support
338 the full set of SVR4/XSI Curses terminfo; and variants such as AIX
339 that have their own extensions incompatible with SVr4/XSI.  Available terminfo
340 subsets are "SVr1", "Ultrix", "HP", and "AIX"; see \fBterminfo\fR(\*n) for
341 details.  You can also choose the subset "BSD" which selects only capabilities
342 with termcap equivalents recognized by 4.4BSD.
343 .TP
344 \fB\-s \fR\fI[d|i|l|c]\fR
345 The \fB\-s\fR option sorts the fields within each type according to the argument
346 below:
347 .br
348 .RS 5
349 .TP 5
350 \fBd\fR
351 leave fields in the order that they are stored in the \fIterminfo\fR database.
352 .TP 5
353 \fBi\fR
354 sort by \fIterminfo\fR name.
355 .TP 5
356 \fBl\fR
357 sort by the long C variable name.
358 .TP 5
359 \fBc\fR
360 sort by the \fItermcap\fR name.
361 .RE
362 .IP
363 If the \fB\-s\fR option is not given, the fields printed out will be
364 sorted alphabetically by the \fBterminfo\fR name within each type,
365 except in the case of the \fB\-C\fR or the \fB\-L\fR options, which cause the
366 sorting to be done by the \fBtermcap\fR name or the long C variable
367 name, respectively.
368 .TP 5
369 \fB\-T\fR
370 eliminates size-restrictions on the generated text.
371 This is mainly useful for testing and analysis, since the compiled
372 descriptions are limited (e.g., 1023 for termcap, 4096 for terminfo).
373 .TP
374 \fB\-t\fR
375 tells \fBtic\fP to discard commented-out capabilities.
376 Normally when translating from terminfo to termcap,
377 untranslatable capabilities are commented-out.
378 .TP 5
379 \fB\-U\fR
380 tells \fB@INFOCMP@\fP to not post-process the data after parsing the source file.
381 This feature helps when comparing the actual contents of two source files,
382 since it excludes the inferences that \fB@INFOCMP@\fP makes to fill in missing
383 data.
384 .TP 5
385 \fB\-V\fR
386 reports the version of ncurses which was used in this program, and exits.
387 .TP 5
388 \fB\-v\fR \fIn\fR
389 prints out tracing information on standard error as the program runs.
390 Higher values of n induce greater verbosity.
391 .TP 5
392 \fB\-w\fR \fIwidth\fR
393 changes the output to \fIwidth\fR characters.
394 .TP
395 \fB\-x\fR
396 print information for user-defined capabilities.
397 These are extensions to the terminfo repertoire which can be loaded
398 using the \fB\-x\fR option of \fBtic\fP.
399 .SH FILES
400 .TP 20
401 \*d
402 Compiled terminal description database.
403 .SH EXTENSIONS
404 The
405 \fB\-0\fR,
406 \fB\-1\fR,
407 \fB\-E\fR,
408 \fB\-F\fR,
409 \fB\-G\fR,
410 \fB\-R\fR,
411 \fB\-T\fR,
412 \fB\-V\fR,
413 \fB\-a\fR,
414 \fB\-e\fR,
415 \fB\-f\fR,
416 \fB\-g\fR,
417 \fB\-i\fR,
418 \fB\-l\fR,
419 \fB\-p\fR,
420 \fB\-q\fR and
421 \fB\-t\fR
422 options are not supported in SVr4 curses.
423 .PP
424 The \fB\-r\fR option's notion of `termcap' capabilities is System V Release 4's.
425 Actual BSD curses versions will have a more restricted set.  To see only the
426 4.4BSD set, use \fB\-r\fR \fB\-RBSD\fR.
427 .SH BUGS
428 The \fB\-F\fR option of \fB@INFOCMP@\fR(1M) should be a \fB@TOE@\fR(1M) mode.
429 .SH SEE ALSO
430 \fB@CAPTOINFO@\fR(1M),
431 \fB@INFOTOCAP@\fR(1M),
432 \fB@TIC@\fR(1M),
433 \fB@TOE@\fR(1M),
434 \fBcurses\fR(3X),
435 \fBterminfo\fR(\*n).
436 .PP
437 This describes \fBncurses\fR
438 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
439 .SH AUTHOR
440 Eric S. Raymond <esr@snark.thyrsus.com>
441 and
442 .br
443 Thomas E. Dickey <dickey@invisible-island.net>