home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / msdos / lynx / source / doslynx / inc / tcapture.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-25  |  1.4 KB  |  52 lines

  1. #ifndef __TCAPTURE_H
  2. //    Avoid include redundancy
  3. #define __TCAPTURE_H
  4.  
  5. //    Copyright (c) 1994, University of Kansas, All Rights Reserved
  6. //
  7. //    Include File:    tcapture.h
  8. //    Purpose:    Provides a class that will insert text into a dumb
  9. //            terminal from stdout and stderr c streams.  This
  10. //            class works in conjunction with the source file
  11. //            capstdio.c
  12. //    Remarks/Portability/Dependencies/Restrictions:
  13. //        Requires the capstdio.c file.
  14. //    Revision History:
  15. //        01-08-94    created
  16.  
  17. //    Constant defines
  18. #define Uses_TWindow
  19. #define Uses_TTerminal
  20. #define Uses_TRect
  21. #define Uses_TEvent
  22.  
  23. //    Required includes
  24. #include<tv.h>
  25. #include<iostream.h>
  26.  
  27. //    Class/Function declarations
  28. class TCapture : public TWindow    {
  29.     TTerminal *TT;
  30. public:
  31.     ostream_withassign DumbStream;
  32.     TCapture(TRect TR, const char *cp_title, unsigned short int
  33.         usi_bufsize);
  34.     void handleEvent(TEvent& TE);
  35. };
  36.  
  37. extern "C" void cap_stdout(const char *);
  38. extern "C" void cap_stderr(const char *);
  39.  
  40. //    Global variable declarations
  41.  
  42. //    Macros
  43. //    Capture C++ streams also, This could be messy.
  44. #include"globals.h"
  45.  
  46. #define cout { ::TC->show(); ::TC->makeFirst(); } (::TC->DumbStream)
  47. #define cerr { ::TC->show(); ::TC->makeFirst(); } (::TC->DumbStream)
  48. #define clog { ::TC->show(); ::TC->makeFirst(); } (::TC->DumbStream)
  49. #define doslynxmessage(message) { cout << "doslynx:  " << message << '\n'; }
  50.  
  51. #endif // __TCAPTURE_H
  52.