1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
4 ****************************************************************************
5 * Copyright (c) 1998-2006,2010 Free Software Foundation, Inc. *
7 * Permission is hereby granted, free of charge, to any person obtaining a *
8 * copy of this software and associated documentation files (the *
9 * "Software"), to deal in the Software without restriction, including *
10 * without limitation the rights to use, copy, modify, merge, publish, *
11 * distribute, distribute with modifications, sublicense, and/or sell *
12 * copies of the Software, and to permit persons to whom the Software is *
13 * furnished to do so, subject to the following conditions: *
15 * The above copyright notice and this permission notice shall be included *
16 * in all copies or substantial portions of the Software. *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
21 * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
22 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
23 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
24 * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
26 * Except as contained in this notice, the name(s) of the above copyright *
27 * holders shall not be used in advertising or otherwise to promote the *
28 * sale, use or other dealings in this Software without prior written *
30 ****************************************************************************
31 * @Id: infocmp.1m,v 1.45 2010/07/31 16:09:36 tom Exp @
35 <TITLE>infocmp 1m</TITLE>
36 <link rev=made href="mailto:bug-ncurses@gnu.org">
37 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
43 <!-- Manpage converted by man2html 3.0.1 -->
44 <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG> <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>
51 <STRONG>infocmp</STRONG> - compare or print out <EM>terminfo</EM> descriptions
55 <H2>SYNOPSIS</H2><PRE>
56 <STRONG>infocmp</STRONG> [<STRONG>-1CEFGILTUVcdegilnpqrtux</STRONG>]
57 [<STRONG>-v</STRONG> <EM>n</EM>] [<STRONG>-s</STRONG> <STRONG>d</STRONG>| <STRONG>i</STRONG>| <STRONG>l</STRONG>| <STRONG>c</STRONG>] [<STRONG>-R</STRONG> <STRONG>subset</STRONG>]
58 [<STRONG>-w</STRONG> <EM>width</EM>] [<STRONG>-A</STRONG> <EM>directory</EM>] [<STRONG>-B</STRONG> <EM>directory</EM>]
59 [<EM>termname</EM>...]
63 <H2>DESCRIPTION</H2><PRE>
64 <STRONG>infocmp</STRONG> can be used to compare a binary <STRONG>terminfo</STRONG> entry
65 with other terminfo entries, rewrite a <STRONG>terminfo</STRONG> descrip-
66 tion to take advantage of the <STRONG>use=</STRONG> terminfo field, or
67 print out a <STRONG>terminfo</STRONG> description from the binary file
68 (<STRONG>term</STRONG>) in a variety of formats. In all cases, the boolean
69 fields will be printed first, followed by the numeric
70 fields, followed by the string fields.
72 <STRONG>Default</STRONG> <STRONG>Options</STRONG>
73 If no options are specified and zero or one <EM>termnames</EM> are
74 specified, the <STRONG>-I</STRONG> option will be assumed. If more than
75 one <EM>termname</EM> is specified, the <STRONG>-d</STRONG> option will be assumed.
77 <STRONG>Comparison</STRONG> <STRONG>Options</STRONG> <STRONG>[-d]</STRONG> <STRONG>[-c]</STRONG> <STRONG>[-n]</STRONG>
78 <STRONG>infocmp</STRONG> compares the <STRONG>terminfo</STRONG> description of the first
79 terminal <EM>termname</EM> with each of the descriptions given by
80 the entries for the other terminal's <EM>termnames</EM>. If a
81 capability is defined for only one of the terminals, the
82 value returned will depend on the type of the capability:
83 <STRONG>F</STRONG> for boolean variables, <STRONG>-1</STRONG> for integer variables, and
84 <STRONG>NULL</STRONG> for string variables.
86 The <STRONG>-d</STRONG> option produces a list of each capability that is
87 different between two entries. This option is useful to
88 show the difference between two entries, created by dif-
89 ferent people, for the same or similar terminals.
91 The <STRONG>-c</STRONG> option produces a list of each capability that is
92 common between two entries. Capabilities that are not set
93 are ignored. This option can be used as a quick check to
94 see if the <STRONG>-u</STRONG> option is worth using.
96 The <STRONG>-n</STRONG> option produces a list of each capability that is
97 in neither entry. If no <EM>termnames</EM> are given, the environ-
98 ment variable <STRONG>TERM</STRONG> will be used for both of the <EM>termnames</EM>.
99 This can be used as a quick check to see if anything was
100 left out of a description.
102 <STRONG>Source</STRONG> <STRONG>Listing</STRONG> <STRONG>Options</STRONG> <STRONG>[-I]</STRONG> <STRONG>[-L]</STRONG> <STRONG>[-C]</STRONG> <STRONG>[-r]</STRONG>
103 The <STRONG>-I</STRONG>, <STRONG>-L</STRONG>, and <STRONG>-C</STRONG> options will produce a source listing
104 for each terminal named.
106 <STRONG>-I</STRONG> use the <STRONG>terminfo</STRONG> names
107 <STRONG>-L</STRONG> use the long C variable name listed in <<STRONG>term.h</STRONG>>
108 <STRONG>-C</STRONG> use the <STRONG>termcap</STRONG> names
109 <STRONG>-r</STRONG> when using <STRONG>-C</STRONG>, put out all capabilities in <STRONG>termcap</STRONG> form
111 If no <EM>termnames</EM> are given, the environment variable <STRONG>TERM</STRONG>
112 will be used for the terminal name.
114 The source produced by the <STRONG>-C</STRONG> option may be used directly
115 as a <STRONG>termcap</STRONG> entry, but not all parameterized strings can
116 be changed to the <STRONG>termcap</STRONG> format. <STRONG>infocmp</STRONG> will attempt to
117 convert most of the parameterized information, and any-
118 thing not converted will be plainly marked in the output
119 and commented out. These should be edited by hand.
121 All padding information for strings will be collected
122 together and placed at the beginning of the string where
123 <STRONG>termcap</STRONG> expects it. Mandatory padding (padding informa-
124 tion with a trailing '/') will become optional.
126 All <STRONG>termcap</STRONG> variables no longer supported by <STRONG>terminfo</STRONG>, but
127 which are derivable from other <STRONG>terminfo</STRONG> variables, will be
128 output. Not all <STRONG>terminfo</STRONG> capabilities will be translated;
129 only those variables which were part of <STRONG>termcap</STRONG> will nor-
130 mally be output. Specifying the <STRONG>-r</STRONG> option will take off
131 this restriction, allowing all capabilities to be output
132 in <EM>termcap</EM> form.
134 Note that because padding is collected to the beginning of
135 the capability, not all capabilities are output. Manda-
136 tory padding is not supported. Because <STRONG>termcap</STRONG> strings
137 are not as flexible, it is not always possible to convert
138 a <STRONG>terminfo</STRONG> string capability into an equivalent <STRONG>termcap</STRONG>
139 format. A subsequent conversion of the <STRONG>termcap</STRONG> file back
140 into <STRONG>terminfo</STRONG> format will not necessarily reproduce the
141 original <STRONG>terminfo</STRONG> source.
143 Some common <STRONG>terminfo</STRONG> parameter sequences, their <STRONG>termcap</STRONG>
144 equivalents, and some terminal types which commonly have
147 <STRONG>terminfo</STRONG> <STRONG>termcap</STRONG> Representative Terminals
148 ---------------------------------------------------------------
149 <STRONG>%p1%c</STRONG> <STRONG>%.</STRONG> adm
150 <STRONG>%p1%d</STRONG> <STRONG>%d</STRONG> hp, ANSI standard, vt100
151 <STRONG>%p1%'x'%+%c</STRONG> <STRONG>%+x</STRONG> concept
152 <STRONG>%i</STRONG> <STRONG>%i</STRONG>q ANSI standard, vt100
153 <STRONG>%p1%?%'x'%>%t%p1%'y'%+%;</STRONG> <STRONG>%>xy</STRONG> concept
154 <STRONG>%p2</STRONG> is printed before <STRONG>%p1</STRONG> <STRONG>%r</STRONG> hp
156 <STRONG>Use=</STRONG> <STRONG>Option</STRONG> <STRONG>[-u]</STRONG>
157 The <STRONG>-u</STRONG> option produces a <STRONG>terminfo</STRONG> source description of
158 the first terminal <EM>termname</EM> which is relative to the sum
159 of the descriptions given by the entries for the other
160 terminals <EM>termnames</EM>. It does this by analyzing the dif-
161 ferences between the first <EM>termname</EM> and the other
162 <EM>termnames</EM> and producing a description with <STRONG>use=</STRONG> fields for
163 the other terminals. In this manner, it is possible to
164 retrofit generic terminfo entries into a terminal's
165 description. Or, if two similar terminals exist, but were
166 coded at different times or by different people so that
167 each description is a full description, using <STRONG>infocmp</STRONG> will
168 show what can be done to change one description to be rel-
171 A capability will get printed with an at-sign (@) if it no
172 longer exists in the first <EM>termname</EM>, but one of the other
173 <EM>termname</EM> entries contains a value for it. A capability's
174 value gets printed if the value in the first <EM>termname</EM> is
175 not found in any of the other <EM>termname</EM> entries, or if the
176 first of the other <EM>termname</EM> entries that has this capabil-
177 ity gives a different value for the capability than that
178 in the first <EM>termname</EM>.
180 The order of the other <EM>termname</EM> entries is significant.
181 Since the terminfo compiler <STRONG>tic</STRONG> does a left-to-right scan
182 of the capabilities, specifying two <STRONG>use=</STRONG> entries that con-
183 tain differing entries for the same capabilities will pro-
184 duce different results depending on the order that the
185 entries are given in. <STRONG>infocmp</STRONG> will flag any such incon-
186 sistencies between the other <EM>termname</EM> entries as they are
189 Alternatively, specifying a capability <EM>after</EM> a <STRONG>use=</STRONG> entry
190 that contains that capability will cause the second speci-
191 fication to be ignored. Using <STRONG>infocmp</STRONG> to recreate a
192 description can be a useful check to make sure that every-
193 thing was specified correctly in the original source
196 Another error that does not cause incorrect compiled
197 files, but will slow down the compilation time, is speci-
198 fying extra <STRONG>use=</STRONG> fields that are superfluous. <STRONG>infocmp</STRONG>
199 will flag any other <EM>termname</EM> <EM>use=</EM> fields that were not
202 <STRONG>Changing</STRONG> <STRONG>Databases</STRONG> <STRONG>[-A</STRONG> <EM>directory</EM>] [-B <EM>directory</EM>]
203 The location of the compiled <STRONG>terminfo</STRONG> database is taken
204 from the environment variable <STRONG>TERMINFO</STRONG> . If the variable
205 is not defined, or the terminal is not found in that loca-
206 tion, the system <STRONG>terminfo</STRONG> database, in <STRONG>/usr/share/ter-</STRONG>
207 <STRONG>minfo</STRONG>, will be used. The options <STRONG>-A</STRONG> and <STRONG>-B</STRONG> may be used to
208 override this location. The <STRONG>-A</STRONG> option will set <STRONG>TERMINFO</STRONG>
209 for the first <EM>termname</EM> and the <STRONG>-B</STRONG> option will set <STRONG>TERMINFO</STRONG>
210 for the other <EM>termnames</EM>. With this, it is possible to
211 compare descriptions for a terminal with the same name
212 located in two different databases. This is useful for
213 comparing descriptions for the same terminal created by
216 <STRONG>Other</STRONG> <STRONG>Options</STRONG>
217 <STRONG>-1</STRONG> causes the fields to be printed out one to a line.
218 Otherwise, the fields will be printed several to a
219 line to a maximum width of 60 characters.
221 <STRONG>-a</STRONG> tells <STRONG>infocmp</STRONG> to retain commented-out capabilities
222 rather than discarding them. Capabilities are com-
223 mented by prefixing them with a period.
225 <STRONG>-E</STRONG> Dump the capabilities of the given terminal as
226 tables, needed in the C initializer for a TERMTYPE
227 structure (the terminal capability structure in the
228 <STRONG><term.h></STRONG>). This option is useful for preparing ver-
229 sions of the curses library hardwired for a given
230 terminal type. The tables are all declared static,
231 and are named according to the type and the name of
232 the corresponding terminal entry.
234 Before ncurses 5.0, the split between the <STRONG>-e</STRONG> and <STRONG>-E</STRONG>
235 options was not needed; but support for extended
236 names required making the arrays of terminal capabil-
237 ities separate from the TERMTYPE structure.
239 <STRONG>-e</STRONG> Dump the capabilities of the given terminal as a C
240 initializer for a TERMTYPE structure (the terminal
241 capability structure in the <STRONG><term.h></STRONG>). This option
242 is useful for preparing versions of the curses
243 library hardwired for a given terminal type.
245 <STRONG>-F</STRONG> compare terminfo files. This assumes that two fol-
246 lowing arguments are filenames. The files are
247 searched for pairwise matches between entries, with
248 two entries considered to match if any of their names
249 do. The report printed to standard output lists
250 entries with no matches in the other file, and
251 entries with more than one match. For entries with
252 exactly one match it includes a difference report.
253 Normally, to reduce the volume of the report, use
254 references are not resolved before looking for dif-
255 ferences, but resolution can be forced by also speci-
256 fying <STRONG>-r</STRONG>.
258 <STRONG>-f</STRONG> Display complex terminfo strings which contain
259 if/then/else/endif expressions indented for readabil-
262 <STRONG>-G</STRONG> Display constant literals in decimal form rather than
263 their character equivalents.
265 <STRONG>-g</STRONG> Display constant character literals in quoted form
266 rather than their decimal equivalents.
268 <STRONG>-i</STRONG> Analyze the initialization (<STRONG>is1</STRONG>, <STRONG>is2</STRONG>, <STRONG>is3</STRONG>), and reset
269 (<STRONG>rs1</STRONG>, <STRONG>rs2</STRONG>, <STRONG>rs3</STRONG>), strings in the entry. For each
270 string, the code tries to analyze it into actions in
271 terms of the other capabilities in the entry, certain
272 X3.64/ISO 6429/ECMA-48 capabilities, and certain DEC
273 VT-series private modes (the set of recognized spe-
274 cial sequences has been selected for completeness
275 over the existing terminfo database). Each report
276 line consists of the capability name, followed by a
277 colon and space, followed by a printable expansion of
278 the capability string with sections matching recog-
279 nized actions translated into {}-bracketed descrip-
280 tions. Here is a list of the DEC/ANSI special
281 sequences recognized: i.
284 -----------------------------------------
289 RSR reset scroll region
290 -----------------------------------------
291 DECSTR soft reset (VT320)
292 S7C1T 7-bit controls (VT220)
293 -----------------------------------------
294 ISO DEC G0 enable DEC graphics for G0
295 ISO UK G0 enable UK chars for G0
296 ISO US G0 enable US chars for G0
297 ISO DEC G1 enable DEC graphics for G1
298 ISO UK G1 enable UK chars for G1
299 ISO US G1 enable US chars for G1
300 -----------------------------------------
301 DECPAM application keypad mode
302 DECPNM normal keypad mode
303 DECANSI enter ANSI mode
304 -----------------------------------------
305 ECMA[+-]AM keyboard action mode
306 ECMA[+-]IRM insert replace mode
307 ECMA[+-]SRM send receive mode
308 ECMA[+-]LNM linefeed mode
309 -----------------------------------------
310 DEC[+-]CKM application cursor keys
311 DEC[+-]ANM set VT52 mode
312 DEC[+-]COLM 132-column mode
314 DEC[+-]SCLM smooth scroll
315 DEC[+-]SCNM reverse video mode
316 DEC[+-]OM origin mode
317 DEC[+-]AWM wraparound mode
318 DEC[+-]ARM auto-repeat mode
320 It also recognizes a SGR action corresponding to
321 ANSI/ISO 6429/ECMA Set Graphics Rendition, with the
322 values NORMAL, BOLD, UNDERLINE, BLINK, and REVERSE.
323 All but NORMAL may be prefixed with `+' (turn on) or
326 An SGR0 designates an empty highlight sequence (equivalent
329 <STRONG>-l</STRONG> Set output format to terminfo.
331 <STRONG>-p</STRONG> Ignore padding specifications when comparing strings.
333 <STRONG>-q</STRONG> Make the comparison listing shorter by omitting sub-
334 headings, and using "-" for absent capabilities, "@"
335 for canceled rather than "NULL".
337 <STRONG>-R</STRONG><EM>subset</EM>
338 Restrict output to a given subset. This option is
339 for use with archaic versions of terminfo like those
340 on SVr1, Ultrix, or HP/UX that do not support the
341 full set of SVR4/XSI Curses terminfo; and variants
342 such as AIX that have their own extensions incompati-
343 ble with SVr4/XSI. Available terminfo subsets are
344 "SVr1", "Ultrix", "HP", and "AIX"; see <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
345 for details. You can also choose the subset "BSD"
346 which selects only capabilities with termcap equiva-
347 lents recognized by 4.4BSD.
349 <STRONG>-s</STRONG> <EM>[d|i|l|c]</EM>
350 The <STRONG>-s</STRONG> option sorts the fields within each type
351 according to the argument below:
353 <STRONG>d</STRONG> leave fields in the order that they are stored
354 in the <EM>terminfo</EM> database.
356 <STRONG>i</STRONG> sort by <EM>terminfo</EM> name.
358 <STRONG>l</STRONG> sort by the long C variable name.
360 <STRONG>c</STRONG> sort by the <EM>termcap</EM> name.
362 If the <STRONG>-s</STRONG> option is not given, the fields printed out
363 will be sorted alphabetically by the <STRONG>terminfo</STRONG> name
364 within each type, except in the case of the <STRONG>-C</STRONG> or the
365 <STRONG>-L</STRONG> options, which cause the sorting to be done by the
366 <STRONG>termcap</STRONG> name or the long C variable name, respec-
369 <STRONG>-T</STRONG> eliminates size-restrictions on the generated text.
370 This is mainly useful for testing and analysis, since
371 the compiled descriptions are limited (e.g., 1023 for
372 termcap, 4096 for terminfo).
374 <STRONG>-t</STRONG> tells <STRONG>tic</STRONG> to discard commented-out capabilities.
375 Normally when translating from terminfo to termcap,
376 untranslatable capabilities are commented-out.
378 <STRONG>-U</STRONG> tells <STRONG>infocmp</STRONG> to not post-process the data after
379 parsing the source file. This feature helps when
380 comparing the actual contents of two source files,
381 since it excludes the inferences that <STRONG>infocmp</STRONG> makes
382 to fill in missing data.
384 <STRONG>-V</STRONG> reports the version of ncurses which was used in this
387 <STRONG>-v</STRONG> <EM>n</EM> prints out tracing information on standard error as
388 the program runs. Higher values of n induce greater
391 <STRONG>-w</STRONG> <EM>width</EM>
392 changes the output to <EM>width</EM> characters.
394 <STRONG>-x</STRONG> print information for user-defined capabilities.
395 These are extensions to the terminfo repertoire which
396 can be loaded using the <STRONG>-x</STRONG> option of <STRONG>tic</STRONG>.
401 /usr/share/terminfo Compiled terminal description data-
406 <H2>EXTENSIONS</H2><PRE>
407 The <STRONG>-E</STRONG>, <STRONG>-F</STRONG>, <STRONG>-G</STRONG>, <STRONG>-R</STRONG>, <STRONG>-T</STRONG>, <STRONG>-V</STRONG>, <STRONG>-a</STRONG>, <STRONG>-e</STRONG>, <STRONG>-f</STRONG>, <STRONG>-g</STRONG>, <STRONG>-i</STRONG>, <STRONG>-l</STRONG>, <STRONG>-p</STRONG>, <STRONG>-q</STRONG>
408 and <STRONG>-t</STRONG> options are not supported in SVr4 curses.
410 The <STRONG>-r</STRONG> option's notion of `termcap' capabilities is System
411 V Release 4's. Actual BSD curses versions will have a
412 more restricted set. To see only the 4.4BSD set, use <STRONG>-r</STRONG>
413 <STRONG>-RBSD</STRONG>.
418 The <STRONG>-F</STRONG> option of <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG> should be a <STRONG><A HREF="toe.1m.html">toe(1m)</A></STRONG> mode.
422 <H2>SEE ALSO</H2><PRE>
423 <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>, <STRONG><A HREF="infotocap.1m.html">infotocap(1m)</A></STRONG>, <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="toe.1m.html">toe(1m)</A></STRONG>,
424 <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
426 This describes <STRONG>ncurses</STRONG> version 5.7 (patch 20100918).
431 Eric S. Raymond <esr@snark.thyrsus.com> and
432 Thomas E. Dickey <dickey@invisible-island.net>
436 <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>
440 Man(1) output converted with
441 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>