1833609 Members
3417 Online
110062 Solutions
New Discussion

termcap, terminfo

 
Darrell Nichols_1
New Member

termcap, terminfo

I am using tgetent in a program to get termcap terminfo for vt220. The function is passing a error and not finding the terminfo. Any suggestions.
3 REPLIES 3
A. Clay Stephenson
Acclaimed Contributor

Re: termcap, terminfo

Hi,

I just created a short program to do a tgetent(dummy,(char *) NULL) to get the terminal specified by TERM and also tgetent(dummy,"vt220") to get a hardset value and both returned 0 as expected. I then followed with a call to tgetstr("cl",&area) and the returned value was as expected.

Have you tried an untic vt220 to see if you have a corrupt terminfo entry? I haven't used the termcap style calls in many moons (> 10 years) and always use the terminfo commands instead.

Regards, Clay


If it ain't broke, I can fix that.
Darrell Nichols_1
New Member

Re: termcap, terminfo

What version of hpux are you on I am on 11. Could you shoot me the code you used. My code might be wrong. Is a error return 0 good or bad.
A. Clay Stephenson
Acclaimed Contributor

Re: termcap, terminfo

Hi,

Zero is the normal exit code and indicates that all is well. -1 is returned on error for integer functions and a NULL pointer for *char functions in curses.

Here's is my sample code and it runs under the Ansi C compiler on both 11.0 and 11i. It will not compile (or at least I didn't try very hard) under aCC becuase tgetent is no defined. You really should be using this function because the documentation for many years has stated that the termcap emulation functions are going away. It appears to have done so under aCC. I think if you switch to the more modern terminfo routines, you will have no problems.

Clay
If it ain't broke, I can fix that.