home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / ISC366.ZIP / DOSFREE / DOSFREE.H < prev    next >
C/C++ Source or Header  |  1993-09-01  |  3KB  |  88 lines

  1. ///////////////////////////////////////////////////////////////////////////
  2. //                                                                       //
  3. //            File: DosFree.h                                            //
  4. //            started on: 28/7/93                                        //
  5. //                                                                       //
  6. ///////////////////////////////////////////////////////////////////////////
  7. //                                                                       //
  8. //  DosFree allows you to use dos within your TSRs. Just derive from     //
  9. //    this class and call func. Go and your dos-free application         //
  10. //    overloading func. AppFunc will run as soon as dos is free.         //
  11. //                                                                       //
  12. ///////////////////////////////////////////////////////////////////////////
  13. //                                                                       //
  14. //                    by Ofer Laor (AKA LeucroTTA)                       //
  15. //                                                                       //
  16. ///////////////////////////////////////////////////////////////////////////
  17.  
  18. #ifndef __DOSFREE_H
  19. #define __DOSFREE_H
  20.  
  21. #include "isc.h"; // ISC.
  22.  
  23.  
  24. // dos IDLE interrupt hook.
  25. class INT28 : public ISC {
  26.  
  27.       virtual void isr(void);
  28.  
  29. protected:
  30.       virtual void ShellFunc(void) {};    // DOSFREE shell.
  31.       virtual void DosIdleHook(void) {};  // overload this function to use Idle interrupt within APP.
  32.  
  33.       INT28() : ISC() {
  34.               activate(0x28);
  35.       };
  36. };
  37.  
  38. // timer interrupt hook.
  39. class INT8 : public ISC {
  40.  
  41.       virtual void isr(void);
  42. protected:
  43.       char far *inDOS;
  44.       virtual void ShellFunc(void) {};    // DOSFREE shell.
  45.       virtual void TimerHook(void) {};    // overload this function to use Timer interrupt within APP.
  46.       INT8();
  47. };
  48.  
  49.  
  50. // trap for critical errors.
  51. class TRAP : public ISC {
  52.  
  53.       virtual void isr(void) {};
  54. public:
  55.        TRAP() {};
  56. };
  57.  
  58. // trap for Abort/Retry/Fail.--> converts to always Fail.
  59. class TRAP24 : public ISC {
  60.  
  61.       virtual void isr(IREGS& regs);
  62. public:
  63.        TRAP24() {};
  64. };
  65.  
  66.  
  67. // Dosfree
  68. class DOSFREE : public INT8, public INT28 {
  69.  
  70.       int fRunning;                 // is app activated?
  71.       virtual void ShellFunc(void); // saves DOS data so that AppFunc can run free.
  72. protected:
  73.  
  74.       TRAP TrapCBreak;
  75.       TRAP TrapMSDOSCriticalError;
  76.       TRAP24 TrapAbortRetryFail;
  77.  
  78.       virtual void AppFunc(void);   // overload this function.
  79.       DOSFREE();                    // prevent direct usage of DOSFREE (use derive classes only).
  80.  
  81. public:
  82.        void Go(void);               // call this func. to activate AppFunc.
  83.  
  84. };
  85.  
  86.  
  87. #endif /* __DOSFREE_H */
  88.