// -*- C++ -*-
#ifndef __STD_STREAMBUF__
#define __STD_STREAMBUF__

/***************************************************************************
 *
 * streambuf - Declarations for the Standard Library stream buffers
 *
 ***************************************************************************
 *    
 *  Copyright 2000 Compaq Computer Corporation
 *
 *  COMPAQ Registered in U.S. Patent and Trademark Office.
 *
 *  Confidential computer software. Valid license from Compaq required for
 *  possession, use or copying. Consistent with FAR 12.211 and 12.212,
 *  Commercial Computer Software, Computer Software Documentation, and
 *  Technical Data for Commercial Items are licensed to the U.S. Government
 *  under vendor's standard commercial license.
 *
 ****************************************************************************
 *
 * (c) Copyright 1994, 1998 Rogue Wave Software, Inc.
 * ALL RIGHTS RESERVED
 *
 * The software and information contained herein are proprietary to, and
 * comprise valuable trade secrets of, Rogue Wave Software, Inc., which
 * intends to preserve as trade secrets such software and information.
 * This software is furnished pursuant to a written license agreement and
 * may be used, copied, transmitted, and stored only in accordance with
 * the terms of such license and with the inclusion of the above copyright
 * notice.  This software and information or any other copies thereof may
 * not be provided or otherwise made available to any other person.
 *
 * Notwithstanding any other lease or license that may pertain to, or
 * accompany the delivery of, this computer software and information, the
 * rights of the Government regarding its use, reproduction and disclosure
 * are as set forth in Section 52.227-19 of the FARS Computer
 * Software-Restricted Rights clause.
 * 
 * Use, duplication, or disclosure by the Government is subject to
 * restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
 * Technical Data and Computer Software clause at DFARS 252.227-7013.
 * Contractor/Manufacturer is Rogue Wave Software, Inc.,
 * P.O. Box 2328, Corvallis, Oregon 97339.
 *
 * This computer software and information is distributed with "restricted
 * rights."  Use, duplication or disclosure is subject to restrictions as
 * set forth in NASA FAR SUP 18-52.227-79 (April 1985) "Commercial
 * Computer Software-Restricted Rights (April 1985)."  If the Clause at
 * 18-52.227-74 "Rights in Data General" is specified in the contract,
 * then the "Alternate III" clause applies.
 *
 **************************************************************************/

#include <compnent.hxx>
#ifndef __USE_STD_IOSTREAM
#error "cannot include streambuf -- define __USE_STD_IOSTREAM to override default - see section 7.1.2 of the C++ Using Guide"
#else

#include <stdcomp>

#ifndef _RWSTD_NO_NEW_HEADER
#include <cstdlib>
#else
#include <stdlib.h>
#endif

#include <ios>

#if defined(__DECCXX)
#   ifdef __PRAGMA_ENVIRONMENT
#      pragma __environment __save
#      pragma __environment __cxx_header_defaults
#   endif
#endif

#if defined(__VMS) && defined(__DECCXX) && !defined(__DECFIXCXXL1158)
#pragma __extern_prefix __save
#pragma __extern_prefix "CXXL$" 
#endif


#ifndef _RWSTD_NO_NAMESPACE
namespace std {
#endif

  template<class charT, class traits>
  class _RWSTDExportTemplate basic_streambuf {

  public:
    //
    // Types:
    //
    typedef charT                                       char_type;
    typedef _TYPENAME traits::int_type                  int_type;
    typedef _TYPENAME traits::pos_type                  pos_type;
    typedef _TYPENAME traits::off_type                  off_type;
    typedef traits                                      traits_type;

    virtual ~basic_streambuf();

    locale pubimbue( const locale& loc);
    locale getloc() const; 

    inline  basic_streambuf<char_type, traits> *
    pubsetbuf(char_type *s, streamsize n);

    inline pos_type pubseekoff(off_type off, ios_base::seekdir way,
                               ios_base::openmode which =
                               ios_base::in | ios_base::out);

    inline pos_type pubseekpos(pos_type sp, ios_base::openmode which =
                               ios_base::in | ios_base::out);

    inline int pubsync( );
    inline ios_base::openmode which_open_mode();
    inline streamsize   in_avail();

    inline int_type snextc();
    inline int_type sbumpc();
    inline int_type sgetc();
    inline streamsize sgetn(char_type *s, streamsize n);

    inline int_type sputbackc(char_type c);
    inline int_type sungetc();

    inline int_type sputc(char_type c);
    inline streamsize sputn(const char_type *s, streamsize n);

#ifdef _RWSTD_MULTI_THREAD
    _RWSTDMutex buffer_mutex_;

    void _RW_lock_buffer()
    {
      _RWSTDGuard* tmp = new _RWSTDGuard(buffer_mutex_);
      if ( tmp )
        _RWbuffer_guard = tmp;
      else
        _RWbuffer_guard = 0;
    }

    void _RW_unlock_buffer()
    {
      if ( _RWbuffer_guard )
      {
        delete _RWbuffer_guard;
        _RWbuffer_guard = 0;
      }
    }
#endif // _RWSTD_MULTI_THREAD

  protected:
    basic_streambuf();

    ios_base::openmode mode_;
     
    inline char_type *eback() const;  
    inline char_type *gptr() const;
    inline char_type *egptr() const;
    inline void gbump(int n);
    inline void setg(char_type *gbeg_arg,char_type *gnext_arg,char_type *gend_arg);

    inline char_type *pbase() const;  
    inline char_type *pptr() const;   
    inline char_type *epptr() const;
    inline void pbump(int n);
    inline void setp(char_type *pbeg_arg,char_type *pend_arg);

    virtual void imbue( const locale& loc);

    virtual basic_streambuf<charT, traits> *
    setbuf(char_type *s, streamsize n);

    virtual pos_type seekoff(off_type off,
                             ios_base::seekdir way, ios_base::openmode which = 
                             ios_base::in | ios_base::out);

    virtual pos_type seekpos(pos_type sp,
                             ios_base::openmode which = 
                             ios_base::in | ios_base::out);

#if defined(__DECCXX) && !defined(__DECFIXCXXL1051)
    virtual streamsize showmanyc();
#else
    virtual int showmanyc();
#endif
    virtual streamsize xsgetn(char_type *s, streamsize n);
    virtual int_type underflow();
    virtual int_type uflow();
    virtual int_type overflow(int_type c = traits::eof());
      
    virtual int_type pbackfail(int_type c = traits::eof());      
    virtual streamsize xsputn(const char_type *s, streamsize n);

    virtual int sync( );
    void streambuf_init(bool set_mode= true);

  private:

    char_type       *_RWgbeg;    
    char_type       *_RWgnext;  
    char_type       *_RWgend;    

    char_type       *_RWpbeg;   
    char_type       *_RWpnext;   
    char_type       *_RWpend;  

    locale          _RWloc_buf; 

#ifdef _RWSTD_MULTI_THREAD
    _RWSTDGuard *_RWbuffer_guard; 
#endif // _RWSTD_MULTI_THREAD
  };


  /* 
   * inline functions
   */

  /*
   * int_type snextc()
   * returns the next character
   */

  template<class charT, class traits>
  inline _TYPENAME basic_streambuf<charT, traits>::int_type
  basic_streambuf<charT, traits>::snextc()
  {
    if( traits::eq_int_type(sbumpc(),traits::eof()) )
      return traits::eof();

    return sgetc();
  }

  /*
   * int_type sbumpc()
   * returns the current character and increments the pointer
   */

  template<class charT, class traits>
  inline _TYPENAME basic_streambuf<charT, traits>::int_type
  basic_streambuf<charT, traits>::sbumpc()
  { 
    char_type c;

    if( gptr()>= egptr()) {
      return uflow();
    } 
    c=*gptr();  
    gbump(1); 
    return traits::to_int_type(c);
  }

  /*
   * int_type sgetc()
   * returns the current character
   */

  template<class charT, class traits>
  inline _TYPENAME basic_streambuf<charT, traits>::int_type
  basic_streambuf<charT, traits>::sgetc()
  {

    if(gptr() >= egptr()) {  
      return underflow();
    }

    return traits::to_int_type(*gptr());
  }

  /*
   * streamsize sgetn(char_type *, streamsize)
   * reads in 'n' characters into 's'
   */

  template<class charT, class traits>
  inline streamsize basic_streambuf<charT, traits>::
  sgetn(char_type *s, streamsize n)
  {
    return xsgetn(s, n);
  }

  /*
   * int_type sputbackc(char_type)
   * puts the character back into the sequence if possible
   */

  template<class charT, class traits>
  inline _TYPENAME basic_streambuf<charT, traits>::int_type
  basic_streambuf<charT, traits>::sputbackc(char_type c)
  {
    if( gptr() > eback())
    { 
      gbump(-1);
      if( !traits::eq(*gptr(),c) )
      { 
        gbump(1); 
        return pbackfail(traits::to_int_type(c));
      }

      return traits::to_int_type(*gptr());
    }

    return pbackfail(traits::to_int_type(c)); 
  }

  /*
   * int sungetc()
   * puts the character back into the sequence. The putback character doesn't
   * have to already be there.  Similar to sputbackc(...)
   */

  template<class charT, class traits>
  inline _TYPENAME basic_streambuf<charT, traits>::int_type
  basic_streambuf<charT, traits>::sungetc()
  {
    if(gptr() > eback())
    {
      gbump(-1);
      return traits::to_int_type(*gptr());
    } 
    return pbackfail();
  }

  /*
   * int sputc(char_type)
   * puts the character into the sequence
   */

  template<class charT, class traits>
  inline _TYPENAME basic_streambuf<charT, traits>::int_type
  basic_streambuf<charT, traits>::sputc(char_type c)
  {
  
    if( pptr() >= epptr() )
    {
      return overflow(traits::to_int_type(c));
    }
    *_RWpnext++ =c; 
    return traits::to_int_type(c);
  }

  /*
   * streamsize sputn(const char_type *, streamsize)
   * writes n characters from s into the sequence
   */

  template<class charT, class traits>
  inline streamsize
  basic_streambuf<charT, traits>::sputn(const char_type *s, streamsize n)
  {
    return xsputn(s, n);
  }

  /*
   * void gbump(int)
   * increments the get pointer by n.  Does no checking to see if this
   * is a valid operation
   */

  template<class charT, class traits>
  inline void 
  basic_streambuf<charT, traits>::gbump(int n)
  {
    _RWgnext += n;
  }

  /*
   * void setg(char_type *, char_type *, char_type *)
   * sets the get pointers
   */

  template<class charT, class traits>
  inline void 
  basic_streambuf<charT, traits>::
  setg(char_type *gbeg, char_type *gnext, char_type *gend)
  {
    _RWgbeg  = gbeg;
    _RWgnext = gnext;
    _RWgend  = gend;
  }

  /*
   * void pbump(int)
   * increments the put pointer.  No checking to see if this is valid
   */

  template<class charT, class traits>
  inline void 
  basic_streambuf<charT, traits>::pbump(int n)
  {
    _RWpnext += n;
  }

  /*
   * void setp(char_type *, char_type *)
   * sets up the put pointers
   */

  template<class charT, class traits>
  inline void 
  basic_streambuf<charT, traits>::
  setp(char_type *pbeg, char_type *pend)
  {
    _RWpbeg = pbeg;
    _RWpnext = pbeg;
    _RWpend = pend;
  }

  /*
   * char_type *eback() const
   * returns the beginning of the get sequence
   */

  template<class charT, class traits>
  inline _TYPENAME basic_streambuf<charT, traits>::char_type *
  basic_streambuf<charT, traits>::eback() const
  {
    return _RWgbeg;
  }

  /*
   * char_type *gptr() const
   */

  template<class charT, class traits>
  inline _TYPENAME basic_streambuf<charT, traits>::char_type *
  basic_streambuf<charT, traits>::gptr() const
  {
    return _RWgnext;
  }

  /*
   * char_type *egptr() const
   */

  template<class charT, class traits>
  inline _TYPENAME basic_streambuf<charT, traits>::char_type *
  basic_streambuf<charT, traits>::egptr() const
  {
    return _RWgend;
  }

  /*
   * char_type *pbase() const
   */

  template<class charT, class traits>
  inline _TYPENAME basic_streambuf<charT, traits>::char_type *
  basic_streambuf<charT, traits>::pbase() const
  {
    return _RWpbeg;
  }

  /*
   * char_type *pptr() const
   */

  template<class charT, class traits>
  inline _TYPENAME basic_streambuf<charT, traits>::char_type *
  basic_streambuf<charT, traits>::pptr() const
  {
    return _RWpnext;
  }

  /*
   * char_type *epptr() const
   */

  template<class charT, class traits>
  inline _TYPENAME basic_streambuf<charT, traits>::char_type *
  basic_streambuf<charT, traits>::epptr() const
  {
    return _RWpend;
  }

  /*
   * streamsize in_avail()
   * returns how many characters are available
   */

  template<class charT, class traits>
  inline streamsize 
  basic_streambuf<charT, traits>::in_avail()
  {
    if(gptr() >= egptr())
      return showmanyc();

    return ( (streamsize)(egptr() - gptr()) );
  }
 
  /*
   * int pubsync()
   */

  template<class charT, class traits>
  inline int 
  basic_streambuf<charT, traits>::pubsync()
  {
    return sync();
  }

  /*
   * pos_type pubseekoff(off_type, ios_base::seekdir, ios_base::openmode)
   */

  template<class charT, class traits>
  inline _TYPENAME basic_streambuf<charT, traits>::pos_type
  basic_streambuf<charT, traits>::
  pubseekoff(off_type off, ios_base::seekdir way, ios_base::openmode which)
  {
    return seekoff(off, way, which);
  }

  /*
   * pos_type pubseekpos(pos_type, ios_base::openmode)
   */

  template<class charT, class traits>
  inline _TYPENAME basic_streambuf<charT, traits>::pos_type
  basic_streambuf<charT, traits>::
  pubseekpos(pos_type sp,
             ios_base::openmode which)
  {
    return seekpos(sp, which);
  }

  /*
   * basic_streambuf *pubsetbuf(char_type *, streamsize)
   */

  template<class charT, class traits>
  inline  basic_streambuf<charT, traits> *
  basic_streambuf<charT, traits>::
  pubsetbuf(char_type *s, streamsize n)
  {
    return setbuf(s, n);
  }

  /*
   * ios_base::openmode which_open_mode()
   */

  template<class charT, class traits>
  inline ios_base::openmode
  basic_streambuf<charT, traits>::which_open_mode()
  {
    return mode_; 
  }

  /*
   *   streambuf iterators
   */

  /*
   *  ostreambuf_iterator
   */

  template<class charT, class traits >
  class _RWSTDExportTemplate ostreambuf_iterator 
    : public iterator<output_iterator_tag,charT, 
  _TYPENAME traits::off_type,charT*,charT&>
  {

  public:
    //
    // Types:
    //
    typedef charT                          char_type;
    typedef traits                         traits_type;
    typedef basic_streambuf<charT, traits> streambuf_type;
    typedef basic_ostream<charT, traits>   ostream_type;

    ostreambuf_iterator(ostream_type& s) _RWSTD_INLINE_NO_THROW
    : _RWsbuf(s.rdbuf())
    {
      if ( s.rdbuf() ) _RWfailed_flag = false;
      else 
        _RWfailed_flag = true; 
    }

    ostreambuf_iterator(streambuf_type *s) _RWSTD_INLINE_NO_THROW
    : _RWsbuf(s)
    { 
      if ( s ) _RWfailed_flag = false;
      else 
        _RWfailed_flag = true;
    }

    ostreambuf_iterator<charT,traits>& operator*()
    { return *this; }
    ostreambuf_iterator<charT,traits>& operator++()
    { return *this; }
    ostreambuf_iterator<charT,traits> operator++(int)
    { return *this; }

    ostreambuf_iterator<charT,traits>& operator=(charT c)
    { 
      if ( !_RWfailed_flag )
      {
        if ( traits::eq_int_type(_RWsbuf->sputc(c),traits::eof()) )
          _RWfailed_flag=true;
      }
      return *this;
    }

    bool failed( ) const _RWSTD_INLINE_NO_THROW
    { return _RWfailed_flag; }

  protected:

  private:
    streambuf_type        *_RWsbuf;
    bool                   _RWfailed_flag;
  };

  /*
   * istreambuf_iterator 
   */

  template<class charT, class traits >
  class _RWSTDExportTemplate istreambuf_iterator
    : public iterator<input_iterator_tag,charT,
  _TYPENAME traits::off_type,charT*,charT&>
  {

  public:
    //
    // Types:
    //
    typedef charT                          char_type;
    typedef _TYPENAME traits::int_type      int_type;
    typedef traits                         traits_type;

    typedef basic_streambuf<charT, traits> streambuf_type;
    typedef basic_istream<charT, traits>   istream_type;

    // class to maintain a character and an associated streambuf
    class proxy {
      char_type                       _RWkeep;
      streambuf_type                  *_RWsbuf;

      proxy(char_type c, streambuf_type *sbuf)
        : _RWkeep(c), _RWsbuf(sbuf)
      { ; }

    public:

      char_type operator*()
      { return _RWkeep; }

      friend class istreambuf_iterator<charT, traits>;
    };

  public:

    istreambuf_iterator()  _RWSTD_INLINE_NO_THROW
    : _RWsbuf(0)
    { _RWfailed_flag = true; }
    istreambuf_iterator(istream_type& s)  _RWSTD_INLINE_NO_THROW
    : _RWsbuf(s.rdbuf())
    { 
      if ( s.rdbuf() ) _RWfailed_flag = false;
      else 
        _RWfailed_flag = true; 
    }
    istreambuf_iterator(streambuf_type *s) _RWSTD_INLINE_NO_THROW
    : _RWsbuf(s)
    {
      if ( s ) _RWfailed_flag = false;
      else 
        _RWfailed_flag = true;
    }
    istreambuf_iterator(const proxy& p) _RWSTD_INLINE_NO_THROW
    : _RWsbuf(p._RWsbuf)
    { ; }
    inline char_type operator*();
    inline istreambuf_iterator<charT, traits>& operator++();
    inline proxy operator++(int);
#if defined(__DECCXX) && !defined(__DECFIXCXXL1101)
    inline bool equal(const istreambuf_iterator<charT, traits>& b) const;
#else
    inline bool equal(istreambuf_iterator<charT, traits>& b);
#endif

    bool failed( ) const _RWSTD_INLINE_NO_THROW
    { return _RWfailed_flag; }

  protected:

  private:
    streambuf_type     *_RWsbuf;
    bool                _RWfailed_flag;
  };

  /*
   * inline functions
   */

  /*
   * char_type operator*()
   */

  template<class charT, class traits>
  inline _TYPENAME istreambuf_iterator<charT, traits>::char_type
  istreambuf_iterator<charT, traits>::operator*()
  {
    int_type c;

    if ( _RWsbuf && !_RWfailed_flag )
    {
      c= _RWsbuf->sgetc();
      if ( traits::eq_int_type(c,traits::eof()) ) 
      {
        _RWsbuf = 0;
        _RWfailed_flag = true;
      }
    }
    else return traits::eof();
 
    return traits::to_char_type(c);
  }

  /*
   * istreambuf_iterator& operator++()
   */

  template<class charT, class traits>
  inline istreambuf_iterator<charT, traits>&
  istreambuf_iterator<charT, traits>::operator++()
  {
    if (_RWsbuf && !_RWfailed_flag )
    { 
      _RWsbuf->sbumpc();
      if ( traits::eq_int_type(_RWsbuf->sgetc(),traits::eof()) ) 
      {
        _RWsbuf = 0;
        _RWfailed_flag = true;
      } 
    }
    return *this;
  }

  /*
   * proxy operator++(int)
   */

  template<class charT, class traits>
  inline _TYPENAME istreambuf_iterator<charT, traits>::proxy 
  istreambuf_iterator<charT, traits>::operator++(int)
  {

    if (_RWsbuf && !_RWfailed_flag )
    {
      proxy     prev(_RWsbuf->sgetc(), _RWsbuf);
      _RWsbuf->sbumpc();
      if ( traits::eq_int_type(_RWsbuf->sgetc(),traits::eof()) ) 
      {
        _RWsbuf = 0;
        _RWfailed_flag = true;
      }  
      return prev;
    }
    
    charT     c=traits::to_char_type(traits::eof());
    return proxy(c, _RWsbuf);
  }

  /*
   * bool equal(istreambuf_iterator&)
   */

  template<class charT, class traits>
  inline bool
  istreambuf_iterator<charT, traits>::
#if defined(__DECCXX) && !defined(__DECFIXCXXL1101)
  equal(const istreambuf_iterator<charT, traits>& b) const
#else
  equal(istreambuf_iterator<charT, traits>& b)
#endif
  {
    if( ((_RWsbuf ==0) && (b._RWsbuf==0)) || ((_RWsbuf !=0) && (b._RWsbuf !=0)) )
      return true;  
    else
      return false;
  }

  /*
   * bool operator==(istreambuf_iterator& a, istreambuf_iterator& b)
   */

  template<class charT, class traits>
#if defined(__DECCXX) && !defined(__DECFIXCXXL1101)
  inline bool _RWSTDExportTemplate operator==(const istreambuf_iterator<charT, traits>& a,
                                              const istreambuf_iterator<charT, traits>& b)
#else
  inline bool _RWSTDExportTemplate operator==(istreambuf_iterator<charT, traits>& a,
                                              istreambuf_iterator<charT, traits>& b)
#endif
  {
    return a.equal(b);
  }

  /*
   * bool operator!=(istreambuf_iterator& a, istreambuf_iterator& b)
   */

  template<class charT, class traits>
#if defined(__DECCXX) && !defined(__DECFIXCXXL1101)
  inline bool _RWSTDExportTemplate operator!=(const istreambuf_iterator<charT, traits>& a,
                                              const istreambuf_iterator<charT, traits>& b)
#else
  inline bool _RWSTDExportTemplate operator!=(istreambuf_iterator<charT, traits>& a,
                                              istreambuf_iterator<charT, traits>& b)
#endif
  {
    return !(a.equal(b));
  }

  // end inlining


#ifndef _RWSTD_NO_COMPLEX_DEFAULT_TEMPLATES
  typedef basic_streambuf<char>                             streambuf;
#else
  typedef basic_streambuf<char, char_traits<char> >         streambuf;
#endif // _RWSTD_NO_COMPLEX_DEFAULT_TEMPLATES
 
#ifndef _RWSTD_NO_WIDE_CHAR
#ifndef _RWSTD_NO_COMPLEX_DEFAULT_TEMPLATES
  typedef basic_streambuf<wchar_t>                          wstreambuf;
#else
  typedef basic_streambuf<wchar_t, char_traits<wchar_t> >   wstreambuf;
#endif // _RWSTD_NO_COMPLEX_DEFAULT_TEMPLATES
#endif // _RWSTD_NO_WIDE_CHAR


#ifndef _RWSTD_NO_NAMESPACE
}
#endif

#ifndef __FORCE_INSTANTIATIONS
// basic_streambuf
#pragma do_not_instantiate std::basic_streambuf<char, std::char_traits<char > >::~basic_streambuf()
#pragma do_not_instantiate std::locale std::basic_streambuf<char, std::char_traits<char > >::getloc() const
#pragma do_not_instantiate std::basic_streambuf<char, std::char_traits<char > >::basic_streambuf()
#pragma do_not_instantiate void std::basic_streambuf<char, std::char_traits<char > >::imbue(const std::locale &)
#pragma do_not_instantiate int std::basic_streambuf<char, std::char_traits<char > >::overflow(int)
#pragma do_not_instantiate int std::basic_streambuf<char, std::char_traits<char > >::pbackfail(int)
#if defined(__DECCXX) && !defined(__DECFIXCXXL1051)
#pragma do_not_instantiate std::streamsize std::basic_streambuf<char, std::char_traits<char > >::showmanyc()
#else
#pragma do_not_instantiate int std::basic_streambuf<char, std::char_traits<char > >::showmanyc()
#endif
#pragma do_not_instantiate int std::basic_streambuf<char, std::char_traits<char > >::underflow()
#pragma do_not_instantiate int std::basic_streambuf<char, std::char_traits<char > >::uflow()
#pragma do_not_instantiate long std::basic_streambuf<char, std::char_traits<char > >::xsgetn(char *, long)
#pragma do_not_instantiate long std::basic_streambuf<char, std::char_traits<char > >::xsputn(const char *, long)
#if defined(__DECCXX) && !defined(__DECFIXCXXL1231)
#pragma do_not_instantiate std::basic_streambuf<char, std::char_traits<char> >::pos_type std::basic_streambuf<char, std::char_traits<char > >::seekoff(std::basic_streambuf<char, std::char_traits<char> >::off_type, std::ios_base::seekdir, std::ios_base::openmode)
#pragma do_not_instantiate std::basic_streambuf<char, std::char_traits<char> >::pos_type std::basic_streambuf<char, std::char_traits<char > >::seekpos(std::basic_streambuf<char, std::char_traits<char> >::pos_type, std::ios_base::openmode)
#endif
#pragma do_not_instantiate std::basic_streambuf<char, std::char_traits<char > > *std::basic_streambuf<char, std::char_traits<char > >::setbuf(char *, long)
#pragma do_not_instantiate int std::basic_streambuf<char, std::char_traits<char > >::sync()
#pragma do_not_instantiate void std::basic_streambuf<char, std::char_traits<char > >::streambuf_init(bool)
#endif


#if defined(__VMS) && defined(__DECCXX) && !defined(__DECFIXCXXL1158)
#   pragma __extern_prefix __restore
#endif

#ifdef _RWSTD_COMPILE_INSTANTIATE
#include <streambuf.cc>
#endif

#if defined(__DECCXX)
#   ifdef __PRAGMA_ENVIRONMENT
#      pragma __environment __restore
#   endif
#endif

#endif // __USE_STD_IOSTREAM

#endif // __STD_STREAMBUF__ 


