DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

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 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦cfaa00a9f⟧ TextFile

    Length: 4724 (0x1274)
    Types: TextFile
    Names: »B«

Derivation

└─⟦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⟧ 

TextFile

with Communications;
with Copy_R;
with Create_R;
with Delete_R;
with Expunge_R;
with File_Exists_R;
with Files;
with Get_R;
with Identity;
with Input_To_Shell_R;
with Interchange;
with Last_Update_R;
with Ls_R;
with Mac_Files;
with Mac_Types;
with Move_R;
with Put_R;
with Rational_Error;
with Remote_Shell;
with Signal_To_Shell_R;
with Talk_Utils;
with Tcp;
with Text_Io;
use Text_Io;
package body Dtia_Server is

    procedure Talk (Aconnection : in out Communications.Connection) is

        I : Mac_Types.Longint;

    begin
        loop
            Mac_Files.Set_Current_User_Home;
            begin
                Interchange.Get_Int (Aconnection, I);
            exception
                when Tcp.Device_Error =>
                    Remote_Shell.Kill;
                    return;
                when others =>
                    Remote_Shell.Kill;
                    raise;
            end;  
            if I = Talk_Utils.F_Disconnect then
                Put_Line ("dtia_server.talk: get F_Disconnect");
                Remote_Shell.Kill;
                return;
            end if;
            if I /= Talk_Utils.F_Delimitor then
                Put_Line ("dtia_server.talk: expected F_Delimitor");
                Remote_Shell.Kill;
                Rational_Error.Raise_Error (Rational_Error.Internal_Error);
            end if;
            begin
                Interchange.Get_Int (Aconnection, I);
                case I is
                    when Talk_Utils.R_Create =>
                        Create_R.Read (Aconnection);
                        Create_R.Write (Aconnection);
                    when Talk_Utils.R_Put =>
                        Put_R.Read (Aconnection);
                        Put_R.Write (Aconnection);
                    when Talk_Utils.R_Get =>
                        Get_R.Read (Aconnection);
                        Get_R.Write (Aconnection);
                    when Talk_Utils.R_Last_Update =>
                        Last_Update_R.Read (Aconnection);
                        Last_Update_R.Write (Aconnection);
                    when Talk_Utils.R_File_Exists =>
                        File_Exists_R.Read (Aconnection);
                        File_Exists_R.Write (Aconnection);
                    when Talk_Utils.R_Copy =>
                        Copy_R.Read (Aconnection);
                        Copy_R.Write (Aconnection);
                    when Talk_Utils.R_Expunge =>
                        Expunge_R.Read (Aconnection);
                        Expunge_R.Write (Aconnection);
                    when Talk_Utils.R_Delete =>
                        Delete_R.Read (Aconnection);
                        Delete_R.Write (Aconnection);
                    when Talk_Utils.R_Move =>
                        Move_R.Read (Aconnection);
                        Move_R.Write (Aconnection);
                    when Talk_Utils.R_Ls =>
                        Ls_R.Read (Aconnection);
                        Ls_R.Write (Aconnection);
                    when Talk_Utils.R_Input_To_Shell =>
                        Input_To_Shell_R.Read (Aconnection);
                        Input_To_Shell_R.Write (Aconnection);
                    when Talk_Utils.R_Signal_To_Shell =>
                        Signal_To_Shell_R.Read (Aconnection);
                        Signal_To_Shell_R.Write (Aconnection);
                    when others =>
                        Put_Line ("dtia_server.talk: unknown id");
                        Rational_Error.Raise_Error
                           (Rational_Error.Internal_Error);
                end case;
            exception
                when others =>
                    Remote_Shell.Kill;
                    raise;
            end;
        end loop;
    end Talk;


    task Server is

        entry Launch;

    end Server;

    task body Server is
        use Mac_Types;
        Aconnection : Communications.Connection;
        User_Home : Mac_Types.Str255;

    begin  
        accept Launch;

        User_Home (0) := Char'Val (26);
        User_Home (1 .. 26) := "MacintoshHD:Rational:Home:";

        Mac_Files.Set_User_Home (User_Home);

        Communications.Initialize;

        loop
            begin
                Communications.Wait_For_Connection (Aconnection);
                Identity.Check (Aconnection);
                Talk (Aconnection);
            exception
                when others =>  
                    Put_Line ("dtia_server.server: catch exception");
                    Communications.Close_Connection (Aconnection);
                    raise;
            end;
        end loop;
    end Server;

    procedure Launch_Server is
    begin
        Server.Launch;
    end Launch_Server;

end Dtia_Server;