home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / INTERNET / WWW / LYNX / SOURCE / SRC0_8A.ZIP / DOSLYNX / INC / TCAPTURE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-09  |  1.6 KB  |  54 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. //        08-09-94    Having to majorly modify code to not depend
  17. //                    on presence of informational views.
  18.  
  19. //    Constant defines
  20. #define Uses_TWindow
  21. #define Uses_TTerminal
  22. #define Uses_TRect
  23. #define Uses_TEvent
  24.  
  25. //    Required includes
  26. #include<tv.h>
  27. #include<iostream.h>
  28.  
  29. //    Class/Function declarations
  30. class TCapture : public TWindow    {
  31.     TTerminal *TT;
  32. public:
  33.     ostream_withassign DumbStream;
  34.     TCapture(TRect TR, const char *cp_title, unsigned short int
  35.         usi_bufsize);
  36.     void handleEvent(TEvent& TE);
  37. };
  38.  
  39. extern "C" void cap_stdout(const char *);
  40. extern "C" void cap_stderr(const char *);
  41.  
  42. //    Global variable declarations
  43.  
  44. //    Macros
  45. //    Capture C++ streams also, This could be messy.
  46. #include"globals.h"
  47.  
  48. #define cout { if(::B_noInfo != TRUE) { ::TC->show(); ::TC->makeFirst(); } } (::TC->DumbStream)
  49. #define cerr { if(::B_noInfo != TRUE) { ::TC->show(); ::TC->makeFirst(); } } (::TC->DumbStream)
  50. #define clog { if(::B_noInfo != TRUE) { ::TC->show(); ::TC->makeFirst(); } } (::TC->DumbStream)
  51. #define doslynxmessage(message) { cout << "doslynx:  " << message << '\n'; }
  52.  
  53. #endif // __TCAPTURE_H
  54.