|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 8192 (0x2000)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Transport_Name, seg_049d73
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦5a81ac88f⟧ »Space Info Vol 1«
└─⟦this⟧
with Socket_System_Interface;
with Unchecked_Conversion;
with Unix_Base_Types;
with System;
with String_Utilities;
with Text_Io;
use Text_Io;
-- use Socket_System_Interface;
-- use Unix_Base_Types;
package body Transport_Name is
Prototype_Error : exception;
package Ssi renames Socket_System_Interface;
package Ubt renames Unix_Base_Types;
function Address_To_Char_Ptr is
new Unchecked_Conversion
(Source => System.Address, Target => Ubt.Char_Ptr);
function Char_Ptr_To_Address is
new Unchecked_Conversion (Source => Ubt.Char_Ptr,
Target => System.Address);
function Host_To_Host_Id (Host_Name : String)
return Transport_Defs.Host_Id is
Uhn : constant String := String_Utilities.Upper_Case (Host_Name);
begin
if Uhn = "BELLADONE" then
--Put_Line ("host_to_host_id: belladone");
return (193, 54, 145, 17);
elsif Uhn = "ANCOLIE" then
--Put_Line ("host_to_host_id: ancolie");
return (193, 53, 145, 16);
elsif Uhn = "ACONIT" then
--Put_Line ("host_to_host_id: aconit");
return (193, 54, 145, 134);
else
Put_Line ("host_to_host_id: *" & Host_Name & "*");
raise Prototype_Error;
end if;
end Host_To_Host_Id;
-- function Host_To_Host_Id (Host_Name : String)
-- return Transport_Defs.Host_Id is
--
-- Host_Name_C : constant String := Host_Name & Ascii.Nul;
--
-- Host_Name_Ptr : Ubt.Char_Ptr :=
-- Address_To_Char_Ptr (Host_Name_C'Address);
--
-- H_Ptr : Ssi.Hostent_Ptr;
--
-- begin
-- New_Line;
-- Put_Line ("host_name => " & Host_Name);
--
-- H_Ptr := Ssi.Gethostbyname (Host => Host_Name_Ptr);
--
-- declare
-- Host : String (1 .. 80);
-- for Host use at Char_Ptr_To_Address (H_Ptr.H_Name);
-- Terminator : Integer := Host'First;
-- begin
-- for I in Host'Range loop
-- exit when Host (I) = Ascii.Nul;
-- Terminator := Terminator + 1;
-- end loop;
--
-- Put_Line ("h_name => " & Host);
-- end;
--
-- if H_Ptr.H_Addr_List = null then
-- Put_Line ("H_Ptr.H_Addr_List is null");
-- else
-- Put_Line ("H_Ptr.H_Addr_List is not null");
-- end if;
--
-- Put_Line ("H_Ptr.H_Addr_List.all'length => " &
-- Integer'Image (H_Ptr.H_Addr_List.all'Length));
--
-- declare
-- Tab : Unix_Base_Types.Char_Ptrs (1 .. 1) := H_Ptr.H_Addr_List.all;
-- begin
-- Put_Line ("tab'length => " & Integer'Image (Tab'Length));
--
-- if Tab (Tab'First) = null then
-- Put_Line ("first of tab is null");
-- else
-- Put_Line ("first of tab is not null");
--
-- end if;
--
-- declare
-- C1 : Character := Tab (0).all;
-- begin
-- Put_Line ("c1 => " & C1);
-- end;
-- end;
--
--
--
--
-- return Transport_Defs.Null_Host_Id;
-- end Host_To_Host_Id;
--
--
--
function Local_Host_Name
(Network : Transport_Defs.Network_Name) return String is
function Get_Host_Name
(Host : in Unix_Base_Types.Char_Ptr; Length : Integer)
return Integer;
pragma Interface (C, Get_Host_Name);
pragma Interface_Information (Get_Host_Name, ".gethostname");
Host : String (1 .. 80);
Terminator : Integer := Host'First;
begin
if Get_Host_Name (Address_To_Char_Ptr (Host'Address), Host'Length) /=
0 then
Put_Line
("local_host_name: unknown host, will return empty string ");
return "";
end if;
for I in Host'Range loop
exit when Host (I) = Ascii.Nul;
Terminator := Terminator + 1;
end loop;
return Host (Host'First .. Terminator - 1);
end Local_Host_Name;
end Transport_Name;
nblk1=7
nid=6
hdr6=c
[0x00] rec0=26 rec1=00 rec2=01 rec3=00e
[0x01] rec0=20 rec1=00 rec2=03 rec3=00c
[0x02] rec0=08 rec1=00 rec2=07 rec3=050
[0x03] rec0=1e rec1=00 rec2=04 rec3=00c
[0x04] rec0=24 rec1=00 rec2=05 rec3=036
[0x05] rec0=0a rec1=00 rec2=02 rec3=001
[0x06] rec0=f0 rec1=54 rec2=00 rec3=002
tail 0x2154743ec8666721a9937 0x42a00088462060003
Free Block Chain:
0x6: 0000 00 00 01 4b 80 07 64 65 63 6c 61 72 65 07 00 27 ┆ K declare '┆