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

⟦0eb2cf0f6⟧ Ada Source

    Length: 8192 (0x2000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Last_Update_F, package body Last_Update_R, seg_025194

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 Communications;
with Errors;
with Files;
with Interchange;
with Mac_Files;  
with Mac_Path;
with Mac_Types;
with Mac_Text;
with Osutils;
with Rational_Error;
with System;
with Talk_Utils;
with Text_Io;
use Text_Io;
with Unchecked_Conversion;
package body Last_Update_R is

    package Last_Update_F is

        procedure Of_Remote_File_In (Name : Mac_Text.Text);
        procedure In_Seconds_Out (Seconds : out Mac_Types.Longint);
        procedure Options_In (Options : Mac_Text.Text);
        procedure End_Last_Update;

    end Last_Update_F;

    package body Last_Update_F is  
        Err : Mac_Types.Oserr := Mac_Types.Noerr;
        Refnum : Mac_Types.Integer;
        Mod_Time : Mac_Types.Longint;

        function As_Varinteger is new Unchecked_Conversion
                                         (Source => System.Address,
                                          Target => Mac_Types.Varinteger);

        function As_Varlongint is new Unchecked_Conversion
                                         (Source => System.Address,
                                          Target => Mac_Types.Varlongint);

        function As_Stringptr is new Unchecked_Conversion
                                        (Source => System.Address,
                                         Target => Mac_Types.Stringptr);

        function As_Hparmblkptr is
           new Unchecked_Conversion (Source => System.Address,
                                     Target => Files.Hparmblkptr);


        procedure Of_Remote_File_In (Name : Mac_Text.Text) is
            S : Mac_Types.Str255 := Mac_Text.Value (Name);  
            Pb : Files.Filehparamblockrec;
        begin
            Pb.Iocompletion := null;
            Pb.Ionameptr := As_Stringptr (S'Address);
            Pb.Iovrefnum := 0;
            Pb.Iofdirindex := 0;
            Pb.Iodirid := 0;
            Err := Files.Pbhgetfinfo (As_Hparmblkptr (Pb'Address), False);
            if Err /= Mac_Types.Noerr then
                return;
            end if;  
            Mod_Time := Pb.Ioflmddat;
        end Of_Remote_File_In;

        procedure Options_In (Options : Mac_Text.Text) is
        begin
            null;
        end Options_In;

        procedure In_Seconds_Out (Seconds : out Mac_Types.Longint) is
            Loc_Time : Mac_Types.Longint;
        begin  
            Osutils.Getdatetime (Secs => Loc_Time);
            Seconds := Mod_Time - Loc_Time;
        end In_Seconds_Out;

        procedure End_Last_Update is
        begin  
            if Err /= Mac_Types.Noerr then
                Rational_Error.Raise_Mac_Error (Err);
            end if;
        end End_Last_Update;
    end Last_Update_F;

    procedure Read (A_Connection : in out Communications.Connection) is
        I : Mac_Types.Longint;
        B : Boolean;
        T : Mac_Text.Text (256);  
    begin
        Put_Line ("last_update_r:read begin");
        Interchange.Get_Int (A_Connection, I);
        if I /= Talk_Utils.F_Of_Remote_File then
            Rational_Error.Raise_Error (Rational_Error.Internal_Error);
        end if;
        Interchange.Get_Text (A_Connection, T);
        Last_Update_F.Of_Remote_File_In (T);
        Interchange.Get_Int (A_Connection, I);
        if I /= Talk_Utils.F_Options then
            Rational_Error.Raise_Error (Rational_Error.Internal_Error);
        end if;
        Interchange.Get_Text (A_Connection, T);
        Last_Update_F.Options_In (T);
        Interchange.Get_Int (A_Connection, I);
        if I /= Talk_Utils.F_Delimitor then
            Rational_Error.Raise_Error (Rational_Error.Internal_Error);
        end if;
        Interchange.Get_Int (A_Connection, I);
        if I /= Talk_Utils.R_Last_Update then
            Rational_Error.Raise_Error (Rational_Error.Internal_Error);
        end if;
        Put_Line ("last_update_r:read end");
    end Read;

    procedure Write (A_Connection : in out Communications.Connection) is
    begin
        Put_Line ("last_update_r:write begin");
        declare
            I : Mac_Types.Longint;
        begin  
            Last_Update_F.In_Seconds_Out (I);  
            Put ("last_update_r:write seconds : ");
            Put (Mac_Types.Longint'Image (I));
            Interchange.Put_Int (A_Connection, Talk_Utils.F_In_Seconds);
            Interchange.Put_Int (A_Connection, I);
            Last_Update_F.End_Last_Update;
        exception
            when others =>
                Rational_Error.Report
                   (A_Connection, Talk_Utils.R_Last_Update, Rational_Error.Get);
        end;
        Interchange.Put_Int (A_Connection, Talk_Utils.F_Delimitor);
        Interchange.Put_Int (A_Connection, Talk_Utils.R_Last_Update);
        Put_Line ("last_update_r:write end");
    end Write;

end Last_Update_R;

E3 Meta Data

    nblk1=7
    nid=4
    hdr6=c
        [0x00] rec0=25 rec1=00 rec2=01 rec3=038
        [0x01] rec0=00 rec1=00 rec2=03 rec3=03c
        [0x02] rec0=17 rec1=00 rec2=05 rec3=030
        [0x03] rec0=20 rec1=00 rec2=07 rec3=016
        [0x04] rec0=17 rec1=00 rec2=02 rec3=02c
        [0x05] rec0=17 rec1=00 rec2=06 rec3=000
        [0x06] rec0=04 rec1=00 rec2=02 rec3=000
    tail 0x217200e14839f58e817ce 0x42a00088462060003
Free Block Chain:
  0x4: 0000  00 00 03 72 00 09 20 20 20 20 62 65 67 69 6e 09  ┆   r      begin ┆