| If you change getc(buf) to getch() the program in .0 works.
My customer has since decided to go with ncurses instead of XPG4 curses
because it's more what like he knows.
What's the best documentation for someone running 3.2 with a heavy reliance
on older curses function who is upgrading to 4.0?
The X/Open CAE Specification, X/Open Curses, Issue 4, 1995 ? Are there any
books, tutorials, etc anyone has run across?
Thanks,
John
|
|
As the prior reply noted, if you replace gets() with a curses i/o
function, the program works correctly. The reason is that the new
curses lib takes control of the tty from the time initscr() is called
to the completion of endwin(). Changes are made to the tty settings
to allow curses to do its thing and it is expected that all i/o be
performed through the curses routines. Functions outside the curses
lib are unaware of the tty changes, be unable to complete their tasks,
and the application will exhibit this type of behavior.
The old curses library (3.2 and prior) was more forgiving and instead
of taking control of the tty, more or less shared it. Thus, programs
such as the one in .0 worked as expected. The downside of this
approach was that if the application changed the tty settings to
something other than what curses expected, then curses could fail.
So, as a general rule for anyone porting curses code to 4.0 or later,
once initscr() is called, use curses lib functions for all i/o
opperations. After endwin() has been called, the tty will be restored
to its initial state and all control returned to the application.
I hope this helps.
Bob Fontaine
Digital UNIX Engineering
[Posted by WWW Notes gateway]
|