Unix Routines

uunet!bria!mike uunet!bria!mike
Wed Jan 16 16:37:54 AEST 1991


In article <2871 at dsacg3.dsac.dla.mil> dsacg3.dsac.dla.mil!nto0302 (Bob Fisher) writes:
>From article <1991Jan13.163326.8246 at jpradley.jpr.com], by jpr at jpradley.jpr.com (Jean-Pierre Radley):

	[ question about reading "special" keys in C under UNIX ]
>> 
>> The required code is highly dependent on your hardware. 
>> Check out termcap, terminfo, tgetent, tput, and other such entries in your
>> manual.
>> In fact, just browing through /etc/termcap, or /usr/lib/terminfo/*src, will
>> show you that the code sequences you seek are quite variable.
>
>Also check out the curses(3) library functions.
>
>The reference to hardware dependency refers to terminals, not just the CPU.
>Different brands of terminals on the same system may require different
>command sequences.

Actually, the code for this is very terminal *independant*; this is why
termcap/terminfo and the routines that are there exist.  The programmer
is isolated from the differences on terminal types, knowing that the curses
routines will perform the same function on different terminal type (unless
of course, the termcap entry is trashed).  Since most termcap/terminfo
sources have virtually every Tom, Dick, and Harry terminal made by Mankind
since the Dawn of Time, the applications programmer rarely has to worry
about writing his own cap entry.

BTW, I directed follow-ups to comp.unix.programmer, where this really
belongs ...
-- 
Michael Stefanik, Systems Engineer (JOAT), Briareus Corporation
UUCP: ...!uunet!bria!mike
--
technoignorami (tek'no-ig'no-ram`i) a group of individuals that are constantly
found to be saying things like "Well, it works on my DOS machine ..."



More information about the Comp.lang.c mailing list