FIOR.LST 56 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502
  1. Listing:
  2. 1 (* Release 3.10 *)
  3. 2 (*-------------------------------------------------------------------------*
  4. 3 * *
  5. 4 * FIOR.MOD - Redirection file support *
  6. 5 * *
  7. 6 * COPYRIGHT (C) 1987..1992 Clarion Software Corporation. *
  8. 7 * All Rights Reserved *
  9. 8 * *
  10. 9 *--------------------------------------------------------------------------*)
  11. 10
  12. 11 (*# call(o_a_copy=>off) *)
  13. 12 (*%F _fdata *)
  14. 13 (*# call(seg_name => null) *)
  15. 14 (*# data(seg_name => null) *)
  16. 15 (*%E *)
  17. 16 (*# module(implementation=>off) *)
  18. 17 (*# check(stack=>off,
  19. 18 index=>off,
  20. 19 range=>off,
  21. 20 overflow=>off,
  22. 21 nil_ptr=>off) *)
  23. 22
  24. 23 IMPLEMENTATION MODULE FIOR ;
  25. 24
  26. 25 (*# call(o_a_copy=>off) *)
  27. 26 FROM Storage IMPORT ALLOCATE,DEALLOCATE,Available ;
  28. 27
  29. 28 (*%F _OS2 *)
  30. 29 IMPORT Str, Lib, SYSTEM, CoreMain;
  31. 30 (*%E *)
  32. 31 (*%T _OS2 *)
  33. 32 IMPORT Str, Lib, SYSTEM, Dos, CoreMain;
  34. 33 (*%E *)
  35. 34 (*%T _mthread *)
  36. 35 IMPORT Process, CoreProc;
  37. 36 (*%E *)
  38. 37
  39. 38 TYPE
  40. 39
  41. 40 String = ARRAY[0..255] OF CHAR ;
  42. ***** ^ not supported yet
  43. ***** ^ not supported yet
  44. 41 StrPtr = POINTER TO String ;
  45. ***** ^ not supported yet
  46. 42 STP = POINTER TO PathStr ;
  47. ***** ^ undeclared identifier
  48. 43
  49. 44 OpenMode = ( OMopen, OMcreate, OMopenrw ) ;
  50. 45
  51. 46
  52. 47 CONST
  53. 48 StrTabSize = 8192 ;
  54. 49 StrTabMax = StrTabSize-1 ;
  55. ***** ^ not supported yet
  56. 50
  57. 51 VAR
  58. 52 StrTab : ARRAY [0..StrTabMax] OF CHAR ;
  59. ***** ^ not supported yet
  60. ***** ^ not supported yet
  61. 53 FilesBase : CARDINAL ;
  62. 54 NoOfStrings : CARDINAL ;
  63. 55 LastDelPtr : CARDINAL ;
  64. 56 StrTabPtr : CARDINAL ;
  65. 57
  66. 58 CONST
  67. 59 MaxNoOfConversions = 50 ;
  68. 60
  69. 61
  70. 62 VAR
  71. 63 NoOfConversions : CARDINAL ;
  72. 64 Conversion : ARRAY[1..MaxNoOfConversions] OF CARDINAL ;
  73. ***** ^ not supported yet
  74. ***** ^ not supported yet
  75. 65 (*%F _mthread *)
  76. 66 IOR : CARDINAL ;
  77. 67 (*%E *)
  78. 68 (*%T _mthread *)
  79. 69 IOR: ARRAY [1..Process.MaxProcess] OF CARDINAL;
  80. ***** ^ not supported yet
  81. ***** ^ not supported yet
  82. ***** ^ not supported yet
  83. 70 (*%E *)
  84. 71
  85. 72 PROCEDURE SetIOR(Num: CARDINAL);
  86. 73
  87. 74 BEGIN
  88. 75 (*%T _mthread *)
  89. 76 IOR[CoreProc._getTID()] := Num;
  90. ***** ^ not supported yet
  91. ***** ^ not supported yet
  92. ***** ^ not supported yet
  93. ***** ^ not supported yet
  94. 77 (*%E *)
  95. 78 (*%F _mthread *)
  96. 79 IOR := Num;
  97. 80 (*%E *)
  98. 81 END SetIOR;
  99. ***** ^ not supported yet
  100. 82
  101. 83 PROCEDURE AddText ( s : ARRAY OF CHAR ) : CARDINAL ;
  102. ***** ^ not supported yet
  103. 84 VAR
  104. 85 len : CARDINAL ;
  105. 86 p : CARDINAL ;
  106. 87 BEGIN
  107. 88 len := Str.Length(s) ;
  108. ***** ^ not supported yet
  109. ***** ^ not supported yet
  110. ***** ^ not supported yet
  111. 89 IF (len+StrTabPtr+1 >= SIZE(StrTab)) THEN RETURN 0 END ;
  112. ***** ^ undeclared identifier
  113. ***** ^ not supported yet
  114. 90 p := StrTabPtr ;
  115. 91 Lib.Move(ADR(s),ADR(StrTab[StrTabPtr]),len) ;
  116. ***** ^ not supported yet
  117. ***** ^ not supported yet
  118. ***** ^ undeclared identifier
  119. ***** ^ not supported yet
  120. ***** ^ undeclared identifier
  121. ***** ^ not supported yet
  122. ***** ^ not supported yet
  123. ***** ^ not supported yet
  124. 92 INC(StrTabPtr,len) ;
  125. ***** ^ undeclared identifier
  126. ***** ^ not supported yet
  127. 93 StrTab[StrTabPtr] := 0C ;
  128. ***** ^ not supported yet
  129. ***** ^ not supported yet
  130. 94 INC(StrTabPtr) ;
  131. ***** ^ undeclared identifier
  132. ***** ^ not supported yet
  133. 95 RETURN p ;
  134. 96 END AddText ;
  135. ***** ^ not supported yet
  136. 97
  137. 98
  138. 99 CONST
  139. 100 FileBuffSize = 4096 ;
  140. 101 FileBuffMax = FileBuffSize-1 ;
  141. ***** ^ not supported yet
  142. 102
  143. 103 TYPE
  144. 104 FileBuffPtr = POINTER TO CHAR ;
  145. ***** ^ not supported yet
  146. 105 VAR
  147. 106 FileBuff : FileBuffPtr ;
  148. ***** ^ not supported yet
  149. 107 FileBuffBase : FileBuffPtr ;
  150. ***** ^ not supported yet
  151. 108
  152. 109
  153. 110 PROCEDURE OpenTextFile ( name : ARRAY OF CHAR ) : BOOLEAN ;
  154. ***** ^ not supported yet
  155. 111 VAR
  156. 112 s : ARRAY[0..79] OF CHAR ;
  157. ***** ^ not supported yet
  158. ***** ^ not supported yet
  159. 113 fb : FileBuffPtr ;
  160. ***** ^ not supported yet
  161. 114 BEGIN
  162. 115 TextFile := Open(name) ;
  163. ***** ^ undeclared identifier
  164. ***** ^ undeclared identifier
  165. ***** ^ not supported yet
  166. 116 IF TextFile = Null THEN RETURN FALSE END ;
  167. ***** ^ undeclared identifier
  168. ***** ^ undeclared identifier
  169. 117 ALLOCATE(fb, FileBuffSize+1) ;
  170. ***** ^ not supported yet
  171. ***** ^ not supported yet
  172. ***** ^ not supported yet
  173. 118 FileBuffBase := fb ;
  174. ***** ^ not supported yet
  175. ***** ^ not supported yet
  176. 119 FileBuff := fb ;
  177. ***** ^ not supported yet
  178. ***** ^ not supported yet
  179. 120 INC(CARDINAL(FileBuff), FileBuffSize);
  180. ***** ^ undeclared identifier
  181. ***** ^ not supported yet
  182. ***** ^ not supported yet
  183. 121 RETURN TRUE ;
  184. 122 END OpenTextFile ;
  185. ***** ^ not supported yet
  186. 123
  187. 124
  188. 125
  189. 126
  190. 127 PROCEDURE ReadTextLn ( VAR l : ARRAY OF CHAR ) ;
  191. ***** ^ not supported yet
  192. 128 VAR c : CHAR ;
  193. 129 i : CARDINAL ;
  194. 130
  195. 131 PROCEDURE ReadTextChar () : CHAR ;
  196. 132 VAR
  197. 133 count : CARDINAL ;
  198. 134 fbp : FileBuffPtr ;
  199. ***** ^ not supported yet
  200. 135 BEGIN
  201. 136 INC(CARDINAL(FileBuff), 1);
  202. ***** ^ undeclared identifier
  203. ***** ^ not supported yet
  204. ***** ^ not supported yet
  205. 137 IF CARDINAL(FileBuff) - CARDINAL(FileBuffBase) >=FileBuffSize THEN
  206. ***** ^ not supported yet
  207. ***** ^ not supported yet
  208. 138 FileBuff := FileBuffBase;
  209. ***** ^ not supported yet
  210. ***** ^ not supported yet
  211. 139 count := FIO.RdBin(TextFile,FileBuff^,FileBuffSize) ;
  212. ***** ^ undeclared identifier
  213. ***** ^ not supported yet
  214. ***** ^ undeclared identifier
  215. ***** ^ not supported yet
  216. ***** ^ not supported yet
  217. 140 IF count<>FileBuffSize THEN
  218. 141 fbp := Lib.AddAddr(FileBuffBase, count) ;
  219. ***** ^ not supported yet
  220. ***** ^ not supported yet
  221. ***** ^ not supported yet
  222. ***** ^ not supported yet
  223. ***** ^ not supported yet
  224. 142 fbp^ := CHR(26) ;
  225. ***** ^ not supported yet
  226. ***** ^ undeclared identifier
  227. ***** ^ not supported yet
  228. 143 END ;
  229. 144 END ;
  230. 145 RETURN FileBuff^ ;
  231. ***** ^ not supported yet
  232. 146 END ReadTextChar ;
  233. ***** ^ not supported yet
  234. 147
  235. 148
  236. 149 BEGIN
  237. 150 i := 0 ;
  238. 151 FileBuff := FileBuff ;
  239. ***** ^ not supported yet
  240. ***** ^ not supported yet
  241. 152 REPEAT (* clear LFs *)
  242. 153 IF CARDINAL(FileBuff) - CARDINAL(FileBuffBase) >=FileBuffMax THEN c := ReadTextChar()
  243. ***** ^ not supported yet
  244. ***** ^ not supported yet
  245. ***** ^ not supported yet
  246. ***** ^ not supported yet
  247. 154 ELSE
  248. 155 INC(CARDINAL(FileBuff), 1);
  249. ***** ^ undeclared identifier
  250. ***** ^ not supported yet
  251. ***** ^ not supported yet
  252. 156 c := FileBuff^ ;
  253. ***** ^ not supported yet
  254. 157 END ;
  255. 158 UNTIL c<>CHR(10) ;
  256. ***** ^ undeclared identifier
  257. ***** ^ not supported yet
  258. 159 IF c=CHR(26) THEN l[0] := c ; INC(i) ; (* check for EOF *)
  259. ***** ^ undeclared identifier
  260. ***** ^ not supported yet
  261. ***** ^ not supported yet
  262. ***** ^ not supported yet
  263. ***** ^ undeclared identifier
  264. ***** ^ not supported yet
  265. 160 ELSE
  266. 161 LOOP
  267. 162 IF (c>=' ')AND(i<HIGH(l)) THEN l[i] := c ; INC(i) ;
  268. ***** ^ undeclared identifier
  269. ***** ^ not supported yet
  270. ***** ^ not supported yet
  271. ***** ^ not supported yet
  272. ***** ^ undeclared identifier
  273. ***** ^ not supported yet
  274. 163 ELSIF (c = CHR(13))OR(c=CHR(26)) THEN EXIT (* EOF treated as end of line *)
  275. ***** ^ undeclared identifier
  276. ***** ^ not supported yet
  277. ***** ^ undeclared identifier
  278. ***** ^ not supported yet
  279. 164 END ;
  280. 165 IF CARDINAL(FileBuff) - CARDINAL(FileBuffBase) >=FileBuffMax THEN c := ReadTextChar()
  281. ***** ^ not supported yet
  282. ***** ^ not supported yet
  283. ***** ^ not supported yet
  284. ***** ^ not supported yet
  285. 166 ELSE
  286. 167 INC(CARDINAL(FileBuff), 1);
  287. ***** ^ undeclared identifier
  288. ***** ^ not supported yet
  289. ***** ^ not supported yet
  290. 168 c := FileBuff^ ;
  291. ***** ^ not supported yet
  292. 169 END ;
  293. 170 END ;
  294. 171 END ;
  295. 172 l[i] := 0C ;
  296. ***** ^ not supported yet
  297. ***** ^ not supported yet
  298. 173 END ReadTextLn ;
  299. ***** ^ not supported yet
  300. 174
  301. 175 PROCEDURE CloseTextFile ;
  302. 176 VAR
  303. 177 fb : POINTER TO ARRAY[0..FileBuffMax] OF CHAR ;
  304. ***** ^ not supported yet
  305. ***** ^ not supported yet
  306. 178 BEGIN
  307. 179 IF TextFile<>Null THEN
  308. ***** ^ undeclared identifier
  309. ***** ^ undeclared identifier
  310. 180 FIO.Close(TextFile) ;
  311. ***** ^ undeclared identifier
  312. ***** ^ not supported yet
  313. ***** ^ undeclared identifier
  314. 181 END ;
  315. 182 SetIOR(FIO.IOresult());
  316. ***** ^ not supported yet
  317. ***** ^ undeclared identifier
  318. ***** ^ not supported yet
  319. ***** ^ not supported yet
  320. 183 DEALLOCATE(FileBuffBase, FileBuffSize+1) ;
  321. ***** ^ not supported yet
  322. ***** ^ not supported yet
  323. ***** ^ not supported yet
  324. 184 END CloseTextFile ;
  325. ***** ^ not supported yet
  326. 185
  327. 186 (*%F _OS2 *)
  328. 187 PROCEDURE DosCall ( VAR R : SYSTEM.Registers ) : BOOLEAN ;
  329. 188 BEGIN
  330. 189 (*%T _mthread *)
  331. 190 (*%F _OS2 *)
  332. 191 Process.Lock();
  333. 192 (*%E *)
  334. 193 (*%E *)
  335. 194 Lib.Dos(R) ;
  336. 195 (*%T _mthread *)
  337. 196 (*%F _OS2 *)
  338. 197 Process.Unlock();
  339. 198 (*%E *)
  340. 199 (*%E *)
  341. 200 WITH R DO
  342. 201 IF (BITSET{SYSTEM.CarryFlag}*Flags)#BITSET{} THEN
  343. 202 SetIOR(AX);
  344. 203 RETURN TRUE ;
  345. 204 ELSE
  346. 205 SetIOR(0) ;
  347. 206 RETURN FALSE ;
  348. 207 END ;
  349. 208 END ;
  350. 209 END DosCall ;
  351. 210
  352. 211 PROCEDURE GetDosVersion (): CARDINAL;
  353. 212 VAR r : SYSTEM.Registers; t : SHORTCARD;
  354. 213 BEGIN
  355. 214 WITH r DO
  356. 215 AH := 30H;
  357. 216 Lib.Dos(r);
  358. 217 t := AH;
  359. 218 AH :=AL;
  360. 219 AL :=t;
  361. 220 RETURN AX
  362. 221 END;
  363. 222 END GetDosVersion;
  364. 223
  365. 224 PROCEDURE ExpandPath ( path : ARRAY OF CHAR ;
  366. 225 VAR fullpath : ARRAY OF CHAR ) ;
  367. 226
  368. 227 VAR
  369. 228 i,p,l : CARDINAL ;
  370. 229 c : CHAR ;
  371. 230 hp : CARDINAL ;
  372. 231 lim : CARDINAL ;
  373. 232 R : SYSTEM.Registers ;
  374. 233 ps : ARRAY[0..13] OF CHAR ;
  375. 234 po : PathStr ;
  376. 235
  377. 236 BEGIN
  378. 237 WITH R DO
  379. 238 i := 0 ;
  380. 239 hp := HIGH(path) ;
  381. 240 IF (hp=0)OR(path[1]<>':')OR(path[0]=0C) THEN
  382. 241 AH := 19H ;
  383. 242 Lib.Dos(R) ;
  384. 243 po[0] := CHR(SHORTCARD('A')+AL) ;
  385. 244 p := 0 ;
  386. 245 ELSE
  387. 246 po[0] := CAP(path[0]) ;
  388. 247 p := 2 ;
  389. 248 END ;
  390. 249 po[1] := ':' ;
  391. 250 po[2] := '\' ;
  392. 251 IF path[p]<>'\' THEN
  393. 252 DL := SHORTCARD(po[0])-SHORTCARD('A')+1 ;
  394. 253 DS := Seg(po) ;
  395. 254 SI := Ofs(po[3]) ;
  396. 255 AH := 47H ;
  397. 256 IF DosCall(R) THEN
  398. 257 fullpath[0] := 0C ;
  399. 258 RETURN ;
  400. 259 END ;
  401. 260 i := Str.Length(po) ;
  402. 261 IF (i>3) THEN po[i] := '\' ; INC(i) ; END ;
  403. 262 ELSE
  404. 263 i := 3 ; INC(p) ;
  405. 264 END ;
  406. 265 po[i] :=CHR (0) ;
  407. 266 LOOP
  408. 267 i := 0 ;
  409. 268 lim := 8 ;
  410. 269 LOOP
  411. 270 IF (p>hp) THEN ps[i] := '\' ; INC(i); EXIT; END ;
  412. 271 c := path[p] ; INC(p) ;
  413. 272 IF (c=0C)OR(c='\') THEN ps[i] := '\' ; INC(i); EXIT; END;
  414. 273 IF (c='.') THEN ps[i] := c ; INC(i); lim := 3;
  415. 274 ELSIF (lim>0) THEN ps[i] := c ; INC(i); DEC(lim) ;
  416. 275 END ;
  417. 276 END ;
  418. 277 ps[i] := 0C ;
  419. 278 IF (i>1) THEN
  420. 279 IF ps[0] = '.' THEN (* .. = parent *)
  421. 280 IF (i=3)AND(ps[1]='.') THEN
  422. 281 l := Str.Length(po)-1 ;
  423. 282 IF l>2 THEN
  424. 283 WHILE (po[l-1]<>'\') DO DEC(l) END ;
  425. 284 END ;
  426. 285 po[l] := 0C ;
  427. 286 ELSIF i<>2 THEN
  428. 287 Str.Append(po,ps) ;
  429. 288 END ;
  430. 289 ELSE
  431. 290 Str.Append(po,ps) ;
  432. 291 END ;
  433. 292 END ;
  434. 293 IF c=0C THEN EXIT END ;
  435. 294 END ;
  436. 295 l := Str.Length(po)-1 ;
  437. 296 IF (l>2) AND (po[l] = '\') THEN po[l] := 0C END ;
  438. 297 Str.Copy(fullpath,po) ;
  439. 298 Str.Caps(fullpath) ;
  440. 299 END ;
  441. 300 END ExpandPath ;
  442. 301 (*%E *)
  443. 302
  444. 303 (*%T _OS2 *)
  445. 304 PROCEDURE GetDosVersion(): CARDINAL;
  446. 305
  447. 306 VAR
  448. 307 Version: CARDINAL;
  449. 308
  450. 309 BEGIN
  451. 310 Dos.GetVersion(Version);
  452. ***** ^ not supported yet
  453. ***** ^ not supported yet
  454. ***** ^ not supported yet
  455. 311 RETURN Version;
  456. 312 END GetDosVersion;
  457. ***** ^ not supported yet
  458. 313
  459. 314 (* Utility routines *)
  460. 315
  461. 316 PROCEDURE ExpandPath ( path : ARRAY OF CHAR ;
  462. ***** ^ not supported yet
  463. 317 VAR fullpath : ARRAY OF CHAR ) ;
  464. ***** ^ not supported yet
  465. 318
  466. 319 VAR
  467. 320 i,p,l : CARDINAL ;
  468. 321 c : CHAR ;
  469. 322 hp : CARDINAL ;
  470. 323 lim : CARDINAL ;
  471. 324 ps : ARRAY[0..13] OF CHAR ;
  472. ***** ^ not supported yet
  473. ***** ^ not supported yet
  474. 325 po : PathStr ;
  475. ***** ^ undeclared identifier
  476. 326 Drive, Length : CARDINAL;
  477. 327 Map: LONGCARD;
  478. ***** ^ undeclared identifier
  479. 328
  480. 329 BEGIN
  481. 330 i := 0 ;
  482. 331 hp := HIGH(path) ;
  483. ***** ^ undeclared identifier
  484. ***** ^ not supported yet
  485. 332 IF (hp=0)OR(path[1]<>':')OR(path[0]=0C) THEN
  486. ***** ^ not supported yet
  487. ***** ^ not supported yet
  488. ***** ^ not supported yet
  489. ***** ^ not supported yet
  490. 333 SYSTEM.Eval(Dos.QCurDisk(Drive, Map));
  491. ***** ^ not supported yet
  492. ***** ^ not supported yet
  493. ***** ^ not supported yet
  494. ***** ^ not supported yet
  495. ***** ^ not supported yet
  496. 334 po[0] := CHR(CARDINAL('A')+Drive-1) ;
  497. ***** ^ not supported yet
  498. ***** ^ not supported yet
  499. ***** ^ undeclared identifier
  500. ***** ^ not supported yet
  501. ***** ^ not supported yet
  502. 335 p := 0 ;
  503. 336 ELSE
  504. 337 po[0] := CAP(path[0]) ;
  505. ***** ^ not supported yet
  506. ***** ^ not supported yet
  507. ***** ^ undeclared identifier
  508. ***** ^ not supported yet
  509. ***** ^ not supported yet
  510. 338 p := 2 ;
  511. 339 END ;
  512. 340 po[1] := ':' ;
  513. ***** ^ not supported yet
  514. ***** ^ not supported yet
  515. 341 po[2] := '\' ;
  516. ***** ^ not supported yet
  517. ***** ^ not supported yet
  518. 342 IF path[p]<>'\' THEN
  519. ***** ^ not supported yet
  520. ***** ^ not supported yet
  521. 343 Drive := CARDINAL(po[0])-CARDINAL('A')+1 ;
  522. ***** ^ not supported yet
  523. ***** ^ not supported yet
  524. ***** ^ not supported yet
  525. 344 Length := 77;
  526. 345 SYSTEM.Eval(Dos.QCurDir(Drive, FarADR(po[3]), Length));
  527. ***** ^ not supported yet
  528. ***** ^ not supported yet
  529. ***** ^ not supported yet
  530. ***** ^ not supported yet
  531. ***** ^ undeclared identifier
  532. ***** ^ not supported yet
  533. ***** ^ not supported yet
  534. ***** ^ not supported yet
  535. 346 i := Str.Length(po) ;
  536. ***** ^ not supported yet
  537. ***** ^ not supported yet
  538. ***** ^ not supported yet
  539. 347 IF (i>3) THEN po[i] := '\' ; INC(i) ; END ;
  540. ***** ^ not supported yet
  541. ***** ^ not supported yet
  542. ***** ^ undeclared identifier
  543. ***** ^ not supported yet
  544. 348 ELSE
  545. 349 i := 3 ; INC(p) ;
  546. ***** ^ undeclared identifier
  547. ***** ^ not supported yet
  548. 350 END ;
  549. 351 po[i] :=CHR (0) ;
  550. ***** ^ not supported yet
  551. ***** ^ not supported yet
  552. ***** ^ undeclared identifier
  553. ***** ^ not supported yet
  554. 352 LOOP
  555. 353 i := 0 ;
  556. 354 lim := 8 ;
  557. 355 LOOP
  558. 356 IF (p>hp) THEN ps[i] := '\' ; INC(i); EXIT; END ;
  559. ***** ^ not supported yet
  560. ***** ^ not supported yet
  561. ***** ^ undeclared identifier
  562. ***** ^ not supported yet
  563. 357 c := path[p] ; INC(p) ;
  564. ***** ^ not supported yet
  565. ***** ^ not supported yet
  566. ***** ^ undeclared identifier
  567. ***** ^ not supported yet
  568. 358 IF (c=0C)OR(c='\') THEN ps[i] := '\' ; INC(i); EXIT; END;
  569. ***** ^ not supported yet
  570. ***** ^ not supported yet
  571. ***** ^ undeclared identifier
  572. ***** ^ not supported yet
  573. 359 IF (c='.') THEN ps[i] := c ; INC(i); lim := 3;
  574. ***** ^ not supported yet
  575. ***** ^ not supported yet
  576. ***** ^ undeclared identifier
  577. ***** ^ not supported yet
  578. 360 ELSIF (lim>0) THEN ps[i] := c ; INC(i); DEC(lim) ;
  579. ***** ^ not supported yet
  580. ***** ^ not supported yet
  581. ***** ^ undeclared identifier
  582. ***** ^ not supported yet
  583. ***** ^ undeclared identifier
  584. ***** ^ not supported yet
  585. 361 END ;
  586. 362 END ;
  587. 363 ps[i] := 0C ;
  588. ***** ^ not supported yet
  589. ***** ^ not supported yet
  590. 364 IF (i>1) THEN
  591. 365 IF ps[0] = '.' THEN (* .. = parent *)
  592. ***** ^ not supported yet
  593. ***** ^ not supported yet
  594. 366 IF (i=3)AND(ps[1]='.') THEN
  595. ***** ^ not supported yet
  596. ***** ^ not supported yet
  597. 367 l := Str.Length(po)-1 ;
  598. ***** ^ not supported yet
  599. ***** ^ not supported yet
  600. ***** ^ not supported yet
  601. 368 IF l>2 THEN
  602. 369 WHILE (po[l-1]<>'\') DO DEC(l) END ;
  603. ***** ^ not supported yet
  604. ***** ^ not supported yet
  605. ***** ^ undeclared identifier
  606. ***** ^ not supported yet
  607. 370 END ;
  608. 371 po[l] := 0C ;
  609. ***** ^ not supported yet
  610. ***** ^ not supported yet
  611. 372 ELSIF i<>2 THEN
  612. 373 Str.Append(po,ps) ;
  613. ***** ^ not supported yet
  614. ***** ^ not supported yet
  615. ***** ^ not supported yet
  616. ***** ^ not supported yet
  617. 374 END ;
  618. 375 ELSE
  619. 376 Str.Append(po,ps) ;
  620. ***** ^ not supported yet
  621. ***** ^ not supported yet
  622. ***** ^ not supported yet
  623. ***** ^ not supported yet
  624. 377 END ;
  625. 378 END ;
  626. 379 IF c=0C THEN EXIT END ;
  627. 380 END ;
  628. 381 l := Str.Length(po)-1 ;
  629. ***** ^ not supported yet
  630. ***** ^ not supported yet
  631. ***** ^ not supported yet
  632. 382 IF (l>2) AND (po[l] = '\') THEN po[l] := 0C END ;
  633. ***** ^ not supported yet
  634. ***** ^ not supported yet
  635. ***** ^ not supported yet
  636. ***** ^ not supported yet
  637. 383 Str.Copy(fullpath,po) ;
  638. ***** ^ not supported yet
  639. ***** ^ not supported yet
  640. ***** ^ not supported yet
  641. ***** ^ not supported yet
  642. 384 Str.Caps(fullpath) ;
  643. ***** ^ not supported yet
  644. ***** ^ not supported yet
  645. ***** ^ not supported yet
  646. 385 END ExpandPath ;
  647. ***** ^ not supported yet
  648. 386 (*%E *)
  649. 387
  650. 388 PROCEDURE AbsolutePath ( name : ARRAY OF CHAR ) : BOOLEAN ;
  651. ***** ^ not supported yet
  652. 389 BEGIN
  653. 390 RETURN (name[0]='\')OR(name[1]=':') ;
  654. ***** ^ not supported yet
  655. ***** ^ not supported yet
  656. ***** ^ not supported yet
  657. ***** ^ not supported yet
  658. 391 END AbsolutePath ;
  659. ***** ^ not supported yet
  660. 392
  661. 393 PROCEDURE SplitPath ( path : ARRAY OF CHAR ;
  662. ***** ^ not supported yet
  663. 394 VAR head,tail : ARRAY OF CHAR ) ;
  664. ***** ^ not supported yet
  665. 395 VAR
  666. 396 L : CARDINAL ;
  667. 397 c : CHAR ;
  668. 398 i : CARDINAL ;
  669. 399 BEGIN
  670. 400 i := Str.Length(path) ;
  671. ***** ^ not supported yet
  672. ***** ^ not supported yet
  673. ***** ^ not supported yet
  674. 401 LOOP
  675. 402 IF (i=0) THEN EXIT END ;
  676. 403 DEC(i) ; c := path[i] ;
  677. ***** ^ undeclared identifier
  678. ***** ^ not supported yet
  679. ***** ^ not supported yet
  680. ***** ^ not supported yet
  681. 404 IF (c='\') THEN EXIT END ;
  682. 405 IF (c=':') THEN INC(i) ; EXIT END ;
  683. ***** ^ undeclared identifier
  684. ***** ^ not supported yet
  685. 406 END ;
  686. 407 Str.Slice(head,path,0,i) ;
  687. ***** ^ not supported yet
  688. ***** ^ not supported yet
  689. ***** ^ not supported yet
  690. ***** ^ not supported yet
  691. ***** ^ not supported yet
  692. 408 IF c='\' THEN INC(i) END ;
  693. ***** ^ undeclared identifier
  694. ***** ^ not supported yet
  695. 409 Str.Slice(tail,path,i,HIGH(tail)+1) ;
  696. ***** ^ not supported yet
  697. ***** ^ not supported yet
  698. ***** ^ not supported yet
  699. ***** ^ not supported yet
  700. ***** ^ undeclared identifier
  701. ***** ^ not supported yet
  702. ***** ^ not supported yet
  703. 410 Str.Caps(head) ; Str.Caps(tail) ;
  704. ***** ^ not supported yet
  705. ***** ^ not supported yet
  706. ***** ^ not supported yet
  707. ***** ^ not supported yet
  708. ***** ^ not supported yet
  709. ***** ^ not supported yet
  710. 411 END SplitPath ;
  711. ***** ^ not supported yet
  712. 412
  713. 413 PROCEDURE MakePath ( VAR path : ARRAY OF CHAR ;
  714. ***** ^ not supported yet
  715. 414 head,tail : ARRAY OF CHAR ) ;
  716. ***** ^ not supported yet
  717. 415 VAR
  718. 416 l : CARDINAL ;
  719. 417 BEGIN
  720. 418 ExpandPath(head,path);
  721. ***** ^ not supported yet
  722. ***** ^ not supported yet
  723. ***** ^ not supported yet
  724. 419 l := Str.Length(path) ;
  725. ***** ^ not supported yet
  726. ***** ^ not supported yet
  727. ***** ^ not supported yet
  728. 420 IF (path[l-1]<>'\') THEN
  729. ***** ^ not supported yet
  730. ***** ^ not supported yet
  731. 421 IF (tail[0]<>'\')AND(l<HIGH(path)) THEN
  732. ***** ^ not supported yet
  733. ***** ^ not supported yet
  734. ***** ^ undeclared identifier
  735. ***** ^ not supported yet
  736. 422 path[l] := '\' ;
  737. ***** ^ not supported yet
  738. ***** ^ not supported yet
  739. 423 path[l+1] := 0C ;
  740. ***** ^ not supported yet
  741. ***** ^ not supported yet
  742. 424 END ;
  743. 425 ELSIF (tail[0]='\') THEN
  744. ***** ^ not supported yet
  745. ***** ^ not supported yet
  746. 426 path[l-1] := 0C ;
  747. ***** ^ not supported yet
  748. ***** ^ not supported yet
  749. 427 END ;
  750. 428 Str.Append(path,tail) ;
  751. ***** ^ not supported yet
  752. ***** ^ not supported yet
  753. ***** ^ not supported yet
  754. ***** ^ not supported yet
  755. 429 ExpandPath(path,path) ;
  756. ***** ^ not supported yet
  757. ***** ^ not supported yet
  758. ***** ^ not supported yet
  759. 430 END MakePath ;
  760. ***** ^ not supported yet
  761. 431
  762. 432 PROCEDURE ExtensionPos ( VAR s : ARRAY OF CHAR ) : CARDINAL ;
  763. ***** ^ not supported yet
  764. 433 VAR
  765. 434 c : CHAR ;
  766. 435 l,i : CARDINAL ;
  767. 436 BEGIN
  768. 437 l := Str.Length(s) ;
  769. ***** ^ not supported yet
  770. ***** ^ not supported yet
  771. ***** ^ not supported yet
  772. 438 IF l=0 THEN RETURN MAX(CARDINAL) END ;
  773. ***** ^ undeclared identifier
  774. ***** ^ not supported yet
  775. 439 i := l ;
  776. 440 REPEAT
  777. 441 DEC(i) ;
  778. ***** ^ undeclared identifier
  779. ***** ^ not supported yet
  780. 442 c := s[i] ;
  781. ***** ^ not supported yet
  782. ***** ^ not supported yet
  783. 443 UNTIL (i=0) OR (c='\') OR (c=':') OR (c='.') ;
  784. 444 IF (c='.') THEN RETURN i END ;
  785. 445 RETURN MAX(CARDINAL) ;
  786. ***** ^ undeclared identifier
  787. ***** ^ not supported yet
  788. 446 END ExtensionPos ;
  789. ***** ^ not supported yet
  790. 447
  791. 448
  792. 449
  793. 450 PROCEDURE AddExtension ( VAR s : ARRAY OF CHAR ; ext : ARRAY OF CHAR ) ;
  794. ***** ^ not supported yet
  795. ***** ^ not supported yet
  796. 451 BEGIN
  797. 452 IF ExtensionPos(s)=MAX(CARDINAL) THEN
  798. ***** ^ not supported yet
  799. ***** ^ not supported yet
  800. ***** ^ undeclared identifier
  801. ***** ^ not supported yet
  802. 453 Str.Append(s,'.') ;
  803. ***** ^ not supported yet
  804. ***** ^ not supported yet
  805. ***** ^ not supported yet
  806. ***** ^ not supported yet
  807. 454 IF (ext[0]<=' ') THEN RETURN END ;
  808. ***** ^ not supported yet
  809. ***** ^ not supported yet
  810. 455 Str.Append(s,ext) ;
  811. ***** ^ not supported yet
  812. ***** ^ not supported yet
  813. ***** ^ not supported yet
  814. ***** ^ not supported yet
  815. 456 END ;
  816. 457 END AddExtension ;
  817. ***** ^ not supported yet
  818. 458
  819. 459 PROCEDURE RemoveExtension ( VAR s : ARRAY OF CHAR ) ;
  820. ***** ^ not supported yet
  821. 460 VAR
  822. 461 p : CARDINAL ;
  823. 462 BEGIN
  824. 463 p := ExtensionPos(s) ;
  825. ***** ^ not supported yet
  826. ***** ^ not supported yet
  827. 464 IF p<>MAX(CARDINAL) THEN s[p] := 0C END ;
  828. ***** ^ undeclared identifier
  829. ***** ^ not supported yet
  830. ***** ^ not supported yet
  831. ***** ^ not supported yet
  832. 465 END RemoveExtension ;
  833. ***** ^ not supported yet
  834. 466
  835. 467
  836. 468 PROCEDURE ChangeExtension ( VAR s : ARRAY OF CHAR ; ext : ARRAY OF CHAR ) ;
  837. ***** ^ not supported yet
  838. ***** ^ not supported yet
  839. 469 BEGIN
  840. 470 RemoveExtension(s) ;
  841. ***** ^ not supported yet
  842. ***** ^ not supported yet
  843. 471 AddExtension(s,ext) ;
  844. ***** ^ not supported yet
  845. ***** ^ not supported yet
  846. ***** ^ not supported yet
  847. 472 END ChangeExtension ;
  848. ***** ^ not supported yet
  849. 473
  850. 474 PROCEDURE IsExtension ( s : ARRAY OF CHAR ; ext : ARRAY OF CHAR ) : BOOLEAN ;
  851. ***** ^ not supported yet
  852. ***** ^ not supported yet
  853. 475 VAR
  854. 476 es: PathStr;
  855. ***** ^ undeclared identifier
  856. 477 BEGIN
  857. 478 Str.Concat(es, '*.', ext);
  858. ***** ^ not supported yet
  859. ***** ^ not supported yet
  860. ***** ^ not supported yet
  861. ***** ^ not supported yet
  862. ***** ^ not supported yet
  863. 479 RETURN Str.Match(s, es);
  864. ***** ^ not supported yet
  865. ***** ^ not supported yet
  866. ***** ^ not supported yet
  867. ***** ^ not supported yet
  868. 480 END IsExtension ;
  869. ***** ^ not supported yet
  870. 481
  871. 482
  872. 483 PROCEDURE FindAndOpenPath ( name : ARRAY OF CHAR ;
  873. ***** ^ not supported yet
  874. 484 om : OpenMode ;
  875. 485 VAR fullname : PathStr ;
  876. ***** ^ undeclared identifier
  877. 486 VAR h : File ) : BOOLEAN ;
  878. ***** ^ undeclared identifier
  879. 487 VAR
  880. 488 l : CARDINAL ;
  881. 489 i,p : CARDINAL ;
  882. 490 sp : StrPtr ;
  883. ***** ^ not supported yet
  884. 491 path : PathStr ;
  885. ***** ^ undeclared identifier
  886. 492
  887. 493 amatch : BOOLEAN ;
  888. 494 savep : CARDINAL ;
  889. 495
  890. 496 PROCEDURE TestFileExists ( name : ARRAY OF CHAR ) : BOOLEAN ;
  891. ***** ^ not supported yet
  892. 497 VAR
  893. 498 path : PathStr ;
  894. ***** ^ undeclared identifier
  895. 499 found : BOOLEAN ;
  896. 500 BEGIN
  897. 501 ExpandPath(name,path) ;
  898. ***** ^ not supported yet
  899. ***** ^ not supported yet
  900. ***** ^ not supported yet
  901. 502 IF om=OMcreate THEN found := TRUE
  902. ***** ^ not supported yet
  903. ***** ^ not supported yet
  904. 503 ELSE
  905. 504 IF om=OMopen THEN
  906. ***** ^ not supported yet
  907. ***** ^ not supported yet
  908. 505 h := FIO.OpenRead(path) ;
  909. ***** ^ not supported yet
  910. ***** ^ undeclared identifier
  911. ***** ^ not supported yet
  912. ***** ^ not supported yet
  913. 506 ELSE
  914. 507 h := FIO.Open(path) ;
  915. ***** ^ not supported yet
  916. ***** ^ undeclared identifier
  917. ***** ^ not supported yet
  918. ***** ^ not supported yet
  919. 508 END;
  920. 509 SetIOR(FIO.IOresult());
  921. ***** ^ not supported yet
  922. ***** ^ undeclared identifier
  923. ***** ^ not supported yet
  924. ***** ^ not supported yet
  925. 510 found := (IOresult()=0) ;
  926. ***** ^ undeclared identifier
  927. ***** ^ not supported yet
  928. 511 IF (IOresult()<>0) THEN h := Null END ;
  929. ***** ^ undeclared identifier
  930. ***** ^ not supported yet
  931. ***** ^ not supported yet
  932. ***** ^ undeclared identifier
  933. 512 END ;
  934. 513 IF found THEN Str.Copy(fullname,path) END ;
  935. ***** ^ not supported yet
  936. ***** ^ not supported yet
  937. ***** ^ not supported yet
  938. ***** ^ not supported yet
  939. 514 RETURN found ;
  940. 515 END TestFileExists ;
  941. ***** ^ not supported yet
  942. 516
  943. 517
  944. 518 BEGIN
  945. 519 SetIOR(0);
  946. ***** ^ not supported yet
  947. ***** ^ not supported yet
  948. 520 amatch := FALSE ;
  949. 521 h := Null ;
  950. ***** ^ not supported yet
  951. ***** ^ undeclared identifier
  952. 522 IF AbsolutePath(name) THEN i := NoOfConversions
  953. ***** ^ not supported yet
  954. ***** ^ not supported yet
  955. 523 ELSE i := 0 ;
  956. 524 END ;
  957. 525 LOOP
  958. 526 INC(i) ;
  959. ***** ^ undeclared identifier
  960. ***** ^ not supported yet
  961. 527 IF i>NoOfConversions THEN
  962. 528 IF NOT amatch THEN
  963. 529 IF TestFileExists ( name ) THEN
  964. ***** ^ not supported yet
  965. ***** ^ not supported yet
  966. 530 RETURN TRUE
  967. 531 END ;
  968. 532 END ;
  969. 533 RETURN FALSE ;
  970. 534 END ;
  971. 535 p := Conversion[i] ;
  972. ***** ^ not supported yet
  973. ***** ^ not supported yet
  974. 536 sp := ADR(StrTab[p]) ;
  975. ***** ^ not supported yet
  976. ***** ^ undeclared identifier
  977. ***** ^ not supported yet
  978. ***** ^ not supported yet
  979. 537 IF Str.Match(name,sp^) THEN
  980. ***** ^ not supported yet
  981. ***** ^ not supported yet
  982. ***** ^ not supported yet
  983. ***** ^ not supported yet
  984. 538 amatch := TRUE ;
  985. 539 LOOP
  986. 540 INC(p,Str.Length(sp^)+1) ;
  987. ***** ^ undeclared identifier
  988. ***** ^ not supported yet
  989. ***** ^ not supported yet
  990. ***** ^ not supported yet
  991. ***** ^ not supported yet
  992. 541 sp := ADR(StrTab[p]) ;
  993. ***** ^ not supported yet
  994. ***** ^ undeclared identifier
  995. ***** ^ not supported yet
  996. ***** ^ not supported yet
  997. 542 IF sp^[0]=0C THEN EXIT END ;
  998. ***** ^ not supported yet
  999. ***** ^ not supported yet
  1000. 543 MakePath(path,sp^,name) ;
  1001. ***** ^ not supported yet
  1002. ***** ^ not supported yet
  1003. ***** ^ not supported yet
  1004. ***** ^ not supported yet
  1005. 544 IF TestFileExists ( path ) THEN
  1006. ***** ^ not supported yet
  1007. ***** ^ not supported yet
  1008. 545 RETURN TRUE ;
  1009. 546 END ;
  1010. 547 END ;
  1011. 548 END ;
  1012. 549 END ;
  1013. 550 END FindAndOpenPath ;
  1014. ***** ^ not supported yet
  1015. 551
  1016. 552 PROCEDURE FindPath ( name : ARRAY OF CHAR ;
  1017. ***** ^ not supported yet
  1018. 553 VAR fullname : PathStr ) : BOOLEAN ;
  1019. ***** ^ undeclared identifier
  1020. 554 VAR
  1021. 555 h : File ;
  1022. ***** ^ undeclared identifier
  1023. 556 b : BOOLEAN ;
  1024. 557 BEGIN
  1025. 558 b := FindAndOpenPath(name,OMopen,fullname,h) ;
  1026. ***** ^ not supported yet
  1027. ***** ^ not supported yet
  1028. ***** ^ not supported yet
  1029. ***** ^ not supported yet
  1030. ***** ^ not supported yet
  1031. 559 IF h<>Null THEN FIO.Close(h) END ;
  1032. ***** ^ not supported yet
  1033. ***** ^ undeclared identifier
  1034. ***** ^ undeclared identifier
  1035. ***** ^ not supported yet
  1036. ***** ^ not supported yet
  1037. 560 RETURN b ;
  1038. 561 END FindPath ;
  1039. ***** ^ not supported yet
  1040. 562
  1041. 563 PROCEDURE FindNewPath ( name : ARRAY OF CHAR ;
  1042. ***** ^ not supported yet
  1043. 564 VAR fullname : PathStr ) : BOOLEAN ;
  1044. ***** ^ undeclared identifier
  1045. 565 VAR
  1046. 566 h : File ;
  1047. ***** ^ undeclared identifier
  1048. 567 b : BOOLEAN ;
  1049. 568 BEGIN
  1050. 569 b := FindAndOpenPath(name,OMcreate,fullname,h) ;
  1051. ***** ^ not supported yet
  1052. ***** ^ not supported yet
  1053. ***** ^ not supported yet
  1054. ***** ^ not supported yet
  1055. ***** ^ not supported yet
  1056. 570 IF h<>Null THEN FIO.Close(h) END ;
  1057. ***** ^ not supported yet
  1058. ***** ^ undeclared identifier
  1059. ***** ^ undeclared identifier
  1060. ***** ^ not supported yet
  1061. ***** ^ not supported yet
  1062. 571 RETURN b ;
  1063. 572 END FindNewPath ;
  1064. ***** ^ not supported yet
  1065. 573
  1066. 574
  1067. 575
  1068. 576 PROCEDURE OpenOrCreateFile ( name : ARRAY OF CHAR ;
  1069. ***** ^ not supported yet
  1070. 577 om : OpenMode ) : CARDINAL ;
  1071. 578 VAR
  1072. 579 h : File ;
  1073. ***** ^ undeclared identifier
  1074. 580 BEGIN
  1075. 581 h := Null ;
  1076. ***** ^ not supported yet
  1077. ***** ^ undeclared identifier
  1078. 582 SetIOR(0);
  1079. ***** ^ not supported yet
  1080. ***** ^ not supported yet
  1081. 583 IF FindAndOpenPath(name,om,LastPath,h) THEN
  1082. ***** ^ not supported yet
  1083. ***** ^ not supported yet
  1084. ***** ^ not supported yet
  1085. ***** ^ undeclared identifier
  1086. ***** ^ not supported yet
  1087. 584 IF (h=Null)OR(IOresult()<>0) THEN
  1088. ***** ^ not supported yet
  1089. ***** ^ undeclared identifier
  1090. ***** ^ undeclared identifier
  1091. ***** ^ not supported yet
  1092. 585 IF h<>Null THEN FIO.Close(h) END ;
  1093. ***** ^ not supported yet
  1094. ***** ^ undeclared identifier
  1095. ***** ^ undeclared identifier
  1096. ***** ^ not supported yet
  1097. ***** ^ not supported yet
  1098. 586 ExpandPath(LastPath,LastPath) ;
  1099. ***** ^ not supported yet
  1100. ***** ^ undeclared identifier
  1101. ***** ^ undeclared identifier
  1102. 587 IF om=OMcreate THEN h := FIO.Create(LastPath)
  1103. ***** ^ not supported yet
  1104. ***** ^ not supported yet
  1105. ***** ^ not supported yet
  1106. ***** ^ undeclared identifier
  1107. ***** ^ not supported yet
  1108. ***** ^ undeclared identifier
  1109. 588 ELSIF om=OMopen THEN h := FIO.OpenRead(LastPath) ;
  1110. ***** ^ not supported yet
  1111. ***** ^ not supported yet
  1112. ***** ^ not supported yet
  1113. ***** ^ undeclared identifier
  1114. ***** ^ not supported yet
  1115. ***** ^ undeclared identifier
  1116. 589 ELSE h := FIO.Open(LastPath) ;
  1117. ***** ^ not supported yet
  1118. ***** ^ undeclared identifier
  1119. ***** ^ not supported yet
  1120. ***** ^ undeclared identifier
  1121. 590 END;
  1122. 591 SetIOR(FIO.IOresult());
  1123. ***** ^ not supported yet
  1124. ***** ^ undeclared identifier
  1125. ***** ^ not supported yet
  1126. ***** ^ not supported yet
  1127. 592 END ;
  1128. 593 ELSE
  1129. 594 IF IOresult()=0 THEN SetIOR(2) END ;
  1130. ***** ^ undeclared identifier
  1131. ***** ^ not supported yet
  1132. ***** ^ not supported yet
  1133. ***** ^ not supported yet
  1134. 595 END ;
  1135. 596 IF IOresult()<>0 THEN
  1136. ***** ^ undeclared identifier
  1137. ***** ^ not supported yet
  1138. 597 h := Null ;
  1139. ***** ^ not supported yet
  1140. ***** ^ undeclared identifier
  1141. 598 END ;
  1142. 599 RETURN h ;
  1143. ***** ^ not supported yet
  1144. 600 END OpenOrCreateFile ;
  1145. ***** ^ not supported yet
  1146. 601
  1147. 602
  1148. 603 PROCEDURE Create ( name : ARRAY OF CHAR ) : File ;
  1149. ***** ^ not supported yet
  1150. ***** ^ undeclared identifier
  1151. 604 BEGIN
  1152. 605 RETURN OpenOrCreateFile(name,OMcreate) ;
  1153. ***** ^ not supported yet
  1154. ***** ^ not supported yet
  1155. ***** ^ not supported yet
  1156. 606 END Create ;
  1157. ***** ^ not supported yet
  1158. 607
  1159. 608
  1160. 609 PROCEDURE Open ( name : ARRAY OF CHAR ) : File ;
  1161. ***** ^ not supported yet
  1162. ***** ^ undeclared identifier
  1163. 610 BEGIN
  1164. 611 RETURN OpenOrCreateFile(name,OMopen) ;
  1165. ***** ^ not supported yet
  1166. ***** ^ not supported yet
  1167. ***** ^ not supported yet
  1168. 612 END Open ;
  1169. ***** ^ not supported yet
  1170. 613
  1171. 614 PROCEDURE OpenRW ( name : ARRAY OF CHAR ) : File ;
  1172. ***** ^ not supported yet
  1173. ***** ^ undeclared identifier
  1174. 615 BEGIN
  1175. 616 RETURN OpenOrCreateFile(name,OMopenrw) ;
  1176. ***** ^ not supported yet
  1177. ***** ^ not supported yet
  1178. ***** ^ not supported yet
  1179. 617 END OpenRW ;
  1180. ***** ^ not supported yet
  1181. 618
  1182. 619
  1183. 620
  1184. 621 (* Redirected calls *)
  1185. 622
  1186. 623
  1187. 624 PROCEDURE Erase ( name : ARRAY OF CHAR ) ;
  1188. ***** ^ not supported yet
  1189. 625 VAR
  1190. 626 path : PathStr ;
  1191. ***** ^ undeclared identifier
  1192. 627 BEGIN
  1193. 628 IF FindPath(name,path) THEN
  1194. ***** ^ not supported yet
  1195. ***** ^ not supported yet
  1196. ***** ^ not supported yet
  1197. 629 FIO.Erase(path) ;
  1198. ***** ^ undeclared identifier
  1199. ***** ^ not supported yet
  1200. ***** ^ not supported yet
  1201. 630 END ;
  1202. 631 END Erase ;
  1203. ***** ^ not supported yet
  1204. 632
  1205. 633 PROCEDURE DelLeading ( VAR R : ARRAY OF CHAR ) ;
  1206. ***** ^ not supported yet
  1207. 634 BEGIN
  1208. 635 WHILE (R[0]>0C)AND(R[0]<=' ') DO Str.Delete(R,0,1) END ;
  1209. ***** ^ not supported yet
  1210. ***** ^ not supported yet
  1211. ***** ^ not supported yet
  1212. ***** ^ not supported yet
  1213. ***** ^ not supported yet
  1214. ***** ^ not supported yet
  1215. ***** ^ not supported yet
  1216. ***** ^ not supported yet
  1217. 636 END DelLeading ;
  1218. ***** ^ not supported yet
  1219. 637
  1220. 638
  1221. 639
  1222. 640
  1223. 641 PROCEDURE ReadRedirectionFile ( name : ARRAY OF CHAR ) ;
  1224. ***** ^ not supported yet
  1225. 642 TYPE
  1226. 643 Str3 = ARRAY[0..2] OF CHAR ;
  1227. ***** ^ not supported yet
  1228. ***** ^ not supported yet
  1229. 644 VAR
  1230. 645 line : ARRAY[0..255] OF CHAR ;
  1231. ***** ^ not supported yet
  1232. ***** ^ not supported yet
  1233. 646 item : ARRAY[0..64] OF CHAR ;
  1234. ***** ^ not supported yet
  1235. ***** ^ not supported yet
  1236. 647 outp : BOOLEAN ;
  1237. 648 pat : CARDINAL ;
  1238. 649 n,i : CARDINAL ;
  1239. 650 path : PathStr ;
  1240. ***** ^ undeclared identifier
  1241. 651 BEGIN
  1242. 652 NoOfConversions := 0 ;
  1243. 653 IF FindExePath(name,TRUE,path) THEN END ;
  1244. ***** ^ undeclared identifier
  1245. ***** ^ not supported yet
  1246. ***** ^ not supported yet
  1247. 654 IF NOT OpenTextFile(path) THEN
  1248. ***** ^ not supported yet
  1249. ***** ^ not supported yet
  1250. 655 RETURN
  1251. 656 END ;
  1252. 657 outp := TRUE ;
  1253. 658 LOOP
  1254. 659 ReadTextLn(line) ;
  1255. ***** ^ not supported yet
  1256. ***** ^ not supported yet
  1257. 660 IF line[0]=CHR(26) THEN EXIT END ;
  1258. ***** ^ not supported yet
  1259. ***** ^ not supported yet
  1260. ***** ^ undeclared identifier
  1261. ***** ^ not supported yet
  1262. 661 Str.Caps(line) ;
  1263. ***** ^ not supported yet
  1264. ***** ^ not supported yet
  1265. ***** ^ not supported yet
  1266. 662 DelLeading(line) ;
  1267. ***** ^ not supported yet
  1268. ***** ^ not supported yet
  1269. 663 Str.ItemS(item,line,' ,=;',0) ;
  1270. ***** ^ not supported yet
  1271. ***** ^ not supported yet
  1272. ***** ^ not supported yet
  1273. ***** ^ not supported yet
  1274. ***** ^ not supported yet
  1275. ***** ^ not supported yet
  1276. 664 IF item[0]<>0C THEN
  1277. ***** ^ not supported yet
  1278. ***** ^ not supported yet
  1279. 665 INC(NoOfConversions) ;
  1280. ***** ^ undeclared identifier
  1281. ***** ^ not supported yet
  1282. 666 Conversion[NoOfConversions] := AddText(item) ;
  1283. ***** ^ not supported yet
  1284. ***** ^ not supported yet
  1285. ***** ^ not supported yet
  1286. ***** ^ not supported yet
  1287. 667 i := 0 ;
  1288. 668 REPEAT
  1289. 669 INC(i) ;
  1290. ***** ^ undeclared identifier
  1291. ***** ^ not supported yet
  1292. 670 Str.ItemS(item,line,' =,;',i) ;
  1293. ***** ^ not supported yet
  1294. ***** ^ not supported yet
  1295. ***** ^ not supported yet
  1296. ***** ^ not supported yet
  1297. ***** ^ not supported yet
  1298. ***** ^ not supported yet
  1299. 671 n := AddText(item) ;
  1300. ***** ^ not supported yet
  1301. ***** ^ not supported yet
  1302. 672 UNTIL item[0]=0C ;
  1303. ***** ^ not supported yet
  1304. ***** ^ not supported yet
  1305. 673 END ;
  1306. 674 IF NoOfConversions=MaxNoOfConversions THEN EXIT END ;
  1307. 675 END ;
  1308. 676 CloseTextFile ;
  1309. ***** ^ not supported yet
  1310. 677 StrTabPtr := 1 ;
  1311. 678 END ReadRedirectionFile ;
  1312. ***** ^ not supported yet
  1313. 679
  1314. 680
  1315. 681 PROCEDURE FindExePath ( path : ARRAY OF CHAR ;
  1316. ***** ^ not supported yet
  1317. 682 ovl : BOOLEAN ;
  1318. 683 VAR outpath : PathStr ) : BOOLEAN ;
  1319. ***** ^ undeclared identifier
  1320. 684 VAR
  1321. 685 fp : PathStr ;
  1322. ***** ^ undeclared identifier
  1323. 686 str : StrPtr ;
  1324. ***** ^ not supported yet
  1325. 687 l : CARDINAL ;
  1326. 688 envpath : String ;
  1327. ***** ^ not supported yet
  1328. 689 n : CARDINAL ;
  1329. 690 BEGIN
  1330. 691 Str.Copy(outpath,path) ;
  1331. ***** ^ not supported yet
  1332. ***** ^ not supported yet
  1333. ***** ^ not supported yet
  1334. ***** ^ not supported yet
  1335. 692 IF FindPath(path,outpath) THEN
  1336. ***** ^ not supported yet
  1337. ***** ^ not supported yet
  1338. ***** ^ not supported yet
  1339. 693 RETURN TRUE ;
  1340. 694 END ;
  1341. 695 IF AbsolutePath(path) THEN RETURN FALSE END ;
  1342. ***** ^ not supported yet
  1343. ***** ^ not supported yet
  1344. 696 IF ovl AND (GetDosVersion() >= 300H) THEN
  1345. ***** ^ not supported yet
  1346. ***** ^ not supported yet
  1347. 697 str := StrPtr(CoreMain._argv[0]);
  1348. ***** ^ not supported yet
  1349. ***** ^ not supported yet
  1350. ***** ^ not supported yet
  1351. ***** ^ not supported yet
  1352. 698 Str.Copy(fp,str^) ;
  1353. ***** ^ not supported yet
  1354. ***** ^ not supported yet
  1355. ***** ^ not supported yet
  1356. ***** ^ not supported yet
  1357. 699 l := Str.Length( fp ) ;
  1358. ***** ^ not supported yet
  1359. ***** ^ not supported yet
  1360. ***** ^ not supported yet
  1361. 700 LOOP
  1362. 701 IF l=0 THEN fp[0] := 0C; EXIT; END;
  1363. ***** ^ not supported yet
  1364. ***** ^ not supported yet
  1365. 702 DEC(l);
  1366. ***** ^ undeclared identifier
  1367. ***** ^ not supported yet
  1368. 703 IF fp[l]='\' THEN EXIT END;
  1369. ***** ^ not supported yet
  1370. ***** ^ not supported yet
  1371. 704 END;
  1372. 705 fp[l+1] := 0C;
  1373. ***** ^ not supported yet
  1374. ***** ^ not supported yet
  1375. 706 MakePath(fp,fp,path) ;
  1376. ***** ^ not supported yet
  1377. ***** ^ not supported yet
  1378. ***** ^ not supported yet
  1379. ***** ^ not supported yet
  1380. 707 IF FindPath(fp,outpath) THEN RETURN TRUE END ;
  1381. ***** ^ not supported yet
  1382. ***** ^ not supported yet
  1383. ***** ^ not supported yet
  1384. 708 END;
  1385. 709 Lib.EnvironmentFind('PATH',envpath) ;
  1386. ***** ^ not supported yet
  1387. ***** ^ not supported yet
  1388. ***** ^ not supported yet
  1389. ***** ^ not supported yet
  1390. 710 n := 0 ;
  1391. 711 LOOP
  1392. 712 Str.ItemS(fp,envpath,' =;,',n) ;
  1393. ***** ^ not supported yet
  1394. ***** ^ not supported yet
  1395. ***** ^ not supported yet
  1396. ***** ^ not supported yet
  1397. ***** ^ not supported yet
  1398. ***** ^ not supported yet
  1399. 713 IF fp[0]=0C THEN RETURN FALSE END ;
  1400. ***** ^ not supported yet
  1401. ***** ^ not supported yet
  1402. 714 MakePath(fp,fp,path) ;
  1403. ***** ^ not supported yet
  1404. ***** ^ not supported yet
  1405. ***** ^ not supported yet
  1406. ***** ^ not supported yet
  1407. 715 IF FindPath(fp,outpath) THEN RETURN TRUE END ;
  1408. ***** ^ not supported yet
  1409. ***** ^ not supported yet
  1410. ***** ^ not supported yet
  1411. 716 INC(n) ;
  1412. ***** ^ undeclared identifier
  1413. ***** ^ not supported yet
  1414. 717 END ;
  1415. 718 END FindExePath ;
  1416. ***** ^ not supported yet
  1417. 719
  1418. 720 PROCEDURE IOresult () : CARDINAL ;
  1419. 721 BEGIN
  1420. 722 (*%F _mthread *)
  1421. 723 RETURN IOR ;
  1422. 724 (*%E *)
  1423. 725 (*%T _mthread *)
  1424. 726 RETURN IOR[CoreProc._getTID()] ;
  1425. ***** ^ not supported yet
  1426. ***** ^ not supported yet
  1427. ***** ^ not supported yet
  1428. ***** ^ not supported yet
  1429. 727 (*%E *)
  1430. 728 END IOresult ;
  1431. ***** ^ not supported yet
  1432. 729
  1433. 730
  1434. 731 PROCEDURE Init ;
  1435. 732
  1436. 733 VAR
  1437. 734 RedFile: ARRAY [0..80] OF CHAR;
  1438. ***** ^ not supported yet
  1439. ***** ^ not supported yet
  1440. 735 BEGIN
  1441. 736 NoOfConversions := 0 ;
  1442. 737 StrTab[0] := 0C ;
  1443. ***** ^ not supported yet
  1444. ***** ^ not supported yet
  1445. 738 StrTabPtr := 1 ;
  1446. 739 LastDelPtr := 0 ;
  1447. 740 NoOfStrings := 0 ;
  1448. 741 FIO.IOcheck := FALSE ;
  1449. ***** ^ undeclared identifier
  1450. ***** ^ not supported yet
  1451. 742 Lib.EnvironmentFind('TSRED', RedFile);
  1452. ***** ^ not supported yet
  1453. ***** ^ not supported yet
  1454. ***** ^ not supported yet
  1455. ***** ^ not supported yet
  1456. 743 IF RedFile[0] = 0C THEN
  1457. ***** ^ not supported yet
  1458. ***** ^ not supported yet
  1459. 744 RedFile := 'TS.RED';
  1460. ***** ^ not supported yet
  1461. ***** ^ not supported yet
  1462. 745 END;
  1463. 746 ReadRedirectionFile(RedFile);
  1464. ***** ^ not supported yet
  1465. ***** ^ not supported yet
  1466. 747 END Init ;
  1467. ***** ^ not supported yet
  1468. 748
  1469. 749 (*%T _mthread *)
  1470. 750 VAR
  1471. 751 n : [1..Process.MaxProcess];
  1472. ***** ^ not supported yet
  1473. ***** ^ not supported yet
  1474. 752 (*%E *)
  1475. 753 BEGIN
  1476. 754 (*%T _mthread *)
  1477. 755 n := 1;
  1478. ***** ^ not supported yet
  1479. 756 WHILE n <= Process.MaxProcess DO
  1480. ***** ^ not supported yet
  1481. ***** ^ not supported yet
  1482. ***** ^ not supported yet
  1483. 757 IOR[n] := 0;
  1484. ***** ^ not supported yet
  1485. ***** ^ not supported yet
  1486. 758 INC(n);
  1487. ***** ^ undeclared identifier
  1488. ***** ^ not supported yet
  1489. 759 END;
  1490. 760 (*%E *)
  1491. 761 (*%F _mthread *)
  1492. 762 IOR := 0;
  1493. 763 (*%E *)
  1494. 764 Init ;
  1495. ***** ^ not supported yet
  1496. 765 END FIOR.
  1497. ***** ^ not supported yet
  1498. 731 errors