1 {
2     This file is part of the Free Pascal run time library.
3     Copyright (c) 2016 by Free Pascal development team
4 
5     dos.library functions for Amiga OS 4.x
6 
7     See the file COPYING.FPC, included in this distribution,
8     for details about the copyright.
9 
10     This program is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 
14  **********************************************************************}
15 
16 {$PACKRECORDS 2}
17 
18 unit amigados;
19 
20 interface
21 
22 uses
23   exec, utility, timer;
24 
25 const
26 // Predefined Amiga DOS global constants
27   DOSTRUE     = -1;
28   DOSFALSE    =  0;
29 
30   BITSPERBYTE  = 8;
31   BYTESPERLONG = 4;
32   BITSPERLONG  = 32;
33   MAXINT       = $7FFFFFFF;
34   MININT       = $80000000;
35 
36 // Mode parameter to Open(), all files are positioned at beginning of file.
37   MODE_OLDFILE   = 1005; // Open existing file read/write positioned at beginning of file.
38   MODE_NEWFILE   = 1006; // Open freshly created file (delete old file) read/write
39   MODE_READWRITE = 1004; // Open old file w/exclusive lock
40 
41 // Relative position to Seek(deprecated) and ChangeFilePosition()
42   OFFSET_BEGINNING = -1; // relative to Begining Of File
43   OFFSET_CURRENT   = 0;  // relative to Current file position
44   OFFSET_END       = 1;  // relative to End Of File
45 
46 // Passed as 'accessMode' to Lock()
47   SHARED_LOCK    = -2; // File is readable by others
48   ACCESS_READ    = -2; //   Somewhat misleading old synonym
49   EXCLUSIVE_LOCK = -1; // No other access allowed
50   ACCESS_WRITE   = -1; //   Somewhat misleading old synonym
51 
52 // *********************************************************************
53 // Flags for the bitmasks returned by LockTags() when using LK_InfoMask tag.*/
54 // These provide detailed information on the string being resolved.  V53.57 */
55 
56   LOCKB_SOFTLINK_MIDPART = 8;  // One or more soft links were found in the middle of the path
57                                // but none of these formed the last component of the path.
58   LOCKB_SOFTLINK_ENDPART = 9;  // One soft link exists as the last component of the path.
59   LOCKB_DEVICE           = 16; // The supplied path is a device relative specification.
60   LOCKB_VOLUME           = 17; // The supplied path is a volume relative specification.
61   LOCKB_ASSIGNMENT       = 18; // The supplied path is an assignment relative specification.
62   LOCKB_PROGDIR          = 19; // The supplied path is a PROGDIR: relative specification.
63   LOCKB_CURRDIR          = 20; // The supplied path is a CURRDIR: relative specification.
64   LOCKB_ROOTDIR          = 21; // The supplied path is a root directory relative specification.
65   LOCKB_FILESYS          = 24; // The supplied path returned the root of the default filesystem.
66 
67 // Field definitions of the above.
68   LOCKF_SOFTLINK_MIDPART = 1 shl LOCKB_SOFTLINK_MIDPART;
69   LOCKF_SOFTLINK_ENDPART = 1 shl LOCKB_SOFTLINK_ENDPART;
70   LOCKF_DEVICE           = 1 shl LOCKB_DEVICE;
71   LOCKF_VOLUME           = 1 shl LOCKB_VOLUME;
72   LOCKF_ASSIGNMENT       = 1 shl LOCKB_ASSIGNMENT;
73   LOCKF_PROGDIR          = 1 shl LOCKB_PROGDIR;
74   LOCKF_CURRDIR          = 1 shl LOCKB_CURRDIR;
75   LOCKF_ROOTDIR          = 1 shl LOCKB_ROOTDIR;
76   LOCKF_FILESYS          = 1 shl LOCKB_FILESYS;
77 
78 // *********************************************************************
79 // Result flags for WaitForData().
80   WFDB_READ  = 0; // Stream has data ready to be read
81   WFDB_WRITE = 1; // Stream is ready to accept more data to be written.
82 
83   WFDF_READ  = 1 shl WFDB_READ;
84   WFDF_WRITE = 1 shl WFDB_WRITE;
85 
86 // *********************************************************************
87 // NotifyProcListChange(), NotifyDosListChange(), termination signal value.
88   NPLC_END = $FFFFFFFF;
89   NDLC_END = $FFFFFFFF;
90 
91 // *********************************************************************
92 // SetBlockingMode() mode values which define whether read/write access to a
93 // stream will block until a request is satisfied or will return immediately.
94   SBM_BLOCKING     = 1;
95   SBM_NON_BLOCKING = 2;
96 
97 // *********************************************************************
thisnull98 // GetPID() function, this flag determins which PID is returned. 53.58
99   GPID_PROCESS = 1;
100   GPID_PARENT  = 2;
101 
102 // *********************************************************************
103 // Length constants specifically for new vector-port based filesystems.
104 // Older packet filesystem designs may not support these lengths,
105 // so use FileSystemAttr() to find out filesystem specific values.
106   MAX_VP_FILENAME   = 255;
107   MAX_VP_COMMENT    = 255;
108   MAX_VP_SOFTLINK_TARGET = 4000;
109 
110 type
111   FileHandle = BPTR;
112   FileLock   = BPTR;
113 
114 // *********************************************************************
115   PDateStamp = ^TDateStamp;
116   TDateStamp = record
117     ds_Days: LongInt;   // Number of days since Jan. 1, 1978
118     ds_Minute: LongInt; // Number of minutes past midnight
119     ds_Tick: LongInt;   // Number of ticks past minute
120   end;
121 
122 const
123   TICKS_PER_SECOND = 50; // Fifty ticks = one second One tick = twenty milliseconds
124 
125 // *********************************************************************
126 // V52 Struct ExamineData, returned by ExamineObject() and ExamineDir().
127 // This structure supports unlimited string lengths, 64 bit file sizes,
128 // automatic resolution of link targets and extended auxilliary information.
129 //
130 // NOTE; Applications DO NOT allocate these, the filesystem does it.
131 //       Also, the filesystem itself must always allocate these using
132 //       AllocDosObject(), otherwise they will simply not work.
133 type
134   // (RO) = Read Only, these fields must not be modified by the application.
135   PExamineData = ^TExamineData;
136   TExamineData = record
137     EXDnode: TMinNode;     // MinList node.
138     EXDinfo: LongWord;     // General purpose user data.
139 
140     // These are private members exclusively for the FS & DOS.
141     FSPrivate: LongWord;   // FILESYSTEM ONLY - Private usage.
142     Reserved0: LongWord;   // DOS RESERVED - Private usage.
143     DOSPrivate: APTR;      // DOSLIB ONLY - Private usage.
144 
145     // The following are public fields.
146     StructSize: LongWord;  // (RO) Full size of the structure.
147     Type_: LongWord;       // Entry type; use EXD_IS_ macros below.
148     FileSize: Int64;       // Size of a file, otherwise set to -1.
149     Date: TDateStamp;      // Days, Mins, Ticks.
150     RefCount: LongWord;    // Object hardlink references.    [Note 1]
151     ObjectID: QWord;       // Unique object identifier.      [Note 2]
152     Name: STRPTR;          // (RO) Nul-terminated object name.
153     NameSize: LongWord;    // (RO) Allocated size of the name buffer.
154     Comment: STRPTR;       // (RO) Nul-terminated comment string.
155     CommentSize: LongWord; // (RO) Allocated size of comment buffer.
156     Link: STRPTR;          // (RO) Nul-terminated target name string.
157     LinkSize: LongWord;    // (RO) Allocated size of target buffer.
158     Protection: LongWord;  // Protection status bitmask.
159     OwnerUID: LongWord;    // Owner info. [Note 3]
160     OwnerGID: LongWord;    // Group info. [Note 3]
161     Reserved2: LongWord;   // DOS reserved field.
162     Reserved3: LongWord;   // DOS reserved field.
163     Reserved4: LongWord;   // DOS reserved field.
164   end;
165 {
166  [Note 1] If possible, this field should be supported by filesystems that
167           support hardlinks, it is used to indicate the hardlink reference
168           count for objects.  A value of one indicates that the object has
169           no additional references other than itself, a value of two will
170           indicate that it has one additional hardlink reference,
171           a value of three means it has two hardlink references, etc...
172           All hardlinks themselves always show a value of 1 in this field
173           when supported, otherwise this field MUST be set to zero for
174           all objects, if the filesystem does not support it.
175           It will be undefined if the caller fails to specify the
176           EXF_REFCOUNT bit in the EX_DataFields mask.
177 
178  [Note 2] This field is the mandatory unique object identfier for all
179           objects on this volume, the value used here may be any arbitrary
180           value as long as it is unique from all other objects on this
181           volume, it may use the object node address, the disk header block
182           number or other such values. (Note: this field is 64 bits wide.)
183           This field will be undefined if you fail to specify the
184           EXF_OBJECTID bit in the EX_DataFields mask.
185 
186  [Note 3] Historically, these fields only used the low 16 bits.
187           For extensibility, the size of these are now 32 bit fields.
188           However, for interoperability, it is recommended that values
189           greater than 65535 be avoided where possible so reading only
190           the low 16 bits results in the same value for legacy applications.
191           These fields will be undefined if you fail to specify the
192           EXF_OWNER bit in the EX_DataFields mask.
193           (See extended information relating to the UID/GID fields below.)}
194 
195 // *********************************************************************
196 // Bit mask field values that are passed in the EX_DataFields tag,
197 // this determines what data is returned from the ExamineDir() function.
198 //
199 // The data value returned in the respective fields will be undefined if
200 // the mask bit is not specified, NEVER assume otherwise.
201 const
202   EXF_DATE       = 1 shl 0;
203   EXF_REFCOUNT   = 1 shl 1;
204   EXF_NAME       = 1 shl 2;
205   EXF_COMMENT    = 1 shl 3;
206   EXF_LINK       = 1 shl 4;
207   EXF_PROTECTION = 1 shl 5;
208   EXF_OWNER      = 1 shl 6;  // both Group and User ID
209   EXF_TYPE       = 1 shl 7;  // MUST be specified for EXD_IS macros
210   EXF_SIZE       = 1 shl 8;
211   EXF_OBJECTID   = 1 shl 9;
212 
213   EXF_spare1     = 1 shl 10; // reserved for future EXF_ALL feature
214   EXF_spare2     = 1 shl 11; // reserved for future EXF_ALL feature
215   EXF_spare3     = 1 shl 12; // reserved for future EXF_ALL feature
216   EXF_spare4     = 1 shl 13; // reserved for future EXF_ALL feature
217   EXF_spare5     = 1 shl 14; // reserved for future EXF_ALL feature
218   EXF_spare6     = 1 shl 15; // reserved for future EXF_ALL feature
219 
220   EXF_ALL        = $FFFF;    // Return all of the information above
221 
222 // *********************************************************************
223 // Values for ExamineData->Type for checking what kind of object it describes.
224 // The lower 8 bits form the unique descriptor value, the upper bits are used
225 // as a bitmask. The FSO_TYPE_MASK is used to filter the descriptor value.
226 // NOTE: You MUST specify EXF_TYPE in the EX_DataFields tag for these macros
227 //       to work otherwise random values will be returned in the 'Type' field.
228 
229   FSO_TYPE_MASK      = $FF; // mask for object type descriptors
230 
231   FSO_TYPE_SOFTLINK  = 0;   // Object is a softlink
232   FSO_TYPE_FILE      = 1;   // Object is a file
233   FSO_TYPE_DIRECTORY = 2;   // Object is a directory
234   FSO_TYPE_PIPE      = 3;   // Object is a pipe stream
235   FSO_TYPE_SOCKET    = 4;   // Object is a socket stream
236 
237   FSO_TYPE_INVALID   = $FE; // Object is unidentifiable or corrupt, you SHOULD never actually see this,
238                             // but the value is reserved here for use by the handler AND DOS to indicate internal errors.
239                             // You MAY also possibly see this value if one were to read the 'Type' member without
240                             // setting the EXF_TYPE bit in EX_DataFields.
241   FSOF_LINK    = 1 shl 8; // Bit set for FFS style hard & soft links
242   FSOF_ALTLINK = 1 shl 9; // Reserved bit for alternate style links, these are currently unimplemented.
243 
244 // Information relating to the ExamineData; OwnerUID and OwnerGID members.
245   DOS_OWNER_ROOT = 65535;
246   DOS_OWNER_NONE = 0;
247 
248 // *********************************************************************
249 // Definitions for the ExamineData "Protection" bitfield.
250   EXDB_OTR_READ        = 15; // Other: file is readable
251   EXDB_OTR_WRITE       = 14; // Other: file is writable
252   EXDB_OTR_EXECUTE     = 13; // Other: file is executable
253   EXDB_OTR_DELETE      = 12; // Other: file is deleted
254   EXDB_GRP_READ        = 11; // Group: file is readable
255   EXDB_GRP_WRITE       = 10; // Group: file is writable
256   EXDB_GRP_EXECUTE     =  9; // Group: file is executable
257   EXDB_GRP_DELETE      =  8; // Group: file is deleteable
258 
259   EXDB_HOLD             = 7; // (H) hold loaded program in cli resident list (v50)
260   EXDB_SCRIPT           = 6; // (S) program is a script (execute) file
261   EXDB_PURE             = 5; // (P) program is reentrant and reexecutable
262   EXDB_ARCHIVE          = 4; // (A) cleared whenever file is changed
263   EXDB_NO_READ          = 3; // (R) NOT readable,
264   EXDB_NO_WRITE         = 2; // (W) NOT writable,
265   EXDB_NO_EXECUTE       = 1; // (E) NOT executable, Used by Shell only
266   EXDB_NO_DELETE        = 0; // (D) NOT deletable,
267 
268 // Masks for above bits
269   EXDF_OTR_READ    = 1 shl EXDB_OTR_READ;
270   EXDF_OTR_WRITE   = 1 shl EXDB_OTR_WRITE;
271   EXDF_OTR_EXECUTE = 1 shl EXDB_OTR_EXECUTE;
272   EXDF_OTR_DELETE  = 1 shl EXDB_OTR_DELETE;
273   EXDF_GRP_READ    = 1 shl EXDB_GRP_READ;
274   EXDF_GRP_WRITE   = 1 shl EXDB_GRP_WRITE;
275   EXDF_GRP_EXECUTE = 1 shl EXDB_GRP_EXECUTE;
276   EXDF_GRP_DELETE  = 1 shl EXDB_GRP_DELETE;
277 
278   EXDF_HOLD        = 1 shl EXDB_HOLD;
279   EXDF_SCRIPT      = 1 shl EXDB_SCRIPT;
280   EXDF_PURE        = 1 shl EXDB_PURE;
281   EXDF_ARCHIVE     = 1 shl EXDB_ARCHIVE;
282   EXDF_NO_READ     = 1 shl EXDB_NO_READ;
283   EXDF_NO_WRITE    = 1 shl EXDB_NO_WRITE;
284   EXDF_NO_EXECUTE  = 1 shl EXDB_NO_EXECUTE;
285   EXDF_NO_DELETE   = 1 shl EXDB_NO_DELETE;
286 
287   EXDF_DEFAULT = 0;
288 
289 {$PACKRECORDS 4}
290 type
291 // Returned by Examine() and ExInfo(), must be on a 4 byte boundary
292 // This structure is obsolete, due to 4 gig file size limits, short string
293 // length issues and lack of extensibility.
294 // Software should migrate to using the new ExamineDir() and the ExamineObject()
295 // functions which use the struct ExamineData.
296 //
297 // This structure is here because it is nested within other structures and for
298 // legacy compatibility reasons, so this definition can't be removed at this time.
299 //
300 // NOTE: The fib_DOSReserved[8] area is ABSOLUTELY DOS PRIVATE !! - Do not access it.
301 //       DOS uses all of this space for context information when emulating the
302 //       old V40 functions that require this structure.
303 
304   PFileInfoBlock = ^TFileInfoBlock;
305   TFileInfoBlock = record
306     fib_DiskKey: LongWord;     // -- FILESYSTEM PRIVATE !!
307     fib_DirEntryType: LongInt; // Use FIB_IS_ macros to identify object.
308     fib_FileName: array[0..107] of Char; // Null terminated.
309     fib_Protection: LongWord;  // Bit mask of protection, rwxd are 3-0.
310     fib_Obsolete: LongInt;     // obsolete use fib_DirEntryType instead
311     fib_Size: LongWord;        // Byte size of file, only good to 4 gig.
312     fib_NumBlocks: LongWord;   // Number of blocks in file
313     fib_Date: TDateStamp;      // Date file last changed
314     fib_Comment: array[0..79] of Char; // Null terminated comment string.
315     // Note: the following two fields are not supported by all filesystems.
316     //   Should be 0 if not supported
317     fib_OwnerUID: Word;        //
318     fib_OwnerGID: Word;        //
319     fib_Reserved: array [0..7] of Pointer; // DOS Private do not access this
320   end; // FileInfoBlock - 260 bytes
321 
322 const
323 
324 { FIB stands for FileInfoBlock }
325 
326 {* FIBB are bit definitions, FIBF are field definitions *}
327 {* Regular RWED bits are 0 == allowed. *}
328 {* NOTE: GRP and OTR RWED permissions are 0 == not allowed! *}
329 {* Group and Other permissions are not directly handled by the filesystem *}
330 
331     FIBB_OTR_READ       = 15;   {* Other: file is readable *}
332     FIBB_OTR_WRITE      = 14;   {* Other: file is writable *}
333     FIBB_OTR_EXECUTE    = 13;   {* Other: file is executable *}
334     FIBB_OTR_DELETE     = 12;   {* Other: prevent file from being deleted *}
335     FIBB_GRP_READ       = 11;   {* Group: file is readable *}
336     FIBB_GRP_WRITE      = 10;   {* Group: file is writable *}
337     FIBB_GRP_EXECUTE    = 9;    {* Group: file is executable *}
338     FIBB_GRP_DELETE     = 8;    {* Group: prevent file from being deleted *}
339 
340     FIBB_SCRIPT         = 6;    { program is a script (execute) file }
341     FIBB_PURE           = 5;    { program is reentrant and rexecutable}
342     FIBB_ARCHIVE        = 4;    { cleared whenever file is changed }
343     FIBB_READ           = 3;    { ignored by old filesystem }
344     FIBB_WRITE          = 2;    { ignored by old filesystem }
345     FIBB_EXECUTE        = 1;    { ignored by system, used by Shell }
346     FIBB_DELETE         = 0;    { prevent file from being deleted }
347 
348     FIBF_OTR_READ      = (1 shl FIBB_OTR_READ);
349     FIBF_OTR_WRITE     = (1 shl FIBB_OTR_WRITE);
350     FIBF_OTR_EXECUTE   = (1 shl FIBB_OTR_EXECUTE);
351     FIBF_OTR_DELETE    = (1 shl FIBB_OTR_DELETE);
352     FIBF_GRP_READ      = (1 shl FIBB_GRP_READ);
353     FIBF_GRP_WRITE     = (1 shl FIBB_GRP_WRITE);
354     FIBF_GRP_EXECUTE   = (1 shl FIBB_GRP_EXECUTE);
355     FIBF_GRP_DELETE    = (1 shl FIBB_GRP_DELETE);
356 
357     FIBF_SCRIPT         = 64;
358     FIBF_PURE           = 32;
359     FIBF_ARCHIVE        = 16;
360     FIBF_READ           = 8;
361     FIBF_WRITE          = 4;
362     FIBF_EXECUTE        = 2;
363     FIBF_DELETE         = 1;
364 
365 // Standard maximum length for an error string from fault.  However, most
366 // error strings should be kept under 60 characters if possible.  Don't
367 // forget space for the header you pass in. *}
368   FAULT_MAX = 82;
369 
370 type
thenull371 // For the old Info() function, the structure must be on a 4 byte boundary.
372 // The new V51+ GetDiskInfo() doesn't require special structure alignment.
373 // Just use AllocDosObject(DOS_INFO,0); to get the right one every time.
374   PInfoData = ^TInfoData;
375   TInfoData = record
376     id_NumSoftErrors: LongInt;  // number of soft errors on disk
377     id_UnitNumber: LongInt;     // Which unit disk is (was) mounted on
378     id_DiskState: LongInt;      // See defines below
379     id_NumBlocks: LongWord;     // Number of blocks on disk
380     id_NumBlocksUsed: LongWord; // Number of block in use
381     id_BytesPerBlock: LongWord;
382     id_DiskType: LongInt;       // Disk Type code
383     id_VolumeNode: BPTR;        // BCPL pointer to volume node
384     id_InUse: LongInt;          // Flag, zero if not in use
385   end;
386 {$PACKRECORDS 2}
387 
388 const
389 // InfoData (ID stands for InfoData)
390 // Disk states }
391   ID_WRITE_PROTECTED  = 80; // Disk is write protected
392   ID_VALIDATING       = 81; // Disk is currently being validated
393   ID_VALIDATED        = 82; // Disk is consistent and writeable
394 // Disk types for; id_DiskType
395   ID_NO_DISK_PRESENT     = -1;
396   ID_UNREADABLE_DISK     = $42414400; // 'BAD\0'
397   ID_BUSY_DISK           = $42555359; // 'BUSY'
398   ID_SWAP_DISK           = $53574150; // 'SWAP'
399   ID_NOT_REALLY_DOS      = $4E444F53; // 'NDOS'
400   ID_KICKSTART_DISK      = $4B49434B; // 'KICK'
401   ID_CDFS_DISK           = ((Ord('C') shl 24) or (Ord('D') shl 16) or (Ord('0') shl 8) or $01); // CDFileSystem 'CD01'
402 
403   ID_DOS_DISK            = $444F5300; // 'DOS\0'
404   ID_FFS_DISK            = $444F5301; // 'DOS\1'
405   ID_INTER_DOS_DISK      = $444F5302; // 'DOS\2'
406   ID_INTER_FFS_DISK      = $444F5303; // 'DOS\3'
407   ID_FASTDIR_DOS_DISK    = $444F5304; // 'DOS\4'
408   ID_FASTDIR_FFS_DISK    = $444F5305; // 'DOS\5'
409   ID_LONGNAME_DOS_DISK   = $444F5306; // 'DOS\6'
410   ID_LONGNAME_FFS_DISK   = $444F5307; // 'DOS\7'
411 
412 // V53 disk type used for new vector-port based filesystems like RAM: ENV: APPDIR:
413   ID_VP255_DOS_DISK     = $444F5309;  // 'DOS\9'
414   ID_NGFS_DISK          = $4E474653;  //  NGFS
415 
416 // Special 'disk type' signatures returned by con-handler
417   ID_CON                = $434F4E00;  // 'CON\0'
418   ID_RAWCON             = $52415700;  // 'RAW\0'
419 
420 // Other known disk types
421   ID_MSDOS_DISK    = (Ord('M') shl 24) or (Ord('S') shl 16) or (Ord('D') shl 8) or $00;
422   ID_MSDOS_DISK_HD = (Ord('M') shl 24) or (Ord('S') shl 16) or (Ord('H') shl 8) or $00;
423   ID_MSDOS_DISK_DS = (Ord('M') shl 24) or (Ord('D') shl 16) or (Ord('D') shl 8) or $00;
424 
425 // FAT disk types
426   ID_FAT00_DISK = (Ord('F') shl 24) or (Ord('A') shl 16) or (Ord('T') shl 8) or $00;
427   ID_FAT01_DISK = (Ord('F') shl 24) or (Ord('A') shl 16) or (Ord('T') shl 8) or $01;
428   ID_FAT32_DISK = (Ord('F') shl 24) or (Ord('A') shl 16) or (Ord('T') shl 8) or $32;
429 
430 // FUSE filesystems
431   ID_BOX0_DISK        = $424F5800; //  BOX\0 - BoxFileSystem
432   ID_EXFAT_DISK       = $46415458; //  FATX  - exFATFileSystem
433   ID_EXT2_DISK        = $45585402; //  EXT\2 - FuseExt2FileSystem
434   ID_HFS_DISK         = $48465300; //  HFS\0 - FuseHFS
435   ID_NTFS_DISK        = $4e544653; //  NTFS  - NTFileSystem3G
436 
437 
438 
439 
440 // Errors from IoErr(), etc.
441   ERROR_INVALID_PACKET_MESSAGE     = 101;
442   ERROR_WRONG_PACKET_RETURNED      = 102;
443   ERROR_NO_FREE_STORE              = 103;
444   ERROR_TASK_TABLE_FULL            = 105;
445   ERROR_BAD_TEMPLATE               = 114;
446   ERROR_BAD_NUMBER                 = 115;
447   ERROR_REQUIRED_ARG_MISSING       = 116;
448   ERROR_KEY_NEEDS_ARG              = 117;
449   ERROR_TOO_MANY_ARGS              = 118;
450   ERROR_UNMATCHED_QUOTES           = 119;
451   ERROR_LINE_TOO_LONG              = 120;
452   ERROR_FILE_NOT_OBJECT            = 121;
453   ERROR_INVALID_RESIDENT_LIBRARY   = 122;
454   ERROR_NO_DEFAULT_DIR             = 201;
455   ERROR_OBJECT_IN_USE              = 202;
456   ERROR_OBJECT_EXISTS              = 203;
457   ERROR_DIR_NOT_FOUND              = 204;
458   ERROR_OBJECT_NOT_FOUND           = 205;
459   ERROR_BAD_STREAM_NAME            = 206;
460   ERROR_OBJECT_TOO_LARGE           = 207;
461   ERROR_ACTION_NOT_KNOWN           = 209;
462   ERROR_INVALID_COMPONENT_NAME     = 210;
463   ERROR_INVALID_LOCK               = 211;
464   ERROR_OBJECT_WRONG_TYPE          = 212;
465   ERROR_DISK_NOT_VALIDATED         = 213;
466   ERROR_DISK_WRITE_PROTECTED       = 214;
467   ERROR_RENAME_ACROSS_DEVICES      = 215;
468   ERROR_DIRECTORY_NOT_EMPTY        = 216;
469   ERROR_TOO_MANY_LEVELS            = 217;
470   ERROR_DEVICE_NOT_MOUNTED         = 218;
471   ERROR_SEEK_ERROR                 = 219;
472   ERROR_COMMENT_TOO_BIG            = 220;
473   ERROR_DISK_FULL                  = 221;
474   ERROR_DELETE_PROTECTED           = 222;
475   ERROR_WRITE_PROTECTED            = 223;
476   ERROR_READ_PROTECTED             = 224;
477   ERROR_NOT_A_DOS_DISK             = 225;
478   ERROR_NO_DISK                    = 226;
479   ERROR_NO_MORE_ENTRIES            = 232;
480 // added for 1.4
481   ERROR_IS_SOFT_LINK               = 233;
482   ERROR_OBJECT_LINKED              = 234;
483   ERROR_BAD_HUNK                   = 235;
484   ERROR_NOT_IMPLEMENTED            = 236;
485   ERROR_RECORD_NOT_LOCKED          = 240;
486   ERROR_LOCK_COLLISION             = 241;
487   ERROR_LOCK_TIMEOUT               = 242;
488   ERROR_UNLOCK_ERROR               = 243;
489 //
490   ERROR_BUFFER_OVERFLOW            = 303; // User or internal buffer overflow
491   ERROR_BREAK                      = 304; // A break character was received
492   ERROR_NOT_EXECUTABLE             = 305; // A file has E bit cleared
493   ERROR_IS_PIPE                    = 306; // Operation is not permitted on pipes
494   ERROR_BROKEN_PIPE                = 307; // No more data can be read from or written to this pipe
495   ERROR_WOULD_BLOCK                = 308; // Operation cannot complete immediately, as requested
496   ERROR_BAD_SIGNAL_BIT             = 309; // An invalid signal bit number was specified
497 //
498   ERROR_UNSUPPORTED_HARDWARE       = 350; // The hardware found is unsupported by software
499 // Special error codes that can be set by MountDevice().
500   ERROR_INVALID_DEVICE_TYPE        = 401; // Device to be mounted is neither handler nor file system.
501   ERROR_INVALID_DEVICE_NAME        = 402; // Name of device to be mounted does contain more colon characters than necessary, or in the wrong place
502   ERROR_DEVICE_NAME_TOO_LONG       = 403; // Name of device to be mounted is longer than 255 characters
503   ERROR_INVALID_SECTOR_SIZE        = 404; // Sector size is not a multiple of four
504   ERROR_CONTROL_STRING_TOO_LONG    = 405; // Control string for device to be mounted is longer than 255 characters
505   ERROR_EXEC_DEVICE_NAME_TOO_LONG  = 406; // Exec device driver name for device to be mounted is longer than 255 characters
506   ERROR_HANDLER_STRING_TOO_LONG    = 407; // Name of handler to be mounted is longer than 255 characters
507   ERROR_STARTUP_STRING_TOO_LONG    = 408; // Startup string for device to be mounted is longer than 255 characters
508   ERROR_SIZE_MISSING               = 409; // Number of surfaces, sector size, number of sectors per block or number of sectors per track is zero
509   ERROR_DEVICE_NAME_MISSING        = 410; // No exec device driver name was given
510   ERROR_INVALID_NUMBER_OF_CYLINDERS = 411; // Number of cylinders to use is negative
511   ERROR_HANDLER_CANNOT_BE_STARTED   = 412; // No handler name, segment list or port address was given
512   ERROR_INVALID_GLOBAL_VECTOR       = 413; // Global vector must be one of -2 or -1
513   ERROR_INVALID_TASK_PRIORITY       = 414; // The task priority is not in the range -128..127
514 
515 // *********************************************************************
516 // These are the return codes used by convention by AmigaDOS commands.
517 // See FAILAT and IF commands for relevance to EXECUTE files.
518 // See RunCommand() and CreateNewProc() for relevance to all DOS processes.
519   RETURN_OK    = 0;  // No problems, success
520   RETURN_WARN  = 5;  // A warning only
521   RETURN_ERROR = 10; // Something wrong
522   RETURN_FAIL  = 20; // Complete or severe failure
523 
524 // Bit numbers that signal that a user has issued a break
525   SIGBREAKB_CTRL_C = 12;
526   SIGBREAKB_CTRL_D = 13;
527   SIGBREAKB_CTRL_E = 14;
528   SIGBREAKB_CTRL_F = 15;
529 // Bit fields that signal that a user has issued a break, See CheckSignal() for examples.
530   SIGBREAKF_CTRL_C = 1 shl SIGBREAKB_CTRL_C;
531   SIGBREAKF_CTRL_D = 1 shl SIGBREAKB_CTRL_D;
532   SIGBREAKF_CTRL_E = 1 shl SIGBREAKB_CTRL_E;
533   SIGBREAKF_CTRL_F = 1 shl SIGBREAKB_CTRL_F;
534 // Values returned by SameLock()
535   LOCK_DIFFERENT    =  -1;
536   LOCK_SAME         =  0;
537   LOCK_SAME_HANDLER =  1; // locks are on same volume
538 // types for ChangeMode()
539   CHANGE_LOCK = 0;
540   CHANGE_FH   = 1;
541 // Mode parameter for DevNameFromLock() and DevNameFromFH()
542   DN_DEVICEONLY = 0;
543   DN_FULLPATH   = 1;
544   DN_ROOTPATH   = 2;
545 // Mode flags for GetProcSegList() (v51.88)
546   GPSLF_CLI = 1 shl 1;
547   GPSLF_SEG = 1 shl 2;
548   GPSLF_ENT = 1 shl 3;
549   GPSLF_RUN = 1 shl 4;
550 // Values for MakeLink() - DO NOT use random values, new link types will be added in the future that require other values to be used.
551   LINK_HARD = 0;
552   LINK_SOFT = 1;
553 // Values returned by ReadItem (and ReadLineItem V50)
554   ITEM_EQUAL    = -2; // "=" Symbol
555   ITEM_ERROR    = -1; // error
556   ITEM_NOTHING  = 0;  // *N, ;, endstreamch
557   ITEM_UNQUOTED = 1;  // unquoted item
558   ITEM_QUOTED   = 2;  // quoted item
559 // Types for AllocDosObject/FreeDosObject
560   DOS_FILEHANDLE        = 0;  // Very few people should use this
561   DOS_EXALLCONTROL      = 1;  // Must be used to allocate this! - Obsolete struct
562   DOS_FIB               = 2;  // may be useful - not really, it's obsolete now
563   DOS_STDPKT            = 3;  // for doing packet-level I/O
564   DOS_CLI               = 4;  // for shell-writers, etc
565   DOS_RDARGS            = 5;  // for ReadArgs if you pass it in
566   DOS_ANCHORPATH        = 6;  // for MatchFirst/MatchNext (V50)
567   DOS_INFODATA          = 7;  // for Info() aligned InfoData (V50)
568   DOS_NOTIFYREQUEST     = 8;  // for Notify request functions (V51)
569   DOS_LOCK              = 9;  // for filesystem lock allocations (V51)
570   DOS_FREADLINEDATA     = 10; // for FReadLine() structure. (V51)
571   DOS_EXAMINEDATA       = 11; // for filesystem ExamineData allocations.(V51)
572   DOS_DOSLIST           = 12; // for struct DosList allocations. (V52.16)
573   DOS_VOLUMELIST        = 13; // for struct list with attached nodes. (V53.52)
574   DOS_FSVECTORPORT      = 14; // for filesystem vector port creation. (53.80)
575 
576 type
577 // The following is used by the new V51 tag;  NP_NotifyOnDeathMessage
578 // See CreateNewProc() autodoc for more details.
579   PDeathMessage = ^TDeathMessage;
580   TDeathMessage = record
581     dm_Msg: PMessage;       // Embedded exec message structure.
582     dm_ReturnCode: LongInt; // Primary process return code, set by DOS
583     dm_Result2: LongInt;    // The value returned from IoErr(),set by DOS
584   end;
585 
586 // The following is the data structure to be used for FReadLine()
ONLY.null587 // which is allocated by the AllocDosObject() function ONLY.
588   PFReadLineData = ^TFReadLineData;
589   TFReadLineData = record
590     frld_Line: STRPTR;                        // NUL-terminated string
591     frld_LineLength: LongWord;                // what strlen(frld_Line) would return
592     frld_DosPrivate: array[0..7] of LongWord; // -- internal dos.library use only
593   end;
594 
595 // For use by the V1.4+ DOS functions StrtoDate() and DatetoStr()
596 type
597   _PDateTime = ^_TDateTime;
598   _TDateTime = record
599     dat_Stamp: TDateStamp; // DOS DateStamp
600     dat_Format: Byte;      // controls appearance of dat_StrDate
601     dat_Flags: Byte;       // see BITDEF's below
602     dat_StrDay: STRPTR;    // day of the week string
603     dat_StrDate: STRPTR;   // date string
604     dat_StrTime: STRPTR;   // time string
605   end;
606 
607 // You need this much room for each of the DateTime strings:
608 CONST
609   LEN_DATSTRING = 16;
610 
611 // Flags for dat_Flags
612    DTB_SUBST  = 0; // substitute Today, Tomorrow, etc.
613    DTB_FUTURE = 1; // day of the week is in future
614    DTF_SUBST  = 1 shl DTB_SUBST;
615    DTF_FUTURE = 1 shl DTB_FUTURE;
616 
617 
618 // date format values
619   FORMAT_DOS = 0; // dd-mmm-yy
620   FORMAT_INT = 1; // yy-mm-dd
621   FORMAT_USA = 2; // mm-dd-yy
622   FORMAT_CDN = 3; // dd-mm-yy
623   FORMAT_DEF = 4; // use default format, as defined by locale; if locale not
624                       // available, use FORMAT_DOS instead
625   FORMAT_ISO = 5; // yyyy-mm-dd (ISO 8601) Requires locale V48 or dos V50.36 if locale not available
626   FORMAT_MAX = FORMAT_ISO;
627 
628 // *********************************************************************
629 // This structure is mostly DOS private for MatchXXX() directory scanner.
630 Type
631   PAChain = ^TAChain;
632   TAChain = record
633     an_Child: PAChain;
634     an_Parent: PAChain;
635     an_Lock: BPTR;
636     // The remaining members are strictly DOS private.
637     an_Info: TFileInfoBlock;
638     an_Flags: Shortint;
639     an_ExData: PExamineData;
640     an_DevProc: Pointer; // real type PDevProc;
641     an_String: Array[0..0] of Char;
642   end;
643 
644 // Obsolete definition ==ONLY== for legacy reference, pre V50.76 DOS.
645 //  This is what DOS will expect when NOT allocated by AllocDosObject().
646 
647   PAnchorPathOld = ^TAnchorPathOld;
648   TAnchorPathOld = record
649     case smallint of
650     0 : (
651       ap_First: PAChain;
652       ap_Last: PAChain;
653      );
654     1 : (
655       ap_Base: PAChain;            // pointer to first anchor
656       ap_Current: PAChain;         // pointer to last anchor
657       ap_BreakBits,                // Bits we want to break on
658       ap_FoundBreak: LongWord;     // Bits we broke on. Also returns ERROR_BREAK
659       ap_Flags: Shortint;          // New use for extra word.
660       ap_Reserved: Shortint;
661       ap_Strlen: Word;             // This is what ap_Length used to be
662       ap_Info: TFileInfoBlock;
663       ap_Buf: array[0..0] of Char; // Buffer for path name, allocated by user !!
664      );
665   end;
666 
667 // ************************ PATTERN MATCHING ***************************
668 {
669   Structure expected by MatchFirst, MatchNext.
670   Allocate this structure ONLY with AllocDosObject() from DOS 50.76+
671   and initialize the ADO_Flags with the appropriate bits as follows:
672 
673   Set ADO_Mask, (ap_BreakBits) to the signal bitmask (^CDEF) that you want to
674   take a break on, or 0L, (default) if you don't want to convenience the user.
675 
676   If you want to have the FULL PATH NAME of the files you found,
677   allocate an additional buffer space using the tag ADO_Strlen, this will
678   place the buffer in ap_Buffer and the size into ap_Strlen.
679 
680   If you don't need the full path name, DO NOT specify the ADO_Strlen tag,
681   this will by default, set ap_Strlen to zero, for no additional buffer space.
682   In this case, the name of the file, and other stats are available in the
683   ap_ExData structure if not NULL, (or old FIB ap_Info struct for legacy apps),
684   Note that the ap_ExData pointer was NULL prior to V54, so you MUST check the
685   pointer before access, when operating with previous dos.library releases.
686   Always use ap_ExData in preference to the old ap_Info data, because only
687   ap_ExData supports 64 bit file sizes and long names > 107 bytes.
688 
689   Then call MatchFirst() and then afterwards, MatchNext() with this structure.
690   You should check the return value each time (see below) and take the
691   appropriate action, ultimately calling MatchEnd() when there are
692   no more files and you are done.  You can tell when you are done by
693   checking for the normal AmigaDOS return code ERROR_NO_MORE_ENTRIES.
694 
695 ************************************************************************
696 WARNING:  You MUST allocate these with AllocDosObject() from DOS 50.76+
697         MatchXXX() will simply not work if you do not heed this warning.
698 ************************************************************************}
699 
700   PAnchorPath = ^TAnchorPath;
701   TAnchorPath = record       // redefined for dos 50.76+ (2004)
702     ap_Magic: LongInt;       // -- PRIVATE - DOS compatibility
703     case smallint of
704     0 : (
705       ap_First: PAChain;
706       ap_Last: PAChain;
707      );
708     1 : (
709       ap_Base: PAChain;        // Ptr to first anchor
710       ap_Current: PAChain;     // Ptr to current anchor
711       ap_BreakBits: LongWord;  // Bits we want to break on
712       ap_FoundBreak: LongWord; // Bits we broke on.
713       ap_Flags: LongWord;      // The flags bitfield.
714       ap_ExData: PExamineData; // Ptr to ExamineData (or nil)
715       ap_CTXPrivate: APTR;     // -- PRIVATE, DOS use only.
716       ap_Reserved: array[0..1] of LongWord;  // Future use, currently 0
717       ap_Strlen: LongWord;     // Strlen : Size of the buffer -1
718       ap_Buffer: STRPTR;       // Full name, (see ADO_Strlen)
719       ap_Info: PFileInfoBlock; // The old FileInfoBlock space
720       ap_Private1: LongWord;   // --PRIVATE, DOS use only.
721       ap_Private2: LongWord;   // --PRIVATE, DOS use only.
722     );
723   end;
724 
725 // Flags for AnchorPath->ap_Flags.
726 
727 const
728   APB_DOWILD       = 0; // Unused
729   APB_ITSWILD      = 1; // Set by MatchFirst, used by MatchNext. Application can test APB_ITSWILD, too
730                         // (means that there's a wildcard in the pattern after calling MatchFirst).
731   APB_DODIR        = 2; // Bit is SET if a DIR node should be entered. Application can RESET this
732                         // bit after MatchFirst/MatchNext to AVOID entering a dir.
733   APB_DIDDIR       = 3; // Bit is SET for an "expired" dir node.
734   APB_NOMEMERR     = 4; // Set on memory error
735   APB_DODOT        = 5; // Unused
736   APB_DirChanged   = 6; // ap_Current->an_Lock changed since last MatchNext call
737   APB_FollowHLinks = 7; // follow hardlinks on DODIR - defaults to not following hardlinks on a DODIR.
738   APB_MultiAssigns = 8; // Set this bit via AllocDosObject() to allow Multi-Assign scanning to be enabled.
739                         // ( NOTE: ONLY AVAILABLE FROM DOS 50.76+ )
740   APF_DOWILD       = 1 shl APB_DOWILD;
741   APF_ITSWILD      = 1 shl APB_ITSWILD;
742   APF_DODIR        = 1 shl APB_DODIR;
743   APF_DIDDIR       = 1 shl APB_DIDDIR;
744   APF_NOMEMERR     = 1 shl APB_NOMEMERR;
745   APF_DODOT        = 1 shl APB_DODOT;
746   APF_DirChanged   = 1 shl APB_DirChanged;
747   APF_FollowHLinks = 1 shl APB_FollowHLinks;
748   APF_MultiAssigns = 1 shl APB_MultiAssigns; // New for V50, See AllocDosObject()
749 
750 // Flags for AChain->an_Flags; these are private to DOS!
751 
752 
753   DDB_PatternBit  = 0;
754   DDB_ExaminedBit = 1;
755   DDB_Completed   = 2;
756   DDB_AllBit      = 3;
757   DDB_Assign      = 4;
758   DDB_Device      = 5;
759 
760   DDF_Device      = 1 shl DDB_Device;
761   DDF_Assign      = 1 shl DDB_Assign;
762   DDF_AllBit      = 1 shl DDB_AllBit;
763   DDF_Completed   = 1 shl DDB_Completed;
764   DDF_ExaminedBit = 1 shl DDB_ExaminedBit;
765   DDF_PatternBit  = 1 shl DDB_PatternBit;
766 
767 {
768  * Constants used by wildcard routines, these are the pre-parsed tokens
769  * referred to by pattern match.  It is not necessary for you to do
770  * anything about these, MatchFirst() MatchNext() handle all these for you.
771  }
772 
773     P_ANY         =  $80;    { Token for '*' or '#?  }
774     P_SINGLE      =  $81;    { Token for '?' }
775     P_ORSTART     =  $82;    { Token for '(' }
776     P_ORNEXT      =  $83;    { Token for '|' }
777     P_OREND       =  $84;    { Token for ')' }
778     P_NOT         =  $85;    { Token for '~' }
779     P_NOTEND      =  $86;    { Token for }
780     P_NOTCLASS    =  $87;    { Token for '^' }
781     P_CLASS       =  $88;    { Token for '[]' }
782     P_REPBEG      =  $89;    { Token for '[' }
783     P_REPEND      =  $8A;    { Token for ']' }
784     P_STOP        =  $8B;    { token to force end of evaluation }
785 
786 { Values for an_Status, NOTE: These are the actual bit numbers }
787 
788     COMPLEX_BIT   =  1;       { Parsing complex pattern }
789     EXAMINE_BIT   =  2;       { Searching directory }
790 
791 {   hunk types }
792      HUNK_UNIT      = 999 ;
793      HUNK_NAME      = 1000;
794      HUNK_CODE      = 1001;
795      HUNK_DATA      = 1002;
796      HUNK_BSS       = 1003;
797      HUNK_RELOC32   = 1004;
798      HUNK_RELOC16   = 1005;
799      HUNK_RELOC8    = 1006;
800      HUNK_EXT       = 1007;
801      HUNK_SYMBOL    = 1008;
802      HUNK_DEBUG     = 1009;
803      HUNK_END       = 1010;
804      HUNK_HEADER    = 1011;
805 
806      HUNK_OVERLAY   = 1013;
807      HUNK_BREAK     = 1014;
808 
809      HUNK_DREL32    = 1015;
810      HUNK_DREL16    = 1016;
811      HUNK_DREL8     = 1017;
812 
813      HUNK_LIB       = 1018;
814      HUNK_INDEX     = 1019;
815 
816 {   hunk_ext sub-types }
817      EXT_SYMB       = 0  ;     {   symbol table }
818      EXT_DEF        = 1  ;     {   relocatable definition }
819      EXT_ABS        = 2  ;     {   Absolute definition }
820      EXT_RES        = 3  ;     {   no longer supported }
821      EXT_REF32      = 129;     {   32 bit reference to symbol }
822      EXT_COMMON     = 130;     {   32 bit reference to COMMON block }
823      EXT_REF16      = 131;     {   16 bit reference to symbol }
824      EXT_REF8       = 132;     {    8 bit reference to symbol }
825      EXT_DEXT32     = 133;     {   32 bit data releative reference }
826      EXT_DEXT16     = 134;     {   16 bit data releative reference }
827      EXT_DEXT8      = 135;     {    8 bit data releative reference }
828 
829 
830 type
831 // All DOS processes have this structure
832   PProcess = ^TProcess;
833   TProcess = record
834     // original definitions from version 1.0 and earlier betas (v30 - 1984)
835     pr_Task: TTask;         // The exec task structure for this process
836     pr_MsgPort: TMsgPort;   // This process' message port structure
837     pr_Size: Word;          // Size of struct from V51.08+, previously 0
838     pr_SegArray: BPTR;      // -- PRIVATE - BPTR to internal process segarray[].
839     pr_StackSize: LongWord; // The running process stack size, in bytes
840     pr_gv: LongInt;         // -- OBSOLETE BCPL value - do not access this.
841     pr_CliNum: LongInt;     // CLI number, for DOS allocated cli processes.
842     pr_sb: BPTR;            // -- OBSOLETE BCPL value - do not access this.
843     pr_Result2: LongInt;    // Secondary result from last call, for IoErr()
844     pr_CurrentDir: BPTR;    // Lock associated with current directory
845     pr_CIS: BPTR;           // Current CLI Input Stream
846     pr_COS: BPTR;           // Current CLI Output Stream
847     pr_ConsoleTask: PMsgPort;     // Console handler process for current window
848     pr_FileSystemTask : PMsgPort; // File handler process for current drive
849     pr_CLI: BPTR;           // BCPL Pointer to struct CommandLineInterface
850     pr_ra: APTR;            // -- OBSOLETE - do not access this.
851     pr_PktWait: APTR;       // Function to be called when awaiting packet
852     pr_WindowPtr: APTR;     // Window for posting error requesters
853 
854     // following definitions are new with 2.0 (v36 - 1990)
855     pr_ProgramDir: BPTR;       // Program's home directory lock
856     pr_Flags: LongWord;        // Flags telling dos about this process
857     pr_ExitCode: APTR;         // Code to call on exit of process or nil
858     pr_ExitData: LongInt;      // Passed as an argument to pr_ExitCode.
859     pr_Arguments: STRPTR;      // Arguments passed to the process at start
860     pr_LocalVars: TMinList;    // Local environment variables
861     pr_ShellPrivate: LongWord; // -- PRIVATE - Internal shell use only.
862     pr_CES: BPTR;              // Error stream - if nil, use pr_COS
863 
864     // following definitions are new from 4.0 (v50 - Apr,2004)
865     pr_PrData: APTR;          // -- PRIVATE - internal dos access ONLY.
866     pr_CurrentSeg: BPTR;      // Seglist of current running code.(READ ONLY)
867     pr_EmulPrivate: LongWord; // -- PRIVATE - Flags for 68k JIT Emulator.
868     pr_68kPrivate: LongWord;  // -- PRIVATE - 68K control opts, OS access only
869     pr_ParentID: LongWord;    // ID# of parent process, 0 if a task. (READ ONLY)
870     pr_ProcessID: LongWord;   // ID# for this process. (READ ONLY)
871     pr_Reserved4: LongWord;   // -- reserved for dos expansion - leave alone
872     pr_OGLContextData: APTR;  // -- PRIVATE - ogl access only.
873     pr_Reserved5: APTR;       // -- reserved for dos expansion - leave alone.
874     pr_CLibData: APTR;        // -- PRIVATE - clib/newlib use, copied by CNP()
875     pr_Reserved6: APTR;       // -- reserved for dos expansion - leave alone
876 
877     // following definitions are new from (v51 - Jan,2006)
878     pr_RestoreList: TMinList;  // -- PRIVATE - used by DOS for process cleanup()
879     pr_DeathSigTask: APTR;     // Process/task to signal when the process ends
880     pr_DeathSigBit: LongWord;  // Signal bit number for pr_DeathSigTask
881     pr_DeathMessage: APTR;     // DeathMessage to ReplyMsg() to when process ends
882     pr_EntryCode: APTR;        // Code to call on startup of process, or nil
883     pr_EntryData: LongInt;     // Passed as an argument to pr_EntryCode func.
884     pr_FinalCode: APTR;        // Code to call on exit of the process, or nil
885     pr_FinalData: LongInt;     // Passed as an argument to pr_FinalCode func.
886     pr_DLNotifyData: LongWord; // -- PRIVATE - dos NotifyDosListChange() data.
887     pr_PLNotifyData: LongWord; // -- PRIVATE - dos NotifyProcListChange() data.
888 
889     // following definitions are new from (v52 - Dec,2006)
890     pr_UID: LongWord;      // -- PRIVATE - dos Set/GetOwnerInfo() use only.
891     pr_GID: LongWord;      // -- PRIVATE - dos Set/GetOwnerInfo() use only.
892     pr_Reserved3: LongInt; // -- reserved for dos expansion - leave alone
893     pr_Reserved2: LongInt; // -- reserved for dos expansion - leave alone
894     pr_Reserved1: LongInt; // -- reserved for dos expansion - leave alone
895     pr_Reserved0: LongInt; // -- reserved for dos expansion - leave alone
896   end; // Process - 344 bytes
897 
898 const
899 // Flags for Process->pr_Flags for all DOS processes.
900   PRB_FREESEGLIST       = 0;  // NP_FreeSegList,TRUE sets this bit.
901   PRB_FREECURRDIR       = 1;  // NP_CurrentDir will be UnLocked if set
902   PRB_FREECLI           = 2;  // NP_Cli will be freed if this is set.
903   PRB_CLOSEINPUT        = 3;  // NP_CloseInput,TRUE sets this bit.
904   PRB_CLOSEOUTPUT       = 4;  // NP_CloseOutput,TRUE sets this bit.
905   PRB_FREEARGS_OBSOLETE = 5;  // (V50) obsolete, args copy now on task memlist.
906   PRB_CLOSEERROR        = 6;  // NP_CloseError,TRUE sets this bit. (V51)
907   PRB_LOCKSTACK         = 7;  // NP_LockStack,TRUE sets this bit. (V52.10)
908   PRB_spare08           = 8;
909   PRB_spare09           = 9;
910   PRB_spare10           = 10;
911   PRB_spare11           = 11;
912   PRB_spare12           = 12;
913   PRB_spare13           = 13;
914   PRB_spare14           = 14;
915   PRB_spare15           = 15;
916 
917   PRB_spare16           = 16;
918   PRB_spare17           = 17;
919   PRB_spare18           = 18;
920   PRB_spare19           = 19;
921   PRB_spare20           = 20;
922   PRB_spare21           = 21;
923   PRB_spare22           = 22;
924   PRB_spare23           = 23;
925   PRB_CHILDPROCESS      = 24; // (V50) NP_Child,TRUE sets this for a dependant child.
926   PRB_HADCHILDREN       = 25; // (V51) Gets set if this process had created any children.
927   PRB_HASDLNOTIFY       = 26; // (V51) Set when doslist change signal notify is enabled.
928   PRB_HASPLNOTIFY       = 27; // (V51) Set when process list change signal notify is on.
929   PRB_SERVERPROCESS     = 28; // (V53) Set when process is one of the internal dos servers
930   PRB_HANDLERPROCESS    = 29; // (V52) Set to indicate if this is a handler/filesystem process
931   PRB_SHELLPROCESS      = 30; // (V51) Set to indicate if this is a shell handler process
932   PRB_EXTENDED_FLAGS    = 31; // (V51) Reserved for internal dos flags expansion use only.
933 // Mask definitions for above bits
934   PRF_FREESEGLIST        = 1 shl PRB_FREESEGLIST;
935   PRF_FREECURRDIR        = 1 shl PRB_FREECURRDIR;
936   PRF_FREECLI            = 1 shl PRB_FREECLI;
937   PRF_CLOSEINPUT         = 1 shl PRB_CLOSEINPUT;
938   PRF_CLOSEOUTPUT        = 1 shl PRB_CLOSEOUTPUT;
939   PRF_FREEARGS_OBSOLETE  = 1 shl PRB_FREEARGS_OBSOLETE;
940   PRF_CLOSEERROR         = 1 shl PRB_CLOSEERROR;
941   PRF_LOCKSTACK          = 1 shl PRB_LOCKSTACK;
942 
943   PRF_CHILDPROCESS       = 1 shl PRB_CHILDPROCESS;
944   PRF_HADCHILDREN        = 1 shl PRB_HADCHILDREN;
945   PRF_HASDLNOTIFY        = 1 shl PRB_HASDLNOTIFY;
946   PRF_HASPLNOTIFY        = 1 shl PRB_HASPLNOTIFY;
947   PRF_SERVERPROCESS      = 1 shl PRB_SERVERPROCESS;
948   PRF_HANDLERPROCESS     = 1 shl PRB_HANDLERPROCESS;
949   PRF_SHELLPROCESS       = 1 shl PRB_SHELLPROCESS;
950   PRF_EXTENDED_FLAGS     = 1 shl PRB_EXTENDED_FLAGS;
951 
952 // The long word address (BPTR) of this structure is returned by
953 // Open() and other routines that return a filehandle.
954 Type
955   PFileHandle = ^TFileHandle;
956   TFileHandle = record
957     fh_StructSize: Word;     // Size of DOS structure allocation.
958     fh_Flags: Word;          // --Private DOS use only.
959     fh_Interactive: LongInt; // Boolean; True if interactive handle
960     fh_MsgPort: PMsgPort;    // MsgPort of the filesystem/handler.
961     fh_Buf: BPTR;            // --Private Bufferered stream members.
962     fh_Pos: LongInt;
963     fh_End: LongInt;
pointersnull964     fh_Func1: APTR;          // --Private function pointers to the
965     fh_Func2: APTR;          //   DOS i/o routines.
966     fh_Func3: APTR;
967     fh_Arg1: BPTR;           // --Private, packet handler use.
968     fh_Arg2: APTR;           // --Private, FSVP handler use.
969     fh_OpenerPID: LongWord;  // The process ID of the opener. V52.16
970     fh_Reserved2: LongInt;   // public expansion, leave alone.
971     fh_Reserved1: LongInt;   // public expansion, leave alone.
972     fh_Priv: array[0..17] of LongInt; // --Private, start of the remainder of many more private DOS members.
973   end; // FileHandle - 128 bytes
974 
975 // This is the standard extension to EXEC Messages used by DOS
976   PDosPacket = ^TDosPacket;
977   TDosPacket = record
978     dp_Link: PMessage;  // EXEC message
979     dp_Port: PMsgPort;  // Reply port for the packet Must be filled in each send.
980     case smallint of
981      0:(
982       dp_Action : LongInt;
983       dp_Status : LongInt;
984       dp_Status2 : LongInt;
985       dp_BufAddr : LongInt;
986      );
987      1:(
988       dp_Type : LongInt;      // See ACTION_... below
989       dp_Res1 : LongInt;      // For file system calls this is the result that would have been returned by the
e.g.null990                               // function, e.g. Write() returns actual length written
991       dp_Res2 : LongInt;      // For file system calls this is what would have been returned by IoErr()
992       dp_Arg1 : LongInt;
993       dp_Arg2 : LongInt;
994       dp_Arg3 : LongInt;
995       dp_Arg4 : LongInt;
996       dp_Arg5 : LongInt;
997       dp_Arg6 : LongInt;
998       dp_Arg7 : LongInt;
999      );
1000   end; // DosPacket - 48 bytes
1001 
1002 // A Packet does not require the Message to be before it in memory, but for convenience it is useful to associate the two.
1003   PStandardPacket = ^TStandardPacket;
1004   TStandardPacket = record
1005     sp_Msg: TMessage;
1006     sp_Pkt: TDosPacket;
1007   end;
1008 
1009 {$PACKRECORDS 4}
1010 // This is the extended 64 bit style EXEC Messages used by DOS. Only dp_Type packets between 8000-8999 range use this structure.
1011   PDosPacket64 = ^TDosPacket64;
1012   TDosPacket64 = record
1013     dp_Link: PMessage;  // EXEC message
1014     dp_Port: PMsgPort;  // Reply port for the packet Must be filled in each send.
1015     case smallint of
1016      0:(
1017       dp_Action: LongInt;
1018       dp_pad: LongInt;
1019       dp_Status2: LongInt;
1020       dp_Status: Int64;
1021       dp_BufAddr: LongInt;
1022      );
1023      1:(
1024       dp_Type: LongInt; // See ACTION_... below
1025       dp_Res0: LongInt; // Special compatibility field. [See below]
1026       dp_Res2: LongInt; // This is returned for IoErr()
1027       dp_Res1: Int64;   // This is the 64 bit primary result
1028       dp_Arg1: LongInt; // 32 bit argument
1029       dp_Arg2: Int64;   // 64 bit argument
1030       dp_Arg3: LongInt; // 32 bit argument
1031       dp_Arg4: LongInt; // 32 bit argument
1032       dp_Arg5: Int64;   // 64 bit argument
1033      );
1034   end; // DosPacket64 - 64 bytes
1035   PStandardPacket64 = ^TStandardPacket64;
1036   TStandardPacket64 = record
1037     sp_Msg: TMessage;
1038     sp_Pkt: TDosPacket64;
1039   end;
1040 
1041 {$PACKRECORDS 2}
1042 const
1043 // The DosPacket64 dp_Res0 member initialisation value.
1044   DP64_INIT       = -3;
1045 // Packet types
1046   ACTION_NIL                  = 0;
1047   ACTION_STARTUP              = 0;
1048   ACTION_EVENT                = 6; // INTERNAL for CDFS and CrossDos commodity
1049   ACTION_CURRENT_VOLUME       = 7; // DEPRECATED from DOS 53.100+
1050   ACTION_LOCATE_OBJECT        = 8;
1051   ACTION_RENAME_DISK          = 9;
1052   ACTION_FREE_LOCK            = 15;
1053   ACTION_DELETE_OBJECT        = 16;
1054   ACTION_RENAME_OBJECT        = 17;
1055   ACTION_MORE_CACHE           = 18;
1056   ACTION_COPY_DIR             = 19;
1057   ACTION_WAIT_CHAR            = 20;
1058   ACTION_SET_PROTECT          = 21;
1059   ACTION_CREATE_DIR           = 22;
1060   ACTION_EXAMINE_OBJECT       = 23; // DEPRECATED
1061   ACTION_EXAMINE_NEXT         = 24; // DEPRECATED
1062   ACTION_DISK_INFO            = 25;
1063   ACTION_INFO                 = 26;
1064   ACTION_FLUSH                = 27;
1065   ACTION_SET_COMMENT          = 28;
1066   ACTION_PARENT               = 29;
1067   ACTION_TIMER                = 30; // INTERNAL
1068   ACTION_INHIBIT              = 31;
1069   ACTION_SET_DATE             = 34;
1070   ACTION_SAME_LOCK            = 40;
1071   ACTION_SAME_FH              = 53; // Added 53.71
1072 
1073   ACTION_READ                 = 82; // 'R'
1074   ACTION_WRITE                = 87; // 'W'
1075 
1076   ACTION_SINGLE_CHARACTER_MODE = 994;
1077   ACTION_CHANGE_SIGNAL         = 995;
1078 // Internal packets used by con-handler
1079   ACTION_READ_RETURN          = 1001; // INTERNAL
1080   ACTION_WRITE_RETURN         = 1002; // INTERNAL
1081   ACTION_INT_WRITE_RETURN     = 1003; // INTERNAL
1082   ACTION_FINDUPDATE           = 1004; // aka MODE_READWRITE
1083   ACTION_FINDINPUT            = 1005; // aka MODE_OLDFILE
1084   ACTION_FINDOUTPUT           = 1006; // aka MODE_NEWFILE
1085   ACTION_END                  = 1007;
1086   ACTION_SEEK                 = 1008; // DEPRECATED
1087   ACTION_ICONIFY              = 1009; // INTERNAL
1088 
1089   ACTION_FORMAT         = 1020;
1090   ACTION_MAKE_LINK      = 1021;
1091   ACTION_WRITE_PROTECT  = 1023;
1092   ACTION_READ_SOFT_LINK = 1024;
1093   ACTION_FH_FROM_LOCK   = 1026;
1094   ACTION_IS_FILESYSTEM  = 1027;
1095   ACTION_CHANGE_MODE    = 1028;
1096   ACTION_COPY_LOCK_FH   = 1030;
1097   ACTION_PARENT_FH      = 1031;
1098 
1099 // Added V52.18 - SetOwnerInfo() - replaces old SetOwner() packet 1036.
1100   ACTION_SET_OWNER_INFO = 1037;
1101 // Internal packets used by datatypes.library
1102   ACTION_NEWMEMFILE     = 1039; // INTERNAL
1103   ACTION_NEWMEMLOCK     = 1040; // INTERNAL
1104 // New packet types for V50
1105   ACTION_WAIT_FOR_DATA     = 1998;
1106   ACTION_SET_BLOCKING_MODE = 1999;
1107 
1108 // PACKETS 2050-2999 are reserved for use by third party applications.
1109 
1110   ACTION_SHUTDOWN = 3000; // Similar functionality to ACTION_DIE
1111   ACTION_COLLECT  = 3001; // controls the relinquishing of active filesystem objects
1112 // The following are the ACTION_COLLECT object identifiers (in dp_Arg1) to identify the object that is placed in dp_Arg2.
1113   ID_COLLECT_LOCK         = 1;
1114   ID_COLLECT_FILEHANDLE   = 2;
1115   ID_COLLECT_NOTIFICATION = 3;
1116 
1117   ACTION_FILESYSTEM_ATTR = 3005; // Obtain or Set filesystem specific attributes; FileSystemAttr()  51.46
1118   ACTION_OBTAIN_CON_INFO = 3006; // Release console information, as obtained through ACTION_OBTAIN_CON_INFO; you must pass the same parameters as with ACTION_OBTAIN_CON_INFO.
1119 // Packets for ExamineObject() and ExamineDir() functions. 51.104
1120   ACTION_EXAMINEDATA     = 3030;
1121   ACTION_EXAMINEDATA_FH  = 3031; // added @ 52.30
1122   ACTION_EXAMINEDATA_DIR = 3040;
1123 // DOS will emulate notifications from 52.33+ if you do not support these
1124   ACTION_ADD_NOTIFY     = 4097; // optional
1125   ACTION_REMOVE_NOTIFY  = 4098; // optional
1126   ACTION_SERIALIZE_DISK = 4200; // Tell a file system to serialize the current volume.
1127   ACTION_GET_DISK_FSSM  = 4201; // DEPRECATED, Obtain a disk's geometry
1128   ACTION_FREE_DISK_FSSM = 4202; // DEPRECATED, Obtain a disk's geometry
1129 
1130 // New Packet to control dos.library long path handling code. (@ v53.23)
1131   ACTION_INHIBIT_DOS_LONGPATH_HANDLING = 5323;
1132 
1133 // 64 Bit ACTION types, ONLY the 8000 series use struct DosPacket64.  51.62
1134   ACTION_CHANGE_FILE_POSITION64 = 8001;
1135   ACTION_GET_FILE_POSITION64    = 8002;
1136   ACTION_CHANGE_FILE_SIZE64     = 8003;
1137   ACTION_GET_FILE_SIZE64        = 8004;
1138   ACTION_LOCK_RECORD64          = 8010; // added 53.86
1139   ACTION_FREE_RECORD64          = 8011; // added 53.86
1140 
1141 // 64 bit PACKETS 8500-8999 are reserved for use by third party applications.
1142 
1143 // The following were used to convert UID and GID to names and visa-versa
1144   ACTION_USERNAME_TO_UID  = 20000;
1145   ACTION_GROUPNAME_TO_GID = 20001;
1146   ACTION_UID_TO_USERINFO  = 20002;
1147   ACTION_GID_TO_GROUPINFO = 20003;
1148 
1149 type
1150 // Data structure used by ACTION_OBTAIN_CON_INFO/ACTION_RELEASE_CON_INFO
1151   PConsoleWindowData = ^TConsoleWindowData;
1152   TConsoleWindowData = record
1153     Reserved: array[0..3] of LongWord; // For use by the console handler
1154     ConsoleWindow: APTR;   // real type: PWindow - Pointer to console window; this may be nil for console handlers
1155                            // which are not bound to a window, or if that window is currently closed.
1156     ConsoleIO: PIORequest; // Pointer to console.device I/O request; this may be nil for console handlers which are not
1157                            // bound to a window, or if that window is currently closed.
1158     ConsoleType: LongWord; // Identifies the type of console, e.g. ID_RAWCON or ID_CON
1159     DOSPrivate: array[0..1] of APTR; // Private fields for use by DOS only
1160   end;
1161 
1162 // The following are used by the new V50 Address Tracking functions
1163   PAddressAndSize = ^TAddressAndSize;
1164   TAddressAndSize = record
1165     aas_Address: LongWord;
1166     aas_Size: LongWord;
1167   end;
1168 
1169   PFindTrackedAddressMsg = ^TFindTrackedAddressMsg;
1170   TFindTrackedAddressMsg = record
1171     ftam_Size: LongInt;
1172     ftam_Name: STRPTR;
1173     ftam_Date: TDateStamp;
1174     ftam_SegList: BPTR;
1175     ftam_SegmentNumber: LongWord;
1176     ftam_SegmentOffset: LongWord;
1177     ftam_ExtraInfo: APTR;
1178     ftam_ExtraInfoSize: LongInt;
1179     // -- 40 bytes @ V50
1180     ftam_AAS: TAddressAndSize;
1181     // -- 48 bytes @ 53.118
1182   end;
1183 
1184 // The following is used by the new V50 pattern functions
1185   PCapturedExpression = ^TCapturedExpression;
1186   TCapturedExpression = record
1187     cape_Next: PCapturedExpression;
1188     cape_Match: STRPTR;
1189     cape_Start: STRPTR;
1190     cape_End: STRPTR;
1191     cape_Pool: APTR;   // private
1192   end;
1193 
1194 // The public structure for PseudoSegLists which are used by RunCommand(), LoadSeg(), Create[new]Proc(), AllocSegList(), etc..
1195   PPseudoSegList = ^TPseudoSegList;
1196   TPseudoSegList = record
1197     ps_Next: BPTR;                // Pointer to next segment. Or 0.
1198     ps_Jump: LongWord;            // Internal compatibility magic.
entrynull1199     ps_Entry: APTR;               // The function entry pointer.
1200     ps_Ikey: LongWord;            // Identification key.
1201     ps_DosPrivate: LongWord;      // DOS Private use only.
1202     ps_Reserved1: LongWord;       // Block alignment - reserved.
1203     ps_Reserved2: LongWord;       // Block alignment - reserved.
1204     ps_Data: array[0..3] of Byte; // First 4 bytes of data area.
1205   end;
1206 
1207 // This value is always initialised in the ps_Jump member. (PPC & 68K)
1208 const
1209   PSJUMP_MAGIC   = $4e714ef9; // NOP,JMP - 68k compatibility
1210 // These are the currently used values for use in the ps_Ikey member.
1211   PSIKEY_INIT    = 0; // Set this value for normal native, data or 68k types.  UnLoadSeg() will perform the normal memory freeing on these.
1212   PSIKEY_NOFREE  = $80000000; // Set this value if your seglist must not be UnLoadSeg()'ed. Not for internal components, see PSIKEY_NFSYS below.
1213   PSIKEY_ELF32   = $7F454C46; //7F 'E' 'L' 'F' This is set EXCLUSIVELY by LoadSeg() for ELF32 executables.
1214   PSIKEY_NFSYS   = $FFFFFFFF;
1215 
1216 type
1217 // A structure ONLY for the Dos resident list.  Do NOT allocate these, use AddSegment() and heed the warnings in the autodocs!
1218   PDosResidentSeg = ^TDosResidentSeg;
1219   TDosResidentSeg = record
1220     seg_Next: BPTR;   // BCPL pointer to next DosResidentSeg, or zero
1221     seg_UC: LongInt;  // Use Count
1222     seg_Seg: BPTR;    // BCPL pointer to seglist of command.
1223     seg_Name: array[0..3] of Char; // First 4 chars of BCPL style formatted name
1224   end;
1225 const
1226   CMD_SYSTEM   = -1;
1227   CMD_INTERNAL = -2;
1228   CMD_DISABLED = -999;
1229 
1230 
1231 
1232 {
1233  * A structure for holding error messages - stored as array with error == 0
1234  * for the last entry.
1235  }
1236 Type
1237        pErrorString = ^tErrorString;
1238        tErrorString = record
1239         estr_Nums     : Pointer;
1240         estr_Strings  : Pointer;
1241        END;
1242 
1243 
1244 { DOS library node structure.
1245  * This is the data at positive offsets from the library node.
1246  * Negative offsets from the node is the jump table to DOS functions
1247  * node = (struct DosLibrary *) OpenLibrary( "dos.library" .. )      }
1248 
1249 Type
1250 
1251     pDosLibrary = ^tDosLibrary;
1252     tDosLibrary = record
1253         dl_lib          : tLibrary;
1254         dl_Root         : Pointer;      { Pointer to RootNode, described below }
1255         dl_GV           : Pointer;      { Pointer to BCPL global vector       }
1256         dl_A2           : LongInt;      { Private register dump of DOS        }
1257         dl_A5           : LongInt;
1258         dl_A6           : LongInt;
1259         dl_Errors       : pErrorString; { pointer to array of error msgs }
1260         dl_TimeReq      : pTimeRequest; { private pointer to timer request }
1261         dl_UtilityBase  : pLibrary;     { private ptr to utility library }
1262         dl_IntuitionBase : pLibrary;
1263     end;
1264 
1265     pRootNode = ^tRootNode;
1266     tRootNode = record
1267         rn_TaskArray    : BPTR;         { [0] is max number of CLI's
1268                                           [1] is APTR to process id of CLI 1
1269                                           [n] is APTR to process id of CLI n }
1270         rn_ConsoleSegment : BPTR;       { SegList for the CLI }
1271         rn_Time          : tDateStamp;  { Current time }
1272         rn_RestartSeg   : LongInt;      { SegList for the disk validator process }
1273         rn_Info         : BPTR;         { Pointer ot the Info structure }
1274         rn_FileHandlerSegment : BPTR;   { segment for a file handler }
1275         rn_CliList      : tMinList;     { new list of all CLI processes }
1276                                         { the first cpl_Array is also rn_TaskArray }
1277         rn_BootProc     : PMsgPort;     { private ptr to msgport of boot fs      }
1278         rn_ShellSegment : BPTR;         { seglist for Shell (for NewShell)         }
1279         rn_Flags        : LongInt;      { dos flags }
1280     end;
1281 
1282 CONST
1283  RNB_WILDSTAR   = 24;
1284  RNF_WILDSTAR   = 16777216;
1285  RNB_PRIVATE1   = 1;       { private for dos }
1286  RNF_PRIVATE1   = 2;
1287 
1288 Type
1289     pDosInfo = ^tDosInfo;
1290     tDosInfo = record
1291         case smallint of
1292         0 : (
1293         di_ResList : BPTR;
1294         );
1295         1 : (
1296         di_McName       : BPTR;          { Network name of this machine; currently 0 }
1297         di_DevInfo      : BPTR;          { Device List }
1298         di_Devices      : BPTR;          { Currently zero }
1299         di_Handlers     : BPTR;          { Currently zero }
1300         di_NetHand      : Pointer;       { Network handler processid; currently zero }
1301         di_DevLock,                      { do NOT access directly! }
1302         di_EntryLock,                    { do NOT access directly! }
1303         di_DeleteLock   : tSignalSemaphore; { do NOT access directly! }
1304         );
1305     end;
1306 
1307 { ONLY to be allocated by DOS! }
1308 
1309        pCliProcList = ^tCliProcList;
1310        tCliProcList = record
1311         cpl_Node   : tMinNode;
1312         cpl_First  : LongInt;      { number of first entry in array }
1313         cpl_Array  : Array[0..0] of PMsgPort;
1314                              { [0] is max number of CLI's in this entry (n)
1315                               * [1] is CPTR to process id of CLI cpl_First
1316                               * [n] is CPTR to process id of CLI cpl_First+n-1
1317                               }
1318        END;
1319 
1320 // DOS Processes started from the CLI via RUN or NEWCLI have this additional set of data associated with them
1321 Type
1322   PCommandLineInterface = ^TCommandLineInterface;
1323   TCommandLineInterface = record
1324     cli_Result2: LongInt;       // Value of IoErr from last command
1325     cli_CurrentDirName: BSTR;   // Name of current directory
1326     cli_PathList: BPTR;         // Lock associated with command directory
1327     cli_ReturnCode: LongInt;    // Return code from last command
1328     cli_CommandName: BSTR;      // Name of current command
1329     cli_FailLevel: LongInt;     // Fail level (set by FAILAT)
1330     cli_Prompt: BSTR;           // Current prompt (set by PROMPT)
1331     cli_StandardInput: BPTR;    // Default (terminal) CLI input stream
1332     cli_CurrentInput: BPTR;     // Current CLI input stream
1333     cli_CommandFile: BSTR;      // BSTR name of EXECUTE command file
1334     cli_Interactive: LongInt;   // Boolean; Truth if prompts required
1335     cli_Background: LongInt;    // Boolean; Truth if CLI created by 'RUN'
1336     cli_CurrentOutput: BPTR;    // Current CLI output
1337     cli_DefaultStack: LongWord; // Stack size to be obtained in long words
1338     cli_StandardOutput: BPTR;   // Default (terminal) CLI output
1339     cli_Module: BPTR;           // SegList of currently loaded command
1340   end;
1341 
1342   // VOLUME structure; vn_Type==DLT_VOLUME
1343   PVolumeNode = ^TVolumeNode;
1344   TVolumeNode = record
1345     vn_Next: BPTR;             // BPTR to next entry in the chain
1346     vn_Type: LongInt;          // always DLT_VOLUME for dos "volumes"
1347     vn_Port: PMsgPort;         // msg port for the handler process
1348     vn_Reserved2: LongInt;     // reserved for use by DOS
1349     vn_VolumeDate: TDateStamp; // creation date
1350     vn_LockList: BPTR;         // unused, leave as 0
1351     vn_DOSType: LongInt;       // ie; 'DOS\7' - 32 bit hex dostype = vn_DiskType
1352     vn_FSPrivate: LongInt;     // private filesystem use
1353     vn_Name: BSTR;             // bstr name
1354     vn_StructSize: LongInt;    // FULL size of this structure
1355     vn_Reserved: array[0..3] of LongInt; // DOS expansion
1356   end;
1357 
1358 // DEVICE structure; dn_Type==DLT_DEVICE
1359   PDeviceNode = ^TDeviceNode;
1360   TDeviceNode = record
1361     dn_Next: BPTR;          // BPTR to next entry in the chain
1362     dn_Type: LongInt;       // always DLT_DEVICE for dos "devices"
1363     dn_Port: PMsgPort;      // msg port to the handler process.
1364     dn_Reserved1: LongInt;  // reserved for use by DOS
1365     dn_Handler: BSTR;       // BSTR name to loadseg if seglist==0
1366     dn_StackSize: LongInt;  // stacksize for the handler process
1367     dn_Priority: LongInt;   // task priority when starting task
1368     dn_Startup: BPTR;       // startup msg / FileSysStartupMsg
1369     dn_SegList: BPTR;       // code to run handler process. if nil then dn_Handler will be loaded
1370     dn_GlobalVec: LongInt;  // Global vector locking method key to use when starting the handler proc.
1371                             // A value of -1 is used for standard C startup locking method. Only values -1 & -2 are valid now.
1372     dn_Name: BSTR;          // BSTR device node name.
1373     dn_StructSize: LongInt; // FULL size of this structure.
1374     dn_Reserved: array[0..3] of LongInt; // DOS expansion space.
1375   end;
1376 
1377   PMultiAssign = ^TMultiAssign; // For normal DLT_LOCK and DLT_NONBINDING(v54) multi-assigns
1378   TMultiAssign = record
1379     ma_Next: PMultiAssign;      // next MultiAssign in chain, or nil
1380     dat: record
1381       ma_lock: BPTR;   // for DLT_LOCK multi-assigns
1382       ma_name: STRPTR; // for DLT_NONBINDING multi-assigns (v54)
1383     end;
1384   end;
1385 
1386 
1387   // ASSIGN struct; DLT_LOCK, DLT_LATE, DLT_NONBINDING
1388   PAssignNode = ^TAssignNode;
1389   TAssignNode = record
1390     an_Next: BPTR;                      // BPTR to next entry in the chain
1391     an_Type: LongInt;                   // DLT_LOCK,DLT_LATE,DLT_NONBINDING
1392     an_Port: PMsgPort;                  // Ptr to handler process port for DLT_LOCK types.
1393     an_Lock: BPTR;                      // Primary lock for DLT_LOCK assignments
1394     an_AssignName: STRPTR;              // Primary name for non or late-binding assigns
1395     an_MultiAssignList: PMultiAssign;   // Chain of DLT_LOCK multi-assigns
1396     an_NBMultiAssignList: PMultiAssign; // Chain of DLT_NONBINDING multi-assigns
1397     an_Unused: array[0..2] of LongInt;  // not currently used, leave as 0
1398     an_Name: BSTR;                      // BSTR assignment node name
1399     an_StructSize: LongInt;             // FULL allocated size of this structure.
1400     an_Reserved: array[0..3] of LongInt;// DOS reserved expansion space.
1401   end;
1402 
1403        pAssignList = ^tAssignList;
1404        tAssignList = record
1405         al_Next : pAssignList;
1406         al_Lock : BPTR;
1407        END;
1408 
1409 // COMBINED structure for all types.
1410   PDOSList = ^TDOSList;
1411   TDOSList = record
1412       dol_Next: DWord;    { BPTR }
1413       dol_Type: LongInt;
1414       dol_Task: PMsgPort;
1415       dol_Lock: DWord;    { BPTR }
1416       case Byte of
1417       0: ( dol_handler : record
1418              dol_Handler  : DWord;    { BSTR }
1419              dol_StackSize: LongInt;
1420              dol_Priority : LongInt;
1421              dol_Startup  : DWord;
1422              dol_SegList  : DWord;    { BPTR }
1423              dol_GlobVec  : DWord;    { BPTR }
1424            end;
1425          );
1426       1: ( dol_volume : record
1427              dol_VolumeDate: TDateStamp;
1428              dol_LockList  : DWord;   { BPTR }
1429              dol_DiskType  : LongInt;
1430            end;
1431          );
1432       2: ( dol_assign : record
1433              dol_AssignName: PChar;
1434              dol_List      : PAssignList;
1435            end;
1436          );
1437       3: ( dol_Misc: array[0..23] of Byte;
1438            dol_Name: DWord;    { BPTR }
1439          );
1440     end;
1441 
1442 
1443 { This structure can take on different values depending on whether it is
1444  * a device, an assigned directory, or a volume.  Below is the structure
1445  * reflecting volumes only.  Following that is the structure representing
1446  * only devices.
1447  }
1448 
1449 { structure representing a volume }
1450 
1451     pDeviceList = ^tDeviceList;
1452     tDeviceList = record
1453         dl_Next         : BPTR;         { bptr to next device list }
1454         dl_Type         : LongInt;      { see DLT below }
1455         dl_Task         : PMsgPort;     { ptr to handler task }
1456         dl_Lock         : BPTR;         { not for volumes }
1457         dl_VolumeDate   : tDateStamp;   { creation date }
1458         dl_LockList     : BPTR;         { outstanding locks }
1459         dl_DiskType     : LongInt;      { 'DOS', etc }
1460         dl_unused       : LongInt;
1461         dl_Name         : BSTR;         { bptr to bcpl name }
1462     end;
1463 
1464 { device structure (same as the DeviceNode structure in filehandler.h) }
1465 
1466     pDevInfo = ^tDevInfo;
1467     tDevInfo = record
1468         dvi_Next        : BPTR;
1469         dvi_Type        : LongInt;
1470         dvi_Task        : Pointer;
1471         dvi_Lock        : BPTR;
1472         dvi_Handler     : BSTR;
1473         dvi_StackSize   : LongInt;
1474         dvi_Priority    : LongInt;
1475         dvi_Startup     : LongInt;
1476         dvi_SegList     : BPTR;
1477         dvi_GlobVec     : BSTR;
1478         dvi_Name        : BSTR;
1479     end;
1480 
1481 {    structure used for multi-directory assigns. AllocVec()ed. }
1482 
1483 
1484 
1485 
1486 
1487 
1488 const
1489 // definitions for dl_Type
1490   DLT_DEVICE     = 0;
1491   DLT_LOCK       = 1;  // normal assign
1492   DLT_VOLUME     = 2;
1493   DLT_LATE       = 3;  // late-binding assign
1494   DLT_NONBINDING = 4;  // non-binding assign
1495   DLT_PRIVATE    = -1; // for internal dos use only
1496 
1497 // Flags for Doslist functions
1498   LDB_READ    = 0;
1499   LDB_WRITE   = 1;
1500   LDB_DEVICES = 2;
1501   LDB_VOLUMES = 3;
1502   LDB_ASSIGNS = 4;
1503   LDB_ENTRY   = 5;
1504   LDB_DELETE  = 6;
1505 
1506 // You MUST specify one of LDF_READ or LDF_WRITE
1507   LDF_READ  = 1 shl LDB_READ;
1508   LDF_WRITE = 1 shl LDB_WRITE;
1509 
1510 // Flags to be passed to LockDosList(), etc
1511   LDF_DEVICES = 1 shl LDB_DEVICES;
1512   LDF_VOLUMES = 1 shl LDB_VOLUMES;
1513   LDF_ASSIGNS = 1 shl LDB_ASSIGNS;
1514   LDF_ENTRY   = 1 shl LDB_ENTRY;   // internal
1515   LDF_DELETE  = 1 shl LDB_DELETE;  // internal
1516 
1517 // Actually all but the internal locking flags
1518   LDF_ALL = LDF_DEVICES or LDF_VOLUMES or LDF_ASSIGNS;
1519 
1520 // Mode types for NonBlockingModifyDosEntry()   (v51.30)
1521 
1522   NBM_ADDDOSENTRY     = 1 shl 0;
1523   NBM_REMDOSENTRY     = 1 shl 1;
1524   NBM_RENAMEDOSENTRY  = 1 shl 2;
1525   NBM_CHANGESIGNAL    = 1 shl 3;
1526   NBM_REMFREEDOSENTRY = 1 shl 4; // added 53.67
1527   NBM_DISKINSERTED    = 1 shl 5; // added 53.73
1528   NBM_DISKREMOVED     = 1 shl 6; // added 53.73
1529 
1530 // A filesystem lock structure, as returned by Lock(), DupLock(), etc.. private
1531 type
1532   PLock = ^TLock;
1533   TLock = record
1534     fl_Link: BPTR;      // PRIVATE - filesystem use only.
1535     fl_Key: LongInt;    // PRIVATE - filesystem use only.
1536     fl_Access: LongInt; // PRIVATE - filesystem use only.
1537     fl_Port: PMsgPort;  // Handler process message port
1538     fl_Volume: BPTR;    // BPTR to DLT_VOLUME DosList entry
1539       // -- V51 additions --
1540     fl_FSPrivate1: APTR;     // PRIVATE - filesystem use only.    */
1541     fl_FSPrivate2: APTR;     // PRIVATE - filesystem use only.    */
1542     fl_DOSType: LongWord;    // The DOSType of the filesystem, initialised by AllocDosObject(). */
1543     fl_StructSize: LongWord; // Full DOS allocated struct size, initialised by AllocDosObject(). */
1544       // -- V53 additions --
1545     fl_DosPrivate: LongInt;              // PRIVATE - dos library use only.
1546     fl_Reserved: array[0..1] of LongInt; // RESERVED for expansion. V53
1547   end;// Filesystem private data usually extends past the end of this definition.
1548 
1549 type
1550 // The Public structure return by GetDeviceProc(), GetDeviceProcFlags()
1551   PDevProc = ^TDevProc;
1552   TDevProc = record
1553     dvp_Port: PMsgPort;  // Handler message port
1554     dvp_Lock: BPTR;      // Reference lock (or nil)
1555     dvp_Flags: LongWord; // Flags fields.
1556   end; // DOS private data extends past the end of this definition.
1557 
1558 const
1559 // Definitions for TDevProc.dvp_Flags;
1560   DVPB_UNLOCK      = 0; // For DOS internal use.
1561   DVPB_MULTIASSIGN = 1; // The Lock refers to part of a multi-assignment
1562 // The following flags were added at V53.56 to provide additional functionality for LockTags() and other internal subsystems.
1563   DVPB_DEVICE      = 16; // The supplied path is a device relative specification.
1564   DVPB_VOLUME      = 17; // The supplied path is a volume relative specification.
1565   DVPB_ASSIGNMENT  = 18; // The supplied path is an assignment relative specification.
1566   DVPB_PROGDIR     = 19; // The supplied path is a PROGDIR: relative specification.
1567   DVPB_CURRDIR     = 20; // The supplied path is a CURRDIR: relative specification.
1568   DVPB_ROOTDIR     = 21; // The supplied path is a root directory relative specification.
1569   DVPB_CONSOLE     = 23; // The supplied path is a CONSOLE: handler specification.
1570   DVPB_FILESYS     = 24; // The supplied path returned the root of the default filesystem.
1571 // Field definitions for above bits
1572   DVPF_UNLOCK      = 1 shl DVPB_UNLOCK;
1573   DVPF_MULTIASSIGN = 1 shl DVPB_MULTIASSIGN;
1574   DVPF_DEVICE      = 1 shl DVPB_DEVICE;
1575   DVPF_VOLUME      = 1 shl DVPB_VOLUME;
1576   DVPF_ASSIGNMENT  = 1 shl DVPB_ASSIGNMENT;
1577   DVPF_PROGDIR     = 1 shl DVPB_PROGDIR;
1578   DVPF_CURRDIR     = 1 shl DVPB_CURRDIR;
1579   DVPF_ROOTDIR     = 1 shl DVPB_ROOTDIR;
1580   DVPF_CONSOLE     = 1 shl DVPB_CONSOLE;
1581   DVPF_FILESYS     = 1 shl DVPB_FILESYS;
1582 
1583 // Error report types for ErrorReport()
1584   REPORT_STREAM = 0; // a stream
1585   REPORT_TASK   = 1; // a process - currently unused
1586   REPORT_LOCK   = 2; // a lock
1587   REPORT_VOLUME = 3; // a volume node
1588   REPORT_INSERT = 4; // "please insert volume..."
1589 
1590 // Special error codes for ErrorReport()
1591   ABORT_DISK_ERROR = 296; // Read/write error
1592   ABORT_BUSY       = 288; // "You MUST replace..."
1593 
1594 // Types for initial packets to shells from run/newcli/execute/system. For shell-writers only
1595   RUN_EXECUTE       = -1;
1596   RUN_SYSTEM        = -2;
1597   RUN_SYSTEM_ASYNCH = -3;
1598 
1599 {    Types for fib_DirEntryType.  NOTE that both USERDIR and ROOT are      }
1600 {    directories, and that directory/file checks should use <0 and >=0.    }
1601 {    This is not necessarily exhaustive!  Some handlers may use other      }
1602 {    values as needed, though <0 and >=0 should remain as supported as     }
1603 {    possible.                                                             }
1604      ST_ROOT       =  1 ;
1605      ST_USERDIR    =  2 ;
1606      ST_SOFTLINK   =  3 ;      {    looks like dir, but may point to a file! }
1607      ST_LINKDIR    =  4 ;      {    hard link to dir }
1608      ST_FILE       =  -3;      {    must be negative for FIB! }
1609      ST_LINKFILE   =  -4;      {    hard link to file }
1610      ST_PIPEFILE   =  -5;      {    for pipes that support ExamineFH   }
1611 
1612 Type
1613 
1614 { a lock structure, as returned by Lock() or DupLock() }
1615 
1616     pFileLock = ^tFileLock;
1617     tFileLock = record
1618         fl_Link         : BPTR;         { bcpl pointer to next lock }
1619         fl_Key          : LongInt;      { disk block number }
1620         fl_Access       : LongInt;      { exclusive or shared }
1621         fl_Task         : PMsgPort;     { handler task's port }
1622         fl_Volume       : BPTR;         { bptr to a DeviceList }
1623     end;
1624 
1625 
1626 {  NOTE: V37 dos.library, when doing ExAll() emulation, and V37 filesystems  }
1627 {  will return an error if passed ED_OWNER.  If you get ERROR_BAD_NUMBER,    }
1628 {  retry with ED_COMMENT to get everything but owner info.  All filesystems  }
1629 {  supporting ExAll() must support through ED_COMMENT, and must check Type   }
1630 {  and return ERROR_BAD_NUMBER if they don't support the type.               }
1631 
1632 {   values that can be passed for what data you want from ExAll() }
1633 {   each higher value includes those below it (numerically)       }
1634 {   you MUST chose one of these values }
1635 CONST
1636      ED_NAME        = 1;
1637      ED_TYPE        = 2;
1638      ED_SIZE        = 3;
1639      ED_PROTECTION  = 4;
1640      ED_DATE        = 5;
1641      ED_COMMENT     = 6;
1642      ED_OWNER       = 7;
1643 
andnull1644 // The ExAll() function and associated structures have been deprecated for V50.
1645 // Use ExamineDir()/ExamineObject() from V50 onwards.
1646 
1647 // Structure in which exall results are returned in.
1648 //  Note that only the fields asked for will exist!
1649 type
1650   PExAllData = ^TExAllData;
1651   TExAllData = record
1652     ed_Next: PExAllData;
1653     ed_Name: STRPTR;
1654     ed_Type: LongInt;
1655     ed_Size: LongWord;  // only good to 4gig
1656     ed_Prot: LongWord;
1657     ed_Days: LongWord;
1658     ed_Mins: LongWord;
1659     ed_Ticks: LongWord;
1660     ed_Comment: STRPTR; // strings will be after last used field
1661     ed_OwnerUID: Word;  // new for V39
1662     ed_OwnerGID: Word;
1663   end;
1664 
1665 { Control structure passed to ExAll.  Unused fields MUST be initialized to 0, expecially eac_LastKey.
1666   eac_MatchFunc is a hook (see utility.library documentation for usage)
1667   It should return true if the entry is to returned, false if it is to be ignored.
1668   This structure MUST be allocated by AllocDosObject()!}
1669   PExAllControl = ^TExAllControl;
1670   TExAllControl = record
1671     eac_Entries: LongWord;   // number of entries returned in buffer
1672     eac_LastKey: LongWord;   // Don't touch inbetween linked ExAll calls!
1673     eac_MatchString: STRPTR; // wildcard string for pattern match OR nil
1674     eac_MatchFunc: PHook;    // optional private wildcard function
1675   end;
1676 
1677 type
1678   pDosEnvec = ^tDosEnvec;
1679   tDosEnvec = record
1680     de_TableSize: LongWord;      // Size of Environment vector
1681     de_SizeBlock: LongWord;      // in longwords: standard value is 128
1682     de_SecOrg: LongWord;         // not used; must be 0
1683     de_Surfaces: LongWord;       // # of heads (surfaces). drive specific
1684     de_SectorPerBlock: LongWord; // not used; must be 1
1685     de_BlocksPerTrack: LongWord; // blocks per track. drive specific
1686     de_Reserved: LongWord;       // DOS reserved blocks at start of partition.
1687     de_PreAlloc: LongWord;       // DOS reserved blocks at end of partition
1688     de_Interleave: LongWord;     // usually 0
1689     de_LowCyl: LongWord;         // starting cylinder. typically 0
1690     de_HighCyl: LongWord;        // max cylinder. drive specific
1691     de_NumBuffers: LongWord;     // Initial # DOS of buffers.
1692     de_BufMemType: LongWord;     // type of mem to allocate for buffers
1693     de_MaxTransfer: LongWord;    // Max number of bytes to transfer at a time
1694     de_Mask: LongWord;           // Address Mask to block out certain memory
1695     de_BootPri: LongInt;         // Boot priority for autoboot
1696     de_DosType: LongWord;        // ASCII (HEX) string showing filesystem type; $444F5300 is old filesystem, $444F5301 is fast file system
1697     de_Baud: LongWord;           // Baud rate for serial handler
1698     de_Control: LongWord;        // Control smallint for handler/filesystem
1699     de_BootBlocks: LongWord;     // Number of blocks containing boot code
1700   end;
1701 
1702 const
1703 // The following are the offsets when DosEnvec was accessed as an array of longwords; DE_TABLESIZE is set to the number of fields in the array, minus 1,
1704 //  that is, NOT including the DE_TABLESIZE field itself. So if de_DosType was the last valid entry, de_TableSize = DE_DOSTYPE.
1705 
1706   DE_TABLESIZE        = 0; // minimum value is 11 (includes NumBuffers)
1707   DE_SIZEBLOCK        = 1; // in longwords: standard value is 128
1708   DE_SECORG           = 2; // not used; must be 0
1709   DE_NUMHEADS         = 3; // # of heads (surfaces). drive specific
1710   DE_SECSPERBLK       = 4; // not used; must be 1
1711   DE_BLKSPERTRACK     = 5; // sectors per track. drive specific
1712   DE_RESERVEDBLKS     = 6; // unavailable blocks at start. usually 2
1713   DE_PREFAC           = 7; // not used; must be 0
1714   DE_INTERLEAVE       = 8; // usually 0
1715   DE_LOWCYL           = 9; // starting cylinder. typically 0
1716   DE_UPPERCYL         = 10; // max cylinder.  drive specific
1717   DE_NUMBUFFERS       = 11; // starting # of buffers.  typically 5
1718   DE_MEMBUFTYPE       = 12; // type of mem to allocate for buffers.
1719   DE_BUFMEMTYPE       = 12; //    1 is public, 3 is chip, 5 is fast
1720   DE_MAXTRANSFER      = 13; // Max number bytes to transfer at a time
1721   DE_MASK             = 14; // Address Mask to block out certain memory
1722   DE_BOOTPRI          = 15; // Boot priority for autoboot
1723   DE_DOSTYPE          = 16; // ASCII (HEX) string showing filesystem type; $444F5300 is old filesystem, $444F5301 is fast file system
1724   DE_BAUD             = 17; // Baud rate for serial handler
1725   DE_CONTROL          = 18; // Control word for handler/filesystem
1726   DE_BOOTBLOCKS       = 19; // Number of blocks containing boot code
1727 
1728 // The file system startup message is linked into a device node's startup
1729 // field.  It contains a pointer to the above environment, plus the
1730 // information needed to do an exec OpenDevice().
1731 type
1732   PFileSysStartupMsg = ^TFileSysStartupMsg;
1733   TFileSysStartupMsg = record
1734     fssm_Unit: LongWord;  // exec unit number for this device
1735     fssm_Device: BSTR;    // null terminated bstring to the device name
1736     fssm_Environ: BPTR;   // ptr to environment table (see above)
1737     fssm_Flags: LongWord; // flags for OpenDevice()
1738   end;
1739 
1740 // The public portion of the structure used for the new V50 functions;
1741 // GetDiskFileSystemData() and FreeDiskFileSystemData().
1742 // Do not depend on the size of this structure to stay constant.
1743   PFileSystemData = ^TFileSystemData;
1744   TFileSystemData = record
1745     fsd_Size: LongWord;                  // the size of this structure
1746     fsd_FileSystemName: STRPTR;
1747     fsd_DeviceName: STRPTR;
1748     fsd_DeviceUnit: LongWord;
1749     fsd_DeviceFlags: LongWord;
1750     fsd_Environment: PDosEnvec;          // WARNING: See (Note 1) below
1751     fsd_DosPrivate: array[0..3] of APTR; // this really is dos private !
1752     fsd_Reserved: array[0..3] of APTR;
1753   end;
1754 const
1755   // The new V53 struct FileSystemVectorPort includes follow.
1756   FS_VECTORPORT_VERSION = 53;
1757 
1758 type
1759   PFileSystemVectors = ^TFileSystemVectors;
1760   TFileSystemVectors = record
1761     StructSize: LongWord; // Filesystem must initialise this to; sizeof(struct FileSystemVectors)
1762     Version: LongWord;    // Filesystem must initialise this to; FS_VECTORPORT_VERSION
1763     FSPrivate: APTR;      // Private field for exclusive use by the filesystem, this is generally used to point to the filesystems private global data structure to
1764                           // make it accessible from the vector-port functions. Optionally, the filesystem may just initialise this to zero and then after the AllocDosObject() call, place your required data in there.
1765     Reserved: array[0..2] of LongWord; // Filesystems initialise these to 0 - reserved expansion
1766     DOSPrivate: APTR;     // Filesystems initialise this  to 0 - private DOS usage
linksnull1767     // function links
1768     DOSEmulatePacket: Pointer;
1769     FSLock,
1770     FSUnLock,
1771     FSDupLock,
1772     FSCreateDir,
1773     FSParentDir,
1774     FSDupLockFromFH,
1775     FSOpenFromLock,
1776     FSParentOfFH,
1777     FSOpen,
1778     FSClose,
1779     FSDelete,
1780     FSRead,
1781     FSWrite,
1782     FSFlush,
1783     FSChangeFilePosition,
1784     FSChangeFileSize,
1785     FSGetFilePosition,
1786     FSGetFileSize,
1787     FSChangeLockMode,
1788     FSChangeFileMode,
1789     FSSetDate,
1790     FSSetProtection,
1791     FSSetComment,
1792     FSSetGroup,
1793     FSSetOwner,
1794     FSRename,
1795     FSCreateSoftLink,
1796     FSCreateHardLink,
1797     FSReadSoftLink,
1798     FSSameLock,
1799     FSSameFile,
1800     FSFileSystemAttr,
1801     FSVolumeInfoData,
1802     FSDeviceInfoData,
1803     FSReserved1,
1804     FSReserved2,
1805     FSExamineLock,
1806     FSExamineFile,
1807     FSExamineDir,
1808     FSInhibit,
1809     FSWriteProtect,
1810     FSFormat,
1811     FSSerialize,
1812     FSRelabel,
1813     FSReserved3,
1814     FSAddNotify,
1815     FSRemoveNotify,
1816     FSLockRecord,
1817     FSUnLockRecord: Pointer;
1818     //=== End of V53 vectors, - New V54 vectors to be added after this line ===
1819     End_Marker: LongInt; // This must always be at vector table end, set to -1
1820   end;
1821 
1822   PFileSystemVectorPort = ^TFileSystemVectorPort;
1823   TFileSystemVectorPort = record
1824     MP: TMsgPort;
1825     FSV: TFileSystemVectors;
1826   end;
1827 
1828   FSVP = TFileSystemVectorPort; // shortcut
1829 
1830 const
1831  // The type of device to mount
1832   MDT_FileSystem = 0; // A file system, which is associated with a block storage device
1833   MDT_Handler    = 1; // Any other kind which does not require a block storage device
1834 // Control tags which describe the device MountDevice() should mount
1835   MD_Dummy           = TAG_USER + 4000;
1836   MD_SectorSize      = MD_Dummy + 1;  // Sector size in bytes (ULONG); must be a multiple of 4
1837   MD_Surfaces        = MD_Dummy + 2;  // Number of surfaces the file system should use (ULONG)
1838   MD_SectorsPerBlock = MD_Dummy + 3;  // Number of sectors that make up a data block (ULONG)
1839   MD_SectorsPerTrack = MD_Dummy + 4;  // Number of sectors that make up a track (ULONG)
1840   MD_Reserved        = MD_Dummy + 5;  // Number of sectors at the beginning of the partition which should not be touched by the file system (ULONG)
1841   MD_PreAlloc        = MD_Dummy + 6;  // Number of sectors at the end of the partition which should not be touched by the file system (ULONG)
1842   MD_LowCyl          = MD_Dummy + 7;  // Lowest cylinder number used by the file system (ULONG)
1843   MD_HighCyl         = MD_Dummy + 8;  // Highest cylinder number used by the file system (ULONG)
1844   MD_NumBuffers      = MD_Dummy + 9;  // Number of data buffers the file system is to use (ULONG)
1845   MD_BufMemType      = MD_Dummy + 10; // The type of memory to use for data buffers (ULONG)
1846   MD_MaxTransfer     = MD_Dummy + 11; // Maximum number of bytes the device driver can transfer in a single step (ULONG)
1847   MD_Mask            = MD_Dummy + 12; // Bit mask which covers the address range which the device driver can access (ULONG)
1848   MD_DOSType         = MD_Dummy + 13;  // File system signature, e.g. ID_DOS_DISK (ULONG)
1849   MD_Baud            = MD_Dummy + 14;  // Transmission speed (bits/second) to be used by the handler (ULONG)
1850   MD_Control         = MD_Dummy + 15;  // Control information for the handler/file system (STRPTR).
1851   MD_Device          = MD_Dummy + 16;  // Name of the exec device driver this file system is to use (STRPTR).
1852   MD_Unit            = MD_Dummy + 17;  // Exec device driver unit number to be used by this file system (ULONG).
1853   MD_Flags           = MD_Dummy + 18;  // Flags to use when the file system opens the exec device driver (ULONG).
1854   MD_StackSize       = MD_Dummy + 19;  // Size of the stack to allocate for the file system (ULONG).
1855   MD_Priority        = MD_Dummy + 20;  // Priority to start the file system process with (LONG).
1856   MD_GlobVec         = MD_Dummy + 21;  // Global vector number (LONG).
1857   MD_StartupNumber   = MD_Dummy + 22;  // The number to store as the file system startup data (LONG).
1858   MD_StartupString   = MD_Dummy + 23;  // The string to store as the file system startup data (STRPTR).
1859   MD_IgnoreFSR       = MD_Dummy + 24;  // Whether the file system parameters should be initialized from the FileSystem.resource or not (BOOL).
1860   MD_Activate        = MD_Dummy + 25;  // Whether the file system should be activated immediately after it has been mounted (BOOL).
1861   MD_Handler         = MD_Dummy + 26;  // Name of the handler which implements the file system (STRPTR).
1862   MD_SegList         = MD_Dummy + 27;  // The segment list which refers to the code which implements the file system (BPTR).
1863   MD_Port            = MD_Dummy + 28;  // The port which implements the file system (struct MsgPort *).
1864   MD_Entry           = MD_Dummy + 29;  // The function which implements the file system (VOID (*)(VOID)).
1865 
1866 
1867 // Flags for DismountDevice()
1868   DMDF_KEEPDEVICE     =  1 shl 0;
1869   DMDF_REMOVEDEVICE   =  1 shl 1;
1870   DMDF_FORCE_DISMOUNT =  1 shl 2;
1871 
1872 const
1873 // --- NotifyMessage Class
1874   NOTIFY_CLASS  =  $40000000;
1875 // --- NotifyMessage Codes
1876   NOTIFY_CODE   =  $1234;
1877 
1878 
1879 // Sent to the application if SEND_MESSAGE is specified.
1880 
1881 type
1882   PNotifyRequest = ^tNotifyRequest;
1883   tNotifyRequest = record
1884     nr_Name : STRPTR;       // The name of object for notification
1885     nr_FullName: STRPTR;   // PRIVATE: set by dos - don't touch
1886     nr_UserData: LongWord; // For the applications use
1887     nr_Flags: LongWord;    // Notify method flags NRF_xxx
1888     nr_stuff: record
1889     case smallint of
1890     0: (nr_Msg: record
1891         nr_Port: PMsgPort;              // for SEND_MESSAGE
1892         nr_MsgPad: array[0..3] of Byte; // Reserved
1893      end);
1894     1: (nr_Signal : record
1895         nr_Task : PTask;                // for SEND_SIGNAL
1896         nr_SignalNum : Byte;            // for SEND_SIGNAL
1897         nr_SigPad: array[0..2] of Byte; // reserved
1898      end);
1899      0: (nr_CallHook: record
1900         nr_Hook: PHook;                  // for CALL_HOOK
1901         nr_HookPad: array[0..3] of Byte; // Reserved
1902      end);
1903     end;
1904     nr_Reserved : array[0..1] of LongWord; // Reserved - leave as 0 for now
1905     // internal use by dos and handlers
1906     nr_DosPrivate:LongWord;                // PRIVATE: DOS use only. -  V51.30
1907     nr_FSPrivate: APTR;                    // PRIVATE: FS/Handler use only. - V51.30
1908     nr_MsgCount: LongWord;                 // PRIVATE: # of outstanding msgs
1909     nr_Handler: PMsgPort;                  // PRIVATE: handler sent to (for EndNotify)
1910     nr_Expansion: array[0..3] of LongWord; // expansion space - added V51.30
1911   end;
1912 
1913   PNotifyMessage = ^TNotifyMessage;
1914   TNotifyMessage = record
1915     nm_ExecMessage: TMessage;
1916     nm_Class: LongWord;
1917     nm_Code: Word;
1918     nm_NReq: PNotifyRequest;  // Don't modify the request while active !
1919     nm_DoNotTouch: LongWord;  // Like it says! For use by handlers
1920     nm_DoNotTouch2: LongWord; // ditto
1921   end;
1922 
1923 const
1924 // Flag bit numbers
1925   NRB_SEND_MESSAGE      = 0;
1926   NRB_SEND_SIGNAL       = 1;
1927   NRB_WAIT_REPLY        = 3;
1928   NRB_NOTIFY_INITIAL    = 4;
1929   NRB_CALL_HOOK         = 5;
1930   NRB_DOS_NOTIFY_ONLY   = 12;
1931   NRB_MAGIC             = 31; // PRIVATE - Handler use only.
1932 
1933 // --- NotifyRequest Flags ------------------------------------------------
1934 // Notify Methods - the following three are mutually exclusive
1935   NRF_SEND_MESSAGE      = 1 shl NRB_SEND_MESSAGE;
1936   NRF_SEND_SIGNAL       = 1 shl NRB_SEND_SIGNAL;
1937   NRF_CALL_HOOK         = 1 shl NRB_CALL_HOOK;
1938 // Do not queue messages for NRF_SEND_MESSAGE method
1939   NRF_WAIT_REPLY        = 1 shl NRB_WAIT_REPLY;
1940 // Always send an initial notification on setup
1941   NRF_NOTIFY_INITIAL    = 1 shl NRB_NOTIFY_INITIAL;
1942 // New flag for V52.33+ DOS, specifying this flag prevents the use  of filesystem supported notification, even if it is available,
1943 // it forces usage of the dos.library notification function instead. The dos.library notification function supports all three methods with both file and directory monitoring.
1944   NRF_DOS_NOTIFY_ONLY   = 1 shl NRB_DOS_NOTIFY_ONLY;
1945 
1946 // PRIVATE - Handler use only. Do NOT set or remove NRF_MAGIC yourself.
1947   NRF_MAGIC             = 1 shl NRB_MAGIC;
1948 
1949 // PRIVATE - Bitmask of flags that are reserved for use by the handler:
1950   NR_HANDLER_MASK       = $ffff0000;
1951   NR_HANDLER_FLAGS      = NR_HANDLER_MASK;  // old source compatibility
1952 
1953 type
1954 // --- NotifyHook data
1955   PNotifyHookMsg = ^TNotifyHookMsg;
1956   TNotifyHookMsg = record
1957     nhm_Size: LongInt;   // Size of data structure
1958     nhm_Action: LongInt; // What happened (see below)
1959     nhm_Name: STRPTR;    // The name of the object
1960   end;
1961 
1962 const
1963 // nhm_Action types
1964   NHM_ACTION_INITIAL = -1; // Initial invocation
1965   NHM_ACTION_ADD     = 0;  // Object was added
1966   NHM_ACTION_CHANGE  = 1;  // Object has changed
1967   NHM_ACTION_DELETE  = 2;  // Object was removed
1968 
1969 // A shell search path list component. Do not allocate this yourself!
1970 type
1971   PPathNode = ^TPathNode;
1972   TPathNode = record
1973     pn_Next: BPTR; // Pointer to next path node
1974     pn_Lock: BPTR; // Directory lock
1975   end;
1976 
1977 // Parameters for use with the AddPathNode() function. Where to add the new node?
1978 const
1979   ADDCMDPATHNODE_HEAD = 0;
1980   ADDCMDPATHNODE_TAIL = 1;
1981 
1982 // The message passed to hook invoked by the SearchCmdPathList() function.
1983 type
1984   PSearchCmdPathListMsg = ^TSearchCmdPathListMsg;
1985   TSearchCmdPathListMsg = record
1986     splm_Size: LongInt;
1987     splm_Lock: BPTR;
1988     splm_Name: STRPTR;
1989   end;
1990 
1991 {*********************************************************************
1992  *
1993  * The CSource data structure defines the input source for "ReadItem()"
1994  * as well as the ReadArgs call.  It is a publicly defined structure
1995  * which may be used by applications which use code that follows the
1996  * conventions defined for access.
1997  *
1998  * When passed to the dos.library functions, the value passed as
1999  * struct *CSource is defined as follows:
2000  *      if ( CSource == 0)      Use buffered IO "ReadChar()" as data source
2001  *      else                    Use CSource for input character stream
2002  *
2003  * The following two pseudo-code routines define how the CSource structure
2004  * is used:
2005  *
2006  * long CS_ReadChar( struct CSource *CSource )
2007  *
2008  *      if ( CSource == 0 )     return ReadChar();
2009  *      if ( CSource->CurChr >= CSource->Length )       return ENDSTREAMCHAR;
2010  *      return CSource->Buffer[ CSource->CurChr++ ];
2011  *
2012  *
2013  * BOOL CS_UnReadChar( struct CSource *CSource )
2014  *
2015  *      if ( CSource == 0 )     return UnReadChar();
2016  *      if ( CSource->CurChr <= 0 )     return FALSE;
2017  *      CSource->CurChr--;
2018  *      return TRUE;
2019  *
2020  *
2021  * To initialize a struct CSource, you set CSource->CS_Buffer to
2022  * a string which is used as the data source, and set CS_Length to
2023  * the number of characters in the string.  Normally CS_CurChr should
2024  * be initialized to ZERO, or left as it was from prior use as
2025  * a CSource.
2026  *
2027  *********************************************************************}
2028 
2029 type
2030   PCSource = ^TCSource;
2031   TCSource = record
2032     CS_Buffer: STRPTR;
2033     CS_Length: LongInt;
2034     CS_CurChr: LongInt;
2035   end;
2036 
2037 {   *********************************************************************
2038  *
2039  * The RDArgs data structure is the input parameter passed to the DOS
2040  * ReadArgs() function call.
2041  *
2042  * The RDA_Source structure is a CSource as defined above;
2043  * if RDA_Source.CS_Buffer is non-null, RDA_Source is used as the input
2044  * character stream to parse, else the input comes from the buffered STDIN
2045  * calls ReadChar/UnReadChar.
2046  *
2047  * RDA_DAList is a private address which is used internally to track
2048  * allocations which are freed by FreeArgs().  This MUST be initialized
2049  * to NULL prior to the first call to ReadArgs().
2050  *
2051  * The RDA_Buffer and RDA_BufSiz fields allow the application to supply
2052  * a fixed-size buffer in which to store the parsed data.  This allows
2053  * the application to pre-allocate a buffer rather than requiring buffer
2054  * space to be allocated.  If either RDA_Buffer or RDA_BufSiz is NULL,
2055  * the application has not supplied a buffer.
2056  *
2057  * RDA_ExtHelp is a text string which will be displayed instead of the
2058  * template string, if the user is prompted for input.
2059  *
2060  * RDA_Flags bits control how ReadArgs() works.  The flag bits are
2061  * defined below.  Defaults are initialized to ZERO.
2062  *
2063  *********************************************************************}
2064 
2065   PRDArgs = ^TRDArgs;
2066   TRDArgs = record
2067     RDA_Source: TCSource; // Select input source
2068     RDA_DAList: LongInt;  // PRIVATE.
2069     RDA_Buffer: STRPTR;   // Optional string parsing space.
2070     RDA_BufSiz: LongInt;  // Size of RDA_Buffer (0..n)
2071     RDA_ExtHelp: STRPTR;  // Optional extended help
2072     RDA_Flags: LongInt;   // Flags for any required control
2073   end;
2074 
2075 const
2076   RDAB_STDIN     = 0; // Use "STDIN" rather than "COMMAND LINE"
2077   RDAB_NOALLOC   = 1; // If set, do not allocate extra string space.
2078   RDAB_NOPROMPT  = 2; // Disable reprompting for string input.
2079   RDAF_STDIN     = 1 shl RDAB_STDIN;
2080   RDAF_NOALLOC   = 1 shl RDAB_NOALLOC;
2081   RDAF_NOPROMPT  = 1 shl RDAB_NOPROMPT;
2082 
2083 // Modes for LockRecord/LockRecords()
2084   REC_EXCLUSIVE       = 0;
2085   REC_EXCLUSIVE_IMMED = 1;
2086   REC_SHARED          = 2;
2087   REC_SHARED_IMMED    = 3;
2088 
2089   RECF_DOS_METHOD_ONLY = 1 shl 16;
2090   REC_MODE_MASK        = $FF;
2091 
2092 // Struct to be passed to LockRecords()/UnLockRecords() v53.86+
2093 // Note: the rec_Size member MUST be set in each struct or it won't work.
2094 type
2095   PRecordLock = ^TRecordLock;
2096   TRecordLock = record
2097     rec_Size: LongWord;   // This MUST be set to sizeof(struct RecordLock)
2098     rec_FH: BPTR;         // filehandle
2099     rec_Offset: LongWord; // offset in file
2100     rec_Length: LongWord; // length of file record to be locked
2101     rec_Mode: LongWord;   // Type of lock
2102   end;
2103 
2104 // The structure in the pr_LocalVars list. Do NOT allocate yourself, use SetVar()!!! This structure may grow in
2105 // future releases!  The list should be left in alphabetical order, and may have multiple entries with the same name but different types.
2106   PLocalVar = ^TLocalVar;
2107   TLocalVar = record
2108     lv_Node: TNode;
2109     lv_Flags: Word;
2110     lv_Value: STRPTR;
2111     lv_Len: LongWord;
2112   end;
2113 // The LocalVar->lv_Node.ln_Name points to the name buffer.
2114 // The LocalVar->lv_Node.ln_Type is used by the system.
2115 // The LocalVar->lv_Node.ln_Pri is reserved for system use.
2116 const
2117 // LocalVar type identifiers:
2118   LV_VAR     =   0; // a variable
2119   LV_ALIAS   =   1; // an alias
2120 // bit definitions for LocalVar type:
2121   LVB_IGNORE =   7;   // ignore this entry on GetVar, FindVar() etc
2122   LV_TYPE_MASK = $FF; // the low 8 flags bits hold the local var type
2123 
2124 // bit definitions of flags passed to GetVar()/SetVar()/DeleteVar(), ScanVars() these bit defs are OR'ed with the type. Item will be treated as a single line of text unless BINARY_VAR is specified
2125   GVB_GLOBAL_ONLY       = 8;  // only use global vars, no local vars will be accessed.
2126   GVB_LOCAL_ONLY        = 9;  // only use local vars, no global vars will be accessed.
2127   GVB_BINARY_VAR        = 10; // treat as binary var, don't truncate at a newline or carriage return char.
2128   GVB_DONT_NULL_TERM    = 11; // can only be used with GVF_BINARY_VAR do not add a nul-terminator 0 byte at the end of data.
2129   GVB_SAVE_VAR          = 12; // only works with GVF_GLOBAL_VAR this is only supported in >= V39 dos.  V37 dos ignores this. this causes SetVar to affect ENVARC: as well as ENV:
2130   GVB_SCAN_ENVARC       = 13; // only usefull with GLOBAL vars scan envarc: instead of env: for use in ScanVars() - v50
2131   GVB_SCAN_LEVEL        = 14; // for ScanVars() - v53 scan single directory level do not go into further sub directories. - v53
2132   GVB_SCAN_TOPLEVEL     = GVB_SCAN_LEVEL;
2133   GVB_SCAN_STARTDIR     = 15;
2134 
2135   LVF_IGNORE              = 1 shl LVB_IGNORE;
2136   GVF_GLOBAL_ONLY         = 1 shl GVB_GLOBAL_ONLY;
2137   GVF_LOCAL_ONLY          = 1 shl GVB_LOCAL_ONLY;
2138   GVF_BINARY_VAR          = 1 shl GVB_BINARY_VAR;
2139   GVF_DONT_NULL_TERM      = 1 shl GVB_DONT_NULL_TERM;
2140   GVF_SAVE_VAR            = 1 shl GVB_SAVE_VAR;
2141   GVF_SCAN_ENVARC         = 1 shl GVB_SCAN_ENVARC;
2142   GVF_SCAN_LEVEL          = 1 shl GVB_SCAN_LEVEL;
2143   GVF_SCAN_STARTDIR       = 1 shl GVB_SCAN_STARTDIR;
2144 
2145 const
2146 //definitions for the (V51.96) GetDiskInfo() call.
2147   GDI_Dummy           = TAG_USER + 500;
2148   GDI_StringNameInput = GDI_Dummy + 1;  // STRPTR - pointer to a string identifier for the handler.
2149   GDI_FileHandleInput = GDI_Dummy + 2;  // BPTR - BCPL pointer to a FileHandle to identify the handler
2150   GDI_LockInput       = GDI_Dummy + 3;  // BPTR - BCPL pointer to a Lock to identify the handler.
2151   GDI_FileLockInput   = GDI_LockInput;
2152   GDI_MsgPortInput    = GDI_Dummy + 4;  // PMsgPort - Pointer to the handlers message port
2153   GDI_VolumeRequired  = GDI_Dummy + 10; // LongBool - True for ACTION_INFO, FALSE for ACTION_DISK_INFO
2154   GDI_InfoData        = GDI_Dummy + 11; // PInfoData - Pointer to an InfoData structure
2155 // definitions for the (V53.59) ObtainConsoleDataTags() call.
2156   OCD_Dummy           = TAG_USER + 600;
2157   OCD_FileHandleInput = OCD_Dummy + 1; // BPTR - BCPL pointer to a FileHandle for a console window.
2158   OCD_MsgPortInput    = OCD_Dummy + 2; // PMsgPort - Pointer to a console message port.
2159 // definitions for the (V50) GetSegListInfo() call
2160   GSLI_Dummy         = TAG_USER + 4000;
2161   GSLI_NATIVE        = GSLI_Dummy + 1;  // PPPseudoSegList - if PPC executable. this only means it's native and executable, it does NOT imply any particular type.
2162   GSLI_Data          = GSLI_Dummy + 2;  // PAPTR - data, if a data-only pseudoseglist.
2163   GSLI_68KPS         = GSLI_Dummy + 3;  // PPPseudoSeglist - if 68K pseudoseglist
2164   GSLI_ElfHandle     = GSLI_Dummy + 4;  // PPElf32_Handle
2165   GSLI_68KHUNK       = GSLI_Dummy + 5;  // PBPTR - seglist, if old 68K HUNK style seglist.
2166   GSLI_68KOVLAY      = GSLI_Dummy + 6;  // PBPTR - seglist, if old 68K OVERLAY seglist.
2167   GSLI_68KFileSize   = GSLI_Dummy + 7;  // PLongWord - size of the 68K binary load file. 51.58
2168   GSLI_68KFileXsum   = GSLI_Dummy + 8;  // PLongWord - 32 bit xsum of the 68K binary load file. 51.58
2169   GSLI_HeaderSize    = GSLI_Dummy + 9;  // PLongWord - byte size of the DOS allocated segment header. 51.99
2170   GSLI_SegmentSize   = GSLI_Dummy + 10; // PLongWord - byte size of the entire segment allocation.  52.13
2171   GSLI_VersionString = GSLI_Dummy + 11; // STRPTR - returns a "$VER:" version string in a seglist. 52.18
2172   GSLI_ResidentVersionString = GSLI_Dummy + 12; // STRPTR - returns Resident->rt_IDString version string. 53.21
2173   GSLI_ResidentStruct = GSLI_Dummy + 13; // PResident - returns a pointer to a struct Resident. 53.70
2174 // definitions for the (V50) AddSegmentTagList() call
2175   AS_Dummy       = TAG_USER + 3000;
2176   AS_SegmentList = AS_Dummy + 1; // Segment list, as returned by the LoadSeg() function
2177   AS_Entry       = AS_Dummy + 2; // Address of a function which implements the command
2178 // definitions for the (V53) LockTagList() call
2179   LK_Dummy       = TAG_USER + 5750;
2180   LK_Name        = LK_Dummy + 1; // STRPTR - Name of object to lock.
2181   LK_Mode        = LK_Dummy + 2; // LongInt - Access mode; SHARED_LOCK or EXCLUSIVE_LOCK
2182   LK_InfoMask    = LK_Dummy + 3; // PLongWord - pointer to info mask storage area.
2183   LK_SoftLinks   = LK_Dummy + 4; // PLongWord - pointer to softlink count storage area.
2184   LK_ResolveSL   = LK_Dummy + 5; // LongInt - Boolean switch to control softlink resolution.
2185   LK_ResolveMA   = LK_Dummy + 6; // LongInt - Boolean switch to control multi-assign resolution. 54.21
2186 
2187 // definitions for the DosSystem() call.
2188   SYS_Dummy              = TAG_USER + 32;
2189   SYS_CommandRunMode     = SYS_Dummy + 0; // (LongBool) PRIVATE Internal SHELL tag to identify "run" command.
2190   SYS_Input              = SYS_Dummy + 1; // (BPTR) specifies the input filehandle
2191   SYS_Output             = SYS_Dummy + 2; // (BPTR) specifies the output filehandle
2192   SYS_Asynch             = SYS_Dummy + 3; // (LongBool) run asynch, close input/output on exit(!)
2193   SYS_UserShell          = SYS_Dummy + 4; // (LongBool) send to user shell instead of boot shell
2194   SYS_CustomShell        = SYS_Dummy + 5; // (STRPTR) send to a specific shell (data is name)
2195   SYS_Error              = SYS_Dummy + 6; // (BPTR) specifies the error output filehandle (New for V50)
2196   SYS_ExecuteInputStream = SYS_Dummy + 7; // (LongBool) instead of reading the 'command' string parameter, reads commands from the input filehandle instead. (V53.45)
2197 
2198 //definitions for the CreateNewProc() call; you MUST specify one of NP_Seglist or NP_Entry. All others are optional.
2199   NP_Dummy       = TAG_USER + 1000;
2200   NP_Seglist     = NP_Dummy + 1;  // seglist of code to run for the process
2201   NP_FreeSeglist = NP_Dummy + 2;  // free seglist on exit - only valid for for NP_Seglist. Default is FALSE.
2202   NP_Entry       = NP_Dummy + 3;  // entry point to run
2203   NP_Input       = NP_Dummy + 4;  // filehandle - default is DosOpen('NIL:'...)
2204   NP_Output      = NP_Dummy + 5;  // filehandle - default is DosOpen('NIL:'...)
2205   NP_CloseInput  = NP_Dummy + 6;  // close input filehandle on exit default TRUE
2206   NP_CloseOutput = NP_Dummy + 7;  // close output filehandle on exit default TRUE
2207   NP_Error       = NP_Dummy + 8;  // filehandle - default is nil V50
2208   NP_CloseError  = NP_Dummy + 9;  // close error filehandle on exit default FALSE V50
2209   NP_CurrentDir  = NP_Dummy + 10; // lock - default is parent's current dir
2210   NP_StackSize   = NP_Dummy + 11; // stacksize for process - default 4000
2211   NP_Name        = NP_Dummy + 12; // name for process - default 'New Process'
2212   NP_Priority    = NP_Dummy + 13; // priority - default same as parent
2213   NP_ConsolePort = NP_Dummy + 14; // consoletask - old compatibility  - default same as parent
2214   NP_ConsoleTask = NP_ConsolePort;
2215   NP_WindowPtr   = NP_Dummy + 15; // window ptr - default is same as parent
2216   NP_ProgramDir  = NP_Dummy + 16; // home program directory - default curr progdir
2217   NP_CopyVars    = NP_Dummy + 17; // Boolean to copy local vars - default TRUE
2218   NP_Cli         = NP_Dummy + 18; // create cli structure - default FALSE
2219   NP_Path        = NP_Dummy + 19; // path - default is copy of parents path only valid if a cli process!
2220   NP_CommandName = NP_Dummy + 20; // commandname - valid only for CLI
2221   NP_Arguments   = NP_Dummy + 21; // cstring of arguments
2222   NP_unused1     = NP_Dummy + 22; // never implemented
2223   NP_unused2     = NP_Dummy + 23; // INTERNALLY - used
2224   NP_ExitCode    = NP_Dummy + 24; // code to be called on process exit, just before cleanup
2225   NP_ExitData    = NP_Dummy + 25; // optional argument for NP_ExitCode function - default 0
2226   NP_UserData    = NP_Dummy + 26; // optional value to install into TTask.tc_UserData.
2227   NP_Child       = NP_Dummy + 27; // LongBool flag to nominate this new process as a dependant child of the parent. (V50)
2228   NP_NotifyOnDeathMessage = NP_Dummy + 28; // PDeathMessage -- (V51.53) Specify an initialised death message structure to ReplyMsg() to,
2229                                            // upon death of this process. Defaults to none.
2230   NP_NotifyOnDeathSigTask = NP_Dummy + 29; // PTask -- (V51.53) Specify the task or process to signal upon death of this process.
2231                                            // Specify NULL for the parent of this child process. Defaults to no signalling, if this tag is not specified
2232   NP_NotifyOnDeathSignalBit = NP_Dummy + 30; // A value 0-31 for the signal bit number to send to the task NP_NotifyOnDeathSigTask, upon death of this process. Defaults to SIGB_CHILD if not specified.
2233   NP_LocalVars   = NP_Dummy + 31; // STRPTR * -- (V51.70) Paired array of string pointers representing a list of local variables to add to the new process, array must be
2234                                   // arranged as;  Name1,Value1, Name2,Value2, Name3,Value3, nil; Default nil
2235   NP_EntryCode   = NP_Dummy + 32; // code to be called on process startup, just before internalRunCommand()
2236   NP_EntryData   = NP_Dummy + 33; // optional argument for NP_EntryCode function - default 0
2237   NP_FinalCode   = NP_Dummy + 34; // code to be called on process exit, just before cleanup
2238   NP_FinalData   = NP_Dummy + 35; // optional argument for NP_FinalCode function - default 0
2239   NP_LocalAlias  = NP_Dummy + 36; // PSTRPTR -- (added V52.5) Paired array of string pointers to represent a list of local aliases to add to the new process,
2240                                   // array must be arranged as; Alias1,Value1, Alias2,Value2, Alias3,Value3, nil; Default nil
2241   NP_LockStack   = NP_Dummy + 37; // Boolean tag to cause exec to lock the stack in place, specifying TRUE will prevent the stack frame being swapped out. Default FALSE   (added V52.10)
2242   NP_OwnerUID    = NP_Dummy + 38; // LongWord -- (added 52.18) Specify the pr_UID value for the new process.
2243   NP_OwnerGID    = NP_Dummy + 39; // LongWord -- (added 52.18) Specify the pr_GID value for the new process.
2244 
2245 // tags for AllocDosObject()
2246   ADO_Dummy        = TAG_USER + 2000;
2247   ADO_TermCharStr  = ADO_Dummy + 0;    // Added for FReadLine() V53.19
2248 // Obsolete tags +1...+5 have removed
2249   ADO_AddedSize    = ADO_Dummy + 6; // Size of additional buffer to allocate over and above the base structure size required by the flag DOS_xxxxx .  (V50)
2250   ADO_Strlen       = ADO_AddedSize;
2251   ADO_Flags        = ADO_Dummy + 7; // Generic 32 bit flags for those allocations that require initialisation of a specific flags field. (V50)
2252   ADO_DOSType      = ADO_Flags;     // alias V51
2253   ADO_TermChar     = ADO_Flags;     // alias V51
2254   ADO_Type         = ADO_Flags;     // alias V52
2255   ADO_Vectors      = ADO_Flags;     // alias V53
2256   ADO_Mask         = ADO_Dummy + 8; // Generic 32 bit mask for those allocations that require initialisation of a specific bitmask. (V50)
2257   ADO_AddColon     = ADO_Mask;      // alias V53
2258   ADO_Name         = ADO_Dummy + 9; // Generic STRPTR Name. (V52)
2259   ADO_NotifyName   = ADO_Name;      // alias V52 Name of the volume, directory or file to monitor and produce notification messages for. (V51)
2260   ADO_NotifyUserData     = ADO_Dummy + 10; // User data to be stored in a NotifyRequest. (V51)
2261   ADO_NotifyMethod       = ADO_Dummy + 11; // Notification method; must be one of NRF_SEND_MESSAGE, NRF_SEND_SIGNAL or NRF_CALL_HOOK. (V51)
2262   ADO_NotifyPort         = ADO_Dummy + 12; // MsgPort to send notification messages to; this is used for the NRF_SEND_MESSAGE notification method. (V51)
2263   ADO_NotifyTask         = ADO_Dummy + 13; // Task to send a notification signal to; this is used for the NRF_SEND_SIGNAL notification method. (V51)
2264   ADO_NotifySignalNumber = ADO_Dummy + 14; // The signal number (0..31) to use when sending a notification signal; this is used for the NRF_SEND_SIGNAL notification method. (V51)
2265   ADO_NotifyHook         = ADO_Dummy + 15; // The hook to call when a notification is required; this is used for the NRF_CALL_HOOK method. (V51)
2266   ADO_NotifyWaitReply    = ADO_Dummy + 16; // Selects if the further notification messages should be sent unless the last message has been replied. (V51)
2267   ADO_NotifyInitial      = ADO_Dummy + 17; // Selects if the notification should be sent immediately after it was requested. (V51)
2268   ADO_Size               = ADO_Dummy + 18; // Specify allocation size that is larger than the default. (V51)
2269   ADO_DOSMethodOnly      = ADO_Dummy + 19; // Force the dos.library to service the notify request, and exclude the filesystem routines even if they are available. (V52.33)
2270   ADO_ExamineData_NameSize = ADO_Dummy + 20; // Selects the size of the name buffer for DOS_EXAMINEDATA. (V51)
2271   ADO_ExamineData_CommentSize = ADO_Dummy + 21; // Selects the size of the comment buffer for DOS_EXAMINEDATA (V51)
2272   ADO_ExamineData_LinkSize = ADO_Dummy + 22; // Selects the size of the link name buffer for DOS_EXAMINEDATA. (V51)
2273   ADO_ExamineDir_Context = ADO_Dummy + 23; // Used by filesystems and DOS to pass an ExamineContext. (V51.104)
2274 
2275 // Tags for DosControl()
2276   DC_Dummy     = TAG_USER + 5000;
2277   DC_WildStarW = DC_Dummy + 1; // (LongInt Boolean) -- Write to the default WildStar switch. Default is FALSE.
2278   DC_WildStarR = DC_Dummy + 2; // (PLongInt) -- Obtain the state of WildStar switch.
2279   DC_FHBufferW = DC_Dummy + 3; // (LongInt) -- Writes the size in bytes for all FileHandle buffers. The default value for V50 DOS is 8000 bytes.
2280   DC_FHBufferR = DC_Dummy + 4; // (PLongInt) -- Obtain the size in bytes for FH Buffers.
2281   DC_WarnPostTimeW = DC_Dummy + 5;  // (LongInt) -- Write the number of seconds to post warning for. Default posting time is currently 120 seconds.
2282   DC_WarnPostTimeR = DC_Dummy + 6;  // (PLongInt) -- Obtain the value for WarnPostTime.
2283   DC_WarnWaitTimeW = DC_Dummy + 7;  // (LongInt) -- Write the number of seconds to wait between warnings. Default wait time is currently 5 seconds.
2284   DC_WarnWaitTimeR = DC_Dummy + 8;  // (PLongInt) -- Obtain the value for WarnWaitTime.
2285   DC_MinProcStackW = DC_Dummy + 9;  // (LongInt) -- Write the number of bytes to enforce as min proc stack
2286   DC_MinProcStackR = DC_Dummy + 10; // (PLongInt) -- Obtain the value for MinProcStack.
2287   DC_AssignMountW  = DC_Dummy + 11; // (LongInt) -- Write to the default AssignMount switch.
2288   DC_AssignMountR  = DC_Dummy + 12; // (PLongInt) -- Obtain the state of the AssignMount switch.
2289   DC_BootCliFontSizeW = DC_Dummy + 13; // (LongInt) -- Write the boot cli font size. TOPAZ_SIXTY or TOPAZ_EIGHTY
2290   DC_BootCliFontSizeR = DC_Dummy + 14; // (PLongInt) -- Obtain the size of the boot cli font size.
2291   DC_Reload68KApplistW = DC_Dummy + 15; // (LongInt) -- DOSTRUE will cause DEVS:applications.dos config file to reload from disk. 51.58
2292   DC_unused1R          = DC_Dummy + 16; // pad tag for DC_Reload68KApplistR slot
2293   DC_BootCliCloseGadgetW = DC_Dummy + 17; // (LongInt) -- DOSTRUE will cause the boot cli to have a close gadget. 52.8
2294   DC_BootCliCloseGadgetR = DC_Dummy + 18; // (PLongInt) -- Obtain the state of the boot cli close gadget switch. 52.8
2295   DC_LocaleBaseW = DC_Dummy + 19; // (PLocaleBase) -- Write the locale base pointer for DOS to access. V54
2296   DC_LocaleBaseR = DC_Dummy + 20; // (PPLocaleBase) -- Obtain the locale base pointer value from DOS. V54
2297 
2298 // Tags for ReadLineItem()
2299   RLI_Dummy           = TAG_USER + 5500;
2300   RLI_FileHandleInput = RLI_Dummy + 1;  // (BPTR) -- Read with FGetC() from this filehandle. Default is FGetC(Input());
2301   RLI_CSourceInput    = RLI_Dummy + 2;  // (PCSource) -- Read from this CSource stream. Default is FGetC(Input());
2302   RLI_EscapeChars     = RLI_Dummy + 10; // (STRPTR) -- Nul-terminated string of one or more characters to be recognised as escape characters.
2303                                         // This may be an empty string '' or nil, for none. Defaults to '*'.
2304   RLI_MultiLine       = RLI_Dummy + 11; // (LongInt; boolean) -- Enable Multi-line processing. Defaults to FALSE.
2305   RLI_CommentChars    = RLI_Dummy + 12; // (STRPTR) -- Nul-terminated string of one or more characters to be used as a comment marker.
2306                                         // This may be an empty string '' or nil, for none. Defaults to ''.
2307   RLI_Substitute_N    = RLI_Dummy + 13; // (LongInt; boolean) -- Substitute quoted escaped 'N' to the hex char $0a.
2308                                         // Only works when RLI_EscapeChars is not "" or nil. Defaults to TRUE.
2309   RLI_Substitute_E    = RLI_Dummy + 14; // (LongInt; boolean) -- Substitute quoted escaped 'E' to the hex
2310                                         // char $1b. Only works when RLI_EscapeChars is not '' or nil. Defaults to TRUE.
2311 // Tags for SetFileHandleAttr()
2312   FH_Dummy      = TAG_USER + 6000;
2313 
2314   FH_BufferSize = FH_Dummy + 1;
2315   FH_UserBuffer = FH_Dummy + 2;
2316   FH_BufferMode = FH_Dummy + 3;
2317   FH_Locking    = FH_Dummy + 4;
2318   FH_EndStream  = FH_Dummy + 5;
2319 
2320 // Tags for SetOwnerInfo(), GetOwnerInfo().
2321   OI_Dummy           = TAG_USER + 6200;
2322 
2323   OI_StringNameInput = OI_Dummy + 1;  // (STRPTR) -- Pointer to a string identifying a filesystem object. This tag is mutually exclusive with OI_Process.
2324   OI_StringName      = OI_StringNameInput;
2325   OI_ProcessInput    = OI_Dummy + 2;  // (PProcess) -- Pointer to a process structure, or nil for this process, to identify a process. This tag is mutually exclusive with OI_StringName.
2326   OI_Process         = OI_ProcessInput;
2327   OI_OwnerUID        = OI_Dummy + 10; // GetOwnerInfo() -- Pointer to a LongInt sized storage area. Returns the value of the objects UID field.
2328                                       // SetOwnerInfo() -- LongInt value. Sets the value of an objects UID field.
2329   OI_OwnerGID        = OI_Dummy + 11; // GetOwnerInfo() -- Pointer to a LongInt sized storage area. Returns the value of the objects GID field.
2330                                       // SetOwnerInfo() -- LongInt value. Sets the value of an objects GID field.
2331 // Tags for TimedDosRequester()
2332   TDR_Dummy      = TAG_USER + 3500;
2333 
2334   TDR_IDCMP_Ptr  = TDR_Dummy + 1; // (PLongInt) -- [OPTIONAL] Pointer to a longword initialised with the IDCMP flags that you want to terminate the requester on. (Default nil)
2335   TDR_Timeout    = TDR_Dummy + 2; // (LongInt) -- [OPTIONAL] Value in seconds to wait before requester will close without intervention.  A timeout will only occur with values > 0.
2336                                  // It is recommended that timouts less than 10 seconds be avoided whenever possible, to be user-friendly. (Default; 0)
2337   TDR_Window     = TDR_Dummy + 3; // (PWindow) -- [OPTIONAL] A pointer to an (over-riding) reference window pointer. Normally, you would not need to specify this tag.
2338   TDR_EasyStruct = TDR_Dummy + 4; // (PEasyStruct) [OPTIONAL] -- Pointer to your own private struct EasyStruct that has already been initialised.   (Default; internally allocated)
2339   TDR_FormatString = TDR_Dummy + 5; // (STRPTR) [OPTIONAL] -- The format string using RawDoFmt style specifiers that match the number of argument array entries.
2340                                     // If this tag is present, it will override a formatstring that may have already been supplied with a private TDR_EasyStruct.
2341   TDR_TitleString  = TDR_Dummy + 6; // (STRPTR) [OPTIONAL] -- The title string for the requester. If this tag is present, it will override a title string that may have already been supplied with a private TDR_EasyStruct.
2342   TDR_GadgetString = TDR_Dummy + 7; // (STRPTR) [OPTIONAL] -- The string spec for the gadgets/text for the requester. If this tag is present, it will override a Gadget string that may have been supplied with a private TDR_EasyStruct.
2343   TDR_ImageType    = TDR_Dummy + 8; // (LongInt) -- The visual style of this request. This argument has currently no effect before IPrefs is running, but should always
2344                                     // be specified to indicate the style of request this is directedfor.   (Default; TDRIMAGE_DEFAULT) The values for this tag are defined below.
2345   TDRIMAGE_DEFAULT    = 0;
2346   TDRIMAGE_INFO       = 1;
2347   TDRIMAGE_WARNING    = 2;
2348   TDRIMAGE_ERROR      = 3;
2349   TDRIMAGE_QUESTION   = 4;
2350   TDRIMAGE_INSERTDISK = 5;
2351 
2352   TDR_ArgArray = TDR_Dummy + 9;  // (APTR) [OPTIONAL] -- A pointer to a completely initialised argument array with the number of entries that correspond to the RawDoFmt() format specifiers.
2353                                  // Do not use this tag if you want to specify up to the first 10 arguments individually with the following TDR_Arg# tags.
2354   TDR_Inactive = TDR_Dummy + 10; // (LongInt; Boolean) -- Boolean value to specify the requester should not be activated to avoid its stealing the users input focus.
2355                                  // You should set this to TRUE when the gadgets of your requester contain keyboard shortcuts and its possible that the user is
2356                                  // currently typing text in another application (otherwise the user could answer the requester by accident). This tag has
2357                                  // currently no effect before IPrefs is running, keyboard shortcuts also won't work before either.  (Default; FALSE)
2358   TDR_CharSet  = TDR_Dummy + 11; // (LongWord) -- Character set for the requester's text and gadgets. Defaults to 0, meaning the charset of the screen font which
2359                                  // will be the current system default charset in most cases. This tag has currently no effect before IPrefs is running.
2360                                  // The tag value is based on the IANA MIBenum value for charsets. See the autodoc for diskfont.library/ObtainCharsetInfo().
2361                                  // TDR_CharSet should be set by localized applications that want to display localized requesters, they tell locale.library in
2362                                  // OpenCatalog() that it shall not convert the catalog charset to current system default charset and use the value of
2363                                  // Catalog->cat_CodeSet for the TDR_CharSet.    (Default; 0)
2364   TDR_NonBlocking = TDR_Dummy + 12; // (LongInt; Boolean) -- [OPTIONAL] switch to prevent this function from attempting any disk based I/O whatsoever.
2365                                     // This makes the function safe to call at any time from handlers and filesystems and in some cases performing dospacket I/O from a task context.
2366                                     // This tag will effectively bypass the use of any reaction components that may cause blocking issues and re-apply the original dos.library
2367                                     // code that only calls the intuition library EasyRequest() function, as if it was never patched by "IPrefs". (Default; FALSE)
2368   TDR_Arg1  = TDR_Dummy+20;
2369   TDR_Arg2  = TDR_Dummy+21;
2370   TDR_Arg3  = TDR_Dummy+22;
2371   TDR_Arg4  = TDR_Dummy+23;
2372   TDR_Arg5  = TDR_Dummy+24;
2373   TDR_Arg6  = TDR_Dummy+25;
2374   TDR_Arg7  = TDR_Dummy+26;
2375   TDR_Arg8  = TDR_Dummy+27;
2376   TDR_Arg9  = TDR_Dummy+28;
2377   TDR_Arg10 = TDR_Dummy+29;
2378 
2379 // Tags for FileSystemAttr()
2380   FSA_Dummy                    = TAG_USER + 9000;
2381   FSA_StringNameInput          = FSA_Dummy + 1; // (STRPTR) -- Identify the filesystem by this name reference.
2382   FSA_FileHandleInput          = FSA_Dummy + 2; // (BPTR) -- Identify the filesystem by this FileHandle.
2383   FSA_LockInput                = FSA_Dummy + 3; // (BPTR) -- Identify the filesystem by this Lock.
2384   FSA_FileLockInput            = FSA_LockInput;
2385   FSA_MsgPortInput             = FSA_Dummy + 4;  // (PMsgPort)  Identify the filesystem by this message port. NOTE: This tag was added in dos.library 51.96
2386   FSA_MaxFileNameLengthR       = FSA_Dummy + 10; // (PLongWord) -- Obtain the maximum filename length. (including \0)
2387   FSA_MaxFileNameLengthW       = FSA_Dummy + 11; // (LongWord) -- Set the maximum filename length. (including \0)
2388   FSA_VersionNumberR           = FSA_Dummy + 12; // (PLongWord) -- Obtain the version/rev number for the filesystem.
2389   FSA_DOSTypeR                 = FSA_Dummy + 13; // (PLongWord) -- Obtain the dostype identifier for the filesystem.
2390   FSA_ActivityFlushTimeoutR    = FSA_Dummy + 14; // (PLongWord) -- Obtain the mS (1000th second) before a flush while active occurs.
2391   FSA_ActivityFlushTimeoutW    = FSA_Dummy + 15; // (LongWord) -- Set the mS (1000th second) before a flush while active occurs.
2392   FSA_InactivityFlushTimeoutR  = FSA_Dummy + 16; // (PLongWord) -- Obtain the mS (1000th second) before a flush when inactive occurs.
2393   FSA_InactivityFlushTimeoutW  = FSA_Dummy + 17; // (LongWord) -- Set the mS (1000th second) before a flush when inactive occurs.
2394   FSA_MaxRecycledEntriesR      = FSA_Dummy + 18; // (PLongWord) -- Obtain the number of recycled entries supported.
2395   FSA_MaxRecycledEntriesW      = FSA_Dummy + 19; // (LongWord) -- Set the number of recycled entries supported.
2396   FSA_HasRecycledEntriesR      = FSA_Dummy + 20; // (PLongWord) -- Obtain boolean value if the filesystem supports recycled entries.
2397   FSA_VersionStringR           = FSA_Dummy + 21; // (STRPTR) -- Obtain a copy of the version string for the filesystem.
2398   FSA_VersionStringR_BufSize   = FSA_Dummy + 22; // (LongWord) -- Sub tag to specify the length of the space provided for FSA_VersionStringR.
2399   FSA_VersionStringR_Len       = FSA_VersionStringR_BufSize;  // temp compatibility
2400 
2401 // Common tags for ExamineObject() and ExamineDir().
2402   EX_Dummy           = TAG_USER + 6500;
2403   EX_StringNameInput = EX_Dummy + 1; // (STRPTR) -- Pointer to a nul-terminated string name, to specify the filesystem object required. This may be relative to the current directory an assignment
2404   EX_StringName      = EX_Dummy + 1; //   or an absolute path.  DOS will internally perform a Lock() on the string provided, it will also Unlock() it again for you. Failure will occur if the object is already exclusively locked.
2405 
2406   EX_FileHandleInput = EX_Dummy + 2; // (BPTR) -- BCPL pointer to a FileHandle. Identify the parent directory from the stream pointed to by an open FileHandle.  DOS determins the parent directory of the
2407   EX_FileHandle      = EX_Dummy + 2; //   file by calling ParentOfFH() internally. The internal lock is UnLock'ed when the caller invokes ReleaseDirContext().
2408 
2409   EX_LockInput       = EX_Dummy + 3; // (BPTR) -- BCPL pointer to a Lock.
2410   EX_FileLockInput   = EX_Dummy + 3; //   Identify the filesystem object by this associated Lock.
2411   EX_DirLockInput    = EX_Dummy + 3; //   This lock is always passed directly throught to the filesystem.
2412   EX_FileLock        = EX_Dummy + 3;
2413   EX_DirLock         = EX_Dummy + 3;
2414 
2415  //The following are specific only for use with ObtainDirContext() when preparing a context for ExamineDir()
2416    EX_DataFields     = EX_Dummy + 10; // (LongWord) -- A bitmask to indicate which additional items of data are to be filled in your ExamineData structure, by the filesystem.
2417    EX_MatchFunc      = EX_Dummy + 11; // (PHook) -- Pointer to a custom Hook structure which has the h_Entry function pointer set to a filtering function. (Default = nil) for the internal filter to be used instead.
2418    EX_MatchString    = EX_Dummy + 12; // (STRPTR) -- A pointer to a pre-parsed pattern string. (Default=NULL) If this field is NULL then all entries will be returned from the internal filter function.
2419    EX_DoCurrentDir   = EX_Dummy + 13; // (BOOLEAN) -- Set TRUE if you wish DOS to make the reference to the specified directory the current directory.
2420                                       // This will allow for recursive directory scans to nominate the sub-directory by name, without having to specifying the full path. (Default=FALSE)
2421    EX_ResetContext   = EX_Dummy + 14; // (APTR) -- Pointer to a previous context for which a change of any parameter/s are required.  By passing in a previous context via this tag, the resources already allocated for the old context and
2422                                       // ExamineData nodes will be reused.  All necessary filesystem context information will also be reset to allow a new scan to begin again. (Default = nil)
2423 
2424 function DosObtain(): LongWord; syscall IDos 60;
2425 function DosRelease(): LongWord; syscall IDos 64;
2426 procedure DosExpunge(); syscall IDos 68;
2427 function DosClone(): PInterface; syscall IDos 72;
2428 function DosOpen(const Name: STRPTR; AccessMode: LongInt): BPTR; syscall IDos 76;
2429 procedure DOSClose(File_: BPTR); syscall IDos 80;
2430 function DosRead(File_: BPTR; Buffer: APTR; Length: LongInt): LongInt; syscall IDos 84;
2431 function DosWrite(File_: BPTR; Buffer: APTR; Length: LongInt): LongInt; syscall IDos 88;
2432 function DosInput: BPTR; syscall IDos 92;
2433 function DosOutput: BPTR; syscall IDos 96;
2434 function DosSeek(File_: BPTR; Position: LongInt; Offset: LongInt): LongInt; syscall IDos 100;
2435 function DosDeleteFile(const Name: STRPTR) : LongBool; overload; syscall IDos 104;  // compatibility to older platforms
2436 function DosDelete(const Name: STRPTR) : LongBool; overload; syscall IDos 104;
2437 function DosRename(const OldName: STRPTR; const NewName: STRPTR): LongBool; syscall IDos 108;
2438 function Lock(const Name: STRPTR; Type_: LongInt): BPTR; syscall IDos 112;
2439 procedure UnLock(Lock: BPTR); syscall IDos 116;
2440 function DupLock(Lock: BPTR): BPTR; syscall IDos 120;
2441 function Examine(Lock: BPTR; FileInfoBlock: PFileInfoBlock): LongBool; syscall IDos 124;
2442 function ExNext(Lock: BPTR; FileInfoBlock: PFileInfoBlock): LongBool; syscall IDos 128;
2443 function Info(Lock: BPTR; ParameterBlock: PInfoData): LongBool; syscall IDos 132;
2444 function CreateDir(const Name: STRPTR) : BPTR; syscall IDos 136;
2445 function CurrentDir(Lock: BPTR): BPTR; syscall IDos 140; // compatibility to older platforms
2446 function SetCurrentDir(Lock: BPTR): BPTR; syscall IDos 140;
2447 function IoErr: LongInt; syscall IDos 144;
2448 function CreateProc(const Name: STRPTR; Pri: LongInt; SegList: BPTR; StackSize: LongInt): PMsgPort; syscall IDos 148;
2449 // obsolete - procedure DosExit(ReturnCode: LongInt); syscall IDos 152;
2450 // obsolete - function LoadSeg(const Name: STRPTR): LongInt; syscall IDos 156;
2451 procedure UnLoadSeg(Seglist: BPTR); syscall IDos 160;
2452 // private - function DoPkt32(Port: PMsgPort; Action, Arg1, Arg2, Arg3, Arg4, Arg5, ): LongInt; syscall IDos 164;
2453 function LoadSeg(const Name: STRPTR): LongInt; syscall IDos 168;
2454 function DeviceProc(const Name: STRPTR): PMsgPort; syscall IDos 172;
2455 function SetComment(const Name: STRPTR; const Comment: STRPTR): LongBool; syscall IDos 176;
2456 function SetProtection(const Name: STRPTR; Protect: LongInt): LongBool; syscall IDos 180;
2457 function DateStamp(Date: PDateStamp): PDateStamp; syscall IDos 184;
2458 procedure DosDelay(TimeOut: LongInt); syscall IDos 188;
2459 function WaitForChar(File_: BPTR; TimeOut: LongInt): LongBool; syscall IDos 192;
2460 function ParentDir(Lock: BPTR): BPTR; syscall IDos 196;
2461 function IsInteractive(File_: BPTR): LongBool; syscall IDos 200;
2462 function Execute(const String_: STRPTR; File_: BPTR; File2: BPTR): LongBool; syscall IDos 204;
2463 function AllocDosObject(Type_: LongWord; const Tags: PTagItem): APTR; syscall IDos 208;
2464 function AllocDosObjectTagList(Type_: LongWord; const Tags: PTagItem): APTR; syscall IDos 212;
2465 // 216 AllocDosObjectTags
2466 procedure FreeDosObject(Type_: LongWord; Ptr: APTR); syscall IDos 220;
2467 function DoPkt(Port: PMsgPort; Action, Arg1, Arg2, Arg3, Arg4, Arg5: LongInt): LongInt; syscall IDos 224;
2468 function DoPkt0(Port: PMsgPort; Action: LongInt): LongInt; syscall IDos 228;
2469 function DoPkt1(Port: PMsgPort; Action, Arg1: LongInt): LongInt; syscall IDos 232;
2470 function DoPkt2(Port: PMsgPort; Action, Arg1, Arg2: LongInt): LongInt; syscall IDos 236;
2471 function DoPkt3(Port: PMsgPort; Action, Arg1, Arg2, Arg3: LongInt): LongInt; syscall IDos 240;
2472 function DoPkt4(Port: PMsgPort; Action, Arg1, Arg2, Arg3, Arg4: LongInt): LongInt; syscall IDos 244;
2473 procedure SendPkt(Dp: PDosPacket; Port: PMsgPort; ReplyPort: PMsgPort); syscall IDos 248;
2474 function WaitPkt: PDosPacket; syscall IDos 252;
2475 procedure ReplyPkt(Dp: PDosPacket; Res1, Res2: LongInt); syscall IDos 256;
2476 // 260 Reserved
2477 // obsolete LockRecord 264
2478 function LockRecords(RecArray: PRecordLock; TimeOut: LongWord): LongBool; syscall IDos 268;
2479 // obsolete UnLockRecord 272
2480 function UnLockRecords(RecArray: PRecordLock): LongBool; syscall IDos 276;
2481 function SelectInput(Fh: BPTR): BPTR; syscall IDos 280;
2482 function SelectOutput(Fh: BPTR): BPTR; syscall IDos 284;
2483 function FGetC(Fh: BPTR): LongInt; syscall IDos 288;
2484 function FPutC(Fh: BPTR; Ch: LongInt): LongInt; syscall IDos 292;
2485 function UnGetC(Fh: BPTR; Character: LongInt): LongInt; syscall IDos 296;
2486 function FRead(Fh: BPTR; Block: APTR; BlockLen: LongWord; Number: LongWord): LongWord; syscall IDos 300;
2487 function FWrite(Fh: BPTR; Block: APTR; BlockLen: LongWord; Number: LongWord): LongWord; syscall IDos 304;
2488 function FGets(Fh: BPTR; Buf: STRPTR; BufLen: LongWord): STRPTR; syscall IDos 308;
2489 function FPuts(Fh: BPTR; const Str: STRPTR): LongInt; syscall IDos 312;
2490 // obsolete VFWritef 316
2491 // obsolete FWritef 320
2492 function VFPrintf(Fh: BPTR; const Format: STRPTR; const ArgArray: APTR): LongInt; syscall IDos 324;
2493 // 328 FPrintf
2494 function DosFlush(Fh: BPTR): LongBool; syscall IDos 332; // compatibility to older platforms
2495 function FFlush(Fh: BPTR): LongBool; syscall IDos 332;
2496 function SetVBuf(Fh: BPTR; Buff: STRPTR; Type_: LongInt; Size: LongInt): LongBool; syscall IDos 336;
2497 function DupLockFromFH(Fh: BPTR): BPTR; syscall IDos 340;
2498 function OpenFromLock(Lock: BPTR): BPTR; syscall IDos 344;
2499 function ParentOfFH(Fh: BPTR): BPTR; syscall IDos 348;
2500 function ExamineFH(Fh: BPTR; Fib: PFileInfoBlock): LongBool; syscall IDos 352;
2501 function SetDate(const Name: STRPTR; const Date: PDateStamp): LongBool; syscall IDos 356;
2502 function NameFromLock(Lock: BPTR; Buffer: STRPTR; Len: LongInt): LongBool; syscall IDos 360;
2503 function NameFromFH(Fh: BPTR; Buffer: STRPTR; Len: LongInt): LongBool; syscall IDos 364;
2504 function SplitName(const Name: STRPTR; Seperator: LongWord; Buf: STRPTR; OldPos: LongInt; Size: LongInt): LongInt; syscall IDos 368;
2505 function SameLock(Lock1, Lock2: BPTR): LongInt; syscall IDos 372;
2506 function SetMode(Fh: BPTR; Mode: LongInt): LongBool; syscall IDos 376;
2507 function ExAll(Lock: BPTR; Buffer: PExAllData; Size, Data: LongInt; Control: PExAllControl): LongBool; syscall IDos 380;
2508 function ReadSoftLink(Port: PMsgPort; Lock: BPTR; const Path: STRPTR; Size: LongWord): LongInt; syscall IDos 384;
2509 function MakeLink(const Name: STRPTR; Dest: APTR; soft: LongInt): LongBool; syscall IDos 388;
2510 function ChangeMode(Type_ : LongInt; Fh: BPTR; NewMode: LongInt): LongBool; syscall IDos 392;
2511 function SetFileSize(Fh: BPTR; Pos: LongInt; Mode: LongInt): LongBool; syscall IDos 396;
2512 function SetIoErr(Result: LongInt): LongInt; syscall IDos 400;
2513 function Fault(Code: LongInt; const Header: STRPTR; Buffer: STRPTR; Len: LongInt): LongBool; syscall IDos 404;
2514 function PrintFault(Code: LongInt; const Header: STRPTR): LongBool; syscall IDos 408;
2515 function ErrorReport(Code, Type_: LongInt; Arg1: LongWord; Device: PMsgPort): LongBool; syscall IDos 412;
2516 // private Requester 416
2517 function Cli: PCommandLineInterface; syscall IDos 420;
2518 function CreateNewProc(const Tags: PTagItem): PProcess; syscall IDos 424;
2519 function CreateNewProcTagList(const Tags: PTagItem): PProcess; syscall IDos 428;
2520 // 432 CreateNewProcTags
2521 function RunCommand(Seg: BPTR; Stack: LongWord; const ParamPtr: STRPTR; ParamLen: LongInt): LongInt; syscall IDos 436;
2522 function GetConsolePort(): PMsgPort; syscall IDos 440;
2523 function SetConsolePort(const Port: PMsgPort): PMsgPort; syscall IDos 444;
2524 function GetFileSysPort(): PMsgPort; syscall IDos 448;
2525 function SetFileSysPort(const Port: PMsgPort): PMsgPort; syscall IDos 452;
2526 function GetArgStr: STRPTR; syscall IDos 456;
2527 function SetArgStr(const String_: STRPTR): STRPTR; syscall IDos 460;
2528 function FindCliProc(Num: LongWord): PProcess; syscall IDos 464;
2529 function MaxCli: LongWord; syscall IDos 468;
2530 function SetCliCurrentDirName(const Name: STRPTR): LongInt; syscall IDos 472;
2531 function GetCliCurrentDirName(Buf: STRPTR; Len: LongInt): LongInt; syscall IDos 476;
2532 function SetCliProgramName(const Name: STRPTR): LongInt; syscall IDos 480;
2533 function GetCliProgramName(Buf: STRPTR; Len: LongInt): LongInt; syscall IDos 484;
2534 function SetCliPrompt(const Name: STRPTR): LongInt; syscall IDos 488;
2535 function GetCliPrompt(Buf: STRPTR; Len: LongInt): LongInt; syscall IDos 492;
2536 function SetProgramDir(Lock: BPTR): BPTR; syscall IDos 496;
2537 function GetProgramDir(): BPTR; syscall IDos 500;
2538 function SystemTagList(const Command: STRPTR; const Tags: PTagItem): LongInt; syscall IDos 504;
2539 function DosSystem(const Command: STRPTR; const Tags: PTagItem): LongInt; syscall IDos 508;
2540 // 512 SystemTags
2541 function AssignLock(const Name: STRPTR; Lock: BPTR): LongBool; syscall IDos 516;
2542 function AssignLate(const Name: STRPTR; const Path: STRPTR): LongBool; syscall IDos 520;
2543 function AssignPath(const Name: STRPTR; const Path: STRPTR) : LongBool; syscall IDos 524;
2544 function AssignAdd(const Name: STRPTR; Lock: BPTR): LongBool; syscall IDos 528;
2545 function RemAssignList(const Name: STRPTR; Lock: BPTR): LongBool; syscall IDos 532;
2546 function GetDeviceProc(const Name: STRPTR; Dp: PDevProc): pDevProc; syscall IDos 536;
2547 procedure FreeDeviceProc(Dp: PDevProc); syscall IDos 540;
2548 function LockDosList(Flags: LongWord): PDosList; syscall IDos 544;
2549 procedure UnLockDosList(Flags: LongWord); syscall IDos 548;
2550 function AttemptLockDosList(Flags: LongWord): PDosList; syscall IDos 552;
2551 function RemDosEntry(DList: PDosList): LongBool; syscall IDos 556;
2552 function AddDosEntry(DList: PDosList): LongBool; syscall IDos 560;
2553 function FindDosEntry(const DList: PDosList; const Name: STRPTR; Flags: LongWord): PDosList; syscall IDos 564;
2554 function NextDosEntry(const DList: PDosList; Flags: LongWord) : PDosList; syscall IDos 568;
2555 function MakeDosEntry(const Name: STRPTR; Type_: LongInt): PDosList; syscall IDos 572;
2556 procedure FreeDosEntry(DList: PDosList); syscall IDos 576;
2557 function IsFileSystem(const Name: STRPTR): LongBool; syscall IDos 580;
2558 function Format(const Filesystem: STRPTR; const VolumeName: STRPTR; DosType: LongWord): LongBool; syscall IDos 584;
2559 function Relabel(const Drive: STRPTR; const NewName: STRPTR): LongBool; syscall IDos 588;
2560 function Inhibit(const Name: STRPTR; OnOff: LongInt): LongBool; syscall IDos 592;
2561 function AddBuffers(const Name: STRPTR; Number: LongInt): LongBool; syscall IDos 596;
2562 function CompareDates(const Date1: PDateStamp; const Date2: PDateStamp): LongInt; syscall IDos 600;
2563 function DosDateToStr(DateTime: _PDateTime): LongBool; syscall IDos 604;
2564 function DosStrToDate(DateTime: _PDateTime): LongBool; syscall IDos 608;
2565 // obsolete InternalLoadSeg 612
2566 // obsolete InternalUnLoadSeg 616
2567 // obsolete NewLoadSeg 620
2568 // obsolete NewLoadSegTagList 624
2569 // obsolete NewLoadSegTags 628
2570 function AddSegment(const Name: STRPTR; Seg: BPTR; Type_: LongInt): LongBool; syscall IDos 632;
2571 function FindSegment(const Name: STRPTR; const Seg: PDosResidentSeg; Sys: LongInt): PDosResidentSeg; syscall IDos 636;
2572 function RemSegment(Seg: PDosResidentSeg): LongBool; syscall IDos 640;
2573 function CheckSignal(Mask: LongWord): LongWord; syscall IDos 644;
2574 function ReadArgs(const ArgTemplate: STRPTR; Array_: PLongInt; Args: PRDArgs): PRDArgs; syscall IDos 648;
2575 function FindArg(const KeyWord: STRPTR; const ArgTemplate: STRPTR): LongInt; syscall IDos 652;
2576 function ReadItem(const Name: STRPTR; MaxChars: LongInt; CSource: PCSource): LongInt; syscall IDos 656;
2577 function StrToLong(const String_: STRPTR; var Value: LongInt): LongInt; syscall IDos 660;
2578 function MatchFirst(const Pat: STRPTR; Anchor: PAnchorPath): LongInt; syscall IDos 664;
2579 function MatchNext(Anchor: PAnchorPath): LongInt; syscall IDos 668;
2580 procedure MatchEnd(Anchor: PAnchorPath); syscall IDos 672;
2581 function ParsePattern(const Pat: STRPTR; Buf: STRPTR; BufLen: LongInt): LongInt; syscall IDos 676;
2582 function MatchPattern(const Pat: STRPTR; Str: STRPTR): LongBool; syscall IDos 680;
2583 // 684 reserved
2584 procedure FreeArgs(Args: PRDArgs); syscall IDos 688;
2585 // 692 reserved
2586 function FilePart(const Path: STRPTR): STRPTR; syscall IDos 696;
2587 function PathPart(const Path: STRPTR): STRPTR; syscall IDos 700;
2588 function AddPart(DestDirName: STRPTR; const FileName: STRPTR; Size: LongWord): LongBool; syscall IDos 704;
2589 function StartNotify(Notify: PNotifyRequest): LongBool; syscall IDos 708;
2590 procedure EndNotify(Notify: PNotifyRequest); syscall IDos 712;
2591 function SetVar(const Name: STRPTR; Buffer: STRPTR; Size: LongInt; Flags: LongWord): LongBool; syscall IDos 716;
2592 function GetVar(const Name: STRPTR; Buffer: STRPTR; Size: LongInt; Flags: LongInt): LongInt; syscall IDos 720;
2593 function DeleteVar(const Name: STRPTR; Flags: LongWord): LongBool; syscall IDos 724;
2594 function FindVar(const Name: STRPTR; Type_: LongWord): PLocalVar; syscall IDos 728;
2595 // private CLIInit 732
2596 function CliInitNewcli(Dp: PDosPacket): LongInt; syscall IDos 736;
2597 function CliInitRun(Dp: PDosPacket): LongInt; syscall IDos 740;
2598 function WriteChars(const Buf: STRPTR; BufLen: LongWord): LongInt; syscall IDos 744;
2599 function PutStr(const Str: STRPTR): LongBool; syscall IDos 748;
2600 function VPrintf(const Format: STRPTR; const ArgArray: PLongInt): LongInt; syscall IDos 752;
2601 // 756 Printf
2602 // 760 reserved
2603 function ParsePatternNoCase(const Pat: STRPTR; Buf: STRPTR; BufLen: LongInt): LongInt; syscall IDos 764;
2604 function MatchPatternNoCase(const Pat: STRPTR; Str: STRPTR): LongBool; syscall IDos 768;
2605 // private DosGetString 772
2606 function SameDevice(Lock1, Lock2: BPTR): LongBool; syscall IDos 776;
2607 procedure ExAllEnd(Lock: BPTR; Buffer: PExAllData; Size, data: LongInt; Control: PExAllControl); syscall IDos 780;
2608 function SetOwner(const Name: STRPTR; OwnerInfo: LongInt): LongBool; syscall IDos 784;
2609 function GetEntryData(): LongInt; syscall IDos 788;
2610 function ReadLineItem(Buffer: STRPTR; MaxChars: LongInt; TagList: PTagItem): LongInt; syscall IDos 792;
2611 // 796 ReadLineItemTags
2612 // private InternalRunCommand 800
2613 function GetCurrentDir(): BPTR; syscall IDos 804;
2614 function NonBlockingModifyDosEntry(Dl: PDosList; Mode: LongInt; Arg1, Arg2: APTR): LongInt; syscall IDos 808;
2615 function SecondsToDateStamp(Seconds: LongWord; Ds: PDateStamp): PDateStamp; syscall IDos 812;
2616 function DateStampToSeconds(const Ds: PDateStamp): LongWord; syscall IDos 816;
2617 function FixDateStamp(Ds: PDateStamp): LongInt; syscall IDos 820;
2618 function AddDates(To_: PDateStamp; const From_: PDateStamp): LongInt; syscall IDos 824;
2619 function SubtractDates(To_: PDateStamp; const From_: PDateStamp): LongInt; syscall IDos 828;
2620 function AddSegmentTagList(const Name: STRPTR; Type_: LongInt; const Tags: PTagItem): LongInt; syscall IDos 832;
2621 function ParseCapturePattern(const Pat: STRPTR; Dst: STRPTR; Length: LongInt; CaseSen: LongInt): LongInt; syscall IDos 836;
2622 function CapturePattern(const Pat: STRPTR; const Str: STRPTR; CaseSen: LongInt; var Cap: PCapturedExpression): LongInt; syscall IDos 840;
2623 procedure ReleaseCapturedExpressions(First: PCapturedExpression); syscall IDos 844;
2624 procedure FindTrackedAddress(const Address: APTR; Hook: PHook); syscall IDos 848;
2625 function TrackAddressList(const Name: STRPTR; Segment: BPTR; const ExtraInfo: APTR; ExtraInfoSize: LongInt; const Aas: PAddressAndSize; NumPairs: LongInt): LongInt; syscall IDos 852;
2626 function TrackSegmentList(const Name: STRPTR; Segment: BPTR; const ExtraInfo: APTR; ExtraInfoSize: LongInt): LongInt; syscall IDos 856;
2627 procedure UnTrackAddress(Address: APTR); syscall IDos 860;
2628 procedure UnTrackSegmentList(Segment: BPTR); syscall IDos 864;
2629 function GetExitData(): LongInt; syscall IDos 868;
2630 function PutErrStr(const str: STRPTR): LongInt; syscall IDos 872;
2631 function ErrorOutput(): BPTR; syscall IDos 876;
2632 function SelectErrorOutput(Fh: BPTR): BPTR; syscall IDos 880;
2633 function MountDevice(const Name: STRPTR; Type_: LongInt; Tags: PTagItem): LongInt; syscall IDos 884;
2634 // 888 MountDeviceTags
2635 function SetProcWindow(const Win: APTR): APTR; syscall IDos 892;
2636 function FindSegmentStackSize(Segment: BPTR): LongWord; syscall IDos 896;
2637 function CalculateSegmentChecksum(Segment: BPTR): LongWord; syscall IDos 900;
2638 function AllocSegList(const Entry: APTR; const Data: APTR; DataLen: LongWord; IdentKey: LongWord): BPTR; syscall IDos 904;
2639 function GetSegListInfo(SegList: BPTR; const Tags: PTagItem): LongInt; syscall IDos 908;
2640 // 912 GetSegListInfoTags
2641 function AddSegListTail(BSegList: BPTR; BSegNew: BPTR): LongInt; syscall IDos 916;
2642 function DevNameFromLock(Lock: BPTR; Buffer: STRPTR; BufLen: LongInt; Mode: LongInt): LongInt; syscall IDos 920;
2643 function GetProcMsgPort(const Proc: PProcess): PMsgPort; syscall IDos 924;
2644 function WaitForData(Stream: BPTR; DataDirection: LongInt; TimeOut: LongInt): LongInt; syscall IDos 928;
2645 function SetBlockingMode(Stream: BPTR; NewBlocking: LongInt): LongInt; syscall IDos 932;
2646 function SetCurrentCmdPathList(Pn: PPathNode): PPathNode; syscall IDos 936;
2647 function AllocateCmdPathList(FirstLock: BPTR): PPathNode; syscall IDos 940;
2648 procedure FreeCmdPathList(Pn: PPathNode); syscall IDos 944;
2649 function RemoveCmdPathNode(Pn: PPathNode; Lock: BPTR): PPathNode; syscall IDos 948;
2650 function AddCmdPathNode(Pn: PPathNode; Lock: BPTR; Where: LongInt): PPathNode; syscall IDos 952;
2651 function SearchCmdPathList(Pn: PPathNode; h: PHook; const Name: STRPTR; const Tags: PTagItem): LongInt; syscall IDos 956;
2652 // 960 SearchCmdPathListTags
2653 function ScanVars(Hook: PHook; Flags: LongWord; const UserData: APTR): LongInt; syscall IDos 964;
2654 function GetProcSegList(const Proc: PProcess; Flags: LongWord): BPTR; syscall IDos 968;
2655 function HexToLong(const String_: STRPTR; ValuePtr: PLongWord): LongInt; syscall IDos 972;
2656 function GetDeviceProcFlags(const Name: STRPTR; Odp: PDevProc; Flags: LongWord): PDevProc; syscall IDos 976;
2657 function DosControl(const Tags: PTagItem): LongInt; syscall IDos 980;
2658 // 984 DosControlTags
2659 function CreateDirTree(const Name: STRPTR): BPTR; syscall IDos 988;
2660 function NotifyVar(const Name: STRPTR; Hook: PHook; Flags: LongInt; const UserData: APTR): LongInt; syscall IDos 992;
2661 function GetDiskFileSystemData(const Name: STRPTR): PFileSystemData; syscall IDos 996;
2662 procedure FreeDiskFileSystemData(Fsd: PFileSystemData); syscall IDos 1000;
2663 function FOpen(const Name: STRPTR; Mode: LongInt; BufSize: LongInt): BPTR; syscall IDos 1004;
2664 function FClose(Scb: BPTR): LongInt; syscall IDos 1008;
2665 function FOpenFromLock(Lock: BPTR; BufSize: LongInt): BPTR; syscall IDos 1012;
2666 // 1016 reserved
2667 function TimedDosRequester(const Tags: PTagITem): LongInt; syscall IDos 1020;
2668 // 1024 TimedDosRequesterTags
2669 function RenameDosEntry(const DList: PDosList; const NewName: STRPTR): LongInt; syscall IDos 1028;
2670 function DismountDevice(const Name: STRPTR; Flags: LongWord; Reserved: APTR): LongInt; syscall IDos 1032;
2671 function DupFileHandle(Scb: BPTR): BPTR; syscall IDos 1036;
2672 function DevNameFromFH(Scb: BPTR; Buffer: STRPTR; BufLen: LongInt; Mode: LongInt): LongInt; syscall IDos 1040;
2673 function AssignAddToList(const Name: STRPTR; Lock: BPTR; EndPos: LongInt): LongInt; syscall IDos 1044;
2674 function SetFileHandleAttr(Fh: BPTR; const Tags: PTagItem): LongInt; syscall IDos 1048;
2675 // 1052 SetFileHandleAttrTags
2676 function FileSystemAttr(const Tags: PTagItem): LongInt; syscall IDos 1056;
2677 // 1060 FileSystemAttrTags
2678 function FReadLine(Fh: BPTR; Frld: PFReadLineData): LongInt; syscall IDos 1064;
2679 function CopyStringBSTRToC(BSrc: BSTR; Dst: STRPTR; Size: LongWord): LongWord; syscall IDos 1068;
2680 function CopyStringCToBSTR(const Src: STRPTR; BDest: BSTR; Size: LongWord): LongWord; syscall IDos 1072;
2681 function GetFilePosition(Fh: BPTR): Int64; syscall IDos 1076;
2682 function ChangeFilePosition(Fh: BPTR; Position: Int64; Offset: LongInt): LongInt; syscall IDos 1080;
2683 function ChangeFileSize(Fh: BPTR; Pos: Int64; Mode: LongInt): LongInt; syscall IDos 1084;
2684 function GetFileSize(Fh: BPTR): Int64; syscall IDos 1088;
2685 // 1092 reserved
2686 // 1096 Private DoPkt64
2687 // 1100 reserved
2688 // 1104 reserved
2689 // 1108 reserved
2690 function ProcessScan(Hook: PHook; const UserData: APTR; Reserved: LongWord): LongInt; syscall IDos 1112;
2691 function NotifyDosListChange(Process: PProcess; SignalNum, Reserved: LongWord): LongInt; syscall IDos 1116;
2692 function NotifyProcListChange(Process: PProcess; SignalNum, Reserved: LongWord): LongInt; syscall IDos 1120;
2693 function GetDiskInfo(const Tags: PTagItem): LongInt; syscall IDos 1124;
2694 // 1128 GetDiskInfoTags
2695 function WriteProtectVolume(const Name: STRPTR; OnOff: LongInt; PassKey: LongWord; Reserved: LongWord): LongInt; syscall IDos 1132;
2696 function ExamineObject(const CTags: PTagItem): PExamineData; syscall IDos 1136;
2697 // 1140 ExamineObjectTags
2698 function ExamineDir(Context: APTR): PExamineData; syscall IDos 1144;
2699 function ObtainDirContext(const CTags: PTagItem): APTR; syscall IDos 1148;
2700 // 1152 ObtainDirContextTags
2701 procedure ReleaseDirContext(Contx: APTR); syscall IDos 1156;
2702 function GetOwnerInfo(const Tags: PTagItem): APTR; syscall IDos 1160;
2703 // 1164 GetOwnerInfoTags
2704 function SetOwnerInfo(const Tags: PTagItem): LongInt; syscall IDos 1168;
2705 // 1172 SetOwnerInfoTags
2706 function LockTagList(const Tags: PTagItem): BPTR; syscall IDos 1176;
2707 // 1180 LockTags
2708 function GetPID(Process: PProcess): LongWord; syscall IDos 1184;
2709 function FlushVolume(const Name: STRPTR): LongInt; syscall IDos 1188;
2710 // 1192 obsolete ConsoleData
2711 // 1196 obsolete ConsoleDataTags
2712 procedure ReleaseConsoleData(Data: PConsoleWindowData); syscall IDos 1200;
2713 function Serialize(const Name: STRPTR): LongInt; syscall IDos 1204;
2714 function NameFromPort(Port: PMsgPort; Buffer: STRPTR; BufLen: LongInt; AddColon: LongInt): LongInt; syscall IDos 1208;
2715 function DevNameFromPort(Port: PMsgPort; Buffer: STRPTR; BufLen: LongInt; AddColon: LongInt): LongInt; syscall IDos 1212;
2716 function SameFH(Scb1, Scb2: BPTR): LongInt; syscall IDos 1216;
2717 function LockRecord(Fh: BPTR; Offset, Length: Int64; Mode: LongWord; TimeOut: LongWord): LongBool; syscall IDos 1220;
2718 function UnLockRecord(Fh: BPTR; Offset, Length: Int64): LongBool; syscall IDos 1224;
2719 function IsFileSystemPort(Port: PMsgPort): LongBool; syscall IDos 1228;
2720 function InhibitPort(Port: PMsgPort; State: LongInt): LongBool; syscall IDos 1232;
2721 function FormatPort(Port: PMsgPort; const VolumeName: STRPTR; DosType: LongInt): LongBool; syscall IDos 1236;
2722 function SerializePort(Port: PMsgPort): LongBool; syscall IDos 1240;
2723 function FlushVolumePort(Port: PMsgPort): LongBool; syscall IDos 1244;
2724 function FileHandleScan(const Hook: PHook; const UserData: APTR; Reserved: LongWord): LongInt; syscall IDos 1248;
2725 function GetFileSystemVectorPort(Port: PMsgPort; MinVersion: LongWord): PFileSystemVectorPort; syscall IDos 1252;
2726 function ResolvePath(Port: PMsgPort; const Path: STRPTR; InLock: BPTR; Out_: STRPTR; OutLen: LongWord; var OutDir: BPTR; var SLCount: LongWord): LongInt; syscall IDos 1256;
2727 function WriteProtectVolumePort(Port: PMsgPort; OnOff: LongInt; PassKey: LongWord; Reserved: LongInt): LongInt; syscall IDos 1260;
2728 // 1264 - 1280 Reserved
2729 
2730 
2731 function BADDR(bval :BPTR): POINTER;
2732 function MKBADDR(adr: Pointer): BPTR;
2733 
2734 // var args version
2735 function AllocDosObjectTags(type_ : LongWord; Const argv : Array of PtrUInt) : POINTER;
2736 function CreateNewProcTags(Const argv : Array of PtrUInt) : pProcess;
2737 function SystemTags(command : PChar; Const argv : Array of PtrUInt) : LongInt;
2738 
2739 
2740 
2741 implementation
2742 
2743 
2744 function BADDR(bval : BPTR): POINTER; inline;
2745 BEGIN
2746   BADDR := POINTER( bval shl 2);
2747 END;
2748 
2749 function MKBADDR(adr : POINTER): BPTR; inline;
2750 BEGIN
2751   MKBADDR := BPTR(LongWord(adr) shr 2);
2752 END;
2753 
2754 function AllocDosObjectTags(type_ : LongWord; Const argv : Array of PtrUInt) : POINTER;
2755 begin
2756   AllocDosObjectTags := AllocDosObjectTagList(type_, @argv);
2757 end;
2758 
2759 function CreateNewProcTags(Const argv : Array of PtrUInt) : pProcess;
2760 begin
2761   CreateNewProcTags := CreateNewProcTagList(@argv);
2762 end;
2763 
2764 function SystemTags(command : PChar; Const argv : Array of PtrUInt) : LongInt;
2765 begin
2766   SystemTags := SystemTagList(command, @argv);
2767 end;
2768 
2769 end.
2770 
2771 
2772