# HG changeset patch # User jwe # Date 820295475 0 # Node ID f85887dfe06c856bdd8c7205e6750de512f75440 # Parent 5282f171363d7a137e1a7586a871c5c5c6a8e1bc [project @ 1995-12-30 03:46:07 by jwe] diff --git a/src/Makefile.in b/src/Makefile.in --- a/src/Makefile.in +++ b/src/Makefile.in @@ -40,33 +40,58 @@ @echo making $@ from $< @$(CXXCPP) -c $(CPPFLAGS) $(XALL_CXXFLAGS) -DMAKE_BUILTINS $< \ | $(srcdir)/mkdefs > $@.tmp - @if test `wc $@.tmp | sed 's%[^0-9]*\([0-9]*\).*%\1%'` -ne 0 ; then \ - mv $@.tmp $@ ; \ - else \ - echo "error: $@ is empty!" 1>&2 ; \ - rm -f $@.tmp ; \ - exit 1 ; \ - fi + @mv $@.tmp $@ + +# How to make a .oct file from a .o file: -DLD_SRC := f-balance.cc f-chol.cc f-colloc.cc f-dassl.cc f-det.cc \ - f-eig.cc f-expm.cc f-fft.cc f-fft2.cc f-filter.cc f-find.cc \ - f-fsolve.cc f-fsqp.cc f-givens.cc f-hess.cc f-ifft.cc \ - f-ifft2.cc f-inv.cc f-log.cc f-lpsolve.cc f-lsode.cc f-lu.cc \ - f-minmax.cc f-npsol.cc f-pinv.cc f-qpsol.cc f-qr.cc f-quad.cc \ - f-qzval.cc f-rand.cc f-schur.cc f-sort.cc f-svd.cc f-syl.cc +ifdef CXXPICFLAG +%.oct: pic/%.o + $(CXX) -shared -o $@ $< \ + $(OCTAVE_LFLAGS) \ + $(OCTAVE_LIBS) \ + $(FLIBS) $(LEXLIB) $(TERMLIBS) $(LIBS) -lg++ +else +%.oct: %.o + $(CXX) -shared -o $@ $< \ + $(OCTAVE_LFLAGS) \ + $(OCTAVE_LIBS) \ + $(FLIBS) $(LEXLIB) $(TERMLIBS) $(LIBS) -lg++ +endif + +DLD_SRC := balance.cc chol.cc colloc.cc dassl.cc det.cc eig.cc \ + expm.cc fft.cc fft2.cc filter.cc find.cc fsolve.cc \ + fsqp.cc givens.cc hess.cc ifft.cc ifft2.cc inv.cc log.cc \ + lpsolve.cc lsode.cc lu.cc minmax.cc npsol.cc pinv.cc \ + qpsol.cc qr.cc quad.cc qzval.cc rand.cc schur.cc sort.cc \ + svd.cc syl.cc DLD_OBJ := $(patsubst %.cc, %.o, $(DLD_SRC)) +ifeq ($(OCTAVE_LITE), true) + OCT_FILES := $(patsubst %.o, %.oct, $(DLD_OBJ)) + ifdef CXXPICFLAG + DLD_PICOBJ := $(addprefix pic/, $(DLD_OBJ)) + else + DLD_PICOBJ := $(DLD_OBJ) + endif + ifeq ($(WITH_DYNAMIC_LINKING), false) + DLD_STATIC_OBJ := $(DLD_OBJ) + endif +else + DLD_STATIC_OBJ := $(DLD_OBJ) +endif + INCLUDES := arith-ops.h builtins.h defaults.h.in defun.h defun-dld.h \ defun-int.h dirfns.h dynamic-ld.h error.h file-info.h \ file-io.h fnmatch.h getopt.h gripes.h help.h input.h lex.h \ - load-save.h mappers.h missing-math.h oct-gperf.h octave.h \ - octave-hist.h oct-map.h oct-obj.h pager.h parse.h \ - pathlen.h pathsearch.h pr-output.h procstream.h sighandlers.h \ + load-save.h mappers.h missing-math.h oct-gperf.h \ + octave-hist.h oct-map.h oct-obj.h pager.h parse.h pathlen.h \ + pathsearch.h pr-output.h procstream.h sighandlers.h \ statdefs.h symtab.h sysdep.h sysdir.h systime.h syswait.h \ - token.h tree-base.h tree-cmd.h tree-const.h tree-expr.h \ - tree-misc.h tree-plot.h unwind-prot.h user-prefs.h utils.h \ - variables.h version.h xdiv.h xpow.h Map.h SLStack.h Stack.h + token.h toplev.h tree-base.h tree-cmd.h tree-const.h \ + tree-expr.h tree-misc.h tree-plot.h unwind-prot.h \ + user-prefs.h utils.h variables.h version.h xdiv.h xpow.h \ + Map.h SLStack.h Stack.h TI_SRC := Array-tc.cc Map-tc.cc DLList-fi.cc \ SLList-expr.cc SLList-misc.cc SLList-plot.cc SLList-tc.cc \ @@ -75,26 +100,39 @@ TI_OBJ := $(patsubst %.cc, %.o, $(TI_SRC)) +TI_PICOBJ := $(TI_OBJ) +ifdef CXXPICFLAG + TI_PICOBJ := $(addprefix pic/, $(TI_OBJ)) +endif + SOURCES := acosh.c arith-ops.cc asinh.c atanh.c data.cc dirfns.cc \ dynamic-ld.cc erf.c erfc.c error.cc file-info.cc file-io.cc \ filemode.c fnmatch.c getopt.c getopt1.c gripes.cc help.cc \ - input.cc lex.l load-save.cc mappers.cc mkdir.c octave.cc \ - octave-hist.cc oct-map.cc oct-obj.cc pager.cc \ - parse.y pr-output.cc procstream.cc rename.c resource.cc \ - rmdir.c sighandlers.cc strcasecmp.c strncase.c strfns.cc \ - strftime.c symtab.cc sysdep.cc tempname.c timefns.cc \ - tempnam.c token.cc tree-base.cc tree-cmd.cc tree-const.cc \ + input.cc lex.l load-save.cc mappers.cc mkdir.c \ + octave-hist.cc oct-map.cc oct-obj.cc pager.cc parse.y \ + pr-output.cc procstream.cc rename.c resource.cc rmdir.c \ + sighandlers.cc strcasecmp.c strncase.c strfns.cc strftime.c \ + symtab.cc sysdep.cc tempname.c timefns.cc tempnam.c token.cc \ + toplev.cc tree-base.cc tree-cmd.cc tree-const.cc \ tree-expr.cc tree-misc.cc tree-plot.cc unwind-prot.cc \ user-prefs.cc utils.cc variables.cc xdiv.cc xpow.cc TEMPLATE_SRC = Map.cc SLStack.cc -OBJECTS_4 := $(SOURCES) builtins.o +OBJECTS_4 := $(SOURCES) OBJECTS_3 := $(patsubst %.l, %.o, $(OBJECTS_4)) OBJECTS_2 := $(patsubst %.y, %.o, $(OBJECTS_3)) OBJECTS_1 := $(patsubst %.c, %.o, $(OBJECTS_2)) OBJECTS := $(patsubst %.cc, %.o, $(OBJECTS_1)) +ifeq ($(SHARED_LIBS), true) + ifdef CXXPICFLAG + PICOBJ := $(addprefix pic/, $(OBJECTS)) + else + PICOBJ := $(OBJECTS) + endif +endif + # Ugh. DEP_SOURCES_3 := $(SOURCES) $(DLD_SRC) $(TI_SRC) builtins.cc @@ -110,38 +148,69 @@ DEF_FILES_1 := $(patsubst %.l, %.def, $(DEF_FILES_2)) DEF_FILES := $(patsubst %.cc, %.def, $(DEF_FILES_1)) -# Don't leave the LIBDLD thing on a line by itself. It may expand to -# nothing. +OCTAVE_LFLAGS = -L../liboctave -L../libcruft -L../readline \ + -L../kpathsea -L. $(RLD_FLAG) -OCTAVE_LIBS = @LIBOCTDLD@ ../liboctave/liboctave.a libtinst.a \ - ../libcruft/libcruft.a @LIBREADLINE@ @LIBPLPLOT@ \ - ../kpathsea/kpathsea.a @LIBDLD@ +OCTAVE_LIBS = -loctinterp -loctave -ltinst -lcruft \ + @LIBPLPLOT@ -lreadline -lkpathsea + +LIBS_TO_INSTALL = liboctinterp.a libtinst.a \ + liboctinterp.$(SHLEXT) libtinst.$(SHLEXT) TERMLIBS = @TERMLIBS@ LIBS = @LIBS@ -DISTFILES = Makefile.in mkdefs mkbuiltins octave.gperf parse.cc \ - lex.cc y.tab.h safe-xstat.cin safe-xstat.hin \ +DISTFILES = Makefile.in mkdefs mkbuiltins octave.gperf octave.cc \ + parse.cc lex.cc y.tab.h safe-xstat.cin safe-xstat.hin \ $(INCLUDES) $(DLD_SRC) $(SOURCES) $(TEMPLATE_SRC) $(TI_SRC) -all: defaults.h safe-stat.h safe-lstat.h octave +all: defaults.h safe-stat.h safe-lstat.h stamp-picdir libraries \ + $(OCT_FILES) octave .PHONY: all -octave: $(OBJECTS) $(DLD_OBJ) $(OCTAVE_LIBS) liboctdld.a +octave: octave.o builtins.o $(DLD_STATIC_OBJ) libraries $(CXX) $(CPPFLAGS) $(ALL_CXXFLAGS) $(ALL_LDFLAGS) -o octave \ - $(OBJECTS) \ + octave.o builtins.o $(DLD_STATIC_OBJ) \ + $(OCTAVE_LFLAGS) \ $(OCTAVE_LIBS) \ $(FLIBS) $(LEXLIB) $(TERMLIBS) $(LIBS) -lg++ -liboctdld.a: $(DLD_OBJ) - $(AR) $(ARFLAGS) liboctdld.a $(DLD_OBJ) - $(RANLIB) liboctdld.a + +stamp-picdir: + if [ -n "$(CPICFLAG)" ]; then \ + if [ -d pic ]; then true; else mkdir pic ; fi ; \ + else true; fi + touch stamp-picdir + +libraries: liboctinterp.a libtinst.a stamp-interp stamp-tinst + +liboctinterp.a: $(OBJECTS) + $(AR) $(ARFLAGS) liboctinterp.a $(OBJECTS) + $(RANLIB) liboctinterp.a libtinst.a: $(TI_OBJ) $(AR) $(ARFLAGS) libtinst.a $(TI_OBJ) $(RANLIB) libtinst.a +stamp-interp: $(PICOBJ) + if $(SHARED_LIBS); then \ + $(CXX) -shared -o liboctinterp.$(SHLEXT) $(PICOBJ) \ + $(OCTAVE_LFLAGS) \ + -loctave -lcruft -ltinst -lreadline -lkpathsea \ + $(TERMLIBS) $(LIBS) -lg++; \ + else true; fi + touch stamp-interp + +stamp-tinst: $(TI_PICOBJ) + if $(SHARED_LIBS); then \ + $(CXX) -shared -o libtinst.$(SHLEXT) $(TI_PICOBJ) \ + $(OCTAVE_LFLAGS) \ + -loctinterp -loctave -lcruft -lreadline -lkpathsea \ + $(TERMLIBS) $(LIBS) -lg++; \ + else true; fi + touch stamp-tinst + builtins.cc: $(DEF_FILES) mkbuiltins @echo making $@ from $(DEF_FILES) @$(srcdir)/mkbuiltins $(DEF_FILES) > $@.tmp @@ -154,15 +223,29 @@ check: all .PHONY: check -install: all - $(top_srcdir)/mkinstalldirs $(bindir) $(libdir) +install: all install-bin install-lib install-oct +.PHONY: install + +install-bin: + $(top_srcdir)/mkinstalldirs $(bindir) rm -f $(bindir)/octave $(INSTALL) octave $(bindir)/octave-$(version) ln $(bindir)/octave-$(version) $(bindir)/octave - if $(OCTAVE_LITE) && $(WITH_DLD) ; then \ - $(INSTALL_DATA) liboctdld.a $(libdir)/liboctdld.a ; \ - fi -.PHONY: install +.PHONY: install-bin + +install-lib: + $(top_srcdir)/mkinstalldirs $(libdir) + for f in $(LIBS_TO_INSTALL); do \ + if [ -f $$f ]; then $(INSTALL_DATA) $$f $(libdir)/$$f; fi; \ + done +.PHONY: install-lib + +install-oct: + $(top_srcdir)/mkinstalldirs $(octfiledir) + for f in $(OCT_FILES); do $(INSTALL_DATA) $$f $(octfiledir)/$$f; done + $(srcdir)/mk-oct-links $(octfiledir) \ + $(addprefix $(srcdir)/, $(DLD_SRC)) +.PHONY: install-oct uninstall: rm -f $(bindir)/octave diff --git a/src/balance.cc b/src/balance.cc --- a/src/balance.cc +++ b/src/balance.cc @@ -43,7 +43,7 @@ #include "user-prefs.h" #include "utils.h" -DEFUN_DLD_BUILTIN ("balance", Fbalance, Sbalance, 11, +DEFUN_DLD_BUILTIN ("balance", Fbalance, Sbalance, FSbalance, 11, "AA = balance (A [, OPT]) or [[DD,] AA] = balance (A [, OPT])\n\ \n\ generalized eigenvalue problem:\n\ diff --git a/src/chol.cc b/src/chol.cc --- a/src/chol.cc +++ b/src/chol.cc @@ -36,7 +36,7 @@ #include "user-prefs.h" #include "utils.h" -DEFUN_DLD_BUILTIN ("chol", Fchol, Schol, 11, +DEFUN_DLD_BUILTIN ("chol", Fchol, Schol, FSchol, 11, "R = chol (X): cholesky factorization") { Octave_object retval; diff --git a/src/colloc.cc b/src/colloc.cc --- a/src/colloc.cc +++ b/src/colloc.cc @@ -33,7 +33,7 @@ #include "tree-const.h" #include "utils.h" -DEFUN_DLD_BUILTIN ("colloc", Fcolloc, Scolloc, 10, +DEFUN_DLD_BUILTIN ("colloc", Fcolloc, Scolloc, FScolloc, 10, "[R, A, B, Q] = colloc (N [, \"left\"] [, \"right\"]): collocation weights") { Octave_object retval; diff --git a/src/dassl.cc b/src/dassl.cc --- a/src/dassl.cc +++ b/src/dassl.cc @@ -103,7 +103,7 @@ return retval; } -DEFUN_DLD_BUILTIN ("dassl", Fdassl, Sdassl, 10, +DEFUN_DLD_BUILTIN ("dassl", Fdassl, Sdassl, FSdassl, 10, "dassl (\"function_name\", x_0, xdot_0, t_out)\n\ dassl (F, X_0, XDOT_0, T_OUT, T_CRIT)\n\ \n\ @@ -315,7 +315,8 @@ return retval; } -DEFUN_DLD_BUILTIN ("dassl_options", Fdassl_options, Sdassl_options, 10, +DEFUN_DLD_BUILTIN ("dassl_options", Fdassl_options, Sdassl_options, + FSdassl_options, 10, "dassl_options (KEYWORD, VALUE)\n\ \n\ Set or show options for dassl. Keywords may be abbreviated\n\ diff --git a/src/defun-dld.h b/src/defun-dld.h --- a/src/defun-dld.h +++ b/src/defun-dld.h @@ -36,21 +36,13 @@ // If Octave is not configured for dynamic linking of builtin // functions, this is exactly like DEFUN. -#if defined (OCTAVE_LITE) && defined (MAKE_BUILTINS) -#if defined (WITH_DLD) -#define DEFUN_DLD_BUILTIN(name, fname, sname, unused_arg_flags, doc) \ - BEGIN_INSTALL_BUILTIN \ - DEFINE_FUN_STRUCT (name, 0, sname, unused_arg_flags, 0, doc); \ - install_builtin_function (&sname); \ - END_INSTALL_BUILTIN -#else -#define DEFUN_DLD_BUILTIN(name, fname, sname, unused_arg_flags, doc) \ - BEGIN_INSTALL_BUILTIN \ - const char *sname = name " not included with --enable-lite-kernel"; \ - END_INSTALL_BUILTIN +#if defined (OCTAVE_LITE) && defined (WITH_DYNAMIC_LINKING) +#if ! defined (MAKE_BUILTINS) +#define DEFUN_DLD_BUILTIN(name, fname, sname, fsname, unused_arg_flags, doc) \ + DEFUN_DLD(name, fname, sname, fsname, unused_arg_flags, doc) #endif #else -#define DEFUN_DLD_BUILTIN(name, fname, sname, unused_arg_flags, doc) \ +#define DEFUN_DLD_BUILTIN(name, fname, fsname, sname, unused_arg_flags, doc) \ DEFUN_INTERNAL (name, fname, sname, unused_arg_flags, 0, doc) #endif @@ -64,10 +56,10 @@ #if ! defined (MAKE_BUILTINS) #define DEFUN_DLD(name, fname, sname, fsname, unused_arg_flags, doc) \ - DECLARE_FUN (fname); \ - DEFINE_FUN_STRUCT (name, fname, sname, unused_arg_flags, 0, doc); \ + DECLARE_FUN_ ## unused_arg_flags(fname); \ + DEFINE_FUN_STRUCT (name, fname, sname, 0, doc); \ DEFINE_FUN_STRUCT_FUN (sname, fsname) \ - DECLARE_FUN (fname) + DECLARE_FUN_ ## unused_arg_flags (fname) #endif #endif diff --git a/src/det.cc b/src/det.cc --- a/src/det.cc +++ b/src/det.cc @@ -36,7 +36,7 @@ #include "user-prefs.h" #include "utils.h" -DEFUN_DLD_BUILTIN ("det", Fdet, Sdet, 10, +DEFUN_DLD_BUILTIN ("det", Fdet, Sdet, FSdet, 10, "det (X): determinant of a square matrix") { Octave_object retval; diff --git a/src/eig.cc b/src/eig.cc --- a/src/eig.cc +++ b/src/eig.cc @@ -35,7 +35,7 @@ #include "user-prefs.h" #include "utils.h" -DEFUN_DLD_BUILTIN ("eig", Feig, Seig, 11, +DEFUN_DLD_BUILTIN ("eig", Feig, Seig, FSeig, 11, "eig (X) or [V, D] = eig (X): compute eigenvalues and eigenvectors of X") { Octave_object retval; diff --git a/src/expm.cc b/src/expm.cc --- a/src/expm.cc +++ b/src/expm.cc @@ -55,7 +55,7 @@ const int&, double*); } -DEFUN_DLD_BUILTIN ("expm", Fexpm, Sexpm, 10, +DEFUN_DLD_BUILTIN ("expm", Fexpm, Sexpm, FSexpm, 10, "expm (X): matrix exponential, e^A") { Octave_object retval; diff --git a/src/fft.cc b/src/fft.cc --- a/src/fft.cc +++ b/src/fft.cc @@ -38,7 +38,7 @@ // This function should be merged with Fifft. -DEFUN_DLD_BUILTIN ("fft", Ffft, Sfft, 10, +DEFUN_DLD_BUILTIN ("fft", Ffft, Sfft, FSfft, 10, "fft (X [, N]): fast fourier transform of a vector") { Octave_object retval; diff --git a/src/fft2.cc b/src/fft2.cc --- a/src/fft2.cc +++ b/src/fft2.cc @@ -38,7 +38,7 @@ // This function should be merged with Fifft2. -DEFUN_DLD_BUILTIN ("fft2", Ffft2, Sfft2, 10, +DEFUN_DLD_BUILTIN ("fft2", Ffft2, Sfft2, FSfft2, 10, "fft2 (X [, N] [, M])\n\ \n\ two dimensional fast fourier transform of a vector") diff --git a/src/filter.cc b/src/filter.cc --- a/src/filter.cc +++ b/src/filter.cc @@ -151,7 +151,7 @@ return filter (b, a, x, si); } -DEFUN_DLD_BUILTIN ("filter", Ffilter, Sfilter, 10, +DEFUN_DLD_BUILTIN ("filter", Ffilter, Sfilter, FSfilter, 10, "usage: [y [, sf]] = filter (b, a, x [, si])\n\ \n\ y = filter (b, a, x) returns the solution to the following linear,\n\ diff --git a/src/find.cc b/src/find.cc --- a/src/find.cc +++ b/src/find.cc @@ -158,7 +158,7 @@ return find_to_fortran_idx (i_idx, j_idx, tmp, m_nr, nargout); } -DEFUN_DLD_BUILTIN ("find", Ffind, Sfind, 11, +DEFUN_DLD_BUILTIN ("find", Ffind, Sfind, FSfind, 11, "find (X) or [I, J, V] = find (X): Return indices of nonzero elements") { Octave_object retval; diff --git a/src/fsolve.cc b/src/fsolve.cc --- a/src/fsolve.cc +++ b/src/fsolve.cc @@ -119,7 +119,7 @@ return retval; } -DEFUN_DLD_BUILTIN ("fsolve", Ffsolve, Sfsolve, 11, +DEFUN_DLD_BUILTIN ("fsolve", Ffsolve, Sfsolve, FSfsolve, 11, "Solve nonlinear equations using Minpack. Usage:\n\ \n\ [X, INFO] = fsolve (F, X0)\n\ @@ -281,7 +281,8 @@ return retval; } -DEFUN_DLD_BUILTIN ("fsolve_options", Ffsolve_options, Sfsolve_options, 10, +DEFUN_DLD_BUILTIN ("fsolve_options", Ffsolve_options, Sfsolve_options, + FSfsolve_options, 10, "fsolve_options (KEYWORD, VALUE)\n\ \n\ Set or show options for fsolve. Keywords may be abbreviated\n\ diff --git a/src/fsqp.cc b/src/fsqp.cc --- a/src/fsqp.cc +++ b/src/fsqp.cc @@ -54,12 +54,12 @@ #endif #if defined (FSQP_MISSING) -DEFUN_DLD_BUILTIN ("fsqp", Ffsqp, Sfsqp, 00, +DEFUN_DLD_BUILTIN ("fsqp", Ffsqp, Sfsqp, FSfsqp, 00, "This function requires FSQP, which is not freely\n\ redistributable. For more information, read the file\n\ libcruft/fsqp/README.MISSING in the source distribution.") #else -DEFUN_DLD_BUILTIN ("fsqp", Ffsqp, Sfsqp, 00, +DEFUN_DLD_BUILTIN ("fsqp", Ffsqp, Sfsqp, FSfsqp, 00, "[X, PHI] = fsqp (X, PHI [, LB, UB] [, LB, A, UB] [, LB, G, UB])\n\ \n\ Groups of arguments surrounded in `[]' are optional, but\n\ @@ -89,12 +89,14 @@ } #if defined (FSQP_MISSING) -DEFUN_DLD_BUILTIN ("fsqp_options", Ffsqp_options, Sfsqp_options, 00, +DEFUN_DLD_BUILTIN ("fsqp_options", Ffsqp_options, Sfsqp_options, + FSfsqp_options, 00, "This function requires FSQP, which is not freely\n\ redistributable. For more information, read the file\n\ libcruft/fsqp/README.MISSING in the source distribution.") #else -DEFUN_DLD_BUILTIN ("fsqp_options", Ffsqp_options, Sfsqp_options, 00, +DEFUN_DLD_BUILTIN ("fsqp_options", Ffsqp_options, Sfsqp_options, + FSfsqp_options, 00, "fsqp_options (KEYWORD, VALUE)\n\ \n\ Set or show options for fsqp. Keywords may be abbreviated\n\ diff --git a/src/givens.cc b/src/givens.cc --- a/src/givens.cc +++ b/src/givens.cc @@ -47,7 +47,7 @@ double&, Complex&, Complex&); } -DEFUN_DLD_BUILTIN ("givens", Fgivens, Sgivens, 11, +DEFUN_DLD_BUILTIN ("givens", Fgivens, Sgivens, FSgivens, 11, "G = givens (X, Y)\n\ \n\ compute orthogonal matrix G = [c s; -conj (s) c]\n\ diff --git a/src/hess.cc b/src/hess.cc --- a/src/hess.cc +++ b/src/hess.cc @@ -36,7 +36,7 @@ #include "user-prefs.h" #include "utils.h" -DEFUN_DLD_BUILTIN ("hess", Fhess, Shess, 11, +DEFUN_DLD_BUILTIN ("hess", Fhess, Shess, FShess, 11, "[P, H] = hess (A) or H = hess (A): Hessenberg decomposition") { Octave_object retval; diff --git a/src/ifft.cc b/src/ifft.cc --- a/src/ifft.cc +++ b/src/ifft.cc @@ -38,7 +38,7 @@ // This function should be merged with Ffft. -DEFUN_DLD_BUILTIN ("ifft", Fifft, Sifft, 10, +DEFUN_DLD_BUILTIN ("ifft", Fifft, Sifft, FSifft, 10, "ifft (X [, N]): inverse fast fourier transform of a vector") { Octave_object retval; diff --git a/src/ifft2.cc b/src/ifft2.cc --- a/src/ifft2.cc +++ b/src/ifft2.cc @@ -38,7 +38,7 @@ // This function should be merged with Ffft2. -DEFUN_DLD_BUILTIN ("ifft2", Fifft2, Sifft2, 10, +DEFUN_DLD_BUILTIN ("ifft2", Fifft2, Sifft2, FSifft2, 10, "ifft2 (X [, N] [, M])\n\ \n\ two dimensional inverse fast fourier transform of a vector") diff --git a/src/inv.cc b/src/inv.cc --- a/src/inv.cc +++ b/src/inv.cc @@ -36,7 +36,7 @@ #include "user-prefs.h" #include "utils.h" -DEFUN_DLD_BUILTIN ("inv", Finv, Sinv, 10, +DEFUN_DLD_BUILTIN ("inv", Finv, Sinv, FSinv, 10, "inv (X): inverse of a square matrix") { Octave_object retval; @@ -111,7 +111,7 @@ // alias_builtin() won't do the right thing if we are actually using // dynamic linking. -DEFUN_DLD_BUILTIN ("inverse", Finverse, Sinverse, 11, +DEFUN_DLD_BUILTIN ("inverse", Finverse, Sinverse, FSinverse, 11, "inverse (X): inverse of a square matrix") { return Finv (args, nargout); diff --git a/src/log.cc b/src/log.cc --- a/src/log.cc +++ b/src/log.cc @@ -38,7 +38,7 @@ // XXX FIXME XXX -- the next two functions should really be just // one... -DEFUN_DLD_BUILTIN ("logm", Flogm, Slogm, 10, +DEFUN_DLD_BUILTIN ("logm", Flogm, Slogm, FSlogm, 10, "logm (X): matrix logarithm") { Octave_object retval; @@ -150,7 +150,7 @@ return retval; } -DEFUN_DLD_BUILTIN ("sqrtm", Fsqrtm, Ssqrtm, 10, +DEFUN_DLD_BUILTIN ("sqrtm", Fsqrtm, Ssqrtm, FSsqrtm, 10, "sqrtm (X): matrix sqrt") { Octave_object retval; diff --git a/src/lpsolve.cc b/src/lpsolve.cc --- a/src/lpsolve.cc +++ b/src/lpsolve.cc @@ -32,7 +32,7 @@ #include "help.h" #include "tree-const.h" -DEFUN_DLD_BUILTIN ("lp_solve", Flp_solve, Slp_solve, 00, +DEFUN_DLD_BUILTIN ("lp_solve", Flp_solve, Slp_solve, FSlp_solve, 00, "lp_solve (): solve linear programs using lp_solve.") { Octave_object retval; @@ -50,7 +50,7 @@ } DEFUN_DLD_BUILTIN ("lp_solve_options", Flp_solve_options, - Slp_solve_options, 00, + Slp_solve_options, FSlp_solve_options, 00, "lp_solve_options (KEYWORD, VALUE)\n\ \n\ Set or show options for lp_solve. Keywords may be abbreviated\n\ diff --git a/src/lsode.cc b/src/lsode.cc --- a/src/lsode.cc +++ b/src/lsode.cc @@ -92,7 +92,7 @@ return retval; } -DEFUN_DLD_BUILTIN ("lsode", Flsode, Slsode, 11, +DEFUN_DLD_BUILTIN ("lsode", Flsode, Slsode, FSlsode, 11, "lsode (F, X0, T_OUT, T_CRIT)\n\ \n\ The first argument is the name of the function to call to\n\ @@ -296,7 +296,8 @@ return retval; } -DEFUN_DLD_BUILTIN ("lsode_options", Flsode_options, Slsode_options, 10, +DEFUN_DLD_BUILTIN ("lsode_options", Flsode_options, Slsode_options, + FSlsode_options, 10, "lsode_options (KEYWORD, VALUE)\n\ \n\ Set or show options for lsode. Keywords may be abbreviated\n\ diff --git a/src/lu.cc b/src/lu.cc --- a/src/lu.cc +++ b/src/lu.cc @@ -35,7 +35,7 @@ #include "user-prefs.h" #include "utils.h" -DEFUN_DLD_BUILTIN ("lu", Flu, Slu, 11, +DEFUN_DLD_BUILTIN ("lu", Flu, Slu, FSlu, 11, "[L, U, P] = lu (A): LU factorization") { Octave_object retval; diff --git a/src/minmax.cc b/src/minmax.cc --- a/src/minmax.cc +++ b/src/minmax.cc @@ -362,7 +362,7 @@ return result; } -DEFUN_DLD_BUILTIN ("min", Fmin, Smin, 11, +DEFUN_DLD_BUILTIN ("min", Fmin, Smin, FSmin, 11, "min (X): minimum value(s) of a vector (matrix)") { Octave_object retval; @@ -590,7 +590,7 @@ return retval; } -DEFUN_DLD_BUILTIN ("max", Fmax, Smax, 11, +DEFUN_DLD_BUILTIN ("max", Fmax, Smax, FSmax, 11, "max (X): maximum value(s) of a vector (matrix)") { Octave_object retval; diff --git a/src/npsol.cc b/src/npsol.cc --- a/src/npsol.cc +++ b/src/npsol.cc @@ -228,12 +228,12 @@ #endif #if defined (NPSOL_MISSING) -DEFUN_DLD_BUILTIN ("npsol", Fnpsol, Snpsol, 00, +DEFUN_DLD_BUILTIN ("npsol", Fnpsol, Snpsol, FSnpsol, 00, "This function requires NPSOL, which is not freely\n\ redistributable. For more information, read the file\n\ libcruft/npsol/README.MISSING in the source distribution.") #else -DEFUN_DLD_BUILTIN ("npsol", Fnpsol, Snpsol, 11, +DEFUN_DLD_BUILTIN ("npsol", Fnpsol, Snpsol, FSnpsol, 11, "[X, OBJ, INFO, LAMBDA] = npsol (X, PHI [, LB, UB] [, LB, A, UB] [, LB, G, UB])\n\ \n\ Groups of arguments surrounded in `[]' are optional, but\n\ @@ -769,12 +769,14 @@ #endif #if defined (NPSOL_MISSING) -DEFUN_DLD_BUILTIN ("npsol_options", Fnpsol_options, Snpsol_options, 00, +DEFUN_DLD_BUILTIN ("npsol_options", Fnpsol_options, Snpsol_options, + FSnpsol_options, 00, "This function requires NPSOL, which is not freely\n\ redistributable. For more information, read the file\n\ libcruft/npsol/README.MISSING in the source distribution.") #else -DEFUN_DLD_BUILTIN ("npsol_options", Fnpsol_options, Snpsol_options, 10, +DEFUN_DLD_BUILTIN ("npsol_options", Fnpsol_options, Snpsol_options, + FSnpsol_options, 10, "npsol_options (KEYWORD, VALUE)\n\ \n\ Set or show options for npsol. Keywords may be abbreviated\n\ diff --git a/src/octave.cc b/src/octave.cc --- a/src/octave.cc +++ b/src/octave.cc @@ -78,90 +78,16 @@ #include "variables.h" #include "version.h" -#if !defined (HAVE_ATEXIT) && defined (HAVE_ON_EXIT) -extern "C" int on_exit (); -#define atexit on_exit -#endif - -// argv[0] for this program. -char *raw_prog_name = 0; - -// Cleaned-up name of this program, not including path information. -char *prog_name = 0; - -// Login name for user running this program. -char *user_name = 0; - -// Name of the host we are running on. -char *host_name = 0; - -// User's home directory. -char *home_directory = 0; - -// Guess what? -char *the_current_working_directory = 0; - -// The path that will be searched for programs that we execute. -// (--exec-path path) -char *exec_path = 0; - -// Load path specified on command line. -// (--path path; -p path) -char *load_path = 0; - -// Name of the info file specified on command line. -// (--info-file file) -char *info_file = 0; - -// Name of the info reader we'd like to use. -// (--info-program program) -char *info_prog = 0; - -// Name of the editor to be invoked by the edit_history command. -char *editor = 0; - -// If nonzero, don't do fancy line editing. -int no_line_editing = 0; - -// If nonzero, print verbose info in some cases. -// (--verbose; -V) -int verbose_flag = 0; - -// Command number, counting from the beginning of this session. -int current_command_number = 1; - -// Nonzero means we are exiting via the builtin exit or quit functions. -int quitting_gracefully = 0; - -// Current command to execute. -tree_statement_list *global_command = 0; - -// Pointer to function that is currently being evaluated. -tree_function *curr_function = 0; - -// Nonzero means input is coming from startup file. -int input_from_startup_file = 0; - -// The command-line options. -charMatrix octave_argv; - -// Nonzero means that input is coming from a file that was named on -// the command line. -int input_from_command_line_file = 1; +// This is from readline's paren.c: +extern int rl_blink_matching_paren; // Top level context (?) jmp_buf toplevel; -// This is from readline's paren.c: -extern int rl_blink_matching_paren; - // Nonzero means we read ~/.octaverc and ./.octaverc. // (--norc; --ignore-init-file; -f) static int read_init_files = 1; -// Nonzero means we printed messages about reading startup files. -static int reading_startup_message_printed = 0; - // Nonzero means we don't print the usual startup message. // (--quiet; --silent; -q) static int inhibit_startup_message = 0; @@ -295,120 +221,6 @@ editor = default_editor (); } -void -parse_and_execute (FILE *f, int print) -{ - begin_unwind_frame ("parse_and_execute"); - - YY_BUFFER_STATE old_buf = current_buffer (); - YY_BUFFER_STATE new_buf = create_buffer (f); - - add_unwind_protect (restore_input_buffer, (void *) old_buf); - add_unwind_protect (delete_input_buffer, (void *) new_buf); - - switch_to_buffer (new_buf); - - unwind_protect_int (using_readline); - unwind_protect_int (input_from_command_line_file); - - using_readline = 0; - input_from_command_line_file = 0; - - unwind_protect_ptr (curr_sym_tab); - - int retval; - do - { - reset_parser (); - - retval = yyparse (); - - if (retval == 0 && global_command) - { - global_command->eval (print); - delete global_command; - } - } - while (retval == 0); - - run_unwind_frame ("parse_and_execute"); -} - -void -parse_and_execute (const char *s, int print, int verbose, - const char *warn_for) -{ - begin_unwind_frame ("parse_and_execute_2"); - - unwind_protect_int (reading_script_file); - unwind_protect_ptr (curr_fcn_file_full_name); - - reading_script_file = 1; - curr_fcn_file_full_name = s; - - FILE *f = get_input_from_file (s, 0); - if (f) - { - unwind_protect_int (input_line_number); - unwind_protect_int (current_input_column); - - input_line_number = 0; - current_input_column = 1; - - if (verbose) - { - cout << "reading commands from " << s << " ... "; - reading_startup_message_printed = 1; - cout.flush (); - } - - parse_and_execute (f, print); - - fclose (f); - - if (verbose) - cout << "done." << endl; - } - else if (warn_for) - error ("%s: unable to open file `%s'", warn_for, s); - - run_unwind_frame ("parse_and_execute_2"); -} - -DEFUN ("source", Fsource, Ssource, 10, - "source (FILE)\n\ -\n\ -Parse and execute the contents of FILE. Like executing commands in a\n\ -script file but without requiring the file to be named `FILE.m'.") -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin == 1) - { - const char *file = args(0).string_value (); - - if (! error_state) - { - file = tilde_expand (file); - - parse_and_execute (file, 1, 0, "source"); - - if (error_state) - error ("source: error sourcing file `%s'", file); - - delete [] file; - } - else - error ("source: expecting file name as argument"); - } - else - print_usage ("source"); - - return retval; -} - // Initialize by reading startup files. static void @@ -502,37 +314,6 @@ exit (1); } -// Fix up things before exiting. - -void -clean_up_and_exit (int retval) -{ - raw_mode (0); - - clean_up_history (); - - close_plot_stream (); - - close_diary_file (); - - close_files (); - - cleanup_tmp_files (); - - if (!quitting_gracefully && (interactive || forced_interactive)) - cout << "\n"; - - if (retval == EOF) - retval = 0; - - exit (retval); - - // This is bogus but should prevent g++ from giving a warning saying - // that this volatile function does return. - - panic_impossible (); -} - static void print_version_and_exit (void) { @@ -801,385 +582,6 @@ clean_up_and_exit (retval); } -DEFUN_TEXT ("casesen", Fcasesen, Scasesen, 10, - "casesen [on|off]") -{ - Octave_object retval; - - DEFINE_ARGV("casesen"); - - if (argc == 1 || (argc > 1 && strcmp (argv[1], "off") == 0)) - warning ("casesen: sorry, Octave is always case sensitive"); - else if (argc > 1 && strcmp (argv[1], "on") == 0) - ; // ok. - else - print_usage ("casesen"); - - DELETE_ARGV; - - return retval; -} - -DEFUN ("computer", Fcomputer, Scomputer, 11, - "computer ():\n\ -\n\ -Have Octave ask the system, \"What kind of computer are you?\"") -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin != 0) - warning ("computer: ignoring extra arguments"); - - ostrstream output_buf; - - if (strcmp (TARGET_HOST_TYPE, "unknown") == 0) - output_buf << "Hi Dave, I'm a HAL-9000"; - else - output_buf << TARGET_HOST_TYPE; - - if (nargout == 0) - { - output_buf << "\n" << ends; - maybe_page_output (output_buf); - } - else - { - output_buf << ends; - char *msg = output_buf.str (); - retval = msg; - delete [] msg; - } - - return retval; -} - -DEFUN ("flops", Fflops, Sflops, 10, - "flops (): count floating point operations") -{ - int nargin = args.length (); - - if (nargin > 0) - print_usage ("flops"); - - warning ("flops is a flop, always returning zero"); - - return 0.0; -} - -DEFUN ("quit", Fquit, Squit, 00, - "quit (): exit Octave gracefully") -{ - Octave_object retval; - quitting_gracefully = 1; - clean_up_and_exit (0); - return retval; -} - -DEFALIAS (exit, quit); - -DEFUN ("warranty", Fwarranty, Swarranty, 00, - "warranty (): describe copying conditions") -{ - Octave_object retval; - - ostrstream output_buf; - output_buf << "\n" OCTAVE_NAME_VERSION_AND_COPYRIGHT "\n\n\ -This program is free software; you can redistribute it and/or modify\n\ -it under the terms of the GNU General Public License as published by\n\ -the Free Software Foundation; either version 2 of the License, or\n\ -(at your option) any later version.\n\ -\n\ -This program is distributed in the hope that it will be useful,\n\ -but WITHOUT ANY WARRANTY; without even the implied warranty of\n\ -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\ -GNU General Public License for more details.\n\ -\n\ -You should have received a copy of the GNU General Public License\n\ -along with this program. If not, write to the Free Software\n\ -Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n\ -\n"; - - output_buf << ends; - maybe_page_output (output_buf); - - return retval; -} - -// XXX FIXME XXX -- this may not be the best place for these... - -Octave_object -feval (const Octave_object& args, int nargout) -{ - Octave_object retval; - - tree_fvc *fcn = is_valid_function (args(0), "feval", 1); - if (fcn) - { - int tmp_nargin = args.length () - 1; - Octave_object tmp_args; - tmp_args.resize (tmp_nargin); - for (int i = 0; i < tmp_nargin; i++) - tmp_args(i) = args(i+1); - retval = fcn->eval (0, nargout, tmp_args); - } - - return retval; -} - -DEFUN ("feval", Ffeval, Sfeval, 11, - "feval (NAME, ARGS, ...)\n\ -\n\ -evaluate NAME as a function, passing ARGS as its arguments") -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin > 0) - retval = feval (args, nargout); - else - print_usage ("feval"); - - return retval; -} - -static Octave_object -eval_string (const char *string, int print, int& parse_status, - int nargout) -{ - begin_unwind_frame ("eval_string"); - - unwind_protect_int (get_input_from_eval_string); - unwind_protect_int (input_from_command_line_file); - unwind_protect_ptr (global_command); - unwind_protect_ptr (current_eval_string); - - get_input_from_eval_string = 1; - input_from_command_line_file = 0; - current_eval_string = string; - - YY_BUFFER_STATE old_buf = current_buffer (); - YY_BUFFER_STATE new_buf = create_buffer (0); - - add_unwind_protect (restore_input_buffer, (void *) old_buf); - add_unwind_protect (delete_input_buffer, (void *) new_buf); - - switch_to_buffer (new_buf); - - unwind_protect_ptr (curr_sym_tab); - - reset_parser (); - - parse_status = yyparse (); - - // Important to reset the idea of where input is coming from before - // trying to eval the command we just parsed -- it might contain the - // name of an function file that still needs to be parsed! - - tree_statement_list *command = global_command; - - run_unwind_frame ("eval_string"); - - Octave_object retval; - - if (parse_status == 0 && command) - { - retval = command->eval (print, nargout); - delete command; - } - - return retval; -} - -tree_constant -eval_string (const char *string, int print, int& parse_status) -{ - tree_constant retval; - - Octave_object tmp = eval_string (string, print, parse_status, 1); - - retval = tmp(0); - - return retval; -} - -static Octave_object -eval_string (const tree_constant& arg, int& parse_status, int nargout) -{ - const char *string = arg.string_value (); - - if (error_state) - { - error ("eval: expecting string argument"); - return -1.0; - } - - // Yes Virginia, we always print here... - - return eval_string (string, 1, parse_status, nargout); -} - -DEFUN ("eval", Feval, Seval, 11, - "eval (TRY, CATCH)\n\ -\n\ -Evaluate the string TRY as octave code. If that fails, evaluate the\n\ -string CATCH.") -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin > 0) - { - begin_unwind_frame ("Feval"); - - if (nargin > 1) - { - unwind_protect_int (buffer_error_messages); - buffer_error_messages = 1; - } - - int parse_status = 0; - - retval = eval_string (args(0), parse_status, nargout); - - if (nargin > 1 && (parse_status != 0 || error_state)) - { - error_state = 0; - - // Set up for letting the user print any messages from - // errors that occurred in the first part of this eval(). - - buffer_error_messages = 0; - bind_global_error_variable (); - add_unwind_protect (clear_global_error_variable, 0); - - eval_string (args(1), parse_status, nargout); - - retval = Octave_object (); - } - - run_unwind_frame ("Feval"); - } - else - print_usage ("eval"); - - return retval; -} - -// Execute a shell command. - -DEFUN ("system", Fsystem, Ssystem, 11, - "system (string [, return_output]): execute shell commands") -{ - Octave_object retval; - - int nargin = args.length (); - - if (nargin < 1 || nargin > 2) - { - print_usage ("system"); - return retval; - } - - tree_constant tc_command = args(0); - - const char *tmp_str = tc_command.string_value (); - - if (error_state) - { - error ("system: expecting string as first argument"); - } - else - { - iprocstream *cmd = new iprocstream (tmp_str); - - add_unwind_protect (cleanup_iprocstream, cmd); - - int status = 127; - - if (cmd && *cmd) - { - ostrstream output_buf; - - char ch; - while (cmd->get (ch)) - output_buf.put (ch); - - output_buf << ends; - - status = cmd->close (); - - // The value in status is as returned by waitpid. If the - // process exited normally, extract the actual exit status of - // the command. Otherwise, return 127 as a failure code. - - if ((status & 0xff) == 0) - status = (status & 0xff00) >> 8; - - if (nargout > 0 || nargin > 1) - { - char *msg = output_buf.str (); - - retval(1) = (double) status; - retval(0) = msg; - - delete [] msg; - } - else - maybe_page_output (output_buf); - } - else - error ("unable to start subprocess for `%s'", tmp_str); - - run_unwind_protect (); - } - - return retval; -} - -DEFALIAS (shell_cmd, system); - -#if defined (__GNUG__) && defined (DEBUG_NEW_DELETE) -int debug_new_delete = 0; - -typedef void (*vfp)(void); -extern vfp __new_handler; - -void * -__builtin_new (size_t sz) -{ - void *p; - - /* malloc (0) is unpredictable; avoid it. */ - if (sz == 0) - sz = 1; - p = (void *) malloc (sz); - while (p == 0) - { - (*__new_handler) (); - p = (void *) malloc (sz); - } - - if (debug_new_delete) - cout << "__builtin_new: " << p << endl; - - return p; -} - -void -__builtin_delete (void *ptr) -{ - if (debug_new_delete) - cout << "__builtin_delete: " << ptr << endl; - - if (ptr) - free (ptr); -} -#endif - /* ;;; Local Variables: *** ;;; mode: C++ *** diff --git a/src/pinv.cc b/src/pinv.cc --- a/src/pinv.cc +++ b/src/pinv.cc @@ -36,7 +36,7 @@ #include "user-prefs.h" #include "utils.h" -DEFUN_DLD_BUILTIN ("pinv", Fpinv, Spinv, 10, +DEFUN_DLD_BUILTIN ("pinv", Fpinv, Spinv, FSpinv, 10, "pinv ( [, tol])\n\ Returns the pseudoinverse of X; singular values less than tol are ignored.") { diff --git a/src/qpsol.cc b/src/qpsol.cc --- a/src/qpsol.cc +++ b/src/qpsol.cc @@ -52,12 +52,12 @@ #endif #if defined (QPSOL_MISSING) -DEFUN_DLD_BUILTIN ("qpsol", Fqpsol, Sqpsol, 00, +DEFUN_DLD_BUILTIN ("qpsol", Fqpsol, Sqpsol, FSqpsol, 00, "This function requires QPSOL, which is not freely\n\ redistributable. For more information, read the file\n\ libcruft/qpsol/README.MISSING in the source distribution.") #else -DEFUN_DLD_BUILTIN ("qpsol", Fqpsol, Sqpsol, 11, +DEFUN_DLD_BUILTIN ("qpsol", Fqpsol, Sqpsol, FSqpsol, 11, "[X, OBJ, INFO, LAMBDA] = qpsol (X, H, C [, LB, UB] [, LB, A, UB])\n\ \n\ Groups of arguments surrounded in `[]' are optional, but\n\ @@ -385,12 +385,14 @@ #endif #if defined (QPSOL_MISSING) -DEFUN_DLD_BUILTIN ("qpsol_options", Fqpsol_options, Sqpsol_options, 00, +DEFUN_DLD_BUILTIN ("qpsol_options", Fqpsol_options, Sqpsol_options, + FSqpsol_options, 00, "This function requires QPSOL, which is not freely\n\ redistributable. For more information, read the file\n\ libcruft/qpsol/README.MISSING in the source distribution.") #else -DEFUN_DLD_BUILTIN ("qpsol_options", Fqpsol_options, Sqpsol_options, 10, +DEFUN_DLD_BUILTIN ("qpsol_options", Fqpsol_options, Sqpsol_options, + FSqpsol_options, 10, "qpsol_options (KEYWORD, VALUE)\n \n\ Set or show options for qpsol. Keywords may be abbreviated\n\ diff --git a/src/qr.cc b/src/qr.cc --- a/src/qr.cc +++ b/src/qr.cc @@ -37,7 +37,7 @@ #include "user-prefs.h" #include "utils.h" -DEFUN_DLD_BUILTIN ("qr", Fqr, Sqr, 11, +DEFUN_DLD_BUILTIN ("qr", Fqr, Sqr, FSqr, 11, "[Q, R] = qr (X): form Q unitary and R upper triangular such\n\ that Q * R = X\n\ \n\ diff --git a/src/quad.cc b/src/quad.cc --- a/src/quad.cc +++ b/src/quad.cc @@ -83,7 +83,7 @@ return retval; } -DEFUN_DLD_BUILTIN ("quad", Fquad, Squad, 11, +DEFUN_DLD_BUILTIN ("quad", Fquad, Squad, FSquad, 11, "[V, IER, NFUN] = quad (F, A, B [, TOL] [, SING])\n\ \n\ Where the first argument is the name of the function to call to\n\ @@ -353,7 +353,8 @@ return retval; } -DEFUN_DLD_BUILTIN ("quad_options", Fquad_options, Squad_options, 10, +DEFUN_DLD_BUILTIN ("quad_options", Fquad_options, Squad_options, + FSquad_options, 10, "quad_options (KEYWORD, VALUE)\n\ \n\ Set or show options for quad. Keywords may be abbreviated\n\ diff --git a/src/qzval.cc b/src/qzval.cc --- a/src/qzval.cc +++ b/src/qzval.cc @@ -56,7 +56,7 @@ const long&, double*); } -DEFUN_DLD_BUILTIN ("qzval", Fqzval, Sqzval, 11, +DEFUN_DLD_BUILTIN ("qzval", Fqzval, Sqzval, FSqzval, 11, "X = qzval (A, B)\n\ \n\ compute generalized eigenvalues of the matrix pencil (A - lambda B).\n\ diff --git a/src/rand.cc b/src/rand.cc --- a/src/rand.cc +++ b/src/rand.cc @@ -328,7 +328,7 @@ return retval; } -DEFUN_DLD_BUILTIN ("rand", Frand, Srand, 11, +DEFUN_DLD_BUILTIN ("rand", Frand, Srand, FSrand, 11, "rand -- generate a random value from a uniform distribution\n\ \n\ rand (N) -- generate N x N matrix\n\ @@ -362,7 +362,7 @@ F77_FCN (setcgn, SETCGN) (current_distribution); } -DEFUN_DLD_BUILTIN ("randn", Frandn, Srandn, 11, +DEFUN_DLD_BUILTIN ("randn", Frandn, Srandn, FSrandn, 11, "randn -- generate a random value from a normal distribution\n\ \n\ randn (N) -- generate N x N matrix\n\ diff --git a/src/schur.cc b/src/schur.cc --- a/src/schur.cc +++ b/src/schur.cc @@ -36,7 +36,7 @@ #include "user-prefs.h" #include "utils.h" -DEFUN_DLD_BUILTIN ("schur", Fschur, Sschur, 11, +DEFUN_DLD_BUILTIN ("schur", Fschur, Sschur, FSschur, 11, "[U, S] = schur (A) or S = schur (A)\n\ \n\ or, for ordered Schur:\n\ diff --git a/src/sort.cc b/src/sort.cc --- a/src/sort.cc +++ b/src/sort.cc @@ -309,7 +309,7 @@ return retval; } -DEFUN_DLD_BUILTIN ("sort", Fsort, Ssort, 11, +DEFUN_DLD_BUILTIN ("sort", Fsort, Ssort, FSsort, 11, "[S, I] = sort (X)\n\ \n\ sort the columns of X, optionally return sort index") diff --git a/src/svd.cc b/src/svd.cc --- a/src/svd.cc +++ b/src/svd.cc @@ -38,7 +38,7 @@ #include "user-prefs.h" #include "utils.h" -DEFUN_DLD_BUILTIN ("svd", Fsvd, Ssvd, 11, +DEFUN_DLD_BUILTIN ("svd", Fsvd, Ssvd, FSsvd, 11, "S = svd (X) or [U, S, V] = svd (X [, 0])\n\ \n\ Compute the singular value decomposition of X. Given a second input\n\ diff --git a/src/syl.cc b/src/syl.cc --- a/src/syl.cc +++ b/src/syl.cc @@ -57,7 +57,7 @@ int&, long, long); } -DEFUN_DLD_BUILTIN ("syl", Fsyl, Ssyl, 11, +DEFUN_DLD_BUILTIN ("syl", Fsyl, Ssyl, FSsyl, 11, "X = syl (A, B, C): solve the Sylvester equation A X + X B + C = 0") { Octave_object retval;