[comp.unix.wizards] terminfo .vs. termcap

eric@dlcdev.UUCP (03/16/87)

Could anyone tell me a reasonable way of converting from terminfo
source to a termcap entry. The correspondence is not very clear to me
I am especially interested in how to deal with parameterized tinfo entries
in tcap. I realize my inexperience is blatant so, thanks in advance to all
usefull suggestions.

	
					Eric Van Tassell
					Data Language Corp.
					617-663-5000
					clyde!bonnie!masscomp!dlcdev!eric
					harvard!mit-eddie!dlcdev!eric
					dlcdev!eric@eddie.mit.edu

hansen@pegasus.UUCP (Tony L. Hansen) (03/18/87)

Time to put in another plug for the AT&T UNIX Toolchest.  (Just call
1-201-522-6900 and login as "guest" [there is no passwd] to browse through
the Toolchest.)  Within it you will find a program, cheap, named "infocmp".
Among the options, you will find "-C", which converts a terminfo entry into
termcap format.  You'd be hard pressed to do a better job by hand.  The
infocmp program is included with System V release 3, but you must go to the
Toolchest if you want to get it without Vr3.

					Tony Hansen
					ihnp4!pegasus!hansen

The man page says this:

	The source produced by the -C option may be used directly as a
	termcap entry, but not all of the parameterized strings may be
	changed to the termcap format.  infocmp will attempt to convert
	most of the parameterized information, but that which it doesn't
	will be plainly marked in the output and commented out.  These
	should be edited by hand.

	All padding information for strings will be collected together
	and placed at the beginning of the string where termcap expects
	it.  Mandatory padding (padding information with a trailing '/')
	will become optional.

	All termcap variables no longer supported by terminfo(4), but
	which are derivable from other terminfo(4) variables, will be
	output.  Not all terminfo(4) capabilities will be translated;
	only those variables which were part of termcap will normally be
	output.  Specifying the -r option will take off this
	restriction, allowing all capabilities to be output in termcap
	form.

	Note that because padding is collected to the beginning of the
	capability, not all capabilities are output, mandatory padding
	is not supported, and termcap strings were not as flexible, it
	is not always possible to convert a terminfo(4) string
	capability into an equivalent termcap format.  Not all of these
	strings will be able to be converted.  A subsequent conversion
	of the termcap file back into terminfo(4) format will not
	necessarily reproduce the original terminfo(4) source.

	Some common terminfo parameter sequences, their termcap
	equivalents, and some terminal types which commonly have such
	sequences, are:

	Terminfo		 Termcap    Representative Terminals

	%p1%c			    %.	    adm
	%p1%d			    %d	    HP, ANSI standard, vt100
	%p1%'x'%+%c		    %+x	    concept
	%i			    %i	    ANSI standard, vt100
	%p1%?%'x'%>%t%p1%'y'%+%;    %>xy    concept
	%p2 is printed before %p1   %r	    hp