home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / bp7os2 / bpos2r.001 / DOS.PAS < prev    next >
Pascal/Delphi Source File  |  1993-12-02  |  6KB  |  160 lines

  1. Unit Dos;
  2.  
  3. Interface
  4.  
  5. Const
  6.   fmClosed = $D7B0;
  7.   fmInput  = $D7B1;
  8.   fmOutput = $D7B2;
  9.   fmInOut  = $D7B3;
  10.  
  11.   ReadOnly  = $01;
  12.   Hidden    = $02;
  13.   SysFile   = $04;
  14.   Directory = $10;
  15.   Archive   = $20;
  16.   AnyFile   = $37;
  17.  
  18. Type
  19.   ComStr  = String[127];
  20.   PathStr = String[79];
  21.   DirStr  = String[67];
  22.   NameStr = String[8];
  23.   ExtStr  = String[4];
  24.  
  25.   FileRec = Record
  26.               Handle   : Word;
  27.               Mode     : Word;
  28.               RecSize  : Word;
  29.               Private  : Array[1..26] of Byte;
  30.               UserData : Array[1..16] of Byte;
  31.               Name     : Array[0..79] of Char;
  32.             End;
  33.  
  34.   TextBuf = Array[0..127] of Char;
  35.  
  36.   TextRec = Record
  37.               Handle    : Word;
  38.               Mode      : Word;
  39.               BufSize   : Word;
  40.               Private   : Word;
  41.               BufPos    : Word;
  42.               BufEnd    : Word;
  43.               BufPtr    : ^TextBuf;
  44.               OpenFunc  : Pointer;
  45.               InOutFunc : Pointer;
  46.               FlushFunc : Pointer;
  47.               CloseFunc : Pointer;
  48.               UserData  : Array[1..16] of Byte;
  49.               Name      : Array[0..79] of Char;
  50.               Buffer    : TextBuf;
  51.             End;
  52.  
  53.  
  54.   SearchRec = Record
  55.                 Fill : Array[1..21] of Byte;
  56.                 Attr : Byte;
  57.                 Time : LongInt;
  58.                 Size : LongInt;
  59.                 Name : String[12];
  60.               End;
  61.  
  62.  
  63.   DateTime = Record
  64.                Year,Month,Day,Hour,Min,Sec : Word;
  65.              End;
  66.  
  67.  
  68.   TPID = Word;
  69.   TTID = Word;
  70.   TSel = Word;
  71.  
  72.  
  73.   PGlobalInfoSeg = ^TGlobalInfoSeg;
  74.   TGlobalInfoSeg = Record
  75.                      time                : LongInt;
  76.                      msecs               : LongInt;
  77.                      hour                : Byte;
  78.                      minutes             : Byte;
  79.                      seconds             : Byte;
  80.                      hundredths          : Byte;
  81.                      timezone            : Word;
  82.                      cusecTimerInterval  : Word;
  83.                      day                 : Byte;
  84.                      month               : Byte;
  85.                      year                : Word;
  86.                      weekday             : Byte;
  87.                      uchMajorVersion     : Byte;
  88.                      uchMinorVersion     : Byte;
  89.                      chRevisionLetter    : Byte;
  90.                      sgCurrent           : Byte;
  91.                      sgMax               : Byte;
  92.                      cHugeShift          : Byte;
  93.                      fProtectModeOnly    : Byte;
  94.                      pidForeground       : Word;
  95.                      fDynamicSched       : Byte;
  96.                      csecMaxWait         : Byte;
  97.                      cmsecMinSlice       : Word;
  98.                      cmsecMaxSlice       : Word;
  99.                      bootdrive           : Word;
  100.                      amecRAS             : Array[1..32] of Byte;
  101.                      csgWindowableVioMax : Byte;
  102.                      csgPMMax            : Byte;
  103.                    End;
  104.  
  105.   PLocalInfoSeg = ^TLocalInfoSeg;
  106.   TLocalInfoSeg  = Record
  107.                      pidCurrent          : TPID;
  108.                      pidParent           : TPID;
  109.                      prtyCurrent         : Word;
  110.                      tidCurrent          : TTID;
  111.                      sgCurrent           : Word;
  112.                      rfProcStatus        : Byte;
  113.                      dummy1              : Byte;
  114.                      fForeground         : WordBool;
  115.                      typeProcess         : Byte;
  116.                      dummy2              : Byte;
  117.                      selEnvironment      : TSel;
  118.                      offCmdLine          : Word;
  119.                      cbDataSegment       : Word;
  120.                      cbStack             : Word;
  121.                      cbHeap              : Word;
  122.                      hmod                : Word;
  123.                      selDS               : TSel;
  124.                    End;
  125.  
  126. Const
  127.   ExecFlags     : Word = 0;   { EXEC_SYNC }
  128. Var
  129.   DosError      : Integer;
  130.   GlobalInfoSeg : PGlobalInfoSeg;
  131.   LocalInfoSeg  : PLocalInfoSeg;
  132.  
  133.   Function  DosVersion : Word;
  134.   Procedure GetDate(Var Year,Month,Day,DayofWeek : Word);
  135.   Procedure SetDate(Year,Month,Day,DayofWeek : Word);
  136.   Procedure GetTime(Var Hour,Minute,Second,Sec100 : Word);
  137.   Procedure SetTime(Hour,Minute,Second,Sec100 : Word);
  138.   Procedure GetVerify(Var Verify : Boolean);
  139.   Procedure SetVerify(Verify : Boolean);
  140.   Function  DiskFree(Drive : Byte) : LongInt;
  141.   Function  DiskSize(Drive : Byte) : LongInt;
  142.   Procedure GetFAttr(Var f;Var Attr : Word);
  143.   Procedure SetFAttr(Var f;Attr : Word);
  144.   Procedure GetFTime(Var f;Var Time : LongInt);
  145.   Procedure SetFTime(Var f;Time : LongInt);
  146.   Procedure FindFirst(Path : PathStr;Attr : Word;Var S : SearchRec);
  147.   Procedure FindNext(Var S : SearchRec);
  148.   Procedure PackTime(Var T : DateTime;Var P : LongInt);
  149.   Procedure UnpackTime(P : LongInt;Var T : DateTime);
  150.   Function  FSearch(Path : PathStr;DirList : String) : PathStr;
  151.   Function  FExpand(Path : PathStr) : PathStr;
  152.   Procedure FSplit(Path : PathStr;Var Dir : DirStr;Var Name : NameStr;Var Ext : ExtStr);
  153.   Function  EnvCount : Integer;
  154.   Function  EnvStr(Index : Integer) : String;
  155.   Function  GetEnv(EnvVar : String) : String;
  156.   Procedure Exec(Path : PathStr;ComLine : ComStr);
  157.   Function  DosExitCode : Word;
  158.   Procedure PlaySound(Frequency,Duration : Word);
  159.  
  160.