Mercurial > hg > octave-nkf
changeset 2630:fdee6fe3e73b
[project @ 1997-01-27 19:08:47 by jwe]
author | jwe |
---|---|
date | Mon, 27 Jan 1997 19:09:52 +0000 |
parents | 20704e7e5e79 |
children | 0774c3f023e8 |
files | ChangeLog configure.in install-octave src/ChangeLog src/oct-conf.h.in src/sysdep.cc src/toplev.cc |
diffstat | 7 files changed, 82 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ Mon Jan 27 00:10:10 1997 John W. Eaton <jwe@bevo.che.wisc.edu> + * configure.in: Add check for usleep(). * Makefile.in: Delete `internal' targets. (static-binary-dist, dynamic-binary-dist): Special cases.
--- a/configure.in +++ b/configure.in @@ -21,7 +21,7 @@ ### Software Foundation, 59 Temple Place - Suite 330, Boston, MA ### 02111-1307, USA. -AC_REVISION($Revision: 1.249 $) +AC_REVISION($Revision: 1.250 $) AC_PREREQ(2.9) AC_INIT(src/octave.cc) AC_CONFIG_HEADER(config.h) @@ -724,7 +724,7 @@ lstat memmove mkdir mkfifo on_exit pipe putenv rename rindex rmdir \ setgrent setpwent setvbuf sigaction sigpending sigprocmask \ sigsuspend stat strcasecmp strdup strerror stricmp strncasecmp \ - strnicmp tempnam umask unlink vfprintf vsprintf waitpid) + strnicmp tempnam umask unlink usleep vfprintf vsprintf waitpid) OCTAVE_SMART_PUTENV OCTAVE_PROGRAM_INVOCATION_NAME
--- a/install-octave +++ b/install-octave @@ -226,13 +226,15 @@ cp $f $octfiledir/$file chmod 755 $octfiledir/$file done -cat links-to-make | while read src dest -do - if test -n "$src" && test -n "$dest"; then - cd $octfiledir - ln $src $dest - fi -done +if test -f links-to-make; then + cat links-to-make | while read src dest + do + if test -n "$src" && test -n "$dest"; then + cd $octfiledir + ln $src $dest + fi + done +fi cd $distdir echo "installing .m files in $fcnfiledir"
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +Mon Jan 27 12:12:03 1997 John W. Eaton <jwe@bevo.che.wisc.edu> + + * sysdep.cc (Fsleep): New function. + (Fusleep): New function. + + * toplev.cc (octave_config_info): Don't include RLD_FLAG. + * oct-conf.h.in: Don't define RLD_FLAG + Sun Jan 26 19:41:48 1997 John W. Eaton <jwe@bevo.che.wisc.edu> * sighandlers.cc (sigchld_handler): Block SIGCHLD while
--- a/src/oct-conf.h.in +++ b/src/oct-conf.h.in @@ -104,10 +104,6 @@ #define LIBFLAGS %LIBFLAGS% #endif -#ifndef RLD_FLAG -#define RLD_FLAG %RLD_FLAG% -#endif - #ifndef CXXLIBS #define CXXLIBS %CXXLIBS% #endif
--- a/src/sysdep.cc +++ b/src/sysdep.cc @@ -521,6 +521,8 @@ { if (xisnan (dval)) warning ("pause: NaN is an invalid delay"); + else if (xisinf (dval)) + kbhit (); else { int delay = NINT (dval); @@ -530,10 +532,68 @@ } } else + kbhit (); + + return retval; +} + +DEFUN (sleep, args, , + "sleep (seconds): suspend program execution") +{ + octave_value_list retval; + + if (args.length () == 1) { - if (kbhit () == EOF) - clean_up_and_exit (0); + double dval = args(0).double_value (); + + if (! error_state) + { + if (xisnan (dval)) + warning ("sleep: NaN is an invalid delay"); + else + { + int delay = NINT (dval); + if (delay > 0) + sleep (delay); + } + } } + else + print_usage ("sleep"); + + return retval; +} + +DEFUN (usleep, args, , + "usleep (microseconds): suspend program execution") +{ + octave_value_list retval; + + if (args.length () == 1) + { + double dval = args(0).double_value (); + + if (! error_state) + { + if (xisnan (dval)) + warning ("usleep: NaN is an invalid delay"); + else + { + int delay = NINT (dval); +#if defined (HAVE_USLEEP) + if (delay > 0) + usleep (delay); +#else + // Kluge alert. + + if (delay > 500000) + sleep (delay / 1000000); +#endif + } + } + } + else + print_usage ("usleep"); return retval; }