text
stringlengths
0
234
Unused_Result := Get_Bandwidth (Decoder);
Fail (Expected_No_Packets_Decoded_Message);
exception
when No_Packets_Decoded =>
null;
Function Definition: procedure Chess_Main is
Function Body: use type Common_Types.Colour_Type;
begin
Game.Initialize (Game_Board => Board.Make);
while not Game.Is_Game_Over loop
Game.Get_Board.Print;
declare
The_Move : constant Move.Object := Move.Get_Move (Game.Get_Turn);
begin
The_Move.Perform_Move;
Function Definition: procedure Dg_Loada is
Function Body: SemVer : constant String := "1.4.3"; -- TODO Update SemVer on each release
Dump_File_Name : Unbounded_String;
Extracting : Boolean := False;
Ignoring_Errors : Boolean := False;
Listing : Boolean := False;
Summary : Boolean := True;
Verbose : Boolean := False;
ArgIx : Integer := 1;
Dump_File : File_Type;
Dump_File_Stream : Stream_Access;
Write_File : File_Type;
-- dump images can legally contain 'too many' directory pops, so we
-- store the starting directory and never traverse above it...
Base_Dir : constant String := Current_Directory;
Working_Dir : Unbounded_String := To_Unbounded_String (Base_Dir);
Buffer : array (1 .. MaxBlockSize) of Unsigned_8;
FSB_Type_Indicator : Integer;
Current_File_Name : Unbounded_String;
SOD : SOD_Type;
Record_Header : Record_Header_Type;
Total_File_Size, Padding_Size : Unsigned_32 := 0;
Done, In_A_File, Load_It : Boolean := False;
File_Count : Natural := 0;
Cannot_Create_Link : exception;
function symlink (fname, linkname : String) return Integer;
pragma Import (C, symlink);
procedure Print_Help is
begin
Ada.Text_IO.Put_Line ("Usage of dg_loada:");
Ada.Text_IO.Put_Line (" -dumpfile <file> DUMP_II or DUMP_III file to read/load (required)");
Ada.Text_IO.Put_Line (" -extract extract the files from the DUMP_II/III into the current directory");
Ada.Text_IO.Put_Line (" -ignoreErrors do not exit if a file or link cannot be created");
Ada.Text_IO.Put_Line (" -list list the contents of the DUMP_II/III file");
Ada.Text_IO.Put_Line (" -summary concise summary of the DUMP_II/III file contents (default true)");
Ada.Text_IO.Put_Line (" -verbose be rather wordy about what dg_loada is doing");
Ada.Text_IO.Put_Line (" -version show the version number of dg_loada and exit");
Set_Exit_Status (Failure);
end Print_Help;
procedure Load_Buffer (Num_Bytes : Integer; Reason : String)
is
Tmp_Blob : Blob_Type (1 .. Num_Bytes);
begin
Tmp_Blob := Read_Blob (Num_Bytes, Dump_File_Stream, Reason);
for B in 1 .. Num_Bytes loop
Buffer (B) := Tmp_Blob (B);
end loop;
end Load_Buffer;
function Process_Name_Block (Record_Header : Record_Header_Type) return Unbounded_String
is
Name_Bytes : Blob_Type (1 .. Record_Header.Record_Length);
File_Name, Write_Path, Display_Path : Unbounded_String;
This_Entry_Type : Fstat_Entry_Rec;
begin
Name_Bytes :=
Read_Blob (Record_Header.Record_Length, Dump_File_Stream, "File Name");
File_Name := Extract_First_String (Name_Bytes);
File_Name := To_Linux_Filename (File_Name);
if Summary and Verbose then
Ada.Text_IO.Put_Line ("");
end if;
This_Entry_Type := Known_Fstat_Entry_Types (FSB_Type_Indicator);
Load_It := This_Entry_Type.Has_Payload;
if This_Entry_Type.Is_Dir then
Working_Dir := Working_Dir & "/" & File_Name;
if Extracting then