int strstreambuf::overflow( int c ) { __lock_it( __b_lock ); if( !__dynamic ) { return( EOF ); } if( __unlimited ) { // adjust end pointer int offset = out_waiting(); setp( pbase(), epptr() + DEFAULT_MAINBUF_SIZE ); pbump( offset ); return( __NOT_EOF ); } // Use doallocate() because streambuf::allocate() will not grow an // existing buffer the way strstreambuf needs to if( doallocate() == EOF ) { return( EOF ); } if( c != EOF ) { *pptr() = (char)c; pbump( 1 ); } return( __NOT_EOF ); }
int allocate() { if (base() || unbuffered()) return 0; else return doallocate(); }
void streambuf::doallocbuf() { if (base() || (!unbuffered() && doallocate() != EOF)) return; setb(_shortbuf, _shortbuf+1, 0); }