amigados.pas 96 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199
  1. {
  2. This file is part of the Free Pascal run time library.
  3. A file in Amiga system run time library.
  4. Copyright (c) 1998-2003 by Nils Sjoholm
  5. member of the Amiga RTL development team.
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. {
  13. History:
  14. Added overlay functions for Pchar->Strings, functions
  15. and procedures. Now you can mix PChar and Strings e.g
  16. OpenLibrary('whatis.library',37). No need to cast to
  17. a PChar.
  18. 14 Jul 2000.
  19. Changed ReadArgs, removed the var for the second arg.
  20. Changed DOSRename from longint to a boolean.
  21. Aug 04 2000.
  22. Added functions and procedures with array of const.
  23. For use with fpc 1.0.7
  24. You have to use systemvartags. Check out that unit.
  25. 09 Nov 2002.
  26. Added the define use_amiga_smartlink.
  27. 13 Jan 2003.
  28. Update for AmigaOS 3.9.
  29. Added some const.
  30. 26 Jan 2003.
  31. Changed integer > smallint.
  32. 09 Feb 2003.
  33. [email protected]
  34. }
  35. {$PACKRECORDS 2}
  36. unit amigados;
  37. INTERFACE
  38. uses exec, utility, timer;
  39. Const
  40. { Predefined Amiga DOS global constants }
  41. DOSTRUE = -1;
  42. DOSFALSE = 0;
  43. { Mode parameter to Open() }
  44. MODE_OLDFILE = 1005; { Open existing file read/write
  45. positioned at beginning of file. }
  46. MODE_NEWFILE = 1006; { Open freshly created file (delete
  47. old file) read/write }
  48. MODE_READWRITE = 1004; { Open old file w/exclusive lock }
  49. { Relative position to Seek() }
  50. OFFSET_BEGINNING = -1; { relative to Begining Of File }
  51. OFFSET_CURRENT = 0; { relative to Current file position }
  52. OFFSET_END = 1; { relative to End Of File }
  53. BITSPERBYTE = 8;
  54. BYTESPERLONG = 4;
  55. BITSPERLONG = 32;
  56. MAXINT = $7FFFFFFF;
  57. MININT = $80000000;
  58. { Passed as type to Lock() }
  59. SHARED_LOCK = -2; { File is readable by others }
  60. ACCESS_READ = -2; { Synonym }
  61. EXCLUSIVE_LOCK = -1; { No other access allowed }
  62. ACCESS_WRITE = -1; { Synonym }
  63. Type
  64. FileHandle = BPTR;
  65. FileLock = BPTR;
  66. pDateStamp = ^tDateStamp;
  67. tDateStamp = record
  68. ds_Days : Longint; { Number of days since Jan. 1, 1978 }
  69. ds_Minute : Longint; { Number of minutes past midnight }
  70. ds_Tick : Longint; { Number of ticks past minute }
  71. end;
  72. Const
  73. TICKS_PER_SECOND = 50; { Number of ticks in one second }
  74. {$PACKRECORDS 4}
  75. Type
  76. { Returned by Examine() and ExInfo(), must be on a 4 byte boundary }
  77. pFileInfoBlock = ^tFileInfoBlock;
  78. tFileInfoBlock = record
  79. fib_DiskKey : Longint;
  80. fib_DirEntryType : Longint;
  81. { Type of Directory. If < 0, then a plain file.
  82. If > 0 a directory }
  83. fib_FileName : Array [0..107] of Char;
  84. { Null terminated. Max 30 chars used for now }
  85. fib_Protection : Longint;
  86. { bit mask of protection, rwxd are 3-0. }
  87. fib_EntryType : Longint;
  88. fib_Size : Longint; { Number of bytes in file }
  89. fib_NumBlocks : Longint; { Number of blocks in file }
  90. fib_Date : tDateStamp; { Date file last changed }
  91. fib_Comment : Array [0..79] of Char;
  92. { Null terminated comment associated with file }
  93. fib_OwnerUID : Word;
  94. fib_OwnerGID : Word;
  95. fib_Reserved : Array [0..31] of Char;
  96. end;
  97. Const
  98. { FIB stands for FileInfoBlock }
  99. {* FIBB are bit definitions, FIBF are field definitions *}
  100. {* Regular RWED bits are 0 == allowed. *}
  101. {* NOTE: GRP and OTR RWED permissions are 0 == not allowed! *}
  102. {* Group and Other permissions are not directly handled by the filesystem *}
  103. FIBB_OTR_READ = 15; {* Other: file is readable *}
  104. FIBB_OTR_WRITE = 14; {* Other: file is writable *}
  105. FIBB_OTR_EXECUTE = 13; {* Other: file is executable *}
  106. FIBB_OTR_DELETE = 12; {* Other: prevent file from being deleted *}
  107. FIBB_GRP_READ = 11; {* Group: file is readable *}
  108. FIBB_GRP_WRITE = 10; {* Group: file is writable *}
  109. FIBB_GRP_EXECUTE = 9; {* Group: file is executable *}
  110. FIBB_GRP_DELETE = 8; {* Group: prevent file from being deleted *}
  111. FIBB_SCRIPT = 6; { program is a script (execute) file }
  112. FIBB_PURE = 5; { program is reentrant and rexecutable}
  113. FIBB_ARCHIVE = 4; { cleared whenever file is changed }
  114. FIBB_READ = 3; { ignored by old filesystem }
  115. FIBB_WRITE = 2; { ignored by old filesystem }
  116. FIBB_EXECUTE = 1; { ignored by system, used by Shell }
  117. FIBB_DELETE = 0; { prevent file from being deleted }
  118. FIBF_OTR_READ = (1 shl FIBB_OTR_READ);
  119. FIBF_OTR_WRITE = (1 shl FIBB_OTR_WRITE);
  120. FIBF_OTR_EXECUTE = (1 shl FIBB_OTR_EXECUTE);
  121. FIBF_OTR_DELETE = (1 shl FIBB_OTR_DELETE);
  122. FIBF_GRP_READ = (1 shl FIBB_GRP_READ);
  123. FIBF_GRP_WRITE = (1 shl FIBB_GRP_WRITE);
  124. FIBF_GRP_EXECUTE = (1 shl FIBB_GRP_EXECUTE);
  125. FIBF_GRP_DELETE = (1 shl FIBB_GRP_DELETE);
  126. FIBF_SCRIPT = 64;
  127. FIBF_PURE = 32;
  128. FIBF_ARCHIVE = 16;
  129. FIBF_READ = 8;
  130. FIBF_WRITE = 4;
  131. FIBF_EXECUTE = 2;
  132. FIBF_DELETE = 1;
  133. {* Standard maximum length for an error string from fault. However, most *}
  134. {* error strings should be kept under 60 characters if possible. Don't *}
  135. {* forget space for the header you pass in. *}
  136. FAULT_MAX = 82;
  137. {* All BCPL data must be long Integer aligned. BCPL pointers are the long Integer
  138. * address (i.e byte address divided by 4 (>>2)) *}
  139. {* BCPL strings have a length in the first byte and then the characters.
  140. * For example: s[0]=3 s[1]=S s[2]=Y s[3]=S *}
  141. Type
  142. { returned by Info(), must be on a 4 byte boundary }
  143. pInfoData = ^tInfoData;
  144. tInfoData = record
  145. id_NumSoftErrors : Longint; { number of soft errors on disk }
  146. id_UnitNumber : Longint; { Which unit disk is (was) mounted on }
  147. id_DiskState : Longint; { See defines below }
  148. id_NumBlocks : Longint; { Number of blocks on disk }
  149. id_NumBlocksUsed : Longint; { Number of block in use }
  150. id_BytesPerBlock : Longint;
  151. id_DiskType : Longint; { Disk Type code }
  152. id_VolumeNode : BPTR; { BCPL pointer to volume node }
  153. id_InUse : Longint; { Flag, zero if not in use }
  154. end;
  155. {$PACKRECORDS 2}
  156. Const
  157. { ID stands for InfoData }
  158. { Disk states }
  159. ID_WRITE_PROTECTED = 80; { Disk is write protected }
  160. ID_VALIDATING = 81; { Disk is currently being validated }
  161. ID_VALIDATED = 82; { Disk is consistent and writeable }
  162. CONST
  163. ID_NO_DISK_PRESENT = -1;
  164. ID_UNREADABLE_DISK = $42414400; { 'BAD\0' }
  165. ID_DOS_DISK = $444F5300; { 'DOS\0' }
  166. ID_FFS_DISK = $444F5301; { 'DOS\1' }
  167. ID_NOT_REALLY_DOS = $4E444F53; { 'NDOS' }
  168. ID_KICKSTART_DISK = $4B49434B; { 'KICK' }
  169. ID_MSDOS_DISK = $4d534400; { 'MSD\0' }
  170. { Errors from IoErr(), etc. }
  171. ERROR_NO_FREE_STORE = 103;
  172. ERROR_TASK_TABLE_FULL = 105;
  173. ERROR_BAD_TEMPLATE = 114;
  174. ERROR_BAD_NUMBER = 115;
  175. ERROR_REQUIRED_ARG_MISSING = 116;
  176. ERROR_KEY_NEEDS_ARG = 117;
  177. ERROR_TOO_MANY_ARGS = 118;
  178. ERROR_UNMATCHED_QUOTES = 119;
  179. ERROR_LINE_TOO_LONG = 120;
  180. ERROR_FILE_NOT_OBJECT = 121;
  181. ERROR_INVALID_RESIDENT_LIBRARY = 122;
  182. ERROR_NO_DEFAULT_DIR = 201;
  183. ERROR_OBJECT_IN_USE = 202;
  184. ERROR_OBJECT_EXISTS = 203;
  185. ERROR_DIR_NOT_FOUND = 204;
  186. ERROR_OBJECT_NOT_FOUND = 205;
  187. ERROR_BAD_STREAM_NAME = 206;
  188. ERROR_OBJECT_TOO_LARGE = 207;
  189. ERROR_ACTION_NOT_KNOWN = 209;
  190. ERROR_INVALID_COMPONENT_NAME = 210;
  191. ERROR_INVALID_LOCK = 211;
  192. ERROR_OBJECT_WRONG_TYPE = 212;
  193. ERROR_DISK_NOT_VALIDATED = 213;
  194. ERROR_DISK_WRITE_PROTECTED = 214;
  195. ERROR_RENAME_ACROSS_DEVICES = 215;
  196. ERROR_DIRECTORY_NOT_EMPTY = 216;
  197. ERROR_TOO_MANY_LEVELS = 217;
  198. ERROR_DEVICE_NOT_MOUNTED = 218;
  199. ERROR_SEEK_ERROR = 219;
  200. ERROR_COMMENT_TOO_BIG = 220;
  201. ERROR_DISK_FULL = 221;
  202. ERROR_DELETE_PROTECTED = 222;
  203. ERROR_WRITE_PROTECTED = 223;
  204. ERROR_READ_PROTECTED = 224;
  205. ERROR_NOT_A_DOS_DISK = 225;
  206. ERROR_NO_DISK = 226;
  207. ERROR_NO_MORE_ENTRIES = 232;
  208. { added for 1.4 }
  209. ERROR_IS_SOFT_LINK = 233;
  210. ERROR_OBJECT_LINKED = 234;
  211. ERROR_BAD_HUNK = 235;
  212. ERROR_NOT_IMPLEMENTED = 236;
  213. ERROR_RECORD_NOT_LOCKED = 240;
  214. ERROR_LOCK_COLLISION = 241;
  215. ERROR_LOCK_TIMEOUT = 242;
  216. ERROR_UNLOCK_ERROR = 243;
  217. { error codes 303-305 are defined in dosasl.h }
  218. { These are the return codes used by convention by AmigaDOS commands }
  219. { See FAILAT and IF for relvance to EXECUTE files }
  220. RETURN_OK = 0; { No problems, success }
  221. RETURN_WARN = 5; { A warning only }
  222. RETURN_ERROR = 10; { Something wrong }
  223. RETURN_FAIL = 20; { Complete or severe failure}
  224. { Bit numbers that signal you that a user has issued a break }
  225. SIGBREAKB_CTRL_C = 12;
  226. SIGBREAKB_CTRL_D = 13;
  227. SIGBREAKB_CTRL_E = 14;
  228. SIGBREAKB_CTRL_F = 15;
  229. { Bit fields that signal you that a user has issued a break }
  230. { for example: if (SetSignal(0,0) & SIGBREAKF_CTRL_C) cleanup_and_exit(); }
  231. SIGBREAKF_CTRL_C = 4096;
  232. SIGBREAKF_CTRL_D = 8192;
  233. SIGBREAKF_CTRL_E = 16384;
  234. SIGBREAKF_CTRL_F = 32768;
  235. { Values returned by SameLock() }
  236. LOCK_SAME = 0;
  237. LOCK_SAME_HANDLER = 1; { actually same volume }
  238. LOCK_DIFFERENT = -1;
  239. { types for ChangeMode() }
  240. CHANGE_LOCK = 0;
  241. CHANGE_FH = 1;
  242. { Values for MakeLink() }
  243. LINK_HARD = 0;
  244. LINK_SOFT = 1; { softlinks are not fully supported yet }
  245. { values returned by }
  246. ITEM_EQUAL = -2; { "=" Symbol }
  247. ITEM_ERROR = -1; { error }
  248. ITEM_NOTHING = 0; { *N, ;, endstreamch }
  249. ITEM_UNQUOTED = 1; { unquoted item }
  250. ITEM_QUOTED = 2; { quoted item }
  251. { types for AllocDosObject/FreeDosObject }
  252. DOS_FILEHANDLE = 0; { few people should use this }
  253. DOS_EXALLCONTROL = 1; { Must be used to allocate this! }
  254. DOS_FIB = 2; { useful }
  255. DOS_STDPKT = 3; { for doing packet-level I/O }
  256. DOS_CLI = 4; { for shell-writers, etc }
  257. DOS_RDARGS = 5; { for ReadArgs if you pass it in }
  258. {
  259. * Data structures and equates used by the V1.4 DOS functions
  260. * StrtoDate() and DatetoStr()
  261. }
  262. {--------- String/Date structures etc }
  263. Type
  264. _pDateTime = ^_tDateTime;
  265. _tDateTime = record
  266. dat_Stamp : tDateStamp; { DOS DateStamp }
  267. dat_Format, { controls appearance of dat_StrDate }
  268. dat_Flags : Byte; { see BITDEF's below }
  269. dat_StrDay, { day of the week string }
  270. dat_StrDate, { date string }
  271. dat_StrTime : STRPTR; { time string }
  272. END;
  273. { You need this much room for each of the DateTime strings: }
  274. CONST
  275. LEN_DATSTRING = 16;
  276. { flags for dat_Flags }
  277. DTB_SUBST = 0; { substitute Today, Tomorrow, etc. }
  278. DTF_SUBST = 1;
  279. DTB_FUTURE = 1; { day of the week is in future }
  280. DTF_FUTURE = 2;
  281. {
  282. * date format values
  283. }
  284. FORMAT_DOS = 0; { dd-mmm-yy }
  285. FORMAT_INT = 1; { yy-mm-dd }
  286. FORMAT_USA = 2; { mm-dd-yy }
  287. FORMAT_CDN = 3; { dd-mm-yy }
  288. FORMAT_MAX = FORMAT_CDN;
  289. FORMAT_DEF = 4; { use default format, as defined
  290. by locale; if locale not
  291. available, use FORMAT_DOS
  292. instead }
  293. {**********************************************************************
  294. ************************ PATTERN MATCHING ******************************
  295. ************************************************************************
  296. * structure expected by MatchFirst, MatchNext.
  297. * Allocate this structure and initialize it as follows:
  298. *
  299. * Set ap_BreakBits to the signal bits (CDEF) that you want to take a
  300. * break on, or NULL, if you don't want to convenience the user.
  301. *
  302. * If you want to have the FULL PATH NAME of the files you found,
  303. * allocate a buffer at the END of this structure, and put the size of
  304. * it into ap_Strlen. If you don't want the full path name, make sure
  305. * you set ap_Strlen to zero. In this case, the name of the file, and stats
  306. * are available in the ap_Info, as per usual.
  307. *
  308. * Then call MatchFirst() and then afterwards, MatchNext() with this structure.
  309. * You should check the return value each time (see below) and take the
  310. * appropriate action, ultimately calling MatchEnd() when there are
  311. * no more files and you are done. You can tell when you are done by
  312. * checking for the normal AmigaDOS return code ERROR_NO_MORE_ENTRIES.
  313. *
  314. }
  315. Type
  316. pAChain = ^tAChain;
  317. tAChain = record
  318. an_Child,
  319. an_Parent : pAChain;
  320. an_Lock : BPTR;
  321. an_Info : tFileInfoBlock;
  322. an_Flags : Shortint;
  323. an_String : Array[0..0] of Char; { FIX!! }
  324. END;
  325. pAnchorPath = ^tAnchorPath;
  326. tAnchorPath = record
  327. case smallint of
  328. 0 : (
  329. ap_First : pAChain;
  330. ap_Last : pAChain;
  331. );
  332. 1 : (
  333. ap_Base, { pointer to first anchor }
  334. ap_Current : pAChain; { pointer to last anchor }
  335. ap_BreakBits, { Bits we want to break on }
  336. ap_FoundBreak : Longint; { Bits we broke on. Also returns ERROR_BREAK }
  337. ap_Flags : Shortint; { New use for extra Integer. }
  338. ap_Reserved : Shortint;
  339. ap_Strlen : smallint; { This is what ap_Length used to be }
  340. ap_Info : tFileInfoBlock;
  341. ap_Buf : Array[0..0] of Char; { Buffer for path name, allocated by user !! }
  342. { FIX! }
  343. );
  344. END;
  345. CONST
  346. APB_DOWILD = 0; { User option ALL }
  347. APF_DOWILD = 1;
  348. APB_ITSWILD = 1; { Set by MatchFirst, used by MatchNext }
  349. APF_ITSWILD = 2; { Application can test APB_ITSWILD, too }
  350. { (means that there's a wildcard }
  351. { in the pattern after calling }
  352. { MatchFirst). }
  353. APB_DODIR = 2; { Bit is SET IF a DIR node should be }
  354. APF_DODIR = 4; { entered. Application can RESET this }
  355. { bit after MatchFirst/MatchNext to AVOID }
  356. { entering a dir. }
  357. APB_DIDDIR = 3; { Bit is SET for an "expired" dir node. }
  358. APF_DIDDIR = 8;
  359. APB_NOMEMERR = 4; { Set on memory error }
  360. APF_NOMEMERR = 16;
  361. APB_DODOT = 5; { IF set, allow conversion of '.' to }
  362. APF_DODOT = 32; { CurrentDir }
  363. APB_DirChanged = 6; { ap_Current->an_Lock changed }
  364. APF_DirChanged = 64; { since last MatchNext call }
  365. DDB_PatternBit = 0;
  366. DDF_PatternBit = 1;
  367. DDB_ExaminedBit = 1;
  368. DDF_ExaminedBit = 2;
  369. DDB_Completed = 2;
  370. DDF_Completed = 4;
  371. DDB_AllBit = 3;
  372. DDF_AllBit = 8;
  373. DDB_Single = 4;
  374. DDF_Single = 16;
  375. {
  376. * Constants used by wildcard routines, these are the pre-parsed tokens
  377. * referred to by pattern match. It is not necessary for you to do
  378. * anything about these, MatchFirst() MatchNext() handle all these for you.
  379. }
  380. P_ANY = $80; { Token for '*' or '#? }
  381. P_SINGLE = $81; { Token for '?' }
  382. P_ORSTART = $82; { Token for '(' }
  383. P_ORNEXT = $83; { Token for '|' }
  384. P_OREND = $84; { Token for ')' }
  385. P_NOT = $85; { Token for '~' }
  386. P_NOTEND = $86; { Token for }
  387. P_NOTCLASS = $87; { Token for '^' }
  388. P_CLASS = $88; { Token for '[]' }
  389. P_REPBEG = $89; { Token for '[' }
  390. P_REPEND = $8A; { Token for ']' }
  391. P_STOP = $8B; { token to force end of evaluation }
  392. { Values for an_Status, NOTE: These are the actual bit numbers }
  393. COMPLEX_BIT = 1; { Parsing complex pattern }
  394. EXAMINE_BIT = 2; { Searching directory }
  395. {
  396. * Returns from MatchFirst(), MatchNext()
  397. * You can also get dos error returns, such as ERROR_NO_MORE_ENTRIES,
  398. * these are in the dos.h file.
  399. }
  400. ERROR_BUFFER_OVERFLOW = 303; { User OR internal buffer overflow }
  401. ERROR_BREAK = 304; { A break character was received }
  402. ERROR_NOT_EXECUTABLE = 305; { A file has E bit cleared }
  403. { hunk types }
  404. HUNK_UNIT = 999 ;
  405. HUNK_NAME = 1000;
  406. HUNK_CODE = 1001;
  407. HUNK_DATA = 1002;
  408. HUNK_BSS = 1003;
  409. HUNK_RELOC32 = 1004;
  410. HUNK_RELOC16 = 1005;
  411. HUNK_RELOC8 = 1006;
  412. HUNK_EXT = 1007;
  413. HUNK_SYMBOL = 1008;
  414. HUNK_DEBUG = 1009;
  415. HUNK_END = 1010;
  416. HUNK_HEADER = 1011;
  417. HUNK_OVERLAY = 1013;
  418. HUNK_BREAK = 1014;
  419. HUNK_DREL32 = 1015;
  420. HUNK_DREL16 = 1016;
  421. HUNK_DREL8 = 1017;
  422. HUNK_LIB = 1018;
  423. HUNK_INDEX = 1019;
  424. { hunk_ext sub-types }
  425. EXT_SYMB = 0 ; { symbol table }
  426. EXT_DEF = 1 ; { relocatable definition }
  427. EXT_ABS = 2 ; { Absolute definition }
  428. EXT_RES = 3 ; { no longer supported }
  429. EXT_REF32 = 129; { 32 bit reference to symbol }
  430. EXT_COMMON = 130; { 32 bit reference to COMMON block }
  431. EXT_REF16 = 131; { 16 bit reference to symbol }
  432. EXT_REF8 = 132; { 8 bit reference to symbol }
  433. EXT_DEXT32 = 133; { 32 bit data releative reference }
  434. EXT_DEXT16 = 134; { 16 bit data releative reference }
  435. EXT_DEXT8 = 135; { 8 bit data releative reference }
  436. Type
  437. { All DOS processes have this structure }
  438. { Create and Device Proc returns pointer to the MsgPort in this structure }
  439. { dev_proc = Address(smallint(DeviceProc()) - SizeOf(Task)) }
  440. pProcess = ^tProcess;
  441. tProcess = record
  442. pr_Task : tTask;
  443. pr_MsgPort : tMsgPort; { This is BPTR address from DOS functions }
  444. pr_Pad : smallint; { Remaining variables on 4 byte boundaries }
  445. pr_SegList : BPTR; { Array of seg lists used by this process }
  446. pr_StackSize : Longint; { Size of process stack in bytes }
  447. pr_GlobVec : Pointer; { Global vector for this process (BCPL) }
  448. pr_TaskNum : Longint; { CLI task number of zero if not a CLI }
  449. pr_StackBase : BPTR; { Ptr to high memory end of process stack }
  450. pr_Result2 : Longint; { Value of secondary result from last call }
  451. pr_CurrentDir : BPTR; { Lock associated with current directory }
  452. pr_CIS : BPTR; { Current CLI Input Stream }
  453. pr_COS : BPTR; { Current CLI Output Stream }
  454. pr_ConsoleTask : Pointer; { Console handler process for current window}
  455. pr_FileSystemTask : Pointer; { File handler process for current drive }
  456. pr_CLI : BPTR; { pointer to ConsoleLineInterpreter }
  457. pr_ReturnAddr : Pointer; { pointer to previous stack frame }
  458. pr_PktWait : Pointer; { Function to be called when awaiting msg }
  459. pr_WindowPtr : Pointer; { Window for error printing }
  460. { following definitions are new with 2.0 }
  461. pr_HomeDir : BPTR; { Home directory of executing program }
  462. pr_Flags : Longint; { flags telling dos about process }
  463. pr_ExitCode : Pointer; { code to call on exit of program OR NULL }
  464. pr_ExitData : Longint; { Passed as an argument to pr_ExitCode. }
  465. pr_Arguments : STRPTR; { Arguments passed to the process at start }
  466. pr_LocalVars : tMinList; { Local environment variables }
  467. pr_ShellPrivate : ULONG; { for the use of the current shell }
  468. pr_CES : BPTR; { Error stream - IF NULL, use pr_COS }
  469. end;
  470. {
  471. * Flags for pr_Flags
  472. }
  473. CONST
  474. PRB_FREESEGLIST = 0 ;
  475. PRF_FREESEGLIST = 1 ;
  476. PRB_FREECURRDIR = 1 ;
  477. PRF_FREECURRDIR = 2 ;
  478. PRB_FREECLI = 2 ;
  479. PRF_FREECLI = 4 ;
  480. PRB_CLOSEINPUT = 3 ;
  481. PRF_CLOSEINPUT = 8 ;
  482. PRB_CLOSEOUTPUT = 4 ;
  483. PRF_CLOSEOUTPUT = 16;
  484. PRB_FREEARGS = 5 ;
  485. PRF_FREEARGS = 32;
  486. { The long smallint address (BPTR) of this structure is returned by
  487. * Open() and other routines that return a file. You need only worry
  488. * about this struct to do async io's via PutMsg() instead of
  489. * standard file system calls }
  490. Type
  491. pFileHandle = ^tFileHandle;
  492. tFileHandle = record
  493. fh_Link : pMessage; { EXEC message }
  494. fh_Port : pMsgPort; { Reply port for the packet }
  495. fh_Type : pMsgPort; { Port to do PutMsg() to
  496. Address is negative if a plain file }
  497. fh_Buf : Longint;
  498. fh_Pos : Longint;
  499. fh_End : Longint;
  500. fh_Func1 : Longint;
  501. fh_Func2 : Longint;
  502. fh_Func3 : Longint;
  503. fh_Arg1 : Longint;
  504. fh_Arg2 : Longint;
  505. end;
  506. { This is the extension to EXEC Messages used by DOS }
  507. pDosPacket = ^tDosPacket;
  508. tDosPacket = record
  509. dp_Link : pMessage; { EXEC message }
  510. dp_Port : pMsgPort; { Reply port for the packet }
  511. { Must be filled in each send. }
  512. case smallint of
  513. 0 : (
  514. dp_Action : Longint;
  515. dp_Status : Longint;
  516. dp_Status2 : Longint;
  517. dp_BufAddr : Longint;
  518. );
  519. 1 : (
  520. dp_Type : Longint; { See ACTION_... below and
  521. * 'R' means Read, 'W' means Write to the
  522. * file system }
  523. dp_Res1 : Longint; { For file system calls this is the result
  524. * that would have been returned by the
  525. * function, e.g. Write ('W') returns actual
  526. * length written }
  527. dp_Res2 : Longint; { For file system calls this is what would
  528. * have been returned by IoErr() }
  529. dp_Arg1 : Longint;
  530. dp_Arg2 : Longint;
  531. dp_Arg3 : Longint;
  532. dp_Arg4 : Longint;
  533. dp_Arg5 : Longint;
  534. dp_Arg6 : Longint;
  535. dp_Arg7 : Longint;
  536. );
  537. end;
  538. { A Packet does not require the Message to be before it in memory, but
  539. * for convenience it is useful to associate the two.
  540. * Also see the function init_std_pkt for initializing this structure }
  541. pStandardPacket = ^tStandardPacket;
  542. tStandardPacket = record
  543. sp_Msg : tMessage;
  544. sp_Pkt : tDosPacket;
  545. end;
  546. Const
  547. { Packet types }
  548. ACTION_NIL = 0;
  549. ACTION_GET_BLOCK = 2; { OBSOLETE }
  550. ACTION_SET_MAP = 4;
  551. ACTION_DIE = 5;
  552. ACTION_EVENT = 6;
  553. ACTION_CURRENT_VOLUME = 7;
  554. ACTION_LOCATE_OBJECT = 8;
  555. ACTION_RENAME_DISK = 9;
  556. ACTION_WRITE = $57; { 'W' }
  557. ACTION_READ = $52; { 'R' }
  558. ACTION_FREE_LOCK = 15;
  559. ACTION_DELETE_OBJECT = 16;
  560. ACTION_RENAME_OBJECT = 17;
  561. ACTION_MORE_CACHE = 18;
  562. ACTION_COPY_DIR = 19;
  563. ACTION_WAIT_CHAR = 20;
  564. ACTION_SET_PROTECT = 21;
  565. ACTION_CREATE_DIR = 22;
  566. ACTION_EXAMINE_OBJECT = 23;
  567. ACTION_EXAMINE_NEXT = 24;
  568. ACTION_DISK_INFO = 25;
  569. ACTION_INFO = 26;
  570. ACTION_FLUSH = 27;
  571. ACTION_SET_COMMENT = 28;
  572. ACTION_PARENT = 29;
  573. ACTION_TIMER = 30;
  574. ACTION_INHIBIT = 31;
  575. ACTION_DISK_TYPE = 32;
  576. ACTION_DISK_CHANGE = 33;
  577. ACTION_SET_DATE = 34;
  578. ACTION_SCREEN_MODE = 994;
  579. ACTION_READ_RETURN = 1001;
  580. ACTION_WRITE_RETURN = 1002;
  581. ACTION_SEEK = 1008;
  582. ACTION_FINDUPDATE = 1004;
  583. ACTION_FINDINPUT = 1005;
  584. ACTION_FINDOUTPUT = 1006;
  585. ACTION_END = 1007;
  586. ACTION_TRUNCATE = 1022; { fast file system only }
  587. ACTION_WRITE_PROTECT = 1023; { fast file system only }
  588. { new 2.0 packets }
  589. ACTION_SAME_LOCK = 40;
  590. ACTION_CHANGE_SIGNAL = 995;
  591. ACTION_FORMAT = 1020;
  592. ACTION_MAKE_LINK = 1021;
  593. {}
  594. {}
  595. ACTION_READ_LINK = 1024;
  596. ACTION_FH_FROM_LOCK = 1026;
  597. ACTION_IS_FILESYSTEM = 1027;
  598. ACTION_CHANGE_MODE = 1028;
  599. {}
  600. ACTION_COPY_DIR_FH = 1030;
  601. ACTION_PARENT_FH = 1031;
  602. ACTION_EXAMINE_ALL = 1033;
  603. ACTION_EXAMINE_FH = 1034;
  604. ACTION_LOCK_RECORD = 2008;
  605. ACTION_FREE_RECORD = 2009;
  606. ACTION_ADD_NOTIFY = 4097;
  607. ACTION_REMOVE_NOTIFY = 4098;
  608. {* Added in V39: *}
  609. ACTION_EXAMINE_ALL_END = 1035;
  610. ACTION_SET_OWNER = 1036;
  611. {* Tell a file system to serialize the current volume. This is typically
  612. * done by changing the creation date of the disk. This packet does not take
  613. * any arguments. NOTE: be prepared to handle failure of this packet for
  614. * V37 ROM filesystems.
  615. *}
  616. ACTION_SERIALIZE_DISK = 4200;
  617. {
  618. * A structure for holding error messages - stored as array with error == 0
  619. * for the last entry.
  620. }
  621. Type
  622. pErrorString = ^tErrorString;
  623. tErrorString = record
  624. estr_Nums : Pointer;
  625. estr_Strings : Pointer;
  626. END;
  627. { DOS library node structure.
  628. * This is the data at positive offsets from the library node.
  629. * Negative offsets from the node is the jump table to DOS functions
  630. * node = (struct DosLibrary *) OpenLibrary( "dos.library" .. ) }
  631. Type
  632. pDosLibrary = ^tDosLibrary;
  633. tDosLibrary = record
  634. dl_lib : tLibrary;
  635. dl_Root : Pointer; { Pointer to RootNode, described below }
  636. dl_GV : Pointer; { Pointer to BCPL global vector }
  637. dl_A2 : Longint; { Private register dump of DOS }
  638. dl_A5 : Longint;
  639. dl_A6 : Longint;
  640. dl_Errors : pErrorString; { pointer to array of error msgs }
  641. dl_TimeReq : pTimeRequest; { private pointer to timer request }
  642. dl_UtilityBase : pLibrary; { private ptr to utility library }
  643. dl_IntuitionBase : pLibrary;
  644. end;
  645. pRootNode = ^tRootNode;
  646. tRootNode = record
  647. rn_TaskArray : BPTR; { [0] is max number of CLI's
  648. [1] is APTR to process id of CLI 1
  649. [n] is APTR to process id of CLI n }
  650. rn_ConsoleSegment : BPTR; { SegList for the CLI }
  651. rn_Time : tDateStamp; { Current time }
  652. rn_RestartSeg : Longint; { SegList for the disk validator process }
  653. rn_Info : BPTR; { Pointer ot the Info structure }
  654. rn_FileHandlerSegment : BPTR; { segment for a file handler }
  655. rn_CliList : tMinList; { new list of all CLI processes }
  656. { the first cpl_Array is also rn_TaskArray }
  657. rn_BootProc : pMsgPort; { private ptr to msgport of boot fs }
  658. rn_ShellSegment : BPTR; { seglist for Shell (for NewShell) }
  659. rn_Flags : Longint; { dos flags }
  660. end;
  661. CONST
  662. RNB_WILDSTAR = 24;
  663. RNF_WILDSTAR = 16777216;
  664. RNB_PRIVATE1 = 1; { private for dos }
  665. RNF_PRIVATE1 = 2;
  666. Type
  667. pDosInfo = ^tDosInfo;
  668. tDosInfo = record
  669. case smallint of
  670. 0 : (
  671. di_ResList : BPTR;
  672. );
  673. 1 : (
  674. di_McName : BPTR; { Network name of this machine; currently 0 }
  675. di_DevInfo : BPTR; { Device List }
  676. di_Devices : BPTR; { Currently zero }
  677. di_Handlers : BPTR; { Currently zero }
  678. di_NetHand : Pointer; { Network handler processid; currently zero }
  679. di_DevLock, { do NOT access directly! }
  680. di_EntryLock, { do NOT access directly! }
  681. di_DeleteLock : tSignalSemaphore; { do NOT access directly! }
  682. );
  683. end;
  684. { ONLY to be allocated by DOS! }
  685. pCliProcList = ^tCliProcList;
  686. tCliProcList = record
  687. cpl_Node : tMinNode;
  688. cpl_First : Longint; { number of first entry in array }
  689. cpl_Array : Array[0..0] of pMsgPort;
  690. { [0] is max number of CLI's in this entry (n)
  691. * [1] is CPTR to process id of CLI cpl_First
  692. * [n] is CPTR to process id of CLI cpl_First+n-1
  693. }
  694. END;
  695. { structure for the Dos resident list. Do NOT allocate these, use }
  696. { AddSegment(), and heed the warnings in the autodocs! }
  697. Type
  698. pSegment = ^tSegment;
  699. tSegment = record
  700. seg_Next : BPTR;
  701. seg_UC : Longint;
  702. seg_Seg : BPTR;
  703. seg_Name : Array[0..3] of Char; { actually the first 4 chars of BSTR name }
  704. END;
  705. CONST
  706. CMD_SYSTEM = -1;
  707. CMD_INTERNAL = -2;
  708. CMD_DISABLED = -999;
  709. { DOS Processes started from the CLI via RUN or NEWCLI have this additional
  710. * set to data associated with them }
  711. Type
  712. pCommandLineInterface = ^tCommandLineInterface;
  713. tCommandLineInterface = record
  714. cli_Result2 : Longint; { Value of IoErr from last command }
  715. cli_SetName : BSTR; { Name of current directory }
  716. cli_CommandDir : BPTR; { Lock associated with command directory }
  717. cli_ReturnCode : Longint; { Return code from last command }
  718. cli_CommandName : BSTR; { Name of current command }
  719. cli_FailLevel : Longint; { Fail level (set by FAILAT) }
  720. cli_Prompt : BSTR; { Current prompt (set by PROMPT) }
  721. cli_StandardInput : BPTR; { Default (terminal) CLI input }
  722. cli_CurrentInput : BPTR; { Current CLI input }
  723. cli_CommandFile : BSTR; { Name of EXECUTE command file }
  724. cli_Interactive : Longint; { Boolean; True if prompts required }
  725. cli_Background : Longint; { Boolean; True if CLI created by RUN }
  726. cli_CurrentOutput : BPTR; { Current CLI output }
  727. cli_DefaultStack : Longint; { Stack size to be obtained in long words }
  728. cli_StandardOutput : BPTR; { Default (terminal) CLI output }
  729. cli_Module : BPTR; { SegList of currently loaded command }
  730. end;
  731. { This structure can take on different values depending on whether it is
  732. * a device, an assigned directory, or a volume. Below is the structure
  733. * reflecting volumes only. Following that is the structure representing
  734. * only devices.
  735. }
  736. { structure representing a volume }
  737. pDeviceList = ^tDeviceList;
  738. tDeviceList = record
  739. dl_Next : BPTR; { bptr to next device list }
  740. dl_Type : Longint; { see DLT below }
  741. dl_Task : pMsgPort; { ptr to handler task }
  742. dl_Lock : BPTR; { not for volumes }
  743. dl_VolumeDate : tDateStamp; { creation date }
  744. dl_LockList : BPTR; { outstanding locks }
  745. dl_DiskType : Longint; { 'DOS', etc }
  746. dl_unused : Longint;
  747. dl_Name : BSTR; { bptr to bcpl name }
  748. end;
  749. { device structure (same as the DeviceNode structure in filehandler.h) }
  750. pDevInfo = ^tDevInfo;
  751. tDevInfo = record
  752. dvi_Next : BPTR;
  753. dvi_Type : Longint;
  754. dvi_Task : Pointer;
  755. dvi_Lock : BPTR;
  756. dvi_Handler : BSTR;
  757. dvi_StackSize : Longint;
  758. dvi_Priority : Longint;
  759. dvi_Startup : Longint;
  760. dvi_SegList : BPTR;
  761. dvi_GlobVec : BSTR;
  762. dvi_Name : BSTR;
  763. end;
  764. { structure used for multi-directory assigns. AllocVec()ed. }
  765. pAssignList = ^tAssignList;
  766. tAssignList = record
  767. al_Next : pAssignList;
  768. al_Lock : BPTR;
  769. END;
  770. { combined structure for devices, assigned directories, volumes }
  771. pDosList = ^tDosList;
  772. tDosList = record
  773. dol_Next : BPTR; { bptr to next device on list }
  774. dol_Type : Longint; { see DLT below }
  775. dol_Task : pMsgPort; { ptr to handler task }
  776. dol_Lock : BPTR;
  777. case smallint of
  778. 0 : (
  779. dol_Handler : record
  780. dol_Handler : BSTR; { file name to load IF seglist is null }
  781. dol_StackSize, { stacksize to use when starting process }
  782. dol_Priority, { task priority when starting process }
  783. dol_Startup : Longint; { startup msg: FileSysStartupMsg for disks }
  784. dol_SegList, { already loaded code for new task }
  785. dol_GlobVec : BPTR; { BCPL global vector to use when starting
  786. * a process. -1 indicates a C/Assembler
  787. * program. }
  788. end;
  789. );
  790. 1 : (
  791. dol_Volume : record
  792. dol_VolumeDate : tDateStamp; { creation date }
  793. dol_LockList : BPTR; { outstanding locks }
  794. dol_DiskType : Longint; { 'DOS', etc }
  795. END;
  796. );
  797. 2 : (
  798. dol_assign : record
  799. dol_AssignName : STRPTR; { name for non-OR-late-binding assign }
  800. dol_List : pAssignList; { for multi-directory assigns (regular) }
  801. END;
  802. );
  803. 3 : (
  804. dol_Misc : array[0..23] of byte;
  805. dol_Name : BSTR; { bptr to bcpl name }
  806. );
  807. END;
  808. Const
  809. { definitions for dl_Type }
  810. DLT_DEVICE = 0;
  811. DLT_DIRECTORY = 1;
  812. DLT_VOLUME = 2;
  813. DLT_LATE = 3; { late-binding assign }
  814. DLT_NONBINDING = 4; { non-binding assign }
  815. DLT_PRIVATE = -1; { for internal use only }
  816. { structure return by GetDeviceProc() }
  817. Type
  818. pDevProc = ^tDevProc;
  819. tDevProc = record
  820. dvp_Port : pMsgPort;
  821. dvp_Lock : BPTR;
  822. dvp_Flags : Longint;
  823. dvp_DevNode : pDosList; { DON'T TOUCH OR USE! }
  824. END;
  825. CONST
  826. { definitions for dvp_Flags }
  827. DVPB_UNLOCK = 0;
  828. DVPF_UNLOCK = 1;
  829. DVPB_ASSIGN = 1;
  830. DVPF_ASSIGN = 2;
  831. { Flags to be passed to LockDosList(), etc }
  832. LDB_DEVICES = 2;
  833. LDF_DEVICES = 4;
  834. LDB_VOLUMES = 3;
  835. LDF_VOLUMES = 8;
  836. LDB_ASSIGNS = 4;
  837. LDF_ASSIGNS = 16;
  838. LDB_ENTRY = 5;
  839. LDF_ENTRY = 32;
  840. LDB_DELETE = 6;
  841. LDF_DELETE = 64;
  842. { you MUST specify one of LDF_READ or LDF_WRITE }
  843. LDB_READ = 0;
  844. LDF_READ = 1;
  845. LDB_WRITE = 1;
  846. LDF_WRITE = 2;
  847. { actually all but LDF_ENTRY (which is used for internal locking) }
  848. LDF_ALL = (LDF_DEVICES+LDF_VOLUMES+LDF_ASSIGNS);
  849. { error report types for ErrorReport() }
  850. REPORT_STREAM = 0; { a stream }
  851. REPORT_TASK = 1; { a process - unused }
  852. REPORT_LOCK = 2; { a lock }
  853. REPORT_VOLUME = 3; { a volume node }
  854. REPORT_INSERT = 4; { please insert volume }
  855. { Special error codes for ErrorReport() }
  856. ABORT_DISK_ERROR = 296; { Read/write error }
  857. ABORT_BUSY = 288; { You MUST replace... }
  858. { types for initial packets to shells from run/newcli/execute/system. }
  859. { For shell-writers only }
  860. RUN_EXECUTE = -1;
  861. RUN_SYSTEM = -2;
  862. RUN_SYSTEM_ASYNCH = -3;
  863. { Types for fib_DirEntryType. NOTE that both USERDIR and ROOT are }
  864. { directories, and that directory/file checks should use <0 and >=0. }
  865. { This is not necessarily exhaustive! Some handlers may use other }
  866. { values as needed, though <0 and >=0 should remain as supported as }
  867. { possible. }
  868. ST_ROOT = 1 ;
  869. ST_USERDIR = 2 ;
  870. ST_SOFTLINK = 3 ; { looks like dir, but may point to a file! }
  871. ST_LINKDIR = 4 ; { hard link to dir }
  872. ST_FILE = -3; { must be negative for FIB! }
  873. ST_LINKFILE = -4; { hard link to file }
  874. ST_PIPEFILE = -5; { for pipes that support ExamineFH }
  875. Type
  876. { a lock structure, as returned by Lock() or DupLock() }
  877. pFileLock = ^tFileLock;
  878. tFileLock = record
  879. fl_Link : BPTR; { bcpl pointer to next lock }
  880. fl_Key : Longint; { disk block number }
  881. fl_Access : Longint; { exclusive or shared }
  882. fl_Task : pMsgPort; { handler task's port }
  883. fl_Volume : BPTR; { bptr to a DeviceList }
  884. end;
  885. { NOTE: V37 dos.library, when doing ExAll() emulation, and V37 filesystems }
  886. { will return an error if passed ED_OWNER. If you get ERROR_BAD_NUMBER, }
  887. { retry with ED_COMMENT to get everything but owner info. All filesystems }
  888. { supporting ExAll() must support through ED_COMMENT, and must check Type }
  889. { and return ERROR_BAD_NUMBER if they don't support the type. }
  890. { values that can be passed for what data you want from ExAll() }
  891. { each higher value includes those below it (numerically) }
  892. { you MUST chose one of these values }
  893. CONST
  894. ED_NAME = 1;
  895. ED_TYPE = 2;
  896. ED_SIZE = 3;
  897. ED_PROTECTION = 4;
  898. ED_DATE = 5;
  899. ED_COMMENT = 6;
  900. ED_OWNER = 7;
  901. {
  902. * Structure in which exall results are returned in. Note that only the
  903. * fields asked for will exist!
  904. }
  905. Type
  906. pExAllData = ^tExAllData;
  907. tExAllData = record
  908. ed_Next : pExAllData;
  909. ed_Name : STRPTR;
  910. ed_Type : LongInt;
  911. ed_Size,
  912. ed_Prot,
  913. ed_Days,
  914. ed_Mins,
  915. ed_Ticks : ULONG;
  916. ed_Comment : STRPTR; { strings will be after last used field }
  917. ed_OwnerUID, { new for V39 }
  918. ed_OwnerGID : Word;
  919. END;
  920. {
  921. * Control structure passed to ExAll. Unused fields MUST be initialized to
  922. * 0, expecially eac_LastKey.
  923. *
  924. * eac_MatchFunc is a hook (see utility.library documentation for usage)
  925. * It should return true if the entry is to returned, false if it is to be
  926. * ignored.
  927. *
  928. * This structure MUST be allocated by AllocDosObject()!
  929. }
  930. pExAllControl = ^tExAllControl;
  931. tExAllControl = record
  932. eac_Entries, { number of entries returned in buffer }
  933. eac_LastKey : ULONG; { Don't touch inbetween linked ExAll calls! }
  934. eac_MatchString : STRPTR; { wildcard string for pattern match OR NULL }
  935. eac_MatchFunc : pHook; { optional private wildcard FUNCTION }
  936. END;
  937. { The disk "environment" is a longword array that describes the
  938. * disk geometry. It is variable sized, with the length at the beginning.
  939. * Here are the constants for a standard geometry.
  940. }
  941. Type
  942. pDosEnvec = ^tDosEnvec;
  943. tDosEnvec = record
  944. de_TableSize : ULONG; { Size of Environment vector }
  945. de_SizeBlock : ULONG; { in longwords: standard value is 128 }
  946. de_SecOrg : ULONG; { not used; must be 0 }
  947. de_Surfaces : ULONG; { # of heads (surfaces). drive specific }
  948. de_SectorPerBlock : ULONG; { not used; must be 1 }
  949. de_BlocksPerTrack : ULONG; { blocks per track. drive specific }
  950. de_Reserved : ULONG; { DOS reserved blocks at start of partition. }
  951. de_PreAlloc : ULONG; { DOS reserved blocks at end of partition }
  952. de_Interleave : ULONG; { usually 0 }
  953. de_LowCyl : ULONG; { starting cylinder. typically 0 }
  954. de_HighCyl : ULONG; { max cylinder. drive specific }
  955. de_NumBuffers : ULONG; { Initial # DOS of buffers. }
  956. de_BufMemType : ULONG; { type of mem to allocate for buffers }
  957. de_MaxTransfer : ULONG; { Max number of bytes to transfer at a time }
  958. de_Mask : ULONG; { Address Mask to block out certain memory }
  959. de_BootPri : Longint; { Boot priority for autoboot }
  960. de_DosType : ULONG; { ASCII (HEX) string showing filesystem type;
  961. * 0X444F5300 is old filesystem,
  962. * 0X444F5301 is fast file system }
  963. de_Baud : ULONG; { Baud rate for serial handler }
  964. de_Control : ULONG; { Control smallint for handler/filesystem }
  965. de_BootBlocks : ULONG; { Number of blocks containing boot code }
  966. end;
  967. Const
  968. { these are the offsets into the array }
  969. DE_TABLESIZE = 0; { standard value is 11 }
  970. DE_SIZEBLOCK = 1; { in longwords: standard value is 128 }
  971. DE_SECORG = 2; { not used; must be 0 }
  972. DE_NUMHEADS = 3; { # of heads (surfaces). drive specific }
  973. DE_SECSPERBLK = 4; { not used; must be 1 }
  974. DE_BLKSPERTRACK = 5; { blocks per track. drive specific }
  975. DE_RESERVEDBLKS = 6; { unavailable blocks at start. usually 2 }
  976. DE_PREFAC = 7; { not used; must be 0 }
  977. DE_INTERLEAVE = 8; { usually 0 }
  978. DE_LOWCYL = 9; { starting cylinder. typically 0 }
  979. DE_UPPERCYL = 10; { max cylinder. drive specific }
  980. DE_NUMBUFFERS = 11; { starting # of buffers. typically 5 }
  981. DE_MEMBUFTYPE = 12; { type of mem to allocate for buffers. }
  982. DE_BUFMEMTYPE = 12; { same as above, better name
  983. * 1 is public, 3 is chip, 5 is fast }
  984. DE_MAXTRANSFER = 13; { Max number bytes to transfer at a time }
  985. DE_MASK = 14; { Address Mask to block out certain memory }
  986. DE_BOOTPRI = 15; { Boot priority for autoboot }
  987. DE_DOSTYPE = 16; { ASCII (HEX) string showing filesystem type;
  988. * 0X444F5300 is old filesystem,
  989. * 0X444F5301 is fast file system }
  990. DE_BAUD = 17; { Baud rate for serial handler }
  991. DE_CONTROL = 18; { Control smallint for handler/filesystem }
  992. DE_BOOTBLOCKS = 19; { Number of blocks containing boot code }
  993. { The file system startup message is linked into a device node's startup
  994. ** field. It contains a pointer to the above environment, plus the
  995. ** information needed to do an exec OpenDevice().
  996. }
  997. Type
  998. pFileSysStartupMsg = ^tFileSysStartupMsg;
  999. tFileSysStartupMsg = record
  1000. fssm_Unit : ULONG; { exec unit number for this device }
  1001. fssm_Device : BSTR; { null terminated bstring to the device name }
  1002. fssm_Environ : BPTR; { ptr to environment table (see above) }
  1003. fssm_Flags : ULONG; { flags for OpenDevice() }
  1004. end;
  1005. { The include file "libraries/dosextens.h" has a DeviceList structure.
  1006. * The "device list" can have one of three different things linked onto
  1007. * it. Dosextens defines the structure for a volume. DLT_DIRECTORY
  1008. * is for an assigned directory. The following structure is for
  1009. * a dos "device" (DLT_DEVICE).
  1010. }
  1011. pDeviceNode = ^tDeviceNode;
  1012. tDeviceNode = record
  1013. dn_Next : BPTR; { singly linked list }
  1014. dn_Type : ULONG; { always 0 for dos "devices" }
  1015. dn_Task : pMsgPort; { standard dos "task" field. If this is
  1016. * null when the node is accesses, a task
  1017. * will be started up }
  1018. dn_Lock : BPTR; { not used for devices -- leave null }
  1019. dn_Handler : BSTR; { filename to loadseg (if seglist is null) }
  1020. dn_StackSize : ULONG; { stacksize to use when starting task }
  1021. dn_Priority : Longint; { task priority when starting task }
  1022. dn_Startup : BPTR; { startup msg: FileSysStartupMsg for disks }
  1023. dn_SegList : BPTR; { code to run to start new task (if necessary).
  1024. * if null then dn_Handler will be loaded. }
  1025. dn_GlobalVec : BPTR; { BCPL global vector to use when starting
  1026. * a task. -1 means that dn_SegList is not
  1027. * for a bcpl program, so the dos won't
  1028. * try and construct one. 0 tell the
  1029. * dos that you obey BCPL linkage rules,
  1030. * and that it should construct a global
  1031. * vector for you.
  1032. }
  1033. dn_Name : BSTR; { the node name, e.g. '\3','D','F','3' }
  1034. end;
  1035. CONST
  1036. { use of Class and code is discouraged for the time being - we might want to
  1037. change things }
  1038. { --- NotifyMessage Class ------------------------------------------------ }
  1039. NOTIFY_CLASS = $40000000;
  1040. { --- NotifyMessage Codes ------------------------------------------------ }
  1041. NOTIFY_CODE = $1234;
  1042. { Sent to the application if SEND_MESSAGE is specified. }
  1043. Type
  1044. { Do not modify or reuse the notifyrequest while active. }
  1045. { note: the first LONG of nr_Data has the length transfered }
  1046. pNotifyRequest = ^tNotifyRequest;
  1047. tNotifyRequest = record
  1048. nr_Name : pchar;
  1049. nr_FullName : pchar;
  1050. nr_UserData : ULONG;
  1051. nr_Flags : ULONG;
  1052. nr_stuff : record
  1053. case smallint of
  1054. 0 : ( nr_Msg : record
  1055. nr_Port : pMsgPort;
  1056. end );
  1057. 1 : ( nr_Signal : record
  1058. nr_Task : pTask;
  1059. nr_SignalNum : BYTE;
  1060. nr_pad : array[0..2] of BYTE;
  1061. end );
  1062. end;
  1063. nr_Reserved : array[0..3] of ULONG;
  1064. nr_MsgCount : ULONG;
  1065. nr_Handler : pMsgPort;
  1066. end;
  1067. pNotifyMessage = ^tNotifyMessage;
  1068. tNotifyMessage = record
  1069. nm_ExecMessage : tMessage;
  1070. nm_Class : ULONG;
  1071. nm_Code : Word;
  1072. nm_NReq : pNotifyRequest; { don't modify the request! }
  1073. nm_DoNotTouch, { like it says! For use by handlers }
  1074. nm_DoNotTouch2 : ULONG; { ditto }
  1075. END;
  1076. CONST
  1077. { --- NotifyRequest Flags ------------------------------------------------ }
  1078. NRF_SEND_MESSAGE = 1 ;
  1079. NRF_SEND_SIGNAL = 2 ;
  1080. NRF_WAIT_REPLY = 8 ;
  1081. NRF_NOTIFY_INITIAL = 16;
  1082. { do NOT set or remove NRF_MAGIC! Only for use by handlers! }
  1083. NRF_MAGIC = $80000000;
  1084. { bit numbers }
  1085. NRB_SEND_MESSAGE = 0;
  1086. NRB_SEND_SIGNAL = 1;
  1087. NRB_WAIT_REPLY = 3;
  1088. NRB_NOTIFY_INITIAL = 4;
  1089. NRB_MAGIC = 31;
  1090. { Flags reserved for private use by the handler: }
  1091. NR_HANDLER_FLAGS = $ffff0000;
  1092. { *********************************************************************
  1093. *
  1094. * The CSource data structure defines the input source for "ReadItem()"
  1095. * as well as the ReadArgs call. It is a publicly defined structure
  1096. * which may be used by applications which use code that follows the
  1097. * conventions defined for access.
  1098. *
  1099. * When passed to the dos.library functions, the value passed as
  1100. * struct *CSource is defined as follows:
  1101. * if ( CSource == 0) Use buffered IO "ReadChar()" as data source
  1102. * else Use CSource for input character stream
  1103. *
  1104. * The following two pseudo-code routines define how the CSource structure
  1105. * is used:
  1106. *
  1107. * long CS_ReadChar( struct CSource *CSource )
  1108. *
  1109. * if ( CSource == 0 ) return ReadChar();
  1110. * if ( CSource->CurChr >= CSource->Length ) return ENDSTREAMCHAR;
  1111. * return CSource->Buffer[ CSource->CurChr++ ];
  1112. *
  1113. *
  1114. * BOOL CS_UnReadChar( struct CSource *CSource )
  1115. *
  1116. * if ( CSource == 0 ) return UnReadChar();
  1117. * if ( CSource->CurChr <= 0 ) return FALSE;
  1118. * CSource->CurChr--;
  1119. * return TRUE;
  1120. *
  1121. *
  1122. * To initialize a struct CSource, you set CSource->CS_Buffer to
  1123. * a string which is used as the data source, and set CS_Length to
  1124. * the number of characters in the string. Normally CS_CurChr should
  1125. * be initialized to ZERO, or left as it was from prior use as
  1126. * a CSource.
  1127. *
  1128. *********************************************************************}
  1129. Type
  1130. pCSource = ^tCSource;
  1131. tCSource = record
  1132. CS_Buffer : STRPTR;
  1133. CS_Length,
  1134. CS_CurChr : Longint;
  1135. END;
  1136. { *********************************************************************
  1137. *
  1138. * The RDArgs data structure is the input parameter passed to the DOS
  1139. * ReadArgs() function call.
  1140. *
  1141. * The RDA_Source structure is a CSource as defined above;
  1142. * if RDA_Source.CS_Buffer is non-null, RDA_Source is used as the input
  1143. * character stream to parse, else the input comes from the buffered STDIN
  1144. * calls ReadChar/UnReadChar.
  1145. *
  1146. * RDA_DAList is a private address which is used internally to track
  1147. * allocations which are freed by FreeArgs(). This MUST be initialized
  1148. * to NULL prior to the first call to ReadArgs().
  1149. *
  1150. * The RDA_Buffer and RDA_BufSiz fields allow the application to supply
  1151. * a fixed-size buffer in which to store the parsed data. This allows
  1152. * the application to pre-allocate a buffer rather than requiring buffer
  1153. * space to be allocated. If either RDA_Buffer or RDA_BufSiz is NULL,
  1154. * the application has not supplied a buffer.
  1155. *
  1156. * RDA_ExtHelp is a text string which will be displayed instead of the
  1157. * template string, if the user is prompted for input.
  1158. *
  1159. * RDA_Flags bits control how ReadArgs() works. The flag bits are
  1160. * defined below. Defaults are initialized to ZERO.
  1161. *
  1162. *********************************************************************}
  1163. pRDArgs = ^tRDArgs;
  1164. tRDArgs = record
  1165. RDA_Source : tCSource; { Select input source }
  1166. RDA_DAList : Longint; { PRIVATE. }
  1167. RDA_Buffer : STRPTR; { Optional string parsing space. }
  1168. RDA_BufSiz : Longint; { Size of RDA_Buffer (0..n) }
  1169. RDA_ExtHelp : STRPTR; { Optional extended help }
  1170. RDA_Flags : Longint; { Flags for any required control }
  1171. END;
  1172. CONST
  1173. RDAB_STDIN = 0; { Use "STDIN" rather than "COMMAND LINE" }
  1174. RDAF_STDIN = 1;
  1175. RDAB_NOALLOC = 1; { If set, do not allocate extra string space.}
  1176. RDAF_NOALLOC = 2;
  1177. RDAB_NOPROMPT = 2; { Disable reprompting for string input. }
  1178. RDAF_NOPROMPT = 4;
  1179. { *********************************************************************
  1180. * Maximum number of template keywords which can be in a template passed
  1181. * to ReadArgs(). IMPLEMENTOR NOTE - must be a multiple of 4.
  1182. *********************************************************************}
  1183. MAX_TEMPLATE_ITEMS = 100;
  1184. { *********************************************************************
  1185. * Maximum number of MULTIARG items returned by ReadArgs(), before
  1186. * an ERROR_LINE_TOO_LONG. These two limitations are due to stack
  1187. * usage. Applications should allow "a lot" of stack to use ReadArgs().
  1188. *********************************************************************}
  1189. MAX_MULTIARGS = 128;
  1190. CONST
  1191. { Modes for LockRecord/LockRecords() }
  1192. REC_EXCLUSIVE = 0;
  1193. REC_EXCLUSIVE_IMMED = 1;
  1194. REC_SHARED = 2;
  1195. REC_SHARED_IMMED = 3;
  1196. { struct to be passed to LockRecords()/UnLockRecords() }
  1197. Type
  1198. pRecordLock = ^tRecordLock;
  1199. tRecordLock = record
  1200. rec_FH : BPTR; { filehandle }
  1201. rec_Offset, { offset in file }
  1202. rec_Length, { length of file to be locked }
  1203. rec_Mode : ULONG; { Type of lock }
  1204. END;
  1205. { the structure in the pr_LocalVars list }
  1206. { Do NOT allocate yourself, use SetVar()!!! This structure may grow in }
  1207. { future releases! The list should be left in alphabetical order, and }
  1208. { may have multiple entries with the same name but different types. }
  1209. Type
  1210. pLocalVar = ^tLocalVar;
  1211. tLocalVar = record
  1212. lv_Node : tNode;
  1213. lv_Flags : Word;
  1214. lv_Value : STRPTR;
  1215. lv_Len : ULONG;
  1216. END;
  1217. {
  1218. * The lv_Flags bits are available to the application. The unused
  1219. * lv_Node.ln_Pri bits are reserved for system use.
  1220. }
  1221. CONST
  1222. { bit definitions for lv_Node.ln_Type: }
  1223. LV_VAR = 0; { an variable }
  1224. LV_ALIAS = 1; { an alias }
  1225. { to be or'ed into type: }
  1226. LVB_IGNORE = 7; { ignore this entry on GetVar, etc }
  1227. LVF_IGNORE = $80;
  1228. { definitions of flags passed to GetVar()/SetVar()/DeleteVar() }
  1229. { bit defs to be OR'ed with the type: }
  1230. { item will be treated as a single line of text unless BINARY_VAR is used }
  1231. GVB_GLOBAL_ONLY = 8 ;
  1232. GVF_GLOBAL_ONLY = $100;
  1233. GVB_LOCAL_ONLY = 9 ;
  1234. GVF_LOCAL_ONLY = $200;
  1235. GVB_BINARY_VAR = 10 ; { treat variable as binary }
  1236. GVF_BINARY_VAR = $400;
  1237. GVB_DONT_NULL_TERM = 11; { only with GVF_BINARY_VAR }
  1238. GVF_DONT_NULL_TERM = $800;
  1239. { this is only supported in >= V39 dos. V37 dos ignores this. }
  1240. { this causes SetVar to affect ENVARC: as well as ENV:. }
  1241. GVB_SAVE_VAR = 12 ; { only with GVF_GLOBAL_VAR }
  1242. GVF_SAVE_VAR = $1000 ;
  1243. CONST
  1244. { ***************************************************************************}
  1245. { definitions for the System() call }
  1246. SYS_Dummy = (TAG_USER + 32);
  1247. SYS_Input = (SYS_Dummy + 1);
  1248. { specifies the input filehandle }
  1249. SYS_Output = (SYS_Dummy + 2);
  1250. { specifies the output filehandle }
  1251. SYS_Asynch = (SYS_Dummy + 3);
  1252. { run asynch, close input/output on exit(!) }
  1253. SYS_UserShell = (SYS_Dummy + 4);
  1254. { send to user shell instead of boot shell }
  1255. SYS_CustomShell= (SYS_Dummy + 5);
  1256. { send to a specific shell (data is name) }
  1257. { SYS_Error, }
  1258. { ***************************************************************************}
  1259. { definitions for the CreateNewProc() call }
  1260. { you MUST specify one of NP_Seglist or NP_Entry. All else is optional. }
  1261. NP_Dummy = (TAG_USER + 1000);
  1262. NP_Seglist = (NP_Dummy + 1);
  1263. { seglist of code to run for the process }
  1264. NP_FreeSeglist = (NP_Dummy + 2);
  1265. { free seglist on exit - only valid for }
  1266. { for NP_Seglist. Default is TRUE. }
  1267. NP_Entry = (NP_Dummy + 3);
  1268. { entry point to run - mutually exclusive }
  1269. { with NP_Seglist! }
  1270. NP_Input = (NP_Dummy + 4);
  1271. { filehandle - default is Open("NIL:"...) }
  1272. NP_Output = (NP_Dummy + 5);
  1273. { filehandle - default is Open("NIL:"...) }
  1274. NP_CloseInput = (NP_Dummy + 6);
  1275. { close input filehandle on exit }
  1276. { default TRUE }
  1277. NP_CloseOutput = (NP_Dummy + 7);
  1278. { close output filehandle on exit }
  1279. { default TRUE }
  1280. NP_Error = (NP_Dummy + 8);
  1281. { filehandle - default is Open("NIL:"...) }
  1282. NP_CloseError = (NP_Dummy + 9);
  1283. { close error filehandle on exit }
  1284. { default TRUE }
  1285. NP_CurrentDir = (NP_Dummy + 10);
  1286. { lock - default is parent's current dir }
  1287. NP_StackSize = (NP_Dummy + 11);
  1288. { stacksize for process - default 4000 }
  1289. NP_Name = (NP_Dummy + 12);
  1290. { name for process - default "New Process"}
  1291. NP_Priority = (NP_Dummy + 13);
  1292. { priority - default same as parent }
  1293. NP_ConsoleTask = (NP_Dummy + 14);
  1294. { consoletask - default same as parent }
  1295. NP_WindowPtr = (NP_Dummy + 15);
  1296. { window ptr - default is same as parent }
  1297. NP_HomeDir = (NP_Dummy + 16);
  1298. { home directory - default curr home dir }
  1299. NP_CopyVars = (NP_Dummy + 17);
  1300. { boolean to copy local vars-default TRUE }
  1301. NP_Cli = (NP_Dummy + 18);
  1302. { create cli structure - default FALSE }
  1303. NP_Path = (NP_Dummy + 19);
  1304. { path - default is copy of parents path }
  1305. { only valid if a cli process! }
  1306. NP_CommandName = (NP_Dummy + 20);
  1307. { commandname - valid only for CLI }
  1308. NP_Arguments = (NP_Dummy + 21);
  1309. { cstring of arguments - passed with str }
  1310. { in a0, length in d0. (copied and freed }
  1311. { on exit. Default is empty string. }
  1312. { NOTE: not operational until 2.04 - see }
  1313. { BIX/TechNotes for more info/workarounds }
  1314. { NOTE: in 2.0, it DIDN'T pass "" - the }
  1315. { registers were random. }
  1316. { FIX! should this be only for cli's? }
  1317. NP_NotifyOnDeath = (NP_Dummy + 22);
  1318. { notify parent on death - default FALSE }
  1319. { Not functional yet. }
  1320. NP_Synchronous = (NP_Dummy + 23);
  1321. { don't return until process finishes - }
  1322. { default FALSE. }
  1323. { Not functional yet. }
  1324. NP_ExitCode = (NP_Dummy + 24);
  1325. { code to be called on process exit }
  1326. NP_ExitData = (NP_Dummy + 25);
  1327. { optional argument for NP_EndCode rtn - }
  1328. { default NULL }
  1329. { ***************************************************************************}
  1330. { tags for AllocDosObject }
  1331. ADO_Dummy = (TAG_USER + 2000);
  1332. ADO_FH_Mode = (ADO_Dummy + 1);
  1333. { for type DOS_FILEHANDLE only }
  1334. { sets up FH for mode specified.
  1335. This can make a big difference for buffered
  1336. files. }
  1337. { The following are for DOS_CLI }
  1338. { If you do not specify these, dos will use it's preferred values }
  1339. { which may change from release to release. The BPTRs to these }
  1340. { will be set up correctly for you. Everything will be zero, }
  1341. { except cli_FailLevel (10) and cli_Background (DOSTRUE). }
  1342. { NOTE: you may also use these 4 tags with CreateNewProc. }
  1343. ADO_DirLen = (ADO_Dummy + 2);
  1344. { size in bytes for current dir buffer }
  1345. ADO_CommNameLen= (ADO_Dummy + 3);
  1346. { size in bytes for command name buffer }
  1347. ADO_CommFileLen= (ADO_Dummy + 4);
  1348. { size in bytes for command file buffer }
  1349. ADO_PromptLen = (ADO_Dummy + 5);
  1350. { size in bytes for the prompt buffer }
  1351. { ***************************************************************************}
  1352. { tags for NewLoadSeg }
  1353. { no tags are defined yet for NewLoadSeg }
  1354. PROCEDURE AbortPkt(port : pMsgPort location 'd1'; pkt : pDosPacket location 'd2'); syscall _DOSBase 264;
  1355. FUNCTION AddBuffers(const name : pCHAR location 'd1'; number : LONGINT location 'd2') : LongBool; syscall _DOSBase 732;
  1356. FUNCTION AddDosEntry(dlist : pDosList location 'd1') : LongBool; syscall _DOSBase 678;
  1357. FUNCTION AddPart(dirname : pCHAR location 'd1';const filename : pCHAR location 'd2'; size : ULONG location 'd3') : LongBool; syscall _DOSBase 882;
  1358. FUNCTION AddSegment(const name : pCHAR location 'd1'; seg : BPTR location 'd2'; system : LONGINT location 'd3') : LongBool; syscall _DOSBase 774;
  1359. FUNCTION AllocDosObject(type_ : ULONG location 'd1';const tags : pTagItem location 'd2') : POINTER; syscall _DOSBase 228;
  1360. FUNCTION AllocDosObjectTagList(type_ : ULONG location 'd1';const tags : pTagItem location 'd2') : POINTER; syscall _DOSBase 228;
  1361. FUNCTION AssignAdd(const name : pCHAR location 'd1'; lock : BPTR location 'd2') : LongBool; syscall _DOSBase 630;
  1362. FUNCTION AssignLate(const name : pCHAR location 'd1';const path : pCHAR location 'd2') : LongBool; syscall _DOSBase 618;
  1363. FUNCTION AssignLock(const name : pCHAR location 'd1'; lock : BPTR location 'd2') : LongBool; syscall _DOSBase 612;
  1364. FUNCTION AssignPath(const name : pCHAR location 'd1';const path : pCHAR location 'd2') : LongBool; syscall _DOSBase 624;
  1365. FUNCTION AttemptLockDosList(flags : ULONG location 'd1') : pDosList; syscall _DOSBase 666;
  1366. FUNCTION ChangeMode(type_ : LONGINT location 'd1'; fh : LONGINT location 'd2'; newmode : LONGINT location 'd3') : LongBool; syscall _DOSBase 450;
  1367. FUNCTION CheckSignal(mask : LONGINT location 'd1') : LONGINT; syscall _DOSBase 792;
  1368. FUNCTION Cli : pCommandLineInterface; syscall _DOSBase 492;
  1369. FUNCTION CliInitNewcli(dp : pDosPacket location 'a0') : LONGINT; syscall _DOSBase 930;
  1370. FUNCTION CliInitRun(dp : pDosPacket location 'a0') : LONGINT; syscall _DOSBase 936;
  1371. FUNCTION CompareDates(const date1 : pDateStamp location 'd1';const date2 : pDateStamp location 'd2') : LONGINT; syscall _DOSBase 738;
  1372. FUNCTION CreateDir(const name : pCHAR location 'd1') : BPTR; syscall _DOSBase 120;
  1373. FUNCTION CreateNewProc(const tags : pTagItem location 'd1') : pProcess; syscall _DOSBase 498;
  1374. FUNCTION CreateNewProcTagList(const tags : pTagItem location 'd1') : pProcess; syscall _DOSBase 498;
  1375. FUNCTION CreateProc(const name : pCHAR location 'd1'; pri : LONGINT location 'd2'; segList : BPTR location 'd3'; stackSize : LONGINT location 'd4') : pMsgPort; syscall _DOSBase 138;
  1376. FUNCTION CurrentDir(lock : BPTR location 'd1') : BPTR; syscall _DOSBase 126;
  1377. PROCEDURE DateStamp(date : pDateStamp location 'd1'); syscall _DOSBase 192;
  1378. FUNCTION DOSDateToStr(datetime : _PDateTime location 'd1') : LongBool; syscall _DOSBase 744;
  1379. FUNCTION DOSDeleteFile(const name : pCHAR location 'd1') : LongBool; syscall _DOSBase 072;
  1380. FUNCTION DeleteVar(const name : pCHAR location 'd1'; flags : ULONG location 'd2') : LongBool; syscall _DOSBase 912;
  1381. FUNCTION DeviceProc(const name : pCHAR location 'd1') : pMsgPort; syscall _DOSBase 174;
  1382. FUNCTION DoPkt(port : pMsgPort location 'd1'; action : LONGINT location 'd2'; arg1 : LONGINT location 'd3'; arg2 : LONGINT location 'd4'; arg3 : LONGINT location 'd5'; arg4 : LONGINT location 'd6'; arg5 : LONGINT location 'd7') : LONGINT; syscall _DOSBase 240;
  1383. FUNCTION DoPkt0(port : pMsgPort location 'd1'; action : LONGINT location 'd2') : LONGINT; syscall _DOSBase 240;
  1384. FUNCTION DoPkt1(port : pMsgPort location 'd1'; action : LONGINT location 'd2'; arg1 : LONGINT location 'd3') : LONGINT; syscall _DOSBase 240;
  1385. FUNCTION DoPkt2(port : pMsgPort location 'd1'; action : LONGINT location 'd2'; arg1 : LONGINT location 'd3'; arg2 : LONGINT location 'd4') : LONGINT; syscall _DOSBase 240;
  1386. FUNCTION DoPkt3(port : pMsgPort location 'd1'; action : LONGINT location 'd2'; arg1 : LONGINT location 'd3'; arg2 : LONGINT location 'd4'; arg3 : LONGINT location 'd5') : LONGINT; syscall _DOSBase 240;
  1387. FUNCTION DoPkt4(port : pMsgPort location 'd1'; action : LONGINT location 'd2'; arg1 : LONGINT location 'd3'; arg2 : LONGINT location 'd4'; arg3 : LONGINT location 'd5'; arg4 : LONGINT location 'd6') : LONGINT; syscall _DOSBase 240;
  1388. PROCEDURE DOSClose(file_ : BPTR location 'd1'); syscall _DOSBase 036;
  1389. PROCEDURE DOSDelay(timeout : LONGINT location 'd1'); syscall _DOSBase 198;
  1390. PROCEDURE DOSExit(returnCode : LONGINT location 'd1'); syscall _DOSBase 144;
  1391. FUNCTION DOSFlush(fh : BPTR location 'd1') : LongBool; syscall _DOSBase 360;
  1392. FUNCTION DOSInput : BPTR; syscall _DOSBase 054;
  1393. FUNCTION DOSOpen(const name : pCHAR location 'd1'; accessMode : LONGINT location 'd2') : BPTR; syscall _DOSBase 030;
  1394. FUNCTION DOSOutput : BPTR; syscall _DOSBase 060;
  1395. FUNCTION DOSRead(file_ : BPTR location 'd1'; buffer : POINTER location 'd2'; length : LONGINT location 'd3') : LONGINT; syscall _DOSBase 042;
  1396. FUNCTION DOSRename(const oldName : pCHAR location 'd1';const newName : pCHAR location 'd2') : LongBool; syscall _DOSBase 078;
  1397. FUNCTION DOSSeek(file_ : BPTR location 'd1'; position : LONGINT location 'd2'; offset : LONGINT location 'd3') : LONGINT; syscall _DOSBase 066;
  1398. FUNCTION DOSWrite(file_ : BPTR location 'd1'; buffer : POINTER location 'd2'; length : LONGINT location 'd3') : LONGINT; syscall _DOSBase 048;
  1399. FUNCTION DupLock(lock : BPTR location 'd1') : BPTR; syscall _DOSBase 096;
  1400. FUNCTION DupLockFromFH(fh : BPTR location 'd1') : BPTR; syscall _DOSBase 372;
  1401. PROCEDURE EndNotify(notify : pNotifyRequest location 'd1'); syscall _DOSBase 894;
  1402. FUNCTION ErrorReport(code : LONGINT location 'd1'; type_ : LONGINT location 'd2'; arg1 : ULONG location 'd3'; device : pMsgPort location 'd4') : LongBool; syscall _DOSBase 480;
  1403. FUNCTION ExAll(lock : BPTR location 'd1'; buffer : pExAllData location 'd2'; size : LONGINT location 'd3'; data : LONGINT location 'd4'; control : pExAllControl location 'd5') : LongBool; syscall _DOSBase 432;
  1404. PROCEDURE ExAllEnd(lock : BPTR location 'd1'; buffer : pExAllData location 'd2'; size : LONGINT location 'd3'; data : LONGINT location 'd4'; control : pExAllControl location 'd5'); syscall _DOSBase 990;
  1405. FUNCTION Examine(lock : BPTR location 'd1'; fileInfoBlock : pFileInfoBlock location 'd2') : LongBool; syscall _DOSBase 102;
  1406. FUNCTION ExamineFH(fh : BPTR location 'd1'; fib : pFileInfoBlock location 'd2') : LongBool; syscall _DOSBase 390;
  1407. FUNCTION Execute(const string_ : pCHAR location 'd1'; file_ : LONGINT location 'd2'; file2 : LONGINT location 'd3') : LongBool; syscall _DOSBase 222;
  1408. FUNCTION ExNext(lock : BPTR location 'd1'; fileInfoBlock : pFileInfoBlock location 'd2') : LongBool; syscall _DOSBase 108;
  1409. FUNCTION Fault(code : LONGINT location 'd1'; header : pCHAR location 'd2'; buffer : pCHAR location 'd3'; len : LONGINT location 'd4') : LongBool; syscall _DOSBase 468;
  1410. FUNCTION FGetC(fh : BPTR location 'd1') : LONGINT; syscall _DOSBase 306;
  1411. FUNCTION FGets(fh : BPTR location 'd1'; buf : pCHAR location 'd2'; buflen : ULONG location 'd3') : pCHAR; syscall _DOSBase 336;
  1412. FUNCTION FilePart(const path : pCHAR location 'd1') : pCHAR; syscall _DOSBase 870;
  1413. FUNCTION FindArg(const keyword : pCHAR location 'd1';const arg_template : pCHAR location 'd2') : LONGINT; syscall _DOSBase 804;
  1414. FUNCTION FindCliProc(num : ULONG location 'd1') : pProcess; syscall _DOSBase 546;
  1415. FUNCTION FindDosEntry(const dlist : pDosList location 'd1';const name : pCHAR location 'd2'; flags : ULONG location 'd3') : pDosList; syscall _DOSBase 684;
  1416. FUNCTION FindSegment(const name : pCHAR location 'd1';const seg : pSegment location 'd2'; system : LONGINT location 'd3') : pSegment; syscall _DOSBase 780;
  1417. FUNCTION FindVar(const name : pCHAR location 'd1'; type_ : ULONG location 'd2') : pLocalVar; syscall _DOSBase 918;
  1418. FUNCTION Format(const filesystem : pCHAR location 'd1';const volumename : pCHAR location 'd2'; dostype : ULONG location 'd3') : LongBool; syscall _DOSBase 714;
  1419. FUNCTION FPutC(fh : BPTR location 'd1'; ch : LONGINT location 'd2') : LONGINT; syscall _DOSBase 312;
  1420. FUNCTION FPuts(fh : BPTR location 'd1';const str : pCHAR location 'd2') : LongInt; syscall _DOSBase 342;
  1421. FUNCTION FRead(fh : BPTR location 'd1'; block : POINTER location 'd2'; blocklen : ULONG location 'd3'; number : ULONG location 'd4') : LONGINT; syscall _DOSBase 324;
  1422. PROCEDURE FreeArgs(args : pRDArgs location 'd1'); syscall _DOSBase 858;
  1423. PROCEDURE FreeDeviceProc(dp : pDevProc location 'd1'); syscall _DOSBase 648;
  1424. PROCEDURE FreeDosEntry(dlist : pDosList); syscall _DOSBase 702;
  1425. PROCEDURE FreeDosObject(type_ : ULONG location 'd1'; ptr : POINTER location 'd2'); syscall _DOSBase 234;
  1426. FUNCTION FWrite(fh : BPTR location 'd1'; block : POINTER location 'd2'; blocklen : ULONG location 'd3'; number : ULONG location 'd4') : LONGINT; syscall _DOSBase 330;
  1427. FUNCTION GetArgStr : pCHAR; syscall _DOSBase 534;
  1428. FUNCTION GetConsoleTask : pMsgPort; syscall _DOSBase 510;
  1429. FUNCTION GetCurrentDirName(buf : pCHAR location 'd1'; len : LONGINT location 'd2') : LongBool; syscall _DOSBase 564;
  1430. FUNCTION GetDeviceProc(const name : pCHAR location 'd1'; dp : pDevProc location 'd2') : pDevProc; syscall _DOSBase 642;
  1431. FUNCTION GetFileSysTask : pMsgPort; syscall _DOSBase 522;
  1432. FUNCTION GetProgramDir : BPTR; syscall _DOSBase 600;
  1433. FUNCTION GetProgramName(buf : pCHAR location 'd1'; len : LONGINT location 'd2') : LongBool; syscall _DOSBase 576;
  1434. FUNCTION GetPrompt(buf : pCHAR location 'd1'; len : LONGINT location 'd2') : LongBool; syscall _DOSBase 588;
  1435. FUNCTION GetVar(const name : pCHAR location 'd1'; buffer : pCHAR location 'd2'; size : LONGINT location 'd3'; flags : LONGINT location 'd4') : LONGINT; syscall _DOSBase 906;
  1436. FUNCTION Info(lock : BPTR location 'd1'; parameterBlock : pInfoData location 'd2') : LongBool; syscall _DOSBase 114;
  1437. FUNCTION Inhibit(const name : pCHAR location 'd1'; onoff : LONGINT location 'd2') : LongBool; syscall _DOSBase 726;
  1438. FUNCTION InternalLoadSeg(fh : BPTR location 'd0'; table : LONGINT location 'a0';const funcarray : pLONGINT location 'a1'; VAR stack : LONGINT location 'a2') : LONGINT; syscall _DOSBase 756;
  1439. FUNCTION InternalUnLoadSeg(seglist : BPTR location 'd1'; freefunc : tPROCEDURE location 'a1') : LongBool; syscall _DOSBase 762;
  1440. FUNCTION IoErr : LONGINT; syscall _DOSBase 132;
  1441. FUNCTION IsFileSystem(const name : pCHAR location 'd1') : LongBool; syscall _DOSBase 708;
  1442. FUNCTION IsInteractive(file_ : BPTR location 'd1') : LongBool; syscall _DOSBase 216;
  1443. FUNCTION LoadSeg(const name : pCHAR location 'd1') : LONGINT; syscall _DOSBase 150;
  1444. FUNCTION Lock(const name : pCHAR location 'd1'; type_ : LONGINT location 'd2') : LONGINT; syscall _DOSBase 084;
  1445. FUNCTION LockDosList(flags : ULONG location 'd1') : pDosList; syscall _DOSBase 654;
  1446. FUNCTION LockRecord(fh : BPTR location 'd1'; offset : ULONG location 'd2'; length : ULONG location 'd3'; mode : ULONG location 'd4'; timeout : ULONG location 'd5') : LongBool; syscall _DOSBase 270;
  1447. FUNCTION LockRecords(recArray : pRecordLock location 'd1'; timeout : ULONG location 'd2') : LongBool; syscall _DOSBase 276;
  1448. FUNCTION MakeDosEntry(const name : pCHAR location 'd1'; type_ : LONGINT location 'd2') : pDosList; syscall _DOSBase 696;
  1449. FUNCTION MakeLink(const name : pCHAR location 'd1'; dest : LONGINT location 'd2'; soft : LONGINT location 'd3') : LongBool; syscall _DOSBase 444;
  1450. PROCEDURE MatchEnd(anchor : pAnchorPath location 'd1'); syscall _DOSBase 834;
  1451. FUNCTION MatchFirst(const pat : pCHAR location 'd1'; anchor : pAnchorPath location 'd2') : LONGINT; syscall _DOSBase 822;
  1452. FUNCTION MatchNext(anchor : pAnchorPath location 'd1') : LONGINT; syscall _DOSBase 828;
  1453. FUNCTION MatchPattern(const pat : pCHAR location 'd1'; str : pCHAR location 'd2') : LongBool; syscall _DOSBase 846;
  1454. FUNCTION MatchPatternNoCase(const pat : pCHAR location 'd1'; str : pCHAR location 'd2') : LongBool; syscall _DOSBase 972;
  1455. FUNCTION MaxCli : ULONG; syscall _DOSBase 552;
  1456. FUNCTION NameFromFH(fh : BPTR location 'd1'; buffer : pCHAR location 'd2'; len : LONGINT location 'd3') : LongBool; syscall _DOSBase 408;
  1457. FUNCTION NameFromLock(lock : BPTR location 'd1'; buffer : pCHAR location 'd2'; len : LONGINT location 'd3') : LongBool; syscall _DOSBase 402;
  1458. FUNCTION NewLoadSeg(const file_ : pCHAR location 'd1';const tags : pTagItem location 'd2') : BPTR; syscall _DOSBase 768;
  1459. FUNCTION NewLoadSegTagList(const file_ : pCHAR location 'd1';const tags : pTagItem location 'd2') : BPTR; syscall _DOSBase 768;
  1460. FUNCTION NextDosEntry(const dlist : pDosList location 'd1'; flags : ULONG location 'd2') : pDosList; syscall _DOSBase 690;
  1461. FUNCTION OpenFromLock(lock : BPTR location 'd1') : BPTR; syscall _DOSBase 378;
  1462. FUNCTION ParentDir(lock : BPTR location 'd1') : BPTR; syscall _DOSBase 210;
  1463. FUNCTION ParentOfFH(fh : BPTR location 'd1') : BPTR; syscall _DOSBase 384;
  1464. FUNCTION ParsePattern(const pat : pCHAR location 'd1'; buf : pCHAR location 'd2'; buflen : LONGINT location 'd3') : LONGINT; syscall _DOSBase 840;
  1465. FUNCTION ParsePatternNoCase(const pat : pCHAR location 'd1'; buf : pCHAR location 'd2'; buflen : LONGINT location 'd3') : LONGINT; syscall _DOSBase 966;
  1466. FUNCTION PathPart(const path : pCHAR location 'd1') : pCHAR; syscall _DOSBase 876;
  1467. FUNCTION PrintFault(code : LONGINT location 'd1';const header : pCHAR location 'd2') : LongBool; syscall _DOSBase 474;
  1468. FUNCTION PutStr(const str : pCHAR location 'd1') : LongBool; syscall _DOSBase 948;
  1469. FUNCTION ReadArgs(const arg_template : pCHAR location 'd1'; arra : pLONGINT location 'd2'; args : pRDArgs location 'd3') : pRDArgs; syscall _DOSBase 798;
  1470. FUNCTION ReadItem(const name : pCHAR location 'd1'; maxchars : LONGINT location 'd2'; cSource : pCSource location 'd3') : LONGINT; syscall _DOSBase 810;
  1471. FUNCTION ReadLink(port : pMsgPort location 'd1'; lock : LONGINT location 'd2';const path : pCHAR location 'd3'; buffer : pCHAR location 'd4'; size : ULONG location 'd5') : LongBool; syscall _DOSBase 438;
  1472. FUNCTION Relabel(const drive : pCHAR location 'd1';const newname : pCHAR location 'd2') : LongBool; syscall _DOSBase 720;
  1473. FUNCTION RemAssignList(const name : pCHAR location 'd1'; lock : LONGINT location 'd2') : LongBool; syscall _DOSBase 636;
  1474. FUNCTION RemDosEntry(dlist : pDosList location 'd1') : LongBool; syscall _DOSBase 672;
  1475. FUNCTION RemSegment(seg : pSegment location 'd1') : LongBool; syscall _DOSBase 786;
  1476. PROCEDURE ReplyPkt(dp : pDosPacket location 'd1'; res1 : LONGINT location 'd2'; res2 : LONGINT location 'd3'); syscall _DOSBase 258;
  1477. FUNCTION RunCommand(seg : BPTR location 'd1'; stack : LONGINT location 'd2';const paramptr : pCHAR location 'd3'; paramlen : LONGINT location 'd4') : LONGINT; syscall _DOSBase 504;
  1478. FUNCTION SameDevice(lock1 : BPTR location 'd1'; lock2 : BPTR location 'd2') : LongBool; syscall _DOSBase 984;
  1479. FUNCTION SameLock(lock1 : BPTR location 'd1'; lock2 : BPTR location 'd2') : LONGINT; syscall _DOSBase 420;
  1480. FUNCTION SelectInput(fh : BPTR location 'd1') : BPTR; syscall _DOSBase 294;
  1481. FUNCTION SelectOutput(fh : BPTR location 'd1') : BPTR; syscall _DOSBase 300;
  1482. PROCEDURE SendPkt(dp : pDosPacket location 'd1'; port : pMsgPort location 'd2'; replyport : pMsgPort location 'd3'); syscall _DOSBase 246;
  1483. FUNCTION SetArgStr(const string_ : pCHAR location 'd1') : PChar; syscall _DOSBase 540;
  1484. FUNCTION SetComment(const name : pCHAR location 'd1';const comment : pCHAR location 'd2') : LongBool; syscall _DOSBase 180;
  1485. FUNCTION SetConsoleTask(const task : pMsgPort location 'd1') : pMsgPort; syscall _DOSBase 516;
  1486. FUNCTION SetCurrentDirName(const name : pCHAR location 'd1') : LongBool; syscall _DOSBase 558;
  1487. FUNCTION SetFileDate(const name : pCHAR location 'd1'; date : pDateStamp location 'd2') : LongBool; syscall _DOSBase 396;
  1488. FUNCTION SetFileSize(fh : BPTR location 'd1'; pos : LONGINT location 'd2'; mode : LONGINT location 'd3') : LongInt; syscall _DOSBase 456;
  1489. FUNCTION SetFileSysTask(const task : pMsgPort location 'd1') : pMsgPort; syscall _DOSBase 528;
  1490. FUNCTION SetIoErr(result : LONGINT location 'd1') : LONGINT; syscall _DOSBase 462;
  1491. FUNCTION SetMode(fh : BPTR location 'd1'; mode : LONGINT location 'd2') : LongBool; syscall _DOSBase 426;
  1492. FUNCTION SetOwner(const name : pCHAR location 'd1'; owner_info : LONGINT location 'd2') : LongBool; syscall _DOSBase 996;
  1493. FUNCTION SetProgramDir(lock : BPTR location 'd1') : LONGINT; syscall _DOSBase 594;
  1494. FUNCTION SetProgramName(const name : pCHAR location 'd1') : LongBool; syscall _DOSBase 570;
  1495. FUNCTION SetPrompt(const name : pCHAR location 'd1') : LongBool; syscall _DOSBase 582;
  1496. FUNCTION SetProtection(const name : pCHAR location 'd1'; protect : LONGINT location 'd2') : LongBool; syscall _DOSBase 186;
  1497. FUNCTION SetVar(const name : pCHAR location 'd1'; buffer : pCHAR location 'd2'; size : LONGINT location 'd3'; flags : LONGINT location 'd4') : LongBool; syscall _DOSBase 900;
  1498. FUNCTION SetVBuf(fh : BPTR location 'd1'; buff : pCHAR location 'd2'; type_ : LONGINT location 'd3'; size : LONGINT location 'd4') : LongBool; syscall _DOSBase 366;
  1499. FUNCTION SplitName(const name : pCHAR location 'd1'; seperator : ULONG location 'd2'; buf : pCHAR location 'd3'; oldpos : LONGINT location 'd4'; size : LONGINT location 'd5') : smallint; syscall _DOSBase 414;
  1500. FUNCTION StartNotify(notify : pNotifyRequest location 'd1') : LongBool; syscall _DOSBase 888;
  1501. FUNCTION DOSStrToDate(datetime : _PDateTime location 'd1') : LongBool; syscall _DOSBase 750;
  1502. FUNCTION StrToLong(const string_ : pCHAR location 'd1'; VAR value : LONGINT location 'd2') : LONGINT; syscall _DOSBase 816;
  1503. FUNCTION SystemTagList(const command : pCHAR location 'd1';const tags : pTagItem location 'd2') : LONGINT; syscall _DOSBase 606;
  1504. FUNCTION DOSSystem(const command : pCHAR location 'd1';const tags : pTagItem location 'd2') : LONGINT; syscall _DOSBase 606;
  1505. FUNCTION UnGetC(fh : LONGINT location 'd1'; character : LONGINT location 'd2') : LONGINT; syscall _DOSBase 318;
  1506. PROCEDURE UnLoadSeg(seglist : BPTR location 'd1'); syscall _DOSBase 156;
  1507. PROCEDURE UnLock(lock : BPTR location 'd1'); syscall _DOSBase 090;
  1508. PROCEDURE UnLockDosList(flags : ULONG location 'd1'); syscall _DOSBase 660;
  1509. FUNCTION UnLockRecord(fh : BPTR location 'd1'; offset : ULONG location 'd2'; length : ULONG location 'd3') : LongBool; syscall _DOSBase 282;
  1510. FUNCTION UnLockRecords(recArray : pRecordLock location 'd1') : LongBool; syscall _DOSBase 288;
  1511. FUNCTION VFPrintf(fh : BPTR location 'd1';const format : pCHAR location 'd2';const argarray : PLongInt location 'd3') : LONGINT; syscall _DOSBase 354;
  1512. PROCEDURE VFWritef(fh : BPTR location 'd1';const format : pCHAR location 'd2';const argarray : pLONGINT location 'd3'); syscall _DOSBase 348;
  1513. FUNCTION VPrintf(const format : pCHAR location 'd1'; const argarray : PLongInt location 'd2') : LONGINT; syscall _DOSBase 954;
  1514. FUNCTION WaitForChar(file_ : BPTR location 'd1'; timeout : LONGINT location 'd2') : LongBool; syscall _DOSBase 204;
  1515. FUNCTION WaitPkt : pDosPacket; syscall _DOSBase 252;
  1516. FUNCTION WriteChars(const buf : pCHAR location 'd1'; buflen : ULONG location 'd2') : LONGINT; syscall _DOSBase 942;
  1517. FUNCTION BADDR(bval :BPTR): POINTER;
  1518. FUNCTION MKBADDR(adr: Pointer): BPTR;
  1519. // var args version
  1520. FUNCTION AllocDosObjectTags(type_ : ULONG; Const argv : Array of PtrUInt) : POINTER;
  1521. FUNCTION CreateNewProcTags(Const argv : Array of PtrUInt) : pProcess;
  1522. FUNCTION NewLoadSegTags(file_ : pCHAR; Const argv : Array of PtrUInt) : LONGINT;
  1523. FUNCTION SystemTags(command : pCHAR; Const argv : Array of PtrUInt) : LONGINT;
  1524. { overlay function and procedures}
  1525. FUNCTION AddBuffers(const name : string; number : LONGINT) : BOOLEAN;
  1526. FUNCTION AddPart(dirname : pCHAR;const filename : string; size : ULONG) : BOOLEAN;
  1527. FUNCTION AssignAdd(const name : string; lock : LONGINT) : BOOLEAN;
  1528. FUNCTION AssignLate(const name : string;const path : pCHAR) : BOOLEAN;
  1529. FUNCTION AssignLate(const name : pChar;const path : string) : BOOLEAN;
  1530. FUNCTION AssignLate(const name : string;const path : string) : BOOLEAN;
  1531. FUNCTION AssignLock(const name : string; lock : LONGINT) : BOOLEAN;
  1532. FUNCTION AssignPath(const name : string; const path : pCHAR) : BOOLEAN;
  1533. FUNCTION AssignPath(const name : pCHAR;const path : string) : BOOLEAN;
  1534. FUNCTION AssignPath(const name : string;const path : string) : BOOLEAN;
  1535. FUNCTION CreateDir(const name : string) : LONGINT;
  1536. FUNCTION DOSDeleteFile(const name : string) : BOOLEAN;
  1537. FUNCTION DeleteVar(const name : string; flags : ULONG) : BOOLEAN;
  1538. FUNCTION DeviceProc(const name : string) : pMsgPort;
  1539. FUNCTION DOSOpen(const name : string; accessMode : LONGINT) : LONGINT;
  1540. FUNCTION DOSRename(const oldName : string;const newName : pChar) : boolean;
  1541. FUNCTION DOSRename(const oldName : pCHAR;const newName : string) : Boolean;
  1542. FUNCTION DOSRename(const oldName : string;const newName : string) : Boolean;
  1543. FUNCTION Execute(const string_ : string; file_ : LONGINT; file2 : LONGINT) : BOOLEAN;
  1544. FUNCTION Fault(code : LONGINT; header : string; buffer : pCHAR; len : LONGINT) : BOOLEAN;
  1545. FUNCTION FilePart(const path : string) : pCHAR;
  1546. FUNCTION FindArg(const keyword : string;const arg_template : pCHAR) : LONGINT;
  1547. FUNCTION FindArg(const keyword : pCHAR;const arg_template : string) : LONGINT;
  1548. FUNCTION FindArg(const keyword : string;const arg_template : string) : LONGINT;
  1549. FUNCTION FindDosEntry(const dlist : pDosList;const name : string; flags : ULONG) : pDosList;
  1550. FUNCTION FindSegment(const name : string;const seg : pSegment; system : LONGINT) : pSegment;
  1551. FUNCTION FindVar(const name : string; type_ : ULONG) : pLocalVar;
  1552. FUNCTION Format(const filesystem : string;const volumename : pCHAR; dostype : ULONG) : BOOLEAN;
  1553. FUNCTION Format(const filesystem : pCHAR;const volumename : string; dostype : ULONG) : BOOLEAN;
  1554. FUNCTION Format(const filesystem : string;const volumename : string; dostype : ULONG) : BOOLEAN;
  1555. FUNCTION FPuts(fh : LONGINT;const str : string) : LongInt;
  1556. FUNCTION GetDeviceProc(const name : string; dp : pDevProc) : pDevProc;
  1557. FUNCTION GetVar(const name : string; buffer : pCHAR; size : LONGINT; flags : LONGINT) : LONGINT;
  1558. FUNCTION Inhibit(const name : string; onoff : LONGINT) : BOOLEAN;
  1559. FUNCTION IsFileSystem(const name : string) : BOOLEAN;
  1560. FUNCTION LoadSeg(const name : string) : LONGINT;
  1561. FUNCTION Lock(const name : string; type_ : LONGINT) : LONGINT;
  1562. FUNCTION MakeDosEntry(const name : string; type_ : LONGINT) : pDosList;
  1563. FUNCTION MakeLink(const name : string; dest : LONGINT; soft : LONGINT) : BOOLEAN;
  1564. FUNCTION MatchFirst(const pat : string; anchor : pAnchorPath) : LONGINT;
  1565. FUNCTION MatchPattern(const pat : pCHAR; str : string) : BOOLEAN;
  1566. FUNCTION MatchPatternNoCase(const pat : pCHAR; str : string) : BOOLEAN;
  1567. FUNCTION NewLoadSeg(const file_ : string;const tags : pTagItem) : LONGINT;
  1568. FUNCTION NewLoadSegTagList(const file_ : string;const tags : pTagItem) : LONGINT;
  1569. FUNCTION PathPart(const path : string) : pCHAR;
  1570. FUNCTION PrintFault(code : LONGINT;const header : string) : BOOLEAN;
  1571. FUNCTION PutStr(const str : string) : BOOLEAN;
  1572. FUNCTION ReadArgs(const arg_template : string; arra : pLONGINT; args : pRDArgs) : pRDArgs;
  1573. FUNCTION ReadLink(port : pMsgPort; lock : LONGINT;const path : string; buffer : pCHAR; size : ULONG) : BOOLEAN;
  1574. FUNCTION Relabel(const drive : string;const newname : pCHAR) : BOOLEAN;
  1575. FUNCTION Relabel(const drive : pCHAR;const newname : string) : BOOLEAN;
  1576. FUNCTION Relabel(const drive : string;const newname : string) : BOOLEAN;
  1577. FUNCTION RemAssignList(const name : string; lock : LONGINT) : BOOLEAN;
  1578. FUNCTION RunCommand(seg : LONGINT; stack : LONGINT;const paramptr : string; paramlen : LONGINT) : LONGINT;
  1579. FUNCTION SetComment(const name : string;const comment : pCHAR) : BOOLEAN;
  1580. FUNCTION SetComment(const name : pCHAR;const comment : string) : BOOLEAN;
  1581. FUNCTION SetComment(const name : string;const comment : string) : BOOLEAN;
  1582. FUNCTION SetCurrentDirName(const name : string) : BOOLEAN;
  1583. FUNCTION SetFileDate(const name : string; date : pDateStamp) : BOOLEAN;
  1584. FUNCTION SetOwner(const name : string; owner_info : LONGINT) : BOOLEAN;
  1585. FUNCTION SetProgramName(const name : string) : BOOLEAN;
  1586. FUNCTION SetPrompt(const name : string) : BOOLEAN;
  1587. FUNCTION SetProtection(const name : string; protect : LONGINT) : BOOLEAN;
  1588. FUNCTION SetVar(const name : string; buffer : pCHAR; size : LONGINT; flags : LONGINT) : BOOLEAN;
  1589. FUNCTION SplitName(const name : string; seperator : ULONG; buf : pCHAR; oldpos : LONGINT; size : LONGINT) : smallint;
  1590. FUNCTION StrToLong(const string_ : string; VAR value : LONGINT) : LONGINT;
  1591. FUNCTION SystemTagList(const command : string;const tags : pTagItem) : LONGINT;
  1592. FUNCTION DOSSystem(const command : string;const tags : pTagItem) : LONGINT;
  1593. IMPLEMENTATION
  1594. FUNCTION BADDR(bval : BPTR): POINTER; inline;
  1595. BEGIN
  1596. BADDR := POINTER( bval shl 2);
  1597. END;
  1598. FUNCTION MKBADDR(adr : POINTER): BPTR; inline;
  1599. BEGIN
  1600. MKBADDR := BPTR( PTRUINT(adr) shr 2);
  1601. END;
  1602. FUNCTION AllocDosObjectTags(type_ : ULONG; Const argv : Array of PtrUInt) : POINTER;
  1603. begin
  1604. AllocDosObjectTags := AllocDosObjectTagList(type_, @argv);
  1605. end;
  1606. FUNCTION CreateNewProcTags(Const argv : Array of PtrUInt) : pProcess;
  1607. begin
  1608. CreateNewProcTags := CreateNewProcTagList(@argv);
  1609. end;
  1610. FUNCTION NewLoadSegTags(file_ : pCHAR; Const argv : Array of PtrUInt) : LONGINT;
  1611. begin
  1612. NewLoadSegTags := NewLoadSegTagList(file_, @argv);
  1613. end;
  1614. FUNCTION SystemTags(command : pCHAR; Const argv : Array of PtrUInt) : LONGINT;
  1615. begin
  1616. SystemTags := SystemTagList(command, @argv);
  1617. end;
  1618. FUNCTION AddBuffers(const name : string; number : LONGINT) : BOOLEAN;
  1619. begin
  1620. AddBuffers := AddBuffers(PChar(RawByteString(name)), number);
  1621. end;
  1622. FUNCTION AddPart(dirname : pCHAR; const filename : string; size : ULONG) : BOOLEAN;
  1623. begin
  1624. AddPart := AddPart(dirname,PChar(RawByteString(filename)),size);
  1625. end;
  1626. FUNCTION AssignAdd(const name : string; lock : LONGINT) : BOOLEAN;
  1627. begin
  1628. AssignAdd := AssignAdd(PChar(RawByteString(name)),lock);
  1629. end;
  1630. FUNCTION AssignLate(const name : string;const path : pCHAR) : BOOLEAN;
  1631. begin
  1632. AssignLate := AssignLate(PChar(RawByteString(name)),path);
  1633. end;
  1634. FUNCTION AssignLate(const name : pChar;const path : string) : BOOLEAN;
  1635. begin
  1636. AssignLate := AssignLate(name,PChar(RawByteString(path)));
  1637. end;
  1638. FUNCTION AssignLate(const name : string;const path : string) : BOOLEAN;
  1639. begin
  1640. AssignLate := AssignLate(PChar(RawByteString(name)),PChar(RawByteString(path)));
  1641. end;
  1642. FUNCTION AssignLock(const name : string; lock : LONGINT) : BOOLEAN;
  1643. begin
  1644. AssignLock := AssignLock(PChar(RawByteString(name)),lock);
  1645. end;
  1646. FUNCTION AssignPath(const name : string;const path : pCHAR) : BOOLEAN;
  1647. begin
  1648. AssignPath := AssignPath(PChar(RawByteString(name)),path);
  1649. end;
  1650. FUNCTION AssignPath(const name : pCHAR;const path : string) : BOOLEAN;
  1651. begin
  1652. AssignPath := AssignPath(name,PChar(RawByteString(path)));
  1653. end;
  1654. FUNCTION AssignPath(const name : string;const path : string) : BOOLEAN;
  1655. begin
  1656. AssignPath := AssignPath(PChar(RawByteString(name)),PChar(RawByteString(path)));
  1657. end;
  1658. FUNCTION CreateDir(const name : string) : LONGINT;
  1659. begin
  1660. CreateDir := CreateDir(PChar(RawByteString(name)));
  1661. end;
  1662. FUNCTION DOSDeleteFile(const name : string) : BOOLEAN;
  1663. begin
  1664. DOSDeleteFile := DOSDeleteFile(PChar(RawByteString(name)));
  1665. end;
  1666. FUNCTION DeleteVar(const name : string; flags : ULONG) : BOOLEAN;
  1667. begin
  1668. DeleteVar := DeleteVar(PChar(RawByteString(name)),flags);
  1669. end;
  1670. FUNCTION DeviceProc(const name : string) : pMsgPort;
  1671. begin
  1672. Deviceproc := DeviceProc(PChar(RawByteString(name)));
  1673. end;
  1674. FUNCTION DOSOpen(const name : string; accessMode : LONGINT) : LONGINT;
  1675. begin
  1676. DOSOpen := DOSOpen(PChar(RawByteString(name)),accessMode);
  1677. end;
  1678. FUNCTION DOSRename(const oldName : string;const newName : pCHAR) : Boolean;
  1679. begin
  1680. DOSRename := DOSRename(PChar(RawByteString(oldName)),newName);
  1681. end;
  1682. FUNCTION DOSRename(const oldName : pCHAR;const newName : string) : Boolean;
  1683. begin
  1684. DOSRename := DOSRename(oldName,PChar(RawByteString(newName)));
  1685. end;
  1686. FUNCTION DOSRename(const oldName : string;const newName : string) : Boolean;
  1687. begin
  1688. DOSRename := DOSRename(PChar(RawByteString(oldName)),PChar(RawByteString(newName)));
  1689. end;
  1690. FUNCTION Execute(const string_ : string; file_ : LONGINT; file2 : LONGINT) : BOOLEAN;
  1691. begin
  1692. Execute := Execute(PChar(RawByteString(string_)),file_ ,file2);
  1693. end;
  1694. FUNCTION Fault(code : LONGINT; header : string; buffer : pCHAR; len : LONGINT) : BOOLEAN;
  1695. begin
  1696. Fault := Fault(code,PChar(RawByteString(header)),buffer,len);
  1697. end;
  1698. FUNCTION FilePart(const path : string) : pCHAR;
  1699. begin
  1700. FilePart := FilePart(PChar(RawByteString(path)));
  1701. end;
  1702. FUNCTION FindArg(const keyword : string;const arg_template : pCHAR) : LONGINT;
  1703. begin
  1704. FindArg := FindArg(PChar(RawByteString(keyword)),arg_template);
  1705. end;
  1706. FUNCTION FindArg(const keyword : pCHAR;const arg_template : string) : LONGINT;
  1707. begin
  1708. FindArg := FindArg(keyword,PChar(RawByteString(arg_template)));
  1709. end;
  1710. FUNCTION FindArg(const keyword : string;const arg_template : string) : LONGINT;
  1711. begin
  1712. FindArg := FindArg(PChar(RawByteString(keyword)),PChar(RawByteString(arg_template)));
  1713. end;
  1714. FUNCTION FindDosEntry(const dlist : pDosList;const name : string; flags : ULONG) : pDosList;
  1715. begin
  1716. FindDosEntry := FindDosEntry(dlist,PChar(RawByteString(name)),flags);
  1717. end;
  1718. FUNCTION FindSegment(const name : string;const seg : pSegment; system : LONGINT) : pSegment;
  1719. begin
  1720. FindSegment := FindSegment(PChar(RawByteString(name)),seg,system);
  1721. end;
  1722. FUNCTION FindVar(const name : string; type_ : ULONG) : pLocalVar;
  1723. begin
  1724. FindVar := FindVar(PChar(RawByteString(name)),type_);
  1725. end;
  1726. FUNCTION Format(const filesystem : string;const volumename : pCHAR; dostype : ULONG) : BOOLEAN;
  1727. begin
  1728. Format := Format(PChar(RawByteString(filesystem)),volumename,dostype);
  1729. end;
  1730. FUNCTION Format(const filesystem : pCHAR;const volumename : string; dostype : ULONG) : BOOLEAN;
  1731. begin
  1732. Format := Format(filesystem,PChar(RawByteString(volumename)),dostype);
  1733. end;
  1734. FUNCTION Format(const filesystem : string;const volumename : string; dostype : ULONG) : BOOLEAN;
  1735. begin
  1736. Format := Format(PChar(RawByteString(filesystem)),PChar(RawByteString(volumename)),dostype);
  1737. end;
  1738. FUNCTION FPuts(fh : LONGINT;const str : string) : LongInt;
  1739. begin
  1740. FPuts := FPuts(fh,PChar(RawByteString(str)));
  1741. end;
  1742. FUNCTION GetDeviceProc(const name : string; dp : pDevProc) : pDevProc;
  1743. begin
  1744. GetDeviceProc := GetDeviceProc(PChar(RawByteString(name)),dp);
  1745. end;
  1746. FUNCTION GetVar(const name : string; buffer : pCHAR; size : LONGINT; flags : LONGINT) : LONGINT;
  1747. begin
  1748. GetVar := GetVar(PChar(RawByteString(name)),buffer,size,flags);
  1749. end;
  1750. FUNCTION Inhibit(const name : string; onoff : LONGINT) : BOOLEAN;
  1751. begin
  1752. Inhibit := Inhibit(PChar(RawByteString(name)),onoff);
  1753. end;
  1754. FUNCTION IsFileSystem(const name : string) : BOOLEAN;
  1755. begin
  1756. IsFileSystem := IsFileSystem(PChar(RawByteString(name)));
  1757. end;
  1758. FUNCTION LoadSeg(const name : string) : LONGINT;
  1759. begin
  1760. LoadSeg := LoadSeg(PChar(RawByteString(name)));
  1761. end;
  1762. FUNCTION Lock(const name : string; type_ : LONGINT) : LONGINT;
  1763. begin
  1764. Lock := Lock(PChar(RawByteString(name)),type_);
  1765. end;
  1766. FUNCTION MakeDosEntry(const name : string; type_ : LONGINT) : pDosList;
  1767. begin
  1768. MakeDosEntry := MakeDosEntry(PChar(RawByteString(name)),type_);
  1769. end;
  1770. FUNCTION MakeLink(const name : string; dest : LONGINT; soft : LONGINT) : BOOLEAN;
  1771. begin
  1772. MakeLink := MakeLink(PChar(RawByteString(name)),dest,soft);
  1773. end;
  1774. FUNCTION MatchFirst(const pat : string; anchor : pAnchorPath) : LONGINT;
  1775. begin
  1776. MatchFirst := MatchFirst(PChar(RawByteString(pat)),anchor);
  1777. end;
  1778. FUNCTION MatchPattern(const pat : pCHAR; str : string) : BOOLEAN;
  1779. begin
  1780. MatchPattern := MatchPattern(pat,PChar(RawByteString(str)));
  1781. end;
  1782. FUNCTION MatchPatternNoCase(const pat : pCHAR; str : string) : BOOLEAN;
  1783. begin
  1784. MatchPatternNoCase := MatchPatternNoCase(pat,PChar(RawByteString(str)));
  1785. end;
  1786. FUNCTION NewLoadSeg(const file_ : string;const tags : pTagItem) : LONGINT;
  1787. begin
  1788. NewLoadSeg := NewLoadSeg(PChar(RawByteString(file_)),tags);
  1789. end;
  1790. FUNCTION NewLoadSegTagList(const file_ : string;const tags : pTagItem) : LONGINT;
  1791. begin
  1792. NewLoadSegTagList := NewLoadSegTagList(PChar(RawByteString(file_)),tags);
  1793. end;
  1794. FUNCTION PathPart(const path : string) : pCHAR;
  1795. begin
  1796. PathPart := PathPart(PChar(RawByteString(path)));
  1797. end;
  1798. FUNCTION PrintFault(code : LONGINT;const header : string) : BOOLEAN;
  1799. begin
  1800. PrintFault := PrintFault(code,PChar(RawByteString(header)));
  1801. end;
  1802. FUNCTION PutStr(const str : string) : BOOLEAN;
  1803. begin
  1804. PutStr := PutStr(PChar(RawByteString(str)));
  1805. end;
  1806. FUNCTION ReadArgs(const arg_template : string; arra : pLONGINT; args : pRDArgs) : pRDArgs;
  1807. begin
  1808. ReadArgs := ReadArgs(PChar(RawByteString(arg_template)),arra,args);
  1809. end;
  1810. FUNCTION ReadLink(port : pMsgPort; lock : LONGINT;const path : string; buffer : pCHAR; size : ULONG) : BOOLEAN;
  1811. begin
  1812. ReadLink := ReadLink(port,lock,PChar(RawByteString(path)),buffer,size);
  1813. end;
  1814. FUNCTION Relabel(const drive : string;const newname : pCHAR) : BOOLEAN;
  1815. begin
  1816. Relabel := Relabel(PChar(RawByteString(drive)),newname);
  1817. end;
  1818. FUNCTION Relabel(const drive : pCHAR;const newname : string) : BOOLEAN;
  1819. begin
  1820. Relabel := Relabel(drive,PChar(RawByteString(newname)));
  1821. end;
  1822. FUNCTION Relabel(const drive : string;const newname : string) : BOOLEAN;
  1823. begin
  1824. Relabel := Relabel(PChar(RawByteString(drive)),PChar(RawByteString(newname)));
  1825. end;
  1826. FUNCTION RemAssignList(const name : string; lock : LONGINT) : BOOLEAN;
  1827. begin
  1828. RemAssignList := RemAssignList(PChar(RawByteString(name)),lock);
  1829. end;
  1830. FUNCTION RunCommand(seg : LONGINT; stack : LONGINT;const paramptr : string; paramlen : LONGINT) : LONGINT;
  1831. begin
  1832. RunCommand := RunCommand(seg,stack,PChar(RawByteString(paramptr)),paramlen);
  1833. end;
  1834. FUNCTION SetComment(const name : string;const comment : pCHAR) : BOOLEAN;
  1835. begin
  1836. SetComment := SetComment(PChar(RawByteString(name)),comment);
  1837. end;
  1838. FUNCTION SetComment(const name : pCHAR;const comment : string) : BOOLEAN;
  1839. begin
  1840. SetComment := SetComment(name,PChar(RawByteString(comment)));
  1841. end;
  1842. FUNCTION SetComment(const name : string;const comment : string) : BOOLEAN;
  1843. begin
  1844. SetComment := SetComment(PChar(RawByteString(name)),PChar(RawByteString(comment)));
  1845. end;
  1846. FUNCTION SetCurrentDirName(const name : string) : BOOLEAN;
  1847. begin
  1848. SetCurrentDirName := SetCurrentDirName(PChar(RawByteString(name)));
  1849. end;
  1850. FUNCTION SetFileDate(const name : string; date : pDateStamp) : BOOLEAN;
  1851. begin
  1852. SetFileDate := SetFileDate(PChar(RawByteString(name)),date);
  1853. end;
  1854. FUNCTION SetOwner(const name : string; owner_info : LONGINT) : BOOLEAN;
  1855. begin
  1856. SetOwner := SetOwner(PChar(RawByteString(name)),owner_info);
  1857. end;
  1858. FUNCTION SetProgramName(const name : string) : BOOLEAN;
  1859. begin
  1860. SetProgramName := SetProgramName(PChar(RawByteString(name)));
  1861. end;
  1862. FUNCTION SetPrompt(const name : string) : BOOLEAN;
  1863. begin
  1864. SetPrompt := SetPrompt(PChar(RawByteString(name)));
  1865. end;
  1866. FUNCTION SetProtection(const name : string; protect : LONGINT) : BOOLEAN;
  1867. begin
  1868. SetProtection := SetProtection(PChar(RawByteString(name)),protect);
  1869. end;
  1870. FUNCTION SetVar(const name : string; buffer : pCHAR; size : LONGINT; flags : LONGINT) : BOOLEAN;
  1871. begin
  1872. SetVar := SetVar(PChar(RawByteString(name)),buffer,size,flags);
  1873. end;
  1874. FUNCTION SplitName(const name : string; seperator : ULONG; buf : pCHAR; oldpos : LONGINT; size : LONGINT) : smallint;
  1875. begin
  1876. SplitName := SplitName(PChar(RawByteString(name)),seperator,buf,oldpos,size);
  1877. end;
  1878. FUNCTION StrToLong(const string_ : string; VAR value : LONGINT) : LONGINT;
  1879. begin
  1880. StrToLong := StrToLong(PChar(RawByteString(string_)),value);
  1881. end;
  1882. FUNCTION SystemTagList(const command : string;const tags : pTagItem) : LONGINT;
  1883. begin
  1884. SystemTagList := SystemTagList(PChar(RawByteString(command)),tags);
  1885. end;
  1886. FUNCTION DOSSystem(const command : string;const tags : pTagItem) : LONGINT;
  1887. begin
  1888. DOSSystem := DOSSystem(PChar(RawByteString(command)),tags);
  1889. end;
  1890. END. (* UNIT DOS *)