amigados.pas 130 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522
  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. {$I useamigasmartlink.inc}
  36. {$ifdef use_amiga_smartlink}
  37. {$smartlink on}
  38. {$endif use_amiga_smartlink}
  39. unit amigados;
  40. INTERFACE
  41. uses exec, utility, timer;
  42. Const
  43. { Predefined Amiga DOS global constants }
  44. DOSTRUE = -1;
  45. DOSFALSE = 0;
  46. { Mode parameter to Open() }
  47. MODE_OLDFILE = 1005; { Open existing file read/write
  48. positioned at beginning of file. }
  49. MODE_NEWFILE = 1006; { Open freshly created file (delete
  50. old file) read/write }
  51. MODE_READWRITE = 1004; { Open old file w/exclusive lock }
  52. { Relative position to Seek() }
  53. OFFSET_BEGINNING = -1; { relative to Begining Of File }
  54. OFFSET_CURRENT = 0; { relative to Current file position }
  55. OFFSET_END = 1; { relative to End Of File }
  56. BITSPERBYTE = 8;
  57. BYTESPERLONG = 4;
  58. BITSPERLONG = 32;
  59. MAXINT = $7FFFFFFF;
  60. MININT = $80000000;
  61. { Passed as type to Lock() }
  62. SHARED_LOCK = -2; { File is readable by others }
  63. ACCESS_READ = -2; { Synonym }
  64. EXCLUSIVE_LOCK = -1; { No other access allowed }
  65. ACCESS_WRITE = -1; { Synonym }
  66. Type
  67. FileHandle = BPTR;
  68. FileLock = BPTR;
  69. pDateStamp = ^tDateStamp;
  70. tDateStamp = record
  71. ds_Days : Longint; { Number of days since Jan. 1, 1978 }
  72. ds_Minute : Longint; { Number of minutes past midnight }
  73. ds_Tick : Longint; { Number of ticks past minute }
  74. end;
  75. Const
  76. TICKS_PER_SECOND = 50; { Number of ticks in one second }
  77. {$PACKRECORDS 4}
  78. Type
  79. { Returned by Examine() and ExInfo(), must be on a 4 byte boundary }
  80. pFileInfoBlock = ^tFileInfoBlock;
  81. tFileInfoBlock = record
  82. fib_DiskKey : Longint;
  83. fib_DirEntryType : Longint;
  84. { Type of Directory. If < 0, then a plain file.
  85. If > 0 a directory }
  86. fib_FileName : Array [0..107] of Char;
  87. { Null terminated. Max 30 chars used for now }
  88. fib_Protection : Longint;
  89. { bit mask of protection, rwxd are 3-0. }
  90. fib_EntryType : Longint;
  91. fib_Size : Longint; { Number of bytes in file }
  92. fib_NumBlocks : Longint; { Number of blocks in file }
  93. fib_Date : tDateStamp; { Date file last changed }
  94. fib_Comment : Array [0..79] of Char;
  95. { Null terminated comment associated with file }
  96. fib_OwnerUID : Word;
  97. fib_OwnerGID : Word;
  98. fib_Reserved : Array [0..31] of Char;
  99. end;
  100. Const
  101. { FIB stands for FileInfoBlock }
  102. {* FIBB are bit definitions, FIBF are field definitions *}
  103. {* Regular RWED bits are 0 == allowed. *}
  104. {* NOTE: GRP and OTR RWED permissions are 0 == not allowed! *}
  105. {* Group and Other permissions are not directly handled by the filesystem *}
  106. FIBB_OTR_READ = 15; {* Other: file is readable *}
  107. FIBB_OTR_WRITE = 14; {* Other: file is writable *}
  108. FIBB_OTR_EXECUTE = 13; {* Other: file is executable *}
  109. FIBB_OTR_DELETE = 12; {* Other: prevent file from being deleted *}
  110. FIBB_GRP_READ = 11; {* Group: file is readable *}
  111. FIBB_GRP_WRITE = 10; {* Group: file is writable *}
  112. FIBB_GRP_EXECUTE = 9; {* Group: file is executable *}
  113. FIBB_GRP_DELETE = 8; {* Group: prevent file from being deleted *}
  114. FIBB_SCRIPT = 6; { program is a script (execute) file }
  115. FIBB_PURE = 5; { program is reentrant and rexecutable}
  116. FIBB_ARCHIVE = 4; { cleared whenever file is changed }
  117. FIBB_READ = 3; { ignored by old filesystem }
  118. FIBB_WRITE = 2; { ignored by old filesystem }
  119. FIBB_EXECUTE = 1; { ignored by system, used by Shell }
  120. FIBB_DELETE = 0; { prevent file from being deleted }
  121. FIBF_OTR_READ = (1 shl FIBB_OTR_READ);
  122. FIBF_OTR_WRITE = (1 shl FIBB_OTR_WRITE);
  123. FIBF_OTR_EXECUTE = (1 shl FIBB_OTR_EXECUTE);
  124. FIBF_OTR_DELETE = (1 shl FIBB_OTR_DELETE);
  125. FIBF_GRP_READ = (1 shl FIBB_GRP_READ);
  126. FIBF_GRP_WRITE = (1 shl FIBB_GRP_WRITE);
  127. FIBF_GRP_EXECUTE = (1 shl FIBB_GRP_EXECUTE);
  128. FIBF_GRP_DELETE = (1 shl FIBB_GRP_DELETE);
  129. FIBF_SCRIPT = 64;
  130. FIBF_PURE = 32;
  131. FIBF_ARCHIVE = 16;
  132. FIBF_READ = 8;
  133. FIBF_WRITE = 4;
  134. FIBF_EXECUTE = 2;
  135. FIBF_DELETE = 1;
  136. {* Standard maximum length for an error string from fault. However, most *}
  137. {* error strings should be kept under 60 characters if possible. Don't *}
  138. {* forget space for the header you pass in. *}
  139. FAULT_MAX = 82;
  140. {* All BCPL data must be long Integer aligned. BCPL pointers are the long Integer
  141. * address (i.e byte address divided by 4 (>>2)) *}
  142. {* BCPL strings have a length in the first byte and then the characters.
  143. * For example: s[0]=3 s[1]=S s[2]=Y s[3]=S *}
  144. Type
  145. { returned by Info(), must be on a 4 byte boundary }
  146. pInfoData = ^tInfoData;
  147. tInfoData = record
  148. id_NumSoftErrors : Longint; { number of soft errors on disk }
  149. id_UnitNumber : Longint; { Which unit disk is (was) mounted on }
  150. id_DiskState : Longint; { See defines below }
  151. id_NumBlocks : Longint; { Number of blocks on disk }
  152. id_NumBlocksUsed : Longint; { Number of block in use }
  153. id_BytesPerBlock : Longint;
  154. id_DiskType : Longint; { Disk Type code }
  155. id_VolumeNode : BPTR; { BCPL pointer to volume node }
  156. id_InUse : Longint; { Flag, zero if not in use }
  157. end;
  158. {$PACKRECORDS NORMAL}
  159. Const
  160. { ID stands for InfoData }
  161. { Disk states }
  162. ID_WRITE_PROTECTED = 80; { Disk is write protected }
  163. ID_VALIDATING = 81; { Disk is currently being validated }
  164. ID_VALIDATED = 82; { Disk is consistent and writeable }
  165. CONST
  166. ID_NO_DISK_PRESENT = -1;
  167. ID_UNREADABLE_DISK = $42414400; { 'BAD\0' }
  168. ID_DOS_DISK = $444F5300; { 'DOS\0' }
  169. ID_FFS_DISK = $444F5301; { 'DOS\1' }
  170. ID_NOT_REALLY_DOS = $4E444F53; { 'NDOS' }
  171. ID_KICKSTART_DISK = $4B49434B; { 'KICK' }
  172. ID_MSDOS_DISK = $4d534400; { 'MSD\0' }
  173. { Errors from IoErr(), etc. }
  174. ERROR_NO_FREE_STORE = 103;
  175. ERROR_TASK_TABLE_FULL = 105;
  176. ERROR_BAD_TEMPLATE = 114;
  177. ERROR_BAD_NUMBER = 115;
  178. ERROR_REQUIRED_ARG_MISSING = 116;
  179. ERROR_KEY_NEEDS_ARG = 117;
  180. ERROR_TOO_MANY_ARGS = 118;
  181. ERROR_UNMATCHED_QUOTES = 119;
  182. ERROR_LINE_TOO_LONG = 120;
  183. ERROR_FILE_NOT_OBJECT = 121;
  184. ERROR_INVALID_RESIDENT_LIBRARY = 122;
  185. ERROR_NO_DEFAULT_DIR = 201;
  186. ERROR_OBJECT_IN_USE = 202;
  187. ERROR_OBJECT_EXISTS = 203;
  188. ERROR_DIR_NOT_FOUND = 204;
  189. ERROR_OBJECT_NOT_FOUND = 205;
  190. ERROR_BAD_STREAM_NAME = 206;
  191. ERROR_OBJECT_TOO_LARGE = 207;
  192. ERROR_ACTION_NOT_KNOWN = 209;
  193. ERROR_INVALID_COMPONENT_NAME = 210;
  194. ERROR_INVALID_LOCK = 211;
  195. ERROR_OBJECT_WRONG_TYPE = 212;
  196. ERROR_DISK_NOT_VALIDATED = 213;
  197. ERROR_DISK_WRITE_PROTECTED = 214;
  198. ERROR_RENAME_ACROSS_DEVICES = 215;
  199. ERROR_DIRECTORY_NOT_EMPTY = 216;
  200. ERROR_TOO_MANY_LEVELS = 217;
  201. ERROR_DEVICE_NOT_MOUNTED = 218;
  202. ERROR_SEEK_ERROR = 219;
  203. ERROR_COMMENT_TOO_BIG = 220;
  204. ERROR_DISK_FULL = 221;
  205. ERROR_DELETE_PROTECTED = 222;
  206. ERROR_WRITE_PROTECTED = 223;
  207. ERROR_READ_PROTECTED = 224;
  208. ERROR_NOT_A_DOS_DISK = 225;
  209. ERROR_NO_DISK = 226;
  210. ERROR_NO_MORE_ENTRIES = 232;
  211. { added for 1.4 }
  212. ERROR_IS_SOFT_LINK = 233;
  213. ERROR_OBJECT_LINKED = 234;
  214. ERROR_BAD_HUNK = 235;
  215. ERROR_NOT_IMPLEMENTED = 236;
  216. ERROR_RECORD_NOT_LOCKED = 240;
  217. ERROR_LOCK_COLLISION = 241;
  218. ERROR_LOCK_TIMEOUT = 242;
  219. ERROR_UNLOCK_ERROR = 243;
  220. { error codes 303-305 are defined in dosasl.h }
  221. { These are the return codes used by convention by AmigaDOS commands }
  222. { See FAILAT and IF for relvance to EXECUTE files }
  223. RETURN_OK = 0; { No problems, success }
  224. RETURN_WARN = 5; { A warning only }
  225. RETURN_ERROR = 10; { Something wrong }
  226. RETURN_FAIL = 20; { Complete or severe failure}
  227. { Bit numbers that signal you that a user has issued a break }
  228. SIGBREAKB_CTRL_C = 12;
  229. SIGBREAKB_CTRL_D = 13;
  230. SIGBREAKB_CTRL_E = 14;
  231. SIGBREAKB_CTRL_F = 15;
  232. { Bit fields that signal you that a user has issued a break }
  233. { for example: if (SetSignal(0,0) & SIGBREAKF_CTRL_C) cleanup_and_exit(); }
  234. SIGBREAKF_CTRL_C = 4096;
  235. SIGBREAKF_CTRL_D = 8192;
  236. SIGBREAKF_CTRL_E = 16384;
  237. SIGBREAKF_CTRL_F = 32768;
  238. { Values returned by SameLock() }
  239. LOCK_SAME = 0;
  240. LOCK_SAME_HANDLER = 1; { actually same volume }
  241. LOCK_DIFFERENT = -1;
  242. { types for ChangeMode() }
  243. CHANGE_LOCK = 0;
  244. CHANGE_FH = 1;
  245. { Values for MakeLink() }
  246. LINK_HARD = 0;
  247. LINK_SOFT = 1; { softlinks are not fully supported yet }
  248. { values returned by }
  249. ITEM_EQUAL = -2; { "=" Symbol }
  250. ITEM_ERROR = -1; { error }
  251. ITEM_NOTHING = 0; { *N, ;, endstreamch }
  252. ITEM_UNQUOTED = 1; { unquoted item }
  253. ITEM_QUOTED = 2; { quoted item }
  254. { types for AllocDosObject/FreeDosObject }
  255. DOS_FILEHANDLE = 0; { few people should use this }
  256. DOS_EXALLCONTROL = 1; { Must be used to allocate this! }
  257. DOS_FIB = 2; { useful }
  258. DOS_STDPKT = 3; { for doing packet-level I/O }
  259. DOS_CLI = 4; { for shell-writers, etc }
  260. DOS_RDARGS = 5; { for ReadArgs if you pass it in }
  261. {
  262. * Data structures and equates used by the V1.4 DOS functions
  263. * StrtoDate() and DatetoStr()
  264. }
  265. {--------- String/Date structures etc }
  266. Type
  267. pDateTime = ^tDateTime;
  268. tDateTime = record
  269. dat_Stamp : tDateStamp; { DOS DateStamp }
  270. dat_Format, { controls appearance of dat_StrDate }
  271. dat_Flags : Byte; { see BITDEF's below }
  272. dat_StrDay, { day of the week string }
  273. dat_StrDate, { date string }
  274. dat_StrTime : STRPTR; { time string }
  275. END;
  276. { You need this much room for each of the DateTime strings: }
  277. CONST
  278. LEN_DATSTRING = 16;
  279. { flags for dat_Flags }
  280. DTB_SUBST = 0; { substitute Today, Tomorrow, etc. }
  281. DTF_SUBST = 1;
  282. DTB_FUTURE = 1; { day of the week is in future }
  283. DTF_FUTURE = 2;
  284. {
  285. * date format values
  286. }
  287. FORMAT_DOS = 0; { dd-mmm-yy }
  288. FORMAT_INT = 1; { yy-mm-dd }
  289. FORMAT_USA = 2; { mm-dd-yy }
  290. FORMAT_CDN = 3; { dd-mm-yy }
  291. FORMAT_MAX = FORMAT_CDN;
  292. FORMAT_DEF = 4; { use default format, as defined
  293. by locale; if locale not
  294. available, use FORMAT_DOS
  295. instead }
  296. {**********************************************************************
  297. ************************ PATTERN MATCHING ******************************
  298. ************************************************************************
  299. * structure expected by MatchFirst, MatchNext.
  300. * Allocate this structure and initialize it as follows:
  301. *
  302. * Set ap_BreakBits to the signal bits (CDEF) that you want to take a
  303. * break on, or NULL, if you don't want to convenience the user.
  304. *
  305. * If you want to have the FULL PATH NAME of the files you found,
  306. * allocate a buffer at the END of this structure, and put the size of
  307. * it into ap_Strlen. If you don't want the full path name, make sure
  308. * you set ap_Strlen to zero. In this case, the name of the file, and stats
  309. * are available in the ap_Info, as per usual.
  310. *
  311. * Then call MatchFirst() and then afterwards, MatchNext() with this structure.
  312. * You should check the return value each time (see below) and take the
  313. * appropriate action, ultimately calling MatchEnd() when there are
  314. * no more files and you are done. You can tell when you are done by
  315. * checking for the normal AmigaDOS return code ERROR_NO_MORE_ENTRIES.
  316. *
  317. }
  318. Type
  319. pAChain = ^tAChain;
  320. tAChain = record
  321. an_Child,
  322. an_Parent : pAChain;
  323. an_Lock : BPTR;
  324. an_Info : tFileInfoBlock;
  325. an_Flags : Shortint;
  326. an_String : Array[0..0] of Char; { FIX!! }
  327. END;
  328. pAnchorPath = ^tAnchorPath;
  329. tAnchorPath = record
  330. case smallint of
  331. 0 : (
  332. ap_First : pAChain;
  333. ap_Last : pAChain;
  334. );
  335. 1 : (
  336. ap_Base, { pointer to first anchor }
  337. ap_Current : pAChain; { pointer to last anchor }
  338. ap_BreakBits, { Bits we want to break on }
  339. ap_FoundBreak : Longint; { Bits we broke on. Also returns ERROR_BREAK }
  340. ap_Flags : Shortint; { New use for extra Integer. }
  341. ap_Reserved : Shortint;
  342. ap_Strlen : smallint; { This is what ap_Length used to be }
  343. ap_Info : tFileInfoBlock;
  344. ap_Buf : Array[0..0] of Char; { Buffer for path name, allocated by user !! }
  345. { FIX! }
  346. );
  347. END;
  348. CONST
  349. APB_DOWILD = 0; { User option ALL }
  350. APF_DOWILD = 1;
  351. APB_ITSWILD = 1; { Set by MatchFirst, used by MatchNext }
  352. APF_ITSWILD = 2; { Application can test APB_ITSWILD, too }
  353. { (means that there's a wildcard }
  354. { in the pattern after calling }
  355. { MatchFirst). }
  356. APB_DODIR = 2; { Bit is SET IF a DIR node should be }
  357. APF_DODIR = 4; { entered. Application can RESET this }
  358. { bit after MatchFirst/MatchNext to AVOID }
  359. { entering a dir. }
  360. APB_DIDDIR = 3; { Bit is SET for an "expired" dir node. }
  361. APF_DIDDIR = 8;
  362. APB_NOMEMERR = 4; { Set on memory error }
  363. APF_NOMEMERR = 16;
  364. APB_DODOT = 5; { IF set, allow conversion of '.' to }
  365. APF_DODOT = 32; { CurrentDir }
  366. APB_DirChanged = 6; { ap_Current->an_Lock changed }
  367. APF_DirChanged = 64; { since last MatchNext call }
  368. DDB_PatternBit = 0;
  369. DDF_PatternBit = 1;
  370. DDB_ExaminedBit = 1;
  371. DDF_ExaminedBit = 2;
  372. DDB_Completed = 2;
  373. DDF_Completed = 4;
  374. DDB_AllBit = 3;
  375. DDF_AllBit = 8;
  376. DDB_Single = 4;
  377. DDF_Single = 16;
  378. {
  379. * Constants used by wildcard routines, these are the pre-parsed tokens
  380. * referred to by pattern match. It is not necessary for you to do
  381. * anything about these, MatchFirst() MatchNext() handle all these for you.
  382. }
  383. P_ANY = $80; { Token for '*' or '#? }
  384. P_SINGLE = $81; { Token for '?' }
  385. P_ORSTART = $82; { Token for '(' }
  386. P_ORNEXT = $83; { Token for '|' }
  387. P_OREND = $84; { Token for ')' }
  388. P_NOT = $85; { Token for '~' }
  389. P_NOTEND = $86; { Token for }
  390. P_NOTCLASS = $87; { Token for '^' }
  391. P_CLASS = $88; { Token for '[]' }
  392. P_REPBEG = $89; { Token for '[' }
  393. P_REPEND = $8A; { Token for ']' }
  394. P_STOP = $8B; { token to force end of evaluation }
  395. { Values for an_Status, NOTE: These are the actual bit numbers }
  396. COMPLEX_BIT = 1; { Parsing complex pattern }
  397. EXAMINE_BIT = 2; { Searching directory }
  398. {
  399. * Returns from MatchFirst(), MatchNext()
  400. * You can also get dos error returns, such as ERROR_NO_MORE_ENTRIES,
  401. * these are in the dos.h file.
  402. }
  403. ERROR_BUFFER_OVERFLOW = 303; { User OR internal buffer overflow }
  404. ERROR_BREAK = 304; { A break character was received }
  405. ERROR_NOT_EXECUTABLE = 305; { A file has E bit cleared }
  406. { hunk types }
  407. HUNK_UNIT = 999 ;
  408. HUNK_NAME = 1000;
  409. HUNK_CODE = 1001;
  410. HUNK_DATA = 1002;
  411. HUNK_BSS = 1003;
  412. HUNK_RELOC32 = 1004;
  413. HUNK_RELOC16 = 1005;
  414. HUNK_RELOC8 = 1006;
  415. HUNK_EXT = 1007;
  416. HUNK_SYMBOL = 1008;
  417. HUNK_DEBUG = 1009;
  418. HUNK_END = 1010;
  419. HUNK_HEADER = 1011;
  420. HUNK_OVERLAY = 1013;
  421. HUNK_BREAK = 1014;
  422. HUNK_DREL32 = 1015;
  423. HUNK_DREL16 = 1016;
  424. HUNK_DREL8 = 1017;
  425. HUNK_LIB = 1018;
  426. HUNK_INDEX = 1019;
  427. { hunk_ext sub-types }
  428. EXT_SYMB = 0 ; { symbol table }
  429. EXT_DEF = 1 ; { relocatable definition }
  430. EXT_ABS = 2 ; { Absolute definition }
  431. EXT_RES = 3 ; { no longer supported }
  432. EXT_REF32 = 129; { 32 bit reference to symbol }
  433. EXT_COMMON = 130; { 32 bit reference to COMMON block }
  434. EXT_REF16 = 131; { 16 bit reference to symbol }
  435. EXT_REF8 = 132; { 8 bit reference to symbol }
  436. EXT_DEXT32 = 133; { 32 bit data releative reference }
  437. EXT_DEXT16 = 134; { 16 bit data releative reference }
  438. EXT_DEXT8 = 135; { 8 bit data releative reference }
  439. Type
  440. { All DOS processes have this structure }
  441. { Create and Device Proc returns pointer to the MsgPort in this structure }
  442. { dev_proc = Address(smallint(DeviceProc()) - SizeOf(Task)) }
  443. pProcess = ^tProcess;
  444. tProcess = record
  445. pr_Task : tTask;
  446. pr_MsgPort : tMsgPort; { This is BPTR address from DOS functions }
  447. pr_Pad : smallint; { Remaining variables on 4 byte boundaries }
  448. pr_SegList : BPTR; { Array of seg lists used by this process }
  449. pr_StackSize : Longint; { Size of process stack in bytes }
  450. pr_GlobVec : Pointer; { Global vector for this process (BCPL) }
  451. pr_TaskNum : Longint; { CLI task number of zero if not a CLI }
  452. pr_StackBase : BPTR; { Ptr to high memory end of process stack }
  453. pr_Result2 : Longint; { Value of secondary result from last call }
  454. pr_CurrentDir : BPTR; { Lock associated with current directory }
  455. pr_CIS : BPTR; { Current CLI Input Stream }
  456. pr_COS : BPTR; { Current CLI Output Stream }
  457. pr_ConsoleTask : Pointer; { Console handler process for current window}
  458. pr_FileSystemTask : Pointer; { File handler process for current drive }
  459. pr_CLI : BPTR; { pointer to ConsoleLineInterpreter }
  460. pr_ReturnAddr : Pointer; { pointer to previous stack frame }
  461. pr_PktWait : Pointer; { Function to be called when awaiting msg }
  462. pr_WindowPtr : Pointer; { Window for error printing }
  463. { following definitions are new with 2.0 }
  464. pr_HomeDir : BPTR; { Home directory of executing program }
  465. pr_Flags : Longint; { flags telling dos about process }
  466. pr_ExitCode : Pointer; { code to call on exit of program OR NULL }
  467. pr_ExitData : Longint; { Passed as an argument to pr_ExitCode. }
  468. pr_Arguments : STRPTR; { Arguments passed to the process at start }
  469. pr_LocalVars : tMinList; { Local environment variables }
  470. pr_ShellPrivate : ULONG; { for the use of the current shell }
  471. pr_CES : BPTR; { Error stream - IF NULL, use pr_COS }
  472. end;
  473. {
  474. * Flags for pr_Flags
  475. }
  476. CONST
  477. PRB_FREESEGLIST = 0 ;
  478. PRF_FREESEGLIST = 1 ;
  479. PRB_FREECURRDIR = 1 ;
  480. PRF_FREECURRDIR = 2 ;
  481. PRB_FREECLI = 2 ;
  482. PRF_FREECLI = 4 ;
  483. PRB_CLOSEINPUT = 3 ;
  484. PRF_CLOSEINPUT = 8 ;
  485. PRB_CLOSEOUTPUT = 4 ;
  486. PRF_CLOSEOUTPUT = 16;
  487. PRB_FREEARGS = 5 ;
  488. PRF_FREEARGS = 32;
  489. { The long smallint address (BPTR) of this structure is returned by
  490. * Open() and other routines that return a file. You need only worry
  491. * about this struct to do async io's via PutMsg() instead of
  492. * standard file system calls }
  493. Type
  494. pFileHandle = ^tFileHandle;
  495. tFileHandle = record
  496. fh_Link : pMessage; { EXEC message }
  497. fh_Port : pMsgPort; { Reply port for the packet }
  498. fh_Type : pMsgPort; { Port to do PutMsg() to
  499. Address is negative if a plain file }
  500. fh_Buf : Longint;
  501. fh_Pos : Longint;
  502. fh_End : Longint;
  503. fh_Func1 : Longint;
  504. fh_Func2 : Longint;
  505. fh_Func3 : Longint;
  506. fh_Arg1 : Longint;
  507. fh_Arg2 : Longint;
  508. end;
  509. { This is the extension to EXEC Messages used by DOS }
  510. pDosPacket = ^tDosPacket;
  511. tDosPacket = record
  512. dp_Link : pMessage; { EXEC message }
  513. dp_Port : pMsgPort; { Reply port for the packet }
  514. { Must be filled in each send. }
  515. case smallint of
  516. 0 : (
  517. dp_Action : Longint;
  518. dp_Status : Longint;
  519. dp_Status2 : Longint;
  520. dp_BufAddr : Longint;
  521. );
  522. 1 : (
  523. dp_Type : Longint; { See ACTION_... below and
  524. * 'R' means Read, 'W' means Write to the
  525. * file system }
  526. dp_Res1 : Longint; { For file system calls this is the result
  527. * that would have been returned by the
  528. * function, e.g. Write ('W') returns actual
  529. * length written }
  530. dp_Res2 : Longint; { For file system calls this is what would
  531. * have been returned by IoErr() }
  532. dp_Arg1 : Longint;
  533. dp_Arg2 : Longint;
  534. dp_Arg3 : Longint;
  535. dp_Arg4 : Longint;
  536. dp_Arg5 : Longint;
  537. dp_Arg6 : Longint;
  538. dp_Arg7 : Longint;
  539. );
  540. end;
  541. { A Packet does not require the Message to be before it in memory, but
  542. * for convenience it is useful to associate the two.
  543. * Also see the function init_std_pkt for initializing this structure }
  544. pStandardPacket = ^tStandardPacket;
  545. tStandardPacket = record
  546. sp_Msg : tMessage;
  547. sp_Pkt : tDosPacket;
  548. end;
  549. Const
  550. { Packet types }
  551. ACTION_NIL = 0;
  552. ACTION_GET_BLOCK = 2; { OBSOLETE }
  553. ACTION_SET_MAP = 4;
  554. ACTION_DIE = 5;
  555. ACTION_EVENT = 6;
  556. ACTION_CURRENT_VOLUME = 7;
  557. ACTION_LOCATE_OBJECT = 8;
  558. ACTION_RENAME_DISK = 9;
  559. ACTION_WRITE = $57; { 'W' }
  560. ACTION_READ = $52; { 'R' }
  561. ACTION_FREE_LOCK = 15;
  562. ACTION_DELETE_OBJECT = 16;
  563. ACTION_RENAME_OBJECT = 17;
  564. ACTION_MORE_CACHE = 18;
  565. ACTION_COPY_DIR = 19;
  566. ACTION_WAIT_CHAR = 20;
  567. ACTION_SET_PROTECT = 21;
  568. ACTION_CREATE_DIR = 22;
  569. ACTION_EXAMINE_OBJECT = 23;
  570. ACTION_EXAMINE_NEXT = 24;
  571. ACTION_DISK_INFO = 25;
  572. ACTION_INFO = 26;
  573. ACTION_FLUSH = 27;
  574. ACTION_SET_COMMENT = 28;
  575. ACTION_PARENT = 29;
  576. ACTION_TIMER = 30;
  577. ACTION_INHIBIT = 31;
  578. ACTION_DISK_TYPE = 32;
  579. ACTION_DISK_CHANGE = 33;
  580. ACTION_SET_DATE = 34;
  581. ACTION_SCREEN_MODE = 994;
  582. ACTION_READ_RETURN = 1001;
  583. ACTION_WRITE_RETURN = 1002;
  584. ACTION_SEEK = 1008;
  585. ACTION_FINDUPDATE = 1004;
  586. ACTION_FINDINPUT = 1005;
  587. ACTION_FINDOUTPUT = 1006;
  588. ACTION_END = 1007;
  589. ACTION_TRUNCATE = 1022; { fast file system only }
  590. ACTION_WRITE_PROTECT = 1023; { fast file system only }
  591. { new 2.0 packets }
  592. ACTION_SAME_LOCK = 40;
  593. ACTION_CHANGE_SIGNAL = 995;
  594. ACTION_FORMAT = 1020;
  595. ACTION_MAKE_LINK = 1021;
  596. {}
  597. {}
  598. ACTION_READ_LINK = 1024;
  599. ACTION_FH_FROM_LOCK = 1026;
  600. ACTION_IS_FILESYSTEM = 1027;
  601. ACTION_CHANGE_MODE = 1028;
  602. {}
  603. ACTION_COPY_DIR_FH = 1030;
  604. ACTION_PARENT_FH = 1031;
  605. ACTION_EXAMINE_ALL = 1033;
  606. ACTION_EXAMINE_FH = 1034;
  607. ACTION_LOCK_RECORD = 2008;
  608. ACTION_FREE_RECORD = 2009;
  609. ACTION_ADD_NOTIFY = 4097;
  610. ACTION_REMOVE_NOTIFY = 4098;
  611. {* Added in V39: *}
  612. ACTION_EXAMINE_ALL_END = 1035;
  613. ACTION_SET_OWNER = 1036;
  614. {* Tell a file system to serialize the current volume. This is typically
  615. * done by changing the creation date of the disk. This packet does not take
  616. * any arguments. NOTE: be prepared to handle failure of this packet for
  617. * V37 ROM filesystems.
  618. *}
  619. ACTION_SERIALIZE_DISK = 4200;
  620. {
  621. * A structure for holding error messages - stored as array with error == 0
  622. * for the last entry.
  623. }
  624. Type
  625. pErrorString = ^tErrorString;
  626. tErrorString = record
  627. estr_Nums : Pointer;
  628. estr_Strings : Pointer;
  629. END;
  630. { DOS library node structure.
  631. * This is the data at positive offsets from the library node.
  632. * Negative offsets from the node is the jump table to DOS functions
  633. * node = (struct DosLibrary *) OpenLibrary( "dos.library" .. ) }
  634. Type
  635. pDosLibrary = ^tDosLibrary;
  636. tDosLibrary = record
  637. dl_lib : tLibrary;
  638. dl_Root : Pointer; { Pointer to RootNode, described below }
  639. dl_GV : Pointer; { Pointer to BCPL global vector }
  640. dl_A2 : Longint; { Private register dump of DOS }
  641. dl_A5 : Longint;
  642. dl_A6 : Longint;
  643. dl_Errors : pErrorString; { pointer to array of error msgs }
  644. dl_TimeReq : pTimeRequest; { private pointer to timer request }
  645. dl_UtilityBase : pLibrary; { private ptr to utility library }
  646. dl_IntuitionBase : pLibrary;
  647. end;
  648. pRootNode = ^tRootNode;
  649. tRootNode = record
  650. rn_TaskArray : BPTR; { [0] is max number of CLI's
  651. [1] is APTR to process id of CLI 1
  652. [n] is APTR to process id of CLI n }
  653. rn_ConsoleSegment : BPTR; { SegList for the CLI }
  654. rn_Time : tDateStamp; { Current time }
  655. rn_RestartSeg : Longint; { SegList for the disk validator process }
  656. rn_Info : BPTR; { Pointer ot the Info structure }
  657. rn_FileHandlerSegment : BPTR; { segment for a file handler }
  658. rn_CliList : tMinList; { new list of all CLI processes }
  659. { the first cpl_Array is also rn_TaskArray }
  660. rn_BootProc : pMsgPort; { private ptr to msgport of boot fs }
  661. rn_ShellSegment : BPTR; { seglist for Shell (for NewShell) }
  662. rn_Flags : Longint; { dos flags }
  663. end;
  664. CONST
  665. RNB_WILDSTAR = 24;
  666. RNF_WILDSTAR = 16777216;
  667. RNB_PRIVATE1 = 1; { private for dos }
  668. RNF_PRIVATE1 = 2;
  669. Type
  670. pDosInfo = ^tDosInfo;
  671. tDosInfo = record
  672. case smallint of
  673. 0 : (
  674. di_ResList : BPTR;
  675. );
  676. 1 : (
  677. di_McName : BPTR; { Network name of this machine; currently 0 }
  678. di_DevInfo : BPTR; { Device List }
  679. di_Devices : BPTR; { Currently zero }
  680. di_Handlers : BPTR; { Currently zero }
  681. di_NetHand : Pointer; { Network handler processid; currently zero }
  682. di_DevLock, { do NOT access directly! }
  683. di_EntryLock, { do NOT access directly! }
  684. di_DeleteLock : tSignalSemaphore; { do NOT access directly! }
  685. );
  686. end;
  687. { ONLY to be allocated by DOS! }
  688. pCliProcList = ^tCliProcList;
  689. tCliProcList = record
  690. cpl_Node : tMinNode;
  691. cpl_First : Longint; { number of first entry in array }
  692. cpl_Array : Array[0..0] of pMsgPort;
  693. { [0] is max number of CLI's in this entry (n)
  694. * [1] is CPTR to process id of CLI cpl_First
  695. * [n] is CPTR to process id of CLI cpl_First+n-1
  696. }
  697. END;
  698. { structure for the Dos resident list. Do NOT allocate these, use }
  699. { AddSegment(), and heed the warnings in the autodocs! }
  700. Type
  701. pSegment = ^tSegment;
  702. tSegment = record
  703. seg_Next : BPTR;
  704. seg_UC : Longint;
  705. seg_Seg : BPTR;
  706. seg_Name : Array[0..3] of Char; { actually the first 4 chars of BSTR name }
  707. END;
  708. CONST
  709. CMD_SYSTEM = -1;
  710. CMD_INTERNAL = -2;
  711. CMD_DISABLED = -999;
  712. { DOS Processes started from the CLI via RUN or NEWCLI have this additional
  713. * set to data associated with them }
  714. Type
  715. pCommandLineInterface = ^tCommandLineInterface;
  716. tCommandLineInterface = record
  717. cli_Result2 : Longint; { Value of IoErr from last command }
  718. cli_SetName : BSTR; { Name of current directory }
  719. cli_CommandDir : BPTR; { Lock associated with command directory }
  720. cli_ReturnCode : Longint; { Return code from last command }
  721. cli_CommandName : BSTR; { Name of current command }
  722. cli_FailLevel : Longint; { Fail level (set by FAILAT) }
  723. cli_Prompt : BSTR; { Current prompt (set by PROMPT) }
  724. cli_StandardInput : BPTR; { Default (terminal) CLI input }
  725. cli_CurrentInput : BPTR; { Current CLI input }
  726. cli_CommandFile : BSTR; { Name of EXECUTE command file }
  727. cli_Interactive : Longint; { Boolean; True if prompts required }
  728. cli_Background : Longint; { Boolean; True if CLI created by RUN }
  729. cli_CurrentOutput : BPTR; { Current CLI output }
  730. cli_DefaultStack : Longint; { Stack size to be obtained in long words }
  731. cli_StandardOutput : BPTR; { Default (terminal) CLI output }
  732. cli_Module : BPTR; { SegList of currently loaded command }
  733. end;
  734. { This structure can take on different values depending on whether it is
  735. * a device, an assigned directory, or a volume. Below is the structure
  736. * reflecting volumes only. Following that is the structure representing
  737. * only devices.
  738. }
  739. { structure representing a volume }
  740. pDeviceList = ^tDeviceList;
  741. tDeviceList = record
  742. dl_Next : BPTR; { bptr to next device list }
  743. dl_Type : Longint; { see DLT below }
  744. dl_Task : pMsgPort; { ptr to handler task }
  745. dl_Lock : BPTR; { not for volumes }
  746. dl_VolumeDate : tDateStamp; { creation date }
  747. dl_LockList : BPTR; { outstanding locks }
  748. dl_DiskType : Longint; { 'DOS', etc }
  749. dl_unused : Longint;
  750. dl_Name : BSTR; { bptr to bcpl name }
  751. end;
  752. { device structure (same as the DeviceNode structure in filehandler.h) }
  753. pDevInfo = ^tDevInfo;
  754. tDevInfo = record
  755. dvi_Next : BPTR;
  756. dvi_Type : Longint;
  757. dvi_Task : Pointer;
  758. dvi_Lock : BPTR;
  759. dvi_Handler : BSTR;
  760. dvi_StackSize : Longint;
  761. dvi_Priority : Longint;
  762. dvi_Startup : Longint;
  763. dvi_SegList : BPTR;
  764. dvi_GlobVec : BSTR;
  765. dvi_Name : BSTR;
  766. end;
  767. { structure used for multi-directory assigns. AllocVec()ed. }
  768. pAssignList = ^tAssignList;
  769. tAssignList = record
  770. al_Next : pAssignList;
  771. al_Lock : BPTR;
  772. END;
  773. { combined structure for devices, assigned directories, volumes }
  774. pDosList = ^tDosList;
  775. tDosList = record
  776. dol_Next : BPTR; { bptr to next device on list }
  777. dol_Type : Longint; { see DLT below }
  778. dol_Task : pMsgPort; { ptr to handler task }
  779. dol_Lock : BPTR;
  780. case smallint of
  781. 0 : (
  782. dol_Handler : record
  783. dol_Handler : BSTR; { file name to load IF seglist is null }
  784. dol_StackSize, { stacksize to use when starting process }
  785. dol_Priority, { task priority when starting process }
  786. dol_Startup : Longint; { startup msg: FileSysStartupMsg for disks }
  787. dol_SegList, { already loaded code for new task }
  788. dol_GlobVec : BPTR; { BCPL global vector to use when starting
  789. * a process. -1 indicates a C/Assembler
  790. * program. }
  791. end;
  792. );
  793. 1 : (
  794. dol_Volume : record
  795. dol_VolumeDate : tDateStamp; { creation date }
  796. dol_LockList : BPTR; { outstanding locks }
  797. dol_DiskType : Longint; { 'DOS', etc }
  798. END;
  799. );
  800. 2 : (
  801. dol_assign : record
  802. dol_AssignName : STRPTR; { name for non-OR-late-binding assign }
  803. dol_List : pAssignList; { for multi-directory assigns (regular) }
  804. END;
  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,
  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; pkt : pDosPacket);
  1355. FUNCTION AddBuffers(const name : pCHAR; number : LONGINT) : BOOLEAN;
  1356. FUNCTION AddDosEntry(dlist : pDosList) : BOOLEAN;
  1357. FUNCTION AddPart(dirname : pCHAR;const filename : pCHAR; size : ULONG) : BOOLEAN;
  1358. FUNCTION AddSegment(const name : pCHAR; seg : LONGINT; system : LONGINT) : BOOLEAN;
  1359. FUNCTION AllocDosObject(type_ : ULONG;const tags : pTagItem) : POINTER;
  1360. FUNCTION AllocDosObjectTagList(type_ : ULONG;const tags : pTagItem) : POINTER;
  1361. FUNCTION AssignAdd(const name : pCHAR; lock : LONGINT) : BOOLEAN;
  1362. FUNCTION AssignLate(const name : pCHAR;const path : pCHAR) : BOOLEAN;
  1363. FUNCTION AssignLock(const name : pCHAR; lock : LONGINT) : BOOLEAN;
  1364. FUNCTION AssignPath(const name : pCHAR;const path : pCHAR) : BOOLEAN;
  1365. FUNCTION AttemptLockDosList(flags : ULONG) : pDosList;
  1366. FUNCTION ChangeMode(type_ : LONGINT; fh : LONGINT; newmode : LONGINT) : BOOLEAN;
  1367. FUNCTION CheckSignal(mask : LONGINT) : LONGINT;
  1368. FUNCTION Cli : pCommandLineInterface;
  1369. FUNCTION CliInitNewcli(dp : pDosPacket) : LONGINT;
  1370. FUNCTION CliInitRun(dp : pDosPacket) : LONGINT;
  1371. FUNCTION CompareDates(const date1 : pDateStamp;const date2 : pDateStamp) : LONGINT;
  1372. FUNCTION CreateDir(const name : pCHAR) : LONGINT;
  1373. FUNCTION CreateNewProc(const tags : pTagItem) : pProcess;
  1374. FUNCTION CreateNewProcTagList(const tags : pTagItem) : pProcess;
  1375. FUNCTION CreateProc(const name : pCHAR; pri : LONGINT; segList : LONGINT; stackSize : LONGINT) : pMsgPort;
  1376. FUNCTION CurrentDir(lock : LONGINT) : LONGINT;
  1377. PROCEDURE DateStamp(date : pDateStamp);
  1378. FUNCTION DateToStr(datetime : pDateTime) : BOOLEAN;
  1379. FUNCTION DeleteFile(const name : pCHAR) : BOOLEAN;
  1380. FUNCTION DeleteVar(const name : pCHAR; flags : ULONG) : BOOLEAN;
  1381. FUNCTION DeviceProc(const name : pCHAR) : pMsgPort;
  1382. FUNCTION DoPkt(port : pMsgPort; action : LONGINT; arg1 : LONGINT; arg2 : LONGINT; arg3 : LONGINT; arg4 : LONGINT; arg5 : LONGINT) : LONGINT;
  1383. FUNCTION DoPkt0(port : pMsgPort; action : LONGINT) : LONGINT;
  1384. FUNCTION DoPkt1(port : pMsgPort; action : LONGINT; arg1 : LONGINT) : LONGINT;
  1385. FUNCTION DoPkt2(port : pMsgPort; action : LONGINT; arg1 : LONGINT; arg2 : LONGINT) : LONGINT;
  1386. FUNCTION DoPkt3(port : pMsgPort; action : LONGINT; arg1 : LONGINT; arg2 : LONGINT; arg3 : LONGINT) : LONGINT;
  1387. FUNCTION DoPkt4(port : pMsgPort; action : LONGINT; arg1 : LONGINT; arg2 : LONGINT; arg3 : LONGINT; arg4 : LONGINT) : LONGINT;
  1388. PROCEDURE DOSClose(file_ : LONGINT);
  1389. PROCEDURE DOSDelay(timeout : LONGINT);
  1390. PROCEDURE DOSExit(returnCode : LONGINT);
  1391. FUNCTION DOSFlush(fh : LONGINT) : BOOLEAN;
  1392. FUNCTION DOSInput : LONGINT;
  1393. FUNCTION DOSOpen(const name : pCHAR; accessMode : LONGINT) : LONGINT;
  1394. FUNCTION DOSOutput : LONGINT;
  1395. FUNCTION DOSRead(file_ : LONGINT; buffer : POINTER; length : LONGINT) : LONGINT;
  1396. FUNCTION DOSRename(const oldName : pCHAR;const newName : pCHAR) : Boolean;
  1397. FUNCTION DOSSeek(file_ : LONGINT; position : LONGINT; offset : LONGINT) : LONGINT;
  1398. FUNCTION DOSWrite(file_ : LONGINT; buffer : POINTER; length : LONGINT) : LONGINT;
  1399. FUNCTION DupLock(lock : LONGINT) : LONGINT;
  1400. FUNCTION DupLockFromFH(fh : LONGINT) : LONGINT;
  1401. PROCEDURE EndNotify(notify : pNotifyRequest);
  1402. FUNCTION ErrorReport(code : LONGINT; type_ : LONGINT; arg1 : ULONG; device : pMsgPort) : BOOLEAN;
  1403. FUNCTION ExAll(lock : LONGINT; buffer : pExAllData; size : LONGINT; data : LONGINT; control : pExAllControl) : BOOLEAN;
  1404. PROCEDURE ExAllEnd(lock : LONGINT; buffer : pExAllData; size : LONGINT; data : LONGINT; control : pExAllControl);
  1405. FUNCTION Examine(lock : LONGINT; fileInfoBlock : pFileInfoBlock) : BOOLEAN;
  1406. FUNCTION ExamineFH(fh : LONGINT; fib : pFileInfoBlock) : BOOLEAN;
  1407. FUNCTION Execute(const string_ : pCHAR; file_ : LONGINT; file2 : LONGINT) : BOOLEAN;
  1408. FUNCTION ExNext(lock : LONGINT; fileInfoBlock : pFileInfoBlock) : BOOLEAN;
  1409. FUNCTION Fault(code : LONGINT; header : pCHAR; buffer : pCHAR; len : LONGINT) : BOOLEAN;
  1410. FUNCTION FGetC(fh : LONGINT) : LONGINT;
  1411. FUNCTION FGets(fh : LONGINT; buf : pCHAR; buflen : ULONG) : pCHAR;
  1412. FUNCTION FilePart(const path : pCHAR) : pCHAR;
  1413. FUNCTION FindArg(const keyword : pCHAR;const arg_template : pCHAR) : LONGINT;
  1414. FUNCTION FindCliProc(num : ULONG) : pProcess;
  1415. FUNCTION FindDosEntry(const dlist : pDosList;const name : pCHAR; flags : ULONG) : pDosList;
  1416. FUNCTION FindSegment(const name : pCHAR;const seg : pSegment; system : LONGINT) : pSegment;
  1417. FUNCTION FindVar(const name : pCHAR; type_ : ULONG) : pLocalVar;
  1418. FUNCTION Format(const filesystem : pCHAR;const volumename : pCHAR; dostype : ULONG) : BOOLEAN;
  1419. FUNCTION FPutC(fh : LONGINT; ch : LONGINT) : LONGINT;
  1420. FUNCTION FPuts(fh : LONGINT;const str : pCHAR) : BOOLEAN;
  1421. FUNCTION FRead(fh : LONGINT; block : POINTER; blocklen : ULONG; number : ULONG) : LONGINT;
  1422. PROCEDURE FreeArgs(args : pRDArgs);
  1423. PROCEDURE FreeDeviceProc(dp : pDevProc);
  1424. PROCEDURE FreeDosEntry(dlist : pDosList);
  1425. PROCEDURE FreeDosObject(type_ : ULONG; ptr : POINTER);
  1426. FUNCTION FWrite(fh : LONGINT; block : POINTER; blocklen : ULONG; number : ULONG) : LONGINT;
  1427. FUNCTION GetArgStr : pCHAR;
  1428. FUNCTION GetConsoleTask : pMsgPort;
  1429. FUNCTION GetCurrentDirName(buf : pCHAR; len : LONGINT) : BOOLEAN;
  1430. FUNCTION GetDeviceProc(const name : pCHAR; dp : pDevProc) : pDevProc;
  1431. FUNCTION GetFileSysTask : pMsgPort;
  1432. FUNCTION GetProgramDir : LONGINT;
  1433. FUNCTION GetProgramName(buf : pCHAR; len : LONGINT) : BOOLEAN;
  1434. FUNCTION GetPrompt(buf : pCHAR; len : LONGINT) : BOOLEAN;
  1435. FUNCTION GetVar(const name : pCHAR; buffer : pCHAR; size : LONGINT; flags : LONGINT) : LONGINT;
  1436. FUNCTION Info(lock : LONGINT; parameterBlock : pInfoData) : BOOLEAN;
  1437. FUNCTION Inhibit(const name : pCHAR; onoff : LONGINT) : BOOLEAN;
  1438. FUNCTION InternalLoadSeg(fh : LONGINT; table : LONGINT;const funcarray : pLONGINT; VAR stack : LONGINT) : LONGINT;
  1439. FUNCTION InternalUnLoadSeg(seglist : LONGINT; freefunc : tPROCEDURE) : BOOLEAN;
  1440. FUNCTION IoErr : LONGINT;
  1441. FUNCTION IsFileSystem(const name : pCHAR) : BOOLEAN;
  1442. FUNCTION IsInteractive(file_ : LONGINT) : BOOLEAN;
  1443. FUNCTION LoadSeg(const name : pCHAR) : LONGINT;
  1444. FUNCTION Lock(const name : pCHAR; type_ : LONGINT) : LONGINT;
  1445. FUNCTION LockDosList(flags : ULONG) : pDosList;
  1446. FUNCTION LockRecord(fh : LONGINT; offset : ULONG; length : ULONG; mode : ULONG; timeout : ULONG) : BOOLEAN;
  1447. FUNCTION LockRecords(recArray : pRecordLock; timeout : ULONG) : BOOLEAN;
  1448. FUNCTION MakeDosEntry(const name : pCHAR; type_ : LONGINT) : pDosList;
  1449. FUNCTION MakeLink(const name : pCHAR; dest : LONGINT; soft : LONGINT) : BOOLEAN;
  1450. PROCEDURE MatchEnd(anchor : pAnchorPath);
  1451. FUNCTION MatchFirst(const pat : pCHAR; anchor : pAnchorPath) : LONGINT;
  1452. FUNCTION MatchNext(anchor : pAnchorPath) : LONGINT;
  1453. FUNCTION MatchPattern(const pat : pCHAR; str : pCHAR) : BOOLEAN;
  1454. FUNCTION MatchPatternNoCase(const pat : pCHAR; str : pCHAR) : BOOLEAN;
  1455. FUNCTION MaxCli : ULONG;
  1456. FUNCTION NameFromFH(fh : LONGINT; buffer : pCHAR; len : LONGINT) : BOOLEAN;
  1457. FUNCTION NameFromLock(lock : LONGINT; buffer : pCHAR; len : LONGINT) : BOOLEAN;
  1458. FUNCTION NewLoadSeg(const file_ : pCHAR;const tags : pTagItem) : LONGINT;
  1459. FUNCTION NewLoadSegTagList(const file_ : pCHAR;const tags : pTagItem) : LONGINT;
  1460. FUNCTION NextDosEntry(const dlist : pDosList; flags : ULONG) : pDosList;
  1461. FUNCTION OpenFromLock(lock : LONGINT) : LONGINT;
  1462. FUNCTION ParentDir(lock : LONGINT) : LONGINT;
  1463. FUNCTION ParentOfFH(fh : LONGINT) : LONGINT;
  1464. FUNCTION ParsePattern(const pat : pCHAR; buf : pCHAR; buflen : LONGINT) : LONGINT;
  1465. FUNCTION ParsePatternNoCase(const pat : pCHAR; buf : pCHAR; buflen : LONGINT) : LONGINT;
  1466. FUNCTION PathPart(const path : pCHAR) : pCHAR;
  1467. FUNCTION PrintFault(code : LONGINT;const header : pCHAR) : BOOLEAN;
  1468. FUNCTION PutStr(const str : pCHAR) : BOOLEAN;
  1469. FUNCTION ReadArgs(const arg_template : pCHAR; arra : pLONGINT; args : pRDArgs) : pRDArgs;
  1470. FUNCTION ReadItem(const name : pCHAR; maxchars : LONGINT; cSource : pCSource) : LONGINT;
  1471. FUNCTION ReadLink(port : pMsgPort; lock : LONGINT;const path : pCHAR; buffer : pCHAR; size : ULONG) : BOOLEAN;
  1472. FUNCTION Relabel(const drive : pCHAR;const newname : pCHAR) : BOOLEAN;
  1473. FUNCTION RemAssignList(const name : pCHAR; lock : LONGINT) : BOOLEAN;
  1474. FUNCTION RemDosEntry(dlist : pDosList) : BOOLEAN;
  1475. FUNCTION RemSegment(seg : pSegment) : BOOLEAN;
  1476. PROCEDURE ReplyPkt(dp : pDosPacket; res1 : LONGINT; res2 : LONGINT);
  1477. FUNCTION RunCommand(seg : LONGINT; stack : LONGINT;const paramptr : pCHAR; paramlen : LONGINT) : LONGINT;
  1478. FUNCTION SameDevice(lock1 : LONGINT; lock2 : LONGINT) : BOOLEAN;
  1479. FUNCTION SameLock(lock1 : LONGINT; lock2 : LONGINT) : LONGINT;
  1480. FUNCTION SelectInput(fh : LONGINT) : LONGINT;
  1481. FUNCTION SelectOutput(fh : LONGINT) : LONGINT;
  1482. PROCEDURE SendPkt(dp : pDosPacket; port : pMsgPort; replyport : pMsgPort);
  1483. FUNCTION SetArgStr(const string_ : pCHAR) : BOOLEAN;
  1484. FUNCTION SetComment(const name : pCHAR;const comment : pCHAR) : BOOLEAN;
  1485. FUNCTION SetConsoleTask(const task : pMsgPort) : pMsgPort;
  1486. FUNCTION SetCurrentDirName(const name : pCHAR) : BOOLEAN;
  1487. FUNCTION SetFileDate(const name : pCHAR; date : pDateStamp) : BOOLEAN;
  1488. FUNCTION SetFileSize(fh : LONGINT; pos : LONGINT; mode : LONGINT) : BOOLEAN;
  1489. FUNCTION SetFileSysTask(const task : pMsgPort) : pMsgPort;
  1490. FUNCTION SetIoErr(result : LONGINT) : LONGINT;
  1491. FUNCTION SetMode(fh : LONGINT; mode : LONGINT) : BOOLEAN;
  1492. FUNCTION SetOwner(const name : pCHAR; owner_info : LONGINT) : BOOLEAN;
  1493. FUNCTION SetProgramDir(lock : LONGINT) : LONGINT;
  1494. FUNCTION SetProgramName(const name : pCHAR) : BOOLEAN;
  1495. FUNCTION SetPrompt(const name : pCHAR) : BOOLEAN;
  1496. FUNCTION SetProtection(const name : pCHAR; protect : LONGINT) : BOOLEAN;
  1497. FUNCTION SetVar(const name : pCHAR; buffer : pCHAR; size : LONGINT; flags : LONGINT) : BOOLEAN;
  1498. FUNCTION SetVBuf(fh : LONGINT; buff : pCHAR; type_ : LONGINT; size : LONGINT) : BOOLEAN;
  1499. FUNCTION SplitName(const name : pCHAR; seperator : ULONG; buf : pCHAR; oldpos : LONGINT; size : LONGINT) : smallint;
  1500. FUNCTION StartNotify(notify : pNotifyRequest) : BOOLEAN;
  1501. FUNCTION StrToDate(datetime : pDateTime) : BOOLEAN;
  1502. FUNCTION StrToLong(const string_ : pCHAR; VAR value : LONGINT) : LONGINT;
  1503. FUNCTION SystemTagList(const command : pCHAR;const tags : pTagItem) : LONGINT;
  1504. FUNCTION DOSSystem(const command : pCHAR;const tags : pTagItem) : LONGINT;
  1505. FUNCTION UnGetC(fh : LONGINT; character : LONGINT) : LONGINT;
  1506. PROCEDURE UnLoadSeg(seglist : LONGINT);
  1507. PROCEDURE UnLock(lock : LONGINT);
  1508. PROCEDURE UnLockDosList(flags : ULONG);
  1509. FUNCTION UnLockRecord(fh : LONGINT; offset : ULONG; length : ULONG) : BOOLEAN;
  1510. FUNCTION UnLockRecords(recArray : pRecordLock) : BOOLEAN;
  1511. FUNCTION VFPrintf(fh : LONGINT;const format : pCHAR;const argarray : POINTER) : LONGINT;
  1512. PROCEDURE VFWritef(fh : LONGINT;const format : pCHAR;const argarray : pLONGINT);
  1513. FUNCTION VPrintf(const format : pCHAR; const argarray : POINTER) : LONGINT;
  1514. FUNCTION WaitForChar(file_ : LONGINT; timeout : LONGINT) : BOOLEAN;
  1515. FUNCTION WaitPkt : pDosPacket;
  1516. FUNCTION WriteChars(const buf : pCHAR; buflen : ULONG) : LONGINT;
  1517. FUNCTION BADDR(bval :BPTR): POINTER;
  1518. FUNCTION MKBADDR(adr: Pointer): BPTR;
  1519. { overlay function and procedures}
  1520. FUNCTION AddBuffers(const name : string; number : LONGINT) : BOOLEAN;
  1521. FUNCTION AddPart(dirname : string;const filename : pCHAR; size : ULONG) : BOOLEAN;
  1522. FUNCTION AddPart(dirname : pCHAR;const filename : string; size : ULONG) : BOOLEAN;
  1523. FUNCTION AddPart(dirname : string;const filename : string; size : ULONG) : BOOLEAN;
  1524. FUNCTION AssignAdd(const name : string; lock : LONGINT) : BOOLEAN;
  1525. FUNCTION AssignLate(const name : string;const path : pCHAR) : BOOLEAN;
  1526. FUNCTION AssignLate(const name : pChar;const path : string) : BOOLEAN;
  1527. FUNCTION AssignLate(const name : string;const path : string) : BOOLEAN;
  1528. FUNCTION AssignLock(const name : string; lock : LONGINT) : BOOLEAN;
  1529. FUNCTION AssignPath(const name : string; const path : pCHAR) : BOOLEAN;
  1530. FUNCTION AssignPath(const name : pCHAR;const path : string) : BOOLEAN;
  1531. FUNCTION AssignPath(const name : string;const path : string) : BOOLEAN;
  1532. FUNCTION CreateDir(const name : string) : LONGINT;
  1533. FUNCTION CreateProc(const name : string; pri : LONGINT; segList : LONGINT; stackSize : LONGINT) : pMsgPort;
  1534. FUNCTION DeleteFile(const name : string) : BOOLEAN;
  1535. FUNCTION DeleteVar(const name : string; flags : ULONG) : BOOLEAN;
  1536. FUNCTION DeviceProc(const name : string) : pMsgPort;
  1537. FUNCTION DOSOpen(const name : string; accessMode : LONGINT) : LONGINT;
  1538. FUNCTION DOSRename(const oldName : string;const newName : pChar) : boolean;
  1539. FUNCTION DOSRename(const oldName : pCHAR;const newName : string) : Boolean;
  1540. FUNCTION DOSRename(const oldName : string;const newName : string) : Boolean;
  1541. FUNCTION Execute(const string_ : string; file_ : LONGINT; file2 : LONGINT) : BOOLEAN;
  1542. FUNCTION Fault(code : LONGINT; header : string; buffer : pCHAR; len : LONGINT) : BOOLEAN;
  1543. FUNCTION FilePart(const path : string) : pCHAR;
  1544. FUNCTION FindArg(const keyword : string;const arg_template : pCHAR) : LONGINT;
  1545. FUNCTION FindArg(const keyword : pCHAR;const arg_template : string) : LONGINT;
  1546. FUNCTION FindArg(const keyword : string;const arg_template : string) : LONGINT;
  1547. FUNCTION FindDosEntry(const dlist : pDosList;const name : string; flags : ULONG) : pDosList;
  1548. FUNCTION FindSegment(const name : string;const seg : pSegment; system : LONGINT) : pSegment;
  1549. FUNCTION FindVar(const name : string; type_ : ULONG) : pLocalVar;
  1550. FUNCTION Format(const filesystem : string;const volumename : pCHAR; dostype : ULONG) : BOOLEAN;
  1551. FUNCTION Format(const filesystem : pCHAR;const volumename : string; dostype : ULONG) : BOOLEAN;
  1552. FUNCTION Format(const filesystem : string;const volumename : string; dostype : ULONG) : BOOLEAN;
  1553. FUNCTION FPuts(fh : LONGINT;const str : string) : BOOLEAN;
  1554. FUNCTION GetDeviceProc(const name : string; dp : pDevProc) : pDevProc;
  1555. FUNCTION GetVar(const name : string; buffer : pCHAR; size : LONGINT; flags : LONGINT) : LONGINT;
  1556. FUNCTION Inhibit(const name : string; onoff : LONGINT) : BOOLEAN;
  1557. FUNCTION IsFileSystem(const name : string) : BOOLEAN;
  1558. FUNCTION LoadSeg(const name : string) : LONGINT;
  1559. FUNCTION Lock(const name : string; type_ : LONGINT) : LONGINT;
  1560. FUNCTION MakeDosEntry(const name : string; type_ : LONGINT) : pDosList;
  1561. FUNCTION MakeLink(const name : string; dest : LONGINT; soft : LONGINT) : BOOLEAN;
  1562. FUNCTION MatchFirst(const pat : string; anchor : pAnchorPath) : LONGINT;
  1563. FUNCTION MatchPattern(const pat : string; str : pCHAR) : BOOLEAN;
  1564. FUNCTION MatchPattern(const pat : pCHAR; str : string) : BOOLEAN;
  1565. FUNCTION MatchPattern(const pat : string; str : string) : BOOLEAN;
  1566. FUNCTION MatchPatternNoCase(const pat : string; str : pCHAR) : BOOLEAN;
  1567. FUNCTION MatchPatternNoCase(const pat : pCHAR; str : string) : BOOLEAN;
  1568. FUNCTION MatchPatternNoCase(const pat : string; str : string) : BOOLEAN;
  1569. FUNCTION NewLoadSeg(const file_ : string;const tags : pTagItem) : LONGINT;
  1570. FUNCTION NewLoadSegTagList(const file_ : string;const tags : pTagItem) : LONGINT;
  1571. FUNCTION PathPart(const path : string) : pCHAR;
  1572. FUNCTION PrintFault(code : LONGINT;const header : string) : BOOLEAN;
  1573. FUNCTION PutStr(const str : string) : BOOLEAN;
  1574. FUNCTION ReadArgs(const arg_template : string; arra : pLONGINT; args : pRDArgs) : pRDArgs;
  1575. FUNCTION ReadItem(const name : string; maxchars : LONGINT; cSource : pCSource) : LONGINT;
  1576. FUNCTION ReadLink(port : pMsgPort; lock : LONGINT;const path : string; buffer : pCHAR; size : ULONG) : BOOLEAN;
  1577. FUNCTION Relabel(const drive : string;const newname : pCHAR) : BOOLEAN;
  1578. FUNCTION Relabel(const drive : pCHAR;const newname : string) : BOOLEAN;
  1579. FUNCTION Relabel(const drive : string;const newname : string) : BOOLEAN;
  1580. FUNCTION RemAssignList(const name : string; lock : LONGINT) : BOOLEAN;
  1581. FUNCTION RunCommand(seg : LONGINT; stack : LONGINT;const paramptr : string; paramlen : LONGINT) : LONGINT;
  1582. FUNCTION SetArgStr(const string_ : string) : BOOLEAN;
  1583. FUNCTION SetComment(const name : string;const comment : pCHAR) : BOOLEAN;
  1584. FUNCTION SetComment(const name : pCHAR;const comment : string) : BOOLEAN;
  1585. FUNCTION SetComment(const name : string;const comment : string) : BOOLEAN;
  1586. FUNCTION SetCurrentDirName(const name : string) : BOOLEAN;
  1587. FUNCTION SetFileDate(const name : string; date : pDateStamp) : BOOLEAN;
  1588. FUNCTION SetOwner(const name : string; owner_info : LONGINT) : BOOLEAN;
  1589. FUNCTION SetProgramName(const name : string) : BOOLEAN;
  1590. FUNCTION SetPrompt(const name : string) : BOOLEAN;
  1591. FUNCTION SetProtection(const name : string; protect : LONGINT) : BOOLEAN;
  1592. FUNCTION SetVar(const name : string; buffer : pCHAR; size : LONGINT; flags : LONGINT) : BOOLEAN;
  1593. FUNCTION SplitName(const name : string; seperator : ULONG; buf : pCHAR; oldpos : LONGINT; size : LONGINT) : smallint;
  1594. FUNCTION StrToLong(const string_ : string; VAR value : LONGINT) : LONGINT;
  1595. FUNCTION SystemTagList(const command : string;const tags : pTagItem) : LONGINT;
  1596. FUNCTION DOSSystem(const command : string;const tags : pTagItem) : LONGINT;
  1597. IMPLEMENTATION
  1598. uses pastoc;
  1599. FUNCTION BADDR(bval : BPTR): POINTER;
  1600. BEGIN
  1601. BADDR := POINTER( bval shl 2);
  1602. END;
  1603. FUNCTION MKBADDR(adr : POINTER): BPTR;
  1604. BEGIN
  1605. MKBADDR := BPTR( LONGINT(adr) shr 2);
  1606. END;
  1607. PROCEDURE AbortPkt(port : pMsgPort; pkt : pDosPacket);
  1608. BEGIN
  1609. ASM
  1610. MOVE.L A6,-(A7)
  1611. MOVE.L port,D1
  1612. MOVE.L pkt,D2
  1613. MOVEA.L _DOSBase,A6
  1614. JSR -264(A6)
  1615. MOVEA.L (A7)+,A6
  1616. END;
  1617. END;
  1618. FUNCTION AddBuffers(const name : pCHAR; number : LONGINT) : BOOLEAN;
  1619. BEGIN
  1620. ASM
  1621. MOVE.L A6,-(A7)
  1622. MOVE.L name,D1
  1623. MOVE.L number,D2
  1624. MOVEA.L _DOSBase,A6
  1625. JSR -732(A6)
  1626. MOVEA.L (A7)+,A6
  1627. TST.L D0
  1628. BEQ.B @end
  1629. MOVEQ #1,D0
  1630. @end: MOVE.B D0,@RESULT
  1631. END;
  1632. END;
  1633. FUNCTION AddDosEntry(dlist : pDosList) : BOOLEAN;
  1634. BEGIN
  1635. ASM
  1636. MOVE.L A6,-(A7)
  1637. MOVE.L dlist,D1
  1638. MOVEA.L _DOSBase,A6
  1639. JSR -678(A6)
  1640. MOVEA.L (A7)+,A6
  1641. TST.L D0
  1642. BEQ.B @end
  1643. MOVEQ #1,D0
  1644. @end: MOVE.B D0,@RESULT
  1645. END;
  1646. END;
  1647. FUNCTION AddPart(dirname : pCHAR;const filename : pCHAR; size : ULONG) : BOOLEAN;
  1648. BEGIN
  1649. ASM
  1650. MOVE.L A6,-(A7)
  1651. MOVE.L dirname,D1
  1652. MOVE.L filename,D2
  1653. MOVE.L size,D3
  1654. MOVEA.L _DOSBase,A6
  1655. JSR -882(A6)
  1656. MOVEA.L (A7)+,A6
  1657. TST.W D0
  1658. BEQ.B @end
  1659. MOVEQ #1,D0
  1660. @end: MOVE.B D0,@RESULT
  1661. END;
  1662. END;
  1663. FUNCTION AddSegment(const name : pCHAR; seg : LONGINT; system : LONGINT) : BOOLEAN;
  1664. BEGIN
  1665. ASM
  1666. MOVE.L A6,-(A7)
  1667. MOVE.L name,D1
  1668. MOVE.L seg,D2
  1669. MOVE.L system,D3
  1670. MOVEA.L _DOSBase,A6
  1671. JSR -774(A6)
  1672. MOVEA.L (A7)+,A6
  1673. TST.L D0
  1674. BEQ.B @end
  1675. MOVEQ #1,D0
  1676. @end: MOVE.B D0,@RESULT
  1677. END;
  1678. END;
  1679. FUNCTION AllocDosObject(type_ : ULONG;const tags : pTagItem) : POINTER;
  1680. BEGIN
  1681. ASM
  1682. MOVE.L A6,-(A7)
  1683. MOVE.L type_,D1
  1684. MOVE.L tags,D2
  1685. MOVEA.L _DOSBase,A6
  1686. JSR -228(A6)
  1687. MOVEA.L (A7)+,A6
  1688. MOVE.L D0,@RESULT
  1689. END;
  1690. END;
  1691. FUNCTION AllocDosObjectTagList(type_ : ULONG;const tags : pTagItem) : POINTER;
  1692. BEGIN
  1693. ASM
  1694. MOVE.L A6,-(A7)
  1695. MOVE.L type_,D1
  1696. MOVE.L tags,D2
  1697. MOVEA.L _DOSBase,A6
  1698. JSR -228(A6)
  1699. MOVEA.L (A7)+,A6
  1700. MOVE.L D0,@RESULT
  1701. END;
  1702. END;
  1703. FUNCTION AssignAdd(const name : pCHAR; lock : LONGINT) : BOOLEAN;
  1704. BEGIN
  1705. ASM
  1706. MOVE.L A6,-(A7)
  1707. MOVE.L name,D1
  1708. MOVE.L lock,D2
  1709. MOVEA.L _DOSBase,A6
  1710. JSR -630(A6)
  1711. MOVEA.L (A7)+,A6
  1712. TST.W D0
  1713. BEQ.B @end
  1714. MOVEQ #1,D0
  1715. @end: MOVE.B D0,@RESULT
  1716. END;
  1717. END;
  1718. FUNCTION AssignLate(const name : pCHAR;const path : pCHAR) : BOOLEAN;
  1719. BEGIN
  1720. ASM
  1721. MOVE.L A6,-(A7)
  1722. MOVE.L name,D1
  1723. MOVE.L path,D2
  1724. MOVEA.L _DOSBase,A6
  1725. JSR -618(A6)
  1726. MOVEA.L (A7)+,A6
  1727. TST.W D0
  1728. BEQ.B @end
  1729. MOVEQ #1,D0
  1730. @end: MOVE.B D0,@RESULT
  1731. END;
  1732. END;
  1733. FUNCTION AssignLock(const name : pCHAR; lock : LONGINT) : BOOLEAN;
  1734. BEGIN
  1735. ASM
  1736. MOVE.L A6,-(A7)
  1737. MOVE.L name,D1
  1738. MOVE.L lock,D2
  1739. MOVEA.L _DOSBase,A6
  1740. JSR -612(A6)
  1741. MOVEA.L (A7)+,A6
  1742. TST.L D0
  1743. BEQ.B @end
  1744. MOVEQ #1,D0
  1745. @end: MOVE.B D0,@RESULT
  1746. END;
  1747. END;
  1748. FUNCTION AssignPath(const name : pCHAR;const path : pCHAR) : BOOLEAN;
  1749. BEGIN
  1750. ASM
  1751. MOVE.L A6,-(A7)
  1752. MOVE.L name,D1
  1753. MOVE.L path,D2
  1754. MOVEA.L _DOSBase,A6
  1755. JSR -624(A6)
  1756. MOVEA.L (A7)+,A6
  1757. TST.W D0
  1758. BEQ.B @end
  1759. MOVEQ #1,D0
  1760. @end: MOVE.B D0,@RESULT
  1761. END;
  1762. END;
  1763. FUNCTION AttemptLockDosList(flags : ULONG) : pDosList;
  1764. BEGIN
  1765. ASM
  1766. MOVE.L A6,-(A7)
  1767. MOVE.L flags,D1
  1768. MOVEA.L _DOSBase,A6
  1769. JSR -666(A6)
  1770. MOVEA.L (A7)+,A6
  1771. MOVE.L D0,@RESULT
  1772. END;
  1773. END;
  1774. FUNCTION ChangeMode(type_ : LONGINT; fh : LONGINT; newmode : LONGINT) : BOOLEAN;
  1775. BEGIN
  1776. ASM
  1777. MOVE.L A6,-(A7)
  1778. MOVE.L type_,D1
  1779. MOVE.L fh,D2
  1780. MOVE.L newmode,D3
  1781. MOVEA.L _DOSBase,A6
  1782. JSR -450(A6)
  1783. MOVEA.L (A7)+,A6
  1784. TST.L D0
  1785. BEQ.B @end
  1786. MOVEQ #1,D0
  1787. @end: MOVE.B D0,@RESULT
  1788. END;
  1789. END;
  1790. FUNCTION CheckSignal(mask : LONGINT) : LONGINT;
  1791. BEGIN
  1792. ASM
  1793. MOVE.L A6,-(A7)
  1794. MOVE.L mask,D1
  1795. MOVEA.L _DOSBase,A6
  1796. JSR -792(A6)
  1797. MOVEA.L (A7)+,A6
  1798. MOVE.L D0,@RESULT
  1799. END;
  1800. END;
  1801. FUNCTION Cli : pCommandLineInterface;
  1802. BEGIN
  1803. ASM
  1804. MOVE.L A6,-(A7)
  1805. MOVEA.L _DOSBase,A6
  1806. JSR -492(A6)
  1807. MOVEA.L (A7)+,A6
  1808. MOVE.L D0,@RESULT
  1809. END;
  1810. END;
  1811. FUNCTION CliInitNewcli(dp : pDosPacket) : LONGINT;
  1812. BEGIN
  1813. ASM
  1814. MOVE.L A6,-(A7)
  1815. MOVEA.L dp,A0
  1816. MOVEA.L _DOSBase,A6
  1817. JSR -930(A6)
  1818. MOVEA.L (A7)+,A6
  1819. MOVE.L D0,@RESULT
  1820. END;
  1821. END;
  1822. FUNCTION CliInitRun(dp : pDosPacket) : LONGINT;
  1823. BEGIN
  1824. ASM
  1825. MOVE.L A6,-(A7)
  1826. MOVEA.L dp,A0
  1827. MOVEA.L _DOSBase,A6
  1828. JSR -936(A6)
  1829. MOVEA.L (A7)+,A6
  1830. MOVE.L D0,@RESULT
  1831. END;
  1832. END;
  1833. FUNCTION CompareDates(const date1 : pDateStamp;const date2 : pDateStamp) : LONGINT;
  1834. BEGIN
  1835. ASM
  1836. MOVE.L A6,-(A7)
  1837. MOVE.L date1,D1
  1838. MOVE.L date2,D2
  1839. MOVEA.L _DOSBase,A6
  1840. JSR -738(A6)
  1841. MOVEA.L (A7)+,A6
  1842. MOVE.L D0,@RESULT
  1843. END;
  1844. END;
  1845. FUNCTION CreateDir(const name : pCHAR) : LONGINT;
  1846. BEGIN
  1847. ASM
  1848. MOVE.L A6,-(A7)
  1849. MOVE.L name,D1
  1850. MOVEA.L _DOSBase,A6
  1851. JSR -120(A6)
  1852. MOVEA.L (A7)+,A6
  1853. MOVE.L D0,@RESULT
  1854. END;
  1855. END;
  1856. FUNCTION CreateNewProc(const tags : pTagItem) : pProcess;
  1857. BEGIN
  1858. ASM
  1859. MOVE.L A6,-(A7)
  1860. MOVE.L tags,D1
  1861. MOVEA.L _DOSBase,A6
  1862. JSR -498(A6)
  1863. MOVEA.L (A7)+,A6
  1864. MOVE.L D0,@RESULT
  1865. END;
  1866. END;
  1867. FUNCTION CreateNewProcTagList(const tags : pTagItem) : pProcess;
  1868. BEGIN
  1869. ASM
  1870. MOVE.L A6,-(A7)
  1871. MOVE.L tags,D1
  1872. MOVEA.L _DOSBase,A6
  1873. JSR -498(A6)
  1874. MOVEA.L (A7)+,A6
  1875. MOVE.L D0,@RESULT
  1876. END;
  1877. END;
  1878. FUNCTION CreateProc(const name : pCHAR; pri : LONGINT; segList : LONGINT; stackSize : LONGINT) : pMsgPort;
  1879. BEGIN
  1880. ASM
  1881. MOVE.L A6,-(A7)
  1882. MOVE.L name,D1
  1883. MOVE.L pri,D2
  1884. MOVE.L segList,D3
  1885. MOVE.L stackSize,D4
  1886. MOVEA.L _DOSBase,A6
  1887. JSR -138(A6)
  1888. MOVEA.L (A7)+,A6
  1889. MOVE.L D0,@RESULT
  1890. END;
  1891. END;
  1892. FUNCTION CurrentDir(lock : LONGINT) : LONGINT;
  1893. BEGIN
  1894. ASM
  1895. MOVE.L A6,-(A7)
  1896. MOVE.L lock,D1
  1897. MOVEA.L _DOSBase,A6
  1898. JSR -126(A6)
  1899. MOVEA.L (A7)+,A6
  1900. MOVE.L D0,@RESULT
  1901. END;
  1902. END;
  1903. PROCEDURE DateStamp(date : pDateStamp);
  1904. BEGIN
  1905. ASM
  1906. MOVE.L A6,-(A7)
  1907. MOVE.L date,D1
  1908. MOVEA.L _DOSBase,A6
  1909. JSR -192(A6)
  1910. MOVEA.L (A7)+,A6
  1911. END;
  1912. END;
  1913. FUNCTION DateToStr(datetime : pDateTime) : BOOLEAN;
  1914. BEGIN
  1915. ASM
  1916. MOVE.L A6,-(A7)
  1917. MOVE.L datetime,D1
  1918. MOVEA.L _DOSBase,A6
  1919. JSR -744(A6)
  1920. MOVEA.L (A7)+,A6
  1921. TST.L D0
  1922. BEQ.B @end
  1923. MOVEQ #1,D0
  1924. @end: MOVE.B D0,@RESULT
  1925. END;
  1926. END;
  1927. FUNCTION DeleteFile(const name : pCHAR) : BOOLEAN;
  1928. BEGIN
  1929. ASM
  1930. MOVE.L A6,-(A7)
  1931. MOVE.L name,D1
  1932. MOVEA.L _DOSBase,A6
  1933. JSR -072(A6)
  1934. MOVEA.L (A7)+,A6
  1935. TST.L D0
  1936. BEQ.B @end
  1937. MOVEQ #1,D0
  1938. @end: MOVE.B D0,@RESULT
  1939. END;
  1940. END;
  1941. FUNCTION DeleteVar(const name : pCHAR; flags : ULONG) : BOOLEAN;
  1942. BEGIN
  1943. ASM
  1944. MOVE.L A6,-(A7)
  1945. MOVE.L name,D1
  1946. MOVE.L flags,D2
  1947. MOVEA.L _DOSBase,A6
  1948. JSR -912(A6)
  1949. MOVEA.L (A7)+,A6
  1950. TST.L D0
  1951. BEQ.B @end
  1952. MOVEQ #1,D0
  1953. @end: MOVE.B D0,@RESULT
  1954. END;
  1955. END;
  1956. FUNCTION DeviceProc(const name : pCHAR) : pMsgPort;
  1957. BEGIN
  1958. ASM
  1959. MOVE.L A6,-(A7)
  1960. MOVE.L name,D1
  1961. MOVEA.L _DOSBase,A6
  1962. JSR -174(A6)
  1963. MOVEA.L (A7)+,A6
  1964. MOVE.L D0,@RESULT
  1965. END;
  1966. END;
  1967. FUNCTION DoPkt(port : pMsgPort; action : LONGINT; arg1 : LONGINT; arg2 : LONGINT; arg3 : LONGINT; arg4 : LONGINT; arg5 : LONGINT) : LONGINT;
  1968. BEGIN
  1969. ASM
  1970. MOVE.L A6,-(A7)
  1971. MOVE.L port,D1
  1972. MOVE.L action,D2
  1973. MOVE.L arg1,D3
  1974. MOVE.L arg2,D4
  1975. MOVE.L arg3,D5
  1976. MOVE.L arg4,D6
  1977. MOVE.L arg5,D7
  1978. MOVEA.L _DOSBase,A6
  1979. JSR -240(A6)
  1980. MOVEA.L (A7)+,A6
  1981. MOVE.L D0,@RESULT
  1982. END;
  1983. END;
  1984. FUNCTION DoPkt0(port : pMsgPort; action : LONGINT) : LONGINT;
  1985. BEGIN
  1986. ASM
  1987. MOVE.L A6,-(A7)
  1988. MOVE.L port,D1
  1989. MOVE.L action,D2
  1990. MOVEA.L _DOSBase,A6
  1991. JSR -240(A6)
  1992. MOVEA.L (A7)+,A6
  1993. MOVE.L D0,@RESULT
  1994. END;
  1995. END;
  1996. FUNCTION DoPkt1(port : pMsgPort; action : LONGINT; arg1 : LONGINT) : LONGINT;
  1997. BEGIN
  1998. ASM
  1999. MOVE.L A6,-(A7)
  2000. MOVE.L port,D1
  2001. MOVE.L action,D2
  2002. MOVE.L arg1,D3
  2003. MOVEA.L _DOSBase,A6
  2004. JSR -240(A6)
  2005. MOVEA.L (A7)+,A6
  2006. MOVE.L D0,@RESULT
  2007. END;
  2008. END;
  2009. FUNCTION DoPkt2(port : pMsgPort; action : LONGINT; arg1 : LONGINT; arg2 : LONGINT) : LONGINT;
  2010. BEGIN
  2011. ASM
  2012. MOVE.L A6,-(A7)
  2013. MOVE.L port,D1
  2014. MOVE.L action,D2
  2015. MOVE.L arg1,D3
  2016. MOVE.L arg2,D4
  2017. MOVEA.L _DOSBase,A6
  2018. JSR -240(A6)
  2019. MOVEA.L (A7)+,A6
  2020. MOVE.L D0,@RESULT
  2021. END;
  2022. END;
  2023. FUNCTION DoPkt3(port : pMsgPort; action : LONGINT; arg1 : LONGINT; arg2 : LONGINT; arg3 : LONGINT) : LONGINT;
  2024. BEGIN
  2025. ASM
  2026. MOVE.L A6,-(A7)
  2027. MOVE.L port,D1
  2028. MOVE.L action,D2
  2029. MOVE.L arg1,D3
  2030. MOVE.L arg2,D4
  2031. MOVE.L arg3,D5
  2032. MOVEA.L _DOSBase,A6
  2033. JSR -240(A6)
  2034. MOVEA.L (A7)+,A6
  2035. MOVE.L D0,@RESULT
  2036. END;
  2037. END;
  2038. FUNCTION DoPkt4(port : pMsgPort; action : LONGINT; arg1 : LONGINT; arg2 : LONGINT; arg3 : LONGINT; arg4 : LONGINT) : LONGINT;
  2039. BEGIN
  2040. ASM
  2041. MOVE.L A6,-(A7)
  2042. MOVE.L port,D1
  2043. MOVE.L action,D2
  2044. MOVE.L arg1,D3
  2045. MOVE.L arg2,D4
  2046. MOVE.L arg3,D5
  2047. MOVE.L arg4,D6
  2048. MOVEA.L _DOSBase,A6
  2049. JSR -240(A6)
  2050. MOVEA.L (A7)+,A6
  2051. MOVE.L D0,@RESULT
  2052. END;
  2053. END;
  2054. PROCEDURE DOSClose(file_ : LONGINT);
  2055. BEGIN
  2056. ASM
  2057. MOVE.L A6,-(A7)
  2058. MOVE.L file_,D1
  2059. MOVEA.L _DOSBase,A6
  2060. JSR -036(A6)
  2061. MOVEA.L (A7)+,A6
  2062. END;
  2063. END;
  2064. PROCEDURE DOSDelay(timeout : LONGINT);
  2065. BEGIN
  2066. ASM
  2067. MOVE.L A6,-(A7)
  2068. MOVE.L timeout,D1
  2069. MOVEA.L _DOSBase,A6
  2070. JSR -198(A6)
  2071. MOVEA.L (A7)+,A6
  2072. END;
  2073. END;
  2074. PROCEDURE DOSExit(returnCode : LONGINT);
  2075. BEGIN
  2076. ASM
  2077. MOVE.L A6,-(A7)
  2078. MOVE.L returnCode,D1
  2079. MOVEA.L _DOSBase,A6
  2080. JSR -144(A6)
  2081. MOVEA.L (A7)+,A6
  2082. END;
  2083. END;
  2084. FUNCTION DOSFlush(fh : LONGINT) : BOOLEAN;
  2085. BEGIN
  2086. ASM
  2087. MOVE.L A6,-(A7)
  2088. MOVE.L fh,D1
  2089. MOVEA.L _DOSBase,A6
  2090. JSR -360(A6)
  2091. MOVEA.L (A7)+,A6
  2092. TST.L D0
  2093. BEQ.B @end
  2094. MOVEQ #1,D0
  2095. @end: MOVE.B D0,@RESULT
  2096. END;
  2097. END;
  2098. FUNCTION DOSInput : LONGINT;
  2099. BEGIN
  2100. ASM
  2101. MOVE.L A6,-(A7)
  2102. MOVEA.L _DOSBase,A6
  2103. JSR -054(A6)
  2104. MOVEA.L (A7)+,A6
  2105. MOVE.L D0,@RESULT
  2106. END;
  2107. END;
  2108. FUNCTION DOSOpen(const name : pCHAR; accessMode : LONGINT) : LONGINT;
  2109. BEGIN
  2110. ASM
  2111. MOVE.L A6,-(A7)
  2112. MOVE.L name,D1
  2113. MOVE.L accessMode,D2
  2114. MOVEA.L _DOSBase,A6
  2115. JSR -030(A6)
  2116. MOVEA.L (A7)+,A6
  2117. MOVE.L D0,@RESULT
  2118. END;
  2119. END;
  2120. FUNCTION DOSOutput : LONGINT;
  2121. BEGIN
  2122. ASM
  2123. MOVE.L A6,-(A7)
  2124. MOVEA.L _DOSBase,A6
  2125. JSR -060(A6)
  2126. MOVEA.L (A7)+,A6
  2127. MOVE.L D0,@RESULT
  2128. END;
  2129. END;
  2130. FUNCTION DOSRead(file_ : LONGINT; buffer : POINTER; length : LONGINT) : LONGINT;
  2131. BEGIN
  2132. ASM
  2133. MOVE.L A6,-(A7)
  2134. MOVE.L file_,D1
  2135. MOVE.L buffer,D2
  2136. MOVE.L length,D3
  2137. MOVEA.L _DOSBase,A6
  2138. JSR -042(A6)
  2139. MOVEA.L (A7)+,A6
  2140. MOVE.L D0,@RESULT
  2141. END;
  2142. END;
  2143. FUNCTION DOSRename(const oldName : pCHAR;const newName : pCHAR) : Boolean;
  2144. BEGIN
  2145. ASM
  2146. MOVE.L A6,-(A7)
  2147. MOVE.L oldName,D1
  2148. MOVE.L newName,D2
  2149. MOVEA.L _DOSBase,A6
  2150. JSR -078(A6)
  2151. MOVEA.L (A7)+,A6
  2152. TST.L D0
  2153. BEQ.B @end
  2154. MOVEQ #1,D0
  2155. @end: MOVE.B D0,@RESULT
  2156. END;
  2157. END;
  2158. FUNCTION DOSSeek(file_ : LONGINT; position : LONGINT; offset : LONGINT) : LONGINT;
  2159. BEGIN
  2160. ASM
  2161. MOVE.L A6,-(A7)
  2162. MOVE.L file_,D1
  2163. MOVE.L position,D2
  2164. MOVE.L offset,D3
  2165. MOVEA.L _DOSBase,A6
  2166. JSR -066(A6)
  2167. MOVEA.L (A7)+,A6
  2168. MOVE.L D0,@RESULT
  2169. END;
  2170. END;
  2171. FUNCTION DOSWrite(file_ : LONGINT; buffer : POINTER; length : LONGINT) : LONGINT;
  2172. BEGIN
  2173. ASM
  2174. MOVE.L A6,-(A7)
  2175. MOVE.L file_,D1
  2176. MOVE.L buffer,D2
  2177. MOVE.L length,D3
  2178. MOVEA.L _DOSBase,A6
  2179. JSR -048(A6)
  2180. MOVEA.L (A7)+,A6
  2181. MOVE.L D0,@RESULT
  2182. END;
  2183. END;
  2184. FUNCTION DupLock(lock : LONGINT) : LONGINT;
  2185. BEGIN
  2186. ASM
  2187. MOVE.L A6,-(A7)
  2188. MOVE.L lock,D1
  2189. MOVEA.L _DOSBase,A6
  2190. JSR -096(A6)
  2191. MOVEA.L (A7)+,A6
  2192. MOVE.L D0,@RESULT
  2193. END;
  2194. END;
  2195. FUNCTION DupLockFromFH(fh : LONGINT) : LONGINT;
  2196. BEGIN
  2197. ASM
  2198. MOVE.L A6,-(A7)
  2199. MOVE.L fh,D1
  2200. MOVEA.L _DOSBase,A6
  2201. JSR -372(A6)
  2202. MOVEA.L (A7)+,A6
  2203. MOVE.L D0,@RESULT
  2204. END;
  2205. END;
  2206. PROCEDURE EndNotify(notify : pNotifyRequest);
  2207. BEGIN
  2208. ASM
  2209. MOVE.L A6,-(A7)
  2210. MOVE.L notify,D1
  2211. MOVEA.L _DOSBase,A6
  2212. JSR -894(A6)
  2213. MOVEA.L (A7)+,A6
  2214. END;
  2215. END;
  2216. FUNCTION ErrorReport(code : LONGINT; type_ : LONGINT; arg1 : ULONG; device : pMsgPort) : BOOLEAN;
  2217. BEGIN
  2218. ASM
  2219. MOVE.L A6,-(A7)
  2220. MOVE.L code,D1
  2221. MOVE.L type_,D2
  2222. MOVE.L arg1,D3
  2223. MOVE.L device,D4
  2224. MOVEA.L _DOSBase,A6
  2225. JSR -480(A6)
  2226. MOVEA.L (A7)+,A6
  2227. TST.L D0
  2228. BEQ.B @end
  2229. MOVEQ #1,D0
  2230. @end: MOVE.B D0,@RESULT
  2231. END;
  2232. END;
  2233. FUNCTION ExAll(lock : LONGINT; buffer : pExAllData; size : LONGINT; data : LONGINT; control : pExAllControl) : BOOLEAN;
  2234. BEGIN
  2235. ASM
  2236. MOVE.L A6,-(A7)
  2237. MOVE.L lock,D1
  2238. MOVE.L buffer,D2
  2239. MOVE.L size,D3
  2240. MOVE.L data,D4
  2241. MOVE.L control,D5
  2242. MOVEA.L _DOSBase,A6
  2243. JSR -432(A6)
  2244. MOVEA.L (A7)+,A6
  2245. TST.L D0
  2246. BEQ.B @end
  2247. MOVEQ #1,D0
  2248. @end: MOVE.B D0,@RESULT
  2249. END;
  2250. END;
  2251. PROCEDURE ExAllEnd(lock : LONGINT; buffer : pExAllData; size : LONGINT; data : LONGINT; control : pExAllControl);
  2252. BEGIN
  2253. ASM
  2254. MOVE.L A6,-(A7)
  2255. MOVE.L lock,D1
  2256. MOVE.L buffer,D2
  2257. MOVE.L size,D3
  2258. MOVE.L data,D4
  2259. MOVE.L control,D5
  2260. MOVEA.L _DOSBase,A6
  2261. JSR -990(A6)
  2262. MOVEA.L (A7)+,A6
  2263. END;
  2264. END;
  2265. FUNCTION Examine(lock : LONGINT; fileInfoBlock : pFileInfoBlock) : BOOLEAN;
  2266. BEGIN
  2267. ASM
  2268. MOVE.L A6,-(A7)
  2269. MOVE.L lock,D1
  2270. MOVE.L fileInfoBlock,D2
  2271. MOVEA.L _DOSBase,A6
  2272. JSR -102(A6)
  2273. MOVEA.L (A7)+,A6
  2274. TST.L D0
  2275. BEQ.B @end
  2276. MOVEQ #1,D0
  2277. @end: MOVE.B D0,@RESULT
  2278. END;
  2279. END;
  2280. FUNCTION ExamineFH(fh : LONGINT; fib : pFileInfoBlock) : BOOLEAN;
  2281. BEGIN
  2282. ASM
  2283. MOVE.L A6,-(A7)
  2284. MOVE.L fh,D1
  2285. MOVE.L fib,D2
  2286. MOVEA.L _DOSBase,A6
  2287. JSR -390(A6)
  2288. MOVEA.L (A7)+,A6
  2289. TST.W D0
  2290. BEQ.B @end
  2291. MOVEQ #1,D0
  2292. @end: MOVE.B D0,@RESULT
  2293. END;
  2294. END;
  2295. FUNCTION Execute(const string_ : pCHAR; file_ : LONGINT; file2 : LONGINT) : BOOLEAN;
  2296. BEGIN
  2297. ASM
  2298. MOVE.L A6,-(A7)
  2299. MOVE.L string_,D1
  2300. MOVE.L file_,D2
  2301. MOVE.L file2,D3
  2302. MOVEA.L _DOSBase,A6
  2303. JSR -222(A6)
  2304. MOVEA.L (A7)+,A6
  2305. TST.L D0
  2306. BEQ.B @end
  2307. MOVEQ #1,D0
  2308. @end: MOVE.B D0,@RESULT
  2309. END;
  2310. END;
  2311. FUNCTION ExNext(lock : LONGINT; fileInfoBlock : pFileInfoBlock) : BOOLEAN;
  2312. BEGIN
  2313. ASM
  2314. MOVE.L A6,-(A7)
  2315. MOVE.L lock,D1
  2316. MOVE.L fileInfoBlock,D2
  2317. MOVEA.L _DOSBase,A6
  2318. JSR -108(A6)
  2319. MOVEA.L (A7)+,A6
  2320. TST.L D0
  2321. BEQ.B @end
  2322. MOVEQ #1,D0
  2323. @end: MOVE.B D0,@RESULT
  2324. END;
  2325. END;
  2326. FUNCTION Fault(code : LONGINT; header : pCHAR; buffer : pCHAR; len : LONGINT) : BOOLEAN;
  2327. BEGIN
  2328. ASM
  2329. MOVE.L A6,-(A7)
  2330. MOVE.L code,D1
  2331. MOVE.L header,D2
  2332. MOVE.L buffer,D3
  2333. MOVE.L len,D4
  2334. MOVEA.L _DOSBase,A6
  2335. JSR -468(A6)
  2336. MOVEA.L (A7)+,A6
  2337. TST.W D0
  2338. BEQ.B @end
  2339. MOVEQ #1,D0
  2340. @end: MOVE.B D0,@RESULT
  2341. END;
  2342. END;
  2343. FUNCTION FGetC(fh : LONGINT) : LONGINT;
  2344. BEGIN
  2345. ASM
  2346. MOVE.L A6,-(A7)
  2347. MOVE.L fh,D1
  2348. MOVEA.L _DOSBase,A6
  2349. JSR -306(A6)
  2350. MOVEA.L (A7)+,A6
  2351. MOVE.L D0,@RESULT
  2352. END;
  2353. END;
  2354. FUNCTION FGets(fh : LONGINT; buf : pCHAR; buflen : ULONG) : pCHAR;
  2355. BEGIN
  2356. ASM
  2357. MOVE.L A6,-(A7)
  2358. MOVE.L fh,D1
  2359. MOVE.L buf,D2
  2360. MOVE.L buflen,D3
  2361. MOVEA.L _DOSBase,A6
  2362. JSR -336(A6)
  2363. MOVEA.L (A7)+,A6
  2364. MOVE.L D0,@RESULT
  2365. END;
  2366. END;
  2367. FUNCTION FilePart(const path : pCHAR) : pCHAR;
  2368. BEGIN
  2369. ASM
  2370. MOVE.L A6,-(A7)
  2371. MOVE.L path,D1
  2372. MOVEA.L _DOSBase,A6
  2373. JSR -870(A6)
  2374. MOVEA.L (A7)+,A6
  2375. MOVE.L D0,@RESULT
  2376. END;
  2377. END;
  2378. FUNCTION FindArg(const keyword : pCHAR;const arg_template : pCHAR) : LONGINT;
  2379. BEGIN
  2380. ASM
  2381. MOVE.L A6,-(A7)
  2382. MOVE.L keyword,D1
  2383. MOVE.L arg_template,D2
  2384. MOVEA.L _DOSBase,A6
  2385. JSR -804(A6)
  2386. MOVEA.L (A7)+,A6
  2387. MOVE.L D0,@RESULT
  2388. END;
  2389. END;
  2390. FUNCTION FindCliProc(num : ULONG) : pProcess;
  2391. BEGIN
  2392. ASM
  2393. MOVE.L A6,-(A7)
  2394. MOVE.L num,D1
  2395. MOVEA.L _DOSBase,A6
  2396. JSR -546(A6)
  2397. MOVEA.L (A7)+,A6
  2398. MOVE.L D0,@RESULT
  2399. END;
  2400. END;
  2401. FUNCTION FindDosEntry(const dlist : pDosList;const name : pCHAR; flags : ULONG) : pDosList;
  2402. BEGIN
  2403. ASM
  2404. MOVE.L A6,-(A7)
  2405. MOVE.L dlist,D1
  2406. MOVE.L name,D2
  2407. MOVE.L flags,D3
  2408. MOVEA.L _DOSBase,A6
  2409. JSR -684(A6)
  2410. MOVEA.L (A7)+,A6
  2411. MOVE.L D0,@RESULT
  2412. END;
  2413. END;
  2414. FUNCTION FindSegment(const name : pCHAR;const seg : pSegment; system : LONGINT) : pSegment;
  2415. BEGIN
  2416. ASM
  2417. MOVE.L A6,-(A7)
  2418. MOVE.L name,D1
  2419. MOVE.L seg,D2
  2420. MOVE.L system,D3
  2421. MOVEA.L _DOSBase,A6
  2422. JSR -780(A6)
  2423. MOVEA.L (A7)+,A6
  2424. MOVE.L D0,@RESULT
  2425. END;
  2426. END;
  2427. FUNCTION FindVar(const name : pCHAR; type_ : ULONG) : pLocalVar;
  2428. BEGIN
  2429. ASM
  2430. MOVE.L A6,-(A7)
  2431. MOVE.L name,D1
  2432. MOVE.L type_,D2
  2433. MOVEA.L _DOSBase,A6
  2434. JSR -918(A6)
  2435. MOVEA.L (A7)+,A6
  2436. MOVE.L D0,@RESULT
  2437. END;
  2438. END;
  2439. FUNCTION Format(const filesystem : pCHAR;const volumename : pCHAR; dostype : ULONG) : BOOLEAN;
  2440. BEGIN
  2441. ASM
  2442. MOVE.L A6,-(A7)
  2443. MOVE.L filesystem,D1
  2444. MOVE.L volumename,D2
  2445. MOVE.L dostype,D3
  2446. MOVEA.L _DOSBase,A6
  2447. JSR -714(A6)
  2448. MOVEA.L (A7)+,A6
  2449. TST.W D0
  2450. BEQ.B @end
  2451. MOVEQ #1,D0
  2452. @end: MOVE.B D0,@RESULT
  2453. END;
  2454. END;
  2455. FUNCTION FPutC(fh : LONGINT; ch : LONGINT) : LONGINT;
  2456. BEGIN
  2457. ASM
  2458. MOVE.L A6,-(A7)
  2459. MOVE.L fh,D1
  2460. MOVE.L ch,D2
  2461. MOVEA.L _DOSBase,A6
  2462. JSR -312(A6)
  2463. MOVEA.L (A7)+,A6
  2464. MOVE.L D0,@RESULT
  2465. END;
  2466. END;
  2467. FUNCTION FPuts(fh : LONGINT;const str : pCHAR) : BOOLEAN;
  2468. BEGIN
  2469. ASM
  2470. MOVE.L A6,-(A7)
  2471. MOVE.L fh,D1
  2472. MOVE.L str,D2
  2473. MOVEA.L _DOSBase,A6
  2474. JSR -342(A6)
  2475. MOVEA.L (A7)+,A6
  2476. TST.L D0
  2477. BEQ.B @end
  2478. MOVEQ #1,D0
  2479. @end: MOVE.B D0,@RESULT
  2480. END;
  2481. END;
  2482. FUNCTION FRead(fh : LONGINT; block : POINTER; blocklen : ULONG; number : ULONG) : LONGINT;
  2483. BEGIN
  2484. ASM
  2485. MOVE.L A6,-(A7)
  2486. MOVE.L fh,D1
  2487. MOVE.L block,D2
  2488. MOVE.L blocklen,D3
  2489. MOVE.L number,D4
  2490. MOVEA.L _DOSBase,A6
  2491. JSR -324(A6)
  2492. MOVEA.L (A7)+,A6
  2493. MOVE.L D0,@RESULT
  2494. END;
  2495. END;
  2496. PROCEDURE FreeArgs(args : pRDArgs);
  2497. BEGIN
  2498. ASM
  2499. MOVE.L A6,-(A7)
  2500. MOVE.L args,D1
  2501. MOVEA.L _DOSBase,A6
  2502. JSR -858(A6)
  2503. MOVEA.L (A7)+,A6
  2504. END;
  2505. END;
  2506. PROCEDURE FreeDeviceProc(dp : pDevProc);
  2507. BEGIN
  2508. ASM
  2509. MOVE.L A6,-(A7)
  2510. MOVE.L dp,D1
  2511. MOVEA.L _DOSBase,A6
  2512. JSR -648(A6)
  2513. MOVEA.L (A7)+,A6
  2514. END;
  2515. END;
  2516. PROCEDURE FreeDosEntry(dlist : pDosList);
  2517. BEGIN
  2518. ASM
  2519. MOVE.L A6,-(A7)
  2520. MOVE.L dlist,D1
  2521. MOVEA.L _DOSBase,A6
  2522. JSR -702(A6)
  2523. MOVEA.L (A7)+,A6
  2524. END;
  2525. END;
  2526. PROCEDURE FreeDosObject(type_ : ULONG; ptr : POINTER);
  2527. BEGIN
  2528. ASM
  2529. MOVE.L A6,-(A7)
  2530. MOVE.L type_,D1
  2531. MOVE.L ptr,D2
  2532. MOVEA.L _DOSBase,A6
  2533. JSR -234(A6)
  2534. MOVEA.L (A7)+,A6
  2535. END;
  2536. END;
  2537. FUNCTION FWrite(fh : LONGINT; block : POINTER; blocklen : ULONG; number : ULONG) : LONGINT;
  2538. BEGIN
  2539. ASM
  2540. MOVE.L A6,-(A7)
  2541. MOVE.L fh,D1
  2542. MOVE.L block,D2
  2543. MOVE.L blocklen,D3
  2544. MOVE.L number,D4
  2545. MOVEA.L _DOSBase,A6
  2546. JSR -330(A6)
  2547. MOVEA.L (A7)+,A6
  2548. MOVE.L D0,@RESULT
  2549. END;
  2550. END;
  2551. FUNCTION GetArgStr : pCHAR;
  2552. BEGIN
  2553. ASM
  2554. MOVE.L A6,-(A7)
  2555. MOVEA.L _DOSBase,A6
  2556. JSR -534(A6)
  2557. MOVEA.L (A7)+,A6
  2558. MOVE.L D0,@RESULT
  2559. END;
  2560. END;
  2561. FUNCTION GetConsoleTask : pMsgPort;
  2562. BEGIN
  2563. ASM
  2564. MOVE.L A6,-(A7)
  2565. MOVEA.L _DOSBase,A6
  2566. JSR -510(A6)
  2567. MOVEA.L (A7)+,A6
  2568. MOVE.L D0,@RESULT
  2569. END;
  2570. END;
  2571. FUNCTION GetCurrentDirName(buf : pCHAR; len : LONGINT) : BOOLEAN;
  2572. BEGIN
  2573. ASM
  2574. MOVE.L A6,-(A7)
  2575. MOVE.L buf,D1
  2576. MOVE.L len,D2
  2577. MOVEA.L _DOSBase,A6
  2578. JSR -564(A6)
  2579. MOVEA.L (A7)+,A6
  2580. TST.W D0
  2581. BEQ.B @end
  2582. MOVEQ #1,D0
  2583. @end: MOVE.B D0,@RESULT
  2584. END;
  2585. END;
  2586. FUNCTION GetDeviceProc(const name : pCHAR; dp : pDevProc) : pDevProc;
  2587. BEGIN
  2588. ASM
  2589. MOVE.L A6,-(A7)
  2590. MOVE.L name,D1
  2591. MOVE.L dp,D2
  2592. MOVEA.L _DOSBase,A6
  2593. JSR -642(A6)
  2594. MOVEA.L (A7)+,A6
  2595. MOVE.L D0,@RESULT
  2596. END;
  2597. END;
  2598. FUNCTION GetFileSysTask : pMsgPort;
  2599. BEGIN
  2600. ASM
  2601. MOVE.L A6,-(A7)
  2602. MOVEA.L _DOSBase,A6
  2603. JSR -522(A6)
  2604. MOVEA.L (A7)+,A6
  2605. MOVE.L D0,@RESULT
  2606. END;
  2607. END;
  2608. FUNCTION GetProgramDir : LONGINT;
  2609. BEGIN
  2610. ASM
  2611. MOVE.L A6,-(A7)
  2612. MOVEA.L _DOSBase,A6
  2613. JSR -600(A6)
  2614. MOVEA.L (A7)+,A6
  2615. MOVE.L D0,@RESULT
  2616. END;
  2617. END;
  2618. FUNCTION GetProgramName(buf : pCHAR; len : LONGINT) : BOOLEAN;
  2619. BEGIN
  2620. ASM
  2621. MOVE.L A6,-(A7)
  2622. MOVE.L buf,D1
  2623. MOVE.L len,D2
  2624. MOVEA.L _DOSBase,A6
  2625. JSR -576(A6)
  2626. MOVEA.L (A7)+,A6
  2627. TST.W D0
  2628. BEQ.B @end
  2629. MOVEQ #1,D0
  2630. @end: MOVE.B D0,@RESULT
  2631. END;
  2632. END;
  2633. FUNCTION GetPrompt(buf : pCHAR; len : LONGINT) : BOOLEAN;
  2634. BEGIN
  2635. ASM
  2636. MOVE.L A6,-(A7)
  2637. MOVE.L buf,D1
  2638. MOVE.L len,D2
  2639. MOVEA.L _DOSBase,A6
  2640. JSR -588(A6)
  2641. MOVEA.L (A7)+,A6
  2642. TST.W D0
  2643. BEQ.B @end
  2644. MOVEQ #1,D0
  2645. @end: MOVE.B D0,@RESULT
  2646. END;
  2647. END;
  2648. FUNCTION GetVar(const name : pCHAR; buffer : pCHAR; size : LONGINT; flags : LONGINT) : LONGINT;
  2649. BEGIN
  2650. ASM
  2651. MOVE.L A6,-(A7)
  2652. MOVE.L name,D1
  2653. MOVE.L buffer,D2
  2654. MOVE.L size,D3
  2655. MOVE.L flags,D4
  2656. MOVEA.L _DOSBase,A6
  2657. JSR -906(A6)
  2658. MOVEA.L (A7)+,A6
  2659. MOVE.L D0,@RESULT
  2660. END;
  2661. END;
  2662. FUNCTION Info(lock : LONGINT; parameterBlock : pInfoData) : BOOLEAN;
  2663. BEGIN
  2664. ASM
  2665. MOVE.L A6,-(A7)
  2666. MOVE.L lock,D1
  2667. MOVE.L parameterBlock,D2
  2668. MOVEA.L _DOSBase,A6
  2669. JSR -114(A6)
  2670. MOVEA.L (A7)+,A6
  2671. TST.L D0
  2672. BEQ.B @end
  2673. MOVEQ #1,D0
  2674. @end: MOVE.B D0,@RESULT
  2675. END;
  2676. END;
  2677. FUNCTION Inhibit(const name : pCHAR; onoff : LONGINT) : BOOLEAN;
  2678. BEGIN
  2679. ASM
  2680. MOVE.L A6,-(A7)
  2681. MOVE.L name,D1
  2682. MOVE.L onoff,D2
  2683. MOVEA.L _DOSBase,A6
  2684. JSR -726(A6)
  2685. MOVEA.L (A7)+,A6
  2686. TST.L D0
  2687. BEQ.B @end
  2688. MOVEQ #1,D0
  2689. @end: MOVE.B D0,@RESULT
  2690. END;
  2691. END;
  2692. FUNCTION InternalLoadSeg(fh : LONGINT; table : LONGINT;const funcarray : pLONGINT; VAR stack : LONGINT) : LONGINT;
  2693. BEGIN
  2694. ASM
  2695. MOVE.L A6,-(A7)
  2696. MOVE.L fh,D0
  2697. MOVEA.L table,A0
  2698. MOVEA.L funcarray,A1
  2699. MOVEA.L stack,A2
  2700. MOVEA.L _DOSBase,A6
  2701. JSR -756(A6)
  2702. MOVEA.L (A7)+,A6
  2703. MOVE.L D0,@RESULT
  2704. END;
  2705. END;
  2706. FUNCTION InternalUnLoadSeg(seglist : LONGINT; freefunc : tPROCEDURE) : BOOLEAN;
  2707. BEGIN
  2708. ASM
  2709. MOVE.L A6,-(A7)
  2710. MOVE.L seglist,D1
  2711. MOVEA.L freefunc,A1
  2712. MOVEA.L _DOSBase,A6
  2713. JSR -762(A6)
  2714. MOVEA.L (A7)+,A6
  2715. TST.W D0
  2716. BEQ.B @end
  2717. MOVEQ #1,D0
  2718. @end: MOVE.B D0,@RESULT
  2719. END;
  2720. END;
  2721. FUNCTION IoErr : LONGINT;
  2722. BEGIN
  2723. ASM
  2724. MOVE.L A6,-(A7)
  2725. MOVEA.L _DOSBase,A6
  2726. JSR -132(A6)
  2727. MOVEA.L (A7)+,A6
  2728. MOVE.L D0,@RESULT
  2729. END;
  2730. END;
  2731. FUNCTION IsFileSystem(const name : pCHAR) : BOOLEAN;
  2732. BEGIN
  2733. ASM
  2734. MOVE.L A6,-(A7)
  2735. MOVE.L name,D1
  2736. MOVEA.L _DOSBase,A6
  2737. JSR -708(A6)
  2738. MOVEA.L (A7)+,A6
  2739. TST.W D0
  2740. BEQ.B @end
  2741. MOVEQ #1,D0
  2742. @end: MOVE.B D0,@RESULT
  2743. END;
  2744. END;
  2745. FUNCTION IsInteractive(file_ : LONGINT) : BOOLEAN;
  2746. BEGIN
  2747. ASM
  2748. MOVE.L A6,-(A7)
  2749. MOVE.L file_,D1
  2750. MOVEA.L _DOSBase,A6
  2751. JSR -216(A6)
  2752. MOVEA.L (A7)+,A6
  2753. TST.L D0
  2754. BEQ.B @end
  2755. MOVEQ #1,D0
  2756. @end: MOVE.B D0,@RESULT
  2757. END;
  2758. END;
  2759. FUNCTION LoadSeg(const name : pCHAR) : LONGINT;
  2760. BEGIN
  2761. ASM
  2762. MOVE.L A6,-(A7)
  2763. MOVE.L name,D1
  2764. MOVEA.L _DOSBase,A6
  2765. JSR -150(A6)
  2766. MOVEA.L (A7)+,A6
  2767. MOVE.L D0,@RESULT
  2768. END;
  2769. END;
  2770. FUNCTION Lock(const name : pCHAR; type_ : LONGINT) : LONGINT;
  2771. BEGIN
  2772. ASM
  2773. MOVE.L A6,-(A7)
  2774. MOVE.L name,D1
  2775. MOVE.L type_,D2
  2776. MOVEA.L _DOSBase,A6
  2777. JSR -084(A6)
  2778. MOVEA.L (A7)+,A6
  2779. MOVE.L D0,@RESULT
  2780. END;
  2781. END;
  2782. FUNCTION LockDosList(flags : ULONG) : pDosList;
  2783. BEGIN
  2784. ASM
  2785. MOVE.L A6,-(A7)
  2786. MOVE.L flags,D1
  2787. MOVEA.L _DOSBase,A6
  2788. JSR -654(A6)
  2789. MOVEA.L (A7)+,A6
  2790. MOVE.L D0,@RESULT
  2791. END;
  2792. END;
  2793. FUNCTION LockRecord(fh : LONGINT; offset : ULONG; length : ULONG; mode : ULONG; timeout : ULONG) : BOOLEAN;
  2794. BEGIN
  2795. ASM
  2796. MOVE.L A6,-(A7)
  2797. MOVE.L fh,D1
  2798. MOVE.L offset,D2
  2799. MOVE.L length,D3
  2800. MOVE.L mode,D4
  2801. MOVE.L timeout,D5
  2802. MOVEA.L _DOSBase,A6
  2803. JSR -270(A6)
  2804. MOVEA.L (A7)+,A6
  2805. TST.W D0
  2806. BEQ.B @end
  2807. MOVEQ #1,D0
  2808. @end: MOVE.B D0,@RESULT
  2809. END;
  2810. END;
  2811. FUNCTION LockRecords(recArray : pRecordLock; timeout : ULONG) : BOOLEAN;
  2812. BEGIN
  2813. ASM
  2814. MOVE.L A6,-(A7)
  2815. MOVE.L recArray,D1
  2816. MOVE.L timeout,D2
  2817. MOVEA.L _DOSBase,A6
  2818. JSR -276(A6)
  2819. MOVEA.L (A7)+,A6
  2820. TST.W D0
  2821. BEQ.B @end
  2822. MOVEQ #1,D0
  2823. @end: MOVE.B D0,@RESULT
  2824. END;
  2825. END;
  2826. FUNCTION MakeDosEntry(const name : pCHAR; type_ : LONGINT) : pDosList;
  2827. BEGIN
  2828. ASM
  2829. MOVE.L A6,-(A7)
  2830. MOVE.L name,D1
  2831. MOVE.L type_,D2
  2832. MOVEA.L _DOSBase,A6
  2833. JSR -696(A6)
  2834. MOVEA.L (A7)+,A6
  2835. MOVE.L D0,@RESULT
  2836. END;
  2837. END;
  2838. FUNCTION MakeLink(const name : pCHAR; dest : LONGINT; soft : LONGINT) : BOOLEAN;
  2839. BEGIN
  2840. ASM
  2841. MOVE.L A6,-(A7)
  2842. MOVE.L name,D1
  2843. MOVE.L dest,D2
  2844. MOVE.L soft,D3
  2845. MOVEA.L _DOSBase,A6
  2846. JSR -444(A6)
  2847. MOVEA.L (A7)+,A6
  2848. TST.L D0
  2849. BEQ.B @end
  2850. MOVEQ #1,D0
  2851. @end: MOVE.B D0,@RESULT
  2852. END;
  2853. END;
  2854. PROCEDURE MatchEnd(anchor : pAnchorPath);
  2855. BEGIN
  2856. ASM
  2857. MOVE.L A6,-(A7)
  2858. MOVE.L anchor,D1
  2859. MOVEA.L _DOSBase,A6
  2860. JSR -834(A6)
  2861. MOVEA.L (A7)+,A6
  2862. END;
  2863. END;
  2864. FUNCTION MatchFirst(const pat : pCHAR; anchor : pAnchorPath) : LONGINT;
  2865. BEGIN
  2866. ASM
  2867. MOVE.L A6,-(A7)
  2868. MOVE.L pat,D1
  2869. MOVE.L anchor,D2
  2870. MOVEA.L _DOSBase,A6
  2871. JSR -822(A6)
  2872. MOVEA.L (A7)+,A6
  2873. MOVE.L D0,@RESULT
  2874. END;
  2875. END;
  2876. FUNCTION MatchNext(anchor : pAnchorPath) : LONGINT;
  2877. BEGIN
  2878. ASM
  2879. MOVE.L A6,-(A7)
  2880. MOVE.L anchor,D1
  2881. MOVEA.L _DOSBase,A6
  2882. JSR -828(A6)
  2883. MOVEA.L (A7)+,A6
  2884. MOVE.L D0,@RESULT
  2885. END;
  2886. END;
  2887. FUNCTION MatchPattern(const pat : pCHAR; str : pCHAR) : BOOLEAN;
  2888. BEGIN
  2889. ASM
  2890. MOVE.L A6,-(A7)
  2891. MOVE.L pat,D1
  2892. MOVE.L str,D2
  2893. MOVEA.L _DOSBase,A6
  2894. JSR -846(A6)
  2895. MOVEA.L (A7)+,A6
  2896. TST.W D0
  2897. BEQ.B @end
  2898. MOVEQ #1,D0
  2899. @end: MOVE.B D0,@RESULT
  2900. END;
  2901. END;
  2902. FUNCTION MatchPatternNoCase(const pat : pCHAR; str : pCHAR) : BOOLEAN;
  2903. BEGIN
  2904. ASM
  2905. MOVE.L A6,-(A7)
  2906. MOVE.L pat,D1
  2907. MOVE.L str,D2
  2908. MOVEA.L _DOSBase,A6
  2909. JSR -972(A6)
  2910. MOVEA.L (A7)+,A6
  2911. TST.W D0
  2912. BEQ.B @end
  2913. MOVEQ #1,D0
  2914. @end: MOVE.B D0,@RESULT
  2915. END;
  2916. END;
  2917. FUNCTION MaxCli : ULONG;
  2918. BEGIN
  2919. ASM
  2920. MOVE.L A6,-(A7)
  2921. MOVEA.L _DOSBase,A6
  2922. JSR -552(A6)
  2923. MOVEA.L (A7)+,A6
  2924. MOVE.L D0,@RESULT
  2925. END;
  2926. END;
  2927. FUNCTION NameFromFH(fh : LONGINT; buffer : pCHAR; len : LONGINT) : BOOLEAN;
  2928. BEGIN
  2929. ASM
  2930. MOVE.L A6,-(A7)
  2931. MOVE.L fh,D1
  2932. MOVE.L buffer,D2
  2933. MOVE.L len,D3
  2934. MOVEA.L _DOSBase,A6
  2935. JSR -408(A6)
  2936. MOVEA.L (A7)+,A6
  2937. TST.L D0
  2938. BEQ.B @end
  2939. MOVEQ #1,D0
  2940. @end: MOVE.B D0,@RESULT
  2941. END;
  2942. END;
  2943. FUNCTION NameFromLock(lock : LONGINT; buffer : pCHAR; len : LONGINT) : BOOLEAN;
  2944. BEGIN
  2945. ASM
  2946. MOVE.L A6,-(A7)
  2947. MOVE.L lock,D1
  2948. MOVE.L buffer,D2
  2949. MOVE.L len,D3
  2950. MOVEA.L _DOSBase,A6
  2951. JSR -402(A6)
  2952. MOVEA.L (A7)+,A6
  2953. TST.L D0
  2954. BEQ.B @end
  2955. MOVEQ #1,D0
  2956. @end: MOVE.B D0,@RESULT
  2957. END;
  2958. END;
  2959. FUNCTION NewLoadSeg(const file_ : pCHAR;const tags : pTagItem) : LONGINT;
  2960. BEGIN
  2961. ASM
  2962. MOVE.L A6,-(A7)
  2963. MOVE.L file_,D1
  2964. MOVE.L tags,D2
  2965. MOVEA.L _DOSBase,A6
  2966. JSR -768(A6)
  2967. MOVEA.L (A7)+,A6
  2968. MOVE.L D0,@RESULT
  2969. END;
  2970. END;
  2971. FUNCTION NewLoadSegTagList(const file_ : pCHAR;const tags : pTagItem) : LONGINT;
  2972. BEGIN
  2973. ASM
  2974. MOVE.L A6,-(A7)
  2975. MOVE.L file_,D1
  2976. MOVE.L tags,D2
  2977. MOVEA.L _DOSBase,A6
  2978. JSR -768(A6)
  2979. MOVEA.L (A7)+,A6
  2980. MOVE.L D0,@RESULT
  2981. END;
  2982. END;
  2983. FUNCTION NextDosEntry(const dlist : pDosList; flags : ULONG) : pDosList;
  2984. BEGIN
  2985. ASM
  2986. MOVE.L A6,-(A7)
  2987. MOVE.L dlist,D1
  2988. MOVE.L flags,D2
  2989. MOVEA.L _DOSBase,A6
  2990. JSR -690(A6)
  2991. MOVEA.L (A7)+,A6
  2992. MOVE.L D0,@RESULT
  2993. END;
  2994. END;
  2995. FUNCTION OpenFromLock(lock : LONGINT) : LONGINT;
  2996. BEGIN
  2997. ASM
  2998. MOVE.L A6,-(A7)
  2999. MOVE.L lock,D1
  3000. MOVEA.L _DOSBase,A6
  3001. JSR -378(A6)
  3002. MOVEA.L (A7)+,A6
  3003. MOVE.L D0,@RESULT
  3004. END;
  3005. END;
  3006. FUNCTION ParentDir(lock : LONGINT) : LONGINT;
  3007. BEGIN
  3008. ASM
  3009. MOVE.L A6,-(A7)
  3010. MOVE.L lock,D1
  3011. MOVEA.L _DOSBase,A6
  3012. JSR -210(A6)
  3013. MOVEA.L (A7)+,A6
  3014. MOVE.L D0,@RESULT
  3015. END;
  3016. END;
  3017. FUNCTION ParentOfFH(fh : LONGINT) : LONGINT;
  3018. BEGIN
  3019. ASM
  3020. MOVE.L A6,-(A7)
  3021. MOVE.L fh,D1
  3022. MOVEA.L _DOSBase,A6
  3023. JSR -384(A6)
  3024. MOVEA.L (A7)+,A6
  3025. MOVE.L D0,@RESULT
  3026. END;
  3027. END;
  3028. FUNCTION ParsePattern(const pat : pCHAR; buf : pCHAR; buflen : LONGINT) : LONGINT;
  3029. BEGIN
  3030. ASM
  3031. MOVE.L A6,-(A7)
  3032. MOVE.L pat,D1
  3033. MOVE.L buf,D2
  3034. MOVE.L buflen,D3
  3035. MOVEA.L _DOSBase,A6
  3036. JSR -840(A6)
  3037. MOVEA.L (A7)+,A6
  3038. MOVE.L D0,@RESULT
  3039. END;
  3040. END;
  3041. FUNCTION ParsePatternNoCase(const pat : pCHAR; buf : pCHAR; buflen : LONGINT) : LONGINT;
  3042. BEGIN
  3043. ASM
  3044. MOVE.L A6,-(A7)
  3045. MOVE.L pat,D1
  3046. MOVE.L buf,D2
  3047. MOVE.L buflen,D3
  3048. MOVEA.L _DOSBase,A6
  3049. JSR -966(A6)
  3050. MOVEA.L (A7)+,A6
  3051. MOVE.L D0,@RESULT
  3052. END;
  3053. END;
  3054. FUNCTION PathPart(const path : pCHAR) : pCHAR;
  3055. BEGIN
  3056. ASM
  3057. MOVE.L A6,-(A7)
  3058. MOVE.L path,D1
  3059. MOVEA.L _DOSBase,A6
  3060. JSR -876(A6)
  3061. MOVEA.L (A7)+,A6
  3062. MOVE.L D0,@RESULT
  3063. END;
  3064. END;
  3065. FUNCTION PrintFault(code : LONGINT;const header : pCHAR) : BOOLEAN;
  3066. BEGIN
  3067. ASM
  3068. MOVE.L A6,-(A7)
  3069. MOVE.L code,D1
  3070. MOVE.L header,D2
  3071. MOVEA.L _DOSBase,A6
  3072. JSR -474(A6)
  3073. MOVEA.L (A7)+,A6
  3074. TST.W D0
  3075. BEQ.B @end
  3076. MOVEQ #1,D0
  3077. @end: MOVE.B D0,@RESULT
  3078. END;
  3079. END;
  3080. FUNCTION PutStr(const str : pCHAR) : BOOLEAN;
  3081. BEGIN
  3082. ASM
  3083. MOVE.L A6,-(A7)
  3084. MOVE.L str,D1
  3085. MOVEA.L _DOSBase,A6
  3086. JSR -948(A6)
  3087. MOVEA.L (A7)+,A6
  3088. TST.L D0
  3089. BEQ.B @end
  3090. MOVEQ #1,D0
  3091. @end: MOVE.B D0,@RESULT
  3092. END;
  3093. END;
  3094. FUNCTION ReadArgs(const arg_template : pCHAR; arra : pLONGINT; args : pRDArgs) : pRDArgs;
  3095. BEGIN
  3096. ASM
  3097. MOVE.L A6,-(A7)
  3098. MOVE.L arg_template,D1
  3099. MOVE.L arra,D2
  3100. MOVE.L args,D3
  3101. MOVEA.L _DOSBase,A6
  3102. JSR -798(A6)
  3103. MOVEA.L (A7)+,A6
  3104. MOVE.L D0,@RESULT
  3105. END;
  3106. END;
  3107. FUNCTION ReadItem(const name : pCHAR; maxchars : LONGINT; cSource : pCSource) : LONGINT;
  3108. BEGIN
  3109. ASM
  3110. MOVE.L A6,-(A7)
  3111. MOVE.L name,D1
  3112. MOVE.L maxchars,D2
  3113. MOVE.L cSource,D3
  3114. MOVEA.L _DOSBase,A6
  3115. JSR -810(A6)
  3116. MOVEA.L (A7)+,A6
  3117. MOVE.L D0,@RESULT
  3118. END;
  3119. END;
  3120. FUNCTION ReadLink(port : pMsgPort; lock : LONGINT;const path : pCHAR; buffer : pCHAR; size : ULONG) : BOOLEAN;
  3121. BEGIN
  3122. ASM
  3123. MOVE.L A6,-(A7)
  3124. MOVE.L port,D1
  3125. MOVE.L lock,D2
  3126. MOVE.L path,D3
  3127. MOVE.L buffer,D4
  3128. MOVE.L size,D5
  3129. MOVEA.L _DOSBase,A6
  3130. JSR -438(A6)
  3131. MOVEA.L (A7)+,A6
  3132. TST.L D0
  3133. BEQ.B @end
  3134. MOVEQ #1,D0
  3135. @end: MOVE.B D0,@RESULT
  3136. END;
  3137. END;
  3138. FUNCTION Relabel(const drive : pCHAR;const newname : pCHAR) : BOOLEAN;
  3139. BEGIN
  3140. ASM
  3141. MOVE.L A6,-(A7)
  3142. MOVE.L drive,D1
  3143. MOVE.L newname,D2
  3144. MOVEA.L _DOSBase,A6
  3145. JSR -720(A6)
  3146. MOVEA.L (A7)+,A6
  3147. TST.L D0
  3148. BEQ.B @end
  3149. MOVEQ #1,D0
  3150. @end: MOVE.B D0,@RESULT
  3151. END;
  3152. END;
  3153. FUNCTION RemAssignList(const name : pCHAR; lock : LONGINT) : BOOLEAN;
  3154. BEGIN
  3155. ASM
  3156. MOVE.L A6,-(A7)
  3157. MOVE.L name,D1
  3158. MOVE.L lock,D2
  3159. MOVEA.L _DOSBase,A6
  3160. JSR -636(A6)
  3161. MOVEA.L (A7)+,A6
  3162. TST.L D0
  3163. BEQ.B @end
  3164. MOVEQ #1,D0
  3165. @end: MOVE.B D0,@RESULT
  3166. END;
  3167. END;
  3168. FUNCTION RemDosEntry(dlist : pDosList) : BOOLEAN;
  3169. BEGIN
  3170. ASM
  3171. MOVE.L A6,-(A7)
  3172. MOVE.L dlist,D1
  3173. MOVEA.L _DOSBase,A6
  3174. JSR -672(A6)
  3175. MOVEA.L (A7)+,A6
  3176. TST.W D0
  3177. BEQ.B @end
  3178. MOVEQ #1,D0
  3179. @end: MOVE.B D0,@RESULT
  3180. END;
  3181. END;
  3182. FUNCTION RemSegment(seg : pSegment) : BOOLEAN;
  3183. BEGIN
  3184. ASM
  3185. MOVE.L A6,-(A7)
  3186. MOVE.L seg,D1
  3187. MOVEA.L _DOSBase,A6
  3188. JSR -786(A6)
  3189. MOVEA.L (A7)+,A6
  3190. TST.L D0
  3191. BEQ.B @end
  3192. MOVEQ #1,D0
  3193. @end: MOVE.B D0,@RESULT
  3194. END;
  3195. END;
  3196. PROCEDURE ReplyPkt(dp : pDosPacket; res1 : LONGINT; res2 : LONGINT);
  3197. BEGIN
  3198. ASM
  3199. MOVE.L A6,-(A7)
  3200. MOVE.L dp,D1
  3201. MOVE.L res1,D2
  3202. MOVE.L res2,D3
  3203. MOVEA.L _DOSBase,A6
  3204. JSR -258(A6)
  3205. MOVEA.L (A7)+,A6
  3206. END;
  3207. END;
  3208. FUNCTION RunCommand(seg : LONGINT; stack : LONGINT;const paramptr : pCHAR; paramlen : LONGINT) : LONGINT;
  3209. BEGIN
  3210. ASM
  3211. MOVE.L A6,-(A7)
  3212. MOVE.L seg,D1
  3213. MOVE.L stack,D2
  3214. MOVE.L paramptr,D3
  3215. MOVE.L paramlen,D4
  3216. MOVEA.L _DOSBase,A6
  3217. JSR -504(A6)
  3218. MOVEA.L (A7)+,A6
  3219. MOVE.L D0,@RESULT
  3220. END;
  3221. END;
  3222. FUNCTION SameDevice(lock1 : LONGINT; lock2 : LONGINT) : BOOLEAN;
  3223. BEGIN
  3224. ASM
  3225. MOVE.L A6,-(A7)
  3226. MOVE.L lock1,D1
  3227. MOVE.L lock2,D2
  3228. MOVEA.L _DOSBase,A6
  3229. JSR -984(A6)
  3230. MOVEA.L (A7)+,A6
  3231. TST.W D0
  3232. BEQ.B @end
  3233. MOVEQ #1,D0
  3234. @end: MOVE.B D0,@RESULT
  3235. END;
  3236. END;
  3237. FUNCTION SameLock(lock1 : LONGINT; lock2 : LONGINT) : LONGINT;
  3238. BEGIN
  3239. ASM
  3240. MOVE.L A6,-(A7)
  3241. MOVE.L lock1,D1
  3242. MOVE.L lock2,D2
  3243. MOVEA.L _DOSBase,A6
  3244. JSR -420(A6)
  3245. MOVEA.L (A7)+,A6
  3246. MOVE.L D0,@RESULT
  3247. END;
  3248. END;
  3249. FUNCTION SelectInput(fh : LONGINT) : LONGINT;
  3250. BEGIN
  3251. ASM
  3252. MOVE.L A6,-(A7)
  3253. MOVE.L fh,D1
  3254. MOVEA.L _DOSBase,A6
  3255. JSR -294(A6)
  3256. MOVEA.L (A7)+,A6
  3257. MOVE.L D0,@RESULT
  3258. END;
  3259. END;
  3260. FUNCTION SelectOutput(fh : LONGINT) : LONGINT;
  3261. BEGIN
  3262. ASM
  3263. MOVE.L A6,-(A7)
  3264. MOVE.L fh,D1
  3265. MOVEA.L _DOSBase,A6
  3266. JSR -300(A6)
  3267. MOVEA.L (A7)+,A6
  3268. MOVE.L D0,@RESULT
  3269. END;
  3270. END;
  3271. PROCEDURE SendPkt(dp : pDosPacket; port : pMsgPort; replyport : pMsgPort);
  3272. BEGIN
  3273. ASM
  3274. MOVE.L A6,-(A7)
  3275. MOVE.L dp,D1
  3276. MOVE.L port,D2
  3277. MOVE.L replyport,D3
  3278. MOVEA.L _DOSBase,A6
  3279. JSR -246(A6)
  3280. MOVEA.L (A7)+,A6
  3281. END;
  3282. END;
  3283. FUNCTION SetArgStr(const string_ : pCHAR) : BOOLEAN;
  3284. BEGIN
  3285. ASM
  3286. MOVE.L A6,-(A7)
  3287. MOVE.L string_,D1
  3288. MOVEA.L _DOSBase,A6
  3289. JSR -540(A6)
  3290. MOVEA.L (A7)+,A6
  3291. TST.W D0
  3292. BEQ.B @end
  3293. MOVEQ #1,D0
  3294. @end: MOVE.B D0,@RESULT
  3295. END;
  3296. END;
  3297. FUNCTION SetComment(const name : pCHAR;const comment : pCHAR) : BOOLEAN;
  3298. BEGIN
  3299. ASM
  3300. MOVE.L A6,-(A7)
  3301. MOVE.L name,D1
  3302. MOVE.L comment,D2
  3303. MOVEA.L _DOSBase,A6
  3304. JSR -180(A6)
  3305. MOVEA.L (A7)+,A6
  3306. TST.L D0
  3307. BEQ.B @end
  3308. MOVEQ #1,D0
  3309. @end: MOVE.B D0,@RESULT
  3310. END;
  3311. END;
  3312. FUNCTION SetConsoleTask(const task : pMsgPort) : pMsgPort;
  3313. BEGIN
  3314. ASM
  3315. MOVE.L A6,-(A7)
  3316. MOVE.L task,D1
  3317. MOVEA.L _DOSBase,A6
  3318. JSR -516(A6)
  3319. MOVEA.L (A7)+,A6
  3320. MOVE.L D0,@RESULT
  3321. END;
  3322. END;
  3323. FUNCTION SetCurrentDirName(const name : pCHAR) : BOOLEAN;
  3324. BEGIN
  3325. ASM
  3326. MOVE.L A6,-(A7)
  3327. MOVE.L name,D1
  3328. MOVEA.L _DOSBase,A6
  3329. JSR -558(A6)
  3330. MOVEA.L (A7)+,A6
  3331. TST.W D0
  3332. BEQ.B @end
  3333. MOVEQ #1,D0
  3334. @end: MOVE.B D0,@RESULT
  3335. END;
  3336. END;
  3337. FUNCTION SetFileDate(const name : pCHAR; date : pDateStamp) : BOOLEAN;
  3338. BEGIN
  3339. ASM
  3340. MOVE.L A6,-(A7)
  3341. MOVE.L name,D1
  3342. MOVE.L date,D2
  3343. MOVEA.L _DOSBase,A6
  3344. JSR -396(A6)
  3345. MOVEA.L (A7)+,A6
  3346. TST.L D0
  3347. BEQ.B @end
  3348. MOVEQ #1,D0
  3349. @end: MOVE.B D0,@RESULT
  3350. END;
  3351. END;
  3352. FUNCTION SetFileSize(fh : LONGINT; pos : LONGINT; mode : LONGINT) : BOOLEAN;
  3353. BEGIN
  3354. ASM
  3355. MOVE.L A6,-(A7)
  3356. MOVE.L fh,D1
  3357. MOVE.L pos,D2
  3358. MOVE.L mode,D3
  3359. MOVEA.L _DOSBase,A6
  3360. JSR -456(A6)
  3361. MOVEA.L (A7)+,A6
  3362. TST.L D0
  3363. BEQ.B @end
  3364. MOVEQ #1,D0
  3365. @end: MOVE.B D0,@RESULT
  3366. END;
  3367. END;
  3368. FUNCTION SetFileSysTask(const task : pMsgPort) : pMsgPort;
  3369. BEGIN
  3370. ASM
  3371. MOVE.L A6,-(A7)
  3372. MOVE.L task,D1
  3373. MOVEA.L _DOSBase,A6
  3374. JSR -528(A6)
  3375. MOVEA.L (A7)+,A6
  3376. MOVE.L D0,@RESULT
  3377. END;
  3378. END;
  3379. FUNCTION SetIoErr(result : LONGINT) : LONGINT;
  3380. BEGIN
  3381. ASM
  3382. MOVE.L A6,-(A7)
  3383. MOVE.L result,D1
  3384. MOVEA.L _DOSBase,A6
  3385. JSR -462(A6)
  3386. MOVEA.L (A7)+,A6
  3387. MOVE.L D0,@RESULT
  3388. END;
  3389. END;
  3390. FUNCTION SetMode(fh : LONGINT; mode : LONGINT) : BOOLEAN;
  3391. BEGIN
  3392. ASM
  3393. MOVE.L A6,-(A7)
  3394. MOVE.L fh,D1
  3395. MOVE.L mode,D2
  3396. MOVEA.L _DOSBase,A6
  3397. JSR -426(A6)
  3398. MOVEA.L (A7)+,A6
  3399. TST.L D0
  3400. BEQ.B @end
  3401. MOVEQ #1,D0
  3402. @end: MOVE.B D0,@RESULT
  3403. END;
  3404. END;
  3405. FUNCTION SetOwner(const name : pCHAR; owner_info : LONGINT) : BOOLEAN;
  3406. BEGIN
  3407. ASM
  3408. MOVE.L A6,-(A7)
  3409. MOVE.L name,D1
  3410. MOVE.L owner_info,D2
  3411. MOVEA.L _DOSBase,A6
  3412. JSR -996(A6)
  3413. MOVEA.L (A7)+,A6
  3414. TST.W D0
  3415. BEQ.B @end
  3416. MOVEQ #1,D0
  3417. @end: MOVE.B D0,@RESULT
  3418. END;
  3419. END;
  3420. FUNCTION SetProgramDir(lock : LONGINT) : LONGINT;
  3421. BEGIN
  3422. ASM
  3423. MOVE.L A6,-(A7)
  3424. MOVE.L lock,D1
  3425. MOVEA.L _DOSBase,A6
  3426. JSR -594(A6)
  3427. MOVEA.L (A7)+,A6
  3428. MOVE.L D0,@RESULT
  3429. END;
  3430. END;
  3431. FUNCTION SetProgramName(const name : pCHAR) : BOOLEAN;
  3432. BEGIN
  3433. ASM
  3434. MOVE.L A6,-(A7)
  3435. MOVE.L name,D1
  3436. MOVEA.L _DOSBase,A6
  3437. JSR -570(A6)
  3438. MOVEA.L (A7)+,A6
  3439. TST.W D0
  3440. BEQ.B @end
  3441. MOVEQ #1,D0
  3442. @end: MOVE.B D0,@RESULT
  3443. END;
  3444. END;
  3445. FUNCTION SetPrompt(const name : pCHAR) : BOOLEAN;
  3446. BEGIN
  3447. ASM
  3448. MOVE.L A6,-(A7)
  3449. MOVE.L name,D1
  3450. MOVEA.L _DOSBase,A6
  3451. JSR -582(A6)
  3452. MOVEA.L (A7)+,A6
  3453. TST.W D0
  3454. BEQ.B @end
  3455. MOVEQ #1,D0
  3456. @end: MOVE.B D0,@RESULT
  3457. END;
  3458. END;
  3459. FUNCTION SetProtection(const name : pCHAR; protect : LONGINT) : BOOLEAN;
  3460. BEGIN
  3461. ASM
  3462. MOVE.L A6,-(A7)
  3463. MOVE.L name,D1
  3464. MOVE.L protect,D2
  3465. MOVEA.L _DOSBase,A6
  3466. JSR -186(A6)
  3467. MOVEA.L (A7)+,A6
  3468. TST.L D0
  3469. BEQ.B @end
  3470. MOVEQ #1,D0
  3471. @end: MOVE.B D0,@RESULT
  3472. END;
  3473. END;
  3474. FUNCTION SetVar(const name : pCHAR; buffer : pCHAR; size : LONGINT; flags : LONGINT) : BOOLEAN;
  3475. BEGIN
  3476. ASM
  3477. MOVE.L A6,-(A7)
  3478. MOVE.L name,D1
  3479. MOVE.L buffer,D2
  3480. MOVE.L size,D3
  3481. MOVE.L flags,D4
  3482. MOVEA.L _DOSBase,A6
  3483. JSR -900(A6)
  3484. MOVEA.L (A7)+,A6
  3485. TST.W D0
  3486. BEQ.B @end
  3487. MOVEQ #1,D0
  3488. @end: MOVE.B D0,@RESULT
  3489. END;
  3490. END;
  3491. FUNCTION SetVBuf(fh : LONGINT; buff : pCHAR; type_ : LONGINT; size : LONGINT) : BOOLEAN;
  3492. BEGIN
  3493. ASM
  3494. MOVE.L A6,-(A7)
  3495. MOVE.L fh,D1
  3496. MOVE.L buff,D2
  3497. MOVE.L type_,D3
  3498. MOVE.L size,D4
  3499. MOVEA.L _DOSBase,A6
  3500. JSR -366(A6)
  3501. MOVEA.L (A7)+,A6
  3502. TST.L D0
  3503. BEQ.B @end
  3504. MOVEQ #1,D0
  3505. @end: MOVE.B D0,@RESULT
  3506. END;
  3507. END;
  3508. FUNCTION SplitName(const name : pCHAR; seperator : ULONG; buf : pCHAR; oldpos : LONGINT; size : LONGINT) : smallint;
  3509. BEGIN
  3510. ASM
  3511. MOVE.L A6,-(A7)
  3512. MOVE.L name,D1
  3513. MOVE.L seperator,D2
  3514. MOVE.L buf,D3
  3515. MOVE.L oldpos,D4
  3516. MOVE.L size,D5
  3517. MOVEA.L _DOSBase,A6
  3518. JSR -414(A6)
  3519. MOVEA.L (A7)+,A6
  3520. MOVE.L D0,@RESULT
  3521. END;
  3522. END;
  3523. FUNCTION StartNotify(notify : pNotifyRequest) : BOOLEAN;
  3524. BEGIN
  3525. ASM
  3526. MOVE.L A6,-(A7)
  3527. MOVE.L notify,D1
  3528. MOVEA.L _DOSBase,A6
  3529. JSR -888(A6)
  3530. MOVEA.L (A7)+,A6
  3531. TST.W D0
  3532. BEQ.B @end
  3533. MOVEQ #1,D0
  3534. @end: MOVE.B D0,@RESULT
  3535. END;
  3536. END;
  3537. FUNCTION StrToDate(datetime : pDateTime) : BOOLEAN;
  3538. BEGIN
  3539. ASM
  3540. MOVE.L A6,-(A7)
  3541. MOVE.L datetime,D1
  3542. MOVEA.L _DOSBase,A6
  3543. JSR -750(A6)
  3544. MOVEA.L (A7)+,A6
  3545. TST.L D0
  3546. BEQ.B @end
  3547. MOVEQ #1,D0
  3548. @end: MOVE.B D0,@RESULT
  3549. END;
  3550. END;
  3551. FUNCTION StrToLong(const string_ : pCHAR; VAR value : LONGINT) : LONGINT;
  3552. BEGIN
  3553. ASM
  3554. MOVE.L A6,-(A7)
  3555. MOVE.L string_,D1
  3556. MOVE.L value,D2
  3557. MOVEA.L _DOSBase,A6
  3558. JSR -816(A6)
  3559. MOVEA.L (A7)+,A6
  3560. MOVE.L D0,@RESULT
  3561. END;
  3562. END;
  3563. FUNCTION SystemTagList(const command : pCHAR;const tags : pTagItem) : LONGINT;
  3564. BEGIN
  3565. ASM
  3566. MOVE.L A6,-(A7)
  3567. MOVE.L command,D1
  3568. MOVE.L tags,D2
  3569. MOVEA.L _DOSBase,A6
  3570. JSR -606(A6)
  3571. MOVEA.L (A7)+,A6
  3572. MOVE.L D0,@RESULT
  3573. END;
  3574. END;
  3575. FUNCTION DOSSystem(const command : pCHAR;const tags : pTagItem) : LONGINT;
  3576. BEGIN
  3577. ASM
  3578. MOVE.L A6,-(A7)
  3579. MOVE.L command,D1
  3580. MOVE.L tags,D2
  3581. MOVEA.L _DOSBase,A6
  3582. JSR -606(A6)
  3583. MOVEA.L (A7)+,A6
  3584. MOVE.L D0,@RESULT
  3585. END;
  3586. END;
  3587. FUNCTION UnGetC(fh : LONGINT; character : LONGINT) : LONGINT;
  3588. BEGIN
  3589. ASM
  3590. MOVE.L A6,-(A7)
  3591. MOVE.L fh,D1
  3592. MOVE.L character,D2
  3593. MOVEA.L _DOSBase,A6
  3594. JSR -318(A6)
  3595. MOVEA.L (A7)+,A6
  3596. MOVE.L D0,@RESULT
  3597. END;
  3598. END;
  3599. PROCEDURE UnLoadSeg(seglist : LONGINT);
  3600. BEGIN
  3601. ASM
  3602. MOVE.L A6,-(A7)
  3603. MOVE.L seglist,D1
  3604. MOVEA.L _DOSBase,A6
  3605. JSR -156(A6)
  3606. MOVEA.L (A7)+,A6
  3607. END;
  3608. END;
  3609. PROCEDURE UnLock(lock : LONGINT);
  3610. BEGIN
  3611. ASM
  3612. MOVE.L A6,-(A7)
  3613. MOVE.L lock,D1
  3614. MOVEA.L _DOSBase,A6
  3615. JSR -090(A6)
  3616. MOVEA.L (A7)+,A6
  3617. END;
  3618. END;
  3619. PROCEDURE UnLockDosList(flags : ULONG);
  3620. BEGIN
  3621. ASM
  3622. MOVE.L A6,-(A7)
  3623. MOVE.L flags,D1
  3624. MOVEA.L _DOSBase,A6
  3625. JSR -660(A6)
  3626. MOVEA.L (A7)+,A6
  3627. END;
  3628. END;
  3629. FUNCTION UnLockRecord(fh : LONGINT; offset : ULONG; length : ULONG) : BOOLEAN;
  3630. BEGIN
  3631. ASM
  3632. MOVE.L A6,-(A7)
  3633. MOVE.L fh,D1
  3634. MOVE.L offset,D2
  3635. MOVE.L length,D3
  3636. MOVEA.L _DOSBase,A6
  3637. JSR -282(A6)
  3638. MOVEA.L (A7)+,A6
  3639. TST.W D0
  3640. BEQ.B @end
  3641. MOVEQ #1,D0
  3642. @end: MOVE.B D0,@RESULT
  3643. END;
  3644. END;
  3645. FUNCTION UnLockRecords(recArray : pRecordLock) : BOOLEAN;
  3646. BEGIN
  3647. ASM
  3648. MOVE.L A6,-(A7)
  3649. MOVE.L recArray,D1
  3650. MOVEA.L _DOSBase,A6
  3651. JSR -288(A6)
  3652. MOVEA.L (A7)+,A6
  3653. TST.W D0
  3654. BEQ.B @end
  3655. MOVEQ #1,D0
  3656. @end: MOVE.B D0,@RESULT
  3657. END;
  3658. END;
  3659. FUNCTION VFPrintf(fh : LONGINT;const format : pCHAR;const argarray : POINTER) : LONGINT;
  3660. BEGIN
  3661. ASM
  3662. MOVE.L A6,-(A7)
  3663. MOVE.L fh,D1
  3664. MOVE.L format,D2
  3665. MOVE.L argarray,D3
  3666. MOVEA.L _DOSBase,A6
  3667. JSR -354(A6)
  3668. MOVEA.L (A7)+,A6
  3669. MOVE.L D0,@RESULT
  3670. END;
  3671. END;
  3672. PROCEDURE VFWritef(fh : LONGINT;const format : pCHAR;const argarray : pLONGINT);
  3673. BEGIN
  3674. ASM
  3675. MOVE.L A6,-(A7)
  3676. MOVE.L fh,D1
  3677. MOVE.L format,D2
  3678. MOVE.L argarray,D3
  3679. MOVEA.L _DOSBase,A6
  3680. JSR -348(A6)
  3681. MOVEA.L (A7)+,A6
  3682. END;
  3683. END;
  3684. FUNCTION VPrintf(const format : pCHAR; const argarray : POINTER) : LONGINT;
  3685. BEGIN
  3686. ASM
  3687. MOVE.L A6,-(A7)
  3688. MOVE.L format,D1
  3689. MOVE.L argarray,D2
  3690. MOVEA.L _DOSBase,A6
  3691. JSR -954(A6)
  3692. MOVEA.L (A7)+,A6
  3693. MOVE.L D0,@RESULT
  3694. END;
  3695. END;
  3696. FUNCTION WaitForChar(file_ : LONGINT; timeout : LONGINT) : BOOLEAN;
  3697. BEGIN
  3698. ASM
  3699. MOVE.L A6,-(A7)
  3700. MOVE.L file_,D1
  3701. MOVE.L timeout,D2
  3702. MOVEA.L _DOSBase,A6
  3703. JSR -204(A6)
  3704. MOVEA.L (A7)+,A6
  3705. TST.L D0
  3706. BEQ.B @end
  3707. MOVEQ #1,D0
  3708. @end: MOVE.B D0,@RESULT
  3709. END;
  3710. END;
  3711. FUNCTION WaitPkt : pDosPacket;
  3712. BEGIN
  3713. ASM
  3714. MOVE.L A6,-(A7)
  3715. MOVEA.L _DOSBase,A6
  3716. JSR -252(A6)
  3717. MOVEA.L (A7)+,A6
  3718. MOVE.L D0,@RESULT
  3719. END;
  3720. END;
  3721. FUNCTION WriteChars(const buf : pCHAR; buflen : ULONG) : LONGINT;
  3722. BEGIN
  3723. ASM
  3724. MOVE.L A6,-(A7)
  3725. MOVE.L buf,D1
  3726. MOVE.L buflen,D2
  3727. MOVEA.L _DOSBase,A6
  3728. JSR -942(A6)
  3729. MOVEA.L (A7)+,A6
  3730. MOVE.L D0,@RESULT
  3731. END;
  3732. END;
  3733. FUNCTION AddBuffers(const name : string; number : LONGINT) : BOOLEAN;
  3734. begin
  3735. AddBuffers := AddBuffers(pas2c(name), number);
  3736. end;
  3737. FUNCTION AddPart(dirname : string;const filename : pCHAR; size : ULONG) : BOOLEAN;
  3738. begin
  3739. AddPart := AddPart(pas2c(dirname),filename,size);
  3740. end;
  3741. FUNCTION AddPart(dirname : pCHAR;const filename : string; size : ULONG) : BOOLEAN;
  3742. begin
  3743. AddPart := AddPart(dirname,pas2c(filename),size);
  3744. end;
  3745. FUNCTION AddPart(dirname : string;const filename : string; size : ULONG) : BOOLEAN;
  3746. begin
  3747. AddPart := AddPart(pas2c(dirname),pas2c(filename),size);
  3748. end;
  3749. FUNCTION AssignAdd(const name : string; lock : LONGINT) : BOOLEAN;
  3750. begin
  3751. AssignAdd := AssignAdd(pas2c(name),lock);
  3752. end;
  3753. FUNCTION AssignLate(const name : string;const path : pCHAR) : BOOLEAN;
  3754. begin
  3755. AssignLate := AssignLate(pas2c(name),path);
  3756. end;
  3757. FUNCTION AssignLate(const name : pChar;const path : string) : BOOLEAN;
  3758. begin
  3759. AssignLate := AssignLate(name,pas2c(path));
  3760. end;
  3761. FUNCTION AssignLate(const name : string;const path : string) : BOOLEAN;
  3762. begin
  3763. AssignLate := AssignLate(pas2c(name),pas2c(path));
  3764. end;
  3765. FUNCTION AssignLock(const name : string; lock : LONGINT) : BOOLEAN;
  3766. begin
  3767. AssignLock := AssignLock(pas2c(name),lock);
  3768. end;
  3769. FUNCTION AssignPath(const name : string;const path : pCHAR) : BOOLEAN;
  3770. begin
  3771. AssignPath := AssignPath(pas2c(name),path);
  3772. end;
  3773. FUNCTION AssignPath(const name : pCHAR;const path : string) : BOOLEAN;
  3774. begin
  3775. AssignPath := AssignPath(name,pas2c(path));
  3776. end;
  3777. FUNCTION AssignPath(const name : string;const path : string) : BOOLEAN;
  3778. begin
  3779. AssignPath := AssignPath(pas2c(name),pas2c(path));
  3780. end;
  3781. FUNCTION CreateDir(const name : string) : LONGINT;
  3782. begin
  3783. CreateDir := CreateDir(pas2c(name));
  3784. end;
  3785. FUNCTION CreateProc(const name : string; pri : LONGINT; segList : LONGINT; stackSize : LONGINT) : pMsgPort;
  3786. begin
  3787. CreateProc := CreateProc(pas2c(name),pri,segList,stackSize);
  3788. end;
  3789. FUNCTION DeleteFile(const name : string) : BOOLEAN;
  3790. begin
  3791. DeleteFile := DeleteFile(pas2c(name));
  3792. end;
  3793. FUNCTION DeleteVar(const name : string; flags : ULONG) : BOOLEAN;
  3794. begin
  3795. DeleteVar := DeleteVar(pas2c(name),flags);
  3796. end;
  3797. FUNCTION DeviceProc(const name : string) : pMsgPort;
  3798. begin
  3799. Deviceproc := DeviceProc(pas2c(name));
  3800. end;
  3801. FUNCTION DOSOpen(const name : string; accessMode : LONGINT) : LONGINT;
  3802. begin
  3803. DOSOpen := DOSOpen(pas2c(name),accessMode);
  3804. end;
  3805. FUNCTION DOSRename(const oldName : string;const newName : pCHAR) : Boolean;
  3806. begin
  3807. DOSRename := DOSRename(pas2c(oldName),newName);
  3808. end;
  3809. FUNCTION DOSRename(const oldName : pCHAR;const newName : string) : Boolean;
  3810. begin
  3811. DOSRename := DOSRename(oldName,pas2c(newName));
  3812. end;
  3813. FUNCTION DOSRename(const oldName : string;const newName : string) : Boolean;
  3814. begin
  3815. DOSRename := DOSRename(pas2c(oldName),pas2c(newName));
  3816. end;
  3817. FUNCTION Execute(const string_ : string; file_ : LONGINT; file2 : LONGINT) : BOOLEAN;
  3818. begin
  3819. Execute := Execute(pas2c(string_),file_ ,file2);
  3820. end;
  3821. FUNCTION Fault(code : LONGINT; header : string; buffer : pCHAR; len : LONGINT) : BOOLEAN;
  3822. begin
  3823. Fault := Fault(code,pas2c(header),buffer,len);
  3824. end;
  3825. FUNCTION FilePart(const path : string) : pCHAR;
  3826. begin
  3827. FilePart := FilePart(pas2c(path));
  3828. end;
  3829. FUNCTION FindArg(const keyword : string;const arg_template : pCHAR) : LONGINT;
  3830. begin
  3831. FindArg := FindArg(pas2c(keyword),arg_template);
  3832. end;
  3833. FUNCTION FindArg(const keyword : pCHAR;const arg_template : string) : LONGINT;
  3834. begin
  3835. FindArg := FindArg(keyword,pas2c(arg_template));
  3836. end;
  3837. FUNCTION FindArg(const keyword : string;const arg_template : string) : LONGINT;
  3838. begin
  3839. FindArg := FindArg(pas2c(keyword),pas2c(arg_template));
  3840. end;
  3841. FUNCTION FindDosEntry(const dlist : pDosList;const name : string; flags : ULONG) : pDosList;
  3842. begin
  3843. FindDosEntry := FindDosEntry(dlist,pas2c(name),flags);
  3844. end;
  3845. FUNCTION FindSegment(const name : string;const seg : pSegment; system : LONGINT) : pSegment;
  3846. begin
  3847. FindSegment := FindSegment(pas2c(name),seg,system);
  3848. end;
  3849. FUNCTION FindVar(const name : string; type_ : ULONG) : pLocalVar;
  3850. begin
  3851. FindVar := FindVar(pas2c(name),type_);
  3852. end;
  3853. FUNCTION Format(const filesystem : string;const volumename : pCHAR; dostype : ULONG) : BOOLEAN;
  3854. begin
  3855. Format := Format(pas2c(filesystem),volumename,dostype);
  3856. end;
  3857. FUNCTION Format(const filesystem : pCHAR;const volumename : string; dostype : ULONG) : BOOLEAN;
  3858. begin
  3859. Format := Format(filesystem,pas2c(volumename),dostype);
  3860. end;
  3861. FUNCTION Format(const filesystem : string;const volumename : string; dostype : ULONG) : BOOLEAN;
  3862. begin
  3863. Format := Format(pas2c(filesystem),pas2c(volumename),dostype);
  3864. end;
  3865. FUNCTION FPuts(fh : LONGINT;const str : string) : BOOLEAN;
  3866. begin
  3867. FPuts := FPuts(fh,pas2c(str));
  3868. end;
  3869. FUNCTION GetDeviceProc(const name : string; dp : pDevProc) : pDevProc;
  3870. begin
  3871. GetDeviceProc := GetDeviceProc(pas2c(name),dp);
  3872. end;
  3873. FUNCTION GetVar(const name : string; buffer : pCHAR; size : LONGINT; flags : LONGINT) : LONGINT;
  3874. begin
  3875. GetVar := GetVar(pas2c(name),buffer,size,flags);
  3876. end;
  3877. FUNCTION Inhibit(const name : string; onoff : LONGINT) : BOOLEAN;
  3878. begin
  3879. Inhibit := Inhibit(pas2c(name),onoff);
  3880. end;
  3881. FUNCTION IsFileSystem(const name : string) : BOOLEAN;
  3882. begin
  3883. IsFileSystem := IsFileSystem(pas2c(name));
  3884. end;
  3885. FUNCTION LoadSeg(const name : string) : LONGINT;
  3886. begin
  3887. LoadSeg := LoadSeg(pas2c(name));
  3888. end;
  3889. FUNCTION Lock(const name : string; type_ : LONGINT) : LONGINT;
  3890. begin
  3891. Lock := Lock(pas2c(name),type_);
  3892. end;
  3893. FUNCTION MakeDosEntry(const name : string; type_ : LONGINT) : pDosList;
  3894. begin
  3895. MakeDosEntry := MakeDosEntry(pas2c(name),type_);
  3896. end;
  3897. FUNCTION MakeLink(const name : string; dest : LONGINT; soft : LONGINT) : BOOLEAN;
  3898. begin
  3899. MakeLink := MakeLink(pas2c(name),dest,soft);
  3900. end;
  3901. FUNCTION MatchFirst(const pat : string; anchor : pAnchorPath) : LONGINT;
  3902. begin
  3903. MatchFirst := MatchFirst(pas2c(pat),anchor);
  3904. end;
  3905. FUNCTION MatchPattern(const pat : string; str : pCHAR) : BOOLEAN;
  3906. begin
  3907. MatchPattern := MatchPattern(pas2c(pat),str);
  3908. end;
  3909. FUNCTION MatchPattern(const pat : pCHAR; str : string) : BOOLEAN;
  3910. begin
  3911. MatchPattern := MatchPattern(pat,pas2c(str));
  3912. end;
  3913. FUNCTION MatchPattern(const pat : string; str : string) : BOOLEAN;
  3914. begin
  3915. MatchPattern := MatchPattern(pas2c(pat),pas2c(str));
  3916. end;
  3917. FUNCTION MatchPatternNoCase(const pat : string; str : pCHAR) : BOOLEAN;
  3918. begin
  3919. MatchPatternNoCase := MatchPatternNoCase(pas2c(pat),str);
  3920. end;
  3921. FUNCTION MatchPatternNoCase(const pat : pCHAR; str : string) : BOOLEAN;
  3922. begin
  3923. MatchPatternNoCase := MatchPatternNoCase(pat,pas2c(str));
  3924. end;
  3925. FUNCTION MatchPatternNoCase(const pat : string; str : string) : BOOLEAN;
  3926. begin
  3927. MatchPatternNoCase := MatchPatternNoCase(pas2c(pat),pas2c(str));
  3928. end;
  3929. FUNCTION NewLoadSeg(const file_ : string;const tags : pTagItem) : LONGINT;
  3930. begin
  3931. NewLoadSeg := NewLoadSeg(pas2c(file_),tags);
  3932. end;
  3933. FUNCTION NewLoadSegTagList(const file_ : string;const tags : pTagItem) : LONGINT;
  3934. begin
  3935. NewLoadSegTagList := NewLoadSegTagList(pas2c(file_),tags);
  3936. end;
  3937. FUNCTION PathPart(const path : string) : pCHAR;
  3938. begin
  3939. PathPart := PathPart(pas2c(path));
  3940. end;
  3941. FUNCTION PrintFault(code : LONGINT;const header : string) : BOOLEAN;
  3942. begin
  3943. PrintFault := PrintFault(code,pas2c(header));
  3944. end;
  3945. FUNCTION PutStr(const str : string) : BOOLEAN;
  3946. begin
  3947. PutStr := PutStr(pas2c(str));
  3948. end;
  3949. FUNCTION ReadArgs(const arg_template : string; arra : pLONGINT; args : pRDArgs) : pRDArgs;
  3950. begin
  3951. ReadArgs := ReadArgs(pas2c(arg_template),arra,args);
  3952. end;
  3953. FUNCTION ReadItem(const name : string; maxchars : LONGINT; cSource : pCSource) : LONGINT;
  3954. begin
  3955. ReadItem := ReadItem(pas2c(name),maxchars,cSource);
  3956. end;
  3957. FUNCTION ReadLink(port : pMsgPort; lock : LONGINT;const path : string; buffer : pCHAR; size : ULONG) : BOOLEAN;
  3958. begin
  3959. ReadLink := ReadLink(port,lock,pas2c(path),buffer,size);
  3960. end;
  3961. FUNCTION Relabel(const drive : string;const newname : pCHAR) : BOOLEAN;
  3962. begin
  3963. Relabel := Relabel(pas2c(drive),newname);
  3964. end;
  3965. FUNCTION Relabel(const drive : pCHAR;const newname : string) : BOOLEAN;
  3966. begin
  3967. Relabel := Relabel(drive,pas2c(newname));
  3968. end;
  3969. FUNCTION Relabel(const drive : string;const newname : string) : BOOLEAN;
  3970. begin
  3971. Relabel := Relabel(pas2c(drive),pas2c(newname));
  3972. end;
  3973. FUNCTION RemAssignList(const name : string; lock : LONGINT) : BOOLEAN;
  3974. begin
  3975. RemAssignList := RemAssignList(pas2c(name),lock);
  3976. end;
  3977. FUNCTION RunCommand(seg : LONGINT; stack : LONGINT;const paramptr : string; paramlen : LONGINT) : LONGINT;
  3978. begin
  3979. RunCommand := RunCommand(seg,stack,pas2c(paramptr),paramlen);
  3980. end;
  3981. FUNCTION SetArgStr(const string_ : string) : BOOLEAN;
  3982. begin
  3983. SetArgStr := SetArgStr(pas2c(string_));
  3984. end;
  3985. FUNCTION SetComment(const name : string;const comment : pCHAR) : BOOLEAN;
  3986. begin
  3987. SetComment := SetComment(pas2c(name),comment);
  3988. end;
  3989. FUNCTION SetComment(const name : pCHAR;const comment : string) : BOOLEAN;
  3990. begin
  3991. SetComment := SetComment(name,pas2c(comment));
  3992. end;
  3993. FUNCTION SetComment(const name : string;const comment : string) : BOOLEAN;
  3994. begin
  3995. SetComment := SetComment(pas2c(name),pas2c(comment));
  3996. end;
  3997. FUNCTION SetCurrentDirName(const name : string) : BOOLEAN;
  3998. begin
  3999. SetCurrentDirName := SetCurrentDirName(pas2c(name));
  4000. end;
  4001. FUNCTION SetFileDate(const name : string; date : pDateStamp) : BOOLEAN;
  4002. begin
  4003. SetFileDate := SetFileDate(pas2c(name),date);
  4004. end;
  4005. FUNCTION SetOwner(const name : string; owner_info : LONGINT) : BOOLEAN;
  4006. begin
  4007. SetOwner := SetOwner(pas2c(name),owner_info);
  4008. end;
  4009. FUNCTION SetProgramName(const name : string) : BOOLEAN;
  4010. begin
  4011. SetProgramName := SetProgramName(pas2c(name));
  4012. end;
  4013. FUNCTION SetPrompt(const name : string) : BOOLEAN;
  4014. begin
  4015. SetPrompt := SetPrompt(pas2c(name));
  4016. end;
  4017. FUNCTION SetProtection(const name : string; protect : LONGINT) : BOOLEAN;
  4018. begin
  4019. SetProtection := SetProtection(pas2c(name),protect);
  4020. end;
  4021. FUNCTION SetVar(const name : string; buffer : pCHAR; size : LONGINT; flags : LONGINT) : BOOLEAN;
  4022. begin
  4023. SetVar := SetVar(pas2c(name),buffer,size,flags);
  4024. end;
  4025. FUNCTION SplitName(const name : string; seperator : ULONG; buf : pCHAR; oldpos : LONGINT; size : LONGINT) : smallint;
  4026. begin
  4027. SplitName := SplitName(pas2c(name), seperator,buf,oldpos,size);
  4028. end;
  4029. FUNCTION StrToLong(const string_ : string; VAR value : LONGINT) : LONGINT;
  4030. begin
  4031. StrToLong := StrToLong(pas2c(string_),value);
  4032. end;
  4033. FUNCTION SystemTagList(const command : string;const tags : pTagItem) : LONGINT;
  4034. begin
  4035. SystemTagList := SystemTagList(pas2c(command),tags);
  4036. end;
  4037. FUNCTION DOSSystem(const command : string;const tags : pTagItem) : LONGINT;
  4038. begin
  4039. DOSSystem := DOSSystem(pas2c(command),tags);
  4040. end;
  4041. END. (* UNIT DOS *)