home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / GCC / GERLIB_DEV08B.LHA / gerlib / libg++ / iostream / README < prev    next >
Encoding:
Text File  |  1993-12-12  |  4.0 KB  |  98 lines

  1. This package is an in-progess implementation of the C++
  2. iostream library, as well as an implementation of C stdio.
  3.  
  4. The entire package is Copyright Per Bothner 1992, except
  5. where explicitly noted.  Note that some code is derived
  6. from the Chris Torek's stdio implementation for BSD 4.4,
  7. developed by the University of California, Berkeley.
  8. I have not put copyright notices in all of the files yet.
  9. The licensing terms are those of the GNU Library License.
  10. If those terms are unacceptable, contact me;
  11. we can probably work out an alternative.
  12.  
  13. The package is far from complete, but it allows useful work.
  14. See the TODO file for list of things missing.
  15.  
  16. FEATURES:
  17.  
  18. * Full implementation of ANSI C stdio.
  19. * Full implementation of the streambuf layer of AT&T's
  20. iostream library for C++. (Mostly done.)
  21. * Impementation of most of the iostream layer of AT&T's
  22. iostream library. I will track the ANSI standard, and
  23. implement more as the details get firmer.
  24. * If you use the stdio library, you get full compatibility
  25. between stdio and streambufs.
  26. All stdio routines are implemented by coering the
  27. (FILE*) argument to a (streambuf*), and then doing
  28. streambuf operations.  You can do the same: For example,
  29. if you have a streambuf* sb, you can do fprintf((FILE*)sb, ...).
  30. Also, (streambuf*)stdin == cin->rdbuf(), so you never need
  31. to synchonize streams and stdio.
  32. * Binary compatibility with the old _iob implementation of stdio.
  33. Thus you can link with libraries compiled for old C libraries.
  34. (There is also binary compatibility with the unreleased GNU libc.)
  35. * A parsebuf sub-class of streambuf that is tailored for parsing
  36. and scanning text:  It keeps track of line numbers, and provides
  37. full access to the current input line with arbitrary seeks and
  38. unget/putback within the current line.
  39. * A string buffer class using an Emacs-style buffer gap.
  40. It provides first-class sub-strings and buffer markers.
  41. There is also an editbuf sub-class of streambuf that allows
  42. any number of streams to read or write in a buffer or a sub-string.
  43.  
  44. INSTALLATION:
  45.  
  46. If you have complete distribution of libg++, it will configure
  47. iostreams for you (as part of configuring libg++), so
  48. you can just do a:
  49.     make
  50.  
  51. If you have a standalone distribution of iostream (not part of
  52. libg++), then do:
  53.     configure <HOST>
  54. where <HOST> might be (say) sun4:
  55.     configure sun4
  56. Then just:
  57.     make
  58.  
  59. Send bug reports to Per Bothner, bothner@cygnus.com.
  60.  
  61. STDIO
  62.  
  63. The stdio sub-directory contains a mostly complete implementation
  64. of ANSI-compatible stdio.  It uses the iostream library.
  65.  
  66. By default, this implementation is not installed, nor
  67. made part of libio.a or libg++.a, because most people probably
  68. prefer to use the existing stdio in their libc.
  69.  
  70. If you do want to this this implementation of stdio, note there
  71. is a "binary compatibilty feature" that allows it to work with
  72. object files and libraries that have been compiled for a
  73. different stdio implementation.  However, this uses an unportable
  74. trick that assumes a "traditional" layout of (struct _iob).
  75. See the file stdio/emulate.C for details.
  76.  
  77. Also, there is still a problem if when linking you
  78. search libio.a before libc.a, if you use routines in
  79. libc.a that need stdio routines that you don't call
  80. directly.  In that case the libc version of the stdio
  81. routine will be linked in, and it might not work here.
  82. Some hacking may be needed to avoid these propblems.
  83. Furthermore, the emulation may be slower (it works by
  84. tricking putc and getc to call a subroutine on each character.
  85.  
  86. Ideally, iostream should be be integrated with a complete libc
  87. implementation, replacing the stdio portion of the library;
  88. this has been done in the Linux system.
  89.  
  90. You may also need to hack streambuf.C if you prefer an
  91. alternative way to forcing flushes (via the call to flush_all())
  92. on exit().  The current scheme uses a static destructor for the
  93. variable io_defs__ which is of the dummy class __io_defs.
  94. The disadvantage is that it requires that the main program be a C++
  95. file (unless you use gcc-2.x), so this is not suitable if you want
  96. to use iostream as the default implementation of stdio
  97. (again, unless you're using gcc-2.x).
  98.