Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.2 KiB

  1. /***
  2. *strmbdbp.cpp - streambuf::dbp() debug routine
  3. *
  4. * Copyright (c) 1991-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * Dump debug info about streambuf to stdout.
  8. *
  9. *Revision History:
  10. *
  11. * 11-13-91 KRS Created.
  12. * 01-26-95 CFW Win32s objects now exist.
  13. * 06-14-95 CFW Comment cleanup.
  14. *
  15. *******************************************************************************/
  16. #include <cruntime.h>
  17. #include <internal.h>
  18. #include <io.h>
  19. #include <stdio.h>
  20. #include <iostream.h>
  21. #pragma hdrstop
  22. #pragma check_stack(on) // large buffer(s)
  23. void streambuf::dbp()
  24. {
  25. int olen;
  26. _WINSTATIC char obuffer[256];
  27. if (unbuffered())
  28. olen = sprintf(obuffer,
  29. "\nSTREAMBUF DEBUG INFO: this=%p, unbuffered\n",
  30. (void *) this);
  31. else
  32. {
  33. olen = sprintf(obuffer,
  34. "\nSTREAMBUF DEBUG INFO: this=%p, _fAlloc=%d\n"
  35. " base()=%p, ebuf()=%p, blen()=%d\n"
  36. " pbase()=%p, pptr()=%p, epptr()=%p\n"
  37. " eback()=%p, gptr()=%p, egptr()=%p\n",
  38. (void *) this, (_fAlloc),
  39. base(), ebuf(), blen(),
  40. pbase(), pptr(), epptr(),
  41. eback(), gptr(), egptr());
  42. }
  43. _write(1,obuffer,olen); // direct write to stdout
  44. }