home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / c / WLIB.ZIP / WDOS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-21  |  2.1 KB  |  78 lines

  1. #ifndef WDOSIncluded
  2. #define WDOSIncluded
  3.  
  4. // copyright (c) 1992, 1993 by Paul Wheaton
  5. // 1916 Brooks #205, Missoula, MT  59801
  6. //
  7. // voice phone:  (406)543-7543
  8. // modem phone:  (406)543-1144 (2400N81)
  9. //  CompuServe:  72707,207
  10. //    Internet:  72707.207@CompuServe.com
  11.  
  12. #include <WTime.h>
  13. #include <WLink.h>
  14. #include <WFile.h>
  15. #include <WStr.h>
  16.  
  17. typedef char FileNameType[13];
  18.  
  19. struct DirElementType
  20.   {
  21.     FileNameType Name;
  22.     Moment M;
  23.   };
  24.  
  25. CreateLinkedListClass(Directory,DirElementType);
  26.  
  27. void LoadDirectory(const char* DirMask,Moment StartMoment,Directory& D);
  28. void LoadDirectory(const char* DirMask,Directory& D);
  29. long DirCount(const char* DirMask);  // how many files match dirmask
  30.  
  31. typedef union
  32.   {
  33.     REGS R;
  34.     Word W[7];
  35.     Byte B[8];
  36.   } URegsType;
  37.  
  38. class Registers
  39.   {
  40.       URegsType UR;
  41.       friend void CallBIOS(Byte IntNum, Registers& R);
  42.     public:
  43.       Registers(Word ax=0,Word bx=0,Word cx=0,Word dx=0)
  44.           {AX()=ax;BX()=bx;CX()=cx;DX()=dx;}
  45.       Word& AX(){return UR.W[0];}
  46.       Word& BX(){return UR.W[1];}
  47.       Word& CX(){return UR.W[2];}
  48.       Word& DX(){return UR.W[3];}
  49.       Word& SI(){return UR.W[4];}
  50.       Word& DI(){return UR.W[5];}
  51.       Word& Flags(){return UR.W[6];}
  52.       Bool CF(){return ((UR.W[6]&1)>0);}
  53.       Bool PF(){return ((UR.W[6]&4)>0);}
  54.       Bool AF(){return ((UR.W[6]&16)>0);}
  55.       Bool ZF(){return ((UR.W[6]&64)>0);}
  56.       Bool SF(){return ((UR.W[6]&128)>0);}
  57.       Bool TF(){return ((UR.W[6]&256)>0);}
  58.       Bool IF(){return ((UR.W[6]&512)>0);}
  59.       Bool DF(){return ((UR.W[6]&1024)>0);}
  60.       Bool OF(){return ((UR.W[6]&2048)>0);}
  61.       Byte& AL(){return UR.B[0];}
  62.       Byte& AH(){return UR.B[1];}
  63.       Byte& BL(){return UR.B[2];}
  64.       Byte& BH(){return UR.B[3];}
  65.       Byte& CL(){return UR.B[4];}
  66.       Byte& CH(){return UR.B[5];}
  67.       Byte& DL(){return UR.B[6];}
  68.       Byte& DH(){return UR.B[7];}
  69.       #ifdef MAJORBBS
  70.         void* operator new(size_t size){return malloc(size);}
  71.         void  operator delete(void* p) {free(p);}
  72.       #endif
  73.   };
  74.  
  75. inline void CallBIOS(Byte IntNum, Registers& R){int86(IntNum,&R.UR.R,&R.UR.R);}
  76.  
  77. #endif
  78.