text
stringlengths
0
234
Path: Port_Number_Array(0..7);
begin
Put(Integer(Cnt));
Put_Line(" devices listed");
for I in Dev_Array'Range loop
Put(Integer(I-Dev_Array'First), 3);
Put(Integer(Get_Bus_Number(Dev_Array(I))), 4);
Put(Integer(Get_Device_Address(Dev_Array(I))), 4);
R := Get_Device_Descriptor(Dev_Array(I), Desc);
if R /= Success then
Put("Failed to get device descriptor: " & Status'Image(R));
else
Put(Integer(Desc.idVendor), 10, 16);
Put(Integer(Desc.idProduct), 10, 16);
Ri := Integer(Get_Port_Numbers(Dev_Array(I),
Path(0)'Unrestricted_Access, -- do not know how to do right
Path'Length));
if Ri > 0 then
Put(" path: ");
for I in 0 .. Ri-1 loop
Put(Integer(Path(I)), 4);
end loop;
end if;
end if;
New_Line;
end loop;
Function Definition: procedure Greet2 is
Function Body: begin
loop
Put_Line ("Please enter your name: ");
declare
Name : String := Get_Line;
-- ^ Call to the Get_Line function
begin
exit when Name = "";
Put_line ("Hi " & Name & "!");
Function Definition: procedure Check_Positive2 is
Function Body: N : Integer;
begin
Put ("Enter an integer value: "); -- Put a String
Get (N); -- Reads in an integer value
Put (N); -- Put an Integer
declare
S : String :=
(if N > 0 then " is a positive number"
else " is not a positive number");
begin
Put_Line (S);
Function Definition: procedure finalize_library is
Function Body: begin
E006 := E006 - 1;
declare
procedure F1;
pragma Import (Ada, F1, "ada__text_io__finalize_spec");
begin
F1;
Function Definition: procedure F2;
Function Body: pragma Import (Ada, F2, "system__file_io__finalize_body");
begin
E109 := E109 - 1;
F2;
Function Definition: procedure Reraise_Library_Exception_If_Any;
Function Body: pragma Import (Ada, Reraise_Library_Exception_If_Any, "__gnat_reraise_library_exception_if_any");
begin
Reraise_Library_Exception_If_Any;
Function Definition: procedure adafinal is
Function Body: procedure s_stalib_adafinal;
pragma Import (Ada, s_stalib_adafinal, "system__standard_library__adafinal");
procedure Runtime_Finalize;
pragma Import (C, Runtime_Finalize, "__gnat_runtime_finalize");
begin
if not Is_Elaborated then
return;
end if;
Is_Elaborated := False;
Runtime_Finalize;
s_stalib_adafinal;
end adafinal;
type No_Param_Proc is access procedure;
pragma Favor_Top_Level (No_Param_Proc);
procedure adainit is
Main_Priority : Integer;
pragma Import (C, Main_Priority, "__gl_main_priority");
Time_Slice_Value : Integer;
pragma Import (C, Time_Slice_Value, "__gl_time_slice_val");
WC_Encoding : Character;
pragma Import (C, WC_Encoding, "__gl_wc_encoding");
Locking_Policy : Character;
pragma Import (C, Locking_Policy, "__gl_locking_policy");