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