[net.unix-wizards] Curses Bug?

brett@wjvax.UUCP (Brett Galloway) (12/28/85)

I saw the 4.2 curses buglist posted by Mike Laman at the end of October;
however, I ran into a problem not addressed therein.  In a program which
uses curses I want to use a terminal capability which curses has not
read into its external capability list; namely I want the value of the
cs (scrolling region) and bl (audible bell) capability strings.  I do
not want to have to read termcap AGAIN, since curses has already done so
via initscr().  My manual entry for curses (3X) includes a function

	getcap(name)		get terminal capbility name

This function has a type declaration in curses.h:

	char	*getcap();

However, it is NOT a symbol supplied by our curses library (either libcurses.a
or libtermcap.a); when I try to use it, the loader notes that "getcap" is
undefined.

Am I missing something obvious?  It seems like one should be able to reference
the terminal entry that curses has read, without having to reread it.  For
the time being, I will just write my own getcap() function which will
reread the termcap entry.  Any help for a better solution would be
appreciated, however.

Thanks in advance.

-------------
Brett Galloway
{pesnta,twg,ios,qubix,turtlevax,tymix,vecpyr,certes,isi}!wjvax!brett

jsdy@hadron.UUCP (Joseph S. D. Yao) (12/30/85)

In article <637@wjvax.wjvax.UUCP> brett@wjvax.UUCP (Brett Galloway) writes:
>                                                 ...  In a program which
>uses curses I want to use a terminal capability which curses has not
>read into its external capability list; namely I want the value of the
>cs (scrolling region) and bl (audible bell) capability strings.

Try using:
	boolean tgetflag(name);
	int tgetnum(name);
	char *tgetstr(name);
-- 

	Joe Yao		hadron!jsdy@seismo.{CSS.GOV,ARPA,UUCP}

jsdy@hadron.UUCP (Joseph S. D. Yao) (01/02/86)

In article <151@hadron.UUCP> jsdy@hadron.UUCP (Joseph S. D. Yao) writes:
>In article <637@wjvax.wjvax.UUCP> brett@wjvax.UUCP (Brett Galloway) writes:
>>                                                 ...  In a program which
>>uses curses I want to use a terminal capability which curses has not
>>read into its external capability list; namely I want the value of the
>>cs (scrolling region) and bl (audible bell) capability strings.
>Try using:
>	boolean tgetflag(name);
>	int tgetnum(name);
>	char *tgetstr(name);

But first read man 3 termcap.  That last is tgetstr(name, &namebuf).
It seems that all of these require a first call to tgetent(buf, term).
Don't forget to check all return values for error, and don't call any
of those three routines in a context in which tgetent()'s buf is no
longer valid.
-- 

	Joe Yao		hadron!jsdy@seismo.{CSS.GOV,ARPA,UUCP}