home *** CD-ROM | disk | FTP | other *** search
-
- { 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
- ModeOldFile = 1005;
- ModeNewFile = 1006;
-
- OffsetBeginning = -1;
- OffsetCurrent = 0;
- OffsetEnd = 1;
-
- SharedLock = -2;
- ExclusiveLock = -1;
- AccessRead = SharedLock;
- AccessWrite = ExclusiveLock;
-
- type
-
- DateStampRec = record
- dsDays : Integer;
- dsMinute : Integer;
- dsTick : Integer;
- end;
-
- FileHandle = Address;
- FileLock = Address;
- FileInfoBlock = record
- fibDiskKey : Integer;
- fibDirEntryType : Integer;
- fibFileName : Array [0..107] of Char;
- fibProtection : Integer;
- fibEntryType : Integer;
- fibSize : Integer;
- fibNumBlocks : Integer;
- fibDate : DateStampRec;
- fibComment : Array [0..115] of Char;
- end;
- FileInfoBlockPtr = ^FileInfoBlock;
-
- InfoData = record
- idNumSoftErrors : Integer;
- idUnitNumber : Integer;
- idDiskState : Integer;
- idNumBlocks : Integer;
- idNumBlocksUsed : Integer;
- idBytesPerBlock : Integer;
- idDiskType : Integer;
- idVolumeNode : Address;
- idInUse : Integer;
- end;
- InfoDataPtr = ^InfoData;
-
-
- { 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(f : Text): FileHandle;
- forward;
- Procedure DOSClose(f : FileHandle);
- forward;
- Function CreateDir(s : String): FileLock;
- forward;
- Function CurrentDir(l : FileLock): FileLock;
- forward;
- Function DeleteFile(s : String): Boolean;
- forward;
- Function DupLock(l : FileLock): FileLock;
- forward;
- Function Examine(l : FileLock; f : FileInfoBlockPtr): Boolean;
- forward;
- Function ExNext(l : FileLock; f : FileInfoBlockPtr): Boolean;
- forward;
- Function Info(l : FileLock; i : InfoDataPtr): Boolean;
- forward;
- Function Input() : FileHandle;
- forward;
- Function IOErr() : Integer;
- forward;
- Function IsInteractive(f : FileHandle): Boolean;
- forward;
- Function Lock(s : String; a : Integer): FileLock;
- forward;
- Function DOSOpen(s : String; a : Integer) : FileHandle;
- forward;
- Function Output() : FileHandle;
- forward;
- Function ParentDir(l : FileLock): FileLock;
- forward;
- Function DOSRead(f : FileHandle; b : Address; l : Integer) : Integer;
- forward;
- Function Rename(o, n : String) : Boolean;
- forward;
- Function Seek(f : FileHandle; p : Integer; m : Integer) : Integer;
- forward;
- Function SetComment(s, n : String): Boolean;
- forward;
- Function SetProtection(s : String; m : Integer): Boolean;
- forward;
- Procedure UnLock(l : FileLock);
- forward;
- Function WaitForChar(f : FileHandle; t : Integer): Boolean;
- forward;
- Function DOSWrite(f : FileHandle; b : Address; l : Integer) : Integer;
- forward;
- Function CreateProc(n : String; p: Integer; s : Address; t : Integer): Integer;
- forward;
- Procedure DateStamp(var v : DateStampRec);
- forward;
- Procedure Delay(t : Integer);
- forward;
- Function DeviceProc(n : String): Address;
- forward;
- Procedure DOSExit(r : Integer);
- forward;
- Function Execute(s : String; i, o : FileHandle): Boolean;
- forward;
- Function LoadSeg(n : String): Address;
- forward;
- Procedure UnLoadSeg(s : Address);
- forward;
-