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

⟦2e55ccaef⟧ Ada Source

    Length: 12288 (0x3000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Delete_F, package body Delete_R, seg_02506a

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

    package Delete_F is

        procedure Recursive_In (Is_Recursive : Boolean);
        procedure Remote_File_In (Name : Mac_Text.Text);  
        procedure Options_In (Options : Mac_Text.Text);
        procedure End_Delete;

    end Delete_F;

    package body Delete_F is  
        Err : Mac_Types.Oserr := Mac_Types.Noerr;
        Recursive : Boolean := False;

        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);


        procedure Recursive_In (Is_Recursive : Boolean) is
        begin
            Err := Mac_Types.Noerr;
            Recursive := Is_Recursive;
        end Recursive_In;

        procedure Remote_File_In (Name : Mac_Text.Text) is
        begin  
            Err := Mac_Files.Delete_File (Name, Recursive);
            if Recursive then
                Mac_Files.Set_Current_User_Home;
            end if;
        end Remote_File_In;

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

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

    end Delete_F;

    procedure Read (A_Connection : in out Communications.Connection) is
        I : Mac_Types.Longint;
        B : Boolean;
        T : Mac_Text.Text (256);  
    begin
        Put_Line ("delete_r:read begin");
        Interchange.Get_Int (A_Connection, I);
        if I /= Talk_Utils.F_Recursive then
            Rational_Error.Raise_Error (Rational_Error.Internal_Error);
        end if;  
        Interchange.Get_Bool (A_Connection, B);
        Delete_F.Recursive_In (B);
        Put ("delete_r:read recursive : ");
        Put_Line (Boolean'Image (B));
        Interchange.Get_Int (A_Connection, I);
        if I /= Talk_Utils.F_Remote_File then
            Rational_Error.Raise_Error (Rational_Error.Internal_Error);
        end if;  
        Interchange.Get_Text (A_Connection, T);
        Delete_F.Remote_File_In (T);
        Put ("delete_r:to file '");
        for I in 1 .. Mac_Text.Length (T) loop
            Put (Character'Val (Mac_Types.Char'Pos (Mac_Text.Value (I, T))));
        end loop;
        Put_Line ("'");
        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);
        Delete_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_Delete then
            Rational_Error.Raise_Error (Rational_Error.Internal_Error);
        end if;
        Put_Line ("delete_r:read end");
    end Read;

    procedure Write (A_Connection : in out Communications.Connection) is
    begin
        Put_Line ("delete_r:write begin");
        begin  
            Delete_F.End_Delete;
        exception
            when others =>
                Rational_Error.Report
                   (A_Connection, Talk_Utils.R_Delete, Rational_Error.Get);
        end;
        Interchange.Put_Int (A_Connection, Talk_Utils.F_Delimitor);
        Interchange.Put_Int (A_Connection, Talk_Utils.R_Delete);
        Put_Line ("delete_r:write end");
    end Write;

end Delete_R;

E3 Meta Data

    nblk1=b
    nid=4
    hdr6=a
        [0x00] rec0=27 rec1=00 rec2=01 rec3=01a
        [0x01] rec0=20 rec1=00 rec2=05 rec3=076
        [0x02] rec0=18 rec1=00 rec2=02 rec3=02e
        [0x03] rec0=1a rec1=00 rec2=09 rec3=052
        [0x04] rec0=08 rec1=00 rec2=08 rec3=000
        [0x05] rec0=21 rec1=00 rec2=04 rec3=006
        [0x06] rec0=15 rec1=00 rec2=09 rec3=04c
        [0x07] rec0=13 rec1=00 rec2=03 rec3=000
        [0x08] rec0=0b rec1=00 rec2=02 rec3=000
        [0x09] rec0=06 rec1=00 rec2=08 rec3=000
        [0x0a] rec0=da rec1=ea rec2=e0 rec3=000
    tail 0x2172004a6839f4a4d0eea 0x42a00088462060003
Free Block Chain:
  0x4: 0000  00 0a 00 3c 80 12 65 74 65 5f 72 3a 77 72 69 74  ┆   <  ete_r:writ┆
  0xa: 0000  00 06 01 42 80 10 20 3d 3e 20 4d 61 78 5f 4c 65  ┆   B   => Max_Le┆
  0x6: 0000  00 03 03 76 80 23 72 20 3a 3d 20 46 69 6c 65 73  ┆   v #r := Files┆
  0x3: 0000  00 0b 02 5d 00 47 20 20 20 20 20 20 20 20 20 20  ┆   ] G          ┆
  0xb: 0000  00 07 00 0f 00 0c 20 20 20 20 20 20 20 20 20 20  ┆                ┆
  0x7: 0000  00 00 03 f9 80 03 65 29 3b 03 00 35 20 20 20 20  ┆      e);  5    ┆