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

⟦74729b876⟧ Ada Source

    Length: 7168 (0x1c00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Message, seg_052f0e

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



package body Message is

    function Initialize (Op : Kind_Of_Message;
                         L_S : Transport_Defs.Socket_Id;
                         R_S : Transport_Defs.Socket_Id;
                         R_H : My_String;
                         Jo : Positive;
                         Com : My_String) return Object is
        Element : Object;
    begin  
        Element.Operation := Op;
        Element.Local_Socket := L_S;  
        Element.Remote_Socket := R_S;
        Bounded_String.Copy (Element.Remote_Host, R_H);
        Element.Job := Jo;
        Bounded_String.Copy (Element.Comment, Com);
        return Element;
    end Initialize;


    function Record_To_String (Mess : Object) return My_String is
        Buffer : My_String;
    begin
        Bounded_String.Copy
           (Buffer, "#" & Message.Kind_Of_Message'Image (Mess.Operation) &
                       "#" & Utils.Byte_String_To_String  
                                (Byte_Defs.Byte_String (Mess.Local_Socket)) &
                       "#" & Utils.Byte_String_To_String
                                (Byte_Defs.Byte_String (Mess.Remote_Socket)) &
                       "#" & Bounded_String.Image (Mess.Remote_Host) &
                       "#" & Positive'Image (Mess.Job) & "#" &
                       Bounded_String.Image (Mess.Comment) & "#");
        return Buffer;

    end Record_To_String;

    function String_To_Record (Mess : My_String) return Object is
        Separator : Character := '#';
        Op : Kind_Of_Message;
        Crt, Last : Positive;
        Element : Object;
        function Extract return String is
            Buffer : My_String;
        begin  
            while Bounded_String.Char_At (Mess, Crt) /= Separator loop  
                Text_Io.Put_Line ("valeur de crt: " & Positive'Image (Crt));  
                Text_Io.Put (Bounded_String.Char_At (Mess, Crt));
                Bounded_String.Append (Buffer,
                                       Bounded_String.Char_At (Mess, Crt));
                Crt := Crt + 1;
            end loop;  
            Text_Io.Put (Bounded_String.Char_At (Mess, Crt));
            Text_Io.Put_Line ("Fin de boucle");
            if Bounded_String.Image (Buffer) = "" then
                Text_Io.Put_Line ("coucou");
                Crt := Crt + 1;
                Bounded_String.Copy (Buffer, Extract);
            end if;
            Text_Io.Put_Line ("buffer: " & Bounded_String.Image (Buffer));
            Crt := Crt + 1;
--            Text_Io.Put ("Hello:" & Bounded_String.Char_At (Mess, Crt));
            return Bounded_String.Image (Buffer);  
        end Extract;
    begin  
        Text_Io.Put_Line (Bounded_String.Image (Mess));
        Crt := 1;
        if Bounded_String.Char_At (Mess, Crt) = Separator then
            Crt := Crt + 1;
            Text_Io.Put_Line ("Premier separateur repere");
        else
            Text_Io.Put_Line ("Premier separateur manquant");
        end if;

        Kind_Of_Mess_Io.Get (Extract, Op,
                             Last);  -- Transforme un string en enumeration
        Element :=
           Initialize (Op => Op,
                       L_S => Transport_Defs.Socket_Id
                                 (Utils.String_To_Byte_String (Extract)),
                       R_S => Transport_Defs.Socket_Id
                                 (Utils.String_To_Byte_String (Extract)),
                       R_H => Bounded_String.Value (Extract),  
                       Jo => Positive'Value (Extract),
                       Com => Bounded_String.Value (Extract));

        return Element;
        return Object'
                  (Operation => Op,
                   Local_Socket => Transport_Defs.Socket_Id
                                      (Utils.String_To_Byte_String (Extract)),
                   Remote_Socket => Transport_Defs.Socket_Id
                                       (Utils.String_To_Byte_String (Extract)),
                   Remote_Host => Bounded_String.Value (Extract),
                   Job => Positive'Value (Extract),
                   Comment => Bounded_String.Value (Extract));

    end String_To_Record;
end Message;



E3 Meta Data

    nblk1=6
    nid=5
    hdr6=a
        [0x00] rec0=1c rec1=00 rec2=01 rec3=050
        [0x01] rec0=16 rec1=00 rec2=06 rec3=004
        [0x02] rec0=16 rec1=00 rec2=03 rec3=032
        [0x03] rec0=15 rec1=00 rec2=04 rec3=036
        [0x04] rec0=09 rec1=00 rec2=02 rec3=000
        [0x05] rec0=43 rec1=d1 rec2=9f rec3=12c
    tail 0x2175a9eda87a84b6f10f8 0x42a00088462060003
Free Block Chain:
  0x5: 0000  00 00 00 fa 80 05 63 74 29 29 2c 05 00 41 20 20  ┆      ct)),  A  ┆