Curses: tparm: portability issues with Linux and Solaris

Curses: tparm: portability issues with Linux and Solaris

Post by arindam.mu » Thu, 23 Nov 2006 02:51:39


I am writing an app which needs to run on Linux, Solaris and AIX. I am
using the tparm function call to create format termcap string and then
output it through tputs or putp.

The problem is that tparm support a termcap string + 9 fixed long int
args on Solaris (XSI standard) but on Linux it is termcap string +
variable number of args. My code looks like this:

tigetstr("cup");
tputs( tparm(cup, x, y) .... );

This tparm call fails to compile on Solaris. I need a way to address
this problem. I need to know how to make the correct call on Solaris. I
could use ifdefs if needed.

Please give your valuable suggestions.

thanks
-- arindam
 
 
 

Curses: tparm: portability issues with Linux and Solaris

Post by Lew Pitche » Thu, 23 Nov 2006 03:09:14


How about
tputs(tparm(cup,x,y,0,0,0,0,0,0,0),...);

That should work in Linux and (according to your summary) in Solaris as
well.

 
 
 

Curses: tparm: portability issues with Linux and Solaris

Post by arindam.mu » Thu, 23 Nov 2006 03:30:49


Thanks for the tip. I could pretty much see that adding additional
params would make it compile. But what value (0 or -1 or whatever) they
ought to be was not clear to me. It does seem to work on Solaris and
Linux too.