[comp.unix.questions] aix curses problem

brian@enkil.UUCP (Brian Ampolsk) (05/15/91)

The following code fragment is from a program running on a Perkin-Elmer 32xx 
under Xelos (P-E's version of Unix V.2).  We are converting to a RISC/6000
and on that system, this program abends.  The culprit appears to be 
"setscrreg".  When we note out this line, the program works fine, with the
minor exception, of course, that we lose our screen scroll region and the entire
screen scrolls instead.  The same thing happens if we use wsetscrreg, mvwprintw,
and wrefresh with stdscr.   We are using AIX 3.1.  Unfortunately, the system 
arrived without documentation - either paper or cd-rom, both of which are
back ordered!  Big Blue strikes again!  So, any special requirements are locked
up somewhere in the back order.  Anyway, I would have thought that curses is 
one of those things that is consistent among any and all versions of Unix/Xenix/
Xelos, etc.  On the other hand, I would also have expected an /etc/gettydefs....
Or a standard version of lp ....  Dream on!  Anyway, any help or ideas will be 
greatly appreciated.

BTW, I don't have access(yet) to comp.unix.aix, so I have posted this 
everywhere else I can think of.  Also, since I read my mail more frequently 
than the news, I'd appreciate any responses by mail.

Thanks,

Brian

--------------------------------------------------------------------------------
#include <curses.h>
#include <signal.h>

main(argc, argv)
int argc;
char *argv[];
{
	initscr();
	noecho();
	cbreak();
	idlok(stdscr,TRUE); 
	scrollok(stdscr,TRUE); 
	setscrreg(10,20);       <------This line causes a core dump!
	mvprintw(1,1,"PROGRAM ERROR OR END");
	mvprintw(2,1,"PRESS <RET> TO RETURN TO MENU: ");
	refresh();
	endwin();
	exit(0);
}
--------------------------------------------------------------------------------
-- 
Brian D. Ampolsk - Wynnewood *nix Consultants - (215) 642-2250
				   1605 Brookhaven Rd.
				   Wynnewood, PA 19096
UUCP:  ..!uunet!enkil!brian			INTERNET:  brian@enkil.UUCP

dold@mitisft.Convergent.COM (Clarence Dold) (05/17/91)

in article <938@enkil.UUCP>, brian@enkil.UUCP (Brian Ampolsk) says:

> and wrefresh with stdscr.   We are using AIX 3.1.  Unfortunately, the system 
> 	refresh();
added wgetch(stdscr); so it would stop...
> 	endwin();

I compiled and executed on RS6000/530 running AIX 3.1
/unix is dated May 29 1990 - 1261933.
Using both xterm and vt100, the program appears okay.

>From other experience, I would guess that you might be running on a Wyse60,
or some other terminal that cannot do hardware scrolling.  If the terminal
has no capability 'csr', curses has changed recently.  I don't know what
flavor of curses AIX thinks it is, since the system seems confused as to
which AT&T it is running.
-- 
---
Clarence A Dold - dold@tsmiti.Convergent.COM
               ...pyramid!ctnews!tsmiti!dold