Annotation of researchv10dc/cmd/cfront/libC/iostream/swstdio.c, revision 1.1

1.1     ! root        1: /*ident        "@(#)ctrans:lib/stream/swstdio.c        1.1.1.1" */
        !             2: /**************************************************************************
        !             3:                        Copyright (c) 1984 AT&T
        !             4:                          All Rights Reserved   
        !             5: 
        !             6:        THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
        !             7:        
        !             8:        The copyright notice above does not evidence any        
        !             9:        actual or intended publication of such source code.
        !            10: 
        !            11: swstdio.c:
        !            12: 
        !            13: *****************************************************************************/
        !            14: 
        !            15: 
        !            16: #include <iostream.h>
        !            17: #include <stdiostream.h>
        !            18: 
        !            19: static void stdioflush()
        !            20: {
        !            21:        fflush(stdout) ;
        !            22:        fflush(stderr) ;
        !            23:        }
        !            24: 
        !            25: void ios::sync_with_stdio() 
        !            26: {
        !            27:        switch ( Iostream_init::stdstatus )
        !            28:        {
        !            29:        case 1 : cout.flush() ; cerr.flush() ; clog.flush() ; break ;
        !            30:        case 2 : break ;
        !            31:        default : return ; }
        !            32:  
        !            33:        cin = new stdiobuf(stdin) ;
        !            34:        cout = new stdiobuf(stdout) ;
        !            35:        cerr = new stdiobuf(stderr) ;
        !            36:        clog = cerr ;
        !            37:        cin.setf(~0L,skipws) ;
        !            38:        cout.setf(~0L,unitbuf|stdio) ;
        !            39:        cerr.setf(~0L,unitbuf|stdio) ;
        !            40:        clog.setf(~0L,unitbuf|stdio) ;
        !            41:        cin.tie(&cout) ;
        !            42:        cerr.tie(&cout) ;
        !            43:        clog.tie(&cout) ;
        !            44:        Iostream_init::stdstatus = 2 ;
        !            45:        ios::stdioflush = ::stdioflush ;
        !            46:        }

unix.superglobalmegacorp.com

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