% Fast and dirty solution
% to get LaTeX access to gnuplot point symbols.
% Caution: This is just a fast hack!
% License: GPL (see http://www.gnu.org/)
% Author: Tobias N"ahring (http://www.tn-home.de/)
% Date (YY-MM-DD): 04-07-10
%% stolen from LaTeX:
\def\loop#1\repeat{\def\iterate{#1\relax\expandafter\iterate\fi}%
  \iterate \let\iterate\relax}
\let\repeat\fi
%
\def\gobble#1{}
%
\def\ifundefined#1{%
\expandafter\ifx\csname\expandafter\gobble\string#1\endcsname\relax}

\newlinechar`\^^J
\ifundefined\epsname
\message{^^J^^JName of the eps-output of gnuplot:}
\read0 to \epsname
\fi
\ifundefined\proname
\immediate\write15{^^J^^JName of the postscript-header file for TeX:}
\read0 to \proname
\fi
\newread\epsfile
\newwrite\profile
\immediate\openin\epsfile\epsname 
\immediate\openout\profile\proname
\begingroup
\catcode`\°=14 % new comment character
% we don not expect ° in the postscript file.
\catcode`\%=12 ° going to be a normal `other' character
\catcode`\^^M=13°
\def\translateEpsPro{°
\begingroup°
\def\do##1{\catcode`##1=12}°
\dospecials°
\def\profileend{%%EndProlog^^M}°
\loop°
\immediate\read\epsfile to\tmp°
\begingroup°
\catcode`\^^M=13\relax°
\def^^M{}°
\immediate\write\profile{\tmp}°
\endgroup°
\ifx\tmp\profileend\else°
\repeat°
\endgroup°
}°
\translateEpsPro°
\endgroup
\immediate\closein\epsfile
\immediate\closeout\profile

\bye
