home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d3xx
/
d339
/
pcq.lha
/
PCQ
/
Include
/
DOS.i
< prev
next >
Wrap
Text File
|
1990-03-19
|
6KB
|
222 lines
{ These are the definitions for the DOS library. Note that a
couple routine names had to be changed since they conflict
with Pascal function names.
Note, by the way, that you do not need to open the DOS library
before you use these. The startup code requires the DOS, and
thus opens it, so the implementation for this library just uses
that pointer. }
const
{ DOSTrue = -1;
DOSFalse = 0; Same as in Pascal...}
ModeReadWrite = 1004; { Open old file with exclusive lock }
ModeOldFile = 1005;
ModeNewFile = 1006;
OffsetBeginning = -1;
OffsetCurrent = 0;
OffsetEnd = 1;
SharedLock = -2;
ExclusiveLock = -1;
AccessRead = SharedLock;
AccessWrite = ExclusiveLock;
TicksPerSecond = 50;
type
DateStampRec = record
dsDays : Integer;
dsMinute : Integer;
dsTick : Integer;
end;
FileHandle = Address;
FileLock = Address;
FileInfoBlock = record { Must be on 4-byte boundary }
fibDiskKey : Integer;
fibDirEntryType : Integer;
fibFileName : Array [0..107] of Char;
fibProtection : Integer;
fibEntryType : Integer;
fibSize : Integer;
fibNumBlocks : Integer;
fibDate : DateStampRec;
fibComment : Array [0..79] of Char;
fibReserved : Array [0..35] of Char;
end;
FileInfoBlockPtr = ^FileInfoBlock;
const
FIBB_SCRIPT = 6;
FIBB_PURE = 5;
FIBB_ARCHIVE = 4;
FIBB_READ = 3;
FIBB_WRITE = 2;
FIBB_EXECUTE = 1;
FIBB_DELETE = 0;
FIBF_SCRIPT = $00000040;
FIBF_PURE = $00000020;
FIBF_ARCHIVE = $0000010;
FIBF_READ = $00000008;
FIBF_WRITE = $00000004;
FIBF_EXECUTE = $00000002;
FIBF_DELETE = $00000001;
type
InfoData = record { Also must be a four-byte boundary }
idNumSoftErrors : Integer;
idUnitNumber : Integer;
idDiskState : Integer;
idNumBlocks : Integer;
idNumBlocksUsed : Integer;
idBytesPerBlock : Integer;
idDiskType : Integer;
idVolumeNode : Address;
idInUse : Integer;
end;
InfoDataPtr = ^InfoData;
const
IDWriteProtected = 80;
IDValidating = 81;
IDValidated = 82;
{ Errors, from IoErr() and other sources... }
ErrorNoFreeStore = 103;
ErrorTaskTableFull = 105;
ErrorLineTooLong = 120;
ErrorFileNotObject = 121;
ErrorInvalidResidentLibrary = 122;
ErrorNoDefaultDir = 201;
ErrorObjectInUse = 202;
ErrorObjectExists = 203;
ErrorDirNotFound = 204;
ErrorObjectNotFound = 205;
ErrorBadStreamName = 206;
ErrorObjectTooLarge = 207;
ErrorActionNotKnown = 209;
ErrorInvalidComponentName = 210;
ErrorInvalidLock = 211;
ErrorObjectWrongType = 212;
ErrorDiskNotValidated = 213;
ErrorDiskWriteProtected = 214;
ErrorRenameAcrossDevices = 215;
ErrorDirectoryNotEmpty = 216;
ErrorTooManyLevels = 217;
ErrorDeviceNotMounted = 218;
ErrorSeekError = 219;
ErrorCommentTooBig = 220;
ErrorDiskFull = 221;
ErrorDeleteProtected = 222;
ErrorWriteProtected = 223;
ErrorReadProtected = 224;
ErrorNotADOSDisk = 225;
ErrorNoDisk = 226;
ErrorNoMoreEntries = 232; { ExNext() }
{ These are conventional values for DOS command return codes }
ReturnOK = 0;
ReturnWarn = 5;
ReturnError = 10;
ReturnFail = 20;
{ Bit numbers of break signals }
SigBreakBCtrlC = 12;
SigBreakBCtrlD = 13;
SigBreakBCtrlE = 14;
SigBreakBCtrlF = 15;
{ Corresponding bit values }
SigBreakFCtrlC = $00001000;
SigBreakFCtrlD = $00002000;
SigBreakFCtrlE = $00004000;
SigBreakFCtrlF = $00008000;
{ This first function is, of course, not an AmigaDOS function. What
it does is return the FileHandle of a normal PCQ file, in case you
want to do a Seek() or some other DOS function on it. If your file
is a type other than Text, just modify this declaration (it doesn't
actually matter what file type is used).
The only thing to keep in mind is that PCQ files always have the
next element buffered. Thus if you are going to mess with the file,
you should get the buffered element ( using filevar^ ) then, after
you have finished messing with it, fix the buffer with a call like
'get(filevar)'. }
Function GetFileHandle(VAR f : Text): FileHandle;
external;
Procedure DOSClose(f : FileHandle);
external;
Function CreateDir(s : String): FileLock;
external;
Function CurrentDir(l : FileLock): FileLock;
external;
Function DeleteFile(s : String): Boolean;
external;
Function DupLock(l : FileLock): FileLock;
external;
Function Examine(l : FileLock; f : FileInfoBlockPtr): Boolean;
external;
Function ExNext(l : FileLock; f : FileInfoBlockPtr): Boolean;
external;
Function Info(l : FileLock; i : InfoDataPtr): Boolean;
external;
Function DOSInput() : FileHandle;
external;
Function IoErr() : Integer;
external;
Function IsInteractive(f : FileHandle): Boolean;
external;
Function Lock(s : String; a : Integer): FileLock;
external;
Function DOSOpen(s : String; a : Integer) : FileHandle;
external;
Function DOSOutput() : FileHandle;
external;
Function ParentDir(l : FileLock): FileLock;
external;
Function DOSRead(f : FileHandle; b : Address; l : Integer) : Integer;
external;
Function Rename(o, n : String) : Boolean;
external;
Function Seek(f : FileHandle; p : Integer; m : Integer) : Integer;
external;
Function SetComment(s, n : String): Boolean;
external;
Function SetProtection(s : String; m : Integer): Boolean;
external;
Procedure UnLock(l : FileLock);
external;
Function WaitForChar(f : FileHandle; t : Integer): Boolean;
external;
Function DOSWrite(f : FileHandle; b : Address; l : Integer) : Integer;
external;
Function CreateProc(n : String; p: Integer; s : Address; t : Integer): Address;
external;
Procedure DateStamp(var v : DateStampRec);
external;
Procedure Delay(t : Integer);
external;
Function DeviceProc(n : String): Address;
external;
Procedure DOSExit(r : Integer);
external;
Function Execute(s : String; i, o : FileHandle): Boolean;
external;
Function LoadSeg(n : String): Address;
external;
Procedure UnLoadSeg(s : Address);
external;