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: 2587 (0xa1b) Types: TextFile Names: »B«
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11 └─ ⟦129cab021⟧ »DATA« └─⟦this⟧ └─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04 └─ ⟦d65440be7⟧ »DATA« └─⟦this⟧
WITH Messages; PACKAGE BODY Mailboxes IS PROCEDURE Find_Message (Message : Sequence_Number; The_Mailbox : IN OUT Mailbox); FUNCTION Make RETURN Mailbox IS BEGIN RETURN Nil; END Make; PROCEDURE Add (Message : Messages.Message; The_Mailbox : IN OUT Mailbox) IS New_Entry : CONSTANT Mailbox := Make ((False, Message), Nil); Temp : Mailbox := The_Mailbox; BEGIN IF Is_Empty (Temp) THEN The_Mailbox := New_Entry; ELSE WHILE NOT Is_Empty (Rest (Temp)) LOOP Temp := Rest (Temp); END LOOP; Set_Rest (Temp, New_Entry); END IF; END Add; FUNCTION Last_Message (The_Mailbox : Mailbox) RETURN Sequence_Number IS BEGIN RETURN Length (The_Mailbox); END Last_Message; PROCEDURE Find_Message (Message : Sequence_Number; The_Mailbox : IN OUT Mailbox) IS BEGIN IF Message = 0 OR ELSE Length (The_Mailbox) < Message THEN RAISE Nonexistent_Sequence_Number; END IF; FOR I IN 1 .. Message - 1 LOOP The_Mailbox := Rest (The_Mailbox); END LOOP; END Find_Message; FUNCTION Get_Message (Message : Sequence_Number; The_Mailbox : Mailbox) RETURN Messages.Message IS Temp : Mailbox := The_Mailbox; BEGIN Find_Message (Message, Temp); RETURN First (Temp).Message; END Get_Message; FUNCTION Get_Read_Flag (Message : Sequence_Number; The_Mailbox : Mailbox) RETURN Boolean IS Temp : Mailbox := The_Mailbox; BEGIN Find_Message (Message, Temp); RETURN First (Temp).Read_Flag; END Get_Read_Flag; PROCEDURE Set_Read_Flag (Message : Sequence_Number; New_Value : Boolean; The_Mailbox : IN OUT Mailbox) IS Temp : Mailbox := The_Mailbox; BEGIN Find_Message (Message, Temp); DECLARE New_Entry : CONSTANT Mailbox_Entry := (New_Value, First (Temp).Message); BEGIN Set_First (Temp, New_Entry); END; END Set_Read_Flag; PROCEDURE Delete_Message (Message : Sequence_Number; The_Mailbox : IN OUT Mailbox) IS Temp : Mailbox := The_Mailbox; BEGIN IF Message = 1 THEN The_Mailbox := Rest (The_Mailbox); ELSE Find_Message (Message - 1, Temp); Set_Rest (Temp, Rest (Rest (Temp))); END IF; END Delete_Message; END Mailboxes;