DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦f4aef06a1⟧ Ada Source

    Length: 5120 (0x1400)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Com_Chanel, seg_057f14, seg_05825a

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



with Byte_Defs;
with Transport_Defs;
with Host_Id_Io;
with Text_Io;

package body Com_Chanel is
    Sep : constant Character := '%';

    function Image (O : Object) return Var_String.V_String is
    begin
        return Var_String.Value
                  (Sep & Host_Id_Io.Image (O.Host_Id) & Sep &
                   Integer'Image (Integer (O.Socket_Id (1)) * 256 +
                                  Integer (O.Socket_Id (2))) & Sep);
    end Image;


    function Value (V : Var_String.V_String) return Object is
        S : String (1 .. Var_String.Length (V)) := Var_String.Image (V);
        Host : Positive := S'First + 1;
        Host1 : Positive := S'First + 1;
        Socket : Positive;
        Ip_1, Ip_2, Ip_3, Ip_4 : Byte_Defs.Byte;
        Sock : Integer;
    begin
        loop
            exit when S (Host) = '.';
            Host := Host + 1;
        end loop;  
        Ip_1 := Byte_Defs.Byte (Integer'Value (S (Host1 .. Host - 1)));

        Host := Host + 1;
        Host1 := Host;
        loop
            exit when S (Host) = '.';
            Host := Host + 1;
        end loop;
        Ip_2 := Byte_Defs.Byte (Integer'Value (S (Host1 .. Host - 1)));

        Host := Host + 1;
        Host1 := Host;
        loop
            exit when S (Host) = '.';
            Host := Host + 1;
        end loop;  
        Ip_3 := Byte_Defs.Byte (Integer'Value (S (Host1 .. Host - 1)));

        Host := Host + 1;
        Host1 := Host;
        loop
            exit when S (Host) = Sep;
            Host := Host + 1;
        end loop;
        Ip_4 := Byte_Defs.Byte (Integer'Value (S (Host1 .. Host - 1)));

        Socket := Host + 1;
        Host1 := Host + 1;
        loop
            exit when S (Socket) = Sep;  
            Socket := Socket + 1;
        end loop;
        Sock := Integer'Value (S (Host1 .. Socket - 1));

        return Object'(Host_Id => (Ip_1, Ip_2, Ip_3, Ip_4),
                       Socket_Id => (Byte_Defs.Byte (Sock / 256),
                                     Byte_Defs.Byte (Sock mod 256)));
    end Value;


    procedure Set_Chanel (O : out Object;
                          Host : in Transport_Defs.Host_Id;
                          Socket : in Transport_Defs.Socket_Id) is
    begin
        O.Host_Id := Host;
        O.Socket_Id := Socket;
    end Set_Chanel;

    function Get_Socket_Id (O : Object) return Transport_Defs.Socket_Id is
    begin
        return O.Socket_Id;
    end Get_Socket_Id;


    function Get_Host_Id (O : Object) return Transport_Defs.Host_Id is
    begin
        return O.Host_Id;
    end Get_Host_Id;


    function Get_Orb_Chanel return Com_Chanel.Object is
    begin
        return Object'(Host_Id => (193, 54, 146, 132), Socket_Id => (10, 41));
    end Get_Orb_Chanel;
end Com_Chanel;

E3 Meta Data

    nblk1=4
    nid=0
    hdr6=8
        [0x00] rec0=20 rec1=00 rec2=01 rec3=000
        [0x01] rec0=04 rec1=00 rec2=04 rec3=014
        [0x02] rec0=1f rec1=00 rec2=03 rec3=020
        [0x03] rec0=1d rec1=00 rec2=02 rec3=000
    tail 0x21765409887d659e62639 0x42a00088462060003