# HG changeset patch # User jwe # Date 837744829 0 # Node ID 4a9feb84912559f7aa500f2b7bb6153ac6c73846 # Parent 893481f3a763f2eda6628cb64a4e448906c6b9d9 [project @ 1996-07-19 02:51:02 by jwe] Initial revision diff --git a/ck-oct-fcns.m b/ck-oct-fcns.m new file mode 100644 --- /dev/null +++ b/ck-oct-fcns.m @@ -0,0 +1,41 @@ +# Script to check for dependency on whitespace_in_literal_matrix. +# +# Use with a command like this: +# +# find . -name '*.m' -print | \ +# sed -e 's,^.*/,,' -e 's,\.m$,,' | \ +# octave --norc --silent --path "`pwd`//:" ~/check_octave_functions +# +# Originally by R. D. Auchterlounie + +1; # Don't interpret this a file that defines a single function. + +function t = wlm_check (wlm, fname) + whitespace_in_literal_matrix = wlm; + bc = "printf (\" %s\", wlm)"; + eval (["t = type ", fname, ";"], ["t = \"failed\";", bc]); +endfunction + +while (isstr (fname = fgets (stdin, 100))) + + # Someone should improve Octave's string handling capabilities! + + tmp = toascii (fname); + tmp (length (tmp)) = 0; + fname = setstr (tmp); + + printf ("checking %s ...", fname); + + eval (["clear ", fname]); trd = wlm_check ("traditional", fname); + eval (["clear ", fname]); ign = wlm_check ("ignore", fname); + eval (["clear ", fname]); def = wlm_check ("default", fname); + + if (strcmp (trd, "failed") + || strcmp (ign, "failed") + || strcmp (def, "failed")) + printf (" FAILED\n"); + else + printf (" ok\n"); + endif + +endwhile diff --git a/demo.m b/demo.m new file mode 100644 --- /dev/null +++ b/demo.m @@ -0,0 +1,69 @@ +# Octave demo + +# This is not a function file. +1; + +function demo_clear () + clc (); +endfunction + +function demo_set_term () + term = getenv ("TERM"); + display = getenv ("DISPLAY"); + if (! strcmp (term, "xterm") || columns (display) == 0) + graphics_terminal = input ("enter graphics terminal type: ", "s"); + command = sprintf ("set term %s", graphics_terminal); + eval (command); + endif +endfunction + +function demo_graphics () + demo_clear (); + demo_set_term () + demo_clear (); + printf ("Graphics\n"); + fflush (stdout); + sombrero (31); + pause (10); + printf ("press return to continue\n"); + fflush (stdout); + pause (); +endfunction + +function demo_linear_algebra () + demo_clear (); + printf ("Solving Linear Algebra Problems\n"); + fflush (stdout); + pause (); +endfunction + +function demo_odes () + demo_clear (); + printf ("Solving ODEs and DAEs\n"); + fflush (stdout); + pause (); +endfunction + +while (1) + + demo_clear (); + + choice = menu ("Octave\n======\n\n", ... + "Graphics", ... + "Linear Algebra", ... + "ODEs and DAEs", ... + "Exit"); + + if (choice == 1) + demo_graphics (); + elseif (choice == 2) + demo_linear_algebra (); + elseif (choice == 3) + demo_odes (); + elseif (choice == 4) + printf ("\nGoodbye and good luck!\n\n"); + fflush (stdout); + break; + endif + +endwhile diff --git a/diff-template b/diff-template new file mode 100644 --- /dev/null +++ b/diff-template @@ -0,0 +1,61 @@ +#!/bin/sh +# +# To apply this patch, cd to the top level Octave source directory and +# run this file through /bin/sh. It will first remove any files that +# have been deleted from the source distribution since the last +# release and then update the sources with patch(1). +# +# Diffs for updating *.ps, *.dvi, and *.info* files are not included +# because they can be recreated from the Texinfo files using TeX and +# makeinfo. +# +# Diffs for updating parse.cc and y.tab.h are not included because +# they can be recreated from the file parse.y using bison. +# +# Diffs for updating lex.cc are not included because it can be +# recreated from lex.l using flex. +# +# Diffs for updating the configure script are not included because +# it can be recreated from configure.in using autoconf. +# +# John W. Eaton +# jwe@bevo.che.wisc.edu +# University of Wisconsin-Madison +# Department of Chemical Engineering + +if test -f src/octave.cc ; then + true +else + echo '***********************************************************' 1>&2 + echo 'You must run this script in the top-level octave directory!' 1>&2 + echo '***********************************************************' 1>&2 + exit 1 +fi + +echo 'removing the bsd-math directory' +rm -rf bsd-math + +echo 'creating libcruft/slatec-fn directory' +mkdir libcruft/slatec-fn + +echo 'removing old test files' +rm -f test/octave.test/index.exp +rm -f test/octave.test/prefer.exp +rm -f test/octave.test/zero-one.exp + +echo 'creating directories for new test files' +mkdir test/octave.test/index/dfi-f +mkdir test/octave.test/index/dfi-t +mkdir test/octave.test/prefer +mkdir test/octave.test/zero-one/fff +mkdir test/octave.test/zero-one/fft +mkdir test/octave.test/zero-one/ftf +mkdir test/octave.test/zero-one/tff +mkdir test/octave.test/zero-one/ftt +mkdir test/octave.test/zero-one/tft +mkdir test/octave.test/zero-one/ttf +mkdir test/octave.test/zero-one/ttt + +echo 'patching existing files' +patch -p1 << \PATCH_EOF +PATCH_EOF diff --git a/src/mkbuiltins b/src/mkbuiltins new file mode 100755 --- /dev/null +++ b/src/mkbuiltins @@ -0,0 +1,34 @@ +#!/bin/sh + +cat << \EOF +// DO NOT EDIT! Generated automatically by mkbuiltins. + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "builtins.h" +#include "mappers.h" +#include "oct-obj.h" +#include "variables.h" + +static void +install_builtin_functions (void) +{ +EOF + +cat "$@" + +cat << \EOF +} + +void +install_builtins (void) +{ + install_builtin_variables (); + install_mapper_functions (); + install_builtin_functions (); +} +EOF + +exit 0 diff --git a/src/mkdefs b/src/mkdefs new file mode 100755 --- /dev/null +++ b/src/mkdefs @@ -0,0 +1,12 @@ +#!/bin/sh + +sed -n -e '/^BEGIN_INSTALL_BUILTIN/{ + : loop + N + /END_INSTALL_BUILTIN/b done + b loop + : done + s/BEGIN_INSTALL_BUILTIN// + s/END_INSTALL_BUILTIN// + p +}'