tech-userlevel archive

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

Re: tn3270, mset and map3270



On 26/02/2010 14:30, ITOH Yasufumi wrote:
In article<4B866EA0.5030407%NetBSD.org@localhost>
roy%NetBSD.org@localhost writes:

What makes you think that terminfo(5) doesn't allow this also?

I knew some implementations have extension to allow custom
capabilities, but is not portable.

This does not matter.

Interesting enough, the extension is something like adding termcap
entry in the terminfo, and inconsistent with the original idea of
terminfo.

The idea of terminfo(5) (terminfo(4) might be more precise, since
UNIX System V reordered section number) is to use a fixed array of
capabilities to speed-up loading database, so basically there is
no room for custom capabilities.
>
> To use custom capabilities, we can use termcap almost everywhere.

Things have moved on.
Both ncurses and my implementation allow extensions.

Do you have any benefit to use terminfo for programs that are
already written to use termcap?
Since our new termcap library is fast, I don't see any benefit to
rewrite termcap programs for terminfo.  It just causes loss of
features such as $TERMCAP.

My terminfo implemenation is faster still as it uses hash tables for termcap and terminfo lookups. As the termcap design is to do a string lookup per capability it's always going to be slow. terminfo allows calling known capabilities directly or by going the string lookup route like termcap. It's still quite quick thanks to hash tables.

As to re-tooling code in terminfo vs termcap?
Less code for termcap applications for staters, which means smaller binaries and less memory requirements. Here's a good example of one of our applications converted to terminfo
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/atari/stand/edahdi/edahdi.c.diff?r1=1.9&r2=1.10&only_with_tag=MAIN&f=h

As you can see, it's a lot less code and easier to see what's going on.
clear_screen means a lot more than "cl".

Recent updates to my implemation allow
$TERMINFO="term|alias|term description, cols#80, foo=bar"
$TERMCAP="term|alias|term description:co#80:foo=bar"

(I'm not objecting for providing termcap API somewhere, since it might
be useful to use programs written for terminfo without modification.)

What makes you think termcap(3) has gone away?
We provide a termcap wrapper on top of terminfo :)

Thanks

Roy


Home | Main Index | Thread Index | Old Index