# HG changeset patch # User jwe # Date 1141931093 0 # Node ID 6aae52010e3bd76c67faf3b4929aae1e2b6b4689 # Parent ab9a339fcec82ab85b5a51a0cbf2a7a5c3b44e55 [project @ 2006-03-09 19:04:53 by jwe] diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -263,7 +263,7 @@ Call license instead of hard-coding license info here. * miscellaneous/license.m: Use persistent instead of global for - __octave_licenses__. Use puts instad of disp. + __octave_licenses__. Use puts instead of disp. Use getuid and getpwuid instead of calling unix ("id -un"). If nargout = 1, return license info instead of printing usage message. @@ -718,7 +718,7 @@ plot/polar.m, plot/semilogxerr.m, plot/semilogx.m, plot/semilogyerr.m, plot/semilogy.m, plot/shg.m, plot/subplot.m, plot/subwindow.m, plot/title.m, plot/top_title.m: - Use __gnuplot_raw__ instad of __gnuplot_set__. + Use __gnuplot_raw__ instead of __gnuplot_set__. * plot/replot.m: Use __gnuplot_replot__, not __greplot__. diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,17 @@ +2006-03-09 John W. Eaton + + * Makefile.in (DIST_SRC): Include octave.cc here. + (DISTFILES, DEP_5): Not here. + + * octave.cc (F__version_info__): New function. + (initialize_version_info): New function. + (octave_main): Call initialize_version_info just before reading + init files. + + * version.h (OCTAVE_RELEASE_DATE): New macro. + + * ov-fcn-handle.h (octave_fcn_handle::dims): New function. + 2006-03-08 John W. Eaton * oct-stream.cc (octave_stream::stream_ok): Move definition here, diff --git a/src/Makefile.in b/src/Makefile.in --- a/src/Makefile.in +++ b/src/Makefile.in @@ -167,8 +167,8 @@ ls-mat-ascii.cc ls-mat4.cc ls-mat5.cc ls-oct-ascii.cc \ ls-oct-binary.cc ls-utils.cc main.c mappers.cc matherr.c \ oct-fstrm.cc oct-hist.cc oct-iostrm.cc oct-map.cc \ - oct-obj.cc oct-prcstrm.cc oct-procbuf.cc \ - oct-stream.cc zfstream.cc oct-strstrm.cc oct-lvalue.cc pager.cc \ + oct-obj.cc oct-prcstrm.cc oct-procbuf.cc oct-stream.cc \ + octave.cc zfstream.cc oct-strstrm.cc oct-lvalue.cc pager.cc \ parse.y pr-output.cc procstream.cc sighandlers.cc \ siglist.c sparse-xdiv.cc sparse-xpow.cc strcasecmp.c \ strncase.c strfns.cc symtab.cc syscalls.cc sysdep.cc \ @@ -201,7 +201,7 @@ # Ugh. -DEP_5 := $(SOURCES) $(DLD_SRC) builtins.cc ops.cc octave.cc main.c +DEP_5 := $(SOURCES) $(DLD_SRC) builtins.cc ops.cc main.c DEP_4 := $(notdir $(DEP_5)) DEP_3 := $(patsubst %.l, %.cc, $(DEP_4)) DEP_2 := $(patsubst %.y, %.cc, $(DEP_3)) @@ -257,8 +257,8 @@ DISTFILES = Makefile.in ChangeLog mkdefs mkops mkgendoc \ DOCSTRINGS mkbuiltins mk-errno-list mk-pkg-add \ - defaults.h.in oct-conf.h.in oct-errno.cc.in octave.gperf oct-gperf.h \ - octave.cc parse.cc lex.cc y.tab.h __gnuplot_raw__.cc \ + defaults.h.in oct-conf.h.in oct-errno.cc.in octave.gperf \ + oct-gperf.h parse.cc lex.cc y.tab.h __gnuplot_raw__.cc \ $(INCLUDES) $(DIST_SRC) $(OPT_HANDLERS) $(EXTRAS) all: octave$(EXEEXT) $(OCT_FILES) PKG_ADD DOCSTRINGS diff --git a/src/octave.cc b/src/octave.cc --- a/src/octave.cc +++ b/src/octave.cc @@ -60,6 +60,7 @@ #include "lex.h" #include "octave.h" #include "oct-hist.h" +#include "oct-map.h" #include "oct-obj.h" #include "ops.h" #include "toplev.h" @@ -209,6 +210,46 @@ + Vlibexec_dir + file_ops::dir_sep_str + "octave"; } +DEFUN (__version_info__, args, , + "-*- texinfo -*-\n\ +@deftypefn {Function File} {retval =} __version_info__ (@var{name}, @var{version}, @var{date})\n\ +@end deftypefn") +{ + octave_value retval; + + static Octave_map vinfo; + + int nargin = args.length (); + + if (nargin == 3) + { + octave_value idx (vinfo.numel () + 1); + + vinfo.assign (idx, "Name", Cell (octave_value (args (0)))); + vinfo.assign (idx, "Version", Cell (octave_value (args (1)))); + vinfo.assign (idx, "Release", Cell (octave_value (args (1)))); + vinfo.assign (idx, "Date", Cell (octave_value (args (2)))); + } + else if (nargin == 0) + retval = vinfo; + else + print_usage ("__version_info__"); + + return retval; +} + +static void +initialize_version_info (void) +{ + octave_value_list args; + + args(2) = OCTAVE_RELEASE_DATE; + args(1) = OCTAVE_VERSION; + args(0) = "GNU Octave"; + + F__version_info__ (args, 0); +} + // Initialize by reading startup files. static void @@ -610,6 +651,8 @@ octave_interpreter_ready = true; + initialize_version_info (); + execute_default_pkg_add_files (); execute_startup_files (); diff --git a/src/ov-fcn-handle.h b/src/ov-fcn-handle.h --- a/src/ov-fcn-handle.h +++ b/src/ov-fcn-handle.h @@ -72,6 +72,8 @@ bool is_function_handle (void) const { return true; } + dim_vector dims (void) const { static dim_vector dv (1, 1); return dv; } + octave_function *function_value (bool = false) { return fcn.function_value (); } diff --git a/src/version.h b/src/version.h --- a/src/version.h +++ b/src/version.h @@ -29,6 +29,8 @@ #define OCTAVE_API_VERSION "api-v17" +#define OCTAVE_RELEASE_DATE "2005-11-11" + #define OCTAVE_COPYRIGHT \ "Copyright (C) 2006 John W. Eaton."