1 {
2 This file is part of the Free Pascal run time library.
3 Copyright (c) 2004 Karoly Balogh for Genesi S.a.r.l. <www.genesi.lu>
4
5 dos.library interface unit for MorphOS/PowerPC
6
7 MorphOS port was done on a free Pegasos II/G4 machine
8 provided by Genesi S.a.r.l. <www.genesi.lu>
9
10 See the file COPYING.FPC, included in this distribution,
11 for details about the copyright.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
17 **********************************************************************}
18 {$INLINE ON}
19 {$PACKRECORDS 2}
20
21 unit AmigaDOS;
22
23 interface
24
25 uses Exec, Timer;
26
27 var
28 DosBase: Pointer;
29
30
31 { * dos global definitions (V50)
32 *********************************************************************
33 * }
34
35
36 const
37 DOSNAME = 'dos.library';
38
39 const
40 DOSTRUE = -1;
41 DOSFALSE = 0;
42
43 const
44 MODE_OLDFILE = 1005;
45 MODE_NEWFILE = 1006;
46 MODE_READWRITE = 1004;
47
48 const
49 OFFSET_BEGINNING = -1;
50 OFFSET_CURRENT = 0;
51 OFFSET_END = 1;
52 OFFSET_BEGINING = OFFSET_BEGINNING; { * Typo fix * }
53
54 const
55 BITSPERBYTE = 8;
56 BYTESPERLONG = 4;
57 BITSPERLONG = 32;
58 _MAXINT = $7FFFFFFF;
59 _MININT = $80000000;
60
61 const
62 SHARED_LOCK = -2;
63 ACCESS_READ = -2;
64 EXCLUSIVE_LOCK = -1;
65 ACCESS_WRITE = -1;
66
67
68 type
69 PDateStamp = ^TDateStamp;
70 TDateStamp = packed record
71 ds_Days : LongInt;
72 ds_Minute: LongInt;
73 ds_Tick : LongInt;
74 end;
75
76 const
77 TICKS_PER_SECOND = 50;
78
79
80 type
81 PFileInfoBlock = ^TFileInfoBlock;
82 TFileInfoBlock = packed record
83 fib_DiskKey : LongInt;
84 fib_DirEntryType: LongInt;
85 fib_FileName : Array[0..107] Of Char;
86 fib_Protection : LongInt;
87 fib_EntryType : LongInt;
88 fib_Size : LongInt;
89 fib_NumBlocks : LongInt;
90 fib_Date : TDateStamp;
91 fib_Comment : Array[0..79] Of Char;
92
93 fib_OwnerUID : Word;
94 fib_OwnerGID : Word;
95 case SmallInt of
96 0: (
97 fib_Reserved : Array[0..31] Of Char;
98 );
99 1: (
100 // 64bit DOS extensions V51 filled by Examine64, ExNext64, ExamineFH64 with ACTION_EXAMINE_OBJECT64
101 fib_Size64: QWord;
102 fib_NumBlocks64: QWord;
103 );
104 end;
105
106 const
107 FIBB_OTR_READ = 15;
108 FIBB_OTR_WRITE = 14;
109 FIBB_OTR_EXECUTE = 13;
110 FIBB_OTR_DELETE = 12;
111 FIBB_GRP_READ = 11;
112 FIBB_GRP_WRITE = 10;
113 FIBB_GRP_EXECUTE = 9;
114 FIBB_GRP_DELETE = 8;
115
116 FIBB_SCRIPT = 6;
117 FIBB_PURE = 5;
118 FIBB_ARCHIVE = 4;
119 FIBB_READ = 3;
120 FIBB_WRITE = 2;
121 FIBB_EXECUTE = 1;
122 FIBB_DELETE = 0;
123
124 const
125 FIBF_OTR_READ = 1 Shl FIBB_OTR_READ;
126 FIBF_OTR_WRITE = 1 Shl FIBB_OTR_WRITE;
127 FIBF_OTR_EXECUTE = 1 Shl FIBB_OTR_EXECUTE;
128 FIBF_OTR_DELETE = 1 Shl FIBB_OTR_DELETE;
129 FIBF_GRP_READ = 1 Shl FIBB_GRP_READ;
130 FIBF_GRP_WRITE = 1 Shl FIBB_GRP_WRITE;
131 FIBF_GRP_EXECUTE = 1 Shl FIBB_GRP_EXECUTE;
132 FIBF_GRP_DELETE = 1 Shl FIBB_GRP_DELETE;
133
134 FIBF_SCRIPT = 1 Shl FIBB_SCRIPT;
135 FIBF_PURE = 1 Shl FIBB_PURE;
136 FIBF_ARCHIVE = 1 Shl FIBB_ARCHIVE;
137 FIBF_READ = 1 Shl FIBB_READ;
138 FIBF_WRITE = 1 Shl FIBB_WRITE;
139 FIBF_EXECUTE = 1 Shl FIBB_EXECUTE;
140 FIBF_DELETE = 1 Shl FIBB_DELETE;
141
142 const
143 FAULT_MAX = 82;
144
145 type
146 BPTR = LongInt;
147 BSTR = LongInt;
148
149 type
150 PInfoData = ^TInfoData;
151 TInfoData = packed record
152 id_NumSoftErrors: LongInt;
153 id_UnitNumber : LongInt;
154 id_DiskState : LongInt;
155 id_NumBlocks : LongInt;
156 id_NumBlocksUsed: LongInt;
157 id_BytesPerBlock: LongInt;
158 id_DiskType : LongInt;
159 id_VolumeNode : BPTR;
160 id_InUse : LongInt;
161 end;
162
163
164 const
165 ID_WRITE_PROTECTED = 80;
166 ID_VALIDATING = 81;
167 ID_VALIDATED = 82;
168
169 ID_NO_DISK_PRESENT = -1;
170 ID_UNREADABLE_DISK = $42414400;
171 ID_DOS_DISK = $444F5300;
172 ID_FFS_DISK = $444F5301;
173 ID_INTER_DOS_DISK = $444F5302;
174 ID_INTER_FFS_DISK = $444F5303;
175 ID_FASTDIR_DOS_DISK = $444F5304;
176 ID_FASTDIR_FFS_DISK = $444F5305;
177 ID_LNFS_DOS_DISK = $444F5306;
178 ID_LNFS_FFS_DISK = $444F5307;
179 ID_NOT_REALLY_DOS = $4E444F53;
180 ID_KICKSTART_DISK = $4B49434B;
181 ID_MSDOS_DISK = $4d534400;
182 ID_CDFS_DISK = $43444653; // CDFS - Built-in CDROM
183 ID_CDROM_ISO_DISK = $43443031; // CD01
184 ID_CDROM_HSF_DISK = $43443030; // CD00
185 ID_CDROM_CDDA_DISK = $43444441; // CDDA
186 ID_SFS_DISK = $53465300; // SFS#0
187
188 const
189 ERROR_NO_FREE_STORE = 103;
190 ERROR_TASK_TABLE_FULL = 105;
191 ERROR_BAD_TEMPLATE = 114;
192 ERROR_BAD_NUMBER = 115;
193 ERROR_REQUIRED_ARG_MISSING = 116;
194 ERROR_KEY_NEEDS_ARG = 117;
195 ERROR_TOO_MANY_ARGS = 118;
196 ERROR_UNMATCHED_QUOTES = 119;
197 ERROR_LINE_TOO_LONG = 120;
198 ERROR_FILE_NOT_OBJECT = 121;
199 ERROR_INVALID_RESIDENT_LIBRARY = 122;
200 ERROR_NO_DEFAULT_DIR = 201;
201 ERROR_OBJECT_IN_USE = 202;
202 ERROR_OBJECT_EXISTS = 203;
203 ERROR_DIR_NOT_FOUND = 204;
204 ERROR_OBJECT_NOT_FOUND = 205;
205 ERROR_BAD_STREAM_NAME = 206;
206 ERROR_OBJECT_TOO_LARGE = 207;
207 ERROR_ACTION_NOT_KNOWN = 209;
208 ERROR_INVALID_COMPONENT_NAME = 210;
209 ERROR_INVALID_LOCK = 211;
210 ERROR_OBJECT_WRONG_TYPE = 212;
211 ERROR_DISK_NOT_VALIDATED = 213;
212 ERROR_DISK_WRITE_PROTECTED = 214;
213 ERROR_RENAME_ACROSS_DEVICES = 215;
214 ERROR_DIRECTORY_NOT_EMPTY = 216;
215 ERROR_TOO_MANY_LEVELS = 217;
216 ERROR_DEVICE_NOT_MOUNTED = 218;
217 ERROR_SEEK_ERROR = 219;
218 ERROR_COMMENT_TOO_BIG = 220;
219 ERROR_DISK_FULL = 221;
220 ERROR_DELETE_PROTECTED = 222;
221 ERROR_WRITE_PROTECTED = 223;
222 ERROR_READ_PROTECTED = 224;
223 ERROR_NOT_A_DOS_DISK = 225;
224 ERROR_NO_DISK = 226;
225 ERROR_NO_MORE_ENTRIES = 232;
226
227 ERROR_IS_SOFT_LINK = 233;
228 ERROR_OBJECT_LINKED = 234;
229 ERROR_BAD_HUNK = 235;
230 ERROR_NOT_IMPLEMENTED = 236;
231 ERROR_RECORD_NOT_LOCKED = 240;
232 ERROR_LOCK_COLLISION = 241;
233 ERROR_LOCK_TIMEOUT = 242;
234 ERROR_UNLOCK_ERROR = 243;
235
236 const
237 RETURN_OK = 0;
238 RETURN_WARN = 5;
239 RETURN_ERROR = 10;
240 RETURN_FAIL = 20;
241
242 const
243 SIGBREAKB_CTRL_C = 12;
244 SIGBREAKB_CTRL_D = 13;
245 SIGBREAKB_CTRL_E = 14;
246 SIGBREAKB_CTRL_F = 15;
247
248 SIGBREAKF_CTRL_C = 1 Shl SIGBREAKB_CTRL_C;
249 SIGBREAKF_CTRL_D = 1 Shl SIGBREAKB_CTRL_D;
250 SIGBREAKF_CTRL_E = 1 Shl SIGBREAKB_CTRL_E;
251 SIGBREAKF_CTRL_F = 1 Shl SIGBREAKB_CTRL_F;
252
253 const
254 LOCK_DIFFERENT = -1;
255 LOCK_SAME = 0;
256 LOCK_SAME_VOLUME = 1;
257 LOCK_SAME_HANDLER = LOCK_SAME_VOLUME;
258
259 const
260 CHANGE_LOCK = 0;
261 CHANGE_FH = 1;
262
263 const
264 LINK_HARD = 0;
265 LINK_SOFT = 1;
266
267 const
268 ITEM_EQUAL = -2;
269 ITEM_ERROR = -1;
270 ITEM_NOTHING = 0;
271 ITEM_UNQUOTED = 1;
272 ITEM_QUOTED = 2;
273
274 // AllocDosObject(), FreeDosObject() Types
275 const
276 DOS_FILEHANDLE = 0;
277 DOS_EXALLCONTROL = 1;
278 DOS_FIB = 2;
279 DOS_STDPKT = 3;
280 DOS_CLI = 4;
281 DOS_RDARGS = 5;
282 // V51
283 DOS_DEVICENODE = 6;
284 DOS_FSCONTEXT = 7;
285 DOS_VOLUMENODE = 8;
286 DOS_ASSIGNNODE = 9;
287
288 { * dos date/time definitions
289 *********************************************************************
290 * }
291
292
293 type
294 { * Required to avoid conflict with default types * }
295 _PDateTime = ^_TDateTime;
296 _TDateTime = packed record
297 dat_Stamp : TDateStamp;
298 dat_Format : Byte;
299 dat_Flags : Byte;
300 dat_StrDay : PChar;
301 dat_StrDate: PChar;
302 dat_StrTime: PChar;
303 end;
304
305 const
306 LEN_DATSTRING = 16;
307
308 const
309 DTB_SUBST = 0;
310 DTF_SUBST = 1 Shl DTB_SUBST;
311 DTB_FUTURE = 1;
312 DTF_FUTURE = 1 Shl DTB_FUTURE;
313
314 const
315 FORMAT_DOS = 0;
316 FORMAT_INT = 1;
317 FORMAT_USA = 2;
318 FORMAT_CDN = 3;
319 FORMAT_MAX = FORMAT_CDN;
320 FORMAT_DEF = 4;
321
322
323
324 { * dos extended structures definitions
325 *********************************************************************
326 * }
327
328
329 type
330 PProcess = ^TProcess;
331 TProcess = packed record
332 pr_Task : TTask;
333 pr_MsgPort : TMsgPort;
334 pr_Pad : Word;
335 pr_SegList : BPTR;
336 pr_StackSize : LongInt; { 68k stacksize! }
337 pr_GlobVec : APTR;
338 pr_TaskNum : LongInt;
339 pr_StackBase : BPTR;
340 pr_Result2 : LongInt;
341 pr_CurrentDir : BPTR;
342 pr_CIS : BPTR;
343 pr_COS : BPTR;
344 pr_ConsoleTask : APTR;
345 pr_FileSystemTask: APTR;
346 pr_CLI : BPTR;
347 pr_ReturnAddr : APTR;
348 pr_PktWait : APTR;
349 pr_WindowPtr : APTR;
350 pr_HomeDir : BPTR;
351 pr_Flags : LongInt;
352 pr_ExitCode : Pointer; { Procedure }
353 pr_ExitData : LongInt;
354 pr_Arguments : STRPTR;
355 pr_LocalVars : TMinList;
356 pr_ShellPrivate : LongWord;
357 pr_CES : BPTR;
358 end;
359
360 const
361 PRB_FREESEGLIST = 0;
362 PRF_FREESEGLIST = 1 Shl PRB_FREESEGLIST;
363
364 PRB_FREECURRDIR = 1;
365 PRF_FREECURRDIR = 1 Shl PRB_FREECURRDIR;
366
367 PRB_FREECLI = 2;
368 PRF_FREECLI = 1 Shl PRB_FREECLI;
369
370 PRB_CLOSEINPUT = 3;
371 PRF_CLOSEINPUT = 1 Shl PRB_CLOSEINPUT;
372
373 PRB_CLOSEOUTPUT = 4;
374 PRF_CLOSEOUTPUT = 1 Shl PRB_CLOSEOUTPUT;
375
376 PRB_FREEARGS = 5;
377 PRF_FREEARGS = 1 Shl PRB_FREEARGS;
378
379 PRB_CLOSEERROR = 6;
380 PRF_CLOSEERROR = 1 Shl PRB_CLOSEERROR;
381
382
383 type
384 PFileHandle = ^TFileHandle;
385 TFileHandle = packed record
386 case Byte of
387 0: (
388 fh_Link : LongWord;
389 fh_Port : LongInt;
390 );
391 1: (
392 fh_Flags : LongWord;
393 fh_Interactive: LongInt;
394 fh_Type : PMsgPort;
395 fh_Buf : LongInt;
396 fh_Pos : LongInt;
397 fh_End : LongInt;
398 fh_Func1 : LongInt;
399 fh_Func2 : LongInt;
400 fh_Func3 : LongInt;
401 fh_Arg1 : LongInt;
402 fh_Arg2 : LongInt;
403 { *** V50 MorphOS *** }
404 fh_BufSize : LongInt;
405 fh_OrigBuf : LongInt;
406 );
407 end;
408
409 type
410 PDOSPacket = ^TDOSPacket;
411 TDOSPacket = packed record
412 dp_Link: PMessage;
413 dp_Port: PMsgPort;
414 case Byte of
415 0 : ( dp_Action : Longint;
416 dp_Status : Longint;
417 dp_Status2: Longint;
418 dp_BufAddr: Longint;
419 );
420 1 : ( dp_Type: Longint;
421 dp_Res1: Longint;
422 dp_Res2: Longint;
423 dp_Arg1: Longint;
424 dp_Arg2: Longint;
425 dp_Arg3: Longint;
426 dp_Arg4: Longint;
427 dp_Arg5: Longint;
428 dp_Arg6: Longint;
429 dp_Arg7: Longint;
430 );
431 end;
432
433 type
434 PStandardPacket = ^TStandardPacket;
435 TStandardPacket = packed record
436 sp_Msg: TMessage;
437 sp_Pkt: TDOSPacket;
438 end;
439
440
441 const
442 ACTION_NIL = 0;
443 ACTION_STARTUP = 0;
444 ACTION_GET_BLOCK = 2; { *** OBSOLETE *** }
445 ACTION_SET_MAP = 4;
446 ACTION_DIE = 5;
447 ACTION_EVENT = 6;
448 ACTION_CURRENT_VOLUME = 7;
449 ACTION_LOCATE_OBJECT = 8;
450 ACTION_RENAME_DISK = 9;
451 ACTION_WRITE = $57; // 'W'
452 ACTION_READ = $52; // 'R'
453 ACTION_FREE_LOCK = 15;
454 ACTION_DELETE_OBJECT = 16;
455 ACTION_RENAME_OBJECT = 17;
456 ACTION_MORE_CACHE = 18;
457 ACTION_COPY_DIR = 19;
458 ACTION_WAIT_CHAR = 20;
459 ACTION_SET_PROTECT = 21;
460 ACTION_CREATE_DIR = 22;
461 ACTION_EXAMINE_OBJECT = 23;
462 ACTION_EXAMINE_NEXT = 24;
463 ACTION_DISK_INFO = 25;
464 ACTION_INFO = 26;
465 ACTION_FLUSH = 27;
466 ACTION_SET_COMMENT = 28;
467 ACTION_PARENT = 29;
468 ACTION_TIMER = 30;
469 ACTION_INHIBIT = 31;
470 ACTION_DISK_TYPE = 32;
471 ACTION_DISK_CHANGE = 33;
472 ACTION_SET_DATE = 34;
473
474 ACTION_SAME_LOCK = 40;
475
476 ACTION_SCREEN_MODE = 994;
477
478 ACTION_CHANGE_SIGNAL = 995;
479
480 ACTION_READ_RETURN = 1001;
481 ACTION_WRITE_RETURN = 1002;
482 ACTION_SEEK = 1008;
483 ACTION_FINDUPDATE = 1004;
484 ACTION_FINDINPUT = 1005;
485 ACTION_FINDOUTPUT = 1006;
486 ACTION_END = 1007;
487
488 ACTION_FORMAT = 1020;
489 ACTION_MAKE_LINK = 1021;
490
491 ACTION_SET_FILE_SIZE = 1022;
492 ACTION_WRITE_PROTECT = 1023;
493
494 ACTION_READ_LINK = 1024;
495 ACTION_FH_FROM_LOCK = 1026;
496 ACTION_IS_FILESYSTEM = 1027;
497 ACTION_CHANGE_MODE = 1028;
498
499 ACTION_COPY_DIR_FH = 1030;
500 ACTION_PARENT_FH = 1031;
501 ACTION_EXAMINE_ALL = 1033;
502 ACTION_EXAMINE_FH = 1034;
503
504 ACTION_EXAMINE_ALL_END = 1035;
505 ACTION_SET_OWNER = 1036;
506
507 ACTION_LOCK_RECORD = 2008;
508 ACTION_FREE_RECORD = 2009;
509
510 ACTION_ADD_NOTIFY = 4097;
511 ACTION_REMOVE_NOTIFY = 4098;
512
513 ACTION_SERIALIZE_DISK = 4200;
514
515 ACTION_GET_DISK_FSSM = 4201;
516 ACTION_FREE_DISK_FSSM = 4202;
517
518 // 64bit DOS extensions - V51
519 ACTION_SEEK64 = 26400; // dp_Arg1 - LongInt fh_Arg1, dp_Arg2 - PInt64 position, dp_Arg3 - LongInt mode, dp_Arg4 - PInt64 oldposition
520 ACTION_SET_FILE_SIZE64 = 26401; // dp_Arg1 - LongInt fh_Arg1, dp_Arg2 - PInt64 position, dp_Arg3 - LongInt mode, dp_Arg4 - PInt64 newsize
521 ACTION_LOCK_RECORD64 = 26402; // dp_Arg1 - LongInt fh_Arg1, dp_Arg2 - PQWord offset, dp_Arg3 - PQWord length, dp_Arg4 - LongWord mode, dp_Arg5 - LongWord timeout
522 ACTION_FREE_RECORD64 = 26403; // dp_Arg1 - LongInt fh_Arg1, dp_Arg2 - PQWord offset, dp_Arg3 - PQWord length
523 ACTION_RESERVED_1 = 26404; // reserved, do not use
524 ACTION_RESERVED_2 = 26405; // reserved, do not use
525 ACTION_NEW_READ_LINK = 26406; // dp_Arg1 - BPTR lock, lock on directory that dp_Arg2 is relative to, dp_Arg2 - UBYTE *name, path and name of link (relative to dp_Arg1), dp_Arg3 - PByte buffer, dp_Arg4 - LongInt buffersize
526 ACTION_QUERY_ATTR = 26407; // dp_Arg1 - LongInt attr, which attribute you want to know about, dp_Arg2 - Pointer storage, memory to hold the return value, dp_Arg3 - LongInt storagesize, size of storage reserved for,
527 ACTION_EXAMINE_OBJECT64 = 26408; // dp_Arg1 - BPTR to lock to examine, dp_Arg2 - BPTR to TFileInfoBlock
528 ACTION_EXAMINE_NEXT64 = 26409; // dp_Arg1 - BPTR to lock to examine, dp_Arg2 - BPTR to TFileInfoBlock
529 ACTION_EXAMINE_FH64 = 26410; // dp_Arg1 - LongInt fh_Arg1, dp_Arg2 - BPTR to TFileInfoBlock
530
531 FQA_MaxFileNameLength = 0; // LongInt - Return the maximum length of a file name (in characters), excluding terminating '\0' char.
532 FQA_MaxVolumeNameLength = 1; // LongInt - Return the maximum length of the volume name (in characters), excluding terminating '\0' char
533 FQA_MaxFileSize = 2; // Int64 - Returns maximum size of the file the filesystem supports.
534 FQA_IsCaseSensitive = 3; // LongInt - If the filesystem names are case sensitive, this attribute must return DOSTrue.
535 FQA_DeviceType = 4; // LongInt - Return the type of the medium the filesystem is using, if known. Value is one of DG_*
536 FQA_ReservedAttr1 = 5; // reserved - do not use
537 FQA_NumBlocks = 6; // Int64 - Return the total number of blocks on the filesystem.
538 FQA_NumBlocksUsed = 7; // Int64 - Return the total number of used blocks on the filesystem.
539
540 // Packets to get and set filesystem options runtime
541 ACTION_GET_PREFS_TEMPLATE = 26500; // arg1 - STRPTR dest_buff, arg2 - LongInt buffer_size
542 ACTION_GET_CURRENT_PREFS = 26501; // arg1 - STRPTR dest_buff, arg2 - LongInt buffer_size
543 ACTION_SET_PREFS = 26502; // arg1 - STRPTR prefs_string
544
545 type
546 PErrorString = ^TErrorString;
547 TErrorString = packed record
548 estr_Nums: PLongInt;
549 estr_Strings: PByte;
550 end;
551
552 type
553 PRootNode = ^TRootNode;
554 TRootNode = packed record
555 rn_TaskArray : BPTR;
556 rn_ConsoleSegment : BPTR;
557 rn_Time : TDateStamp;
558 rn_RestartSeg : LongInt;
559 rn_Info : BPTR;
560 rn_FileHandlerSegment: BPTR;
561 rn_CliList : TMinList;
562 rn_BootProc : PMsgPort;
563 rn_ShellSegment : BPTR;
564 rn_Flags : LongInt;
565 end;
566
567 type
568 PDOSLibrary = ^TDOSLibrary;
569 TDOSLibrary = packed record
570 dl_Lib : TLibrary;
571 dl_Root : PRootNode;
572 dl_GU : APTR;
573 dl_A2 : LongInt;
574 dl_A5 : LongInt;
575 dl_A6 : LongInt;
576 dl_Errors : PErrorString;
577 dl_TimeReq : PTimeRequest;
578 dl_UtilityBase : PLibrary;
579 dl_IntuitionBase: PLibrary;
580 end;
581
582
583 const
584 RNB_WILDSTAR = 24;
585 RNF_WILDSTAR = 1 Shl RNB_WILDSTAR;
586
587 RNB_PRIVATE1 = 1;
588 RNF_PRIVATE1 = 1 Shl RNB_PRIVATE1;
589
590
591 type
592 PCliProcList = ^TCliProcList;
593 TCliProcList = packed record
594 cpl_Node : TMinNode;
595 cpl_First: LongInt;
596 cpl_Array: Array[0..0] Of PMsgPort;
597 end;
598
599 type
600 PDOSInfo = ^TDOSInfo;
601 TDOSInfo = packed record
602 case Byte of
603 0 : ( di_ResList: BPTR;
604 );
605 1 : ( di_McName : BPTR;
606 di_DevInfo : BPTR;
607 di_Devices : BPTR;
608 di_Handlers : BPTR;
609 di_NetHand : APTR;
610 di_DevLock : TSignalSemaphore;
611 di_EntryLock : TSignalSemaphore;
612 di_DeleteLock: TSignalSemaphore;
613 );
614 end;
615
616 type
617 PSegment = ^TSegment;
618 TSegment = packed record
619 seg_Next : BPTR;
620 seg_UC : LongInt;
621 seg_Seg : BPTR;
622 seg_Name : Array[0..3] Of Byte;
623 { * seg_Name continues * }
624 end;
625
626
627 const
628 CMD_SYSTEM = -1;
629 CMD_INTERNAL = -2;
630 CMD_NOTLOADED = -998;
631 CMD_DISABLED = -999;
632
633
634 type
635 PCommandLineInterface = ^TCommandLineInterface;
636 TCommandLineInterface = packed record
637 cli_Result2 : LongInt;
638 cli_SetName : BSTR;
639 cli_CommandDir : BPTR;
640 cli_ReturnCode : LongInt;
641 cli_CommandName : BSTR;
642 cli_FailLevel : LongInt;
643 cli_Prompt : BSTR;
644 cli_StandardInput : BPTR;
645 cli_CurrentInput : BPTR;
646 cli_CommandFile : BSTR;
647 cli_Interactive : LongInt;
648 cli_Background : LongInt;
649 cli_CurrentOutput : BPTR;
650 cli_DefaultStack : LongInt;
651 cli_StandardOutput: BPTR;
652 cli_Module : BPTR;
653 end;
654
655 type
656 PDeviceList = ^TDeviceList;
657 TDeviceList = packed record
658 dl_Next : BPTR;
659 dl_Type : LongInt;
660 dl_Task : PMsgPort;
661 dl_Lock : BPTR;
662 dl_VolumeDate: TDateStamp;
663 dl_LockList : BPTR;
664 dl_DiskType : LongInt;
665 dl_unused : LongInt;
666 dl_Name : BSTR;
667 end;
668
669 type
670 PDevInfo = ^TDevInfo;
671 TDevInfo = packed record
672 dvi_Next : BPTR;
673 dvi_Type : LongInt;
674 dvi_Task : Pointer;
675 dvi_Lock : BPTR;
676 dvi_Handler : BSTR;
677 dvi_StackSize: LongInt;
678 dvi_Priority : LongInt;
679 dvi_Startup : LongInt;
680 dvi_SegList : BPTR;
681 dvi_GlobVec : BPTR;
682 dvi_Name : BSTR;
683 end;
684
685 type
686 PAssignList = ^TAssignList;
687 TAssignList = packed record
688 al_Next: PAssignList;
689 al_Lock: BPTR;
690 end;
691
692 type
693 PDOSList = ^TDOSList;
694 TDOSList = packed record
695 dol_Next: BPTR;
696 dol_Type: LongInt;
697 dol_Task: PMsgPort;
698 dol_Lock: BPTR;
699 case Byte of
700 0: ( dol_handler : record
701 dol_Handler : BSTR;
702 dol_StackSize: LongInt;
703 dol_Priority : LongInt;
704 dol_Startup : LongWord;
705 dol_SegList : BPTR;
706 dol_GlobVec : BPTR;
707 end;
708 );
709 1: ( dol_volume : record
710 dol_VolumeDate: TDateStamp;
711 dol_LockList : BPTR;
712 dol_DiskType : LongInt;
713 end;
714 );
715 2: ( dol_assign : record
716 dol_AssignName: PChar;
717 dol_List : PAssignList;
718 end;
719 );
720 3: ( dol_Misc: array[0..23] of Byte;
721 dol_Name: BPTR;
722 );
723 end;
724
725
726 const
727 DLT_DEVICE = 0;
728 DLT_DIRECTORY = 1;
729 DLT_VOLUME = 2;
730 DLT_LATE = 3;
731 DLT_NONBINDING = 4;
732 DLT_PRIVATE = -1;
733 // V51 (MorphOS)
734 DLT_FSCONTEXT = 5;
735
736 type
737 PDevProc = ^TDevProc;
738 TDevProc = packed record
739 dvp_Port : PMsgPort;
740 dvp_Lock : BPTR;
741 dvp_Flags : LongWord;
742 dvp_DevNode: PDOSList;
743 end;
744
745
746 const
747 DVPB_UNLOCK = 0;
748 DVPF_UNLOCK = 1 Shl DVPB_UNLOCK;
749
750 DVPB_ASSIGN = 1;
751 DVPF_ASSIGN = 1 Shl DVPB_ASSIGN;
752 // V51 (MorphOS)
753 DVPB_FSCONTEXT = 2;
754 DVPF_FSCONTEXT = 1 Shl DVPB_FSCONTEXT;
755
756 const
757 LDB_READ = 0;
758 LDF_READ = 1 Shl LDB_READ;
759
760 LDB_WRITE = 1;
761 LDF_WRITE = 1 Shl LDB_WRITE;
762
763 LDB_DEVICES = 2;
764 LDF_DEVICES = 1 Shl LDB_DEVICES;
765
766 LDB_VOLUMES = 3;
767 LDF_VOLUMES = 1 Shl LDB_VOLUMES;
768
769 LDB_ASSIGNS = 4;
770 LDF_ASSIGNS = 1 Shl LDB_ASSIGNS;
771
772 LDB_ENTRY = 5;
773 LDF_ENTRY = 1 Shl LDB_ENTRY;
774
775 LDB_DELETE = 6;
776 LDF_DELETE = 1 Shl LDB_DELETE;
777
778 LDF_ALL = LDF_DEVICES Or LDF_VOLUMES Or LDF_ASSIGNS;
779
780
781 type
782 PFileLock = ^TFileLock;
783 TFileLock = packed record
784 fl_Link : BPTR;
785 fl_Key : LongInt;
786 fl_Access: LongInt;
787 fl_Task : PMsgPort;
788 fl_Volume: BPTR;
789 end;
790
791
792 const
793 REPORT_STREAM = 0;
794 REPORT_TASK = 1;
795 REPORT_LOCK = 2;
796 REPORT_VOLUME = 3;
797 REPORT_INSERT = 4;
798
799 const
800 ABORT_DISK_ERROR = 296;
801 ABORT_BUSY = 288;
802
803 const
804 RUN_EXECUTE = -1;
805 RUN_SYSTEM = -2;
806 RUN_SYSTEM_ASYNCH = -3;
807
808 const
809 ST_ROOT = 1;
810 ST_USERDIR = 2;
811 ST_SOFTLINK = 3;
812 ST_LINKDIR = 4;
813 ST_FILE = -3;
814 ST_LINKFILE = -4;
815 ST_PIPEFILE = -5;
816
817
818
819 { * dos asl definitions
820 *********************************************************************
821 * }
822
823
824 type
825 PAChain = ^TAChain;
826 TAChain = packed record
827 an_Child : PAChain;
828 an_Parent: PAChain;
829 an_Lock : BPTR;
830 an_Info : TFileInfoBlock;
831 an_Flags : ShortInt;
832 an_String: Array[0..0] Of Char;
833 { * an_String continues * }
834 end;
835
836 type
837 PAnchorPath = ^TAnchorPath;
838 TAnchorPath = packed record
839 case Byte of
840 0 : ( ap_First: PAChain;
841 ap_Last : PAChain;
842 ap_BreakBits_1 : LongInt; // just as placeholder
843 ap_FoundBreak_1: LongInt; // just as placeholder
844 ap_Length : ShortInt;
845 ap_Extended : ShortInt;
846 );
847 1 : ( ap_Base : PAChain;
848 ap_Current : PAChain;
849 ap_BreakBits : LongInt;
850 ap_FoundBreak: LongInt;
851 ap_Flags : ShortInt;
852 ap_Reserved : ShortInt;
853 ap_Strlen : SmallInt;
854 ap_Info : TFileInfoBlock;
855 ap_Buf : Array[0..1] of Char;
856 { * an_Buf continues * }
857 );
858 end;
859
860
861 const
862 APB_DOWILD = 0;
863 APF_DOWILD = 1 Shl APB_DOWILD;
864
865 APB_ITSWILD = 1;
866 APF_ITSWILD = 1 Shl APB_ITSWILD;
867
868 APB_DODIR = 2;
869 APF_DODIR = 1 Shl APB_DODIR;
870
871 APB_DIDDIR = 3;
872 APF_DIDDIR = 1 Shl APB_DIDDIR;
873
874 APB_NOMEMERR = 4;
875 APF_NOMEMERR = 1 Shl APB_NOMEMERR;
876
877 APB_DODOT = 5;
878 APF_DODOT = 1 Shl APB_DODOT;
879
880 APB_DirChanged = 6;
881 APF_DirChanged = 1 Shl APB_DirChanged;
882
883 APB_FollowHLinks = 7;
884 APF_FollowHLinks = 1 Shl APB_FollowHLinks;
885
886 const
887 APSB_EXTENDED = 15;
888 APSF_EXTENDED = 1 Shl APSB_EXTENDED;
889
890 // Following are ap_Extended flags, only enabled when ap_StrLen has
891 // APSF_EXTENDED set. Added in dos.library 50.67.
892
893 // Return literal softlink names instead of the link destination
894 APEB_LiteralSLinks = 1;
895 APEF_LiteralSLinks = 1 shl APEB_LiteralSLinks;
896
897 // Don't follow softlink directories, implies APEF_LiteralSLinks
898 APEB_DontFollowSLinks = 2;
899 APEF_DontFollowSLinks = 1 shl APEB_DontFollowSLinks;
900
901 APEB_FutureExtension = 7;
902 APEF_FutureExtension = 1 Shl APEB_FutureExtension;
903
904 const
905 DDB_PatternBit = 0;
906 DDF_PatternBit = 1 Shl DDB_PatternBit;
907
908 DDB_ExaminedBit = 1;
909 DDF_ExaminedBit = 1 Shl DDB_ExaminedBit;
910
911 DDB_Completed = 2;
912 DDF_Completed = 1 Shl DDB_Completed;
913
914 DDB_AllBit = 3;
915 DDF_AllBit = 1 Shl DDB_AllBit;
916
917 DDB_Single = 4;
918 DDF_Single = 1 Shl DDB_Single;
919
920 const
921 P_ANY = $80;
922 P_SINGLE = $81;
923 P_ORSTART = $82;
924 P_ORNEXT = $83;
925 P_OREND = $84;
926 P_NOT = $85;
927 P_NOTEND = $86;
928 P_NOTCLASS = $87;
929 P_CLASS = $88;
930 P_REPBEG = $89;
931 P_REPEND = $8A;
932 P_STOP = $8B;
933
934 const
935 COMPLEX_BIT = 1;
936 EXAMINE_BIT = 2;
937
938 const
939 ERROR_BUFFER_OVERFLOW = 303;
940 ERROR_BREAK = 304;
941 ERROR_NOT_EXECUTABLE = 305;
942
943
944 { * dos hunk definitions
945 *********************************************************************
946 * }
947
948 const
949 HUNK_UNIT = 999;
950 HUNK_NAME = 1000;
951 HUNK_CODE = 1001;
952 HUNK_DATA = 1002;
953 HUNK_BSS = 1003;
954
955 HUNK_RELOC32 = 1004;
956 HUNK_ABSRELOC32 = HUNK_RELOC32;
957
958 HUNK_RELOC16 = 1005;
959 HUNK_RELRELOC16 = HUNK_RELOC16;
960
961 HUNK_RELOC8 = 1006;
962 HUNK_RELRELOC8 = HUNK_RELOC8;
963
964 HUNK_EXT = 1007;
965 HUNK_SYMBOL = 1008;
966 HUNK_DEBUG = 1009;
967 HUNK_END = 1010;
968 HUNK_HEADER = 1011;
969
970 HUNK_OVERLAY = 1013;
971 HUNK_BREAK = 1014;
972
973 HUNK_DREL32 = 1015;
974 HUNK_DREL16 = 1016;
975 HUNK_DREL8 = 1017;
976
977 HUNK_LIB = 1018;
978 HUNK_INDEX = 1019;
979
980 HUNK_RELOC32SHORT = 1020;
981
982 HUNK_RELRELOC32 = 1021;
983 HUNK_ABSRELOC16 = 1022;
984
985 const
986 HUNKB_ADVISORY = 29;
987 HUNKB_CHIP = 30;
988 HUNKB_FAST = 31;
989
990 HUNKF_ADVISORY = 1 Shl HUNKB_ADVISORY;
991 HUNKF_CHIP = 1 Shl HUNKB_CHIP;
992 HUNKF_FAST = 1 Shl HUNKB_FAST;
993
994 const
995 EXT_SYMB = 0;
996 EXT_DEF = 1;
997 EXT_ABS = 2;
998 EXT_RES = 3;
999
1000 EXT_REF32 = 129;
1001 EXT_ABSREF32 = EXT_REF32;
1002
1003 EXT_COMMON = 130;
1004 EXT_ABSCOMMON = EXT_COMMON;
1005
1006 EXT_REF16 = 131;
1007 EXT_RELREF16 = EXT_REF16;
1008
1009 EXT_REF8 = 132;
1010 EXT_RELREF8 = EXT_REF8;
1011
1012 EXT_DEXT32 = 133;
1013 EXT_DEXT16 = 134;
1014 EXT_DEXT8 = 135;
1015
1016 EXT_RELREF32 = 136;
1017 EXT_RELCOMMON = 137;
1018
1019 EXT_ABSREF16 = 138;
1020
1021 EXT_ABSREF8 = 139;
1022
1023
1024 { * dos ExAll definitions
1025 *********************************************************************
1026 * }
1027
1028 const
1029 ED_NAME = 1;
1030 ED_TYPE = 2;
1031 ED_SIZE = 3;
1032 ED_PROTECTION = 4;
1033 ED_DATE = 5;
1034 ED_COMMENT = 6;
1035 ED_OWNER = 7;
1036 // 64bit DOS extensions - V51
1037 // The ExAllData ed_Size64 field is filled. For files larger than 2^31-1 bytes, ed_Size is 0.
1038 ED_SIZE64 = 8;
1039
1040 type
1041 PExAllData = ^TExAllData;
1042 TExAllData = packed record
1043 ed_Next : PExAllData;
1044 ed_Name : PChar;
1045 ed_Type : LongInt;
1046 ed_Size : LongWord;
1047 ed_Prot : LongWord;
1048 ed_Days : LongWord;
1049 ed_Mins : LongWord;
1050 ed_Ticks : LongWord;
1051 ed_Comment : PChar;
1052 ed_OwnerUID: Word;
1053 ed_OwnerGID: Word;
1054 ed_Size64: QWord;
1055 end;
1056
1057 type
1058 PExAllControl = ^TExAllControl;
1059 TexAllControl = packed record
1060 eac_Entries : LongWord;
1061 eac_LastKey : LongWord;
1062 eac_MatchString: PChar;
1063 eac_MatchFunc : PHook;
1064
1065 end;
1066
1067
1068
1069 { * dos record definitions
1070 *********************************************************************
1071 * }
1072
1073
1074 const
1075 REC_EXCLUSIVE = 0;
1076 REC_EXCLUSIVE_IMMED = 1;
1077 REC_SHARED = 2;
1078 REC_SHARED_IMMED = 3;
1079
1080
1081 type
1082 PRecordLock = ^TRecordLock;
1083 TRecordLock = packed record
1084 rec_FH: BPTR;
1085 rec_Offset: LongWord;
1086 rec_Length: LongWord;
1087 rec_Mode: LongWord;
1088 end;
1089
1090 // 64bit DOS extensions - V51
1091 PRecordLock64 = ^TRecordLock64;
1092 TRecordLock64 = packed record
1093 rec_FH: BPTR;
1094 rec_Offset: QWord;
1095 rec_Length: QWord;
1096 rec_Mode: LongWord;
1097 end;
1098
1099
1100 { * dos tag definitions (V50)
1101 *********************************************************************
1102 * }
1103
1104
1105 const
1106 SYS_Dummy = TAG_USER + 32;
1107 SYS_Input = SYS_Dummy + 1;
1108 SYS_Output = SYS_Dummy + 2;
1109 SYS_Asynch = SYS_Dummy + 3;
1110 SYS_UserShell = SYS_Dummy + 4;
1111 SYS_CustomShell = SYS_Dummy + 5;
1112
1113 { *** V50 *** }
1114 SYS_FilterTags = SYS_Dummy + 6; { * filters the tags passed down to CreateNewProc(), default: TRUE * }
1115
1116 const
1117 NP_Dummy = TAG_USER + 1000;
1118 NP_Seglist = NP_Dummy + 1;
1119 NP_FreeSeglist = NP_Dummy + 2;
1120 NP_Entry = NP_Dummy + 3;
1121 NP_Input = NP_Dummy + 4;
1122 NP_Output = NP_Dummy + 5;
1123 NP_CloseInput = NP_Dummy + 6;
1124 NP_CloseOutput = NP_Dummy + 7;
1125 NP_Error = NP_Dummy + 8;
1126 NP_CloseError = NP_Dummy + 9;
1127 NP_CurrentDir = NP_Dummy + 10;
1128 NP_StackSize = NP_Dummy + 11;
1129 NP_Name = NP_Dummy + 12;
1130 NP_Priority = NP_Dummy + 13;
1131 NP_ConsoleTask = NP_Dummy + 14;
1132 NP_WindowPtr = NP_Dummy + 15;
1133 NP_HomeDir = NP_Dummy + 16;
1134 NP_CopyVars = NP_Dummy + 17;
1135 NP_Cli = NP_Dummy + 18;
1136 NP_Path = NP_Dummy + 19;
1137 NP_CommandName = NP_Dummy + 20;
1138 NP_Arguments = NP_Dummy + 21;
1139
1140 NP_NotifyOnDeath = NP_Dummy + 22;
1141 NP_Synchronous = NP_Dummy + 23;
1142 NP_ExitCode = NP_Dummy + 24;
1143 NP_ExitData = NP_Dummy + 25;
1144
1145 { *** V50 *** }
1146 NP_SeglistArray = NP_Dummy + 26;
1147 NP_UserData = NP_Dummy + 27;
1148 NP_StartupMsg = NP_Dummy + 28; { * PMessage, ReplyMsg'd at exit * }
1149 NP_TaskMsgPort = NP_Dummy + 29; { * ^PMsgPort, create MsgPort, automagic delete * }
1150
1151 NP_CodeType = NP_Dummy + 100;
1152 NP_PPC_Arg1 = NP_Dummy + 101;
1153 NP_PPC_Arg2 = NP_Dummy + 102;
1154 NP_PPC_Arg3 = NP_Dummy + 103;
1155 NP_PPC_Arg4 = NP_Dummy + 104;
1156 NP_PPC_Arg5 = NP_Dummy + 105;
1157 NP_PPC_Arg6 = NP_Dummy + 106;
1158 NP_PPC_Arg7 = NP_Dummy + 107;
1159 NP_PPC_Arg8 = NP_Dummy + 108;
1160 NP_PPCStackSize = NP_Dummy + 109;
1161
1162 const
1163 ADO_Dummy = TAG_USER + 2000;
1164 ADO_FH_Mode = ADO_Dummy + 1;
1165
1166 ADO_DirLen = ADO_Dummy + 2;
1167 ADO_CommNameLen = ADO_Dummy + 3;
1168 ADO_CommFileLen = ADO_Dummy + 4;
1169 ADO_PromptLen = ADO_Dummy + 5;
1170
1171 { *** V50 *** }
1172 ADDS_Dummy = TAG_USER + 3000;
1173 ADDS_Name = ADDS_Dummy + 1; // Segment name
1174 ADDS_Seglist = ADDS_Dummy + 2; // Seglist for this segment
1175 ADDS_Filename = ADDS_Dummy + 3; // Name of the file to load when needed. Ignored if Seglist is given.
1176 ADDS_Type = ADDS_Dummy + 4; // Segment type
1177
1178 ADO_CLI_Dir = ADO_Dummy + 20; // BSTR fixed
1179 ADO_CLI_CommName = ADO_Dummy + 21; // BSTR fixed
1180 ADO_CLI_CommFile = ADO_Dummy + 22; // BSTR fixed
1181 ADO_CLI_Prompt = ADO_Dummy + 23; // BSTR fixed
1182 ADO_CLI_Result2 = ADO_Dummy + 24; // LongInt
1183 ADO_CLI_ReturnCode = ADO_Dummy + 25; // LongInt
1184 ADO_CLI_FailLevel = ADO_Dummy + 26; // LongInt
1185 ADO_CLI_Interactive = ADO_Dummy + 27; // LongInt
1186 ADO_CLI_Background = ADO_Dummy + 28; // LongInt
1187 ADO_CLI_DefaultStack = ADO_Dummy + 29; // LongInt
1188
1189 // DOS_DEVICENODE tags
1190 ADO_DN_Name = ADO_Dummy + 30; // BSTR
1191 ADO_DN_MsgPort = ADO_Dummy + 31; // PMsgPort
1192 ADO_DN_Lock = ADO_Dummy + 32; // BPTR
1193 ADO_DN_Handler = ADO_Dummy + 33; // BSTR
1194 ADO_DN_Seglist = ADO_Dummy + 34; // BPTR
1195 ADO_DN_StackSize = ADO_Dummy + 35; // LongWord Default: 4096
1196 ADO_DN_Priority = ADO_Dummy + 36; // LongInt
1197 ADO_DN_Startup = ADO_Dummy + 37; // BSTR
1198 ADO_DN_GlobalVec = ADO_Dummy + 38; // BPTR
1199
1200 // Only for new devicenodes created by AllocDosObject
1201 ADO_DN_SerialID = ADO_Dummy + 39; // BPTR
1202 // Value < $100 as startup argument
1203 ADO_DN_StartupValue = ADO_Dummy + 40; // LongWord
1204
1205 // New = dos.lib 51.40+; tags
1206 ADO_DN_Flags = ADO_Dummy + 41; // LongWord
1207 ADO_DN_Status = ADO_Dummy + 42; // LongWord
1208 ADO_DN_ExitNotifyMsg = ADO_Dummy + 43; // PMsg
1209
1210 // Run handler only once, do not reload after exit
1211 DNF_STARTONCE = 1 shl 0;
1212 // Free handler seglist after handler exit
1213 DNF_UNLOADSEGLIST = 1 shl 1;
1214 // Remove doslist entry after handler exit
1215 DNF_REMDOSLIST = 1 shl 2;
1216
1217 // Only useful for GetDosObjectAttr
1218 ADO_FSSM = ADO_Dummy + 50; // PFileSysStartupMsg
1219 ADO_FSSM_Device = ADO_Dummy + 51; // BSTR
1220 ADO_FSSM_Unit = ADO_Dummy + 52; // LongWord
1221 ADO_FSSM_Flags = ADO_Dummy + 53; // LongWord
1222
1223 // Only useful for GetDosObjectAttr
1224 ADO_DE = ADO_Dummy + 60; // PDosEnvec
1225 ADO_DE_TableSize = ADO_Dummy + 61; // LongWord Default: DE_BOOTBLOCKS
1226 ADO_DE_SizeBlock = ADO_Dummy + 62; // LongWord Default: 512
1227 ADO_DE_SecOrg = ADO_Dummy + 63; // LongWord
1228 ADO_DE_NumHeads = ADO_Dummy + 64; // LongWord
1229 ADO_DE_Surfaces = ADO_DE_NumHeads;
1230 ADO_DE_SecsPerBlk = ADO_Dummy + 65; // LongWord Default: 1
1231 ADO_DE_BlksPerTrack = ADO_Dummy + 66; // LongWord
1232 ADO_DE_ReservedBlks = ADO_Dummy + 67; // LongWord
1233 ADO_DE_PreFac = ADO_Dummy + 68; // LongWord
1234 ADO_DE_PreAlloc = ADO_DE_PreFac;
1235 ADO_DE_Interleave = ADO_Dummy + 69; // LongWord
1236 ADO_DE_LowCyl = ADO_Dummy + 70; // LongWord
1237 ADO_DE_UpperCyl = ADO_Dummy + 71; // LongWord
1238 ADO_DE_HighCyl = ADO_DE_UpperCyl;
1239 ADO_DE_NumBuffers = ADO_Dummy + 72; // LongWord
1240 ADO_DE_BufMemType = ADO_Dummy + 73; // LongWord
1241 ADO_DE_MaxTransfer = ADO_Dummy + 74; // LongWord Default: $ffffffff
1242 ADO_DE_Mask = ADO_Dummy + 75; // LongWord Default: $ffffffff
1243 ADO_DE_BootPri = ADO_Dummy + 76; // LongInt
1244 ADO_DE_DosType = ADO_Dummy + 77; // LongWord
1245 ADO_DE_Baud = ADO_Dummy + 78; // LongWord
1246 ADO_DE_Control = ADO_Dummy + 79; // BSTR
1247 ADO_DE_BootBlocks = ADO_Dummy + 80; // LongWord
1248
1249 // Used by AllocDosObject
1250 ADO_FS_DosType = ADO_Dummy + 90; // LongWord
1251
1252 ADO_VN_Name = ADO_Dummy + 100; // BSTR
1253 ADO_VN_MsgPort = ADO_Dummy + 101; // PMsgPort
1254 ADO_VN_Lock = ADO_Dummy + 102; // BPTR
1255 ADO_VN_LockList = ADO_Dummy + 103; // PLock
1256 ADO_VN_Date = ADO_Dummy + 104; // PDateStamp
1257 ADO_VN_DiskType = ADO_Dummy + 105; // LongWord
1258
1259
1260 ADO_AN_Name = ADO_Dummy + 120; // BSTR
1261 ADO_AN_MsgPort = ADO_Dummy + 121; // PMsgPort
1262 ADO_AN_Lock = ADO_Dummy + 122; // BPTR
1263 ADO_AN_Type = ADO_Dummy + 123; // LongWord
1264 ADO_AN_AssignName = ADO_Dummy + 124; // PChar
1265 ADO_AN_AssignList = ADO_Dummy + 125; // PAssignList
1266
1267 // GetDosObjectAttr uses this to store variable size entries.
1268 type
1269 TDosAttrBuffer = record
1270 dab_Ptr: APTR;
1271 dab_Len: LongWord;
1272 end;
1273 PDosAttrBuffer = ^TDosAttrBuffer;
1274
1275 const
1276 FNDS_Dummy = TAG_USER + 3100;
1277 FNDS_Name = FNDS_Dummy + 1; { * Segment name * }
1278 FNDS_From = FNDS_Dummy + 2; { * Segment to start from * }
1279 FNDS_System = FNDS_Dummy + 3; { * Look for a system segment ? * }
1280 FNDS_Load = FNDS_Dummy + 4; { * Load the seglist if needed ? (Default: TRUE) * }
1281
1282 // V51
1283 FSCONTEXTTAG_Dummy = TAG_USER + 3200;
1284
1285 // Pass a custom handler seglist. This handler MUST be able to handle the fscontext filesystem extension
1286
1287 FSCONTEXTTAG_SEGLIST = FSCONTEXTTAG_Dummy + $1;
1288 FSCONTEXTTAG_PRIORITY = FSCONTEXTTAG_Dummy + $2;
1289 FSCONTEXTTAG_STACKSIZE = FSCONTEXTTAG_Dummy + $3;
1290 FSCONTEXTTAG_STARTUPSTRING = FSCONTEXTTAG_Dummy + $4;
1291 FSCONTEXTTAG_STARTUPVALUE = FSCONTEXTTAG_Dummy + $5;
1292 FSCONTEXTTAG_FSSM = FSCONTEXTTAG_Dummy + $6;
1293 // A matching filesystem is searched through query.library
1294 FSCONTEXTTAG_DOSTYPE = FSCONTEXTTAG_Dummy + $7;
1295
1296 FSCONTEXTINFOTAG_Dummy = TAG_USER + 3300;
1297 FSCONTEXTINFOTAG_NAME = FSCONTEXTINFOTAG_Dummy + $1;
1298
1299 SEGLISTTAG_Dummy = TAG_USER + 3400;
1300 // return the ObjData object when it exists or nil.
1301 SEGLISTTAG_OBJDATA = SEGLISTTAG_Dummy + $1;
1302
1303
1304 { * dos stdio definitions
1305 *********************************************************************
1306 * }
1307
1308 const
1309 BUF_LINE = 0;
1310 BUF_FULL = 1;
1311 BUF_NONE = 2;
1312
1313 const
1314 ENDSTREAMCH = -1;
1315
1316
1317
1318 { * dos env-var definitions
1319 *********************************************************************
1320 * }
1321
1322
1323 type
1324 PLocalVar = ^TLocalVar;
1325 TLocalVar = packed record
1326 lv_Node : TNode;
1327 lv_Flags: Word;
1328 lv_Value: PChar;
1329 lv_Len : LongWord;
1330 end;
1331
1332
1333 const
1334 LV_VAR = 0;
1335 LV_ALIAS = 1;
1336
1337 const
1338 LVB_IGNORE = 7;
1339 LVF_IGNORE = 1 Shl LVB_IGNORE;
1340
1341 GVB_GLOBAL_ONLY = 8;
1342 GVF_GLOBAL_ONLY = 1 Shl GVB_GLOBAL_ONLY;
1343
1344 GVB_LOCAL_ONLY = 9;
1345 GVF_LOCAL_ONLY = 1 Shl GVB_LOCAL_ONLY;
1346
1347 GVB_BINARY_VAR = 10;
1348 GVF_BINARY_VAR = 1 Shl GVB_BINARY_VAR;
1349
1350 GVB_DONT_NULL_TERM = 11;
1351 GVF_DONT_NULL_TERM = 1 Shl GVB_DONT_NULL_TERM;
1352
1353 GVB_SAVE_VAR = 12;
1354 GVF_SAVE_VAR = 1 Shl GVB_SAVE_VAR;
1355
1356
1357
1358 { * dos ReadArgs definitions
1359 *********************************************************************
1360 * }
1361
1362
1363 type
1364 PCSource = ^TCSource;
1365 TCSource = packed record
1366 CS_Buffer: PChar;
1367 CS_Length: LongInt;
1368 CS_CurChr: LongInt;
1369 end;
1370
1371 type
1372 PRDArgs = ^TRDArgs;
1373 TRDArgs = packed record
1374 RDA_Source : TCSource;
1375 RDA_DAList : LongInt;
1376 RDA_Buffer : PChar;
1377 RDA_BufSiz : LongInt;
1378 RDA_ExtHelp: PChar;
1379 RDA_Flags : LongInt;
1380 end;
1381
1382
1383 const
1384 RDAB_STDIN = 0;
1385 RDAF_STDIN = 1 Shl RDAB_STDIN;
1386
1387 RDAB_NOALLOC = 1;
1388 RDAF_NOALLOC = 1 Shl RDAB_NOALLOC;
1389
1390 RDAB_NOPROMPT = 2;
1391 RDAF_NOPROMPT = 1 Shl RDAB_NOPROMPT;
1392
1393 const
1394 MAX_TEMPLATE_ITEMS = 100;
1395 MAX_MULTIARGS = 128;
1396
1397
1398
1399 { * dos filehandler definitions
1400 *********************************************************************
1401 * }
1402
1403
1404 type
1405 PDosEnvec = ^TDosEnvec;
1406 TDosEnvec = packed record
1407 de_TableSize : LongWord;
1408 de_SizeBlock : LongWord;
1409 de_SecOrg : LongWord;
1410 de_Surfaces : LongWord;
1411 de_SectorPerBlock: LongWord;
1412 de_BlocksPerTrack: LongWord;
1413 de_Reserved : LongWord;
1414 de_PreAlloc : LongWord;
1415 de_Interleave : LongWord;
1416 de_LowCyl : LongWord;
1417 de_HighCyl : LongWord;
1418 de_NumBuffers : LongWord;
1419 de_BufMemType : LongWord;
1420 de_MaxTransfer : LongWord;
1421 de_Mask : LongWord;
1422 de_BootPri : LongInt;
1423 de_DosType : LongWord;
1424 de_Baud : LongWord;
1425 de_Control : LongWord;
1426 de_BootBlocks : LongWord;
1427 end;
1428
1429
1430 const
1431 DE_TABLESIZE = 0;
1432 DE_SIZEBLOCK = 1;
1433 DE_SECORG = 2;
1434 DE_NUMHEADS = 3;
1435 DE_SECSPERBLK = 4;
1436 DE_BLKSPERTRACK = 5;
1437 DE_RESERVEDBLKS = 6;
1438 DE_PREFAC = 7;
1439 DE_INTERLEAVE = 8;
1440 DE_LOWCYL = 9;
1441 DE_UPPERCYL = 10;
1442 DE_NUMBUFFERS = 11;
1443 DE_MEMBUFTYPE = 12;
1444 DE_BUFMEMTYPE = 12;
1445 DE_MAXTRANSFER = 13;
1446 DE_MASK = 14;
1447 DE_BOOTPRI = 15;
1448 DE_DOSTYPE = 16;
1449 DE_BAUD = 17;
1450 DE_CONTROL = 18;
1451 DE_BOOTBLOCKS = 19;
1452
1453
1454 type
1455 PFileSysStartupMsg = ^TFileSysStartupMsg;
1456 TFileSysStartupMsg = packed record
1457 fssm_Unit : LongWord;
1458 fssm_Device : BSTR;
1459 fssm_Environ: BPTR;
1460 fssm_Flags : LongWord;
1461 end;
1462
1463 type
1464 PDeviceNode = ^TDeviceNode;
1465 TDeviceNode = packed record
1466 dn_Next : BPTR;
1467 dn_Type : LongWord;
1468 dn_Task : PMsgPort;
1469 dn_Lock : BPTR;
1470 dn_Handler : BSTR;
1471 dn_StackSize: LongWord;
1472 dn_Priority : LongInt;
1473 dn_Startup : BPTR;
1474 dn_SegList : BPTR;
1475 dn_GlobalVec: BPTR;
1476 dn_Name : BSTR;
1477 end;
1478
1479
1480
1481 { * dos notification definitions
1482 *********************************************************************
1483 * }
1484
1485
1486 const
1487 NOTIFY_CLASS = $40000000;
1488 NOTIFY_CODE = $1234;
1489
1490
1491 type
1492 PNotifyRequest = ^TNotifyRequest;
1493 TNotifyRequest = packed record
1494 nr_Name : PChar;
1495 nr_FullName: PChar;
1496 nr_UserData: LongWord;
1497 nr_Flags : LongWord;
1498 nr_stuff : record
1499 case Byte of
1500 0 : ( nr_Msg : record
1501 nr_Port: PMsgPort;
1502 end );
1503 1 : ( nr_Signal : record
1504 nr_Task : PTask;
1505 nr_SignalNum: Byte;
1506 nr_pad : Array[0..2] Of Byte;
1507 end );
1508 end;
1509 nr_Reserved: Array[0..3] Of LongWord;
1510 nr_MsgCount: LongWord;
1511 nr_Handler : PMsgPort;
1512 end;
1513
1514 type
1515 PNotifyMessage = ^TNotifyMessage;
1516 TNotifyMessage = packed record
1517 nm_ExecMessage: TMessage;
1518 nm_Class : LongWord;
1519 nm_Code : Word;
1520 nm_NReq : PNotifyRequest;
1521 nm_DoNotTouch : LongWord;
1522 nm_DoNotTouch2: LongWord;
1523 end;
1524
1525
1526 const
1527 NRB_SEND_MESSAGE = 0;
1528 NRB_SEND_SIGNAL = 1;
1529 NRB_WAIT_REPLY = 3;
1530 NRB_NOTIFY_INITIAL = 4;
1531
1532 NRB_MAGIC = 31;
1533
1534 const
1535 NRF_SEND_MESSAGE = 1 Shl NRB_SEND_MESSAGE;
1536 NRF_SEND_SIGNAL = 1 Shl NRB_SEND_SIGNAL;
1537 NRF_WAIT_REPLY = 1 Shl NRB_WAIT_REPLY;
1538 NRF_NOTIFY_INITIAL = 1 Shl NRB_NOTIFY_INITIAL;
1539
1540 NRF_MAGIC = 1 Shl NRB_MAGIC;
1541
1542 const
1543 NR_HANDLER_FLAGS = $ffff0000;
1544
1545
1546
1547 { * dos.library segtracker include
1548 *********************************************************************
1549 * }
1550
1551
1552 const
1553 SEG_SEM = 'SegTracker';
1554
1555
1556 type
1557 PSegSem = ^TSegSem;
1558 TSegSem = packed record
1559 seg_Semaphore: TSignalSemaphore;
1560 seg_Find : Procedure; { Name = seg_Find(REG(a0, ULONG Address), REG(a1, ULONG *SegNum), REG(a2, ULONG *Offset)) }
1561 seg_List : TMinList;
1562 end;
1563
1564 type
1565 PSegArray = ^TSegArray;
1566 TSegArray = packed record
1567 seg_Address: Cardinal;
1568 seg_Size : Cardinal;
1569 end;
1570
1571 type
1572 PSegNode = ^TSegNode;
1573 TSegNode = packed record
1574 seg_Node : TMinNode;
1575 seg_Name : PChar;
1576 seg_Array: Array[0..0] Of TSegArray;
1577 end;
1578
1579
1580 {.$include doslibd.inc}
1581 {.$include doslibf.inc}
1582
1583 { dos.library functions }
1584
dosOpennull1585 function dosOpen(fname : PChar location 'd1';
1586 accessMode: LongInt location 'd2'): BPTR;
1587 SysCall MOS_DOSBase 30;
1588
dosClosenull1589 function dosClose(fileh: BPTR location 'd1'): LongBool;
1590 SysCall MOS_DOSBase 36;
1591
dosReadnull1592 function dosRead(fileh : BPTR location 'd1';
1593 buffer: Pointer location 'd2';
1594 length: LongInt location 'd3'): LongInt;
1595 SysCall MOS_DOSBase 42;
1596
dosWritenull1597 function dosWrite(fileh : BPTR location 'd1';
1598 buffer: Pointer location 'd2';
1599 length: LongInt location 'd3'): LongInt;
1600 SysCall MOS_DOSBase 48;
1601
dosInputnull1602 function dosInput: BPTR;
1603 SysCall MOS_DOSBase 54;
1604
dosOutputnull1605 function dosOutput: BPTR;
1606 SysCall MOS_DOSBase 60;
1607
dosSeeknull1608 function dosSeek(fileh : BPTR location 'd1';
1609 position: LongInt location 'd2';
1610 posmode : LongInt location 'd3'): LongInt;
1611 SysCall MOS_DOSBase 66;
1612
dosDeleteFilenull1613 function dosDeleteFile(fname: PChar location 'd1'): LongBool;
1614 SysCall MOS_DOSBase 72;
1615
dosRenamenull1616 function dosRename(oldName: PChar location 'd1';
1617 newName: PChar location 'd2'): LongInt;
1618 SysCall MOS_DOSBase 78;
1619
Locknull1620 function Lock(lname : PChar location 'd1';
1621 accessMode: LongInt location 'd2'): BPTR;
1622 SysCall MOS_DOSBase 84;
1623
1624 procedure Unlock(lock: BPTR location 'd1');
1625 SysCall MOS_DOSBase 90;
1626
DupLocknull1627 function DupLock(lock: BPTR location 'd1'): LongInt;
1628 SysCall MOS_DOSBase 096;
1629
Examinenull1630 function Examine(lock : BPTR location 'd1';
1631 fileInfoBlock: PFileInfoBlock location 'd2'): LongInt;
1632 SysCall MOS_DOSBase 102;
1633
ExNextnull1634 function ExNext(lock : BPTR location 'd1';
1635 fileInfoBlock: PFileInfoBlock location 'd2'): LongInt;
1636 SysCall MOS_DOSBase 108;
1637
Infonull1638 function Info(lock : BPTR location 'd1';
1639 parameterBlock: PInfoData location 'd2'): LongInt;
1640 SysCall MOS_DOSBase 114;
1641
dosCreateDirnull1642 function dosCreateDir(dname: PChar location 'd1'): LongInt;
1643 SysCall MOS_DOSBase 120;
1644
CurrentDirnull1645 function CurrentDir(lock: BPTR location 'd1'): BPTR;
1646 SysCall MOS_DOSBase 126;
1647
IoErrnull1648 function IoErr: LongInt;
1649 SysCall MOS_DOSBase 132;
1650
CreateProcnull1651 function CreateProc(name : PChar location 'd1';
1652 pri : LongInt location 'd2';
1653 segList : BPTR location 'd3';
1654 stackSize: LongInt location 'd4'): PMsgPort;
1655 SysCall MOS_DOSBase 138;
1656
1657 procedure dosExit(returnCode: LongInt location 'd1');
1658 SysCall MOS_DOSBase 144;
1659
LoadSegnull1660 function LoadSeg(name: PChar location 'd1'): BPTR;
1661 SysCall MOS_DOSBase 150;
1662
1663 procedure UnLoadSeg(seglist: BPTR location 'd1');
1664 SysCall MOS_DOSBase 156;
1665
DeviceProcnull1666 function DeviceProc(name: PChar location 'd1'): PMsgPort;
1667 SysCall MOS_DOSBase 174;
1668
SetCommentnull1669 function SetComment(name : PChar location 'd1';
1670 comment: PChar location 'd2'): LongBool;
1671 SysCall MOS_DOSBase 180;
1672
SetProtectionnull1673 function SetProtection(name: PChar location 'd1';
1674 mask: LongInt location 'd2'): LongInt;
1675 SysCall MOS_DOSBase 186;
1676
DateStampnull1677 function DateStamp(date: PDateStamp location 'd1'): PDateStamp;
1678 SysCall MOS_DOSBase 192;
1679
1680 procedure DOSDelay(timeout: LongInt location 'd1');
1681 SysCall MOS_DOSBase 198;
1682
WaitForCharnull1683 function WaitForChar(file1 : LongInt location 'd1';
1684 timeout: LongInt location 'd2'): LongBool;
1685 SysCall MOS_DOSBase 204;
1686
ParentDirnull1687 function ParentDir(lock: BPTR location 'd1'): BPTR;
1688 SysCall MOS_DOSBase 210;
1689
IsInteractivenull1690 function IsInteractive(file1: BPTR location 'd1'): LongBool;
1691 SysCall MOS_DOSBase 216;
1692
Executenull1693 function Execute(string1: PChar location 'd1';
1694 file1 : BPTR location 'd2';
1695 file2 : BPTR location 'd3'): LongBool;
1696 SysCall MOS_DOSBase 222;
1697
AllocDosObjectnull1698 function AllocDosObject(type1: Cardinal location 'd1';
1699 tags : PTagItem location 'd2'): Pointer;
1700 SysCall MOS_DOSBase 228;
1701
AllocDosObjectTagListnull1702 function AllocDosObjectTagList(type1: Cardinal location 'd1';
1703 tags : PTagItem location 'd2'): Pointer;
1704 SysCall MOS_DOSBase 228;
1705
1706 procedure FreeDosObject(type1: Cardinal location 'd1';
1707 ptr : Pointer location 'd2');
1708 SysCall MOS_DOSBase 234;
1709
DoPktnull1710 function DoPkt(port : PMsgPort location 'd1';
1711 action: LongInt location 'd2';
1712 arg1 : LongInt location 'd3';
1713 arg2 : LongInt location 'd4';
1714 arg3 : LongInt location 'd5';
1715 arg4 : LongInt location 'd6';
1716 arg5 : LongInt location 'd7'): LongInt;
1717 SysCall MOS_DOSBase 240;
1718
DoPkt0null1719 function DoPkt0(port : PMsgPort location 'd1';
1720 action: LongInt location 'd2'): LongInt;
1721 SysCall MOS_DOSBase 240;
1722
DoPkt1null1723 function DoPkt1(port : PMsgPort location 'd1';
1724 action: LongInt location 'd2';
1725 arg1 : LongInt location 'd3'): LongInt;
1726 SysCall MOS_DOSBase 240;
1727
DoPkt2null1728 function DoPkt2(port : PMsgPort location 'd1';
1729 action: LongInt location 'd2';
1730 arg1 : LongInt location 'd3';
1731 arg2 : LongInt location 'd4'): LongInt;
1732 SysCall MOS_DOSBase 240;
1733
DoPkt3null1734 function DoPkt3(port : PMsgPort location 'd1';
1735 action: LongInt location 'd2';
1736 arg1 : LongInt location 'd3';
1737 arg2 : LongInt location 'd4';
1738 arg3 : LongInt location 'd5'): LongInt;
1739 SysCall MOS_DOSBase 240;
1740
DoPkt4null1741 function DoPkt4(port : PMsgPort location 'd1';
1742 action: LongInt location 'd2';
1743 arg1 : LongInt location 'd3';
1744 arg2 : LongInt location 'd4';
1745 arg3 : LongInt location 'd5';
1746 arg4 : LongInt location 'd6'): LongInt;
1747 SysCall MOS_DOSBase 240;
1748
1749 procedure SendPkt(dp : PDosPacket location 'd1';
1750 port : PMsgPort location 'd2';
1751 replyport: PMsgPort location 'd3');
1752 SysCall MOS_DOSBase 246;
1753
WaitPktnull1754 function WaitPkt: PDosPacket;
1755 SysCall MOS_DOSBase 252;
1756
1757 procedure ReplyPkt(dp : PDosPacket location 'd1';
1758 res1: LongInt location 'd2';
1759 res2: LongInt location 'd3');
1760 SysCall MOS_DOSBase 258;
1761
1762 procedure AbortPkt(port: PMsgPort location 'd1';
1763 pkt : PDosPacket location 'd2');
1764 SysCall MOS_DOSBase 264;
1765
LockRecordnull1766 function LockRecord(fh : BPTR location 'd1';
1767 offset : Cardinal location 'd2';
1768 length : Cardinal location 'd3';
1769 mode : Cardinal location 'd4';
1770 timeout: Cardinal location 'd5'): LongBool;
1771 SysCall MOS_DOSBase 270;
1772
LockRecordsnull1773 function LockRecords(recArray: PRecordLock location 'd1';
1774 timeout : Cardinal location 'd2'): LongBool;
1775 SysCall MOS_DOSBase 276;
1776
UnLockRecordnull1777 function UnLockRecord(fh : BPTR location 'd1';
1778 offset: Cardinal location 'd2';
1779 length: Cardinal location 'd3'): LongBool;
1780 SysCall MOS_DOSBase 282;
1781
UnLockRecordsnull1782 function UnLockRecords(recArray: PRecordLock location 'd1'): LongBool;
1783 SysCall MOS_DOSBase 288;
1784
SelectInputnull1785 function SelectInput(fh: BPTR location 'd1'): LongInt;
1786 SysCall MOS_DOSBase 294;
1787
SelectOutputnull1788 function SelectOutput(fh: BPTR location 'd1'): LongInt;
1789 SysCall MOS_DOSBase 300;
1790
FGetCnull1791 function FGetC(fh: BPTR location 'd1'): LongInt;
1792 SysCall MOS_DOSBase 306;
1793
FPutCnull1794 function FPutC(fh: BPTR location 'd1';
1795 ch: LongInt location 'd2'): LongInt;
1796 SysCall MOS_DOSBase 312;
1797
UnGetCnull1798 function UnGetC(fh : BPTR location 'd1';
1799 character: LongInt location 'd2'): LongInt;
1800 SysCall MOS_DOSBase 318;
1801
FReadnull1802 function FRead(fh : BPTR location 'd1';
1803 block : Pointer location 'd2';
1804 blocklen: Cardinal location 'd3';
1805 number : Cardinal location 'd4'): LongInt;
1806 SysCall MOS_DOSBase 324;
1807
FWritenull1808 function FWrite(fh : BPTR location 'd1';
1809 block : Pointer location 'd2';
1810 blocklen: Cardinal location 'd3';
1811 number : Cardinal location 'd4'): LongInt;
1812 SysCall MOS_DOSBase 330;
1813
FGetsnull1814 function FGets(fh : BPTR location 'd1';
1815 buf : PChar location 'd2';
1816 buflen: Cardinal location 'd3'): PChar;
1817 SysCall MOS_DOSBase 336;
1818
FPutsnull1819 function FPuts(fh : BPTR location 'd1';
1820 str: PChar location 'd2'): LongInt;
1821 SysCall MOS_DOSBase 342;
1822
1823 procedure VFWritef(fh : BPTR location 'd1';
1824 format : PChar location 'd2';
1825 argarray: Pointer location 'd3');
1826 SysCall MOS_DOSBase 348;
1827
VFPrintfnull1828 function VFPrintf(fh : BPTR location 'd1';
1829 format : PChar location 'd2';
1830 argarray: PLongInt location 'd3'): LongInt;
1831 SysCall MOS_DOSBase 354;
1832
dosFlushnull1833 function dosFlush(fh: BPTR location 'd1'): LongInt;
1834 SysCall MOS_DOSBase 360;
1835
SetVBufnull1836 function SetVBuf(fh : BPTR location 'd1';
1837 buff : PChar location 'd2';
1838 type1: LongInt location 'd3';
1839 size : LongInt location 'd4'): LongInt;
1840 SysCall MOS_DOSBase 366;
1841
DupLockFromFHnull1842 function DupLockFromFH(fh: BPTR location 'd1'): BPTR;
1843 SysCall MOS_DOSBase 372;
1844
OpenFromLocknull1845 function OpenFromLock(lock: BPTR location 'd1'): BPTR;
1846 SysCall MOS_DOSBase 378;
1847
ParentOfFHnull1848 function ParentOfFH(fh: BPTR location 'd1'): BPTR;
1849 SysCall MOS_DOSBase 384;
1850
ExamineFHnull1851 function ExamineFH(fh : BPTR location 'd1';
1852 fib: PFileInfoBlock location 'd2'): LongBool;
1853 SysCall MOS_DOSBase 390;
1854
SetFileDatenull1855 function SetFileDate(name: PChar location 'd1';
1856 date: PDateStamp location 'd2'): LongBool;
1857 SysCall MOS_DOSBase 396;
1858
NameFromLocknull1859 function NameFromLock(lock : BPTR location 'd1';
1860 buffer: PChar location 'd2';
1861 len : LongInt location 'd3'): LongBool;
1862 SysCall MOS_DOSBase 402;
1863
NameFromFHnull1864 function NameFromFH(fh : BPTR location 'd1';
1865 buffer: PChar location 'd2';
1866 len : LongInt location 'd3'): LongBool;
1867 SysCall MOS_DOSBase 408;
1868
SplitNamenull1869 function SplitName(name : PChar location 'd1';
1870 separator: Cardinal location 'd2';
1871 buf : PChar location 'd3';
1872 oldpos : LongInt location 'd4';
1873 size : LongInt location 'd5'): SmallInt;
1874 SysCall MOS_DOSBase 414;
1875
SameLocknull1876 function SameLock(lock1: BPTR location 'd1';
1877 lock2: BPTR location 'd2'): LongInt;
1878 SysCall MOS_DOSBase 420;
1879
SetModenull1880 function SetMode(fh : BPTR location 'd1';
1881 mode: LongInt location 'd2'): LongInt;
1882 SysCall MOS_DOSBase 426;
1883
ExAllnull1884 function ExAll(lock : BPTR location 'd1';
1885 buffer : PExAllData location 'd2';
1886 size : LongInt location 'd3';
1887 data : LongInt location 'd4';
1888 control: PExAllControl location 'd5'): LongBool;
1889 SysCall MOS_DOSBase 432;
1890
ReadLinknull1891 function ReadLink(port : PMsgPort location 'd1';
1892 lock : BPTR location 'd2';
1893 path : PChar location 'd3';
1894 buffer: PChar location 'd4';
1895 size : Cardinal location 'd5'): LongBool;
1896 SysCall MOS_DOSBase 438;
1897
MakeLinknull1898 function MakeLink(name: PChar location 'd1';
1899 dest: LongInt location 'd2';
1900 soft: LongInt location 'd3'): LongBool;
1901 SysCall MOS_DOSBase 444;
1902
ChangeModenull1903 function ChangeMode(type1 : LongInt location 'd1';
1904 fh : BPTR location 'd2';
1905 newmode: LongInt location 'd3'): LongBool;
1906 SysCall MOS_DOSBase 450;
1907
SetFileSizenull1908 function SetFileSize(fh : BPTR location 'd1';
1909 pos : LongInt location 'd2';
1910 mode: LongInt location 'd3'): LongInt;
1911 SysCall MOS_DOSBase 456;
1912
SetIoErrnull1913 function SetIoErr(result: LongInt location 'd1'): LongInt;
1914 SysCall MOS_DOSBase 462;
1915
Faultnull1916 function Fault(code : LongInt location 'd1';
1917 header: PChar location 'd2';
1918 buffer: PChar location 'd3';
1919 len : LongInt location 'd4'): LongBool;
1920 SysCall MOS_DOSBase 468;
1921
PrintFaultnull1922 function PrintFault(code : LongInt location 'd1';
1923 header: PChar location 'd2'): LongBool;
1924 SysCall MOS_DOSBase 474;
1925
ErrorReportnull1926 function ErrorReport(code : LongInt location 'd1';
1927 type1 : LongInt location 'd2';
1928 arg1 : Cardinal location 'd3';
1929 device: PMsgPort location 'd4'): LongBool;
1930 SysCall MOS_DOSBase 480;
1931
Clinull1932 function Cli: PCommandLineInterface;
1933 SysCall MOS_DOSBase 492;
1934
CreateNewProcnull1935 function CreateNewProc(tags: PTagItem location 'd1'): PProcess;
1936 SysCall MOS_DOSBase 498;
1937
CreateNewProcTagListnull1938 function CreateNewProcTagList(tags: PTagItem location 'd1'): PProcess;
1939 SysCall MOS_DOSBase 498;
1940
RunCommandnull1941 function RunCommand(seg : BPTR location 'd1';
1942 stack : LongInt location 'd2';
1943 paramptr: PChar location 'd3';
1944 paramlen: LongInt location 'd4'): LongInt;
1945 SysCall MOS_DOSBase 504;
1946
GetConsoleTasknull1947 function GetConsoleTask: PMsgPort;
1948 SysCall MOS_DOSBase 510;
1949
SetConsoleTasknull1950 function SetConsoleTask(task: PMsgPort location 'd1'): PMsgPort;
1951 SysCall MOS_DOSBase 516;
1952
GetFileSysTasknull1953 function GetFileSysTask: PMsgPort;
1954 SysCall MOS_DOSBase 522;
1955
SetFileSysTasknull1956 function SetFileSysTask(task: PMsgPort location 'd1'): PMsgPort;
1957 SysCall MOS_DOSBase 528;
1958
GetArgStrnull1959 function GetArgStr: PChar;
1960 SysCall MOS_DOSBase 534;
1961
SetArgStrnull1962 function SetArgStr(str: PChar location 'd1'): LongBool;
1963 SysCall MOS_DOSBase 540;
1964
FindCliProcnull1965 function FindCliProc(num: Cardinal location 'd1'): PProcess;
1966 SysCall MOS_DOSBase 546;
1967
MaxClinull1968 function MaxCli: Cardinal;
1969 SysCall MOS_DOSBase 552;
1970
SetCurrentDirNamenull1971 function SetCurrentDirName(name: PChar location 'd1'): LongBool;
1972 SysCall MOS_DOSBase 558;
1973
GetCurrentDirNamenull1974 function GetCurrentDirName(buf: PChar location 'd1';
1975 len: LongInt location 'd2'): LongBool;
1976 SysCall MOS_DOSBase 564;
1977
SetProgramNamenull1978 function SetProgramName(name: PChar location 'd1'): LongBool;
1979 SysCall MOS_DOSBase 570;
1980
GetProgramNamenull1981 function GetProgramName(buf: PChar location 'd1';
1982 len: LongInt location 'd2'): LongBool;
1983 SysCall MOS_DOSBase 576;
1984
SetPromptnull1985 function SetPrompt(name: PChar location 'd1'): LongBool;
1986 SysCall MOS_DOSBase 582;
1987
GetPromptnull1988 function GetPrompt(buf: PChar location 'd1';
1989 len: LongInt location 'd2'): LongBool;
1990 SysCall MOS_DOSBase 588;
1991
SetProgramDirnull1992 function SetProgramDir(lock: BPTR location 'd1'): LongInt;
1993 SysCall MOS_DOSBase 594;
1994
GetProgramDirnull1995 function GetProgramDir: BPTR;
1996 SysCall MOS_DOSBase 600;
1997
SystemTagListnull1998 function SystemTagList(command: PChar location 'd1';
1999 tags : PTagItem location 'd2'): LongInt;
2000 SysCall MOS_DOSBase 606;
2001
dosSystemnull2002 function dosSystem(command: PChar location 'd1';
2003 tags : PTagItem location 'd2'): LongInt;
2004 SysCall MOS_DOSBase 606;
2005
AssignLocknull2006 function AssignLock(name: PChar location 'd1';
2007 lock: BPTR location 'd2'): LongBool;
2008 SysCall MOS_DOSBase 612;
2009
AssignLatenull2010 function AssignLate(name: PChar location 'd1';
2011 path: PChar location 'd2'): LongBool;
2012 SysCall MOS_DOSBase 618;
2013
AssignPathnull2014 function AssignPath(name: PChar location 'd1';
2015 path: PChar location 'd2'): LongBool;
2016 SysCall MOS_DOSBase 624;
2017
AssignAddnull2018 function AssignAdd(name: PChar location 'd1';
2019 lock: BPTR location 'd2'): LongBool;
2020 SysCall MOS_DOSBase 630;
2021
RemAssignListnull2022 function RemAssignList(name: PChar location 'd1';
2023 lock: BPTR location 'd2'): LongBool;
2024 SysCall MOS_DOSBase 636;
2025
GetDeviceProcnull2026 function GetDeviceProc(name: PChar location 'd1';
2027 dp : PDevProc location 'd2'): PDevProc;
2028 SysCall MOS_DOSBase 642;
2029
2030 procedure FreeDeviceProc(dp: PDevProc location 'd1');
2031 SysCall MOS_DOSBase 648;
2032
LockDosListnull2033 function LockDosList(flags: Cardinal location 'd1'): PDosList;
2034 SysCall MOS_DOSBase 654;
2035
2036 procedure UnLockDosList(flags: Cardinal location 'd1');
2037 SysCall MOS_DOSBase 660;
2038
AttemptLockDosListnull2039 function AttemptLockDosList(flags: Cardinal location 'd1'): PDosList;
2040 SysCall MOS_DOSBase 666;
2041
RemDosEntrynull2042 function RemDosEntry(dlist: PDosList location 'd1'): LongBool;
2043 SysCall MOS_DOSBase 672;
2044
AddDosEntrynull2045 function AddDosEntry(dlist: PDosList location 'd1'): LongInt;
2046 SysCall MOS_DOSBase 678;
2047
FindDosEntrynull2048 function FindDosEntry(dlist: PDosList location 'd1';
2049 name : PChar location 'd2';
2050 flags: Cardinal location 'd3'): PDosList;
2051 SysCall MOS_DOSBase 684;
2052
NextDosEntrynull2053 function NextDosEntry(dlist: PDosList location 'd1';
2054 flags: Cardinal location 'd2'): PDosList;
2055 SysCall MOS_DOSBase 690;
2056
MakeDosEntrynull2057 function MakeDosEntry(name : PChar location 'd1';
2058 type1: LongInt location 'd2'): PDosList;
2059 SysCall MOS_DOSBase 696;
2060
2061 procedure FreeDosEntry(dlist: PDosList location 'd1');
2062 SysCall MOS_DOSBase 702;
2063
IsFileSystemnull2064 function IsFileSystem(name: PChar location 'd1'): LongBool;
2065 SysCall MOS_DOSBase 708;
2066
Formatnull2067 function Format(filesystem: PChar location 'd1';
2068 volumename: PChar location 'd2';
2069 dostype : Cardinal location 'd3'): LongBool;
2070 SysCall MOS_DOSBase 714;
2071
Relabelnull2072 function Relabel(drive : PChar location 'd1';
2073 newname: PChar location 'd2'): LongBool;
2074 SysCall MOS_DOSBase 720;
2075
Inhibitnull2076 function Inhibit(name : PChar location 'd1';
2077 onoff: LongInt location 'd2'): LongBool;
2078 SysCall MOS_DOSBase 726;
2079
AddBuffersnull2080 function AddBuffers(name : PChar location 'd1';
2081 number: LongInt location 'd2'): LongBool;
2082 SysCall MOS_DOSBase 732;
2083
CompareDatesnull2084 function CompareDates(date1: PDateStamp location 'd1';
2085 date2: PDateStamp location 'd2'): LongInt;
2086 SysCall MOS_DOSBase 738;
2087
DOSDateToStrnull2088 function DOSDateToStr(datetime: _PDateTime location 'd1'): LongBool;
2089 SysCall MOS_DOSBase 744;
2090
DOSStrToDatenull2091 function DOSStrToDate(datetime: _PDateTime location 'd1'): LongBool;
2092 SysCall MOS_DOSBase 750;
2093
InternalLoadSegnull2094 function InternalLoadSeg(fh : BPTR location 'd0';
2095 table : LongInt location 'a0';
2096 var funcarray: LongInt location 'a1';
2097 var stack : LongInt location 'a2'): LongInt;
2098 SysCall MOS_DOSBase 756;
2099
NewLoadSegnull2100 function NewLoadSeg(file1: PChar location 'd1';
2101 tags : PTagItem location 'd2'): LongInt;
2102 SysCall MOS_DOSBase 768;
2103
NewLoadSegTagListnull2104 function NewLoadSegTagList(file1: PChar location 'd1';
2105 tags : PTagItem location 'd2'): LongInt;
2106 SysCall MOS_DOSBase 768;
2107
AddSegmentnull2108 function AddSegment(name : PChar location 'd1';
2109 seg : BPTR location 'd2';
2110 system: LongInt location 'd3'): LongBool;
2111 SysCall MOS_DOSBase 774;
2112
FindSegmentnull2113 function FindSegment(name : PChar location 'd1';
2114 seg : PSegment location 'd2';
2115 system: LongInt location 'd3'): PSegment;
2116 SysCall MOS_DOSBase 780;
2117
RemSegmentnull2118 function RemSegment(seg: PSegment location 'd1'): LongBool;
2119 SysCall MOS_DOSBase 786;
2120
CheckSignalnull2121 function CheckSignal(mask: LongInt location 'd1'): LongInt;
2122 SysCall MOS_DOSBase 792;
2123
ReadArgsnull2124 function ReadArgs(arg_template: PChar location 'd1';
2125 var array1 : LongInt location 'd2';
2126 args : PRDArgs location 'd3'): PRDArgs;
2127 SysCall MOS_DOSBase 798;
2128
FindArgnull2129 function FindArg(keyword : PChar location 'd1';
2130 arg_template: PChar location 'd2'): LongInt;
2131 SysCall MOS_DOSBase 804;
2132
ReadItemnull2133 function ReadItem(name : PChar location 'd1';
2134 maxchars: LongInt location 'd2';
2135 cSource : PCSource location 'd3'): LongInt;
2136 SysCall MOS_DOSBase 810;
2137
StrToLongnull2138 function StrToLong(string1 : PChar location 'd1';
2139 var value: LongInt location 'd2'): LongInt;
2140 SysCall MOS_DOSBase 816;
2141
MatchFirstnull2142 function MatchFirst(pat : PChar location 'd1';
2143 anchor: PAnchorPath location 'd2'): LongInt;
2144 SysCall MOS_DOSBase 822;
2145
MatchNextnull2146 function MatchNext(anchor: PAnchorPath location 'd1'): LongInt;
2147 SysCall MOS_DOSBase 828;
2148
2149 procedure MatchEnd(anchor: PAnchorPath location 'd1');
2150 SysCall MOS_DOSBase 834;
2151
ParsePatternnull2152 function ParsePattern(pat : PChar location 'd1';
2153 buf : PChar location 'd2';
2154 buflen: LongInt location 'd3'): LongInt;
2155 SysCall MOS_DOSBase 840;
2156
MatchPatternnull2157 function MatchPattern(pat: PChar location 'd1';
2158 str: PChar location 'd2'): LongBool;
2159 SysCall MOS_DOSBase 846;
2160
2161 procedure FreeArgs(args: pRDArgs location 'd1');
2162 SysCall MOS_DOSBase 858;
2163
FilePartnull2164 function FilePart(path: PChar location 'd1'): PChar;
2165 SysCall MOS_DOSBase 870;
2166
PathPartnull2167 function PathPart(path: PChar location 'd1'): PChar;
2168 SysCall MOS_DOSBase 876;
2169
AddPartnull2170 function AddPart(dirname: PChar location 'd1';
2171 filename: PChar location 'd2';
2172 size : Cardinal location 'd3'): LongBool;
2173 SysCall MOS_DOSBase 882;
2174
StartNotifynull2175 function StartNotify(notify: PNotifyRequest location 'd1'): LongBool;
2176 SysCall MOS_DOSBase 888;
2177
2178 procedure EndNotify(notify: PNotifyRequest location 'd1');
2179 SysCall MOS_DOSBase 894;
2180
SetVarnull2181 function SetVar(name : PChar location 'd1';
2182 buffer: PChar location 'd2';
2183 size : LongInt location 'd3';
2184 flags : LongInt location 'd4'): LongBool;
2185 SysCall MOS_DOSBase 900;
2186
GetVarnull2187 function GetVar(name : PChar location 'd1';
2188 buffer: PChar location 'd2';
2189 size : LongInt location 'd3';
2190 flags : LongInt location 'd4'): LongInt;
2191 SysCall MOS_DOSBase 906;
2192
DeleteVarnull2193 function DeleteVar(name : PChar location 'd1';
2194 flags: Cardinal location 'd2'): LongBool;
2195 SysCall MOS_DOSBase 912;
2196
FindVarnull2197 function FindVar(name : PChar location 'd1';
2198 type1: Cardinal location 'd2'): PLocalVar;
2199 SysCall MOS_DOSBase 918;
2200
CliInitNewclinull2201 function CliInitNewcli(dp: PDosPacket location 'a0'): LongInt;
2202 SysCall MOS_DOSBase 930;
2203
CliInitRunnull2204 function CliInitRun(dp: PDosPacket location 'a0'): LongInt;
2205 SysCall MOS_DOSBase 936;
2206
WriteCharsnull2207 function WriteChars(buf : PChar location 'd1';
2208 buflen: Cardinal location 'd2'): LongInt;
2209 SysCall MOS_DOSBase 942;
2210
PutStrnull2211 function PutStr(str: PChar location 'd1'): LongInt;
2212 SysCall MOS_DOSBase 948;
2213
VPrintfnull2214 function VPrintf(format : PChar location 'd1';
2215 argarray: Pointer location 'd2'): LongInt;
2216 SysCall MOS_DOSBase 954;
2217
ParsePatternNoCasenull2218 function ParsePatternNoCase(pat : PChar location 'd1';
2219 buf : PChar location 'd2';
2220 buflen: LongInt location 'd3'): LongInt;
2221 SysCall MOS_DOSBase 966;
2222
MatchPatternNoCasenull2223 function MatchPatternNoCase(pat: PChar location 'd1';
2224 str: PChar location 'd2'): LongBool;
2225 SysCall MOS_DOSBase 972;
2226
SameDevicenull2227 function SameDevice(lock1: BPTR location 'd1';
2228 lock2: BPTR location 'd2'): LongBool;
2229 SysCall MOS_DOSBase 984;
2230
2231 procedure ExAllEnd(lock : LongInt location 'd1';
2232 buffer : PExAllData location 'd2';
2233 size : LongInt location 'd3';
2234 data : LongInt location 'd4';
2235 control: PExAllControl location 'd5');
2236 SysCall MOS_DOSBase 990;
2237
SetOwnernull2238 function SetOwner(name : PChar location 'd1';
2239 owner_info: LongInt location 'd2'): LongBool;
2240 SysCall MOS_DOSBase 996;
2241
AddSegmentTagListnull2242 function AddSegmentTagList(tags: PTagItem location 'a0'): LongInt;
2243 SysCall MOS_DOSBase 1002;
2244
FindSegmentTagListnull2245 function FindSegmentTagList(tags: PTagItem location 'a0'): PSegment;
2246 SysCall MOS_DOSBase 1008;
2247
2248 // MorphOS Specific
2249
Seek64null2250 function Seek64(fh: BPTR; Position: Int64; Mode: LongInt): Int64; syscall BaseSysV MOS_DOSBase 1066;
SetFileSize64null2251 function SetFileSize64(fh: BPTR; Pos: Int64; Mode: LongInt): Int64; syscall BaseSysV MOS_DOSBase 1072;
LockRecord64null2252 function LockRecord64(fh: BPTR; Offset, Length: QWord; Mode, TimeOut: LongWord): LongInt; syscall BaseSysV MOS_DOSBase 1078;
LockRecords64null2253 function LockRecords64(RecArray: TRecordLock64; TimeOut: LongWord): LongInt; syscall BaseSysV MOS_DOSBase 1084;
UnLockRecord64null2254 function UnLockRecord64(Fh: BPTR; Offset, Length: QWord): LongInt; syscall BaseSysV MOS_DOSBase 1090;
UnLockRecords64null2255 function UnLockRecords64(RecArray: TRecordLock64): LongInt; syscall BaseSysV MOS_DOSBase 1096;
NewReadLinknull2256 function NewReadLink(Port: PMsgPort; Lock: BPTR; Path: STRPTR; Buffer: PByte; Size: LongInt): LongInt; syscall BaseSysV MOS_DOSBase 1114;
GetFileSysAttrnull2257 function GetFileSysAttr(DeviceName: STRPTR; Attr: LongInt; Storage: APTR; StorageSize: LongInt): LongInt; syscall BaseSysV MOS_DOSBase 1120;
GetSegListAttrnull2258 function GetSegListAttr(SegList: BPTR; Attr: LongInt; Storage: APTR; StorageSize: LongInt): LongInt; syscall BaseSysV MOS_DOSBase 1126;
SetDosObjectAttrnull2259 function SetDosObjectAttr(Type_: LongWord; Ptr: APTR; Tags: PTagItem): LongInt; syscall BaseSysV MOS_DOSBase 1132;
GetDosObjectAttrnull2260 function GetDosObjectAttr(Type_: LongWord; Ptr: APTR; Tags: PTagItem): LongInt; syscall BaseSysV MOS_DOSBase 1138;
Examine64null2261 function Examine64(Lock: BPTR; Fib: PFileInfoBlock; Tags: PTagItem): LongInt; syscall BaseSysV MOS_DOSBase 1144;
Examine64TagListnull2262 function Examine64TagList(Lock: BPTR; Fib: PFileInfoBlock; Tags: PTagItem): LongInt; syscall BaseSysV MOS_DOSBase 1144;
ExNext64null2263 function ExNext64(Lock: BPTR; Fib: PFileInfoBlock; Tags: PTagItem): LongInt; syscall BaseSysV MOS_DOSBase 1150;
ExNext64TagListnull2264 function ExNext64TagList(Lock: BPTR; Fib: PFileInfoBlock; Tags: PTagItem): LongInt; syscall BaseSysV MOS_DOSBase 1150;
ExamineFH64null2265 function ExamineFH64(Fh: BPTR; Fib: PFileInfoBlock; Tags: PTagItem): LongInt; syscall BaseSysV MOS_DOSBase 1156;
ExamineFH64TagListnull2266 function ExamineFH64TagList(Fh: BPTR; Fib: PFileInfoBlock; Tags: PTagItem): LongInt; syscall BaseSysV MOS_DOSBase 1156;
2267
2268
2269 { * dos global definitions (V50)
2270 *********************************************************************
2271 * }
2272
BADDRnull2273 function BADDR(x: BPTR): Pointer; Inline;
MKBADDRnull2274 function MKBADDR(x: Pointer): BPTR; Inline;
2275
2276
2277 { * dos stdio definitions
2278 *********************************************************************
2279 * }
2280
ReadCharnull2281 function ReadChar: LongInt; Inline;
WriteCharnull2282 function WriteChar(ch: Char): LongInt; Inline;
UnReadCharnull2283 function UnReadChar(ch: Char): LongInt; Inline;
ReadCharsnull2284 function ReadChars(buf: Pointer; num: LongInt): LongInt; Inline;
dosReadLnnull2285 function dosReadLn(buf: PChar; num: LongInt): PChar; Inline;
dosWriteStrnull2286 function dosWriteStr(str: PChar): LongInt; Inline;
2287 procedure VWritef(format: PChar; argv: Pointer); Inline;
2288
2289
2290 { * calls with tags workarounds (should be removed later)
2291 *********************************************************************
2292 * }
2293
CreateNewProcTagsnull2294 function CreateNewProcTags(tags: array of dword): PProcess; Inline;
AllocDosObjectTagsnull2295 function AllocDosObjectTags(type1: Cardinal; Tags: array of DWord): Pointer; inline;
SystemTagsnull2296 function SystemTags(command: PChar; Tags: array of DWord): LongInt; Inline;
2297
SetDosObjectAttrTagListnull2298 function SetDosObjectAttrTagList(Type_: LongWord; Ptr: APTR; const Tags: array of PtrUInt): LongInt; inline;
GetDosObjectAttrTagListnull2299 function GetDosObjectAttrTagList(Type_: LongWord; Ptr: APTR; const Tags: array of PtrUInt): LongInt; inline;
Examine64Tagsnull2300 function Examine64Tags(Lock: BPTR; Fib: PFileInfoBlock; const Tags: array of PtrUInt): LongInt; inline;
ExNext64Tagsnull2301 function ExNext64Tags(Lock: BPTR; Fib: PFileInfoBlock; const Tags: array of PtrUInt): LongInt; inline;
ExamineFH64Tagsnull2302 function ExamineFH64Tags(Fh: BPTR; Fib: PFileInfoBlock; const Tags: array of PtrUInt): LongInt; inline;
2303
2304 implementation
2305
2306
2307 { * dos stdio definitions
2308 *********************************************************************
2309 * }
2310
ReadCharnull2311 function ReadChar: LongInt; Inline;
2312 begin
2313 ReadChar:=FGetC(dosInput);
2314 end;
2315
WriteCharnull2316 function WriteChar(ch: Char): LongInt; Inline;
2317 begin
2318 WriteChar:=FPutC(dosOutput,Byte(ch));
2319 end;
2320
UnReadCharnull2321 function UnReadChar(ch: Char): LongInt; Inline;
2322 begin
2323 UnReadChar:=UnGetC(dosInput,Byte(ch));
2324 end;
2325
ReadCharsnull2326 function ReadChars(buf: Pointer; num: LongInt): LongInt; Inline;
2327 begin
2328 ReadChars:=FRead(dosInput,buf,1,num);
2329 end;
2330
dosReadLnnull2331 function dosReadLn(buf: PChar; num: LongInt): PChar; Inline;
2332 begin
2333 dosReadLn:=FGets(dosInput,buf,num);
2334 end;
2335
dosWriteStrnull2336 function dosWriteStr(str: PChar): LongInt; Inline;
2337 begin
2338 dosWriteStr:=FPuts(dosOutput,str);
2339 end;
2340
2341 procedure VWritef(format: PChar; argv: Pointer); Inline;
2342 begin
2343 VFWritef(dosOutput,format,argv);
2344 end;
2345
2346
2347
2348 { * dos global definitions (V50)
2349 *********************************************************************
2350 * }
2351
2352
BADDRnull2353 function BADDR(x: BPTR): Pointer; Inline;
2354 begin
2355 BADDR:=Pointer(x Shl 2);
2356 end;
2357
MKBADDRnull2358 function MKBADDR(x: Pointer): BPTR; Inline;
2359 begin
2360 MKBADDR:=LongInt(PtrUInt(x)) Shr 2;
2361 end;
2362
2363
2364
2365 { * calls with tags workarounds (should be removed later)
2366 *********************************************************************
2367 * }
2368
CreateNewProcTagsnull2369 function CreateNewProcTags(tags: array of DWord): PProcess; Inline;
2370 begin
2371 CreateNewProcTags:=CreateNewProc(@tags);
2372 end;
2373
AllocDosObjectTagsnull2374 function AllocDosObjectTags(type1: Cardinal; Tags: array of DWord): Pointer; inline;
2375 begin
2376 AllocDosObjectTags := AllocDosObject(type1, @Tags);
2377 end;
2378
SystemTagsnull2379 function SystemTags(command: PChar; Tags: array of DWord): LongInt;
2380 begin
2381 SystemTags := SystemTagList(Command, @Tags);
2382 end;
2383
SetDosObjectAttrTagListnull2384 function SetDosObjectAttrTagList(Type_: LongWord; Ptr: APTR; const Tags: array of PtrUInt): LongInt;
2385 begin
2386 SetDosObjectAttrTagList := SetDosObjectAttr(Type_, Ptr, @Tags);
2387 end;
2388
GetDosObjectAttrTagListnull2389 function GetDosObjectAttrTagList(Type_: LongWord; Ptr: APTR; const Tags: array of PtrUInt): LongInt;
2390 begin
2391 GetDosObjectAttrTagList := GetDosObjectAttr(Type_, Ptr, @Tags);
2392 end;
2393
Examine64Tagsnull2394 function Examine64Tags(Lock: BPTR; Fib: PFileInfoBlock; const Tags: array of PtrUInt): LongInt;
2395 begin
2396 Examine64Tags := Examine64(Lock, Fib, @Tags);
2397 end;
2398
ExNext64Tagsnull2399 function ExNext64Tags(Lock: BPTR; Fib: PFileInfoBlock; const Tags: array of PtrUInt): LongInt;
2400 begin
2401 ExNext64Tags := ExNext64(Lock, Fib, @Tags);
2402 end;
2403
ExamineFH64Tagsnull2404 function ExamineFH64Tags(Fh: BPTR; Fib: PFileInfoBlock; const Tags: array of PtrUInt): LongInt;
2405 begin
2406 ExamineFH64Tags := ExamineFH64(Fh, Fib, @Tags);
2407 end;
2408
2409 begin
2410 DosBase:=MOS_DOSBase;
2411 end.
2412