tech-userlevel archive

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

Re: terminfo vs termcap

>> We do [] have t_getent, t_getnum, etc, which do appear to fully
>> support using multiple terminal types.  (Even traditional termcap
>> can support use of multiple terminals, though not multiple types;
>> most functions return strings, and the one that doesn't - tputs -
>> takes a callback to handle output.)
> terminfo provides the "same" tputs, which in the original comment was
> implied to be deficient.

Right.  tputs depends on two globals: PC and ospeed.  Our manpage is
unclear on whether these are set up by -ltermcap or the application
must set them before first use of tputs.  (Given that unclarity, it's
possible tputs depends on other globals and just isn't documented
properly, though UTSLing makes me think not.)  t_puts takes a terminal
type state pointer, which removes the dependency on PC, but still
depends on ospeed.  However, I see no reason multiple terminals can't
be used anyway, with setting ospeed being part of switching terminals.
(Actually, I think ospeed-based output padding is completely broken.
NetBSD, even as far back as 1.4T, uses the baud rate directly as the
speed, but the tputs() code expects ospeed to be a small integer, used
to index into a table.)

> t_getent/etc solve part of the problem; I don't see any evidence that
> they solve the entire problem which was stated.

No, they don't.  They solve only the multiple-types part of it.  For
the rest, see the previous paragraph.

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML      
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

Home | Main Index | Thread Index | Old Index