# HG changeset patch # User jwe # Date 1083349627 0 # Node ID 4a796c5fc7a3fb347c978c1f5a3029729ba87c16 # Parent bbddd4339cf23e80f12a3f40d92092001dfeaade [project @ 2004-04-30 18:27:07 by jwe] diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2004-04-30 John W. Eaton + + * oct-stream.cc (octave_base_stream::clear): Also clear stream state. + * oct-stdstrm.h (octave_stdiostream::clear): New function. + * c-file-ptr-stream.h (c_file_ptr_buf::clear, + i_c_file_ptr_stream::clear, o_c_file_ptr_stream::clear, + io_c_file_ptr_stream::clear): New functions. + 2004-04-29 David Bateman * load-save.cc (Fload, Fsave): Accept -mat as well as -mat-binary. diff --git a/src/DLD-FUNCTIONS/dassl.cc b/src/DLD-FUNCTIONS/dassl.cc --- a/src/DLD-FUNCTIONS/dassl.cc +++ b/src/DLD-FUNCTIONS/dassl.cc @@ -226,13 +226,12 @@ + c {\\partial f \\over \\partial \\dot{x}}\n\ $$\n\ @end tex\n\ +@example\n\ @ifinfo\n\ df df\n\ jac = -- + c ------\n\ dx d xdot\n\ -@example\n\ @end example\n\ -\n\ @end ifinfo\n\ \n\ The modified Jacobian function must have the form\n\ diff --git a/src/DLD-FUNCTIONS/odessa.cc b/src/DLD-FUNCTIONS/odessa.cc --- a/src/DLD-FUNCTIONS/odessa.cc +++ b/src/DLD-FUNCTIONS/odessa.cc @@ -400,8 +400,8 @@ If the computation is not successful, @var{istate} will be something\n\ other than 2 and @var{msg} will contain additional information.\n\ \n\ -You can use the function @code{lsode_options} to set optional\n\ -parameters for @code{lsode}.\n\ +You can use the function @code{odessa_options} to set optional\n\ +parameters for @code{odessa}.\n\ @end deftypefn\n\ @seealso{daspk, dassl, dasrt, lsode}") { diff --git a/src/c-file-ptr-stream.h b/src/c-file-ptr-stream.h --- a/src/c-file-ptr-stream.h +++ b/src/c-file-ptr-stream.h @@ -82,6 +82,8 @@ long tell (void) { return f ? ftell (f) : -1; } + void clear (void) { if (f) clearerr (f); } + static int fclose (FILE *f) { return ::fclose (f); } protected: @@ -115,6 +117,8 @@ long tell (void) { return buf ? buf->tell () : -1; } + void clear (void) { if (buf) buf->clear (); std::istream::clear (); } + private: c_file_ptr_buf *buf; @@ -140,6 +144,8 @@ long tell (void) { return buf ? buf->tell () : -1; } + void clear (void) { if (buf) buf->clear (); std::ostream::clear (); } + private: c_file_ptr_buf *buf; @@ -165,6 +171,8 @@ long tell (void) { return buf ? buf->tell () : -1; } + void clear (void) { if (buf) buf->clear (); std::iostream::clear (); } + private: c_file_ptr_buf *buf; @@ -177,4 +185,3 @@ ;;; mode: C++ *** ;;; End: *** */ - diff --git a/src/oct-stream.cc b/src/oct-stream.cc --- a/src/oct-stream.cc +++ b/src/oct-stream.cc @@ -935,6 +935,15 @@ void octave_base_stream::clear (void) { + std::istream *is = input_stream (); + std::ostream *os = output_stream (); + + if (is) + is->clear (); + + if (os) + os->clear (); + fail = false; errmsg = ""; }