Path: utzoo!utgpu!attcan!uunet!cbmvax!ditto From: ditto@cbmvax.UUCP (Michael "Ford" Ditto) Newsgroups: comp.unix.wizards Subject: Re: terminfo (and input capabilities) Summary: terminfo != curses Keywords: terminfo termcap Message-ID: <4616@cbmvax.UUCP> Date: 1 Sep 88 03:37:11 GMT References: <508@altos86.UUCP> <10544@ulysses.homer.nj.att.com> <4577@cbmvax.UUCP> <440@uport.UUCP> Reply-To: ditto@cbmvax.UUCP (Michael "Ford" Ditto) Organization: Commodore Technology, West Chester, PA Lines: 49 In article <440@uport.UUCP> plocher@uport.UUCP (John Plocher) writes: >In article <4577@cbmvax.UUCP> ditto@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 (''). You >aren't (I hope) assuming that the program which needs to 'see' a 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@kenobi.cts.com This space under construction, ...!ucsd!elgar!ford pardon our dust. ditto@cbmvax.commodore.com