|
From: Petr M. <mi...@ph...> - 2008-11-16 20:34:34
|
\> > The primary intention was to achieve better functionality of programs piping
> > commands to gnuplot, like Octave, i.e. an efficient pgnuplot.exe
> > replacement.
>
> Not quite. Given that pgnuplot itself was always meant as a replacement for
> the missing console, pipe-capable implementation of gnuplot for MS Windows.
>
> We're effectively talking about the replacement of a replacement here.
>
> > Thus, what should be the name of this executable?
>
> gnuplot.exe
Well, then the console mode version of gnuplot will be called gnuplot.exe.
The pgnuplot program serves to capture the standard input and pass it to
gnuplot for drawing. As it is more efficient to pass data to gnuplot.exe
instead of wgnuplot.exe (it was the aim of the console mode gnuplot), then
pgnuplot.c could use this code:
{
FILE *gp;
gp = popen("gnuplot.exe", "wb");
if (!gp) {
printf("Cannot run gnuplot.exe!\n");
return 1;
}
while (fgets(psBuffer, BUFFER_SIZE, stdin) != NULL) {
fprintf(gp, psBuffer);
}
fclose(gp);
return 0;
}
Then Windows programs can use the traditional method of piping to
pgnuplot.exe on Windows but with improved efficiency. The tradition
(backwards compatibility) is important as the other programs don't have to
take care which version of gnuplot is installed -- and drawing will work
regardless the executable the pgnuplot is piping data to.
Hans-Bernhard, is this approach OK for you?
---
PM
|