text stringlengths 0 234 |
|---|
Create_Directory (To_String (Working_Dir)); |
end if; |
end if; |
if Listing then |
if Working_Dir = "" then |
Display_Path := File_Name; |
else |
Display_Path := Working_Dir & "/" & File_Name; |
end if; |
Ada.Text_IO.Put |
(To_String (This_Entry_Type.Desc) & " " & |
To_String (Display_Path)); |
if Verbose or else This_Entry_Type.Is_Dir then |
Ada.Text_IO.Put_Line (""); |
else |
Ada.Text_IO.Put (" "); |
end if; |
end if; |
File_Count := File_Count + 1; |
if Extracting and Load_It then |
if Working_Dir = "" then |
Write_Path := File_Name; |
else |
Write_Path := Working_Dir & "/" & File_Name; |
end if; |
if Verbose then |
Ada.Text_IO.Put_Line (" Creating file: " & To_String (Write_Path)); |
end if; |
Create (Write_File, Out_File, To_String (Write_Path)); |
-- Ada.Text_IO.Put_Line ("DEBUG: Output file created" ); |
end if; |
return File_Name; |
end Process_Name_Block; |
procedure Process_Data_Block is |
DHB : Data_Header_Type; |
FourBytes : Blob_Type (1 .. 4); |
TwoBytes : Blob_Type (1 .. 2); |
begin |
-- first get the address and length |
FourBytes := Read_Blob (4, Dump_File_Stream, "Byte Addr"); |
DHB.Byte_Address := Unsigned_32 (FourBytes (1)); |
DHB.Byte_Address := |
Shift_Left (DHB.Byte_Address, 8) + Unsigned_32 (FourBytes (2)); |
DHB.Byte_Address := |
Shift_Left (DHB.Byte_Address, 8) + Unsigned_32 (FourBytes (3)); |
DHB.Byte_Address := |
Shift_Left (DHB.Byte_Address, 8) + Unsigned_32 (FourBytes (4)); |
FourBytes := Read_Blob (4, Dump_File_Stream, "Byte Length"); |
DHB.Byte_Length := Unsigned_32 (FourBytes (1)); |
DHB.Byte_Length := |
Shift_Left (DHB.Byte_Length, 8) + Unsigned_32 (FourBytes (2)); |
DHB.Byte_Length := |
Shift_Left (DHB.Byte_Length, 8) + Unsigned_32 (FourBytes (3)); |
DHB.Byte_Length := |
Shift_Left (DHB.Byte_Length, 8) + Unsigned_32 (FourBytes (4)); |
if DHB.Byte_Length > Unsigned_32 (MaxBlockSize) then |
Ada.Text_IO.Put_Line |
(Ada.Text_IO.Standard_Error, |
"ERROR: Maximum Block Size Exceeded."); |
Set_Exit_Status (Failure); |
Abort_Task (Current_Task); |
end if; |
if Verbose then |
Ada.Text_IO.Put_Line |
(" Data block: " & Unsigned_32'Image (DHB.Byte_Length) & |
" (bytes)"); |
end if; |
TwoBytes := Read_Blob (2, Dump_File_Stream, "Alignment Count"); |
DHB.Alighnment_Count := Unsigned_16 (TwoBytes (1)); |
DHB.Alighnment_Count := |
Shift_Left (DHB.Alighnment_Count, 8) + Unsigned_16 (TwoBytes (2)); |
-- skip any alignment bytes - usually just one |
if DHB.Alighnment_Count /= 0 then |
if Verbose then |
Ada.Text_IO.Put_Line |
(" Skipping " & Unsigned_16'Image (DHB.Alighnment_Count) & |
" alignment byte(s)"); |
end if; |
declare |
Dummy_Blob : Blob_Type (1 .. Integer (DHB.Alighnment_Count)); |
begin |
Dummy_Blob := Read_Blob (Integer (DHB.Alighnment_Count), Dump_File_Stream, "Alignment"); |
Function Definition: procedure Process_End_Block is |
Function Body: begin |
if Is_Open (Write_File) then |
Close (Write_File); |
if Verbose then |
Ada.Text_IO.Put_Line (" File Closed"); |
end if; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.