summaryrefslogtreecommitdiffstats
path: root/private/crt32/iostream/strmbdbp.cxx
blob: 2f209a67f34348d14e90561142f99f36826f1d25 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/***
*strmbdbp.cxx - streambuf::dbp() debug routine
*
*	Copyright (c) 1991-1992, Microsoft Corporation.  All rights reserved.
*
*Purpose:
*	Dump debug info about streambuf to stdout.
*
*Revision History:
*
*	11-13-91   KRS	Created.
*
*******************************************************************************/

#include <cruntime.h>
#include <internal.h>
#include <io.h>
#include <stdio.h>
#include <iostream.h>
#pragma hdrstop

#pragma check_stack(on)		// large buffer(s)

void streambuf::dbp()
{
#if ((!defined(_WINDOWS)) || defined(_QWIN))
int olen;
_WINSTATIC char obuffer[256];		// CONSIDER: size? (198 bytes?)
    if (unbuffered())
	olen = sprintf(obuffer,
	    "\nSTREAMBUF DEBUG INFO: this=%p, unbuffered\n",
	    (void *) this);
    else
	{
	olen = sprintf(obuffer,
	    "\nSTREAMBUF DEBUG INFO: this=%p, _fAlloc=%d\n"
	    "  base()=%p, ebuf()=%p,  blen()=%d\n"
	    " pbase()=%p, pptr()=%p, epptr()=%p\n"
	    " eback()=%p, gptr()=%p, egptr()=%p\n",
	    (void *) this, (_fAlloc),
	     base(), ebuf(),  blen(),
	    pbase(), pptr(), epptr(),
	    eback(), gptr(), egptr());
	}
    _write(1,obuffer,olen);	// direct write to stdout
    // CONSIDER: add more info?
#endif
}