Low level termcap routines

Low level termcap routines

Post by Hrvoje Niks » Sun, 22 Jan 1995 00:02:54

Has anyone here any experience with termcap(3) set of low-level routines?
Namely, I have a program I wouldn't like to overload (meaning size) with
curses, but which should work on different terminal types.

Reading of numbers (via tgetnum) works fine, but I cannot get strings.  Say
I have this program:

char bp[1024], term[]="vt100";

tgetent(bp, term);
col = tgetnum("co");  /*  OVO RADI!!!!  */
if (tgetflag("md"))
   bld = tgetstr("md", area);

The latter doesn't work, of course...  Not only does tgetstr fail to fetch
the string, but even tgetflag returns negative result (a zero), so that
tgetstr doesn't get executed.  Forcing it (by leaving out testing with
tgetflag), it returns NULL (which should be an error message).

Did anyone get it by now, or will I have to interprete things manually, from
bp buffer?

Hrvoje Niksic             |  Student of electrical engineering

A Thaum is the basic unit of magical strength. It has been universally
established as the amount of magic needed to create one small white pigeon
or three normal sized billiard balls.
        -- (Terry Pratchett, The Light Fantastic)


1. low level termcap/terminfo special keys on Suns

I've got a curious probblem with Xterm (comes with OpenWindows 2.0) and

I'm writing a little application that uses the low level termcap interface.
tgoto(), tgetstr(), tgetint()...

When I read the up-arrow key from stdin, I get the values that are recorded
as the up-arrow for a Sun terminal (console). Yet, my TERM environment
variable is xterm.

If the bytes sent for an up-arrow key don't match the TERM environment
variables idea of an up-arrow, what is a poor programmer to do?

Why is this happeining? How do I make it go away? The FM says that Sun
function keys can be turned on/off. I've tried it both ways. It doesn't help.

BTW, output works fine.


Joe Garvey

17215 Gravenstein Rd, Suite B    uucp: sumax!quick!johnny5!garvey
Bothell, Wa., 98012-9132


Joe Garvey

2. redhat wont boot

3. LOW-low level debugging

4. jumpstart: "GMT is not a valid timezone" error

5. Good bit and low level protocol level FibreChannel reference Book?

6. RH4.2 but not 5.1 will install

7. Solaris on x86: LOW LOW LOW PRICES

8. net.views ... windows on unix ... responses

9. TermCaps Routines needed

10. Fast opmized BLAS(Level 1) routine is available

11. Fast BLAS routine(Level 3)