home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l044 / 2.ddi / INTRFACE.ZIP / DOS.INT < prev    next >
Encoding:
Text File  |  1990-10-23  |  4.3 KB  |  152 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Turbo Pascal Version 6.0                        }
  5. {       DOS Interface Unit                              }
  6. {                                                       }
  7. {       Copyright (C) 1987, 1990 Borland International  }
  8. {                                                       }
  9. {*******************************************************}
  10.  
  11. unit Dos;
  12.  
  13. {$D-,I-,S-}
  14.  
  15. interface
  16.  
  17. const
  18.  
  19. { Flags bit masks }
  20.  
  21.   FCarry     = $0001;
  22.   FParity    = $0004;
  23.   FAuxiliary = $0010;
  24.   FZero      = $0040;
  25.   FSign      = $0080;
  26.   FOverflow  = $0800;
  27.  
  28. { File mode magic numbers }
  29.  
  30.   fmClosed = $D7B0;
  31.   fmInput  = $D7B1;
  32.   fmOutput = $D7B2;
  33.   fmInOut  = $D7B3;
  34.  
  35. { File attribute constants }
  36.  
  37.   ReadOnly  = $01;
  38.   Hidden    = $02;
  39.   SysFile   = $04;
  40.   VolumeID  = $08;
  41.   Directory = $10;
  42.   Archive   = $20;
  43.   AnyFile   = $3F;
  44.  
  45. type
  46.  
  47. { String types }
  48.  
  49.   ComStr  = string[127];        { Command line string }
  50.   PathStr = string[79];         { Full file path string }
  51.   DirStr  = string[67];         { Drive and directory string }
  52.   NameStr = string[8];          { File name string }
  53.   ExtStr  = string[4];          { File extension string }
  54.  
  55. { Registers record used by Intr and MsDos }
  56.  
  57.   Registers = record
  58.                 case Integer of
  59.                   0: (AX,BX,CX,DX,BP,SI,DI,DS,ES,Flags: Word);
  60.                   1: (AL,AH,BL,BH,CL,CH,DL,DH: Byte);
  61.               end;
  62.  
  63. { Typed-file and untyped-file record }
  64.  
  65.   FileRec = record
  66.               Handle: Word;
  67.               Mode: Word;
  68.               RecSize: Word;
  69.               Private: array[1..26] of Byte;
  70.               UserData: array[1..16] of Byte;
  71.               Name: array[0..79] of Char;
  72.             end;
  73.  
  74. { Textfile record }
  75.  
  76.   TextBuf = array[0..127] of Char;
  77.   TextRec = record
  78.               Handle: Word;
  79.               Mode: Word;
  80.               BufSize: Word;
  81.               Private: Word;
  82.               BufPos: Word;
  83.               BufEnd: Word;
  84.               BufPtr: ^TextBuf;
  85.               OpenFunc: Pointer;
  86.               InOutFunc: Pointer;
  87.               FlushFunc: Pointer;
  88.               CloseFunc: Pointer;
  89.               UserData: array[1..16] of Byte;
  90.               Name: array[0..79] of Char;
  91.               Buffer: TextBuf;
  92.             end;
  93.  
  94. { Search record used by FindFirst and FindNext }
  95.  
  96.   SearchRec = record
  97.                 Fill: array[1..21] of Byte;
  98.                 Attr: Byte;
  99.                 Time: Longint;
  100.                 Size: Longint;
  101.                 Name: string[12];
  102.               end;
  103.  
  104. { Date and time record used by PackTime and UnpackTime }
  105.  
  106.   DateTime = record
  107.                Year,Month,Day,Hour,Min,Sec: Word;
  108.              end;
  109.  
  110. var
  111.  
  112. { Error status variable }
  113.  
  114.   DosError: Integer;
  115.  
  116.  
  117. function DosVersion: Word;
  118. procedure Intr(IntNo: Byte; var Regs: Registers);
  119. procedure MsDos(var Regs: Registers);
  120. procedure GetDate(var Year,Month,Day,DayOfWeek: Word);
  121. procedure SetDate(Year,Month,Day: Word);
  122. procedure GetTime(var Hour,Minute,Second,Sec100: Word);
  123. procedure SetTime(Hour,Minute,Second,Sec100: Word);
  124. procedure GetCBreak(var Break: Boolean);
  125. procedure SetCBreak(Break: Boolean);
  126. procedure GetVerify(var Verify: Boolean);
  127. procedure SetVerify(Verify: Boolean);
  128. function DiskFree(Drive: Byte): Longint;
  129. function DiskSize(Drive: Byte): Longint;
  130. procedure GetFAttr(var F; var Attr: Word);
  131. procedure SetFAttr(var F; Attr: Word);
  132. procedure GetFTime(var F; var Time: Longint);
  133. procedure SetFTime(var F; Time: Longint);
  134. procedure FindFirst(Path: PathStr; Attr: Word; var F: SearchRec);
  135. procedure FindNext(var F: SearchRec);
  136. procedure UnpackTime(P: Longint; var T: DateTime);
  137. procedure PackTime(var T: DateTime; var P: Longint);
  138. procedure GetIntVec(IntNo: Byte; var Vector: Pointer);
  139. procedure SetIntVec(IntNo: Byte; Vector: Pointer);
  140. procedure SwapVectors;
  141. procedure Keep(ExitCode: Word);
  142. procedure Exec(Path: PathStr; ComLine: ComStr);
  143. function DosExitCode: Word;
  144. function FSearch(Path: PathStr; DirList: String): PathStr;
  145. function FExpand(Path: PathStr): PathStr;
  146. procedure FSplit(Path: PathStr; var Dir: DirStr;
  147.   var Name: NameStr; var Ext: ExtStr);
  148. function EnvCount: Integer;
  149. function EnvStr(Index: Integer): String;
  150. function GetEnv(EnvVar: String): String;
  151.  
  152.