tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: terminfo vs termcap



On Fri, Jun 05, 2009 at 04:48:31PM +0100, Julian Coleman wrote:
> Hi,
> 
> > So I looked into what we have, and I think we can do quite a bit by 
> > providing libterminfo to read the terminfo db's and provide termcap 
> > compat functions and a basic tic compiler to convert termcap(5) and 
> > terminfo(5) sources into terminfo.dbs. curses(3) would have to be 
> > re-tooled around libterminfo of course.
> 
> I did wonder about creating a terminfo compatible part of our libterm.  This
> would allow us to support those extra terminfo calls that are not in the
> current libterm.  The most useful one to me was tparm().
> 
> I was thinking of still using termcap as the back end.  Basically, the
> compatible part would have a mapping between terminfo and termcap
> capabilities.  For example, if you called:
> 
>   tigetstr("cud");
> 
> it would translate internally to:
> 
>   t_getstr(tc, "DO", NULL, l);

But the capabilities using parameters aren't compatible.

For example, though it's possible to write a "cm" (cursor-movement)
string that works the same in termcap/terminfo, it's only because
some implementations for the latter recognize the common flavors of
the former's abbreviated syntax.

As for tparm - tgoto works for applications which use the parameter
features that termcap does support.
 
> (Functions without a termcap mapping would be extra).  That wouldn't involve
> any changes to the curses library.
> 
> Thanks,
> 
> J
> 
> -- 
>   My other computer also runs NetBSD    /        Sailing at Newbiggin
>         http://www.netbsd.org/        /   http://www.newbigginsailingclub.org/

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net

Attachment: pgpfbAjDfls5n.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index