Mercurial > hg > octave-terminal
changeset 2599:9705ea40f0a2
[project @ 1996-12-19 04:49:09 by jwe]
author | jwe |
---|---|
date | Thu, 19 Dec 1996 04:49:28 +0000 |
parents | 36a4daa9e3c7 |
children | c454cd888ada |
files | liboctave/ChangeLog liboctave/Range.cc liboctave/Range.h src/ChangeLog src/file-io.cc src/ov-range.cc src/ov-range.h |
diffstat | 7 files changed, 47 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,5 +1,7 @@ Wed Dec 18 16:18:58 1996 John W. Eaton <jwe@bevo.che.wisc.edu> + * Range.cc (operator -): New function. + * lo-ieee.cc: Include <nan.h> on all systems that have it. Fri Dec 13 02:01:32 1996 John W. Eaton <jwe@bevo.che.wisc.edu>
--- a/liboctave/Range.cc +++ b/liboctave/Range.cc @@ -150,6 +150,12 @@ return is; } +Range +operator - (const Range& r) +{ + return Range (-r.base (), -r.limit (), -r.inc ()); +} + // C See Knuth, Art Of Computer Programming, Vol. 1, Problem 1.2.4-5. // C // C===Tolerant FLOOR function.
--- a/liboctave/Range.h +++ b/liboctave/Range.h @@ -85,6 +85,8 @@ int nelem_internal (void) const; }; +extern Range operator - (const Range& r); + #endif /*
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ Wed Dec 18 20:17:23 1996 John W. Eaton <jwe@bevo.che.wisc.edu> + * file-io.cc (Ffgetl, Ffgets): Also return number of characters read. + + * ov-range.cc (octave_range::not): New function. + * ov-range.h (octave_range::uminus): New function. + * BaseSLList.cc: Include error.h. (BaseSLList::error): Call ::error() to process error message.
--- a/src/file-io.cc +++ b/src/file-io.cc @@ -182,11 +182,14 @@ } DEFUN (fgetl, args, , - "STRING = fgetl (FILENUM [, LENGTH])\n\ + "[STRING, LENGTH] = fgetl (FILENUM [, LENGTH])\n\ \n\ read a string from a file") { - octave_value retval = -1.0; + octave_value_list retval; + + retval(1) = 0.0; + retval(0) = -1.0; int nargin = args.length (); @@ -204,7 +207,10 @@ string tmp = os->getl (len_arg, err); if (! err) - retval = tmp; + { + retval(1) = (double) tmp.length (); + retval(0) = tmp; + } } else gripe_invalid_file_id ("fgetl"); @@ -216,11 +222,14 @@ } DEFUN (fgets, args, , - "STRING = fgets (FILENUM [, LENGTH])\n\ + "[STRING, LENGTH] = fgets (FILENUM [, LENGTH])\n\ \n\ read a string from a file") { - octave_value retval = -1.0; + octave_value_list retval; + + retval(1) = 0.0; + retval(0) = -1.0; int nargin = args.length (); @@ -238,7 +247,10 @@ string tmp = os->gets (len_arg, err); if (! err) - retval = tmp; + { + retval(1) = (double) tmp.length (); + retval(0) = tmp; + } } else gripe_invalid_file_id ("fgets"); @@ -338,7 +350,9 @@ If fopen fails, FILENUM is set to -1 and ERRMSG contains a\n\ system-dependent error message") { - octave_value_list retval = -1.0; + octave_value_list retval; + + retval(0) = -1.0; int nargin = args.length ();