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