This package is an in-progess implementation of the C++
iostream library, as well as an implementation of C stdio.

The entire package is Copyright Per Bothner 1992, except
where explicitly noted.  Note that some code is derived
from the Chris Torek's stdio implementation for BSD 4.4,
developed by the University of California, Berkeley.
I have not put copyright notices in all of the files yet.
The licensing terms are those of the GNU Library License.
If those terms are unacceptable, contact me;
we can probably work out an alternative.

The package is far from complete, but it allows useful work.
See the TODO file for list of things missing.

FEATURES:

* Full implementation of ANSI C stdio. (Mostly done.)
* Full implementation of the streambuf layer of AT&T's
iostream library for C++. (Mostly done.)
* Impementation of most of the iostream layer of AT&T's
iostream library. I will track the ANSI standard, and
implement more as the details get firmer.
* If you use the stdio library, you get full compatibility
between stdio and streambufs.
All stdio routines are implemented by coering the
(FILE*) argument to a (streambuf*), and then doing
streambuf operations.  You can do the same: For example,
if you have a streambuf* sb, you can do fprintf((FILE*)sb, ...).
Also, (streambuf*)stdin == cin->rdbuf(), so you never need
to synchonize streams and stdio.
* Binary compatibility with the old _iob implementation of stdio.
Thus you can link with libraries compiled for old C libraries.
(There is also binary compatibility with the unreleased GNU libc.)
* A parsebuf sub-class of streambuf that is tailored for parsing
and scanning text:  It keeps track of line numbers, and provides
full access to the current input line with arbitrary seeks and
unget/putback within the current line.
* A string buffer class using an Emacs-style buffer gap.
It provides first-class sub-strings and buffer markers.
There is also an editbuf sub-class of streambuf that allows
any number of streams to read or write in a buffer or a sub-string.

INSTALLATION:

If you have complete distribution of libg++, it will configure
iostreams for you (as part of configuring libg++), so
you can just do a:
	make

If you have a standalone distribution of iostream (not part of
libg++), then do:
	configure <HOST>
where <HOST> might be (say) sun4:
	configure sun4
Then just:
	make

STDIO

The stdio sub-directory contains a mostly complete implementation
of ANSI-compatible stdio.  It uses the iostream library.

Note that the default configuration redefines the stdio part of libc.
This may cause problems with routines in libc that call stdio
routines; they may get the wrong (libc) version.
Ideally, iostream should be be integrated with some libc
implementation, replacing the stdio portion of the library;
that has not been done yet.  If you don't want the iostream stdio
implementation at all, follow the instruction in the section below.

The (OBSOLETE) file ioconfig.h is intended to contain configuration flags.
You may also want to hack streambuf.C if you prefer an
alternative way to forcing flushes (via the call to flush_all())
on exit().  The current scheme uses a static destructor for the
variable io_defs__ which is of the dummy class __io_defs.
The disadvantage is that it requires that the main program be a C++ file,
so this is not suitable if you want to use iostream as the
default implementation of stdio.

INSTALLING WITHOUT THE STDIO IMPLEMENTATION:

By default, the library includes a almost-complete implementation
of the stdio library for ANSI standard C.  It includes an
emulation trick so that you can use this implementation
of stdio with files and libraries that have been compiled
for some other implementation.  See the file emulate.C
for details.

However, there is still a problem if when linking you
search libio.a before libc.a, if you use routines in
libc.a that need stdio routines that you don't call
directly.  In that case the libc version of the stdio
routine will be linked in, and it might not work here.
Futhermore, the emulation may be slower (it works
by tricking putc and getc to call a subroutine on
each character.  For these reasons you may prefer to
create a version of libio.a without the stdio stuff.

Send bug reports to Per Bothner, bothner@cygnus.com.
Also, send Makefiles for other configurations.
