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

⟦8205427b9⟧ Ada Source

    Length: 8192 (0x2000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Package_Notice, seg_026cf1

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 Umps_Defs;
with Notice;
with Set;
with Slot;  
with Text_Io;

package body Package_Notice is

    procedure Test_Creation is
        Note  : Notice.Element;
        Param : Set.Object := Set.Null_Object;
        function Note_Image is new Notice.Image
                                      (Separator => Umps_Defs.Separator);
        use Text_Io;
    begin
        Put_Line ("-- Creation d'une Notice :");
        Put_Line ("-- NOTICE : 2, 4, File, Open, 1, Inode, INTEGER, 12.");
        Notice.Add_Sender (2, Note);
        Notice.Add_Handler (4, Note);
        Notice.Add_Class ("File", Note);
        Notice.Add_Id ("Open", Note);
        Param := Set.Add (Slot.Make ("Inode", 12), Param);
        Notice.Add_Params (Param, Note);
        Put_Line ("ENTEXTE : " & Note_Image (Note));
        Set.Free (Param);  
        New_Line;
        Notice.Display (Note);

        New_Line;
        Text_Io.Put_Line ("-- Notice");
        Put_Line (Umps_Defs.Behavior_Number'Image (Notice.Sender (Note)));
        Put_Line (Umps_Defs.Behavior_Number'Image (Notice.Handler (Note)));
        Put_Line (Notice.Class (Note));
        Put_Line (Notice.Id (Note));

    end Test_Creation;


    procedure Test_Comparaison is
        Note  : Notice.Element;
        Note2 : Notice.Element;
        Param : Set.Object := Set.Null_Object;
        function Is_Name_Equal  is new Notice.Is_Equal (Field => Slot.On_Name);
        function Is_Kind_Equal  is new Notice.Is_Equal (Field => Slot.On_Kind);
        function Is_Value_Equal is new Notice.Is_Equal (Field => Slot.On_Value);
        function Note_Image     is new Notice.Image
                                          (Separator => Umps_Defs.Separator);
        use Text_Io;
    begin
        Put_Line ("-- Creation d'une Notice :");
        Put_Line
           ("-- Notice : 2, 3, File, Open, 3, Inode, integer, 12, Name, string, toto.c, Time, integer, 13");
        Notice.Add_Sender (2, Note);
        Notice.Add_Handler (3, Note);
        Notice.Add_Class ("File", Note);
        Notice.Add_Id ("Open", Note);
        Param :=
           Set.Add (Slot.Make (The_Variable => "Name", With_Value => "toto.c"),
                    Param);
        Param :=
           Set.Add
              (Slot.Make (The_Variable => "Inode", With_Value => 12), Param);
        Param :=
           Set.Add
              (Slot.Make (The_Variable => "Time", With_Value => 13), Param);
        Notice.Add_Params (Param, Note);
        Put_Line ("ENTEXTE : " & Note_Image (Note));
        Set.Free (Param);
        New_Line;

        Put_Line ("-- Copie de la Notice");
        Note2 := Note;
        Put_Line ("-- Test egalite sur noms (TRUE)" &
                  Boolean'Image (Is_Name_Equal (Note, Note2)));
        Put_Line ("-- Test egalite sur kinds (TRUE)" &
                  Boolean'Image (Is_Kind_Equal (Note, Note2)));
        Put_Line ("-- Test egalite sur values (TRUE)" &
                  Boolean'Image (Is_Value_Equal (Note, Note2)));

        Put_Line ("-- Creation d'une 2eme requete avec une valeur vide");
        Notice.Add_Sender (2, Note2);
        Notice.Add_Handler (3, Note2);
        Notice.Add_Class ("File", Note2);
        Notice.Add_Id ("Open", Note2);
        Param :=
           Set.Add (Slot.Make (The_Variable => "Name", With_Value => "toto.c"),
                    Param);
        Param :=
           Set.Add
              (Slot.Make (The_Variable => "Inode", With_Value => 12), Param);
        Param :=
           Set.Add
              (Slot.Make (The_Variable => "Time", With_Kind => Slot.Integer),
               Param);
        Notice.Add_Params (Param, Note2);
        Put_Line ("ENTEXTE : " & Note_Image (Note2));
        Set.Free (Param);
        Put_Line ("-- Test egalite sur noms (TRUE)" &
                  Boolean'Image (Is_Name_Equal (Note, Note2)));
        Put_Line ("-- Test egalite sur kinds (TRUE)" &
                  Boolean'Image (Is_Kind_Equal (Note, Note2)));
        Put_Line ("-- Test egalite sur values (FALSE)" &
                  Boolean'Image (Is_Value_Equal (Note, Note2)));
        New_Line;  
    end Test_Comparaison;


    procedure Test is
        use Text_Io;
    begin  
        New_Line;
        Put_Line ("---> Test package Notice");
        New_Line;

        Put_Line ("-- Test de creation et affichage");
        Test_Creation;
        New_Line;

        Put_Line ("-- Test de comparaison");
        Test_Comparaison;
        New_Line;
    end Test;


end Package_Notice;

E3 Meta Data

    nblk1=7
    nid=7
    hdr6=a
        [0x00] rec0=20 rec1=00 rec2=01 rec3=032
        [0x01] rec0=16 rec1=00 rec2=02 rec3=02c
        [0x02] rec0=18 rec1=00 rec2=06 rec3=054
        [0x03] rec0=17 rec1=00 rec2=04 rec3=056
        [0x04] rec0=1a rec1=00 rec2=05 rec3=000
        [0x05] rec0=1a rec1=00 rec2=03 rec3=001
        [0x06] rec0=06 rec1=2c rec2=00 rec3=011
    tail 0x21520433283aa6770cd53 0x42a00088462063c03
Free Block Chain:
  0x7: 0000  00 03 02 95 80 0a 20 28 54 52 55 45 29 22 20 26  ┆       (TRUE)" &┆
  0x3: 0000  00 00 02 8f 80 04 29 22 20 26 04 00 3f 20 20 20  ┆      )" &  ?   ┆