|
@@ -38,7 +38,7 @@ interface
|
|
|
|
|
|
uses
|
|
uses
|
|
cmsgs,verbose,
|
|
cmsgs,verbose,
|
|
- cutils,cclasses,
|
|
|
|
|
|
+ cutils,cclasses,cstreams,
|
|
globtype,globals,finput,fmodule,
|
|
globtype,globals,finput,fmodule,
|
|
symbase,ppu,symtype;
|
|
symbase,ppu,symtype;
|
|
|
|
|
|
@@ -59,7 +59,8 @@ interface
|
|
constructor create(LoadedFrom:TModule;const amodulename: string; const afilename:TPathStr;_is_unit:boolean);
|
|
constructor create(LoadedFrom:TModule;const amodulename: string; const afilename:TPathStr;_is_unit:boolean);
|
|
destructor destroy;override;
|
|
destructor destroy;override;
|
|
procedure reset;override;
|
|
procedure reset;override;
|
|
- function openppu:boolean;
|
|
|
|
|
|
+ function openppufile:boolean;
|
|
|
|
+ function openppustream(strm:TCStream):boolean;
|
|
procedure getppucrc;
|
|
procedure getppucrc;
|
|
procedure writeppu;
|
|
procedure writeppu;
|
|
procedure loadppu;
|
|
procedure loadppu;
|
|
@@ -75,6 +76,7 @@ interface
|
|
avoid endless resolving loops in case of cyclic dependencies. }
|
|
avoid endless resolving loops in case of cyclic dependencies. }
|
|
defsgeneration : longint;
|
|
defsgeneration : longint;
|
|
|
|
|
|
|
|
+ function openppu(ppufiletime:longint):boolean;
|
|
function search_unit_files(onlysource:boolean):boolean;
|
|
function search_unit_files(onlysource:boolean):boolean;
|
|
function search_unit(onlysource,shortname:boolean):boolean;
|
|
function search_unit(onlysource,shortname:boolean):boolean;
|
|
procedure load_interface;
|
|
procedure load_interface;
|
|
@@ -181,11 +183,11 @@ var
|
|
until false;
|
|
until false;
|
|
end;
|
|
end;
|
|
|
|
|
|
- function tppumodule.openppu:boolean;
|
|
|
|
|
|
+ function tppumodule.openppufile:boolean;
|
|
var
|
|
var
|
|
ppufiletime : longint;
|
|
ppufiletime : longint;
|
|
begin
|
|
begin
|
|
- openppu:=false;
|
|
|
|
|
|
+ openppufile:=false;
|
|
Message1(unit_t_ppu_loading,ppufilename,@queuecomment);
|
|
Message1(unit_t_ppu_loading,ppufilename,@queuecomment);
|
|
{ Get ppufile time (also check if the file exists) }
|
|
{ Get ppufile time (also check if the file exists) }
|
|
ppufiletime:=getnamedfiletime(ppufilename);
|
|
ppufiletime:=getnamedfiletime(ppufilename);
|
|
@@ -201,6 +203,29 @@ var
|
|
Message(unit_u_ppu_file_too_short);
|
|
Message(unit_u_ppu_file_too_short);
|
|
exit;
|
|
exit;
|
|
end;
|
|
end;
|
|
|
|
+ result:=openppu(ppufiletime);
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ function tppumodule.openppustream(strm:TCStream):boolean;
|
|
|
|
+ begin
|
|
|
|
+ { Open the ppufile }
|
|
|
|
+ Message1(unit_u_ppu_name,ppufilename);
|
|
|
|
+ ppufile:=tcompilerppufile.create(ppufilename);
|
|
|
|
+ if not ppufile.openstream(strm) then
|
|
|
|
+ begin
|
|
|
|
+ ppufile.free;
|
|
|
|
+ ppufile:=nil;
|
|
|
|
+ Message(unit_u_ppu_file_too_short);
|
|
|
|
+ exit;
|
|
|
|
+ end;
|
|
|
|
+ result:=openppu(-1);
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ function tppumodule.openppu(ppufiletime:longint):boolean;
|
|
|
|
+ begin
|
|
|
|
+ openppu:=false;
|
|
{ check for a valid PPU file }
|
|
{ check for a valid PPU file }
|
|
if not ppufile.CheckPPUId then
|
|
if not ppufile.CheckPPUId then
|
|
begin
|
|
begin
|
|
@@ -287,7 +312,10 @@ var
|
|
interface_crc:=ppufile.header.interface_checksum;
|
|
interface_crc:=ppufile.header.interface_checksum;
|
|
indirect_crc:=ppufile.header.indirect_checksum;
|
|
indirect_crc:=ppufile.header.indirect_checksum;
|
|
{ Show Debug info }
|
|
{ Show Debug info }
|
|
- Message1(unit_u_ppu_time,filetimestring(ppufiletime));
|
|
|
|
|
|
+ if ppufiletime<>-1 then
|
|
|
|
+ Message1(unit_u_ppu_time,filetimestring(ppufiletime))
|
|
|
|
+ else
|
|
|
|
+ Message1(unit_u_ppu_time,'unknown');
|
|
Message1(unit_u_ppu_flags,tostr(flags));
|
|
Message1(unit_u_ppu_flags,tostr(flags));
|
|
Message1(unit_u_ppu_crc,hexstr(ppufile.header.checksum,8));
|
|
Message1(unit_u_ppu_crc,hexstr(ppufile.header.checksum,8));
|
|
Message1(unit_u_ppu_crc,hexstr(ppufile.header.interface_checksum,8)+' (intfc)');
|
|
Message1(unit_u_ppu_crc,hexstr(ppufile.header.interface_checksum,8)+' (intfc)');
|
|
@@ -338,7 +366,7 @@ var
|
|
if Found then
|
|
if Found then
|
|
Begin
|
|
Begin
|
|
SetFileName(hs,false);
|
|
SetFileName(hs,false);
|
|
- Found:=OpenPPU;
|
|
|
|
|
|
+ Found:=openppufile;
|
|
End;
|
|
End;
|
|
PPUSearchPath:=Found;
|
|
PPUSearchPath:=Found;
|
|
end;
|
|
end;
|