Metropoli BBS
VIEWER: windos.pas MODE: TEXT (CP437)
{█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█}
{█                                                       █}
{█      Virtual Pascal Runtime Library.  Version 1.0.    █}
{█      OS/2 Presentation Manager DOS interface unit     █}
{█      ─────────────────────────────────────────────────█}
{█      Copyright (C) 1995,96 fPrint UK Ltd              █}
{█                                                       █}
{▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀}

{$S-,R-,Q-,I-,Cdecl-,OrgName-,AlignRec-,Delphi+,PureInt+}

unit WinDos;

interface

uses Os2Def, Os2Base, Use32;

const

{ Flags bit masks }

  fCarry     = $0001;
  fParity    = $0004;
  fAuxiliary = $0010;
  fZero      = $0040;
  fSign      = $0080;
  fOverflow  = $0800;

{ File mode magic numbers }

  fmClosed = $A55AD7B0;
  fmInput  = $A55AD7B1;
  fmOutput = $A55AD7B2;
  fmInOut  = $A55AD7B3;

{ File attribute constants }

  faReadOnly  = $01;
  faHidden    = $02;
  faSysFile   = $04;
  faVolumeID  = $08;    { For compatibility only, OS/2 doesn't use this attribute }
  faDirectory = $10;
  faArchive   = $20;
  faAnyFile   = $37;

{ Maximum file name component string lengths }

const
  fsPathName  = 259;
  fsDirectory = 255;
  fsFileName  = 255;
  fsExtension = 255;

{ FileSplit return flags }

const
  fcExtension = $0001;
  fcFileName  = $0002;
  fcDirectory = $0004;
  fcWildcards = $0008;

{ Typed-file and untyped-file record }

type
  TFileRec = record
    Handle:   Longint;                  { File Handle                }
    Mode:     Longint;                  { Current file mode          }
    RecSize:  Longint;                  { I/O operation record size  }
    Private:  array [1..28] of Byte;    { Reserved                   }
    UserData: array [1..32] of Byte;    { User data area             }
    Name:     array [0..259] of Char;   { File name (ASCIIZ)         }
  end;

{ Textfile record }

type
  PTextBuf = ^TTextBuf;
  TTextBuf = array[0..127] of Char;
  TTextRec = record
    Handle:    Longint;                 { File Handle                }
    Mode:      Longint;                 { Current file mode          }
    BufSize:   Longint;                 { Text File buffer size      }
    BufPos:    Longint;                 { Buffer current position    }
    BufEnd:    Longint;                 { Buffer ending position     }
    BufPtr:    PTextBuf;                { Pointer to the buffer      }
    OpenFunc:  Pointer;                 { Open Text File function @  }
    InOutFunc: Pointer;                 { In/Out ...                 }
    FlushFunc: Pointer;                 { Flush ...                  }
    CloseFunc: Pointer;                 { Close ...                  }
    UserData:  array [1..32] of Byte;   { User data area             }
    Name:      array [0..259] of Char;  { File name (ASCIIZ)         }
    Buffer:    TTextBuf;                { Default I/O buffer         }
  end;

{ Search record used by FindFirst and FindNext }

type
  TSearchRec = record
    HDir: Longint;
    Attr: Byte;
    Time: Longint;
    Size: Longint;
    Name: array[0..fsFileName] of Char;
  end;

{ Date and time record used by PackTime and UnpackTime }

type
  TDateTime = record
    Year, Month, Day, Hour, Min, Sec: Word;
  end;

{ Error status variable }

threadvar
  DosError: Integer;

function DosVersion: Word;
procedure GetDate(var Year, Month, Day, DayOfWeek: Word);
procedure SetDate(Year, Month, Day: Word);
procedure GetTime(var Hour, Minute, Second, Sec100: Word);
procedure SetTime(Hour, Minute, Second, Sec100: Word);
procedure GetVerify(var Verify: Boolean);
procedure SetVerify(Verify: Boolean);
function DiskFree(Drive: Byte): Longint;
function DiskSize(Drive: Byte): Longint;
procedure GetFAttr(var F; var Attr: Word);
procedure SetFAttr(var F; Attr: Word);
procedure GetFTime(var F; var Time: Longint);
procedure SetFTime(var F; Time: Longint);
procedure FindFirst(Path: PChar; Attr: Word; var F: TSearchRec);
procedure FindNext(var F: TSearchRec);
procedure UnpackTime(P: Longint; var T: TDateTime);
procedure PackTime(var T: TDateTime; var P: Longint);
function FileSearch(Dest, Name, List: PChar): PChar;
function FileExpand(Dest, Name: PChar): PChar;
function FileSplit(Path, Dir, Name, Ext: PChar): Word;
function GetCurDir(Dir: PChar; Drive: Byte): PChar;
procedure SetCurDir(Dir: PChar);
procedure CreateDir(Dir: PChar);
procedure RemoveDir(Dir: PChar);
function GetArgCount: Integer;
function GetArgStr(Dest: PChar; Index: Integer; MaxLen: Word): PChar;
function GetEnvVar(VarName: PChar): PChar;

{ The following procedures are not implemented

procedure Intr(IntNo: Byte; var Regs: TRegisters);
procedure MsDos(var Regs: TRegisters);
procedure GetCBreak(var Break: Boolean);
procedure SetCBreak(Break: Boolean);
procedure GetIntVec(IntNo: Byte; var Vector: Pointer);
procedure SetIntVec(IntNo: Byte; Vector: Pointer);

}

{ The following support have been added }

procedure FindClose(var F: TSearchRec);

implementation

uses Strings;

end.
[ RETURN TO DIRECTORY ]