home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
pascal
/
bp7os2
/
bpos2r.001
/
DOS.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-12-02
|
6KB
|
160 lines
Unit Dos;
Interface
Const
fmClosed = $D7B0;
fmInput = $D7B1;
fmOutput = $D7B2;
fmInOut = $D7B3;
ReadOnly = $01;
Hidden = $02;
SysFile = $04;
Directory = $10;
Archive = $20;
AnyFile = $37;
Type
ComStr = String[127];
PathStr = String[79];
DirStr = String[67];
NameStr = String[8];
ExtStr = String[4];
FileRec = Record
Handle : Word;
Mode : Word;
RecSize : Word;
Private : Array[1..26] of Byte;
UserData : Array[1..16] of Byte;
Name : Array[0..79] of Char;
End;
TextBuf = Array[0..127] of Char;
TextRec = Record
Handle : Word;
Mode : Word;
BufSize : Word;
Private : Word;
BufPos : Word;
BufEnd : Word;
BufPtr : ^TextBuf;
OpenFunc : Pointer;
InOutFunc : Pointer;
FlushFunc : Pointer;
CloseFunc : Pointer;
UserData : Array[1..16] of Byte;
Name : Array[0..79] of Char;
Buffer : TextBuf;
End;
SearchRec = Record
Fill : Array[1..21] of Byte;
Attr : Byte;
Time : LongInt;
Size : LongInt;
Name : String[12];
End;
DateTime = Record
Year,Month,Day,Hour,Min,Sec : Word;
End;
TPID = Word;
TTID = Word;
TSel = Word;
PGlobalInfoSeg = ^TGlobalInfoSeg;
TGlobalInfoSeg = Record
time : LongInt;
msecs : LongInt;
hour : Byte;
minutes : Byte;
seconds : Byte;
hundredths : Byte;
timezone : Word;
cusecTimerInterval : Word;
day : Byte;
month : Byte;
year : Word;
weekday : Byte;
uchMajorVersion : Byte;
uchMinorVersion : Byte;
chRevisionLetter : Byte;
sgCurrent : Byte;
sgMax : Byte;
cHugeShift : Byte;
fProtectModeOnly : Byte;
pidForeground : Word;
fDynamicSched : Byte;
csecMaxWait : Byte;
cmsecMinSlice : Word;
cmsecMaxSlice : Word;
bootdrive : Word;
amecRAS : Array[1..32] of Byte;
csgWindowableVioMax : Byte;
csgPMMax : Byte;
End;
PLocalInfoSeg = ^TLocalInfoSeg;
TLocalInfoSeg = Record
pidCurrent : TPID;
pidParent : TPID;
prtyCurrent : Word;
tidCurrent : TTID;
sgCurrent : Word;
rfProcStatus : Byte;
dummy1 : Byte;
fForeground : WordBool;
typeProcess : Byte;
dummy2 : Byte;
selEnvironment : TSel;
offCmdLine : Word;
cbDataSegment : Word;
cbStack : Word;
cbHeap : Word;
hmod : Word;
selDS : TSel;
End;
Const
ExecFlags : Word = 0; { EXEC_SYNC }
Var
DosError : Integer;
GlobalInfoSeg : PGlobalInfoSeg;
LocalInfoSeg : PLocalInfoSeg;
Function DosVersion : Word;
Procedure GetDate(Var Year,Month,Day,DayofWeek : Word);
Procedure SetDate(Year,Month,Day,DayofWeek : 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 : PathStr;Attr : Word;Var S : SearchRec);
Procedure FindNext(Var S : SearchRec);
Procedure PackTime(Var T : DateTime;Var P : LongInt);
Procedure UnpackTime(P : LongInt;Var T : DateTime);
Function FSearch(Path : PathStr;DirList : String) : PathStr;
Function FExpand(Path : PathStr) : PathStr;
Procedure FSplit(Path : PathStr;Var Dir : DirStr;Var Name : NameStr;Var Ext : ExtStr);
Function EnvCount : Integer;
Function EnvStr(Index : Integer) : String;
Function GetEnv(EnvVar : String) : String;
Procedure Exec(Path : PathStr;ComLine : ComStr);
Function DosExitCode : Word;
Procedure PlaySound(Frequency,Duration : Word);