Annotation of researchv10no/cmd/cfront/libC/ooiostream/README, revision 1.1

1.1     ! root        1: 
        !             2: Cycle 13
        !             3: 
        !             4: Change typedef in strstream.c to avoid use of size_t.  (This is
        !             5: because of header file compatibility problems.)
        !             6: 
        !             7: Change exit(10) to abort() in oldformat.c.
        !             8: 
        !             9: Cycle 12
        !            10: 
        !            11: Put in include of <iostream.h> in strstream.h
        !            12: 
        !            13: Change istream::get() so that it really gets expanded inline.
        !            14: Previous definition was being outlined.
        !            15: 
        !            16: Reorder declarations so that ipfx comes before any operator>>. Not
        !            17: just before the ones that have inline code refering to it. The old
        !            18: ordering was resulting in a failure to expand ipfx where it should
        !            19: have been.
        !            20: 
        !            21: Move declaration of ios_user_union higher in stream.c in order to
        !            22: eliminate a new warning message.
        !            23: 
        !            24: Change values of O_CREAT O_TRUNC O_EXCL in cases where headers don't
        !            25: define them (the only known such system is V9)
        !            26: 
        !            27: Fix ostream::out_waiting.  It was just returning non-zero when there was stuff
        !            28: accumulated but not consumed.  It was supposed to return the number
        !            29: (at least according to the man page.)
        !            30: 
        !            31: -----------------------------------------------------
        !            32: Cycle 11
        !            33: 
        !            34: Change cstreams.c for change to way explicit placement works.
        !            35: 
        !            36: Implement bidirectional strstream. 
        !            37: 
        !            38: ----------------------------------------------------
        !            39: Cycle 9 
        !            40: 
        !            41: Fix bug in void* inserter.  (Showbase should have been set
        !            42: but wasn't)
        !            43: 
        !            44: 
        !            45: --------------------------------------------------
        !            46: Cycle 8
        !            47: 
        !            48: streambuf::snextc was not incrementing the get pointer before
        !            49: it called underflow.  This had no effect because the streambuf
        !            50: classes assume that when underflow is called there
        !            51: was nothing in the buffer.  The man page said that although this
        !            52: was "normally the case" but doesn't guarantee it.  I wrote a new
        !            53: streambuf class that checked for the condition and it failed.
        !            54: I've fixed snextc.  
        !            55: 
        !            56: ---------------------------------------------------
        !            57: Cycle 7  
        !            58: 
        !            59: Fix bug in setstate.  
        !            60: 
        !            61: Change return type of filebuf::close to filebuf*
        !            62: 
        !            63: Add noreplace to open_mode 
        !            64: 
        !            65: Fixed bug in adjustment of floating fields
        !            66: 
        !            67: -----------------------------------------------------
        !            68: 
        !            69: Cycle 6.1 
        !            70: 
        !            71: Interpretation of justification fields was screwed up.
        !            72: 
        !            73: Fix for whitespace eating of character extractor of cycle 6  was
        !            74: incomplete. (It might read characters when the stream was
        !            75: in error status).
        !            76: 
        !            77: -----------------------------------------------------
        !            78: Cycle 6
        !            79: 
        !            80: Make streambuf::xsgetn and streambuf::xsputn virtuals
        !            81: 
        !            82: ios::operator int changed to ios::operator void* in order to allow
        !            83: detection of "cin << 5" without requiring any extractor or inserter
        !            84: to be declared in class iostream.
        !            85: 
        !            86: sync is moved from ios to istream,  the corresponding action on
        !            87: ostreams is flushing.
        !            88: 
        !            89: Reorder declarations in iostream.h to avoid forward enum tag
        !            90: declarations.
        !            91: 
        !            92: Fixes to single character extractors to make sure they skip
        !            93: whitespace when required.
        !            94: 
        !            95: Massive simplification of format control stuff
        !            96: 
        !            97:        struct fmtinfo goes away as do pushing and popping of it.
        !            98: 
        !            99:        several format state variables are consolodated into
        !           100:        a single flag field and new flags are added to control
        !           101:        more stuff.  Remaining state variables are fill, precision and
        !           102:        width.  New statevariable "flags".
        !           103: 
        !           104:        Flags declared in an enum within ios:
        !           105: 
        !           106:        enum            { skipws=01,    
        !           107:                                        /* skip whitespace on input */
        !           108:                          left=02,  right=04, internal=010,
        !           109:                                        /* padding location */
        !           110:                          dec=020, oct=040, hex=0100, 
        !           111:                                        /* conversion base */
        !           112:                          showbase=0200, showpoint=0400, uppercase=01000,
        !           113:                          showpos=02000, 
        !           114:                                        /* modifiers */
        !           115:                          scientific=04000, fixed=010000
        !           116:                                        /* floating point notation */                                             } ;
        !           117:        
        !           118:        Functions to manipulate the flag field
        !           119:                s.flags()       return current flag
        !           120:                s.flags(b)      sets flags to b 
        !           121:                s.setf(b)       turns on bits marked in f in flags
        !           122:                s.setf(b,f)     assigns b to "field" specified by f
        !           123:                                (i.e. bits that are on in f)
        !           124: 
        !           125:         static ios int members for convienent reference to fields
        !           126:                 ios::basefield = hex|dec|oct ;
        !           127:                 ios::adjustfield = left|right|internal ;
        !           128:                 ios::floatfield = scientific|fixed ;
        !           129: 
        !           130: New manipulators
        !           131: 
        !           132:        s << setfill(f)         sets fill state variable
        !           133:        s << setprecision(p)    sets precision state variable
        !           134:        s << setiosflags(b)     does s.setf(b)
        !           135:        s << resetiosflags(b)   does s.setf(0,b)
        !           136: 
        !           137: New user setable state variables
        !           138: 
        !           139:        flags are a long user code may use unassigned bits
        !           140:        s.iword(x)              returns a long& 
        !           141:        s.pword(s)              returns a void*& (sharing space with s.iword(x)
        !           142:        
        !           143: 
        !           144:        ios::bitalloc()         returns a previously unallocated bit
        !           145:        ios::xalloc()           returns a previously unused index
        !           146:        
        !           147: ---------------------------------------------
        !           148: Cycle 5
        !           149: 
        !           150: Eliminated a lot of warnings about assigning longs to ints and
        !           151: the like.
        !           152: 
        !           153: Put in some overflow detection on integer input (it is still very
        !           154: incomplete). 
        !           155: 
        !           156: Change sync_with_stdio into a static member function
        !           157: 
        !           158: Add enum_mode, nocreate.  Causes failure of an open if file does not
        !           159: previously exist. 
        !           160: 
        !           161: Changed popfmt to reset width to 0.  This is more consistent with the
        !           162: normal use.
        !           163: 
        !           164: Fixed some bugs in interaction of EOF eating whitespace and "ignore"
        !           165: 
        !           166: ------------------------------------------
        !           167: 
        !           168: Multiple Inheritance Version.  
        !           169: 
        !           170: Changes from previous version:
        !           171: 
        !           172: MI structure in classes.  Mainly this is a lot of trivial changes.
        !           173: But one substantive change arises.  Because ios is now inherited
        !           174: as a virtual base class, a constructor with no arguments must
        !           175: be used.  Therefore ios::init(streambuf*) is declared protected and
        !           176: must be used to initialize in derived classes.
        !           177: 
        !           178: -------------------------------------------
        !           179: 
        !           180: The latest version of the iostream package incorporates a large
        !           181: number of changes and bug fixes.  They are listed here in my
        !           182: estimation of their importance.
        !           183: 
        !           184: In principle, istream, ostream, and iostream are now distinct
        !           185: classes. istream only contains input operations and ostream only
        !           186: contains output operations.  iostream is the "join" of the two. There
        !           187: is a new class ios containing the common state information from which
        !           188: all these are derived.
        !           189: 
        !           190: This means, for example, that cin should't be passed to a function
        !           191: expecting an iostream.
        !           192: 
        !           193: In practice to do this would have required a good implementation of
        !           194: multiple inheritance with virtual base classes. To avoid relying on
        !           195: this feature of C++ all the stream classes are typedefed to ios.
        !           196: 
        !           197: As a consequence of this change several classes derived from
        !           198: "istream" and "ostream" have been added.  Namely ifstream, ofstream,
        !           199: istrstream and ostrstream.  These (rather than the bidrectional
        !           200: fstream and strstream) should be used when a stream for only input or
        !           201: only output is desired.
        !           202: 
        !           203: The kludge that used #defines and pointer variables to implement cin,
        !           204: cour, cerr and cdebug has been eliminated. The standard streams are
        !           205: now declared as extern variables in iostream.h. Their types are
        !           206: classes derived from iostream with an assignment operator. So that it
        !           207: is now permitted to assign streams to them.
        !           208: 
        !           209: Because cfront now distinguishes int from char in overload resolution
        !           210: cout << 'a' now outputs the character 'a' rather than the decimal
        !           211: value.  This is an incompatibility with the old stream package, but
        !           212: is such a large improvement that I thought it was worth any
        !           213: conversion problems it might cause.   This made the manipulator
        !           214: "onec" redundant and it has been removed.
        !           215: 
        !           216: The name space has been cleaned up.  A lot of identifiers that were
        !           217: previously part of the global name space have been made local to a
        !           218: class. A table of the old and new names follows.  Probably the most
        !           219: important is the renaming of open_modes.
        !           220: 
        !           221:        old name                new name
        !           222:        --------                --------
        !           223: 
        !           224:        iocdebug                        // eliminated
        !           225:        iocerr                          // eliminated
        !           226:        iocin                           // eliminated
        !           227:        iocout                          // eliminated
        !           228:        
        !           229:        cdebug                  clog    // Renamed because of
        !           230:                                        // complaints about old name
        !           231: 
        !           232:        state_value             io_state
        !           233:                                        // Renamed because state_value
        !           234:                                        // was too unspecific
        !           235: 
        !           236:        _bad                    ios::badbit
        !           237:        _eof                    ios::eofbit
        !           238:        _fail                   ios::failbit
        !           239:        _good                   ios::goodbit
        !           240: 
        !           241:        append                  ios::app
        !           242:        atend                   ios::ate
        !           243:        input                   ios::in
        !           244:        output                  ios::out
        !           245: 
        !           246:        seek_beg                ios::beg
        !           247:        seek_cur                ios::cur
        !           248:        seek_end                ios::end
        !           249: 
        !           250: stream.h contains declarations of the names required for backward
        !           251: compatibility with the stream package.
        !           252: 
        !           253: The macros for declaring manipulator classes (IOMANIP and  IOMANIP2)
        !           254: have been replaced by a collection of macros that are more
        !           255: "template-like". Two argument manipulators are not implemented.
        !           256: (Users may follow the pattern in iomanip.h to implement them
        !           257: themselves.)
        !           258: 
        !           259: filebuf and fstream operations no longer clear errno.
        !           260: 
        !           261: The virtual declaration of streambuf::setbuf now only has two
        !           262: arguments. The three argument form exists in streambuf for
        !           263: compatibility with the stream package, but the "official"
        !           264: definition has only two arguments. Similarly the documented
        !           265: constructor is now streambuf(char*,int).
        !           266: 
        !           267: The members of fstream (ifstream and ofstream) that used to return an
        !           268: int as an error indication (namely open, attach, close) now return
        !           269: void.  Errors are indicated by setting failbit in the error state.
        !           270: There was some confusion here about whether an error was indicated by
        !           271: returning 0 or EOF.  Declaraing these functions to return void
        !           272: eliminates the possibility of confusion.
        !           273: 
        !           274: strstreambuf now allows setbuf in order to control sizes of
        !           275: allocation in dynamic mode. (When character strings are being
        !           276: automatically extended.)
        !           277: 
        !           278: More careful checks for whether flushes are required on streams that
        !           279: are tied to other streams. (E.g. flushes on cout when characters are
        !           280: extracted from cin.)
        !           281: 
        !           282: Tieing now works for insertion. E.g. cerr is tied to cout, so
        !           283: insertion into cerr causes cout to be flushed.
        !           284: 
        !           285: Redundant calls to allocate have been removed from streambuf::xsgetn
        !           286: and streambuf::xsputn.  (This means that the only calls to
        !           287: streambuf::allocate from streambuf member functions are from the
        !           288: virtuals that may be overriden in derived classes.)
        !           289: 
        !           290: open with ios::ate (the old atend) no longer implies ios::out (the
        !           291: old output).  ios::app does.  (ate is a perfectly sensible mode
        !           292: for input.)
        !           293: 
        !           294: eatwhite is defined for compatibility with stream package.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.