📄 readme
字号:
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, exceptwhere explicitly noted. Note that some code is derivedfrom 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.* Full implementation of the streambuf layer of AT&T'siostream library for C++. (Mostly done.)* Impementation of most of the iostream layer of AT&T'siostream library. I will track the ANSI standard, andimplement more as the details get firmer.* If you use the stdio library, you get full compatibilitybetween stdio and streambufs.All stdio routines are implemented by coering the(FILE*) argument to a (streambuf*), and then doingstreambuf 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 needto 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 parsingand scanning text: It keeps track of line numbers, and providesfull access to the current input line with arbitrary seeks andunget/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 allowsany number of streams to read or write in a buffer or a sub-string.INSTALLATION:If you have complete distribution of libg++, it will configureiostreams for you (as part of configuring libg++), soyou can just do a: makeIf you have a standalone distribution of iostream (not part oflibg++), then do: configure <HOST>where <HOST> might be (say) sun4: configure sun4Then just: makeSend bug reports to Per Bothner, bothner@cygnus.com.STDIOThe stdio sub-directory contains a mostly complete implementationof ANSI-compatible stdio. It uses the iostream library.By default, this implementation is not installed, normade part of libio.a or libg++.a, because most people probablyprefer to use the existing stdio in their libc.If you do want to this this implementation of stdio, note thereis a "binary compatibilty feature" that allows it to work withobject files and libraries that have been compiled for adifferent stdio implementation. However, this uses an unportabletrick that assumes a "traditional" layout of (struct _iob).See the file stdio/emulate.C for details.Also, there is still a problem if when linking yousearch libio.a before libc.a, if you use routines inlibc.a that need stdio routines that you don't calldirectly. In that case the libc version of the stdioroutine will be linked in, and it might not work here.Some hacking may be needed to avoid these propblems.Furthermore, the emulation may be slower (it works bytricking putc and getc to call a subroutine on each character.Ideally, iostream should be be integrated with a complete libcimplementation, replacing the stdio portion of the library;this has been done in the Linux system.You may also need to hack streambuf.C if you prefer analternative way to forcing flushes (via the call to flush_all())on exit(). The current scheme uses a static destructor for thevariable io_defs__ which is of the dummy class __io_defs.The disadvantage is that it requires that the main program be a C++file (unless you use gcc-2.x), so this is not suitable if you wantto use iostream as the default implementation of stdio(again, unless you're using gcc-2.x).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -