|
From: Jim K. <je...@kl...> - 2005-01-11 19:15:02
|
Ethan Merritt wrote:
>On Monday 10 January 2005 10:46 pm, Ethan Merritt wrote:
>
>
>>>diff -u -r1.72 plot.c
>>>--- plot.c 25 Aug 2004 22:33:16 -0000 1.72
>>>+++ plot.c 11 Jan 2005 05:26:21 -0000
>>>@@ -422,7 +422,9 @@
>>> * Do any non-X platforms suffer from the same problem?
>>> * EAM - Jan 2004.
>>> */
>>>- setvbuf(stdin, (char *) NULL, _IONBF, 0);
>>>+ if (isatty(fileno(stdin))) {
>>>+ setvbuf(stdin, (char *) NULL, _IONBF, 0);
>>>+ }
>>> #endif
>>>
>>>
>>I see why you want this. But speed is no good if the program
>>does not function properly, and previous experience showed that
>>unbuffering the input stream was needed for at least some
>>implementations of piped input.
>>
>>
>
>I have changed my mind. The behavior is not likely to differ
>from user to user, only from one platform to another. So it should
>be a configuration option for building on that platform, not a
>run-time option on the command line.
>
>How about we wrap the code as follows:
>
>#ifndef UNBUFFERED_STDIN
> setvbuf(stdin, (char *) NULL, _IONBF, 0);
>#endif
>
>and you can provide a brief set of instructions for how to set
>this conditional compilation flag during the cygwin configuration setup.
>I have not used cygwin, so I don't know exactly how that is done.
>
>It would be nice if you also checked that this doesn't interfere
>with correct execution of "pause" commands, however, since as I
>recall that was one of the original problems this was supposed to fix.
>For instance, please check that "mousevariables.dem" works properly with
>buffered input under cygwin.
>
>
>
cygwin looks like a unix box with X11 and it already appears in
configure I see.
I have just been doing configure and build and it works fine (I pre-install
the PDF library so that it will get detected at configure time).
The demo seems to work the same way with buffering on or off.
It also seems to work correctly with one exception. A tab or enter
does not terminate the keystroke.dem sub-test.
Jim
|