gcc/libstdc++-v3/include/std
Paolo Carlini 71b460210a Nathan C.
2003-06-24  Paolo Carlini  <pcarlini@unitus.it>
            Nathan C. Myers  <ncm-nospam@cantrip.org>

	* include/std/std_fstream.h (_M_filepos): Remove.
	(_M_reading, _M_writing): New, encode the various I/O modes:
	'read', 'write' and 'uncommitted'.
	(sync): If there is something to flush, do it, then go to
	'uncommitted' mode.
	* include/bits/fstream.tcc (_M_set_buffer): Overhaul to deal
	with three different cases: __off > 0 (upon underflow),
	__off == 0 (upon overflow), __off == -1 (upon open, setbuf,
	seekoff/pos).
	(_M_underflow): Don't call overflow, set _M_reading to true
	on success, tweak.
	(pbackfail): Set _M_reading to true on pback creation, tweak.
	(overflow): Don't seek, deal with overflow in 'uncommitted' mode,
	set _M_writing to true on success, tweak.
	(seekoff): Simplify, set _M_reading, _M_writing to false, call
	_M_set_buffer(-1) ('uncommitted').
	(open, close, setbuf): Set _M_reading, _M_writing to false and
	call _M_set_buffer(-1), tweak.
	(basic_filebuf): Don't set _M_buf_unified.
	(_M_destroy_internal_buffer): Don't call setg and setp.
	* include/ext/stdio_filebuf.h (stdio_filebuf): Use _M_reading,
	_M_writing and _M_set_buffer(-1).
	* include/std/std_streambuf.h (_M_move_out_cur, _M_move_in_cur,
	_M_out_lim, _M_buf_unified): Remove.
	(basic_streambuf): Don't set _M_out_lim and _M_buf_unified.
	(setp): Don't set _M_out_lim.
	* testsuite/27_io/basic_filebuf/sbumpc/char/1-io.cc: Fix for
	the new logic ('read', 'write' and 'uncommitted' modes): e.g.,
	upon open the mode is 'uncommitted' and therefore the put area
	pointers are null.
	* testsuite/27_io/basic_filebuf/sbumpc/char/1-out.cc: Ditto.
	* testsuite/27_io/basic_filebuf/seekoff/char/3-io.cc: Ditto.
	* testsuite/27_io/basic_filebuf/seekpos/char/3-io.cc: Ditto.
	* testsuite/27_io/basic_filebuf/setbuf/char/1.cc: Ditto.
	* testsuite/27_io/basic_filebuf/sgetc/char/1-io.cc: Ditto.
	* testsuite/27_io/basic_filebuf/sgetc/char/1-out.cc: Ditto.
	* testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc: Ditto.
	* testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc: Ditto.
	* testsuite/27_io/basic_filebuf/snextc/char/1-io.cc: Ditto.
	* testsuite/27_io/basic_filebuf/snextc/char/1-out.cc: Ditto.
	* testsuite/27_io/basic_filebuf/sputbackc/char/1-io.cc: Ditto.
	* testsuite/27_io/basic_filebuf/sputbackc/char/1-out.cc: Ditto.
	* testsuite/27_io/basic_filebuf/sputc/char/1-io.cc: Ditto.
	* testsuite/27_io/basic_filebuf/sputc/char/1-out.cc: Ditto.
	* testsuite/27_io/basic_filebuf/sputc/char/9701-2.cc: Ditto.
	* testsuite/27_io/basic_filebuf/sputn/char/1-io.cc: Ditto.
	* testsuite/27_io/basic_filebuf/sputn/char/1-out.cc: Ditto.
	* testsuite/27_io/basic_filebuf/sputn/char/9701-1.cc: Ditto.
	* testsuite/27_io/basic_filebuf/sungetc/char/1-io.cc: Ditto.
	* testsuite/27_io/basic_filebuf/sungetc/char/1-out.cc: Ditto.

	* include/bits/fstream.tcc (showmanyc): Use only the
	documented derivation interface to basic_streambuf (gptr(),
	setg(), etc.) to work right with user specializations.
	* include/bits/streambuf.tcc (sbumpc, sputbackc, sungetc,
	sputc, xsgetn, xsputn, __copy_streambufs): Likewise.
	* include/std/std_streambuf.h (in_avail, sgetc, uflow, stossc):
	Likewise.
	* include/std/std_fstream.h (_M_create_pback, _M_destroy_pback,
	xsgetn): Likewise.

Co-Authored-By: Nathan C. Myers <ncm-nospam@cantrip.org>

From-SVN: r68420
2003-06-24 13:48:11 +00:00
..
std_algorithm.h Makefile.am (doxygen, [...]): Tweak targets. 2002-01-28 22:13:12 +00:00
std_bitset.h BUGS: Update from 2.90.8 snapshot. 2003-06-10 21:52:25 +00:00
std_complex.h re PR libstdc++/10689 (pow(std::complex(0),1/3) returns (nan, nan) instead of 0.) 2003-05-20 06:52:11 +00:00
std_deque.h [multiple changes] 2003-06-11 15:52:11 +00:00
std_fstream.h Nathan C. 2003-06-24 13:48:11 +00:00
std_functional.h Makefile.am (doxygen, [...]): Tweak targets. 2002-01-28 22:13:12 +00:00
std_iomanip.h c++config (_GLIBCPP_EXTERN_TEMPLATE): Define. 2003-02-13 21:39:03 +00:00
std_ios.h Makefile.am (doxygen, [...]): Tweak targets. 2002-01-28 22:13:12 +00:00
std_iosfwd.h Revert include ordering. 2003-01-23 18:56:00 +00:00
std_iostream.h TODO: Note change in clause 27 docs. 2002-11-21 07:06:41 +00:00
std_istream.h std_istream.h, [...]: Typo in comment. 2003-05-27 14:29:39 +01:00
std_iterator.h Makefile.am (doxygen, [...]): Tweak targets. 2002-01-28 22:13:12 +00:00
std_limits.h Intro.3: Update with new (proper) names. 2003-02-26 00:02:16 +00:00
std_list.h [multiple changes] 2003-06-11 15:52:11 +00:00
std_locale.h locale_facets.h: Move non-facet classes requiring <string> to... 2003-01-22 16:51:52 +00:00
std_map.h Makefile.am (doxygen, [...]): Tweak targets. 2002-01-28 22:13:12 +00:00
std_memory.h [multiple changes] 2003-06-11 15:52:11 +00:00
std_numeric.h Makefile.am (doxygen, [...]): Tweak targets. 2002-01-28 22:13:12 +00:00
std_ostream.h std_istream.h, [...]: Typo in comment. 2003-05-27 14:29:39 +01:00
std_queue.h [multiple changes] 2003-06-11 15:52:11 +00:00
std_set.h Makefile.am (doxygen, [...]): Tweak targets. 2002-01-28 22:13:12 +00:00
std_sstream.h Nathan C. 2003-06-22 18:37:10 +00:00
std_stack.h [multiple changes] 2003-06-11 15:52:11 +00:00
std_stdexcept.h Makefile.am (doxygen, [...]): Tweak targets. 2002-01-28 22:13:12 +00:00
std_streambuf.h Nathan C. 2003-06-24 13:48:11 +00:00
std_string.h Makefile.am (doxygen, [...]): Tweak targets. 2002-01-28 22:13:12 +00:00
std_utility.h Makefile.am (doxygen, [...]): Tweak targets. 2002-01-28 22:13:12 +00:00
std_valarray.h valarray_meta.h: Remove, split into ... 2003-01-24 16:32:11 +00:00
std_vector.h [multiple changes] 2003-06-11 15:52:11 +00:00