amigados.pas 56 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164
  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. dos.library interface unit for MorphOS/PowerPC
  5. MorphOS port was done on a free Pegasos II/G4 machine
  6. provided by Genesi S.a.r.l. <www.genesi.lu>
  7. See the file COPYING.FPC, included in this distribution,
  8. for details about the copyright.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. **********************************************************************}
  13. {$INLINE ON}
  14. {$PACKRECORDS 2}
  15. unit AmigaDOS;
  16. interface
  17. uses Exec, Timer;
  18. var
  19. DosBase: Pointer;
  20. { * dos global definitions (V50)
  21. *********************************************************************
  22. * }
  23. const
  24. DOSNAME = 'dos.library';
  25. const
  26. DOSTRUE = -1;
  27. DOSFALSE = 0;
  28. const
  29. MODE_OLDFILE = 1005;
  30. MODE_NEWFILE = 1006;
  31. MODE_READWRITE = 1004;
  32. const
  33. OFFSET_BEGINNING = -1;
  34. OFFSET_CURRENT = 0;
  35. OFFSET_END = 1;
  36. OFFSET_BEGINING = OFFSET_BEGINNING; { * Typo fix * }
  37. const
  38. BITSPERBYTE = 8;
  39. BYTESPERLONG = 4;
  40. BITSPERLONG = 32;
  41. _MAXINT = $7FFFFFFF;
  42. _MININT = $80000000;
  43. const
  44. SHARED_LOCK = -2;
  45. ACCESS_READ = -2;
  46. EXCLUSIVE_LOCK = -1;
  47. ACCESS_WRITE = -1;
  48. type
  49. PDateStamp = ^TDateStamp;
  50. TDateStamp = packed record
  51. ds_Days : LongInt;
  52. ds_Minute: LongInt;
  53. ds_Tick : LongInt;
  54. end;
  55. const
  56. TICKS_PER_SECOND = 50;
  57. type
  58. PFileInfoBlock = ^TFileInfoBlock;
  59. TFileInfoBlock = packed record
  60. fib_DiskKey : LongInt;
  61. fib_DirEntryType: LongInt;
  62. fib_FileName : Array[0..107] Of Char;
  63. fib_Protection : LongInt;
  64. fib_EntryType : LongInt;
  65. fib_Size : LongInt;
  66. fib_NumBlocks : LongInt;
  67. fib_Date : TDateStamp;
  68. fib_Comment : Array[0..79] Of Char;
  69. fib_OwnerUID : Word;
  70. fib_OwnerGID : Word;
  71. fib_Reserved : Array[0..31] Of Char;
  72. end;
  73. const
  74. FIBB_OTR_READ = 15;
  75. FIBB_OTR_WRITE = 14;
  76. FIBB_OTR_EXECUTE = 13;
  77. FIBB_OTR_DELETE = 12;
  78. FIBB_GRP_READ = 11;
  79. FIBB_GRP_WRITE = 10;
  80. FIBB_GRP_EXECUTE = 9;
  81. FIBB_GRP_DELETE = 8;
  82. FIBB_SCRIPT = 6;
  83. FIBB_PURE = 5;
  84. FIBB_ARCHIVE = 4;
  85. FIBB_READ = 3;
  86. FIBB_WRITE = 2;
  87. FIBB_EXECUTE = 1;
  88. FIBB_DELETE = 0;
  89. const
  90. FIBF_OTR_READ = (1 Shl FIBB_OTR_READ);
  91. FIBF_OTR_WRITE = (1 Shl FIBB_OTR_WRITE);
  92. FIBF_OTR_EXECUTE = (1 Shl FIBB_OTR_EXECUTE);
  93. FIBF_OTR_DELETE = (1 Shl FIBB_OTR_DELETE);
  94. FIBF_GRP_READ = (1 Shl FIBB_GRP_READ);
  95. FIBF_GRP_WRITE = (1 Shl FIBB_GRP_WRITE);
  96. FIBF_GRP_EXECUTE = (1 Shl FIBB_GRP_EXECUTE);
  97. FIBF_GRP_DELETE = (1 Shl FIBB_GRP_DELETE);
  98. FIBF_SCRIPT = (1 Shl FIBB_SCRIPT);
  99. FIBF_PURE = (1 Shl FIBB_PURE);
  100. FIBF_ARCHIVE = (1 Shl FIBB_ARCHIVE);
  101. FIBF_READ = (1 Shl FIBB_READ);
  102. FIBF_WRITE = (1 Shl FIBB_WRITE);
  103. FIBF_EXECUTE = (1 Shl FIBB_EXECUTE);
  104. FIBF_DELETE = (1 Shl FIBB_DELETE);
  105. const
  106. FAULT_MAX = 82;
  107. type
  108. BPTR = LongInt;
  109. BSTR = LongInt;
  110. type
  111. PInfoData = ^TInfoData;
  112. TInfoData = packed record
  113. id_NumSoftErrors: LongInt;
  114. id_UnitNumber : LongInt;
  115. id_DiskState : LongInt;
  116. id_NumBlocks : LongInt;
  117. id_NumBlocksUsed: LongInt;
  118. id_BytesPerBlock: LongInt;
  119. id_DiskType : LongInt;
  120. id_VolumeNode : LongInt; {BPTR}
  121. id_InUse : LongInt;
  122. end;
  123. const
  124. ID_WRITE_PROTECTED = 80;
  125. ID_VALIDATING = 81;
  126. ID_VALIDATED = 82;
  127. ID_NO_DISK_PRESENT = -1;
  128. ID_UNREADABLE_DISK = $42414400;
  129. ID_DOS_DISK = $444F5300;
  130. ID_FFS_DISK = $444F5301;
  131. ID_INTER_DOS_DISK = $444F5302;
  132. ID_INTER_FFS_DISK = $444F5303;
  133. ID_FASTDIR_DOS_DISK = $444F5304;
  134. ID_FASTDIR_FFS_DISK = $444F5305;
  135. ID_LNFS_DOS_DISK = $444F5306;
  136. ID_LNFS_FFS_DISK = $444F5307;
  137. ID_NOT_REALLY_DOS = $4E444F53;
  138. ID_KICKSTART_DISK = $4B49434B;
  139. ID_MSDOS_DISK = $4d534400;
  140. const
  141. ERROR_NO_FREE_STORE = 103;
  142. ERROR_TASK_TABLE_FULL = 105;
  143. ERROR_BAD_TEMPLATE = 114;
  144. ERROR_BAD_NUMBER = 115;
  145. ERROR_REQUIRED_ARG_MISSING = 116;
  146. ERROR_KEY_NEEDS_ARG = 117;
  147. ERROR_TOO_MANY_ARGS = 118;
  148. ERROR_UNMATCHED_QUOTES = 119;
  149. ERROR_LINE_TOO_LONG = 120;
  150. ERROR_FILE_NOT_OBJECT = 121;
  151. ERROR_INVALID_RESIDENT_LIBRARY = 122;
  152. ERROR_NO_DEFAULT_DIR = 201;
  153. ERROR_OBJECT_IN_USE = 202;
  154. ERROR_OBJECT_EXISTS = 203;
  155. ERROR_DIR_NOT_FOUND = 204;
  156. ERROR_OBJECT_NOT_FOUND = 205;
  157. ERROR_BAD_STREAM_NAME = 206;
  158. ERROR_OBJECT_TOO_LARGE = 207;
  159. ERROR_ACTION_NOT_KNOWN = 209;
  160. ERROR_INVALID_COMPONENT_NAME = 210;
  161. ERROR_INVALID_LOCK = 211;
  162. ERROR_OBJECT_WRONG_TYPE = 212;
  163. ERROR_DISK_NOT_VALIDATED = 213;
  164. ERROR_DISK_WRITE_PROTECTED = 214;
  165. ERROR_RENAME_ACROSS_DEVICES = 215;
  166. ERROR_DIRECTORY_NOT_EMPTY = 216;
  167. ERROR_TOO_MANY_LEVELS = 217;
  168. ERROR_DEVICE_NOT_MOUNTED = 218;
  169. ERROR_SEEK_ERROR = 219;
  170. ERROR_COMMENT_TOO_BIG = 220;
  171. ERROR_DISK_FULL = 221;
  172. ERROR_DELETE_PROTECTED = 222;
  173. ERROR_WRITE_PROTECTED = 223;
  174. ERROR_READ_PROTECTED = 224;
  175. ERROR_NOT_A_DOS_DISK = 225;
  176. ERROR_NO_DISK = 226;
  177. ERROR_NO_MORE_ENTRIES = 232;
  178. ERROR_IS_SOFT_LINK = 233;
  179. ERROR_OBJECT_LINKED = 234;
  180. ERROR_BAD_HUNK = 235;
  181. ERROR_NOT_IMPLEMENTED = 236;
  182. ERROR_RECORD_NOT_LOCKED = 240;
  183. ERROR_LOCK_COLLISION = 241;
  184. ERROR_LOCK_TIMEOUT = 242;
  185. ERROR_UNLOCK_ERROR = 243;
  186. const
  187. RETURN_OK = 0;
  188. RETURN_WARN = 5;
  189. RETURN_ERROR = 10;
  190. RETURN_FAIL = 20;
  191. const
  192. SIGBREAKB_CTRL_C = 12;
  193. SIGBREAKB_CTRL_D = 13;
  194. SIGBREAKB_CTRL_E = 14;
  195. SIGBREAKB_CTRL_F = 15;
  196. SIGBREAKF_CTRL_C = (1 Shl SIGBREAKB_CTRL_C);
  197. SIGBREAKF_CTRL_D = (1 Shl SIGBREAKB_CTRL_D);
  198. SIGBREAKF_CTRL_E = (1 Shl SIGBREAKB_CTRL_E);
  199. SIGBREAKF_CTRL_F = (1 Shl SIGBREAKB_CTRL_F);
  200. const
  201. LOCK_DIFFERENT = -1;
  202. LOCK_SAME = 0;
  203. LOCK_SAME_VOLUME = 1;
  204. LOCK_SAME_HANDLER = LOCK_SAME_VOLUME;
  205. const
  206. CHANGE_LOCK = 0;
  207. CHANGE_FH = 1;
  208. const
  209. LINK_HARD = 0;
  210. LINK_SOFT = 1;
  211. const
  212. ITEM_EQUAL = -2;
  213. ITEM_ERROR = -1;
  214. ITEM_NOTHING = 0;
  215. ITEM_UNQUOTED = 1;
  216. ITEM_QUOTED = 2;
  217. const
  218. DOS_FILEHANDLE = 0;
  219. DOS_EXALLCONTROL = 1;
  220. DOS_FIB = 2;
  221. DOS_STDPKT = 3;
  222. DOS_CLI = 4;
  223. DOS_RDARGS = 5;
  224. { * dos date/time definitions
  225. *********************************************************************
  226. * }
  227. type
  228. { * Required to avoid conflict with default types * }
  229. _PDateTime = ^_TDateTime;
  230. _TDateTime = packed record
  231. dat_Stamp : TDateStamp;
  232. dat_Format : Byte;
  233. dat_Flags : Byte;
  234. dat_StrDay : Pointer;
  235. dat_StrDate: Pointer;
  236. dat_StrTime: Pointer;
  237. end;
  238. const
  239. LEN_DATSTRING = 16;
  240. const
  241. DTB_SUBST = 0;
  242. DTF_SUBST = (1 Shl DTB_SUBST);
  243. DTB_FUTURE = 1;
  244. DTF_FUTURE = (1 Shl DTB_FUTURE);
  245. const
  246. FORMAT_DOS = 0;
  247. FORMAT_INT = 1;
  248. FORMAT_USA = 2;
  249. FORMAT_CDN = 3;
  250. FORMAT_MAX = FORMAT_CDN;
  251. FORMAT_DEF = 4;
  252. { * dos extended structures definitions
  253. *********************************************************************
  254. * }
  255. type
  256. PProcess = ^TProcess;
  257. TProcess = packed record
  258. pr_Task : TTask;
  259. pr_MsgPort : TMsgPort;
  260. pr_Pad : Word;
  261. pr_SegList : DWord; { BPTR }
  262. pr_StackSize : LongInt; { 68k stacksize! }
  263. pr_GlobVec : Pointer;
  264. pr_TaskNum : LongInt;
  265. pr_StackBase : DWord; { BPTR }
  266. pr_Result2 : LongInt;
  267. pr_CurrentDir : DWord; { BPTR }
  268. pr_CIS : DWord; { BPTR }
  269. pr_COS : DWord; { BPTR }
  270. pr_ConsoleTask : Pointer;
  271. pr_FileSystemTask: Pointer;
  272. pr_CLI : DWord; { BPTR }
  273. pr_ReturnAddr : Pointer;
  274. pr_PktWait : Pointer;
  275. pr_WindowPtr : Pointer;
  276. pr_HomeDir : DWord; { BPTR }
  277. pr_Flags : LongInt;
  278. pr_ExitCode : Pointer; { Procedure }
  279. pr_ExitData : LongInt;
  280. pr_Arguments : PChar;
  281. pr_LocalVars : TMinList;
  282. pr_ShellPrivate : DWord;
  283. pr_CES : DWord; { BPTR }
  284. end;
  285. const
  286. PRB_FREESEGLIST = 0;
  287. PRF_FREESEGLIST = (1 Shl PRB_FREESEGLIST);
  288. PRB_FREECURRDIR = 1;
  289. PRF_FREECURRDIR = (1 Shl PRB_FREECURRDIR);
  290. PRB_FREECLI = 2;
  291. PRF_FREECLI = (1 Shl PRB_FREECLI);
  292. PRB_CLOSEINPUT = 3;
  293. PRF_CLOSEINPUT = (1 Shl PRB_CLOSEINPUT);
  294. PRB_CLOSEOUTPUT = 4;
  295. PRF_CLOSEOUTPUT = (1 Shl PRB_CLOSEOUTPUT);
  296. PRB_FREEARGS = 5;
  297. PRF_FREEARGS = (1 Shl PRB_FREEARGS);
  298. type
  299. PFileHandle = ^TFileHandle;
  300. TFileHandle = packed record
  301. fh_Flags : DWord;
  302. fh_Interactive: LongInt;
  303. fh_Type : PMsgPort;
  304. fh_Buf : LongInt;
  305. fh_Pos : LongInt;
  306. fh_End : LongInt;
  307. fh_Func1 : LongInt;
  308. fh_Func2 : LongInt;
  309. fh_Func3 : LongInt;
  310. fh_Arg1 : LongInt;
  311. fh_Arg2 : LongInt;
  312. { *** V50 MorphOS *** }
  313. fh_BufSize : LongInt;
  314. fh_OrigBuf : LongInt;
  315. end;
  316. type
  317. PDOSPacket = ^TDOSPacket;
  318. TDOSPacket = packed record
  319. dp_Link: PMessage;
  320. dp_Port: PMsgPort;
  321. case Byte of
  322. 0 : ( dp_Action : Longint;
  323. dp_Status : Longint;
  324. dp_Status2: Longint;
  325. dp_BufAddr: Longint;
  326. );
  327. 1 : ( dp_Type: Longint;
  328. dp_Res1: Longint;
  329. dp_Res2: Longint;
  330. dp_Arg1: Longint;
  331. dp_Arg2: Longint;
  332. dp_Arg3: Longint;
  333. dp_Arg4: Longint;
  334. dp_Arg5: Longint;
  335. dp_Arg6: Longint;
  336. dp_Arg7: Longint;
  337. );
  338. end;
  339. type
  340. PStandardPacket = ^TStandardPacket;
  341. TStandardPacket = packed record
  342. sp_Msg: TMessage;
  343. sp_Pkt: TDOSPacket;
  344. end;
  345. const
  346. ACTION_NIL = 0;
  347. ACTION_STARTUP = 0;
  348. ACTION_GET_BLOCK = 2; { *** OBSOLETE *** }
  349. ACTION_SET_MAP = 4;
  350. ACTION_DIE = 5;
  351. ACTION_EVENT = 6;
  352. ACTION_CURRENT_VOLUME = 7;
  353. ACTION_LOCATE_OBJECT = 8;
  354. ACTION_RENAME_DISK = 9;
  355. ACTION_WRITE = 'W';
  356. ACTION_READ = 'R';
  357. ACTION_FREE_LOCK = 15;
  358. ACTION_DELETE_OBJECT = 16;
  359. ACTION_RENAME_OBJECT = 17;
  360. ACTION_MORE_CACHE = 18;
  361. ACTION_COPY_DIR = 19;
  362. ACTION_WAIT_CHAR = 20;
  363. ACTION_SET_PROTECT = 21;
  364. ACTION_CREATE_DIR = 22;
  365. ACTION_EXAMINE_OBJECT = 23;
  366. ACTION_EXAMINE_NEXT = 24;
  367. ACTION_DISK_INFO = 25;
  368. ACTION_INFO = 26;
  369. ACTION_FLUSH = 27;
  370. ACTION_SET_COMMENT = 28;
  371. ACTION_PARENT = 29;
  372. ACTION_TIMER = 30;
  373. ACTION_INHIBIT = 31;
  374. ACTION_DISK_TYPE = 32;
  375. ACTION_DISK_CHANGE = 33;
  376. ACTION_SET_DATE = 34;
  377. ACTION_SAME_LOCK = 40;
  378. ACTION_SCREEN_MODE = 994;
  379. ACTION_CHANGE_SIGNAL = 995;
  380. ACTION_READ_RETURN = 1001;
  381. ACTION_WRITE_RETURN = 1002;
  382. ACTION_SEEK = 1008;
  383. ACTION_FINDUPDATE = 1004;
  384. ACTION_FINDINPUT = 1005;
  385. ACTION_FINDOUTPUT = 1006;
  386. ACTION_END = 1007;
  387. ACTION_FORMAT = 1020;
  388. ACTION_MAKE_LINK = 1021;
  389. ACTION_SET_FILE_SIZE = 1022;
  390. ACTION_WRITE_PROTECT = 1023;
  391. ACTION_READ_LINK = 1024;
  392. ACTION_FH_FROM_LOCK = 1026;
  393. ACTION_IS_FILESYSTEM = 1027;
  394. ACTION_CHANGE_MODE = 1028;
  395. ACTION_COPY_DIR_FH = 1030;
  396. ACTION_PARENT_FH = 1031;
  397. ACTION_EXAMINE_ALL = 1033;
  398. ACTION_EXAMINE_FH = 1034;
  399. ACTION_EXAMINE_ALL_END = 1035;
  400. ACTION_SET_OWNER = 1036;
  401. ACTION_LOCK_RECORD = 2008;
  402. ACTION_FREE_RECORD = 2009;
  403. ACTION_ADD_NOTIFY = 4097;
  404. ACTION_REMOVE_NOTIFY = 4098;
  405. ACTION_SERIALIZE_DISK = 4200;
  406. ACTION_GET_DISK_FSSM = 4201;
  407. ACTION_FREE_DISK_FSSM = 4202;
  408. type
  409. PErrorString = ^TErrorString;
  410. TErrorString = packed record
  411. estr_Nums: Pointer; { ^LongInt }
  412. estr_Byte: Pointer; { ^Byte }
  413. end;
  414. type
  415. PRootNode = ^TRootNode;
  416. TRootNode = packed record
  417. rn_TaskArray : DWord; { BPTR }
  418. rn_ConsoleSegment : DWord; { BPTR }
  419. rn_Time : TDateStamp;
  420. rn_RestartSeg : LongInt;
  421. rn_Info : DWord; { BPTR }
  422. rn_FileHandlerSegment: DWord; { BPTR }
  423. rn_CliList : TMinList;
  424. rn_BootProc : PMsgPort;
  425. rn_ShellSegment : DWord; { BPTR }
  426. rn_Flags : LongInt;
  427. end;
  428. type
  429. PDOSLibrary = ^TDOSLibrary;
  430. TDOSLibrary = packed record
  431. dl_Lib : TLibrary;
  432. dl_Root : PRootNode;
  433. dl_GU : Pointer;
  434. dl_A2 : LongInt;
  435. dl_A5 : LongInt;
  436. dl_A6 : LongInt;
  437. dl_Errors : PErrorString;
  438. dl_TimeReq : PTimeRequest;
  439. dl_UtilityBase : PLibrary;
  440. dl_IntuitionBase: PLibrary;
  441. end;
  442. const
  443. RNB_WILDSTAR = 24;
  444. RNF_WILDSTAR = (1 Shl RNB_WILDSTAR);
  445. RNB_PRIVATE1 = 1;
  446. RNF_PRIVATE1 = (1 Shl RNB_PRIVATE1);
  447. type
  448. PCliProcList = ^TCliProcList;
  449. TCliProcList = packed record
  450. cpl_Node : TMinNode;
  451. cpl_First: LongInt;
  452. cpl_Array: Array[0..0] Of PMsgPort;
  453. end;
  454. type
  455. PDOSInfo = ^TDOSInfo;
  456. TDOSInfo = packed record
  457. case Byte of
  458. 0 : ( di_ResList: DWord; { BPTR }
  459. );
  460. 1 : ( di_McName : DWord; { BPTR }
  461. di_DevInfo : DWord; { BPTR }
  462. di_Devices : DWord; { BPTR }
  463. di_Handlers : DWord; { BPTR }
  464. di_NetHand : Pointer;
  465. di_DevLock : TSignalSemaphore;
  466. di_EntryLock : TSignalSemaphore;
  467. di_DeleteLock: TSignalSemaphore;
  468. );
  469. end;
  470. type
  471. PSegment = ^TSegment;
  472. TSegment = packed record
  473. seg_Next : DWord; { BPTR }
  474. seg_UC : LongInt;
  475. seg_Seg : DWord; { BPTR }
  476. seg_Name : Array[0..3] Of Byte;
  477. { * seg_Name continues * }
  478. end;
  479. const
  480. CMD_SYSTEM = -1;
  481. CMD_INTERNAL = -2;
  482. CMD_NOTLOADED = -998;
  483. CMD_DISABLED = -999;
  484. type
  485. PCommandLineInterface = ^TCommandLineInterface;
  486. TCommandLineInterface = packed record
  487. cli_Result2 : LongInt;
  488. cli_SetName : DWord; { BSTR }
  489. cli_CommandDir : DWord; { BPTR }
  490. cli_ReturnCode : LongInt;
  491. cli_CommandName : DWord; { BSTR }
  492. cli_FailLevel : LongInt;
  493. cli_Prompt : DWord; { BSTR }
  494. cli_StandardInput : DWord; { BPTR }
  495. cli_CurrentInput : DWord; { BPTR }
  496. cli_CommandFile : DWord; { BSTR }
  497. cli_Interactive : LongInt;
  498. cli_Background : LongInt;
  499. cli_CurrentOutput : DWord; { BPTR }
  500. cli_DefaultStack : LongInt;
  501. cli_StandardOutput: DWord; { BPTR }
  502. cli_Module : DWord; { BPTR }
  503. end;
  504. type
  505. PDeviceList = ^TDeviceList;
  506. TDeviceList = packed record
  507. dl_Next : DWord; { BPTR }
  508. dl_Type : LongInt;
  509. dl_Task : PMsgPort;
  510. dl_Lock : DWord; { BPTR }
  511. dl_VolumeDate: TDateStamp;
  512. dl_LockList : DWord; { BPTR }
  513. dl_DiskType : LongInt;
  514. dl_unused : LongInt;
  515. dl_Name : DWord; { BSTR }
  516. end;
  517. type
  518. PDevInfo = ^TDevInfo;
  519. TDevInfo = packed record
  520. dvi_Next : DWord; { BPTR }
  521. dvi_Type : LongInt;
  522. dvi_Task : Pointer;
  523. dvi_Lock : DWord; { BPTR }
  524. dvi_Handler : DWord; { BSTR }
  525. dvi_StackSize: LongInt;
  526. dvi_Priority : LongInt;
  527. dvi_Startup : LongInt;
  528. dvi_SegList : DWord; { BPTR }
  529. dvi_GlobVec : DWord; { BPTR }
  530. dvi_Name : DWord; { BSTR }
  531. end;
  532. type
  533. PAssignList = ^TAssignList;
  534. TAssignList = packed record
  535. al_Next: PAssignList;
  536. al_Lock: DWord; { BPTR }
  537. end;
  538. type
  539. PDOSList = ^TDOSList;
  540. TDOSList = packed record
  541. dol_Next: DWord; { BPTR }
  542. dol_Type: LongInt;
  543. dol_Task: PMsgPort;
  544. dol_Lock: DWord; { BPTR }
  545. case Byte of
  546. 0: ( dol_handler : record
  547. dol_Handler : DWord; { BSTR }
  548. dol_StackSize: LongInt;
  549. dol_Priority : LongInt;
  550. dol_Startup : DWord;
  551. dol_SegList : DWord; { BPTR }
  552. dol_GlobVec : DWord; { BPTR }
  553. end;
  554. );
  555. 1: ( dol_volume : record
  556. dol_VolumeDate: TDateStamp;
  557. dol_LockList : DWord; { BPTR }
  558. dol_DiskType : LongInt;
  559. end;
  560. );
  561. 2: ( dol_assign : record
  562. dol_AssignName: PChar;
  563. dol_List : PAssignList;
  564. end;
  565. );
  566. 3: ( dol_Misc: array[0..23] of Byte;
  567. dol_Name: DWord; { BPTR }
  568. );
  569. end;
  570. const
  571. DLT_DEVICE = 0;
  572. DLT_DIRECTORY = 1;
  573. DLT_VOLUME = 2;
  574. DLT_LATE = 3;
  575. DLT_NONBINDING = 4;
  576. DLT_PRIVATE = -1;
  577. type
  578. PDevProc = ^TDevProc;
  579. TDevProc = packed record
  580. dvp_Port : PMsgPort;
  581. dvp_Lock : DWord; { BPTR }
  582. dvp_Flags : DWord;
  583. dvp_DevNode: PDOSList;
  584. end;
  585. const
  586. DVPB_UNLOCK = 0;
  587. DVPF_UNLOCK = (1 Shl DVPB_UNLOCK);
  588. DVPB_ASSIGN = 1;
  589. DVPF_ASSIGN = (1 Shl DVPB_ASSIGN);
  590. const
  591. LDB_READ = 0;
  592. LDF_READ = (1 Shl LDB_READ);
  593. LDB_WRITE = 1;
  594. LDF_WRITE = (1 Shl LDB_WRITE);
  595. LDB_DEVICES = 2;
  596. LDF_DEVICES = (1 Shl LDB_DEVICES);
  597. LDB_VOLUMES = 3;
  598. LDF_VOLUMES = (1 Shl LDB_VOLUMES);
  599. LDB_ASSIGNS = 4;
  600. LDF_ASSIGNS = (1 Shl LDB_ASSIGNS);
  601. LDB_ENTRY = 5;
  602. LDF_ENTRY = (1 Shl LDB_ENTRY);
  603. LDB_DELETE = 6;
  604. LDF_DELETE = (1 Shl LDB_DELETE);
  605. LDF_ALL = (LDF_DEVICES Or LDF_VOLUMES Or LDF_ASSIGNS);
  606. type
  607. PFileLock = ^TFileLock;
  608. TFileLock = packed record
  609. fl_Link : DWord; { BPTR }
  610. fl_Key : LongInt;
  611. fl_Access: LongInt;
  612. fl_Task : PMsgPort;
  613. fl_Volume: DWord; { BPTR }
  614. end;
  615. const
  616. REPORT_STREAM = 0;
  617. REPORT_TASK = 1;
  618. REPORT_LOCK = 2;
  619. REPORT_VOLUME = 3;
  620. REPORT_INSERT = 4;
  621. const
  622. ABORT_DISK_ERROR = 296;
  623. ABORT_BUSY = 288;
  624. const
  625. RUN_EXECUTE = -1;
  626. RUN_SYSTEM = -2;
  627. RUN_SYSTEM_ASYNCH = -3;
  628. const
  629. ST_ROOT = 1;
  630. ST_USERDIR = 2;
  631. ST_SOFTLINK = 3;
  632. ST_LINKDIR = 4;
  633. ST_FILE = -3;
  634. ST_LINKFILE = -4;
  635. ST_PIPEFILE = -5;
  636. { * dos asl definitions
  637. *********************************************************************
  638. * }
  639. type
  640. PAChain = ^TAChain;
  641. TAChain = packed record
  642. an_Child : PAChain;
  643. an_Parent: PAChain;
  644. an_Lock : DWord; { BPTR }
  645. an_Info : TFileInfoBlock;
  646. an_Flags : ShortInt;
  647. an_String: Array[0..0] Of Char;
  648. { * an_String continues * }
  649. end;
  650. type
  651. PAnchorPath = ^TAnchorPath;
  652. TAnchorPath = packed record
  653. case Byte of
  654. 0 : ( ap_First: PAChain;
  655. ap_Last : PAChain;
  656. );
  657. 1 : ( ap_Base : PAChain;
  658. ap_Current : PAChain;
  659. ap_BreakBits : LongInt;
  660. ap_FoundBreak: LongInt;
  661. ap_Flags : ShortInt;
  662. ap_Reserved : ShortInt;
  663. ap_Strlen : SmallInt;
  664. ap_Info : TFileInfoBlock;
  665. ap_Buf : Array[0..0] of Char;
  666. { * an_Buf continues * }
  667. );
  668. end;
  669. const
  670. APB_DOWILD = 0;
  671. APF_DOWILD = (1 Shl APB_DOWILD);
  672. APB_ITSWILD = 1;
  673. APF_ITSWILD = (1 Shl APB_ITSWILD);
  674. APB_DODIR = 2;
  675. APF_DODIR = (1 Shl APB_DODIR);
  676. APB_DIDDIR = 3;
  677. APF_DIDDIR = (1 Shl APB_DIDDIR);
  678. APB_NOMEMERR = 4;
  679. APF_NOMEMERR = (1 Shl APB_NOMEMERR);
  680. APB_DODOT = 5;
  681. APF_DODOT = (1 Shl APB_DODOT);
  682. APB_DirChanged = 6;
  683. APF_DirChanged = (1 Shl APB_DirChanged);
  684. APB_FollowHLinks = 7;
  685. APF_FollowHLinks = (1 Shl APB_FollowHLinks);
  686. const
  687. APSB_EXTENDED = 15;
  688. APSF_EXTENDED = (1 Shl APSB_EXTENDED);
  689. APEB_DoMultiAssigns = 0;
  690. APEF_DoMultiAssigns = (1 Shl APEB_DoMultiAssigns);
  691. APEB_FutureExtension = 7;
  692. APEF_FutureExtension = (1 Shl APEB_FutureExtension);
  693. const
  694. DDB_PatternBit = 0;
  695. DDF_PatternBit = (1 Shl DDB_PatternBit);
  696. DDB_ExaminedBit = 1;
  697. DDF_ExaminedBit = (1 Shl DDB_ExaminedBit);
  698. DDB_Completed = 2;
  699. DDF_Completed = (1 Shl DDB_Completed);
  700. DDB_AllBit = 3;
  701. DDF_AllBit = (1 Shl DDB_AllBit);
  702. DDB_Single = 4;
  703. DDF_Single = (1 Shl DDB_Single);
  704. const
  705. P_ANY = $80;
  706. P_SINGLE = $81;
  707. P_ORSTART = $82;
  708. P_ORNEXT = $83;
  709. P_OREND = $84;
  710. P_NOT = $85;
  711. P_NOTEND = $86;
  712. P_NOTCLASS = $87;
  713. P_CLASS = $88;
  714. P_REPBEG = $89;
  715. P_REPEND = $8A;
  716. P_STOP = $8B;
  717. const
  718. COMPLEX_BIT = 1;
  719. EXAMINE_BIT = 2;
  720. const
  721. ERROR_BUFFER_OVERFLOW = 303;
  722. ERROR_BREAK = 304;
  723. ERROR_NOT_EXECUTABLE = 305;
  724. { * dos hunk definitions
  725. *********************************************************************
  726. * }
  727. const
  728. HUNK_UNIT = 999;
  729. HUNK_NAME = 1000;
  730. HUNK_CODE = 1001;
  731. HUNK_DATA = 1002;
  732. HUNK_BSS = 1003;
  733. HUNK_RELOC32 = 1004;
  734. HUNK_ABSRELOC32 = HUNK_RELOC32;
  735. HUNK_RELOC16 = 1005;
  736. HUNK_RELRELOC16 = HUNK_RELOC16;
  737. HUNK_RELOC8 = 1006;
  738. HUNK_RELRELOC8 = HUNK_RELOC8;
  739. HUNK_EXT = 1007;
  740. HUNK_SYMBOL = 1008;
  741. HUNK_DEBUG = 1009;
  742. HUNK_END = 1010;
  743. HUNK_HEADER = 1011;
  744. HUNK_OVERLAY = 1013;
  745. HUNK_BREAK = 1014;
  746. HUNK_DREL32 = 1015;
  747. HUNK_DREL16 = 1016;
  748. HUNK_DREL8 = 1017;
  749. HUNK_LIB = 1018;
  750. HUNK_INDEX = 1019;
  751. HUNK_RELOC32SHORT = 1020;
  752. HUNK_RELRELOC32 = 1021;
  753. HUNK_ABSRELOC16 = 1022;
  754. const
  755. HUNKB_ADVISORY = 29;
  756. HUNKB_CHIP = 30;
  757. HUNKB_FAST = 31;
  758. HUNKF_ADVISORY = (1 Shl HUNKB_ADVISORY);
  759. HUNKF_CHIP = (1 Shl HUNKB_CHIP);
  760. HUNKF_FAST = (1 Shl HUNKB_FAST);
  761. const
  762. EXT_SYMB = 0;
  763. EXT_DEF = 1;
  764. EXT_ABS = 2;
  765. EXT_RES = 3;
  766. EXT_REF32 = 129;
  767. EXT_ABSREF32 = EXT_REF32;
  768. EXT_COMMON = 130;
  769. EXT_ABSCOMMON = EXT_COMMON;
  770. EXT_REF16 = 131;
  771. EXT_RELREF16 = EXT_REF16;
  772. EXT_REF8 = 132;
  773. EXT_RELREF8 = EXT_REF8;
  774. EXT_DEXT32 = 133;
  775. EXT_DEXT16 = 134;
  776. EXT_DEXT8 = 135;
  777. EXT_RELREF32 = 136;
  778. EXT_RELCOMMON = 137;
  779. EXT_ABSREF16 = 138;
  780. EXT_ABSREF8 = 139;
  781. { * dos ExAll definitions
  782. *********************************************************************
  783. * }
  784. const
  785. ED_NAME = 1;
  786. ED_TYPE = 2;
  787. ED_SIZE = 3;
  788. ED_PROTECTION = 4;
  789. ED_DATE = 5;
  790. ED_COMMENT = 6;
  791. ED_OWNER = 7;
  792. type
  793. PExAllData = ^TExAllData;
  794. TExAllData = packed record
  795. ed_Next : PExAllData;
  796. ed_Name : PChar;
  797. ed_Type : LongInt;
  798. ed_Size : Cardinal;
  799. ed_Prot : Cardinal;
  800. ed_Days : Cardinal;
  801. ed_Mins : Cardinal;
  802. ed_Ticks : Cardinal;
  803. ed_Comment : PChar;
  804. ed_OwnerUID: Word;
  805. ed_OwnerGID: Word;
  806. end;
  807. type
  808. PExAllControl = ^TExAllControl;
  809. TexAllControl = packed record
  810. eac_Entries : Cardinal;
  811. eac_LastKey : Cardinal;
  812. eac_MatchString: PChar;
  813. eac_MatchFunc : PHook;
  814. end;
  815. { * dos record definitions
  816. *********************************************************************
  817. * }
  818. const
  819. REC_EXCLUSIVE = 0;
  820. REC_EXCLUSIVE_IMMED = 1;
  821. REC_SHARED = 2;
  822. REC_SHARED_IMMED = 3;
  823. type
  824. PRecordLock = ^TRecordLock;
  825. TRecordLock = packed record
  826. rec_FH : LongInt;
  827. rec_Offset: Cardinal;
  828. rec_Length: Cardinal;
  829. rec_Mode : Cardinal;
  830. end;
  831. { * dos tag definitions (V50)
  832. *********************************************************************
  833. * }
  834. const
  835. SYS_Dummy = (TAG_USER + 32);
  836. SYS_Input = (SYS_Dummy + 1);
  837. SYS_Output = (SYS_Dummy + 2);
  838. SYS_Asynch = (SYS_Dummy + 3);
  839. SYS_UserShell = (SYS_Dummy + 4);
  840. SYS_CustomShell = (SYS_Dummy + 5);
  841. { *** V50 *** }
  842. SYS_FilterTags = (SYS_Dummy + 6); { * filters the tags passed down to CreateNewProc(), default: TRUE * }
  843. const
  844. NP_Dummy = (TAG_USER + 1000);
  845. NP_Seglist = (NP_Dummy + 1);
  846. NP_FreeSeglist = (NP_Dummy + 2);
  847. NP_Entry = (NP_Dummy + 3);
  848. NP_Input = (NP_Dummy + 4);
  849. NP_Output = (NP_Dummy + 5);
  850. NP_CloseInput = (NP_Dummy + 6);
  851. NP_CloseOutput = (NP_Dummy + 7);
  852. NP_Error = (NP_Dummy + 8);
  853. NP_CloseError = (NP_Dummy + 9);
  854. NP_CurrentDir = (NP_Dummy + 10);
  855. NP_StackSize = (NP_Dummy + 11);
  856. NP_Name = (NP_Dummy + 12);
  857. NP_Priority = (NP_Dummy + 13);
  858. NP_ConsoleTask = (NP_Dummy + 14);
  859. NP_WindowPtr = (NP_Dummy + 15);
  860. NP_HomeDir = (NP_Dummy + 16);
  861. NP_CopyVars = (NP_Dummy + 17);
  862. NP_Cli = (NP_Dummy + 18);
  863. NP_Path = (NP_Dummy + 19);
  864. NP_CommandName = (NP_Dummy + 20);
  865. NP_Arguments = (NP_Dummy + 21);
  866. NP_NotifyOnDeath = (NP_Dummy + 22);
  867. NP_Synchronous = (NP_Dummy + 23);
  868. NP_ExitCode = (NP_Dummy + 24);
  869. NP_ExitData = (NP_Dummy + 25);
  870. { *** V50 *** }
  871. NP_SeglistArray = (NP_Dummy + 26);
  872. NP_UserData = (NP_Dummy + 27);
  873. NP_StartupMsg = (NP_Dummy + 28); { * PMessage, ReplyMsg'd at exit * }
  874. NP_TaskMsgPort = (NP_Dummy + 29); { * ^PMsgPort, create MsgPort, automagic delete * }
  875. NP_CodeType = (NP_Dummy + 100);
  876. NP_PPC_Arg1 = (NP_Dummy + 101);
  877. NP_PPC_Arg2 = (NP_Dummy + 102);
  878. NP_PPC_Arg3 = (NP_Dummy + 103);
  879. NP_PPC_Arg4 = (NP_Dummy + 104);
  880. NP_PPC_Arg5 = (NP_Dummy + 105);
  881. NP_PPC_Arg6 = (NP_Dummy + 106);
  882. NP_PPC_Arg7 = (NP_Dummy + 107);
  883. NP_PPC_Arg8 = (NP_Dummy + 108);
  884. NP_PPCStackSize = (NP_Dummy + 109);
  885. const
  886. ADO_Dummy = (TAG_USER + 2000);
  887. ADO_FH_Mode = (ADO_Dummy + 1);
  888. ADO_DirLen = (ADO_Dummy + 2);
  889. ADO_CommNameLen = (ADO_Dummy + 3);
  890. ADO_CommFileLen = (ADO_Dummy + 4);
  891. ADO_PromptLen = (ADO_Dummy + 5);
  892. { *** V50 *** }
  893. ADDS_Dummy = (TAG_USER + 3000);
  894. ADDS_Name = (ADDS_Dummy + 1); { * Segment name * }
  895. ADDS_Seglist = (ADDS_Dummy + 2); { * Seglist for this segment * }
  896. ADDS_Filename = (ADDS_Dummy + 3); { * Name of the file to load when needed. Ignored if Seglist is given. * }
  897. ADDS_Type = (ADDS_Dummy + 4); { * Segment type * }
  898. const
  899. FNDS_Dummy = (TAG_USER + 3100);
  900. FNDS_Name = (FNDS_Dummy + 1); { * Segment name * }
  901. FNDS_From = (FNDS_Dummy + 2); { * Segment to start from * }
  902. FNDS_System = (FNDS_Dummy + 3); { * Look for a system segment ? * }
  903. FNDS_Load = (FNDS_Dummy + 4); { * Load the seglist if needed ? (Default: TRUE) * }
  904. { * dos stdio definitions
  905. *********************************************************************
  906. * }
  907. const
  908. BUF_LINE = 0;
  909. BUF_FULL = 1;
  910. BUF_NONE = 2;
  911. const
  912. ENDSTREAMCH = -1;
  913. { * dos env-var definitions
  914. *********************************************************************
  915. * }
  916. type
  917. PLocalVar = ^TLocalVar;
  918. TLocalVar = packed record
  919. lv_Node : TNode;
  920. lv_Flags: Word;
  921. lv_Value: PChar;
  922. lv_Len : Cardinal;
  923. end;
  924. const
  925. LV_VAR = 0;
  926. LV_ALIAS = 1;
  927. const
  928. LVB_IGNORE = 7;
  929. LVF_IGNORE = (1 Shl LVB_IGNORE);
  930. GVB_GLOBAL_ONLY = 8;
  931. GVF_GLOBAL_ONLY = (1 Shl GVB_GLOBAL_ONLY);
  932. GVB_LOCAL_ONLY = 9;
  933. GVF_LOCAL_ONLY = (1 Shl GVB_LOCAL_ONLY);
  934. GVB_BINARY_VAR = 10;
  935. GVF_BINARY_VAR = (1 Shl GVB_BINARY_VAR);
  936. GVB_DONT_NULL_TERM = 11;
  937. GVF_DONT_NULL_TERM = (1 Shl GVB_DONT_NULL_TERM);
  938. GVB_SAVE_VAR = 12;
  939. GVF_SAVE_VAR = (1 Shl GVB_SAVE_VAR);
  940. { * dos ReadArgs definitions
  941. *********************************************************************
  942. * }
  943. type
  944. PCSource = ^TCSource;
  945. TCSource = packed record
  946. CS_Buffer: PChar;
  947. CS_Length: LongInt;
  948. CS_CurChr: LongInt;
  949. end;
  950. type
  951. PRDArgs = ^TRDArgs;
  952. TRDArgs = packed record
  953. RDA_Source : TCSource;
  954. RDA_DAList : LongInt;
  955. RDA_Buffer : PChar;
  956. RDA_BufSiz : LongInt;
  957. RDA_ExtHelp: PChar;
  958. RDA_Flags : LongInt;
  959. end;
  960. const
  961. RDAB_STDIN = 0;
  962. RDAF_STDIN = (1 Shl RDAB_STDIN);
  963. RDAB_NOALLOC = 1;
  964. RDAF_NOALLOC = (1 Shl RDAB_NOALLOC);
  965. RDAB_NOPROMPT = 2;
  966. RDAF_NOPROMPT = (1 Shl RDAB_NOPROMPT);
  967. const
  968. MAX_TEMPLATE_ITEMS = 100;
  969. MAX_MULTIARGS = 128;
  970. { * dos filehandler definitions
  971. *********************************************************************
  972. * }
  973. type
  974. PDosEnvec = ^TDosEnvec;
  975. TDosEnvec = packed record
  976. de_TableSize : Cardinal;
  977. de_SizeBlock : Cardinal;
  978. de_SecOrg : Cardinal;
  979. de_Surfaces : Cardinal;
  980. de_SectorPerBlock: Cardinal;
  981. de_BlocksPerTrack: Cardinal;
  982. de_Reserved : Cardinal;
  983. de_PreAlloc : Cardinal;
  984. de_Interleave : Cardinal;
  985. de_LowCyl : Cardinal;
  986. de_HighCyl : Cardinal;
  987. de_NumBuffers : Cardinal;
  988. de_BufMemType : Cardinal;
  989. de_MaxTransfer : Cardinal;
  990. de_Mask : Cardinal;
  991. de_BootPri : LongInt;
  992. de_DosType : Cardinal;
  993. de_Baud : Cardinal;
  994. de_Control : Cardinal;
  995. de_BootBlocks : Cardinal;
  996. end;
  997. const
  998. DE_TABLESIZE = 0;
  999. DE_SIZEBLOCK = 1;
  1000. DE_SECORG = 2;
  1001. DE_NUMHEADS = 3;
  1002. DE_SECSPERBLK = 4;
  1003. DE_BLKSPERTRACK = 5;
  1004. DE_RESERVEDBLKS = 6;
  1005. DE_PREFAC = 7;
  1006. DE_INTERLEAVE = 8;
  1007. DE_LOWCYL = 9;
  1008. DE_UPPERCYL = 10;
  1009. DE_NUMBUFFERS = 11;
  1010. DE_MEMBUFTYPE = 12;
  1011. DE_BUFMEMTYPE = 12;
  1012. DE_MAXTRANSFER = 13;
  1013. DE_MASK = 14;
  1014. DE_BOOTPRI = 15;
  1015. DE_DOSTYPE = 16;
  1016. DE_BAUD = 17;
  1017. DE_CONTROL = 18;
  1018. DE_BOOTBLOCKS = 19;
  1019. type
  1020. PFileSysStartupMsg = ^TFileSysStartupMsg;
  1021. TFileSysStartupMsg = packed record
  1022. fssm_Unit : Cardinal;
  1023. fssm_Device : LongInt;
  1024. fssm_Environ: LongInt;
  1025. fssm_Flags : Cardinal;
  1026. end;
  1027. type
  1028. PDeviceNode = ^TDeviceNode;
  1029. TDeviceNode = packed record
  1030. dn_Next : LongInt;
  1031. dn_Type : Cardinal;
  1032. dn_Task : PMsgPort;
  1033. dn_Lock : LongInt;
  1034. dn_Handler : LongInt;
  1035. dn_StackSize: Cardinal;
  1036. dn_Priority : LongInt;
  1037. dn_Startup : LongInt;
  1038. dn_SegList : LongInt;
  1039. dn_GlobalVec: LongInt;
  1040. dn_Name : LongInt;
  1041. end;
  1042. { * dos notification definitions
  1043. *********************************************************************
  1044. * }
  1045. const
  1046. NOTIFY_CLASS = $40000000;
  1047. NOTIFY_CODE = $1234;
  1048. type
  1049. PNotifyRequest = ^TNotifyRequest;
  1050. TNotifyRequest = packed record
  1051. nr_Name : PChar;
  1052. nr_FullName: PChar;
  1053. nr_UserData: Cardinal;
  1054. nr_Flags : Cardinal;
  1055. nr_stuff : record
  1056. case Byte of
  1057. 0 : ( nr_Msg : record
  1058. nr_Port: PMsgPort;
  1059. end );
  1060. 1 : ( nr_Signal : record
  1061. nr_Task : PTask;
  1062. nr_SignalNum: Byte;
  1063. nr_pad : Array[0..2] Of Byte;
  1064. end );
  1065. end;
  1066. nr_Reserved: Array[0..3] Of Cardinal;
  1067. nr_MsgCount: Cardinal;
  1068. nr_Handler : PMsgPort;
  1069. end;
  1070. type
  1071. PNotifyMessage = ^TNotifyMessage;
  1072. TNotifyMessage = packed record
  1073. nm_ExecMessage: TMessage;
  1074. nm_Class : Cardinal;
  1075. nm_Code : Word;
  1076. nm_NReq : PNotifyRequest;
  1077. nm_DoNotTouch : Cardinal;
  1078. nm_DoNotTouch2: Cardinal;
  1079. end;
  1080. const
  1081. NRB_SEND_MESSAGE = 0;
  1082. NRB_SEND_SIGNAL = 1;
  1083. NRB_WAIT_REPLY = 3;
  1084. NRB_NOTIFY_INITIAL = 4;
  1085. NRB_MAGIC = 31;
  1086. const
  1087. NRF_SEND_MESSAGE = (1 Shl NRB_SEND_MESSAGE);
  1088. NRF_SEND_SIGNAL = (1 Shl NRB_SEND_SIGNAL);
  1089. NRF_WAIT_REPLY = (1 Shl NRB_WAIT_REPLY);
  1090. NRF_NOTIFY_INITIAL = (1 Shl NRB_NOTIFY_INITIAL);
  1091. NRF_MAGIC = (1 Shl NRB_MAGIC);
  1092. const
  1093. NR_HANDLER_FLAGS = $ffff0000;
  1094. { * dos.library segtracker include
  1095. *********************************************************************
  1096. * }
  1097. const
  1098. SEG_SEM = 'SegTracker';
  1099. type
  1100. PSegSem = ^TSegSem;
  1101. TSegSem = packed record
  1102. seg_Semaphore: TSignalSemaphore;
  1103. seg_Find : Procedure; { Name = seg_Find(REG(a0, ULONG Address), REG(a1, ULONG *SegNum), REG(a2, ULONG *Offset)) }
  1104. seg_List : TMinList;
  1105. end;
  1106. type
  1107. PSegArray = ^TSegArray;
  1108. TSegArray = packed record
  1109. seg_Address: Cardinal;
  1110. seg_Size : Cardinal;
  1111. end;
  1112. type
  1113. PSegNode = ^TSegNode;
  1114. TSegNode = packed record
  1115. seg_Node : TMinNode;
  1116. seg_Name : PChar;
  1117. seg_Array: Array[0..0] Of TSegArray;
  1118. end;
  1119. {.$include doslibd.inc}
  1120. {.$include doslibf.inc}
  1121. { dos.library functions }
  1122. function dosOpen(fname : PChar location 'd1';
  1123. accessMode: LongInt location 'd2'): LongInt;
  1124. SysCall MOS_DOSBase 30;
  1125. function dosClose(fileh: LongInt location 'd1'): LongBool;
  1126. SysCall MOS_DOSBase 36;
  1127. function dosRead(fileh : LongInt location 'd1';
  1128. buffer: Pointer location 'd2';
  1129. length: LongInt location 'd3'): LongInt;
  1130. SysCall MOS_DOSBase 42;
  1131. function dosWrite(fileh : LongInt location 'd1';
  1132. buffer: Pointer location 'd2';
  1133. length: LongInt location 'd3'): LongInt;
  1134. SysCall MOS_DOSBase 48;
  1135. function dosInput: LongInt;
  1136. SysCall MOS_DOSBase 54;
  1137. function dosOutput: LongInt;
  1138. SysCall MOS_DOSBase 60;
  1139. function dosSeek(fileh : LongInt location 'd1';
  1140. position: LongInt location 'd2';
  1141. posmode : LongInt location 'd3'): LongInt;
  1142. SysCall MOS_DOSBase 66;
  1143. function dosDeleteFile(fname: PChar location 'd1'): LongBool;
  1144. SysCall MOS_DOSBase 72;
  1145. function dosRename(oldName: PChar location 'd1';
  1146. newName: PChar location 'd2'): LongInt;
  1147. SysCall MOS_DOSBase 78;
  1148. function Lock(lname : PChar location 'd1';
  1149. accessMode: LongInt location 'd2'): LongInt;
  1150. SysCall MOS_DOSBase 84;
  1151. procedure Unlock(lock: LongInt location 'd1');
  1152. SysCall MOS_DOSBase 90;
  1153. function DupLock(lock: LongInt location 'd1'): LongInt;
  1154. SysCall MOS_DOSBase 096;
  1155. function Examine(lock : LongInt location 'd1';
  1156. fileInfoBlock: PFileInfoBlock location 'd2'): LongInt;
  1157. SysCall MOS_DOSBase 102;
  1158. function ExNext(lock : LongInt location 'd1';
  1159. fileInfoBlock: PFileInfoBlock location 'd2'): LongInt;
  1160. SysCall MOS_DOSBase 108;
  1161. function Info(lock : LongInt location 'd1';
  1162. parameterBlock: PInfoData location 'd2'): LongInt;
  1163. SysCall MOS_DOSBase 114;
  1164. function dosCreateDir(dname: PChar location 'd1'): LongInt;
  1165. SysCall MOS_DOSBase 120;
  1166. function CurrentDir(lock: LongInt location 'd1'): LongInt;
  1167. SysCall MOS_DOSBase 126;
  1168. function IoErr: LongInt;
  1169. SysCall MOS_DOSBase 132;
  1170. function CreateProc(name : PChar location 'd1';
  1171. pri : LongInt location 'd2';
  1172. segList : LongInt location 'd3';
  1173. stackSize: LongInt location 'd4'): PMsgPort;
  1174. SysCall MOS_DOSBase 138;
  1175. procedure dosExit(returnCode: LongInt location 'd1');
  1176. SysCall MOS_DOSBase 144;
  1177. function LoadSeg(name: PChar location 'd1'): LongInt;
  1178. SysCall MOS_DOSBase 150;
  1179. procedure UnLoadSeg(seglist: LongInt location 'd1');
  1180. SysCall MOS_DOSBase 156;
  1181. function DeviceProc(name: PChar location 'd1'): PMsgPort;
  1182. SysCall MOS_DOSBase 174;
  1183. function SetComment(name : PChar location 'd1';
  1184. comment: PChar location 'd2'): LongBool;
  1185. SysCall MOS_DOSBase 180;
  1186. function SetProtection(name: PChar location 'd1';
  1187. mask: LongInt location 'd2'): LongInt;
  1188. SysCall MOS_DOSBase 186;
  1189. function DateStamp(date: PDateStamp location 'd1'): PDateStamp;
  1190. SysCall MOS_DOSBase 192;
  1191. procedure DOSDelay(timeout: LongInt location 'd1');
  1192. SysCall MOS_DOSBase 198;
  1193. function WaitForChar(file1 : LongInt location 'd1';
  1194. timeout: LongInt location 'd2'): LongBool;
  1195. SysCall MOS_DOSBase 204;
  1196. function ParentDir(lock: LongInt location 'd1'): LongInt;
  1197. SysCall MOS_DOSBase 210;
  1198. function IsInteractive(file1: LongInt location 'd1'): LongBool;
  1199. SysCall MOS_DOSBase 216;
  1200. function Execute(string1: PChar location 'd1';
  1201. file1 : LongInt location 'd2';
  1202. file2 : LongInt location 'd3'): LongBool;
  1203. SysCall MOS_DOSBase 222;
  1204. function AllocDosObject(type1: Cardinal location 'd1';
  1205. tags : PTagItem location 'd2'): Pointer;
  1206. SysCall MOS_DOSBase 228;
  1207. function AllocDosObjectTagList(type1: Cardinal location 'd1';
  1208. tags : PTagItem location 'd2'): Pointer;
  1209. SysCall MOS_DOSBase 228;
  1210. procedure FreeDosObject(type1: Cardinal location 'd1';
  1211. ptr : Pointer location 'd2');
  1212. SysCall MOS_DOSBase 234;
  1213. function DoPkt(port : PMsgPort location 'd1';
  1214. action: LongInt location 'd2';
  1215. arg1 : LongInt location 'd3';
  1216. arg2 : LongInt location 'd4';
  1217. arg3 : LongInt location 'd5';
  1218. arg4 : LongInt location 'd6';
  1219. arg5 : LongInt location 'd7'): LongInt;
  1220. SysCall MOS_DOSBase 240;
  1221. function DoPkt0(port : PMsgPort location 'd1';
  1222. action: LongInt location 'd2'): LongInt;
  1223. SysCall MOS_DOSBase 240;
  1224. function DoPkt1(port : PMsgPort location 'd1';
  1225. action: LongInt location 'd2';
  1226. arg1 : LongInt location 'd3'): LongInt;
  1227. SysCall MOS_DOSBase 240;
  1228. function DoPkt2(port : PMsgPort location 'd1';
  1229. action: LongInt location 'd2';
  1230. arg1 : LongInt location 'd3';
  1231. arg2 : LongInt location 'd4'): LongInt;
  1232. SysCall MOS_DOSBase 240;
  1233. function DoPkt3(port : PMsgPort location 'd1';
  1234. action: LongInt location 'd2';
  1235. arg1 : LongInt location 'd3';
  1236. arg2 : LongInt location 'd4';
  1237. arg3 : LongInt location 'd5'): LongInt;
  1238. SysCall MOS_DOSBase 240;
  1239. function DoPkt4(port : PMsgPort location 'd1';
  1240. action: LongInt location 'd2';
  1241. arg1 : LongInt location 'd3';
  1242. arg2 : LongInt location 'd4';
  1243. arg3 : LongInt location 'd5';
  1244. arg4 : LongInt location 'd6'): LongInt;
  1245. SysCall MOS_DOSBase 240;
  1246. procedure SendPkt(dp : PDosPacket location 'd1';
  1247. port : PMsgPort location 'd2';
  1248. replyport: PMsgPort location 'd3');
  1249. SysCall MOS_DOSBase 246;
  1250. function WaitPkt: PDosPacket;
  1251. SysCall MOS_DOSBase 252;
  1252. procedure ReplyPkt(dp : PDosPacket location 'd1';
  1253. res1: LongInt location 'd2';
  1254. res2: LongInt location 'd3');
  1255. SysCall MOS_DOSBase 258;
  1256. procedure AbortPkt(port: PMsgPort location 'd1';
  1257. pkt : PDosPacket location 'd2');
  1258. SysCall MOS_DOSBase 264;
  1259. function LockRecord(fh : LongInt location 'd1';
  1260. offset : Cardinal location 'd2';
  1261. length : Cardinal location 'd3';
  1262. mode : Cardinal location 'd4';
  1263. timeout: Cardinal location 'd5'): LongBool;
  1264. SysCall MOS_DOSBase 270;
  1265. function LockRecords(recArray: PRecordLock location 'd1';
  1266. timeout : Cardinal location 'd2'): LongBool;
  1267. SysCall MOS_DOSBase 276;
  1268. function UnLockRecord(fh : LongInt location 'd1';
  1269. offset: Cardinal location 'd2';
  1270. length: Cardinal location 'd3'): LongBool;
  1271. SysCall MOS_DOSBase 282;
  1272. function UnLockRecords(recArray: PRecordLock location 'd1'): LongBool;
  1273. SysCall MOS_DOSBase 288;
  1274. function SelectInput(fh: LongInt location 'd1'): LongInt;
  1275. SysCall MOS_DOSBase 294;
  1276. function SelectOutput(fh: LongInt location 'd1'): LongInt;
  1277. SysCall MOS_DOSBase 300;
  1278. function FGetC(fh: LongInt location 'd1'): LongInt;
  1279. SysCall MOS_DOSBase 306;
  1280. function FPutC(fh: LongInt location 'd1';
  1281. ch: LongInt location 'd2'): LongInt;
  1282. SysCall MOS_DOSBase 312;
  1283. function UnGetC(fh : LongInt location 'd1';
  1284. character: LongInt location 'd2'): LongInt;
  1285. SysCall MOS_DOSBase 318;
  1286. function FRead(fh : LongInt location 'd1';
  1287. block : Pointer location 'd2';
  1288. blocklen: Cardinal location 'd3';
  1289. number : Cardinal location 'd4'): LongInt;
  1290. SysCall MOS_DOSBase 324;
  1291. function FWrite(fh : LongInt location 'd1';
  1292. block : Pointer location 'd2';
  1293. blocklen: Cardinal location 'd3';
  1294. number : Cardinal location 'd4'): LongInt;
  1295. SysCall MOS_DOSBase 330;
  1296. function FGets(fh : LongInt location 'd1';
  1297. buf : PChar location 'd2';
  1298. buflen: Cardinal location 'd3'): PChar;
  1299. SysCall MOS_DOSBase 336;
  1300. function FPuts(fh : LongInt location 'd1';
  1301. str: PChar location 'd2'): LongInt;
  1302. SysCall MOS_DOSBase 342;
  1303. procedure VFWritef(fh : LongInt location 'd1';
  1304. format : PChar location 'd2';
  1305. argarray: Pointer location 'd3');
  1306. SysCall MOS_DOSBase 348;
  1307. function VFPrintf(fh : LongInt location 'd1';
  1308. format : PChar location 'd2';
  1309. argarray: Pointer location 'd3'): LongInt;
  1310. SysCall MOS_DOSBase 354;
  1311. function dosFlush(fh: LongInt location 'd1'): LongInt;
  1312. SysCall MOS_DOSBase 360;
  1313. function SetVBuf(fh : LongInt location 'd1';
  1314. buff : PChar location 'd2';
  1315. type1: LongInt location 'd3';
  1316. size : LongInt location 'd4'): LongInt;
  1317. SysCall MOS_DOSBase 366;
  1318. function DupLockFromFH(fh: LongInt location 'd1'): LongInt;
  1319. SysCall MOS_DOSBase 372;
  1320. function OpenFromLock(lock: LongInt location 'd1'): LongInt;
  1321. SysCall MOS_DOSBase 378;
  1322. function ParentOfFH(fh: LongInt location 'd1'): LongInt;
  1323. SysCall MOS_DOSBase 384;
  1324. function ExamineFH(fh : LongInt location 'd1';
  1325. fib: PFileInfoBlock location 'd2'): LongBool;
  1326. SysCall MOS_DOSBase 390;
  1327. function SetFileDate(name: PChar location 'd1';
  1328. date: PDateStamp location 'd2'): LongBool;
  1329. SysCall MOS_DOSBase 396;
  1330. function NameFromLock(lock : LongInt location 'd1';
  1331. buffer: PChar location 'd2';
  1332. len : LongInt location 'd3'): LongBool;
  1333. SysCall MOS_DOSBase 402;
  1334. function NameFromFH(fh : LongInt location 'd1';
  1335. buffer: PChar location 'd2';
  1336. len : LongInt location 'd3'): LongBool;
  1337. SysCall MOS_DOSBase 408;
  1338. function SplitName(name : PChar location 'd1';
  1339. separator: Cardinal location 'd2';
  1340. buf : PChar location 'd3';
  1341. oldpos : LongInt location 'd4';
  1342. size : LongInt location 'd5'): SmallInt;
  1343. SysCall MOS_DOSBase 414;
  1344. function SameLock(lock1: LongInt location 'd1';
  1345. lock2: LongInt location 'd2'): LongInt;
  1346. SysCall MOS_DOSBase 420;
  1347. function SetMode(fh : LongInt location 'd1';
  1348. mode: LongInt location 'd2'): LongInt;
  1349. SysCall MOS_DOSBase 426;
  1350. function ExAll(lock : LongInt location 'd1';
  1351. buffer : PExAllData location 'd2';
  1352. size : LongInt location 'd3';
  1353. data : LongInt location 'd4';
  1354. control: PExAllControl location 'd5'): LongBool;
  1355. SysCall MOS_DOSBase 432;
  1356. function ReadLink(port : PMsgPort location 'd1';
  1357. lock : LongInt location 'd2';
  1358. path : PChar location 'd3';
  1359. buffer: PChar location 'd4';
  1360. size : Cardinal location 'd5'): LongBool;
  1361. SysCall MOS_DOSBase 438;
  1362. function MakeLink(name: PChar location 'd1';
  1363. dest: LongInt location 'd2';
  1364. soft: LongInt location 'd3'): LongBool;
  1365. SysCall MOS_DOSBase 444;
  1366. function ChangeMode(type1 : LongInt location 'd1';
  1367. fh : LongInt location 'd2';
  1368. newmode: LongInt location 'd3'): LongBool;
  1369. SysCall MOS_DOSBase 450;
  1370. function SetFileSize(fh : LongInt location 'd1';
  1371. pos : LongInt location 'd2';
  1372. mode: LongInt location 'd3'): LongInt;
  1373. SysCall MOS_DOSBase 456;
  1374. function SetIoErr(result: LongInt location 'd1'): LongInt;
  1375. SysCall MOS_DOSBase 462;
  1376. function Fault(code : LongInt location 'd1';
  1377. header: PChar location 'd2';
  1378. buffer: PChar location 'd3';
  1379. len : LongInt location 'd4'): LongBool;
  1380. SysCall MOS_DOSBase 468;
  1381. function PrintFault(code : LongInt location 'd1';
  1382. header: PChar location 'd2'): LongBool;
  1383. SysCall MOS_DOSBase 474;
  1384. function ErrorReport(code : LongInt location 'd1';
  1385. type1 : LongInt location 'd2';
  1386. arg1 : Cardinal location 'd3';
  1387. device: PMsgPort location 'd4'): LongBool;
  1388. SysCall MOS_DOSBase 480;
  1389. function Cli: PCommandLineInterface;
  1390. SysCall MOS_DOSBase 492;
  1391. function CreateNewProc(tags: PTagItem location 'd1'): PProcess;
  1392. SysCall MOS_DOSBase 498;
  1393. function CreateNewProcTagList(tags: PTagItem location 'd1'): PProcess;
  1394. SysCall MOS_DOSBase 498;
  1395. function RunCommand(seg : LongInt location 'd1';
  1396. stack : LongInt location 'd2';
  1397. paramptr: PChar location 'd3';
  1398. paramlen: LongInt location 'd4'): LongInt;
  1399. SysCall MOS_DOSBase 504;
  1400. function GetConsoleTask: PMsgPort;
  1401. SysCall MOS_DOSBase 510;
  1402. function SetConsoleTask(task: PMsgPort location 'd1'): PMsgPort;
  1403. SysCall MOS_DOSBase 516;
  1404. function GetFileSysTask: PMsgPort;
  1405. SysCall MOS_DOSBase 522;
  1406. function SetFileSysTask(task: PMsgPort location 'd1'): PMsgPort;
  1407. SysCall MOS_DOSBase 528;
  1408. function GetArgStr: PChar;
  1409. SysCall MOS_DOSBase 534;
  1410. function SetArgStr(str: PChar location 'd1'): LongBool;
  1411. SysCall MOS_DOSBase 540;
  1412. function FindCliProc(num: Cardinal location 'd1'): PProcess;
  1413. SysCall MOS_DOSBase 546;
  1414. function MaxCli: Cardinal;
  1415. SysCall MOS_DOSBase 552;
  1416. function SetCurrentDirName(name: PChar location 'd1'): LongBool;
  1417. SysCall MOS_DOSBase 558;
  1418. function GetCurrentDirName(buf: PChar location 'd1';
  1419. len: LongInt location 'd2'): LongBool;
  1420. SysCall MOS_DOSBase 564;
  1421. function SetProgramName(name: PChar location 'd1'): LongBool;
  1422. SysCall MOS_DOSBase 570;
  1423. function GetProgramName(buf: PChar location 'd1';
  1424. len: LongInt location 'd2'): LongBool;
  1425. SysCall MOS_DOSBase 576;
  1426. function SetPrompt(name: PChar location 'd1'): LongBool;
  1427. SysCall MOS_DOSBase 582;
  1428. function GetPrompt(buf: PChar location 'd1';
  1429. len: LongInt location 'd2'): LongBool;
  1430. SysCall MOS_DOSBase 588;
  1431. function SetProgramDir(lock: LongInt location 'd1'): LongInt;
  1432. SysCall MOS_DOSBase 594;
  1433. function GetProgramDir: LongInt;
  1434. SysCall MOS_DOSBase 600;
  1435. function SystemTagList(command: PChar location 'd1';
  1436. tags : PTagItem location 'd2'): LongInt;
  1437. SysCall MOS_DOSBase 606;
  1438. function dosSystem(command: PChar location 'd1';
  1439. tags : PTagItem location 'd2'): LongInt;
  1440. SysCall MOS_DOSBase 606;
  1441. function AssignLock(name: PChar location 'd1';
  1442. lock: LongInt location 'd2'): LongBool;
  1443. SysCall MOS_DOSBase 612;
  1444. function AssignLate(name: PChar location 'd1';
  1445. path: PChar location 'd2'): LongBool;
  1446. SysCall MOS_DOSBase 618;
  1447. function AssignPath(name: PChar location 'd1';
  1448. path: PChar location 'd2'): LongBool;
  1449. SysCall MOS_DOSBase 624;
  1450. function AssignAdd(name: PChar location 'd1';
  1451. lock: LongInt location 'd2'): LongBool;
  1452. SysCall MOS_DOSBase 630;
  1453. function RemAssignList(name: PChar location 'd1';
  1454. lock: LongInt location 'd2'): LongBool;
  1455. SysCall MOS_DOSBase 636;
  1456. function GetDeviceProc(name: PChar location 'd1';
  1457. dp : PDevProc location 'd2'): PDevProc;
  1458. SysCall MOS_DOSBase 642;
  1459. procedure FreeDeviceProc(dp: PDevProc location 'd1');
  1460. SysCall MOS_DOSBase 648;
  1461. function LockDosList(flags: Cardinal location 'd1'): PDosList;
  1462. SysCall MOS_DOSBase 654;
  1463. procedure UnLockDosList(flags: Cardinal location 'd1');
  1464. SysCall MOS_DOSBase 660;
  1465. function AttemptLockDosList(flags: Cardinal location 'd1'): PDosList;
  1466. SysCall MOS_DOSBase 666;
  1467. function RemDosEntry(dlist: PDosList location 'd1'): LongBool;
  1468. SysCall MOS_DOSBase 672;
  1469. function AddDosEntry(dlist: PDosList location 'd1'): LongInt;
  1470. SysCall MOS_DOSBase 678;
  1471. function FindDosEntry(dlist: PDosList location 'd1';
  1472. name : PChar location 'd2';
  1473. flags: Cardinal location 'd3'): PDosList;
  1474. SysCall MOS_DOSBase 684;
  1475. function NextDosEntry(dlist: PDosList location 'd1';
  1476. flags: Cardinal location 'd2'): PDosList;
  1477. SysCall MOS_DOSBase 690;
  1478. function MakeDosEntry(name : PChar location 'd1';
  1479. type1: LongInt location 'd2'): PDosList;
  1480. SysCall MOS_DOSBase 696;
  1481. procedure FreeDosEntry(dlist: PDosList location 'd1');
  1482. SysCall MOS_DOSBase 702;
  1483. function IsFileSystem(name: PChar location 'd1'): LongBool;
  1484. SysCall MOS_DOSBase 708;
  1485. function Format(filesystem: PChar location 'd1';
  1486. volumename: PChar location 'd2';
  1487. dostype : Cardinal location 'd3'): LongBool;
  1488. SysCall MOS_DOSBase 714;
  1489. function Relabel(drive : PChar location 'd1';
  1490. newname: PChar location 'd2'): LongBool;
  1491. SysCall MOS_DOSBase 720;
  1492. function Inhibit(name : PChar location 'd1';
  1493. onoff: LongInt location 'd2'): LongBool;
  1494. SysCall MOS_DOSBase 726;
  1495. function AddBuffers(name : PChar location 'd1';
  1496. number: LongInt location 'd2'): LongBool;
  1497. SysCall MOS_DOSBase 732;
  1498. function CompareDates(date1: PDateStamp location 'd1';
  1499. date2: PDateStamp location 'd2'): LongInt;
  1500. SysCall MOS_DOSBase 738;
  1501. function DateToStr(datetime: _PDateTime location 'd1'): LongBool;
  1502. SysCall MOS_DOSBase 744;
  1503. function StrToDate(datetime: _PDateTime location 'd1'): LongBool;
  1504. SysCall MOS_DOSBase 750;
  1505. function InternalLoadSeg(fh : LongInt location 'd0';
  1506. table : LongInt location 'a0';
  1507. var funcarray: LongInt location 'a1';
  1508. var stack : LongInt location 'a2'): LongInt;
  1509. SysCall MOS_DOSBase 756;
  1510. function NewLoadSeg(file1: PChar location 'd1';
  1511. tags : PTagItem location 'd2'): LongInt;
  1512. SysCall MOS_DOSBase 768;
  1513. function NewLoadSegTagList(file1: PChar location 'd1';
  1514. tags : PTagItem location 'd2'): LongInt;
  1515. SysCall MOS_DOSBase 768;
  1516. function AddSegment(name : PChar location 'd1';
  1517. seg : LongInt location 'd2';
  1518. system: LongInt location 'd3'): LongBool;
  1519. SysCall MOS_DOSBase 774;
  1520. function FindSegment(name : PChar location 'd1';
  1521. seg : PSegment location 'd2';
  1522. system: LongInt location 'd3'): PSegment;
  1523. SysCall MOS_DOSBase 780;
  1524. function RemSegment(seg: PSegment location 'd1'): LongBool;
  1525. SysCall MOS_DOSBase 786;
  1526. function CheckSignal(mask: LongInt location 'd1'): LongInt;
  1527. SysCall MOS_DOSBase 792;
  1528. function ReadArgs(arg_template: PChar location 'd1';
  1529. var array1 : LongInt location 'd2';
  1530. args : PRDArgs location 'd3'): PRDArgs;
  1531. SysCall MOS_DOSBase 798;
  1532. function FindArg(keyword : PChar location 'd1';
  1533. arg_template: PChar location 'd2'): LongInt;
  1534. SysCall MOS_DOSBase 804;
  1535. function ReadItem(name : PChar location 'd1';
  1536. maxchars: LongInt location 'd2';
  1537. cSource : PCSource location 'd3'): LongInt;
  1538. SysCall MOS_DOSBase 810;
  1539. function StrToLong(string1 : PChar location 'd1';
  1540. var value: LongInt location 'd2'): LongInt;
  1541. SysCall MOS_DOSBase 816;
  1542. function MatchFirst(pat : PChar location 'd1';
  1543. anchor: PAnchorPath location 'd2'): LongInt;
  1544. SysCall MOS_DOSBase 822;
  1545. function MatchNext(anchor: PAnchorPath location 'd1'): LongInt;
  1546. SysCall MOS_DOSBase 828;
  1547. procedure MatchEnd(anchor: PAnchorPath location 'd1');
  1548. SysCall MOS_DOSBase 834;
  1549. function ParsePattern(pat : PChar location 'd1';
  1550. buf : PChar location 'd2';
  1551. buflen: LongInt location 'd3'): LongInt;
  1552. SysCall MOS_DOSBase 840;
  1553. function MatchPattern(pat: PChar location 'd1';
  1554. str: PChar location 'd2'): LongBool;
  1555. SysCall MOS_DOSBase 846;
  1556. procedure FreeArgs(args: pRDArgs location 'd1');
  1557. SysCall MOS_DOSBase 858;
  1558. function FilePart(path: PChar location 'd1'): PChar;
  1559. SysCall MOS_DOSBase 870;
  1560. function PathPart(path: PChar location 'd1'): PChar;
  1561. SysCall MOS_DOSBase 876;
  1562. function AddPart(dirname: PChar location 'd1';
  1563. filename: PChar location 'd2';
  1564. size : Cardinal location 'd3'): LongBool;
  1565. SysCall MOS_DOSBase 882;
  1566. function StartNotify(notify: PNotifyRequest location 'd1'): LongBool;
  1567. SysCall MOS_DOSBase 888;
  1568. procedure EndNotify(notify: PNotifyRequest location 'd1');
  1569. SysCall MOS_DOSBase 894;
  1570. function SetVar(name : PChar location 'd1';
  1571. buffer: PChar location 'd2';
  1572. size : LongInt location 'd3';
  1573. flags : LongInt location 'd4'): LongBool;
  1574. SysCall MOS_DOSBase 900;
  1575. function GetVar(name : PChar location 'd1';
  1576. buffer: PChar location 'd2';
  1577. size : LongInt location 'd3';
  1578. flags : LongInt location 'd4'): LongInt;
  1579. SysCall MOS_DOSBase 906;
  1580. function DeleteVar(name : PChar location 'd1';
  1581. flags: Cardinal location 'd2'): LongBool;
  1582. SysCall MOS_DOSBase 912;
  1583. function FindVar(name : PChar location 'd1';
  1584. type1: Cardinal location 'd2'): PLocalVar;
  1585. SysCall MOS_DOSBase 918;
  1586. function CliInitNewcli(dp: PDosPacket location 'a0'): LongInt;
  1587. SysCall MOS_DOSBase 930;
  1588. function CliInitRun(dp: PDosPacket location 'a0'): LongInt;
  1589. SysCall MOS_DOSBase 936;
  1590. function WriteChars(buf : PChar location 'd1';
  1591. buflen: Cardinal location 'd2'): LongInt;
  1592. SysCall MOS_DOSBase 942;
  1593. function PutStr(str: PChar location 'd1'): LongInt;
  1594. SysCall MOS_DOSBase 948;
  1595. function VPrintf(format : PChar location 'd1';
  1596. argarray: Pointer location 'd2'): LongInt;
  1597. SysCall MOS_DOSBase 954;
  1598. function ParsePatternNoCase(pat : PChar location 'd1';
  1599. buf : PChar location 'd2';
  1600. buflen: LongInt location 'd3'): LongInt;
  1601. SysCall MOS_DOSBase 966;
  1602. function MatchPatternNoCase(pat: PChar location 'd1';
  1603. str: PChar location 'd2'): LongBool;
  1604. SysCall MOS_DOSBase 972;
  1605. function SameDevice(lock1: LongInt location 'd1';
  1606. lock2: LongInt location 'd2'): LongBool;
  1607. SysCall MOS_DOSBase 984;
  1608. procedure ExAllEnd(lock : LongInt location 'd1';
  1609. buffer : PExAllData location 'd2';
  1610. size : LongInt location 'd3';
  1611. data : LongInt location 'd4';
  1612. control: PExAllControl location 'd5');
  1613. SysCall MOS_DOSBase 990;
  1614. function SetOwner(name : PChar location 'd1';
  1615. owner_info: LongInt location 'd2'): LongBool;
  1616. SysCall MOS_DOSBase 996;
  1617. function AddSegmentTagList(tags: PTagItem location 'a0'): LongInt;
  1618. SysCall MOS_DOSBase 1002;
  1619. function FindSegmentTagList(tags: PTagItem location 'a0'): PSegment;
  1620. SysCall MOS_DOSBase 1008;
  1621. { * dos global definitions (V50)
  1622. *********************************************************************
  1623. * }
  1624. function BADDR(x: LongInt): Pointer; Inline;
  1625. function MKBADDR(x: Pointer): LongInt; Inline;
  1626. { * dos stdio definitions
  1627. *********************************************************************
  1628. * }
  1629. function ReadChar: LongInt; Inline;
  1630. function WriteChar(ch: Char): LongInt; Inline;
  1631. function UnReadChar(ch: Char): LongInt; Inline;
  1632. function ReadChars(buf: Pointer; num: LongInt): LongInt; Inline;
  1633. function dosReadLn(buf: PChar; num: LongInt): PChar; Inline;
  1634. function WriteStr(str: PChar): LongInt; Inline;
  1635. procedure VWritef(format: PChar; argv: Pointer); Inline;
  1636. { * calls with tags workarounds (should be removed later)
  1637. *********************************************************************
  1638. * }
  1639. function CreateNewProcTags(tags: array of dword): PProcess; Inline;
  1640. implementation
  1641. { * dos stdio definitions
  1642. *********************************************************************
  1643. * }
  1644. function ReadChar: LongInt; Inline;
  1645. begin
  1646. ReadChar:=FGetC(dosInput);
  1647. end;
  1648. function WriteChar(ch: Char): LongInt; Inline;
  1649. begin
  1650. WriteChar:=FPutC(dosOutput,Byte(ch));
  1651. end;
  1652. function UnReadChar(ch: Char): LongInt; Inline;
  1653. begin
  1654. UnReadChar:=UnGetC(dosInput,Byte(ch));
  1655. end;
  1656. function ReadChars(buf: Pointer; num: LongInt): LongInt; Inline;
  1657. begin
  1658. ReadChars:=FRead(dosInput,buf,1,num);
  1659. end;
  1660. function dosReadLn(buf: PChar; num: LongInt): PChar; Inline;
  1661. begin
  1662. dosReadLn:=FGets(dosInput,buf,num);
  1663. end;
  1664. function WriteStr(str: PChar): LongInt; Inline;
  1665. begin
  1666. WriteStr:=FPuts(dosOutput,str);
  1667. end;
  1668. procedure VWritef(format: PChar; argv: Pointer); Inline;
  1669. begin
  1670. VFWritef(dosOutput,format,argv);
  1671. end;
  1672. { * dos global definitions (V50)
  1673. *********************************************************************
  1674. * }
  1675. function BADDR(x: LongInt): Pointer; Inline;
  1676. begin
  1677. BADDR:=Pointer(x Shl 2);
  1678. end;
  1679. function MKBADDR(x: Pointer): LongInt; Inline;
  1680. begin
  1681. MKBADDR:=LongInt(PtrUInt(x)) Shr 2;
  1682. end;
  1683. { * calls with tags workarounds (should be removed later)
  1684. *********************************************************************
  1685. * }
  1686. function CreateNewProcTags(tags: array of DWord): PProcess; Inline;
  1687. begin
  1688. CreateNewProcTags:=CreateNewProc(@tags);
  1689. end;
  1690. begin
  1691. DosBase:=MOS_DOSBase;
  1692. end.