2
0

symppu.inc 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 by Florian Klaempfl, Pierre Muller
  4. Implementation of the reading of PPU Files for the symtable
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. const
  19. {$ifdef FPC}
  20. ppubufsize=32768;
  21. {$ELSE}
  22. {$IFDEF USEOVERLAY}
  23. ppubufsize=512;
  24. {$ELSE}
  25. ppubufsize=4096;
  26. {$ENDIF}
  27. {$ENDIF}
  28. {$define ORDERSOURCES}
  29. {*****************************************************************************
  30. PPU Writing
  31. *****************************************************************************}
  32. procedure writebyte(b:byte);
  33. begin
  34. current_ppu^.putbyte(b);
  35. end;
  36. procedure writeword(w:word);
  37. begin
  38. current_ppu^.putword(w);
  39. end;
  40. procedure writelong(l:longint);
  41. begin
  42. current_ppu^.putlongint(l);
  43. end;
  44. procedure writereal(d:bestreal);
  45. begin
  46. current_ppu^.putreal(d);
  47. end;
  48. procedure writestring(const s:string);
  49. begin
  50. current_ppu^.putstring(s);
  51. end;
  52. procedure writenormalset(var s); {You cannot pass an array[0..31] of byte!}
  53. begin
  54. current_ppu^.putdata(s,sizeof(tnormalset));
  55. end;
  56. procedure writesmallset(var s; size: longint);
  57. var
  58. tmpl: longint;
  59. begin
  60. { The minimum size of a set under Delphi isn't 32 bit }
  61. { this is only binary compatible with FPC if first element's value of the set is 0 }
  62. tmpl:=0; move(s,tmpl,size);
  63. current_ppu^.putdata(tmpl,4);
  64. {old code: current_ppu^.putdata(s,4);}
  65. end;
  66. procedure writeguid(var g: tguid);
  67. begin
  68. current_ppu^.putdata(g,sizeof(g));
  69. end;
  70. { posinfo is not relevant for changes in PPU }
  71. procedure writeposinfo(const p:tfileposinfo);
  72. var
  73. oldcrc : boolean;
  74. begin
  75. oldcrc:=current_ppu^.do_crc;
  76. current_ppu^.do_crc:=false;
  77. current_ppu^.putword(p.fileindex);
  78. current_ppu^.putlongint(p.line);
  79. current_ppu^.putword(p.column);
  80. current_ppu^.do_crc:=oldcrc;
  81. end;
  82. procedure writederef(p : psymtableentry);
  83. begin
  84. if p=nil then
  85. current_ppu^.putbyte(ord(derefnil))
  86. else
  87. begin
  88. { Static symtable ? }
  89. if p^.owner^.symtabletype=staticsymtable then
  90. begin
  91. current_ppu^.putbyte(ord(derefaktstaticindex));
  92. current_ppu^.putword(p^.indexnr);
  93. end
  94. { Local record/object symtable ? }
  95. else if (p^.owner=aktrecordsymtable) then
  96. begin
  97. current_ppu^.putbyte(ord(derefaktrecordindex));
  98. current_ppu^.putword(p^.indexnr);
  99. end
  100. { Local local/para symtable ? }
  101. else if (p^.owner=aktlocalsymtable) then
  102. begin
  103. current_ppu^.putbyte(ord(derefaktlocal));
  104. current_ppu^.putword(p^.indexnr);
  105. end
  106. else
  107. begin
  108. current_ppu^.putbyte(ord(derefindex));
  109. current_ppu^.putword(p^.indexnr);
  110. { Current unit symtable ? }
  111. repeat
  112. if not assigned(p) then
  113. internalerror(556655);
  114. case p^.owner^.symtabletype of
  115. { when writing the pseudo PPU file
  116. to get CRC values the globalsymtable is not yet
  117. a unitsymtable PM }
  118. globalsymtable,
  119. unitsymtable :
  120. begin
  121. { check if the unit is available in the uses
  122. clause, else it's an error }
  123. if p^.owner^.unitid=$ffff then
  124. internalerror(55665566);
  125. current_ppu^.putbyte(ord(derefunit));
  126. current_ppu^.putword(p^.owner^.unitid);
  127. break;
  128. end;
  129. staticsymtable :
  130. begin
  131. current_ppu^.putbyte(ord(derefaktstaticindex));
  132. current_ppu^.putword(p^.indexnr);
  133. break;
  134. end;
  135. localsymtable :
  136. begin
  137. p:=p^.owner^.defowner;
  138. current_ppu^.putbyte(ord(dereflocal));
  139. current_ppu^.putword(p^.indexnr);
  140. end;
  141. parasymtable :
  142. begin
  143. p:=p^.owner^.defowner;
  144. current_ppu^.putbyte(ord(derefpara));
  145. current_ppu^.putword(p^.indexnr);
  146. end;
  147. objectsymtable,
  148. recordsymtable :
  149. begin
  150. p:=p^.owner^.defowner;
  151. current_ppu^.putbyte(ord(derefrecord));
  152. current_ppu^.putword(p^.indexnr);
  153. end;
  154. else
  155. internalerror(556656);
  156. end;
  157. until false;
  158. end;
  159. end;
  160. end;
  161. procedure writedefref(p : pdef);
  162. begin
  163. writederef(p);
  164. end;
  165. procedure writesymref(p : psym);
  166. begin
  167. writederef(p);
  168. end;
  169. procedure writesourcefiles;
  170. var
  171. hp : pinputfile;
  172. {$ifdef ORDERSOURCES}
  173. i,j : longint;
  174. {$endif ORDERSOURCES}
  175. begin
  176. { second write the used source files }
  177. current_ppu^.do_crc:=false;
  178. hp:=current_module^.sourcefiles^.files;
  179. {$ifdef ORDERSOURCES}
  180. { write source files directly in good order }
  181. j:=0;
  182. while assigned(hp) do
  183. begin
  184. inc(j);
  185. hp:=hp^.ref_next;
  186. end;
  187. while j>0 do
  188. begin
  189. hp:=current_module^.sourcefiles^.files;
  190. for i:=1 to j-1 do
  191. hp:=hp^.ref_next;
  192. current_ppu^.putstring(hp^.name^);
  193. dec(j);
  194. end;
  195. {$else not ORDERSOURCES}
  196. while assigned(hp) do
  197. begin
  198. { only name and extension }
  199. current_ppu^.putstring(hp^.name^);
  200. hp:=hp^.ref_next;
  201. end;
  202. {$endif ORDERSOURCES}
  203. current_ppu^.writeentry(ibsourcefiles);
  204. current_ppu^.do_crc:=true;
  205. end;
  206. procedure writeusedmacros;
  207. var
  208. hp : pmacrosym;
  209. i : longint;
  210. begin
  211. { second write the used source files }
  212. current_ppu^.do_crc:=false;
  213. for i:=1 to macros^.symindex^.count do
  214. begin
  215. hp:=pmacrosym(macros^.symindex^.search(i));
  216. { only used or init defined macros are stored }
  217. if hp^.is_used or hp^.defined_at_startup then
  218. begin
  219. current_ppu^.putstring(hp^.name);
  220. current_ppu^.putbyte(byte(hp^.defined_at_startup));
  221. current_ppu^.putbyte(byte(hp^.is_used));
  222. end;
  223. end;
  224. current_ppu^.writeentry(ibusedmacros);
  225. current_ppu^.do_crc:=true;
  226. end;
  227. procedure writeusedunit;
  228. var
  229. hp : pused_unit;
  230. begin
  231. numberunits;
  232. hp:=pused_unit(current_module^.used_units.first);
  233. while assigned(hp) do
  234. begin
  235. { implementation units should not change
  236. the CRC PM }
  237. current_ppu^.do_crc:=hp^.in_interface;
  238. current_ppu^.putstring(hp^.name^);
  239. { the checksum should not affect the crc of this unit ! (PFV) }
  240. current_ppu^.do_crc:=false;
  241. current_ppu^.putlongint(hp^.checksum);
  242. current_ppu^.putlongint(hp^.interface_checksum);
  243. current_ppu^.putbyte(byte(hp^.in_interface));
  244. current_ppu^.do_crc:=true;
  245. hp:=pused_unit(hp^.next);
  246. end;
  247. current_ppu^.do_interface_crc:=true;
  248. current_ppu^.writeentry(ibloadunit);
  249. end;
  250. procedure writelinkcontainer(var p:tlinkcontainer;id:byte;strippath:boolean);
  251. var
  252. hcontainer : tlinkcontainer;
  253. s : string;
  254. mask : longint;
  255. begin
  256. hcontainer.init;
  257. while not p.empty do
  258. begin
  259. s:=p.get(mask);
  260. if strippath then
  261. current_ppu^.putstring(SplitFileName(s))
  262. else
  263. current_ppu^.putstring(s);
  264. current_ppu^.putlongint(mask);
  265. hcontainer.insert(s,mask);
  266. end;
  267. current_ppu^.writeentry(id);
  268. p:=hcontainer;
  269. end;
  270. procedure writeunitas(const s : string;unittable : punitsymtable;only_crc : boolean);
  271. begin
  272. Message1(unit_u_ppu_write,s);
  273. { create unit flags }
  274. with Current_Module^ do
  275. begin
  276. {$ifdef GDB}
  277. if cs_gdb_dbx in aktglobalswitches then
  278. flags:=flags or uf_has_dbx;
  279. {$endif GDB}
  280. if target_os.endian=endian_big then
  281. flags:=flags or uf_big_endian;
  282. if cs_browser in aktmoduleswitches then
  283. flags:=flags or uf_has_browser;
  284. if cs_local_browser in aktmoduleswitches then
  285. flags:=flags or uf_local_browser;
  286. end;
  287. {$ifdef Test_Double_checksum_write}
  288. If only_crc then
  289. Assign(CRCFile,s+'.INT')
  290. else
  291. Assign(CRCFile,s+'.IMP');
  292. Rewrite(CRCFile);
  293. {$endif def Test_Double_checksum_write}
  294. { open ppufile }
  295. current_ppu:=new(pppufile,init(s));
  296. current_ppu^.crc_only:=only_crc;
  297. if not current_ppu^.create then
  298. Message(unit_f_ppu_cannot_write);
  299. {$ifdef Test_Double_checksum}
  300. if only_crc then
  301. begin
  302. new(current_ppu^.crc_test);
  303. new(current_ppu^.crc_test2);
  304. end
  305. else
  306. begin
  307. current_ppu^.crc_test:=Current_Module^.crc_array;
  308. current_ppu^.crc_index:=Current_Module^.crc_size;
  309. current_ppu^.crc_test2:=Current_Module^.crc_array2;
  310. current_ppu^.crc_index2:=Current_Module^.crc_size2;
  311. end;
  312. {$endif def Test_Double_checksum}
  313. current_ppu^.change_endian:=source_os.endian<>target_os.endian;
  314. { write symbols and definitions }
  315. unittable^.writeasunit;
  316. { flush to be sure }
  317. current_ppu^.flush;
  318. { create and write header }
  319. current_ppu^.header.size:=current_ppu^.size;
  320. current_ppu^.header.checksum:=current_ppu^.crc;
  321. current_ppu^.header.interface_checksum:=current_ppu^.interface_crc;
  322. current_ppu^.header.compiler:=wordversion;
  323. current_ppu^.header.cpu:=word(target_cpu);
  324. current_ppu^.header.target:=word(target_info.target);
  325. current_ppu^.header.flags:=current_module^.flags;
  326. If not only_crc then
  327. current_ppu^.writeheader;
  328. { save crc in current_module also }
  329. current_module^.crc:=current_ppu^.crc;
  330. current_module^.interface_crc:=current_ppu^.interface_crc;
  331. if only_crc then
  332. begin
  333. {$ifdef Test_Double_checksum}
  334. Current_Module^.crc_array:=current_ppu^.crc_test;
  335. current_ppu^.crc_test:=nil;
  336. Current_Module^.crc_size:=current_ppu^.crc_index2;
  337. Current_Module^.crc_array2:=current_ppu^.crc_test2;
  338. current_ppu^.crc_test2:=nil;
  339. Current_Module^.crc_size2:=current_ppu^.crc_index2;
  340. {$endif def Test_Double_checksum}
  341. closecurrentppu;
  342. end;
  343. {$ifdef Test_Double_checksum_write}
  344. close(CRCFile);
  345. {$endif Test_Double_checksum_write}
  346. end;
  347. procedure closecurrentppu;
  348. begin
  349. {$ifdef Test_Double_checksum}
  350. if assigned(current_ppu^.crc_test) then
  351. dispose(current_ppu^.crc_test);
  352. if assigned(current_ppu^.crc_test2) then
  353. dispose(current_ppu^.crc_test2);
  354. {$endif Test_Double_checksum}
  355. { close }
  356. current_ppu^.close;
  357. dispose(current_ppu,done);
  358. current_ppu:=nil;
  359. end;
  360. {*****************************************************************************
  361. PPU Reading
  362. *****************************************************************************}
  363. function readbyte:byte;
  364. begin
  365. readbyte:=current_ppu^.getbyte;
  366. if current_ppu^.error then
  367. Message(unit_f_ppu_read_error);
  368. end;
  369. function readword:word;
  370. begin
  371. readword:=current_ppu^.getword;
  372. if current_ppu^.error then
  373. Message(unit_f_ppu_read_error);
  374. end;
  375. function readlong:longint;
  376. begin
  377. readlong:=current_ppu^.getlongint;
  378. if current_ppu^.error then
  379. Message(unit_f_ppu_read_error);
  380. end;
  381. function readreal : bestreal;
  382. begin
  383. readreal:=current_ppu^.getreal;
  384. if current_ppu^.error then
  385. Message(unit_f_ppu_read_error);
  386. end;
  387. function readstring : string;
  388. begin
  389. readstring:=current_ppu^.getstring;
  390. if current_ppu^.error then
  391. Message(unit_f_ppu_read_error);
  392. end;
  393. procedure readnormalset(var s); {You cannot pass an array [0..31] of byte.}
  394. begin
  395. current_ppu^.getdata(s,sizeof(tnormalset));
  396. if current_ppu^.error then
  397. Message(unit_f_ppu_read_error);
  398. end;
  399. procedure readsmallset(var s;size: longint);
  400. var
  401. tmpl: longint;
  402. begin
  403. { The minimum size of a set under Delphi isn't 32 bit }
  404. { this is only binary compatible if first element's value of the set is 0 }
  405. current_ppu^.getdata(tmpl,4);
  406. move(tmpl,s,size);
  407. {old code: current_ppu^.getdata(s,4); }
  408. if current_ppu^.error then
  409. Message(unit_f_ppu_read_error);
  410. end;
  411. procedure readguid(var g: tguid);
  412. begin
  413. current_ppu^.getdata(g,sizeof(g));
  414. if current_ppu^.error then
  415. Message(unit_f_ppu_read_error);
  416. end;
  417. procedure readposinfo(var p:tfileposinfo);
  418. begin
  419. p.fileindex:=current_ppu^.getword;
  420. p.line:=current_ppu^.getlongint;
  421. p.column:=current_ppu^.getword;
  422. end;
  423. function readderef : pderef;
  424. var
  425. hp,p : pderef;
  426. b : tdereftype;
  427. begin
  428. p:=nil;
  429. repeat
  430. hp:=p;
  431. b:=tdereftype(current_ppu^.getbyte);
  432. case b of
  433. derefnil :
  434. break;
  435. derefunit,
  436. derefaktrecordindex,
  437. derefaktlocal,
  438. derefaktstaticindex :
  439. begin
  440. new(p,init(b,current_ppu^.getword));
  441. p^.next:=hp;
  442. break;
  443. end;
  444. derefindex,
  445. dereflocal,
  446. derefpara,
  447. derefrecord :
  448. begin
  449. new(p,init(b,current_ppu^.getword));
  450. p^.next:=hp;
  451. end;
  452. end;
  453. until false;
  454. readderef:=p;
  455. end;
  456. function readdefref : pdef;
  457. begin
  458. readdefref:=pdef(readderef);
  459. end;
  460. function readsymref : psym;
  461. begin
  462. readsymref:=psym(readderef);
  463. end;
  464. procedure readusedmacros;
  465. var
  466. hs : string;
  467. mac : pmacrosym;
  468. was_defined_at_startup,
  469. was_used : boolean;
  470. begin
  471. while not current_ppu^.endofentry do
  472. begin
  473. hs:=current_ppu^.getstring;
  474. was_defined_at_startup:=boolean(current_ppu^.getbyte);
  475. was_used:=boolean(current_ppu^.getbyte);
  476. mac:=pmacrosym(macros^.search(hs));
  477. if assigned(mac) then
  478. begin
  479. {$ifndef EXTDEBUG}
  480. { if we don't have the sources why tell }
  481. if current_module^.sources_avail then
  482. {$endif ndef EXTDEBUG}
  483. if (not was_defined_at_startup) and
  484. was_used and
  485. mac^.defined_at_startup then
  486. Message2(unit_h_cond_not_set_in_last_compile,hs,current_module^.mainsource^);
  487. end
  488. else { not assigned }
  489. if was_defined_at_startup and
  490. was_used then
  491. Message2(unit_h_cond_not_set_in_last_compile,hs,current_module^.mainsource^);
  492. end;
  493. end;
  494. procedure readsourcefiles;
  495. var
  496. temp,hs : string;
  497. temp_dir : string;
  498. {$ifdef ORDERSOURCES}
  499. main_dir : string;
  500. {$endif ORDERSOURCES}
  501. incfile_found,
  502. main_found,
  503. is_main : boolean;
  504. ppufiletime,
  505. source_time : longint;
  506. hp : pinputfile;
  507. begin
  508. ppufiletime:=getnamedfiletime(current_module^.ppufilename^);
  509. current_module^.sources_avail:=true;
  510. {$ifdef ORDERSOURCES}
  511. is_main:=true;
  512. main_dir:='';
  513. {$endif ORDERSOURCES}
  514. while not current_ppu^.endofentry do
  515. begin
  516. hs:=current_ppu^.getstring;
  517. {$ifndef ORDERSOURCES}
  518. is_main:=current_ppu^.endofentry;
  519. {$endif ORDERSOURCES}
  520. temp_dir:='';
  521. if (current_module^.flags and uf_in_library)<>0 then
  522. begin
  523. current_module^.sources_avail:=false;
  524. temp:=' library';
  525. end
  526. else if pos('Macro ',hs)=1 then
  527. begin
  528. { we don't want to find this file }
  529. { but there is a problem with file indexing !! }
  530. temp:='';
  531. end
  532. else
  533. begin
  534. { check the date of the source files }
  535. Source_Time:=GetNamedFileTime(current_module^.path^+hs);
  536. incfile_found:=false;
  537. main_found:=false;
  538. if Source_Time<>-1 then
  539. hs:=current_module^.path^+hs
  540. {$ifdef ORDERSOURCES}
  541. else if not(is_main) then
  542. begin
  543. Source_Time:=GetNamedFileTime(main_dir+hs);
  544. if Source_Time<>-1 then
  545. hs:=main_dir+hs;
  546. end
  547. {$endif def ORDERSOURCES}
  548. ;
  549. if (Source_Time=-1) then
  550. begin
  551. if is_main then
  552. temp_dir:=unitsearchpath.FindFile(hs,main_found)
  553. else
  554. temp_dir:=includesearchpath.FindFile(hs,incfile_found);
  555. if incfile_found or main_found then
  556. begin
  557. hs:=temp_dir+hs;
  558. Source_Time:=GetNamedFileTime(hs);
  559. end
  560. end;
  561. if Source_Time=-1 then
  562. begin
  563. current_module^.sources_avail:=false;
  564. temp:=' not found';
  565. end
  566. else
  567. begin
  568. if main_found then
  569. main_dir:=temp_dir;
  570. { time newer? But only allow if the file is not searched
  571. in the include path (PFV), else you've problems with
  572. units which use the same includefile names }
  573. if incfile_found then
  574. temp:=' found'
  575. else
  576. begin
  577. temp:=' time '+filetimestring(source_time);
  578. if (source_time>ppufiletime) then
  579. begin
  580. current_module^.do_compile:=true;
  581. current_module^.recompile_reason:=rr_sourcenewer;
  582. temp:=temp+' *'
  583. end;
  584. end;
  585. end;
  586. new(hp,init(hs));
  587. { the indexing is wrong here PM }
  588. current_module^.sourcefiles^.register_file(hp);
  589. end;
  590. {$ifdef ORDERSOURCES}
  591. if is_main then
  592. begin
  593. stringdispose(current_module^.mainsource);
  594. current_module^.mainsource:=stringdup(hs);
  595. end;
  596. {$endif ORDERSOURCES}
  597. Message1(unit_u_ppu_source,hs+temp);
  598. {$ifdef ORDERSOURCES}
  599. is_main:=false;
  600. {$endif ORDERSOURCES}
  601. end;
  602. {$ifndef ORDERSOURCES}
  603. { main source is always the last }
  604. stringdispose(current_module^.mainsource);
  605. current_module^.mainsource:=stringdup(hs);
  606. { the indexing is corrected here PM }
  607. current_module^.sourcefiles^.inverse_register_indexes;
  608. {$endif ORDERSOURCES}
  609. { check if we want to rebuild every unit, only if the sources are
  610. available }
  611. if do_build and current_module^.sources_avail then
  612. begin
  613. current_module^.do_compile:=true;
  614. current_module^.recompile_reason:=rr_build;
  615. end;
  616. end;
  617. procedure readloadunit;
  618. var
  619. hs : string;
  620. intfchecksum,
  621. checksum : longint;
  622. in_interface : boolean;
  623. begin
  624. while not current_ppu^.endofentry do
  625. begin
  626. hs:=current_ppu^.getstring;
  627. checksum:=current_ppu^.getlongint;
  628. intfchecksum:=current_ppu^.getlongint;
  629. in_interface:=(current_ppu^.getbyte<>0);
  630. current_module^.used_units.concat(new(pused_unit,init_to_load(hs,checksum,intfchecksum,in_interface)));
  631. end;
  632. end;
  633. procedure readlinkcontainer(var p:tlinkcontainer);
  634. var
  635. s : string;
  636. m : longint;
  637. begin
  638. while not current_ppu^.endofentry do
  639. begin
  640. s:=current_ppu^.getstring;
  641. m:=current_ppu^.getlongint;
  642. p.insert(s,m);
  643. end;
  644. end;
  645. procedure load_interface;
  646. var
  647. b : byte;
  648. newmodulename : string;
  649. begin
  650. { read interface part }
  651. repeat
  652. b:=current_ppu^.readentry;
  653. case b of
  654. ibmodulename :
  655. begin
  656. newmodulename:=current_ppu^.getstring;
  657. if upper(newmodulename)<>current_module^.modulename^ then
  658. Message2(unit_f_unit_name_error,current_module^.realmodulename^,newmodulename);
  659. stringdispose(current_module^.modulename);
  660. stringdispose(current_module^.realmodulename);
  661. current_module^.modulename:=stringdup(upper(newmodulename));
  662. current_module^.realmodulename:=stringdup(newmodulename);
  663. end;
  664. ibsourcefiles :
  665. readsourcefiles;
  666. ibusedmacros :
  667. readusedmacros;
  668. ibloadunit :
  669. readloadunit;
  670. iblinkunitofiles :
  671. readlinkcontainer(current_module^.LinkUnitOFiles);
  672. iblinkunitstaticlibs :
  673. readlinkcontainer(current_module^.LinkUnitStaticLibs);
  674. iblinkunitsharedlibs :
  675. readlinkcontainer(current_module^.LinkUnitSharedLibs);
  676. iblinkotherofiles :
  677. readlinkcontainer(current_module^.LinkotherOFiles);
  678. iblinkotherstaticlibs :
  679. readlinkcontainer(current_module^.LinkotherStaticLibs);
  680. iblinkothersharedlibs :
  681. readlinkcontainer(current_module^.LinkotherSharedLibs);
  682. ibendinterface :
  683. break;
  684. else
  685. Message1(unit_f_ppu_invalid_entry,tostr(b));
  686. end;
  687. until false;
  688. end;
  689. {
  690. $Log$
  691. Revision 1.7 2000-11-04 14:25:22 florian
  692. + merged Attila's changes for interfaces, not tested yet
  693. Revision 1.6 2000/10/31 22:02:52 peter
  694. * symtable splitted, no real code changes
  695. Revision 1.5 2000/10/15 07:47:53 peter
  696. * unit names and procedure names are stored mixed case
  697. Revision 1.4 2000/09/24 21:33:47 peter
  698. * message updates merges
  699. Revision 1.3 2000/09/21 20:56:19 pierre
  700. * fix for bugs 1084/1128 (merged)
  701. Revision 1.2 2000/07/13 11:32:49 michael
  702. + removed logs
  703. }