home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD2.bin
/
bbs
/
dev
/
oberon-a-1.4ß.lha
/
Oberon-A
/
source
/
amiga
/
Dos.mod
< prev
next >
Wrap
Text File
|
1994-08-08
|
87KB
|
2,578 lines
(***************************************************************************
$RCSfile: Dos.mod $
Description: Interface to dos.library
Created by: fjc (Frank Copeland)
$Revision: 3.2 $
$Author: fjc $
$Date: 1994/08/08 00:52:02 $
Includes Release 40.15
(C) Copyright 1985-1993 Commodore-Amiga, Inc.
All Rights Reserved
Oberon-A interface Copyright © 1994, Frank Copeland.
This file is part of the Oberon-A Interface.
See Oberon-A.doc for conditions of use and distribution.
***************************************************************************)
MODULE Dos;
(*
** $C- CaseChk $I- IndexChk $L+ LongAdr $N- NilChk
** $P- PortableCode $R- RangeChk $S- StackChk $T- TypeChk
** $V- OvflChk $Z- ZeroVars
*)
IMPORT E := Exec, T := Timer, U := Utility, SYS := SYSTEM;
(*
** Missing include files:
**
** dos/stdio.h (uses C multiple parameters)
*)
(**-- Pointer declarations ---------------------------------------------*)
TYPE
DatePtr* = CPOINTER TO Date;
FileInfoBlockPtr* = CPOINTER TO FileInfoBlock;
InfoDataPtr* = CPOINTER TO InfoData;
DateTimePtr* = CPOINTER TO DateTime;
AChainPtr* = CPOINTER TO AChain;
AnchorPathPtr* = CPOINTER TO AnchorPath;
DosEnvecPtr* = BPOINTER TO DosEnvec;
FileSysStartupMsgPtr* = BPOINTER TO FileSysStartupMsg;
DeviceNodePtr* = CPOINTER TO DeviceNode;
NotifyRequestPtr* = CPOINTER TO NotifyRequest;
NotifyMessagePtr* = CPOINTER TO NotifyMessage;
CSourcePtr* = CPOINTER TO CSource;
RDArgsPtr* = CPOINTER TO RDArgs;
RecordLockPtr* = CPOINTER TO RecordLock;
LocalVarPtr* = CPOINTER TO LocalVar;
ExAllDataPtr* = CPOINTER TO ExAllData;
ExAllControlPtr* = CPOINTER TO ExAllControl;
ProcessPtr* = CPOINTER TO Process;
FileHandlePtr* = BPOINTER TO FileHandle;
DosPacketPtr* = CPOINTER TO DosPacket;
StandardPacketPtr* = CPOINTER TO StandardPacket;
TaskArrayPtr* = BPOINTER TO TaskArray;
RootNodePtr* = CPOINTER TO RootNode;
ErrorStringPtr* = CPOINTER TO ErrorString;
DosLibraryPtr* = CPOINTER TO DosLibrary;
CliProcListPtr* = CPOINTER TO CliProcList;
DosInfoPtr* = BPOINTER TO DosInfo;
SegmentPtr* = CPOINTER TO Segment;
CommandLineInterfacePtr* = BPOINTER TO CommandLineInterface;
DeviceListPtr* = BPOINTER TO DeviceList;
DevInfoPtr* = BPOINTER TO DevInfo;
AssignListPtr* = CPOINTER TO AssignList;
DosListPtr* = BPOINTER TO DosList;
DevProcPtr* = CPOINTER TO DevProc;
FileLockPtr* = BPOINTER TO FileLock;
ProcessId* = E.MsgPortPtr; (* Points to Process.msgPort *)
DosListNodePtr* = CPOINTER TO DosListNode;
(*
** $VER: dos.h 36.27 (5.4.92)
**
** Standard header for AmigaDOS
*)
CONST
name * = "dos.library";
(* Predefined Amiga DOS global constants *)
TRUE * = -1;
FALSE * = 0;
(* Mode parameter to Open() *)
modeOldFile * = 1005; (* Open existing file read/write
* positioned at beginning of file. *)
modeNewFile * = 1006; (* Open freshly created file (delete
* old file) read/write, exclusive lock. *)
modeReadWrite * = 1004; (* Open old file w/shared lock,
* creates file if doesn't exist. *)
(* Relative position to Seek() *)
offsetBeginning * = -1; (* relative to Begining Of File *)
offsetCurrent * = 0; (* relative to Current file position *)
offsetEnd * = 1; (* relative to End Of File *)
bitsPerByte * = 8;
bytesPerLong * = 4;
bitsPerLong * = 32;
maxInt * = 7FFFFFFFH;
minInt * = 80000000H;
(* Passed as type to Lock() *)
sharedLock * = -2; (* File is readable by others *)
accessRead * = -2; (* Synonym *)
exclusiveLock * = -1; (* No other access allowed *)
accessWrite * = -1; (* Synonym *)
TYPE
(*
** Note that the type name has been changed from DateStamp to Date to
** avoid a name clash with the DateStamp() function.
*)
Date* = RECORD
days * : LONGINT; (* Number of days since Jan. 1, 1978 *)
minute* : LONGINT; (* Number of minutes past midnight *)
tick * : LONGINT; (* Number of ticks past minute *)
END; (* Date *)
CONST
ticksPerSecond * = 50; (* Number of ticks in one second *)
TYPE
(* Returned by Examine() and ExNext(), must be on a 4 byte boundary *)
FileInfoBlock* = RECORD
diskKey * : LONGINT;
dirEntryType* : LONGINT;
(* Type of Directory. If < 0, then a plain file.
* If > 0 a directory *)
fileName * : ARRAY 108 OF CHAR;
(* Null terminated. Max 30 chars used for now *)
protection * : SET; (* bit mask of protection, rwxd are 3-0. *)
entryType * : LONGINT;
size * : LONGINT; (* Number of bytes in file *)
numBlocks * : LONGINT; (* Number of blocks in file *)
date * : Date; (* Date file last changed *)
comment * : ARRAY 80 OF CHAR;
(* Null terminated comment associated with file *)
(* Note: the following fields are not supported by all filesystems. *)
(* They should be initialized to 0 sending an ACTION_EXAMINE packet. *)
(* When Examine() is called, these are set to 0 for you. *)
(* AllocDosObject() also initializes them to 0. *)
ownerUID * : E.UWORD; (* owner's UID *)
ownerGID * : E.UWORD; (* owner's GID *)
reserved * : ARRAY 32 OF CHAR;
END; (* FileInfoBlock *)
CONST
(* fib stands for FileInfoBlock *)
(* Bit definitions *)
(* Regular RWED bits are 0 == allowed. *)
(* NOTE: GRP and OTR RWED permissions are 0 == not allowed! *)
(* Group and Other permissions are not directly handled by the filesystem *)
fibOtrRead * = 15; (* Other: file is readable *)
fibOtrWrite * = 14; (* Other: file is writable *)
fibOtrExecute * = 13; (* Other: file is executable *)
fibOtrDelete * = 12; (* Other: prevent file from being deleted *)
fibGrpRead * = 11; (* Group: file is readable *)
fibGrpWrite * = 10; (* Group: file is writable *)
fibGrpExecute * = 9; (* Group: file is executable *)
fibGrpDelete * = 8; (* Group: prevent file from being deleted *)
fibScript * = 6; (* program is a script (execute) file *)
fibPure * = 5; (* program is reentrant and rexecutable *)
fibArchive * = 4; (* cleared whenever file is changed *)
fibReadProt * = 3; (* ignored by old filesystem *)
fibWriteProt * = 2; (* ignored by old filesystem *)
fibExecute * = 1; (* ignored by system, used by Shell *)
fibDelete * = 0; (* prevent file from being deleted *)
(* Standard maximum length for an error string from fault. However, most *)
(* error strings should be kept under 60 characters if possible. Don't *)
(* forget space for the header you pass in. *)
faultMax * = 82;
TYPE
(* All BCPL data must be long word aligned. BCPL pointers are the long word
* address (i.e byte address divided by 4 (>>2)) *)
BPTR* = SYS.BPTR; (* Long word pointer *)
BSTR* = BPOINTER TO ARRAY 256 OF CHAR; (* Long word pointer to BCPL string *)
(* BCPL strings have a length in the first byte and then the characters.
* For example: s[0]=3 s[1]=S s[2]=Y s[3]=S *)
(* returned by Info(), must be on a 4 byte boundary *)
InfoData* = RECORD
numSoftErrors* : LONGINT; (* number of soft errors on disk *)
unitNumber * : LONGINT; (* Which unit disk is (was) mounted on *)
diskState * : LONGINT; (* See defines below *)
numBlocks * : LONGINT; (* Number of blocks on disk *)
numBlocksUsed* : LONGINT; (* Number of block in use *)
bytesPerBlock* : LONGINT;
diskType * : LONGINT; (* Disk Type code *)
volumeNode * : DeviceListPtr;(* BCPL pointer to volume node *)
inUse * : LONGINT; (* Flag, zero if not in use *)
END; (* InfoData *)
CONST
(* id stands for InfoData *)
(* Disk states *)
idWriteProtect * = 80; (* Disk is write protected *)
idValidating * = 81; (* Disk is currently being validated *)
idValidated * = 82; (* Disk is consistent and writeable *)
(* Disk types *)
(* idInter* use international case comparison routines for hashing *)
idNoDiskPresent * = -1;
idUnreadableDisk * = 42414400H; (* 'BAD\0' *)
idDosDisk * = 444F5300H; (* 'DOS\0' *)
idFfsDisk * = 444F5301H; (* 'DOS\1' *)
idInterDosDisk * = 444F5302H; (* 'DOS\2' *)
idInterFfsDisk * = 444F5303H; (* 'DOS\3' *)
idNotReallyDos * = 4E444F53H; (* 'NDOS' *)
idKickstartDisk * = 4B49434BH; (* 'KICK' *)
idMsdosDisk * = 4D534400H; (* 'MSD\0' *)
(* Errors from IoErr(), etc. *)
errorNoFreeStore * = 103;
errorTaskTableFull * = 105;
errorBadTemplate * = 114;
errorBadNumber * = 115;
errorRequiredArgMissing * = 116;
errorKeyNeedsArg * = 117;
errorTooManyArgs * = 118;
errorUnmatchedQuotes * = 119;
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;
(* added for 1.4 *)
errorIsSoftLink * = 233;
errorObjectLinked * = 234;
errorBadHunk * = 235;
errorNotImplemented * = 236;
errorRecordNotLocked * = 240;
errorLockCollision * = 241;
errorLockTimeout * = 242;
errorUnlockError * = 243;
(* error codes 303-305 are defined in dosasl.h *)
(* These are the return codes used by convention by AmigaDOS commands *)
(* See FAILAT and IF for relvance to EXECUTE files *)
returnOk * = 0; (* No problems, success *)
returnWarn * = 5; (* A warning only *)
returnError * = 10; (* Something wrong *)
returnFail * = 20; (* Complete or severe failure*)
(* Bit numbers that signal you that a user has issued a break *)
sigBreakCtrlC * = 12;
sigBreakCtrlD * = 13;
sigBreakCtrlE * = 14;
sigBreakCtrlF * = 15;
(* Values returned by SameLock() *)
lockDifferent * = -1;
lockSame * = 0;
lockSameVolume * = 1; (* locks are on same volume *)
lockSameHandler * = lockSameVolume;
(* lockSameHandler was a misleading name, def kept for src compatibility *)
(* types for ChangeMode() *)
changeLock * = 0;
changeFH * = 1;
(* Values for MakeLink() *)
linkHard * = 0;
linkSoft * = 1; (* softlinks are not fully supported yet *)
(* values returned by ReadItem *)
itemEqual * = -2; (* "=" Symbol *)
itemItemError * = -1; (* error *)
itemNothing * = 0; (* *N, ;, endstreamch *)
itemUnQuoted * = 1; (* unquoted item *)
itemQuoted * = 2; (* quoted item *)
(* types for AllocDosObject/FreeDosObject *)
fileHandle * = 0; (* few people should use this *)
exAllControl * = 1; (* Must be used to allocate this! *)
fib * = 2; (* useful *)
stdPkt * = 3; (* for doing packet-level I/O *)
cli * = 4; (* for shell-writers, etc *)
rdArgs * = 5; (* for ReadArgs if you pass it in *)
(*
** $VER: datetime.h 36.7 (12.7.90)
**
** Date and time header for AmigaDOS
*)
(*
* Data structures and equates used by the V1.4 DOS functions
* StrtoDate() and DatetoStr()
*)
CONST
(* You need this much room for each of the DateTime strings: *)
lenDatString * = 16;
TYPE
DatString * = ARRAY lenDatString OF CHAR;
DatStringPtr * = CPOINTER TO DatString;
(* --------- String/Date structures etc *)
DateTime* = RECORD (Date) (* DOS Date *)
format * : E.UBYTE; (* controls appearance of datStrDate *)
flags * : E.BSET; (* see BITDEF's below *)
strDay * : DatStringPtr; (* day of the week string *)
strDate* : DatStringPtr; (* date string *)
strTime* : DatStringPtr; (* time string *)
END; (* DateTime *)
CONST
(* flags for datFlags *)
dtSubst * = 0; (* substitute Today, Tomorrow, etc. *)
dtFuture * = 1; (* day of the week is in future *)
(*
* date format values
*)
formatDos * = 0; (* dd-mmm-yy *)
formatInt * = 1; (* yy-mm-dd *)
formatUSA * = 2; (* mm-dd-yy *)
formatCDN * = 3; (* dd-mm-yy *)
formatMax * = formatCDN;
(*
** $VER: dosasl.h 36.16 (2.5.91)
**
** Pattern-matching structure definitions
*)
(***********************************************************************
************************ PATTERN MATCHING ******************************
************************************************************************
* structure expected by MatchFirst, MatchNext.
* Allocate this structure and initialize it as follows:
*
* Set apBreakBits to the signal bits (CDEF) that you want to take a
* break on, or NULL, if you don't want to convenience the user.
*
* If you want to have the FULL PATH NAME of the files you found,
* allocate a buffer at the END of this structure, and put the size of
* it into apStrlen. If you don't want the full path name, make sure
* you set apStrlen to zero. In this case, the name of the file, and stats
* are available in the apInfo, as per usual.
*
* Then call MatchFirst() and then afterwards, MatchNext() with this structure.
* You should check the return value each time (see below) and take the
* appropriate action, ultimately calling MatchEnd() when there are
* no more files and you are done. You can tell when you are done by
* checking for the normal AmigaDOS return code errornomoreENTRIES.
*
*)
TYPE
AnchorPath* = RECORD
base * : AChainPtr; (* pointer to first anchor *)
last * : AChainPtr; (* pointer to last anchor *)
breakBits * : SET; (* Bits we want to break on *)
foundBreak* : SET; (* Bits we broke on. Also returns errorBREAK *)
flags * : E.BSET; (* New use for extra word. *)
reserved * : E.BYTE;
strlen * : INTEGER; (* This is what apLength used to be *)
info * : FileInfoBlock;
buf * : ARRAY 256 OF CHAR;
(* Buffer for path name, allocated by user *)
END; (* AnchorPath *)
CONST
apDoWild * = 0; (* User option ALL *)
apItsWild * = 1; (* Set by MatchFirst, used by MatchNext *)
(* Application can test apItsWild, too *)
(* (means that there's a wildcard *)
(* in the pattern after calling *)
(* MatchFirst). *)
apDoDir * = 2; (* Bit is SET if a DIR node should be *)
(* entered. Application can RESET this *)
(* bit after MatchFirst/MatchNext to AVOID *)
(* entering a dir. *)
apDidDir * = 3; (* Bit is SET for an "expired" dir node. *)
apNoMemErr * = 4; (* Set on memory error *)
apDoDot * = 5; (* If set, allow conversion of '.' to *)
(* CurrentDir *)
apDirChanged * = 6; (* apcurrent->anLock changed *)
(* since last MatchNext call *)
apFollowHLinks* = 7; (* follow hardlinks on DODIR - defaults *)
(* to not following hardlinks on a DODIR. *)
TYPE
AChain* = RECORD
child * : AChainPtr;
parent * : AChainPtr;
lock * : FileLockPtr;
info * : FileInfoBlock;
flags * : E.BSET;
string * : ARRAY 256 OF CHAR;
END; (* AChain *)
CONST
ddPatternBit * = 0;
ddExaminedBit* = 1;
ddCompleted * = 2;
ddAllBit * = 3;
ddSingle * = 4;
(*
* Constants used by wildcard routines, these are the pre-parsed tokens
* referred to by pattern match. It is not necessary for you to do
* anything about these, MatchFirst() MatchNext() handle all these for you.
*)
pAny * = 80H; (* Token for '*' or '#? *)
pSingle * = 81H; (* Token for '?' *)
pOrStart * = 82H; (* Token for '(' *)
pOrNext * = 83H; (* Token for '|' *)
pOeEnd * = 84H; (* Token for ')' *)
pNot * = 85H; (* Token for '~' *)
pNotEnd * = 86H; (* Token for *)
pNotClass * = 87H; (* Token for '^' *)
pClass * = 88H; (* Token for '[]' *)
pRepBeg * = 89H; (* Token for '[' *)
pRepEnd * = 8AH; (* Token for ']' *)
pStop * = 8BH; (* token to force end of evaluation *)
(* Values for anStatus, NOTE: These are the actual bit numbers *)
complexBit * = 1; (* Parsing complex pattern *)
examineBit * = 2; (* Searching directory *)
(*
* Returns from MatchFirst(), MatchNext()
* You can also get dos error returns, such as errornomoreENTRIES,
* these are in the dos.h file.
*)
errorBufferOverflow * = 303; (* User or internal buffer overflow *)
errorBreak * = 304; (* A break character was received *)
errorNotExecutable * = 305; (* A file has E bit cleared *)
(*
** $VER: doshunks.h 36.9 (2.6.92)
**
** Hunk definitions for object and load modules.
*)
CONST
(* hunk types *)
hunkUnit * = 999;
hunkName * = 1000;
hunkCode * = 1001;
hunkData * = 1002;
hunkBSS * = 1003;
hunkReloc32 * = 1004;
hunkAbsReloc32 * = hunkReloc32;
hunkReloc16 * = 1005;
hunkRelReloc16 * = hunkReloc16;
hunkReloc8 * = 1006;
hunkRelReloc8 * = hunkReloc8;
hunkExt * = 1007;
hunkSymbol * = 1008;
hunkDebug * = 1009;
hunkEnd * = 1010;
hunkHeader * = 1011;
hunkOverlay * = 1013;
hunkBreak * = 1014;
hunkDRel32 * = 1015;
hunkDRel16 * = 1016;
hunkDRel8 * = 1017;
hunkLib * = 1018;
hunkIndex * = 1019;
(*
* Note: V37 LoadSeg uses 1015 (hunkDRel32) by mistake. This will continue
* to be supported in future versions, since hunkDRel32 is illegal in load files
* anyways. Future versions will support both 1015 and 1020, though anything
* that should be usable under V37 should use 1015.
*)
hunkReloc32Short * = 1020;
(* see ext_xxx below. New for V39 (note that LoadSeg only handles relReloc32).*)
hunkRelReloc32 * = 1021;
hunkAbsReloc16 * = 1022;
(*
* Any hunks that have the hunkAdvisory bit set will be ignored if they
* aren't understood. When ignored, they're treated like hunkDebug hunks.
* NOTE: this handling of hunkAdvisory started as of V39 dos.library! If
* lading such executables is attempted under <V39 dos, it will fail with a
* bad hunk type.
*)
hunkAdvisory * = 29;
hunkChip * = 30;
hunkFast * = 31;
(* hunkext sub-types *)
extSymb * = 0; (* symbol table *)
extDef * = 1; (* relocatable definition *)
extAbs * = 2; (* Absolute definition *)
extRes * = 3; (* no longer supported *)
extRef32 * = 129; (* 32 bit reference to symbol *)
extAbsRef32 * = extRef32;
extCommon * = 130; (* 32 bit reference to COMMON block *)
extAbsCommon * = extCommon;
extRef16 * = 131; (* 16 bit reference to symbol *)
extRelRef16 * = extRef16;
extRef8 * = 132; (* 8 bit reference to symbol *)
extRelRef8 * = extRef8;
extDExt32 * = 133; (* 32 bit data releative reference *)
extDExt16 * = 134; (* 16 bit data releative reference *)
extDExt8 * = 135; (* 8 bit data releative reference *)
(* These are to support some of the '020 and up modes that are rarely used *)
extRelRef32 * = 136; (* 32 bit PC-relative reference to symbol *)
extRelCommon * = 137; (* 32 bit PC-relative reference to COMMON block *)
(* for completeness... All 680x0's support this *)
extAbsRef16 * = 138; (* 16 bit absolute reference to symbol *)
(* this only exists on '020's and above, in the (d8,An,Xn) address mode *)
extAbsRef8 * = 139; (* 8 bit absolute reference to symbol *)
(*
** $VER: filehandler.h 36.6 (9.8.92)
**
** device and file handler specific code for AmigaDOS
*)
TYPE
(* The disk "environment" is a longword array that describes the
* disk geometry. It is variable sized, with the length at the beginning.
* Here are the constants for a standard geometry.
*)
DosEnvec* = RECORD
tableSize * : E.ULONG; (* Size of Environment vector *)
sizeBlock * : E.ULONG; (* in longwords: standard value is 128 *)
secOrg * : E.ULONG; (* not used; must be 0 *)
surfaces * : E.ULONG; (* # of heads (surfaces). drive specific *)
sectorPerBlock* : E.ULONG; (* not used; must be 1 *)
blocksPerTrack* : E.ULONG; (* blocks per track. drive specific *)
reserved * : E.ULONG; (* DOS reserved blocks at start of partition. *)
preAlloc * : E.ULONG; (* DOS reserved blocks at end of partition *)
interleave * : E.ULONG; (* usually 0 *)
lowCyl * : E.ULONG; (* starting cylinder. typically 0 *)
highCyl * : E.ULONG; (* max cylinder. drive specific *)
numBuffers * : E.ULONG; (* Initial # DOS of buffers. *)
bufMemType * : E.ULONG; (* type of mem to allocate for buffers *)
maxTransfer * : E.ULONG; (* Max number of bytes to transfer at a time *)
mask * : SET; (* Address Mask to block out certain memory *)
bootPri * : LONGINT; (* Boot priority for autoboot *)
dosType * : E.ULONG; (* ASCII (HEX) string showing filesystem type;
* 444F5300H is old filesystem,
* 444F5301H is fast file system *)
baud * : E.ULONG; (* Baud rate for serial handler *)
control * : E.ULONG; (* Control word for handler/filesystem *)
bootBlocks * : E.ULONG; (* Number of blocks containing boot code *)
END; (* DosEnvec *)
CONST
(* these are the offsets into the array *)
(* deTableSize is set to the number of longwords in the table minus 1 *)
deTableSize * = 0; (* minimum value is 11 (includes NumBuffers) *)
deSizeBlock * = 1; (* in longwords: standard value is 128 *)
deSecOrg * = 2; (* not used; must be 0 *)
deNumHeads * = 3; (* # of heads (surfaces). drive specific *)
deSecsPerBlk * = 4; (* not used; must be 1 *)
deBlksPerTrack* = 5; (* blocks per track. drive specific *)
deReservedBlks* = 6; (* unavailable blocks at start. usually 2 *)
dePrefac * = 7; (* not used; must be 0 *)
deInterleave * = 8; (* usually 0 *)
deLowCyl * = 9; (* starting cylinder. typically 0 *)
deUpperCyl * = 10; (* max cylinder. drive specific *)
deNumBuffers * = 11; (* starting # of buffers. typically 5 *)
deMemBufType * = 12; (* type of mem to allocate for buffers. *)
deBufMemType * = 12; (* same as above, better name
* 1 is public, 3 is chip, 5 is fast *)
deMaxTransfer * = 13; (* Max number bytes to transfer at a time *)
deMask * = 14; (* Address Mask to block out certain memory *)
deBootPri * = 15; (* Boot priority for autoboot *)
deDosType * = 16; (* ASCII (HEX) string showing filesystem type;
* 444F5300H is old filesystem,
* 444F5301H is fast file system *)
deBaud * = 17; (* Baud rate for serial handler *)
deControl * = 18; (* Control word for handler/filesystem *)
deBootBlocks * = 19; (* Number of blocks containing boot code *)
TYPE
(* The file system startup message is linked into a device node's startup
** field. It contains a pointer to the above environment, plus the
** information needed to do an exec OpenDevice().
*)
FileSysStartupMsg* = RECORD
unit * : E.ULONG; (* exec unit number for this device *)
device * : BSTR; (* null terminated bstring to the device name *)
environ* : DosEnvecPtr; (* ptr to environment table (see above) *)
flags * : SET; (* flags for OpenDevice() *)
END; (* FileSysStartupMsg *)
(* The include file "libraries/dosextens.h" has a DeviceList structure.
* The "device list" can have one of three different things linked onto
* it. Dosextens defines the structure for a volume. dltDirectory
* is for an assigned directory. The following structure is for
* a dos "device" (dltDevice).
*)
DeviceNode* = RECORD
next * : DeviceNodePtr; (* singly linked list *)
type * : E.ULONG; (* always 0 for dos "devices" *)
task * : ProcessId; (* standard dos "task" field. If this is
* null when the node is accesses, a task
* will be started up *)
lock * : FileLockPtr; (* not used for devices -- leave null *)
handler * : BSTR; (* filename to loadseg (if seglist is null) *)
stackSize* : E.ULONG; (* stacksize to use when starting task *)
priority * : LONGINT; (* task priority when starting task *)
startup * : FileSysStartupMsgPtr; (* startup msg: FileSysStartupMsg for disks *)
segList * : BPTR; (* code to run to start new task (if necessary).
* if null then dnHandler will be loaded. *)
globalVec* : BPTR; (* BCPL global vector to use when starting
* a task. -1 means that dnSegList is not
* for a bcpl program, so the dos won't
* try and construct one. 0 tell the
* dos that you obey BCPL linkage rules,
* and that it should construct a global
* vector for you.
*)
name * : BSTR; (* the node name, e.g. '\3','D','F','3' *)
END; (* DeviceNode *)
(*
** $VER: notify.h 36.8 (29.8.90)
**
** dos notification definitions
*)
CONST
(* use of Class and code is discouraged for the time being - we might want
to change things *)
(* --- NotifyMessage Class ---------------------------------------------- *)
notifyClass * = 40000000H;
(* --- NotifyMessage Codes ---------------------------------------------- *)
notifyCode * = 1234H;
TYPE
(* Sent to the application if sendMESSAGE is specified. *)
NotifyMessage* = RECORD (E.Message)
class * : E.ULONG;
code * : E.UWORD;
nReq * : NotifyRequestPtr; (* don't modify the request! *)
doNotTouch * : E.ULONG; (* like it says! For use by handlers *)
doNotTouch2 * : E.ULONG; (* ditto *)
END; (* NotifyMessage *)
(* Do not modify or reuse the notifyrequest while active. *)
(* note: the first LONG of nrData has the length transfered *)
NotifyRequest* = RECORD
name * : E.STRPTR;
fullName* : E.STRPTR; (* set by dos - don't touch *)
userData* : E.ULONG; (* for applications use *)
flags * : SET;
task * : E.TaskPtr; (* for sendSignal *)
(** port * : E.MsgPortPtr; (* for sendMessage *)
*
* port occupies the same space as task (a C union). Access via:
* SYS.VAL (E.MsgPortPtr, NotifyRequest.task)
*)
signalNum* : E.UBYTE; (* for sendSignal *)
pad * : ARRAY 3 OF E.UBYTE;
reserved* : ARRAY 4 OF E.ULONG; (* leave 0 for now *)
(* internal use by handlers *)
msgCount* : E.ULONG; (* # of outstanding msgs *)
handler * : E.MsgPortPtr; (* handler sent to (for EndNotify) *)
END; (* NotifyRequest *)
CONST
(* --- NotifyRequest Flags ------------------------------------------------ *)
(* bit numbers *)
nrSendMessage * = 0;
nrSendSignal * = 1;
nrWaitReply * = 3;
nrNotifyInitial * = 4;
(* do NOT set or remove nrMagic! Only for use by handlers! *)
nrMagic * = 31;
(* Flags reserved for private use by the handler: *)
nrHandlerFlags * = {16 .. 31};
(*
** $VER: rdargs.h 36.6 (12.7.90)
**
** ReadArgs() structure definitions
*)
(**********************************************************************
*
* The CSource data structure defines the input source for "ReadItem()"
* as well as the ReadArgs call. It is a publicly defined structure
* which may be used by applications which use code that follows the
* conventions defined for access.
*
* When passed to the dos.library functions, the value passed as
* struct *CSource is defined as follows:
* if ( CSource == 0) Use buffered IO "ReadChar()" as data source
* else Use CSource for input character stream
*
* The following two pseudo-code routines define how the CSource structure
* is used:
*
* long csReadChar( CSource : CSourcePtr )
* {
* if ( CSource == 0 ) return ReadChar();
* if ( CSource->CurChr >= CSource->Length ) return ENDSTREAMCHAR;
* return CSource->Buffer[ CSource->CurChr++ ];
* }
*
* BOOL csUnReadChar( CSource : CSourcePtr )
* {
* if ( CSource == 0 ) return UnReadChar();
* if ( CSource->CurChr <= 0 ) return FALSE;
* CSource->CurChr--;
* return TRUE;
* }
*
* To initialize a struct CSource, you set csource->csBuffer to
* a string which is used as the data source, and set csLength to
* the number of characters in the string. Normally csCurChr should
* be initialized to ZERO, or left as it was from prior use as
* a CSource.
*
**********************************************************************)
TYPE
CSource* = RECORD
buffer* : E.STRPTR;
length* : LONGINT;
curChr* : LONGINT;
END; (* CSource *)
(**********************************************************************
*
* The RDArgs data structure is the input parameter passed to the DOS
* ReadArgs() function call.
*
* The rdaSource structure is a CSource as defined above;
* if rdasource.csBuffer is non-null, rdaSource is used as the input
* character stream to parse, else the input comes from the buffered STDIN
* calls ReadChar/UnReadChar.
*
* rdaDAList is a private address which is used internally to track
* allocations which are freed by FreeArgs(). This MUST be initialized
* to NULL prior to the first call to ReadArgs().
*
* The rdaBuffer and rdaBufSiz fields allow the application to supply
* a fixed-size buffer in which to store the parsed data. This allows
* the application to pre-allocate a buffer rather than requiring buffer
* space to be allocated. If either rdaBuffer or rdaBufSiz is NULL,
* the application has not supplied a buffer.
*
* rdaExtHelp is a text string which will be displayed instead of the
* template string, if the user is prompted for input.
*
* rdaFlags bits control how ReadArgs() works. The flag bits are
* defined below. Defaults are initialized to ZERO.
*
**********************************************************************)
TYPE
RDArgs* = RECORD
source * : CSource; (* Select input source *)
daList * : LONGINT; (* PRIVATE. *)
buffer * : E.STRPTR; (* Optional string parsing space. *)
bufSiz * : LONGINT; (* Size of rdaBuffer (0..n) *)
extHelp* : E.STRPTR; (* Optional extended help *)
flags * : SET; (* Flags for any required control *)
END; (* RDArgs *)
CONST
rdaStdIn * = 0; (* Use "STDIN" rather than "COMMAND LINE" *)
rdaNoAlloc * = 1; (* If set, do not allocate extra string space.*)
rdaNoPrompt * = 2; (* Disable reprompting for string input. *)
(**********************************************************************
* Maximum number of template keywords which can be in a template passed
* to ReadArgs(). IMPLEMENTOR NOTE - must be a multiple of 4.
**********************************************************************)
maxTemplateItems * = 100;
(**********************************************************************
* Maximum number of MULTIARG items returned by ReadArgs(), before
* an errorLineTooLONG. These two limitations are due to stack
* usage. Applications should allow "a lot" of stack to use ReadArgs().
**********************************************************************)
maxMultiArgs * = 128;
(*
** $VER: record.h 36.5 (12.7.90)
**
** include file for record locking
*)
CONST
(* Modes for LockRecord/LockRecords() *)
recExclusive * = 0;
recExclusiveImmed * = 1;
recShared * = 2;
recSharedImmed * = 3;
TYPE
(* struct to be passed to LockRecords()/UnLockRecords() *)
RecordLock* = RECORD
fh * : FileHandlePtr; (* filehandle *)
offset* : E.ULONG; (* offset in file *)
length* : E.ULONG; (* length of file to be locked *)
mode * : E.ULONG; (* Type of lock *)
END; (* RecordLock *)
(*
** $VER: var.h 36.11 (2.6.92)
**
** include file for dos local and environment variables
*)
TYPE
(* the structure in the prLocalVars list *)
(* Do NOT allocate yourself, use SetVar()!!! This structure may grow in *)
(* future releases! The list should be left in alphabetical order, and *)
(* may have multiple entries with the same name but different types. *)
LocalVar* = RECORD (E.Node)
flags* : E.WSET;
value* : E.STRPTR;
len * : E.ULONG;
END; (* LocalVar *)
CONST
(*
* The LocalVar.flags bits are available to the application. The unused
* LocalVar.pri bits are reserved for system use.
*)
(* bit definitions for LocalVar.type: *)
lvVar * = 0; (* an variable *)
lvAlias * = 1; (* an alias *)
(* to be or'ed into LocalVar.type: *)
lvIgnore * = 7; (* ignore this entry on GetVar, etc *)
(* definitions of flags passed to GetVar()/SetVar()/DeleteVar() *)
(* bit defs to be OR'ed with the type: *)
(* item will be treated as a single line of text unless binaryVAR is used *)
gvGlobalOnly * = 8;
gvLocalOnly * = 9;
gvBinaryVar * = 10; (* treat variable as binary *)
gvDontNullTerm * = 11; (* only with gvBinaryVar *)
(* this is only supported in >= V39 dos. V37 dos ignores this. *)
(* this causes SetVar to affect ENVARC: as well as ENV:. *)
gvSaveVar * = 12; (* only with gvGlobalVar *)
(*
** $VER: dostags.h 36.11 (29.4.91)
**
** Tag definitions for all Dos routines using tags
*)
CONST
(*****************************************************************************)
(* definitions for the System() call *)
sysDummy * = U.tagUser + 32;
sysInput * = sysDummy + 1; (* specifies the input filehandle *)
sysOutput * = sysDummy + 2; (* specifies the output filehandle *)
sysAsynch * = sysDummy + 3; (* run asynch, close input/output on exit(!) *)
sysUserShell * = sysDummy + 4; (* send to user shell instead of boot shell *)
sysCustomShell* = sysDummy + 5; (* send to a specific shell (data is name) *)
(*****************************************************************************)
(* definitions for the CreateNewProc() call *)
(* you MUST specify one of npSeglist or npEntry. All else is optional. *)
npDummy * = U.tagUser + 1000;
npSeglist * = npDummy + 1; (* seglist of code to run for the process *)
npFreeSeglist * = npDummy + 2; (* free seglist on exit - only valid for *)
(* for npSeglist. Default is TRUE. *)
npEntry * = npDummy + 3; (* entry point to run - mutually exclusive *)
(* with npSeglist! *)
npInput * = npDummy + 4; (* filehandle - default is Open("NIL:"...) *)
npOutput * = npDummy + 5; (* filehandle - default is Open("NIL:"...) *)
npCloseInput * = npDummy + 6; (* close input filehandle on exit *)
(* default TRUE *)
npCloseOutput * = npDummy + 7; (* close output filehandle on exit *)
(* default TRUE *)
npError * = npDummy + 8; (* filehandle - default is Open("NIL:"...) *)
npCloseError * = npDummy + 9; (* close error filehandle on exit *)
(* default TRUE *)
npCurrentDir * = npDummy + 10; (* lock - default is parent's current dir *)
npStackSize * = npDummy + 11; (* stacksize for process - default 4000 *)
npName * = npDummy + 12; (* name for process - default "New Process"*)
npPriority * = npDummy + 13; (* priority - default same as parent *)
npConsoleTask * = npDummy + 14; (* consoletask - default same as parent *)
npWindowPtr * = npDummy + 15; (* window ptr - default is same as parent *)
npHomeDir * = npDummy + 16; (* home directory - default curr home dir *)
npCopyVars * = npDummy + 17; (* boolean to copy local vars-default TRUE *)
npCli * = npDummy + 18; (* create cli structure - default FALSE *)
npPath * = npDummy + 19; (* path - default is copy of parents path *)
(* only valid if a cli process! *)
npCommandName * = npDummy + 20; (* commandname - valid only for CLI *)
npArguments * = npDummy + 21; (* cstring of arguments - passed with str in a0, length in d0. *)
(* (copied and freed on exit.) Default is 0-length NULL ptr. *)
(* NOTE: not operational until V37 - see BIX/TechNotes for *)
(* more info/workaround. In V36, the registers were random. *)
(* You must NEVER use npArguments with a npInput of NULL. *)
(* FIX! should this be only for cli's? *)
npNotifyOnDeath* = npDummy + 22; (* notify parent on death - default FALSE *)
(* Not functional yet. *)
npSynchronous * = npDummy + 23; (* don't return until process finishes - *)
(* default FALSE. *)
(* Not functional yet. *)
npExitCode * = npDummy + 24; (* code to be called on process exit *)
npExitData * = npDummy + 25; (* optional argument for npEndCode rtn - *)
(* default NULL *)
(*****************************************************************************)
(* tags for AllocDosObject *)
adoDummy * = U.tagUser + 2000;
adoFhMode * = adoDummy + 1;
(* for type dosFILEHANDLE only *)
(* sets up FH for mode specified.
This can make a big difference for buffered
files. *)
(* The following are for dosCLI *)
(* If you do not specify these, dos will use it's preferred values *)
(* which may change from release to release. The BPTRs to these *)
(* will be set up correctly for you. Everything will be zero, *)
(* except cliFailLevel (10) and cliBackground (DOSTRUE). *)
(* NOTE: you may also use these 4 tags with CreateNewProc. *)
adoDirLen * = adoDummy + 2; (* size in bytes for current dir buffer *)
adoCommNameLen* = adoDummy + 3; (* size in bytes for command name buffer *)
adoCommFileLen* = adoDummy + 4; (* size in bytes for command file buffer *)
adoPromptLen * = adoDummy + 5; (* size in bytes for the prompt buffer *)
(*****************************************************************************)
(* tags for NewLoadSeg *)
(* no tags are defined yet for NewLoadSeg *)
(*
** $VER: exall.h 36.6 (5.4.92)
**
** include file for ExAll() data structures
*)
(* NOTE: V37 dos.library, when doing ExAll() emulation, and V37 filesystems *)
(* will return an error if passed edOwner. If you get errorBadNumber, *)
(* retry with edComment to get everything but owner info. All filesystems *)
(* supporting ExAll() must support through edComment, and must check Type *)
(* and return errorBadNumber if they don't support the type. *)
CONST
(* values that can be passed for what data you want from ExAll() *)
(* each higher value includes those below it (numerically) *)
(* you MUST chose one of these values *)
edName * = 1;
edType * = 2;
edSize * = 3;
edProtection * = 4;
edDate * = 5;
edComment * = 6;
edOwner * = 7;
TYPE
(*
* Structure in which exall results are returned in. Note that only the
* fields asked for will exist!
*)
ExAllData* = RECORD
next * : ExAllDataPtr;
name * : E.STRPTR;
type * : LONGINT;
size * : E.ULONG;
prot * : SET;
days * : E.ULONG;
mins * : E.ULONG;
ticks * : E.ULONG;
comment * : E.STRPTR; (* strings will be after last used field *)
ownerUID * : E.UWORD; (* new for V39 *)
ownerGID * : E.UWORD;
END; (* ExAllData *)
(*
* Control structure passed to ExAll. Unused fields MUST be initialized to
* 0, expecially eacLastKey.
*
* eacMatchFunc is a hook (see utility.library documentation for usage)
* It should return true if the entry is to returned, false if it is to be
* ignored.
*
* This structure MUST be allocated by AllocDosObject()!
*)
ExAllControl* = RECORD
entries * : E.ULONG; (* number of entries returned in buffer *)
lastKey * : E.ULONG; (* Don't touch inbetween linked ExAll calls! *)
matchString* : E.STRPTR; (* wildcard string for pattern match or NULL *)
matchFunc * : U.HookPtr; (* optional private wildcard function *)
END; (* ExAllControl *)
(*
** $VER: dosextens.h 36.41 (14.5.92)
**
** DOS structures not needed for the casual AmigaDOS user
*)
TYPE
(* All DOS processes have this structure *)
(* Create and Device Proc returns pointer to the MsgPort in this structure *)
(* devproc* = (DeviceProc(..) - SIZE (Task)); *)
Process* = RECORD (E.Task)
msgPort * : E.MsgPort; (* This is BPTR address from DOS functions *)
pad * : INTEGER; (* Remaining variables on 4 byte boundaries *)
segList * : BPTR; (* Array of seg lists used by this process *)
stackSize * : LONGINT; (* Size of process stack in bytes *)
globVec * : E.APTR; (* Global vector for this process (BCPL) *)
taskNum * : LONGINT; (* CLI task number of zero if not a CLI *)
stackBase * : BPTR; (* Ptr to high memory end of process stack *)
result2 * : LONGINT; (* Value of secondary result from last call *)
currentDir * : FileLockPtr; (* Lock associated with current directory *)
cis * : FileHandlePtr; (* Current CLI Input Stream *)
cos * : FileHandlePtr; (* Current CLI Output Stream *)
consoleTask * : ProcessId; (* Console handler process for current window*)
fileSystemTask* : ProcessId; (* File handler process for current drive *)
cli * : CommandLineInterfacePtr;
(* pointer to CommandLineInterface *)
returnAddr * : E.APTR; (* pointer to previous stack frame *)
pktWait * : E.APTR; (* Function to be called when awaiting msg *)
windowPtr * : E.APTR; (* Window for error printing *)
(* following definitions are new with 2.0 *)
homeDir * : FileLockPtr; (* Home directory of executing program *)
prFlags * : SET; (* flags telling dos about process *)
exitCode * : E.PROC; (* code to call on exit of program or NULL *)
exitData * : LONGINT; (* Passed as an argument to prExitCode. *)
arguments * : E.STRPTR; (* Arguments passed to the process at start *)
localVars * : E.MinList; (* Local environment variables *)
shellPrivate * : E.ULONG; (* for the use of the current shell *)
ces * : FileHandlePtr; (* Error stream - if NULL, use prCOS *)
END; (* Process *)
CONST
(*
* Flags for Process.prFlags
*)
prFreeSegList * = 0;
prFreeCurrDir * = 1;
prFreeCli * = 2;
prCloseInput * = 3;
prCloseOutput * = 4;
prFreeArgs * = 5;
TYPE
(* The long word address (BPTR) of this structure is returned by
* Open() and other routines that return a file. You need only worry
* about this struct to do async io's via PutMsg() instead of
* standard file system calls *)
FileHandle* = RECORD
link * : E.MessagePtr; (* EXEC message *)
port * : E.MsgPortPtr; (* Reply port for the packet *)
type * : ProcessId; (* Port to do PutMsg() to
* Address is negative if a plain file *)
buf * : LONGINT;
pos * : LONGINT;
end * : LONGINT;
func1 * : LONGINT;
func2 * : LONGINT;
func3 * : LONGINT;
arg1 * : LONGINT;
arg2 * : LONGINT;
END; (* FileHandle *)
(* This is the extension to EXEC Messages used by DOS *)
DosPacket* = RECORD
link* : E.MessagePtr; (* EXEC message *)
port* : E.MsgPortPtr; (* Reply port for the packet *)
(* Must be filled in each send. *)
type* : LONGINT; (* See action... below and
* 'R' means Read, 'W' means Write to the
* file system *)
res1* : LONGINT; (* For file system calls this is the result
* that would have been returned by the
* function, e.g. Write ('W') returns actual
* length written *)
res2* : LONGINT; (* For file system calls this is what would
* have been returned by IoErr() *)
arg1* : LONGINT;
arg2* : LONGINT;
arg3* : LONGINT;
arg4* : LONGINT;
arg5* : LONGINT;
arg6* : LONGINT;
arg7* : LONGINT;
END; (* DosPacket *)
(* A Packet does not require the Message to be before it in memory, but
* for convenience it is useful to associate the two.
* Also see the function initstdpkt for initializing this structure *)
StandardPacket* = RECORD (E.Message)
pkt * : DosPacket;
END; (* StandardPacket *)
CONST
(* DosPacket types *)
actionNil * = 0;
actionStartup * = 0;
actionGetBlock * = 2; (* OBSOLETE *)
actionSetMap * = 4;
actionDie * = 5;
actionEvent * = 6;
actionCurrentVolume * = 7;
actionLocateObject * = 8;
actionRenameDisk * = 9;
actionWrite * = ORD ("W");
actionRead * = ORD ("R");
actionFreeLock * = 15;
actionDeleteObject * = 16;
actionRenameObject * = 17;
actionMoreCache * = 18;
actionCopyDir * = 19;
actionWaitChar * = 20;
actionSetProtect * = 21;
actionCreateDir * = 22;
actionExamineObject * = 23;
actionExamineNext * = 24;
actionDiskInfo * = 25;
actionInfo * = 26;
actionFlush * = 27;
actionSetComment * = 28;
actionParent * = 29;
actionTimer * = 30;
actionInhibit * = 31;
actionDiskType * = 32;
actionDiskChange * = 33;
actionSetDate * = 34;
actionScreenMode * = 994;
actionReadReturn * = 1001;
actionWriteReturn * = 1002;
actionSeek * = 1008;
actionFindUpdate * = 1004;
actionFindInput * = 1005;
actionFindOutput * = 1006;
actionEnd * = 1007;
actionSetFileSize * = 1022; (* fast file system only in 1.3 *)
actionWriteprotect * = 1023; (* fast file system only in 1.3 *)
(* new 2.0 packets *)
actionSameLock * = 40;
actionChangeSignal * = 995;
actionFormat * = 1020;
actionMakeLink * = 1021;
actionReadLink * = 1024;
actionFhFromLock * = 1026;
actionIsFileSystem * = 1027;
actionChangeMode * = 1028;
actionCopyDirFH * = 1030;
actionParentFH * = 1031;
actionExamineAll * = 1033;
actionExamineFH * = 1034;
actionLockRecord * = 2008;
actionFreeRecord * = 2009;
actionAddNotify * = 4097;
actionRemoveNotify * = 4098;
(* Added in V39: *)
actionExamineAllEnd * = 1035;
actionSetOwner * = 1036;
(* Tell a file system to serialize the current volume. This is typically
* done by changing the creation date of the disk. This packet does not take
* any arguments. NOTE: be prepared to handle failure of this packet for
* V37 ROM filesystems.
*)
actionSerializeDisk * = 4200;
TYPE
(*
* A structure for holding error messages - stored as array with error = 0
* for the last entry.
*)
ErrorString* = RECORD
nums * : E.APTR;
strings* : E.APTR;
END; (* ErrorString *)
(* DOS library node structure.
* This is the data at positive offsets from the library node.
* Negative offsets from the node is the jump table to DOS functions
* node = OpenLibrary( "dos.library" .. ) *)
DosLibrary* = RECORD (E.Library)
root * : RootNodePtr; (* Pointer to RootNode, described below *)
gv * : E.APTR; (* Pointer to BCPL global vector *)
a2 * : LONGINT; (* BCPL standard register values *)
a5 * : LONGINT;
a6 * : LONGINT;
errors : ErrorStringPtr; (* PRIVATE pointer to array of error msgs *)
timeReq : T.TimeRequestPtr; (* PRIVATE pointer to timer request *)
utilityBase : E.LibraryPtr; (* PRIVATE ptr to utility library *)
intuitionBase : E.LibraryPtr (* PRIVATE ptr to intuition library *)
END; (* DosLibrary *)
TaskArray* = RECORD
maxCLI * : LONGINT;
cli * : ARRAY 32767 OF ProcessId;
END; (* TaskArray *)
RootNode* = RECORD
taskArray * : TaskArrayPtr; (* [0] is max number of CLI's
* [1] is APTR to process id of CLI 1
* [n] is APTR to process id of CLI n *)
consoleSegment* : BPTR; (* SegList for the CLI *)
time * : Date; (* Current time *)
restartSeg * : BPTR; (* SegList for the disk validator process *)
info * : DosInfoPtr; (* Pointer to the Info structure *)
fileHandlerSegment* : BPTR; (* segment for a file handler *)
cliList * : E.MinList; (* new list of all CLI processes *)
(* the first cplArray is also rnTaskArray *)
bootProc * : ProcessId; (* private ptr to msgport of boot fs *)
shellSegment * : BPTR; (* seglist for Shell (for NewShell) *)
flags * : SET; (* dos flags *)
END; (* RootNode *)
CONST
rnWildStar * = 24;
rnPrivate1 = 1; (* private for dos *)
TYPE
(* ONLY to be allocated by DOS! *)
CliProcList* = RECORD (E.MinNode)
first* : LONGINT; (* number of first entry in array *)
array* : CPOINTER TO ARRAY 32767 OF ProcessId;
(* [0] is max number of CLI's in this entry (n)
* [1] is CPTR to process id of CLI cplFirst
* [n] is CPTR to process id of CLI cplFirst+n-1
*)
END; (* CliProcList *)
DosInfo* = RECORD
mcName : BPTR; (* PRIVATE: system resident module list *)
devInfo * : DevInfoPtr; (* Device List *)
devices * : BPTR; (* Currently zero *)
handlers * : BPTR; (* Currently zero *)
netHand * : ProcessId; (* Network handler processid; currently zero *)
devLock : E.SignalSemaphore; (* do NOT access directly! *)
entryLock : E.SignalSemaphore; (* do NOT access directly! *)
deleteLock : E.SignalSemaphore; (* do NOT access directly! *)
END; (* DosInfo *) (* DosInfo *)
(* structure for the Dos resident list. Do NOT allocate these, use *)
(* AddSegment(), and heed the warnings in the autodocs! *)
Segment* = RECORD
next* : BPTR;
uc * : LONGINT;
seg * : BPTR;
name* : ARRAY 4 OF CHAR; (* actually the first 4 chars of BSTR name *)
END; (* Segment *)
CONST
cmdSystem * = -1;
cmdInternal * = -2;
cmdDisabled * = -999;
TYPE
PathLockPtr * = CPOINTER TO PathLock;
PathLock * = RECORD
next * : PathLockPtr;
lock * : FileLockPtr;
END; (* PathLock *)
(* DOS Processes started from the CLI via RUN or NEWCLI have this additional
* set to data associated with them *)
CommandLineInterface* = RECORD
result2 * : LONGINT; (* Value of IoErr from last command *)
setName * : BSTR; (* Name of current directory *)
commandDir * : PathLockPtr; (* Head of the path locklist *)
returnCode * : LONGINT; (* Return code from last command *)
commandName * : BSTR; (* Name of current command *)
failLevel * : LONGINT; (* Fail level (set by FAILAT) *)
prompt * : BSTR; (* Current prompt (set by PROMPT) *)
standardInput * : FileHandlePtr; (* Default (terminal) CLI input *)
currentInput * : FileHandlePtr; (* Current CLI input *)
commandFile * : BSTR; (* Name of EXECUTE command file *)
interactive * : LONGINT; (* Boolean; True if prompts required *)
background * : LONGINT; (* Boolean; True if CLI created by RUN *)
currentOutput * : FileHandlePtr; (* Current CLI output *)
defaultStack * : LONGINT; (* Stack size to be obtained in long words *)
standardOutput* : FileHandlePtr; (* Default (terminal) CLI output *)
module * : BPTR; (* SegList of currently loaded command *)
END; (* CommandLineInterface *)
CommandLineInterfaceAPtr* = CPOINTER TO CommandLineInterface;
(* This structure can take on different values depending on whether it is
* a device, an assigned directory, or a volume. Below is the structure
* reflecting volumes only. Following that is the structure representing
* only devices. Following that is the unioned structure representing all
* the values
*)
DosListNode * = RECORD END;
(* structure representing a volume *)
DeviceList* = RECORD (DosListNode)
next * : DeviceListPtr; (* bptr to next device list *)
type * : LONGINT; (* see DLT below *)
task * : ProcessId; (* ptr to handler task *)
lock * : FileLockPtr; (* not for volumes *)
volumeDate* : Date; (* creation date *)
lockList * : FileLockPtr; (* outstanding locks *)
diskType * : LONGINT; (* 'DOS', etc *)
unused * : LONGINT;
name * : BSTR; (* bptr to bcpl name *)
END; (* DeviceList *)
DeviceListAPtr* = CPOINTER TO DeviceList;
(* device structure (same as the DeviceNode structure in filehandler.h) *)
DevInfo* = RECORD (DosListNode)
next * : DevInfoPtr;
type * : LONGINT;
task * : ProcessId;
lock * : FileLockPtr;
handler * : BSTR;
stackSize* : LONGINT;
priority * : LONGINT;
startup * : FileSysStartupMsgPtr;
segList * : BPTR;
globVec * : BPTR;
name * : BSTR;
END; (* DevInfo *)
DevInfoAPtr* = CPOINTER TO DevInfo;
(* structure used for multi-directory assigns. AllocVec()ed. *)
AssignList* = RECORD
next* : AssignListPtr;
lock* : FileLockPtr;
END; (* AssignList *)
(* combined structure for devices, assigned directories, volumes *)
DosList* = RECORD (DosListNode)
next * : DevInfoPtr; (* bptr to next device on list *)
type * : LONGINT; (* see DLT below *)
task * : ProcessId; (* ptr to handler task *)
lock * : FileLockPtr;
assignName* : E.STRPTR; (* name for non-or-late-binding assign *)
list * : AssignListPtr; (* for multi-directory assigns (regular) *)
unused * : ARRAY 4 OF LONGINT;
name * : BSTR; (* bptr to bcpl name *)
END; (* DosList *)
DosListAPtr* = CPOINTER TO DosList;
CONST
(* definitions for DosList.type *)
dltDevice * = 0;
dltDirectory * = 1; (* assign *)
dltVolume * = 2;
dltLate * = 3; (* late-binding assign *)
dltNonBinding * = 4; (* non-binding assign *)
dltPrivate * = -1; (* for internal use only *)
TYPE
(* structure return by GetDeviceProc() *)
DevProc* = RECORD
port * : E.MsgPortPtr;
lock * : FileLockPtr;
flags * : SET;
devNode : DosListNodePtr; (* DON'T TOUCH OR USE! *)
END; (* DevProc *)
CONST
(* definitions for DevProc.flags *)
dvpUnLock * = 0;
dvpAssign * = 1;
(* Flags to be passed to LockDosList(), etc *)
ldDevices * = 2;
ldVolumes * = 3;
ldAssigns * = 4;
ldEntry * = 5;
ldDelete * = 6;
(* you MUST specify one of ldRead or ldWrite *)
ldRead * = 0;
ldWrite * = 1;
(* actually all but ldEntry (which is used for internal locking) *)
all * = {ldDevices, ldVolumes, ldAssigns};
TYPE
(* a lock structure, as returned by Lock() or DupLock() *)
FileLock* = RECORD
link - : FileLockPtr; (* bcpl pointer to next lock *)
key * : LONGINT; (* disk block number *)
access* : LONGINT; (* exclusive or shared *)
task * : ProcessId; (* handler task's port *)
volume* : DeviceListPtr; (* bptr to dltVOLUME DosList entry *)
END; (* FileLock *)
CONST
(* error report types for ErrorReport() *)
reportStream * = 0; (* a stream *)
reportTask * = 1; (* a process - unused *)
reportLock * = 2; (* a lock *)
reportVolume * = 3; (* a volume node *)
reportInsert * = 4; (* please insert volume *)
(* Special error codes for ErrorReport() *)
abortDiskError * = 296; (* Read/write error *)
abortBusy * = 288; (* You MUST replace... *)
(* types for initial packets to shells from run/newcli/execute/system. *)
(* For shell-writers only *)
runExecute * = -1;
runSystem * = -2;
runSystemAsynch * = -3;
(* Types for fibDirEntryType. NOTE that both USERDIR and ROOT are *)
(* directories, and that directory/file checks should use <0 and >=0. *)
(* This is not necessarily exhaustive! Some handlers may use other *)
(* values as needed, though <0 and >=0 should remain as supported as *)
(* possible. *)
stRoot * = 1;
stUserDir * = 2;
stSoftLink * = 3; (* looks like dir, but may point to a file! *)
stLinkDir * = 4; (* hard link to dir *)
stFile * = -3; (* must be negative for FIB! *)
stLinkFile * = -4; (* hard link to file *)
stPipeFile * = -5; (* for pipes that support ExamineFH *)
(*
** $VER: stdio.h 36.6 (1.11.91)
**
** ANSI-like stdio defines for dos buffered I/O
*)
CONST
(* types for SetVBuf *)
bufLine * = 0; (* flush on \n, etc *)
bufFull * = 1; (* never flush except when needed *)
bufNone * = 2; (* no buffering *)
(* EOF return value *)
endStreamCh * = -1;
(**-- Library Base variable --------------------------------------------*)
VAR
base* : DosLibraryPtr;
(**-- Library Functions ------------------------------------------------*)
(*
** $VER: dos_protos.h 36.31 (17.12.92)
*)
LIBCALL (base : DosLibraryPtr) Open*
( name [1] : ARRAY OF CHAR;
accessMode [2] : LONGINT)
: FileHandlePtr;
-30;
LIBCALL (base : DosLibraryPtr) Close*
( file [1] : FileHandlePtr )
: BOOLEAN;
-36;
LIBCALL (base : DosLibraryPtr) OldClose*
( file [1] : FileHandlePtr );
-36;
LIBCALL (base : DosLibraryPtr) Read*
( file [1] : FileHandlePtr;
VAR buffer [2] : ARRAY OF SYS.BYTE;
length [3] : LONGINT)
: LONGINT;
-42;
LIBCALL (base : DosLibraryPtr) Write*
( file [1] : FileHandlePtr;
buffer [2] : ARRAY OF SYS.BYTE;
length [3] : LONGINT)
: LONGINT;
-48;
LIBCALL (base : DosLibraryPtr) Input* ()
: FileHandlePtr;
-54;
LIBCALL (base : DosLibraryPtr) Output* ()
: FileHandlePtr;
-60;
LIBCALL (base : DosLibraryPtr) Seek*
( file [1] : FileHandlePtr;
position [2] : LONGINT;
offset [3] : LONGINT)
: LONGINT;
-66;
LIBCALL (base : DosLibraryPtr) DeleteFile*
( name [1] : ARRAY OF CHAR )
: BOOLEAN;
-72;
LIBCALL (base : DosLibraryPtr) Rename*
( oldName [1] : ARRAY OF CHAR;
newName [2] : ARRAY OF CHAR )
: BOOLEAN;
-78;
LIBCALL (base : DosLibraryPtr) Lock*
( name [1] : ARRAY OF CHAR;
type [2] : LONGINT)
: FileLockPtr;
-84;
LIBCALL (base : DosLibraryPtr) UnLock*
( lock [1] : FileLockPtr );
-90;
LIBCALL (base : DosLibraryPtr) DupLock*
( lock [1] : FileLockPtr )
: FileLockPtr;
-96;
LIBCALL (base : DosLibraryPtr) Examine*
( lock [1] : FileLockPtr;
VAR fib [2] : FileInfoBlock )
: BOOLEAN;
-102;
LIBCALL (base : DosLibraryPtr) ExNext*
( lock [1] : FileLockPtr;
VAR fib [2] : FileInfoBlock )
: BOOLEAN;
-108;
LIBCALL (base : DosLibraryPtr) Info*
( lock [1] : FileLockPtr;
VAR info [2] : InfoData )
: BOOLEAN;
-114;
LIBCALL (base : DosLibraryPtr) CreateDir*
( name [1] : ARRAY OF CHAR )
: FileLockPtr;
-120;
LIBCALL (base : DosLibraryPtr) CurrentDir*
( lock [1] : FileLockPtr )
: FileLockPtr;
-126;
LIBCALL (base : DosLibraryPtr) IoErr* ()
: LONGINT;
-132;
LIBCALL (base : DosLibraryPtr) CreateProc*
( name [1] : ARRAY OF CHAR;
pri [2] : LONGINT;
segList [3] : BPTR;
stackSize [4] : LONGINT)
: ProcessId;
-138;
LIBCALL (base : DosLibraryPtr) Exit*
( returnCode [1] : LONGINT);
-144;
LIBCALL (base : DosLibraryPtr) LoadSeg*
( name [1] : ARRAY OF CHAR )
: BPTR;
-150;
LIBCALL (base : DosLibraryPtr) UnLoadSeg*
( seglist [1] : BPTR );
-156;
LIBCALL (base : DosLibraryPtr) DeviceProc*
( name [1] : ARRAY OF CHAR )
: ProcessId;
-174;
LIBCALL (base : DosLibraryPtr) SetComment*
( name [1] : ARRAY OF CHAR;
comment [2] : ARRAY OF CHAR )
: BOOLEAN;
-180;
LIBCALL (base : DosLibraryPtr) SetProtection*
( name [1] : ARRAY OF CHAR;
protect [2] : SET)
: BOOLEAN;
-186;
LIBCALL (base : DosLibraryPtr) DateStamp*
( VAR date [1] : Date );
-192;
LIBCALL (base : DosLibraryPtr) Delay*
( timeout [1] : E.ULONG);
-198;
LIBCALL (base : DosLibraryPtr) WaitForChar*
( file [1] : FileHandlePtr;
timeout [2] : LONGINT)
: BOOLEAN;
-204;
LIBCALL (base : DosLibraryPtr) ParentDir*
( lock [1] : FileLockPtr )
: FileLockPtr;
-210;
LIBCALL (base : DosLibraryPtr) IsInteractive*
( file [1] : FileHandlePtr )
: BOOLEAN;
-216;
LIBCALL (base : DosLibraryPtr) Execute*
( string [1] : ARRAY OF CHAR;
file [2] : FileHandlePtr;
file2 [3] : FileHandlePtr )
: BOOLEAN;
-222;
(* --- functions in V36 or higher (distributed as Release 2.0) ---*)
(* DOS Object creation/deletion *)
LIBCALL (base : DosLibraryPtr) AllocDosObject*
( type [1] : E.ULONG;
tags [2] : ARRAY OF U.TagItem )
: E.APTR;
-228;
LIBCALL (base : DosLibraryPtr) AllocDosObjectTags*
( type [1] : E.ULONG;
tags [2].. : U.Tag )
: E.APTR;
-228;
LIBCALL (base : DosLibraryPtr) FreeDosObject*
( type [1] : E.ULONG;
ptr [2] : E.APTR );
-234;
(* Packet Level routines *)
LIBCALL (base : DosLibraryPtr) DoPkt*
( port [1] : ProcessId;
action [2] : LONGINT;
arg1 [3] : LONGINT;
arg2 [4] : LONGINT;
arg3 [5] : LONGINT;
arg4 [6] : LONGINT;
arg5 [7] : LONGINT)
: LONGINT;
-240;
LIBCALL (base : DosLibraryPtr) DoPkt0*
( port [1] : ProcessId;
action [2] : LONGINT)
: LONGINT;
-240;
LIBCALL (base : DosLibraryPtr) DoPkt1*
( port [1] : ProcessId;
action [2] : LONGINT;
arg1 [3] : LONGINT)
: LONGINT;
-240;
LIBCALL (base : DosLibraryPtr) DoPkt2*
( port [1] : ProcessId;
action [2] : LONGINT;
arg1 [3] : LONGINT;
arg2 [4] : LONGINT)
: LONGINT;
-240;
LIBCALL (base : DosLibraryPtr) DoPkt3*
( port [1] : ProcessId;
action [2] : LONGINT;
arg1 [3] : LONGINT;
arg2 [4] : LONGINT;
arg3 [5] : LONGINT)
: LONGINT;
-240;
LIBCALL (base : DosLibraryPtr) DoPkt4*
( port [1] : ProcessId;
action [2] : LONGINT;
arg1 [3] : LONGINT;
arg2 [4] : LONGINT;
arg3 [5] : LONGINT;
arg4 [6] : LONGINT)
: LONGINT;
-240;
LIBCALL (base : DosLibraryPtr) SendPkt*
( VAR dp [1] : DosPacket;
port [2] : ProcessId;
replyport [3] : E.MsgPortPtr );
-246;
LIBCALL (base : DosLibraryPtr) WaitPkt* ()
: DosPacketPtr;
-252;
LIBCALL (base : DosLibraryPtr) ReplyPkt*
( dp [1] : DosPacketPtr;
res1 [2] : LONGINT;
res2 [3] : LONGINT);
-258;
LIBCALL (base : DosLibraryPtr) AbortPkt*
( port [1] : ProcessId;
pkt [2] : DosPacketPtr );
-264;
(* Record Locking *)
LIBCALL (base : DosLibraryPtr) LockRecord*
( fh [1] : FileHandlePtr;
offset [2] : E.ULONG;
length [3] : E.ULONG;
mode [4] : E.ULONG;
timeout [5] : E.ULONG )
: BOOLEAN;
-270;
LIBCALL (base : DosLibraryPtr) LockRecords*
( recArray [1] : RecordLockPtr;
timeout [2] : E.ULONG )
: BOOLEAN;
-276;
LIBCALL (base : DosLibraryPtr) UnLockRecord*
( fh [1] : FileHandlePtr;
offset [2] : E.ULONG;
length [3] : E.ULONG )
: BOOLEAN;
-282;
LIBCALL (base : DosLibraryPtr) UnLockRecords*
( recArray [1] : RecordLockPtr )
: BOOLEAN;
-288;
(* Buffered File I/O *)
LIBCALL (base : DosLibraryPtr) SelectInput*
( fh [1] : FileHandlePtr )
: FileHandlePtr;
-294;
LIBCALL (base : DosLibraryPtr) SelectOutput*
( fh [1] : FileHandlePtr )
: FileHandlePtr;
-300;
LIBCALL (base : DosLibraryPtr) FGetC*
( fh [1] : FileHandlePtr )
: LONGINT;
-306;
LIBCALL (base : DosLibraryPtr) FPutC*
( fh [1] : FileHandlePtr;
ch [2] : LONGINT )
: LONGINT;
-312;
LIBCALL (base : DosLibraryPtr) UnGetC*
( fh [1] : FileHandlePtr;
character [2] : LONGINT)
: LONGINT;
-318;
LIBCALL (base : DosLibraryPtr) FRead*
( fh [1] : FileHandlePtr;
VAR block [2] : ARRAY OF SYS.BYTE;
blocklen [3] : E.ULONG;
number [4] : E.ULONG )
: LONGINT;
-324;
LIBCALL (base : DosLibraryPtr) FWrite*
( fh [1] : FileHandlePtr;
block [2] : ARRAY OF SYS.BYTE;
blocklen [3] : E.ULONG;
number [4] : E.ULONG )
: LONGINT;
-330;
LIBCALL (base : DosLibraryPtr) FGets*
( fh [1] : FileHandlePtr;
VAR buf [2] : ARRAY OF CHAR;
buflen [3] : E.ULONG )
: E.APTR;
-336;
LIBCALL (base : DosLibraryPtr) FPuts*
( fh [1] : FileHandlePtr;
str [2] : ARRAY OF CHAR )
: BOOLEAN;
-342;
LIBCALL (base : DosLibraryPtr) VFWritef*
( fh [1] : FileHandlePtr;
format [2] : ARRAY OF CHAR;
argv [3] : ARRAY OF SYS.LONGWORD )
: LONGINT;
-348;
LIBCALL (base : DosLibraryPtr) FWritef*
( fh [1] : FileHandlePtr;
format [2] : ARRAY OF CHAR;
argv [3].. : SYS.LONGWORD )
: LONGINT;
-348;
LIBCALL (base : DosLibraryPtr) VFPrintf*
( fh [1] : FileHandlePtr;
format [2] : ARRAY OF CHAR;
argv [3] : ARRAY OF SYS.LONGWORD )
: LONGINT;
-354;
LIBCALL (base : DosLibraryPtr) FPrintf*
( fh [1] : FileHandlePtr;
format [2] : ARRAY OF CHAR;
argv [3].. : SYS.LONGWORD )
: LONGINT;
-354;
LIBCALL (base : DosLibraryPtr) Flush*
( fh [1] : FileHandlePtr )
: BOOLEAN;
-360;
LIBCALL (base : DosLibraryPtr) SetVBuf*
( fh [1] : FileHandlePtr;
VAR buff [2] : ARRAY OF CHAR;
type [3] : LONGINT;
size [4] : LONGINT)
: LONGINT;
-366;
LIBCALL (base : DosLibraryPtr) SetVBufPtr*
( fh [1] : FileHandlePtr;
buff [2] : E.STRPTR;
type [3] : LONGINT;
size [4] : LONGINT)
: LONGINT;
-366;
(* DOS Object Management *)
LIBCALL (base : DosLibraryPtr) DupLockFromFH*
( fh [1] : FileHandlePtr )
: FileLockPtr;
-372;
LIBCALL (base : DosLibraryPtr) OpenFromLock*
( lock [1] : FileLockPtr )
: FileHandlePtr;
-378;
LIBCALL (base : DosLibraryPtr) ParentOfFH*
( fh [1] : FileHandlePtr )
: FileLockPtr;
-384;
LIBCALL (base : DosLibraryPtr) ExamineFH*
( fh [1] : FileHandlePtr;
VAR fib [2] : FileInfoBlock )
: BOOLEAN;
-390;
LIBCALL (base : DosLibraryPtr) SetFileDate*
( name [1] : ARRAY OF CHAR;
VAR date [2] : Date )
: BOOLEAN;
-396;
LIBCALL (base : DosLibraryPtr) NameFromLock*
( lock [1] : FileLockPtr;
VAR buffer [2] : ARRAY OF CHAR;
len [3] : LONGINT)
: BOOLEAN;
-402;
LIBCALL (base : DosLibraryPtr) NameFromFH*
( fh [1] : FileHandlePtr;
VAR buffer [2] : ARRAY OF CHAR;
len [3] : LONGINT)
: BOOLEAN;
-408;
LIBCALL (base : DosLibraryPtr) SplitName*
( name [1] : ARRAY OF CHAR;
seperator [2] : CHAR;
VAR buf [3] : ARRAY OF CHAR;
oldpos [4] : LONGINT;
size [5] : LONGINT)
: INTEGER;
-414;
LIBCALL (base : DosLibraryPtr) SameLock*
( lock1 [1] : FileLockPtr;
lock2 [2] : FileLockPtr )
: INTEGER;
-420;
LIBCALL (base : DosLibraryPtr) SetMode*
( fh [1] : FileHandlePtr;
mode [2] : LONGINT)
: BOOLEAN;
-426;
LIBCALL (base : DosLibraryPtr) ExAll*
( lock [1] : FileLockPtr;
buffer [2] : ARRAY OF SYS.BYTE;
size [3] : LONGINT;
data [4] : LONGINT;
control [5] : ExAllControlPtr )
: BOOLEAN;
-432;
LIBCALL (base : DosLibraryPtr) ReadLink*
( port [1] : ProcessId;
lock [2] : FileLockPtr;
path [3] : ARRAY OF CHAR;
VAR buffer [4] : ARRAY OF CHAR;
size [5] : E.ULONG )
: LONGINT;
-438;
LIBCALL (base : DosLibraryPtr) MakeLink*
( name [1] : ARRAY OF CHAR;
dest [2] : LONGINT;
soft [3] : LONGINT)
: LONGINT;
-444;
LIBCALL (base : DosLibraryPtr) ChangeMode*
( type [1] : LONGINT; (* must be changeFH *)
fh [2] : FileHandlePtr;
newmode [3] : LONGINT)
: BOOLEAN;
-450;
LIBCALL (base : DosLibraryPtr) ChangeModeLock*
( type [1] : LONGINT; (* must be changeLock *)
fh [2] : FileLockPtr;
newmode [3] : LONGINT)
: BOOLEAN;
-450;
LIBCALL (base : DosLibraryPtr) SetFileSize*
( fh [1] : FileHandlePtr;
pos [2] : LONGINT;
mode [3] : LONGINT)
: LONGINT;
-456;
(* Error Handling *)
LIBCALL (base : DosLibraryPtr) SetIoErr*
( result [1] : LONGINT)
: LONGINT;
-462;
LIBCALL (base : DosLibraryPtr) Fault*
( code [1] : LONGINT;
header [2] : ARRAY OF CHAR;
VAR buffer [3] : ARRAY OF CHAR;
len [4] : LONGINT)
: LONGINT;
-468;
LIBCALL (base : DosLibraryPtr) PrintFault*
( code [1] : LONGINT;
header [2] : ARRAY OF CHAR )
: BOOLEAN;
-474;
LIBCALL (base : DosLibraryPtr) ErrorReport*
( code [1] : LONGINT;
type [2] : LONGINT;
arg1 [3] : DeviceListAPtr;
device [8] : ProcessId )
: LONGINT;
-480;
LIBCALL (base : DosLibraryPtr) ErrorReportLock*
( code [1] : LONGINT;
type [2] : LONGINT;
arg1 [3] : FileLockPtr;
device [8] : ProcessId )
: LONGINT;
-480;
LIBCALL (base : DosLibraryPtr) ErrorReportFH*
( code [1] : LONGINT;
type [2] : LONGINT;
arg1 [3] : FileHandlePtr;
device [8] : ProcessId )
: LONGINT;
-480;
(* Process Management *)
LIBCALL (base : DosLibraryPtr) Cli* ()
: CommandLineInterfaceAPtr;
-492;
LIBCALL (base : DosLibraryPtr) CreateNewProc*
( tags [1] : ARRAY OF U.TagItem )
: ProcessPtr;
-498;
LIBCALL (base : DosLibraryPtr) CreateNewProcTags*
( tags [1].. : U.Tag )
: ProcessPtr;
-498;
LIBCALL (base : DosLibraryPtr) RunCommand*
( seg [1] : BPTR;
stack [2] : LONGINT;
paramptr [3] : ARRAY OF CHAR;
paramlen [4] : LONGINT)
: LONGINT;
-504;
LIBCALL (base : DosLibraryPtr) GetConsoleTask* ()
: ProcessId;
-510;
LIBCALL (base : DosLibraryPtr) SetConsoleTask*
( task [1] : ProcessId )
: ProcessId;
-516;
LIBCALL (base : DosLibraryPtr) GetFileSysTask* ()
: ProcessId;
-522;
LIBCALL (base : DosLibraryPtr) SetFileSysTask*
( task [1] : ProcessId )
: ProcessId;
-528;
LIBCALL (base : DosLibraryPtr) GetArgStr* ()
: E.STRPTR;
-534;
LIBCALL (base : DosLibraryPtr) SetArgStr*
( string [1] : ARRAY OF CHAR )
: E.STRPTR;
-540;
LIBCALL (base : DosLibraryPtr) FindCliProc*
( num [1] : E.ULONG )
: ProcessPtr;
-546;
LIBCALL (base : DosLibraryPtr) MaxCli* ()
: E.ULONG;
-552;
LIBCALL (base : DosLibraryPtr) SetCurrentDirName*
( name [1] : ARRAY OF CHAR )
: BOOLEAN;
-558;
LIBCALL (base : DosLibraryPtr) GetCurrentDirName*
( VAR buf [1] : ARRAY OF CHAR;
len [2] : LONGINT)
: BOOLEAN;
-564;
LIBCALL (base : DosLibraryPtr) SetProgramName*
( name [1] : ARRAY OF CHAR )
: BOOLEAN;
-570;
LIBCALL (base : DosLibraryPtr) GetProgramName*
( VAR buf [1] : ARRAY OF CHAR;
len [2] : LONGINT)
: BOOLEAN;
-576;
LIBCALL (base : DosLibraryPtr) SetPrompt*
( name [1] : ARRAY OF CHAR )
: BOOLEAN;
-582;
LIBCALL (base : DosLibraryPtr) GetPrompt*
( VAR buf [1] : ARRAY OF CHAR;
len [2] : LONGINT)
: BOOLEAN;
-588;
LIBCALL (base : DosLibraryPtr) SetProgramDir*
( lock [1] : FileLockPtr )
: FileLockPtr;
-594;
LIBCALL (base : DosLibraryPtr) GetProgramDir* ()
: FileLockPtr;
-600;
(* Device List Management *)
LIBCALL (base : DosLibraryPtr) System*
( command [1] : ARRAY OF CHAR;
tags [2] : ARRAY OF U.TagItem )
: LONGINT;
-606;
LIBCALL (base : DosLibraryPtr) SystemTags*
( command [1] : ARRAY OF CHAR;
tags [2].. : U.Tag )
: LONGINT;
-606;
LIBCALL (base : DosLibraryPtr) AssignLock*
( name [1] : ARRAY OF CHAR;
lock [2] : FileLockPtr )
: BOOLEAN;
-612;
LIBCALL (base : DosLibraryPtr) AssignLate*
( name [1] : ARRAY OF CHAR;
path [2] : ARRAY OF CHAR )
: BOOLEAN;
-618;
LIBCALL (base : DosLibraryPtr) AssignPath*
( name [1] : ARRAY OF CHAR;
path [2] : ARRAY OF CHAR )
: BOOLEAN;
-624;
LIBCALL (base : DosLibraryPtr) AssignAdd*
( name [1] : ARRAY OF CHAR;
lock [2] : FileLockPtr )
: BOOLEAN;
-630;
LIBCALL (base : DosLibraryPtr) RemAssignList*
( name [1] : ARRAY OF CHAR;
lock [2] : FileLockPtr )
: LONGINT;
-636;
LIBCALL (base : DosLibraryPtr) GetDeviceProc*
( name [1] : ARRAY OF CHAR;
dp [2] : DevProcPtr )
: DevProcPtr;
-642;
LIBCALL (base : DosLibraryPtr) FreeDeviceProc*
( dp [1] : DevProcPtr );
-648;
LIBCALL (base : DosLibraryPtr) LockDosList*
( flags [1] : SET )
: DosListNodePtr;
-654;
LIBCALL (base : DosLibraryPtr) UnLockDosList*
( flags [1] : SET );
-660;
LIBCALL (base : DosLibraryPtr) AttemptLockDosList*
( flags [1] : SET )
: DosListNodePtr;
-666;
LIBCALL (base : DosLibraryPtr) RemDosEntry*
( dlist [1] : DosListNodePtr )
: BOOLEAN;
-672;
LIBCALL (base : DosLibraryPtr) AddDosEntry*
( dlist [1] : DosListNodePtr )
: DosListNodePtr;
-678;
LIBCALL (base : DosLibraryPtr) FindDosEntry*
( dlist [1] : DosListNodePtr;
name [2] : ARRAY OF CHAR;
flags [3] : SET )
: DosListNodePtr;
-684;
LIBCALL (base : DosLibraryPtr) NextDosEntry*
( dlist [1] : DosListNodePtr;
flags [2] : SET )
: DosListNodePtr;
-690;
LIBCALL (base : DosLibraryPtr) MakeDosEntry*
( name [1] : ARRAY OF CHAR;
type [2] : LONGINT)
: DosListNodePtr;
-696;
LIBCALL (base : DosLibraryPtr) FreeDosEntry*
( dlist [1] : DosListNodePtr );
-702;
LIBCALL (base : DosLibraryPtr) IsFileSystem*
( name [1] : ARRAY OF CHAR )
: BOOLEAN;
-708;
(* Handler Interface *)
LIBCALL (base : DosLibraryPtr) Format*
( filesystem [1] : ARRAY OF CHAR;
volumename [2] : ARRAY OF CHAR;
dostype [3] : E.ULONG )
: BOOLEAN;
-714;
LIBCALL (base : DosLibraryPtr) Relabel*
( drive [1] : ARRAY OF CHAR;
newname [2] : ARRAY OF CHAR )
: BOOLEAN;
-720;
LIBCALL (base : DosLibraryPtr) Inhibit*
( name [1] : ARRAY OF CHAR;
onoff [2] : LONGINT)
: BOOLEAN;
-726;
LIBCALL (base : DosLibraryPtr) AddBuffers*
( name [1] : ARRAY OF CHAR;
number [2] : LONGINT)
: BOOLEAN;
-732;
(* Date, Time Routines *)
LIBCALL (base : DosLibraryPtr) CompareDates*
( VAR date1 [1] : Date;
VAR date2 [2] : Date )
: LONGINT;
-738;
LIBCALL (base : DosLibraryPtr) DateToStr*
( VAR datetime [1] : DateTime )
: BOOLEAN;
-744;
LIBCALL (base : DosLibraryPtr) StrToDate*
( VAR datetime [1] : DateTime )
: BOOLEAN;
-750;
(* Image Management *)
LIBCALL (base : DosLibraryPtr) InternalLoadSeg*
( fh [1] : FileHandlePtr;
table [8] : BPTR;
funcarray [9] : E.APTR;
VAR stack [10] : LONGINT )
: BPTR;
-756;
LIBCALL (base : DosLibraryPtr) InternalUnLoadSeg*
( seglist [1] : BPTR;
freefunc [9] : E.PROC )
: BOOLEAN;
-762;
LIBCALL (base : DosLibraryPtr) NewLoadSeg*
( file [1] : ARRAY OF CHAR;
tags [2] : ARRAY OF U.TagItem )
: BPTR;
-768;
LIBCALL (base : DosLibraryPtr) NewLoadSegTags*
( file [1] : ARRAY OF CHAR;
tags [2].. : U.Tag )
: BPTR;
-768;
LIBCALL (base : DosLibraryPtr) AddSegment*
( name [1] : ARRAY OF CHAR;
seg [2] : BPTR;
system [3] : LONGINT)
: BOOLEAN;
-774;
LIBCALL (base : DosLibraryPtr) FindSegment*
( name [1] : ARRAY OF CHAR;
seg [2] : SegmentPtr;
system [3] : LONGINT)
: SegmentPtr;
-780;
LIBCALL (base : DosLibraryPtr) RemSegment*
( seg [1] : SegmentPtr )
: BOOLEAN;
-786;
(* Command Support *)
LIBCALL (base : DosLibraryPtr) CheckSignal*
( mask [1] : SET)
: SET;
-792;
LIBCALL (base : DosLibraryPtr) ReadArgs*
( template [1] : ARRAY OF CHAR;
VAR array [2] : ARRAY OF SYS.LONGWORD;
args [3] : RDArgsPtr )
: RDArgsPtr;
-798;
LIBCALL (base : DosLibraryPtr) FindArg*
( template [1] : ARRAY OF CHAR;
keyword [2] : ARRAY OF CHAR )
: LONGINT;
-804;
LIBCALL (base : DosLibraryPtr) ReadItem*
( VAR name [1] : ARRAY OF CHAR;
maxchars [2] : LONGINT;
cSource [3] : CSourcePtr )
: LONGINT;
-810;
LIBCALL (base : DosLibraryPtr) StrToLong*
( string [1] : ARRAY OF CHAR;
VAR value [2] : LONGINT )
: LONGINT;
-816;
LIBCALL (base : DosLibraryPtr) MatchFirst*
( pat [1] : ARRAY OF CHAR;
VAR anchor [2] : AnchorPath )
: LONGINT;
-822;
LIBCALL (base : DosLibraryPtr) MatchNext*
( VAR anchor [1] : AnchorPath )
: LONGINT;
-828;
LIBCALL (base : DosLibraryPtr) MatchEnd*
( VAR anchor [1] : AnchorPath );
-834;
LIBCALL (base : DosLibraryPtr) ParsePattern*
( pat [1] : ARRAY OF CHAR;
VAR buf [2] : ARRAY OF CHAR;
buflen [3] : LONGINT)
: INTEGER;
-840;
LIBCALL (base : DosLibraryPtr) MatchPattern*
( pat [1] : ARRAY OF CHAR;
str [2] : ARRAY OF CHAR )
: BOOLEAN;
-846;
LIBCALL (base : DosLibraryPtr) FreeArgs*
( args [1] : RDArgsPtr );
-858;
LIBCALL (base : DosLibraryPtr) FilePart*
( path [1] : ARRAY OF CHAR )
: E.STRPTR;
-870;
LIBCALL (base : DosLibraryPtr) PathPart*
( path [1] : ARRAY OF CHAR )
: E.STRPTR;
-876;
LIBCALL (base : DosLibraryPtr) AddPart*
( VAR dirname [1] : ARRAY OF CHAR;
filename [2] : ARRAY OF CHAR;
size [3] : E.ULONG )
: BOOLEAN;
-882;
(* Notification *)
LIBCALL (base : DosLibraryPtr) StartNotify*
( VAR notify [1] : NotifyRequest )
: BOOLEAN;
-888;
LIBCALL (base : DosLibraryPtr) EndNotify*
( VAR notify [1] : NotifyRequest );
-894;
(* Environment Variable functions *)
LIBCALL (base : DosLibraryPtr) SetVar*
( name [1] : ARRAY OF CHAR;
VAR buffer [2] : ARRAY OF CHAR;
size [3] : LONGINT;
flags [4] : SET)
: BOOLEAN;
-900;
LIBCALL (base : DosLibraryPtr) GetVar*
( name [1] : ARRAY OF CHAR;
VAR buffer [2] : ARRAY OF CHAR;
size [3] : LONGINT;
flags [4] : SET)
: LONGINT;
-906;
LIBCALL (base : DosLibraryPtr) DeleteVar*
( name [1] : ARRAY OF CHAR;
flags [2] : SET )
: BOOLEAN;
-912;
LIBCALL (base : DosLibraryPtr) FindVar*
( name [1] : ARRAY OF CHAR;
type [2] : SET )
: LocalVarPtr;
-918;
LIBCALL (base : DosLibraryPtr) CliInit*
( VAR dp [8] : DosPacket )
: SET;
-924;
LIBCALL (base : DosLibraryPtr) CliInitNewcli*
( VAR dp [8] : DosPacket )
: SET;
-930;
LIBCALL (base : DosLibraryPtr) CliInitRun*
( VAR dp [8] : DosPacket )
: SET;
-936;
LIBCALL (base : DosLibraryPtr) WriteChars*
( buf [1] : ARRAY OF CHAR;
buflen [2] : LONGINT )
: LONGINT;
-942;
LIBCALL (base : DosLibraryPtr) PutStr*
( str [1] : ARRAY OF CHAR )
: LONGINT;
-948;
LIBCALL (base : DosLibraryPtr) VPrintf*
( format [1] : ARRAY OF CHAR;
argarray [2] : ARRAY OF SYS.LONGWORD )
: LONGINT;
-954;
LIBCALL (base : DosLibraryPtr) Printf*
( format [1] : ARRAY OF CHAR;
argarray [2].. : SYS.LONGWORD )
: LONGINT;
-954;
LIBCALL (base : DosLibraryPtr) PrintF*
( format [1] : ARRAY OF CHAR;
argarray [2].. : SYS.LONGWORD );
-954;
(* these were unimplemented until dos 36.147 *)
LIBCALL (base : DosLibraryPtr) ParsePatternNoCase*
( pat [1] : ARRAY OF CHAR;
VAR buf [2] : ARRAY OF CHAR;
buflen [3] : LONGINT)
: INTEGER;
-966;
LIBCALL (base : DosLibraryPtr) MatchPatternNoCase*
( pat [1] : ARRAY OF CHAR;
str [2] : ARRAY OF CHAR )
: BOOLEAN;
-972;
(* this was added for V37 dos; returned 0 before then. *)
LIBCALL (base : DosLibraryPtr) SameDevice*
( lock1 [1] : FileLockPtr;
lock2 [2] : FileLockPtr )
: BOOLEAN;
-984;
(* NOTE: the following entries did NOT exist before ks 36.303 (2.02) *)
(* If you are going to use them, open dos.library with version 37 *)
(* These calls were added for V39 dos: *)
LIBCALL (base : DosLibraryPtr) ExAllEnd *
( lock [1] : FileLockPtr;
buffer [2] : ARRAY OF SYS.BYTE;
size [3] : LONGINT;
data [4] : LONGINT;
control [5] : ExAllControlPtr );
-990;
LIBCALL (base : DosLibraryPtr) SetOwner *
( name [1] : ARRAY OF CHAR;
ownerInfo [2] : LONGINT)
: BOOLEAN;
-996;
(**-- C Macros ---------------------------------------------------------*)
(*
** $VER: stdio.h 36.6 (1.11.91)
**
** ANSI-like stdio defines for dos buffered I/O
*)
PROCEDURE ReadChar * () : CHAR;
VAR c : LONGINT;
BEGIN
c := base.FGetC (base.Input());
IF (c < 0) OR (c > 255) THEN c := 0 END;
RETURN CHR(c)
END ReadChar;
PROCEDURE WriteChar * ( c : CHAR ) : LONGINT;
BEGIN
RETURN base.FPutC (base.Output (), ORD (c))
END WriteChar;
PROCEDURE UnReadChar * ( c : CHAR ) : LONGINT;
BEGIN
RETURN base.UnGetC (base.Input(), ORD(c))
END UnReadChar;
(* next one is inefficient *)
PROCEDURE ReadChars *
(VAR buf : ARRAY OF SYS.BYTE; num : LONGINT)
: LONGINT;
BEGIN
RETURN base.FRead (base.Input (), buf, 1, num)
END ReadChars;
PROCEDURE ReadLn * (VAR buf : ARRAY OF CHAR; len : LONGINT) : E.APTR;
BEGIN
RETURN base.FGets (base.Input (), buf, len)
END ReadLn;
PROCEDURE WriteStr * (s : ARRAY OF CHAR) : BOOLEAN;
(* $D- *)
BEGIN
RETURN base.FPuts (base.Output (), s)
END WriteStr;
PROCEDURE VWritef *
(format : ARRAY OF CHAR; argv : ARRAY OF SYS.LONGWORD)
: LONGINT;
(* $D- *)
BEGIN
RETURN base.VFWritef (base.Output(), format, argv)
END VWritef;
(**-- Library Base variable --------------------------------------------*)
(* $L- *)
PROCEDURE* Close ();
BEGIN (* Close *)
IF base # NIL THEN E.base.CloseLibrary (base) END;
END Close;
BEGIN (* Dos *)
base :=
SYS.VAL (
DosLibraryPtr,
E.base.OpenLibrary (name, E.libraryMinimum));
IF base = NIL THEN HALT (100) END;
SYS.SETCLEANUP (Close)
END Dos.