'\"!  tbl | mmdoc
'\"macro stdmacro
.if n .pH g1a.infocmp @(#)infocmp	40.13 of 12/15/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} infocmp 1M "Terminal Information Utilities" "\&"
.if \nX=1 .ds x} infocmp 1M "Terminal Information Utilities"
.if \nX=2 .ds x} infocmp 1M "" "\&"
.if \nX=3 .ds x} infocmp "" "" "\&"
.TH \*(x}
'\" ident	"@(#)svid_ti:ti_cmd/infocmp	1.3"
.if n .pH ti_cmd.tput @(#)tput	30.1
.ds Ga \|\\v'-((\\n(.su-2u)*10u)'\\D'l (2u*\\n(.su) (2u*\\n(.su)'\
\\v'(((\\n(.su-2u)*10u)-(2u*\\n(.su))'\|
.ds Aa \\v'-((\\n(.su-4u)*10u)'\\D'l (2u*\\n(.su) -(2u*\\n(.su)'\
\\v'((\\n(.su-2u)*10u)'\|
.ds gA  \\v'-((\\n(.su-2u)*10u)'\\D'l (2u*\\n(.su) (2u*\\n(.su)'\
\\v'(((\\n(.su-2u)*10u)-(2u*\\n(.su))'\|
.ds aA \|\\v'-((\\n(.su-4u)*10u)'\\D'l (2u*\\n(.su) -(2u*\\n(.su)'\
\\v'((\\n(.su-2u)*10u)'\|
.SH NAME
\f4infocmp\f1 \- compare or print out \f2terminfo\f1 descriptions
.SH SYNOPSIS
.na
.ds [ \f1[\fP
.ds ] \f1]\fP
.ds | \f1\||\fP
.ft 4
infocmp \*[-d\*]
\*[-c\*]
\*[-n\*]
\*[-I\*]
\*[-L\*]
\*[-C\*]
\*[-r\*]
\*[-u\*]
\*[-s d\*|i\*|l\*|c\*]
\*[-v\*]
\*[-V\*]
.br
.ta .6i
	\*[-1\*]
\*[-w \f2width\fP\*]
\*[-A \f2directory\fP\*]
\*[-B \f2directory\fP\*]
\*[\f2termname\fP \f1...\fP\*]
.ft 1
.ad
.ta
.SH DESCRIPTION
\f4infocmp\f1
can be used to compare a binary
\f4terminfo\f1
entry with other terminfo entries, rewrite a
\f4terminfo\f1
description to take advantage of the
\f4use=\f1 terminfo field, or print out a
\f4terminfo\f1
description from the binary file
(\f4term\f1)
in a variety of formats.
In all cases, the boolean fields will be printed first, followed by the
numeric fields, followed by the string fields.
.SS "Default Options"
If no options are specified and zero or one
.IR termnames
are specified, the
\f4\-I\f1
option will be assumed.
If more than one
.IR termname
is specified, the
\f4\-d\f1
option will be assumed.
.SS "Comparison Options [\-d] [\-c] [\-n]"
\f4infocmp\f1
compares the
\f4terminfo\f1
description of the first terminal
.I termname
with each of the descriptions given by the entries for the other terminal's
.IR termnames .
If a capability is defined for only one of the terminals,
the value returned will depend on the type of the capability:
\f4F\f1
for boolean variables,
\f4\-1\f1
for integer variables,
and
\f4NULL\f1
for string variables.
.TP 8
\f4\-d\f1
produces a list of each capability that is different between two entries.
This option is useful to show the difference between two entries,
created by different people,
for the same or similar terminals.
.TP
\f4\-c\f1
produces a list of each capability that is common between two
entries.
Capabilities that are not set are ignored.
This option can be used as a quick check to see if the
\f4\-u\f1
option is worth using.
.TP
\f4\-n\f1
produces a list of each capability that is in neither entry.
If no
.IR termnames
are given, the environment variable
\f4TERM\f1
will be used for both of the
.IR termnames .
This can be used as a quick check to see if anything was left out
of a description.
.SS "Source Listing Options [\-I] [\-L] [\-C] [\-r]"
The
\f4\-I\f1,
\f4\-L\f1,
and
\f4\-C\f1
options will produce a source listing for each terminal named.
.PD .15
.TP 8
\f4\-I\f1
use the \f4terminfo\f1 names
.TP
\f4\-L\f1
use the long C variable name listed in
<\f4term.h\f1>
.TP
\f4\-C\f1
use the \f4termcap\f1 names
.TP
\f4\-r\f1
when using \f4\-C\f1, put out all
capabilities in \f4termcap\f1 form
.PD
.P
If no
.IR termnames
are given, the environment variable
\f4TERM\f1
will be used for the terminal name.
.P
The source produced by the
\f4\-C\f1
option may be used directly as a \f4termcap\f1 entry, but not all of the
parameterized strings may be changed to the \f4termcap\f1 format.
\f4infocmp\f1
will attempt to convert most of the parameterized information, but anything
not converted will be plainly marked in the output and commented out.
These should be edited by hand.
.P
All padding information for strings will be collected together and placed at
the beginning of the string where \f4termcap\f1 expects it.
Mandatory padding (padding information with a trailing '/') will become
optional.
.P
All \f4termcap\f1 variables no longer supported by \f4terminfo\f1,
but which are
derivable from other \f4terminfo\f1 variables, will be output.
Not all \f4\%terminfo\f1 capabilities will be translated;
only those variables which
were part of \f4termcap\f1 will normally be output.
Specifying the
\f4\-r\f1
option will take off this restriction, allowing all capabilities to be output
in \f2termcap\f1 form.
.P
Note that because padding is collected to the beginning of the capability,
not all capabilities are output.
Mandatory padding is not supported.
Because \f4termcap\f1 strings are not as flexible,
it is not always possible to convert a \f4terminfo\f1
string capability into an
equivalent \f4termcap\f1 format.
A subsequent conversion of the \f4termcap\f1 file back into
\f4terminfo\f1 format will not
necessarily reproduce the original \f4terminfo\f1 source.
.P
Some common \f4terminfo\f1 parameter sequences,
their \f4termcap\f1 equivalents, and some
terminal types which commonly have such sequences, are:
.sp
.TS
center ;
l l l.
\f4terminfo\f1	\f4termcap\f1	Representative Terminals

\f4%p1%c	%.\f1	adm
\f4%p1%d	%d\f1	hp, ANSI standard, vt100
\f4%p1%'x'%+%c	%+x\f1	concept
\f4%i	%i\f1	ANSI standard, vt100
\f4%p1%?%'x'%>%t%p1%'y'%+%;	%>xy\f1	concept
\f4%p2\f1 is printed before \f4%p1	%r\f1	hp
.TE
.SS "Use= Option [\-u]"
.TP 8
\f4\-u\f1
produces a \f4terminfo\f1
source description of the first terminal
.I termname
which is relative to the sum of the descriptions given by the entries for the
other terminals
.IR termnames .
It does this by analyzing the differences between the first
.I termname
and the other
.I termnames
and producing a description with
\f4use=\f1
fields for the other terminals.
In this manner, it is possible to retrofit generic terminfo entries into a
terminal's description.
Or, if two similar terminals exist, but were coded at different times or by
different people so that each description is a full description, using
\f4infocmp\f1
will show what can be done to change one description to be relative to the
other.
.P
A capability will get printed with an at-sign (@) if it no longer exists in
the first
.IR termname ,
but one of the other
.I termname
entries contains a value for it.
A capability's value gets printed if the value in the first
.IR termname
is not found in any of the other
.I termname
entries, or if the first of the other
.I termname
entries\p
.br
.ne2
that has this capability gives a different value for the capability
than that in the first
.IR termname .
.P
The order of the other
.I termname
entries is significant.
Since the terminfo compiler
\f4tic\f1
does a left-to-right scan of the capabilities, specifying two
\f4use=\f1
entries that contain differing entries for the same capabilities will
produce different results
.br
.ne.5i
depending on the order that the entries are given in.
\f4infocmp\f1
will flag any such inconsistencies between the other
.I termname
entries as they are found.
.P
Alternatively, specifying a capability
.I after
a
\f4use=\f1
entry that contains that capability will cause the second specification to
be ignored.
Using
\f4infocmp\f1
to recreate a description can be a useful check to make sure that everything
was specified correctly in the original source description.
.P
Another error that does not cause incorrect compiled files, but will slow
down the compilation time, is specifying extra
\f4use=\f1
fields that are superfluous.
\f4infocmp\f1
will flag any other
.I termname
\f4use=\f1
fields that were not needed.
.SS "Other Options [\-s d\||\|\|i\||\|\|l\||\|\|c] [\-v] [\-V] [\-1] [\-w \f2width\fP]"
.TP 8
\f4\-s\f1
sorts the fields within each type according to
the argument below:
.RS 8
.TP 5
\f4d\f1
leave fields in the order that they are
stored in the \f2terminfo\f1 database.
.TP
\f4i\f1
sort by \f2terminfo\f1 name.
.TP
\f4l\f1
sort by the long C variable name.
.TP
\f4c\f1
sort by the \f2termcap\f1 name.
.P
If the \f4\-s\f1 option is not given,
the fields printed out will be sorted alphabetically by the \f4terminfo\f1
name within each type, except in the case of the
\f4\-C\f1
or the
\f4\-L\f1
options, which cause the sorting to be done by the
\f4termcap\f1 name or the long
C variable name, respectively.
.RE
.TP 8
\f4\-v\f1
prints out tracing information on standard error as the program runs.
.TP
\f4\-V\f1
prints out the version of the program in use on standard error and exit.
.TP
\f4\-1\f1
causes the fields to be printed out one to a line.
Otherwise, the fields will be printed several to a line to a maximum width
of 60 characters.
.TP
\f4\-w\f1
changes the output to \f2width\fP characters.
.SS "Changing Databases [\-A \f2directory\fP] [\-B \f2directory\fP]"
The location of the compiled \f4terminfo\f1 database
is taken from the environment
variable
\f4TERMINFO\f1 .
If the variable is not defined, or the terminal is not found in that
location, the system \f4terminfo\f1 database, usually in
\f4/usr/share/lib/terminfo\f1,
will be used.
The options
\f4\-A\f1
and
\f4\-B\f1
may be used to override this location.
The
\f4\-A\f1
option will set
\f4TERMINFO\f1
for the first
.IR termname
and the
\f4\-B\f1
option will set
\f4TERMINFO\f1
for the other
.IR termnames .
With this, it is possible to compare descriptions for a terminal with the
same name located in two different databases.
This is useful for comparing descriptions for the same terminal created by
different people.
.br
.ne4
.SH FILES
\f4\&/usr/share/lib/terminfo/?/*\f1    Compiled terminal description database.
.SH SEE ALSO
\f4curses\fP(3X),
\f4captoinfo\fP(1M),
\f4terminfo\fP(4),
\f4tic\fP(1M).
