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

⟦62ab7854a⟧ Ada Source

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

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

    type Conversion is
       array (Command_Type'First .. Command_Type'Last) of Command_String;

    To_String : constant Conversion :=
       (Registration => Command_Type'Image (Registration)
                           (1 .. Length_Command_String),
        Unregistration => Command_Type'Image (Unregistration)
                             (1 .. Length_Command_String),
        Queries => Command_Type'Image (Queries) (1 .. Length_Command_String),
        Request => Command_Type'Image (Request) (1 .. Length_Command_String),
        Notification => Command_Type'Image (Notification)
                           (1 .. Length_Command_String),
        Forward => Command_Type'Image (Forward) (1 .. Length_Command_String),
        Publication => Command_Type'Image (Publication)
                          (1 .. Length_Command_String),
        Unpublication => Command_Type'Image (Unpublication)
                            (1 .. Length_Command_String),
        Subscription => Command_Type'Image (Subscription)
                           (1 .. Length_Command_String),
        Unsubscription => Command_Type'Image (Unsubscription)
                             (1 .. Length_Command_String),
        Filtration => Command_Type'Image (Filtration)
                         (1 .. Length_Command_String),
        Unfiltration => Command_Type'Image (Unfiltration)
                           (1 .. Length_Command_String));


    procedure Fill (Data : in out Data_String; Mess : in Tmessage) is
    begin
        Bounded_String.Copy
           (Source => Identification.Tclient_Id'Image (Mess.Origin) &
                         ":" & To_String (Mess.Command) & ":" &
                         Bounded_String.Image (Mess.Content),
            Target => Data);
    end Fill;

    procedure Unfill (Data : in Data_String; Mess : in out Tmessage) is
        Intermediaire : Command_String;
        I, J : Natural := 1;
        Char : String (1 .. 1);
    begin
        loop
            Char := Bounded_String.Extract
                       (Source => Data, Start_Pos => J, End_Pos => J);
            exit when Char = ":";
            J := J + 1;
        end loop;
        Mess.Origin := Identification.Tclient_Id'Value
                          (Bounded_String.Extract (Data, I, J - 1));
        I := J + 1;
        J := Length_Command_String + I - 1;
        Intermediaire := Bounded_String.Extract
                            (Source => Data, Start_Pos => I, End_Pos => J);
        for Index in Command_Type'First .. Command_Type'Last loop
            if Intermediaire = To_String (Index) then
                Mess.Command := Index;
            end if;
        end loop;
        I := J + 2;
        J := Bounded_String.Length (Data);
        Bounded_String.Copy
           (Target => Mess.Content,
            Source => Bounded_String.Extract
                         (Source => Data, Start_Pos => I, End_Pos => J));
    end Unfill;

    procedure Fill_Command (Mess : out Tmessage; Comm : in Command_Type) is
    begin
        Mess.Command := Comm;
    end Fill_Command;

    procedure Unfill_Command (Mess : in Tmessage; Comm : out Command_Type) is
    begin
        Comm := Mess.Command;
    end Unfill_Command;

    procedure Fill_Origin (Mess : out Tmessage;
                           Orig : in Identification.Tclient_Id) is
    begin
        Mess.Origin := Orig;
    end Fill_Origin;

    procedure Unfill_Origin (Mess : in Tmessage;
                             Orig : out Identification.Tclient_Id) is
    begin
        Orig := Mess.Origin;
    end Unfill_Origin;

    procedure Fill_Content (Mess : out Tmessage; Cont : in Content_String) is
    begin
        Mess.Content := Cont;
    end Fill_Content;

    procedure Unfill_Content (Mess : in Tmessage; Cont : out Content_String) is
    begin
        Cont := Mess.Content;
    end Unfill_Content;
end Message;

E3 Meta Data

    nblk1=6
    nid=4
    hdr6=a
        [0x00] rec0=14 rec1=00 rec2=01 rec3=072
        [0x01] rec0=17 rec1=00 rec2=06 rec3=02a
        [0x02] rec0=18 rec1=00 rec2=02 rec3=080
        [0x03] rec0=21 rec1=00 rec2=05 rec3=02e
        [0x04] rec0=02 rec1=00 rec2=03 rec3=000
        [0x05] rec0=43 rec1=d1 rec2=48 rec3=4e4
    tail 0x2175f8e3687bd454f4009 0x42a00088462060003
Free Block Chain:
  0x4: 0000  00 00 01 aa 80 20 20 20 20 20 20 20 20 20 20 20  ┆                ┆