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);
area=&bp;
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?
Hrv
--
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)