comparison scripts/plot/private/__gnuplot_version__.m @ 12793:6f91ca83d2be

codesprint : Make many plot helper functions private. * plot/module.mk : Update where to find files for Automake *__fltk_ginput__.m, __fltk_print__.m, __gnuplot_drawnow__.m, __gnuplot_get_var__.m, __gnuplot_ginput__.m, __gnuplot_has_feature__.m, __gnuplot_open_stream__.m, __gnuplot_print__.m, __gnuplot_version__.m, __go_draw_axes__.m, __go_draw_figure__.m, __marching_cube__.m, __next_line_color__.m, __next_line_style__.m, __print_parse_opts__.m: Move helper functions into plot/private/ directory.
author Rik <octave@nomad.inbox5.com>
date Sat, 16 Jul 2011 09:28:26 -0700
parents scripts/plot/__gnuplot_version__.m@fd0a3ac60b0e
children 72c96de7a403
comparison
equal deleted inserted replaced
12792:dc29b64668fa 12793:6f91ca83d2be
1 ## Copyright (C) 2006-2011 Daniel Sebald
2 ##
3 ## This file is part of Octave.
4 ##
5 ## Octave is free software; you can redistribute it and/or modify it
6 ## under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 3 of the License, or (at
8 ## your option) any later version.
9 ##
10 ## Octave is distributed in the hope that it will be useful, but
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 ## General Public License for more details.
14 ##
15 ## You should have received a copy of the GNU General Public License
16 ## along with Octave; see the file COPYING. If not, see
17 ## <http://www.gnu.org/licenses/>.
18
19 ## -*- texinfo -*-
20 ## @deftypefn {Function File} {@var{version} =} __gnuplot_version__ ()
21 ## Undocumented internal function.
22 ## @end deftypefn
23
24 ## Return the version of gnuplot we are using. Note that we do not
25 ## attempt to handle the case of the user switching to different
26 ## versions of gnuplot during the same session.
27
28 function version = __gnuplot_version__ ()
29
30 persistent __version__ = "";
31
32 if (isempty (__version__))
33 [status, output] = system (sprintf ("\"%s\" --version", gnuplot_binary ()));
34 if (status != 0)
35 ## This message ends in a newline so that the traceback messages
36 ## are skipped and people might actually see the message, read it,
37 ## comprehend it, actually take the advice it gives, and stop
38 ## asking us why plotting fails when gnuplot is not found.
39 error ("you must have gnuplot installed to display graphics; if you have gnuplot installed in a non-standard location, see the 'gnuplot_binary' function\n");
40 endif
41 output = strrep (output, "gnuplot", "");
42 output = strrep (output, "patchlevel", ".");
43 output = strrep (output, "\n", "");
44 output = strrep (output, "\r", "");
45 __version__ = strrep (output, " ", "");
46 endif
47
48 version = __version__;
49
50 endfunction
51