terminfo (and input capabilities)
Michael "Ford" Ditto
ditto at cbmvax.UUCP
Thu Sep 1 13:37:11 AEST 1988
In article <440 at uport.UUCP> plocher at uport.UUCP (John Plocher) writes:
>In article <4577 at cbmvax.UUCP> ditto at cbmvax.UUCP (Michael "Ford" Ditto) writes:
>>>3) terminfo handles input escape sequences, such as what the arrow
>>
>>But termcap *will* have that if you put it in...
>
>Except that only *you* will have compiled them in - if you give your stuff
>to me it will be useless unless I *too* modify my curses source. (if I am lucky
>enough to have it :-)
Right, but now we're talking about curses, not terminal database format;
This applies to terminfo as well as termcap, (but more so with terminfo,
because that recompilation would involve rebuilding the database as well).
Curses can be (and has been) modified to use these input-sequence
capabilities, regardless of whether it's using termcap or terminfo
to read these capabilities from the database.
I think I wasn't clear in my comment, which was essentially: terminfo/
termcap BOTH provide a database which retrieves "capabilities" and a
method for instantiating parameters into output strings. These capabilities
can be used for input, output, or whatever, by a user program or a library
such as curses. To add new capabilities is easier with termcap.
Standardizing new capabilities is equally easy(/difficult) with either
format.
>I am assuming you wish to have a curses call such as getch() that returns
>a "value" such as 65 (for 'A') or 129 ('a umlaut') or 329 ('<F1>'). You
>aren't (I hope) assuming that the program which needs to 'see' a <F1> keypress
>will actually parse its input WRT the entry in the terminfo database?
The terminfo/termcap routines shouldn't care whether they're being called
by getch() or directly by user code. They should just return the string
(or number) read from the database.
>terminfo is useful in that it does this work for you - in a portable way.
>termcap requires your program to 'know' too much of how the terminal
>database is structured.
Terminfo doesn't do that work, curses does. Terminfo and termcap both
require some higher level software to do this interpretation... same thing
with output. Most people use curses and don't worry about it.
--
-=] Ford [=-
. . (In Real Life: Mike Ditto)
. : , ford at kenobi.cts.com
This space under construction, ...!ucsd!elgar!ford
pardon our dust. ditto at cbmvax.commodore.com
More information about the Comp.unix.wizards
mailing list