DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: ┃ B T ┃
Length: 8869 (0x22a5) Types: TextFile Names: »B«
└─⟦149519bd4⟧ Bits:30000546 8mm tape, Rational 1000, !projects 93-07-13 └─ ⟦124ff5788⟧ »DATA« └─⟦this⟧ └─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11 └─ ⟦129cab021⟧ »DATA« └─⟦this⟧ └─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16 └─ ⟦6f12a12be⟧ »DATA« └─⟦this⟧ └─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04 └─ ⟦d65440be7⟧ »DATA« └─⟦this⟧
------------------------------------------------------------------------------- with Umps_Defs; with Text_Io; with Wild_String; with Database; with Slot; with Set; with Request; package body Package_Database is --------------------------------------------------------------------------- function Create (Sender : Umps_Defs.Behavior_Number; Handler : Umps_Defs.Behavior_Number; Method : String) return Request.Element is Rq : Request.Element; begin Request.Add_Sender (Sender, Rq); Request.Add_Handler (Handler, Rq); Request.Add_Method (Method, Rq); return Rq; end Create; --------------------------------------------------------------------------- procedure Test_Remplissage is Rq : Request.Element; Rq2 : Request.Element; Param : Set.Object; use Text_Io; begin Put_Line ("-- Destruction Database"); Database.Destroy; Put_Line ("-- Ouverture Database"); Database.Open; Put_Line ("-- Database Vide"); Database.Display; New_Line; Put_Line ("-- Ajout de : Open(File : in string := ""toto.c"";"); Put_Line (" Rights : in string := ""rw"";"); Put_Line (" Is_Open : out integer);"); Rq := Create (1, Umps_Defs.Any_Behaviors, "Open"); Request.Add_Param (Slot.Make ("File", "toto.c"), Rq); Request.Add_Param (Slot.Make ("Rights", "rw"), Rq); Request.Add_Param (Slot.Make ("Is_Open", Slot.Boolean), Rq); Database.Put (Rq); Database.Display; New_Line; Put_Line ("-- Ajout de : Close(File : string;"); Put_Line (" Is_Open : integer);"); Rq := Create (2, Umps_Defs.Any_Behaviors, "Close"); Request.Add_Param (Slot.Make ("File", Slot.String), Rq); Request.Add_Param (Slot.Make ("Is_ok", Slot.Integer), Rq); Database.Put (Rq); Database.Display; New_Line; Put_Line ("-- Ajout de : Put(The_Car : character := 'a';"); Put_Line (" File : string := ""toto.c"");"); Rq := Create (2, Umps_Defs.Any_Behaviors, "Put"); Request.Add_Param (Slot.Make ("The_Car", 'a'), Rq); Request.Add_Param (Slot.Make ("File", "toto.c"), Rq); Database.Put (Rq); Database.Display; New_Line; Put_Line ("-- Ajout de : Date(Day : integer;"); Put_Line (" Month : integer;"); Put_Line (" Year : integer );"); Rq := Create (4, Umps_Defs.Any_Behaviors, "Date"); Request.Add_Param (Slot.Make ("Day", Slot.Integer), Rq); Request.Add_Param (Slot.Make ("Month", Slot.Integer), Rq); Request.Add_Param (Slot.Make ("Year", Slot.Integer), Rq); Database.Put (Rq); Database.Display; New_Line; Put_Line ("-- Ajout de : Date(Time : string);"); Rq := Create (5, Umps_Defs.Any_Behaviors, "Date"); Request.Add_Param (Slot.Make ("Time", Slot.String), Rq); Database.Put (Rq); Database.Display; New_Line; end Test_Remplissage; --------------------------------------------------------------------------- procedure Test_Interrogation is Iter : Database.Iter_Request; Rq : Request.Element; Action : Database.Actions; State : Database.States; Param : Set.Object; use Text_Io; begin Put_Line ("-- Recherche d'une requete faisant date"); Rq := Create (Umps_Defs.Any_Behaviors, Umps_Defs.Any_Behaviors, "Date"); Database.Init (Iter, Rq, Slot.On_None, Database.Performed, Database.Unlock); Research_Each_Element: while (not Database.Done (Iter)) loop Database.Value (Iter, Rq, Action, State); Request.Display (Rq); Put_Line ("-- Action : " & Database.Actions'Image (Action)); Put_Line ("-- State : " & Database.States'Image (State)); Database.Next (Iter); end loop Research_Each_Element; New_Line; Put_Line ("-- Recherche d'une requete faisant Date(Day, Month, Year)"); Rq := Create (Umps_Defs.Any_Behaviors, Umps_Defs.Any_Behaviors, "Date"); Request.Add_Param (Slot.Make ("Day", Slot.Void), Rq); Request.Add_Param (Slot.Make ("Month", Slot.Void), Rq); Request.Add_Param (Slot.Make ("Year", Slot.Void), Rq); Database.Init (Iter, Rq, Slot.On_Name, Database.Performed, Database.Unlock); Research_Element: while (not Database.Done (Iter)) loop Database.Value (Iter, Rq, Action, State); Request.Display (Rq); Put_Line ("-- Action : " & Database.Actions'Image (Action)); Put_Line ("-- State : " & Database.States'Image (State)); Database.Next (Iter); end loop Research_Element; New_Line; Put_Line ("-- Recherche d'une requete faisant Date(Day : integer, Month : string, Year: integer)"); Rq := Create (Umps_Defs.Any_Behaviors, Umps_Defs.Any_Behaviors, "Date"); Request.Add_Param (Slot.Make ("Day", Slot.Integer), Rq); Request.Add_Param (Slot.Make ("Month", Slot.String), Rq); Request.Add_Param (Slot.Make ("Year", Slot.Integer), Rq); Database.Init (Iter, Rq, Slot.On_Kind, Database.Performed, Database.Unlock); while (not Database.Done (Iter)) loop Database.Value (Iter, Rq, Action, State); Request.Display (Rq); Put_Line ("-- Action : " & Database.Actions'Image (Action)); Put_Line ("-- State : " & Database.States'Image (State)); Database.Next (Iter); end loop; New_Line; Put_Line ("-- Recherche d'une requete faisant Date(Day : integer, Month : integer, Year: integer)"); Rq := Create (Umps_Defs.Any_Behaviors, Umps_Defs.Any_Behaviors, "Date"); Request.Add_Param (Slot.Make ("Day", Slot.Integer), Rq); Request.Add_Param (Slot.Make ("Month", Slot.Integer), Rq); Request.Add_Param (Slot.Make ("Year", Slot.Integer), Rq); Database.Init (Iter, Rq, Slot.On_Kind, Database.Performed, Database.Unlock); while (not Database.Done (Iter)) loop Database.Value (Iter, Rq, Action, State); Request.Display (Rq); Put_Line ("-- Action : " & Database.Actions'Image (Action)); Put_Line ("-- State : " & Database.States'Image (State)); Database.Next (Iter); end loop; New_Line; Put_Line ("-- Recherche d'une requete faisant Open(""toto.c"", ""rw"", Result : boolean)"); Rq := Create (Umps_Defs.Any_Behaviors, Umps_Defs.Any_Behaviors, "Open"); Request.Add_Param (Slot.Make ("File", "toto.c"), Rq); Request.Add_Param (Slot.Make ("Rights", "rw"), Rq); Request.Add_Param (Slot.Make ("Is_Open", Slot.Boolean), Rq); Database.Init (Iter, Rq, Slot.On_Value, Database.Performed, Database.Unlock); while (not Database.Done (Iter)) loop Database.Value (Iter, Rq, Action, State); Request.Display (Rq); Put_Line ("-- Action : " & Database.Actions'Image (Action)); Put_Line ("-- State : " & Database.States'Image (State)); Database.Next (Iter); end loop; New_Line; Put_Line ("-- Recherche de toutes les requetes"); Rq := Create (Umps_Defs.Any_Behaviors, Umps_Defs.Any_Behaviors, "" & Wild_String.Wildcard.Question_Mark); Database.Init (Iter, Rq, Slot.On_None, Database.Performed, Database.Unlock); while (not Database.Done (Iter)) loop Database.Value (Iter, Rq, Action, State); Request.Display (Rq); Put_Line ("-- Action : " & Database.Actions'Image (Action)); Put_Line ("-- State : " & Database.States'Image (State)); Database.Next (Iter); end loop; end Test_Interrogation; --------------------------------------------------------------------------- procedure Test is use Text_Io; begin Put_Line ("---> Test Package Database"); New_Line; Put_Line ("-- Remplissage de la database"); Test_Remplissage; New_Line; Put_Line ("-- Test interrogation"); Test_Interrogation; New_Line; end Test; end Package_Database; -------------------------------------------------------------------------------