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

⟦6bdb7cff4⟧ TextFile

    Length: 6098 (0x17d2)
    Types: TextFile
    Names: »B«

Derivation

└─⟦149519bd4⟧ Bits:30000546 8mm tape, Rational 1000, !projects 93-07-13
    └─ ⟦124ff5788⟧ »DATA« 
        └─⟦this⟧ 
└─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16
    └─ ⟦6f12a12be⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with Rpc;
with Interchange;
with Transport_Stream;
with Transport_Interchange;
with Transport_Name;
with Transport_Defs;
with Rpc_Client;
with Complex_Number_Interchange;
with Complex_Number_Rpc_Defs;
with Complex_Number;
with Complex_Number;
package body Complex_Number is

    Remote_Host : constant Transport_Defs.Host_Id :=
       Transport_Name.Host_To_Host_Id ("bonnie");

    procedure Start_Request is
       new Rpc_Client.Start_Request_Generic
              (Complex_Number_Rpc_Defs.Network,  
               Remote_Host,  
               Complex_Number_Rpc_Defs.Socket, Complex_Number_Rpc_Defs.Program,
               Complex_Number_Rpc_Defs.Version);

    procedure Raise_Exception (The_Exception : Rpc.Exception_Number) is
    begin
        case The_Exception is
            when Complex_Number_Rpc_Defs.Exception_Number.Constraint_Error =>
                raise Constraint_Error;
            when Complex_Number_Rpc_Defs.Exception_Number.Numeric_Error =>
                raise Numeric_Error;
            when Complex_Number_Rpc_Defs.Exception_Number.Program_Error =>
                raise Program_Error;
            when Complex_Number_Rpc_Defs.Exception_Number.Storage_Error =>
                raise Storage_Error;
            when Complex_Number_Rpc_Defs.Exception_Number.Tasking_Error =>
                raise Tasking_Error;
            when Complex_Number_Rpc_Defs.Exception_Number.Overflow =>
                raise Overflow;
            when Complex_Number_Rpc_Defs.Exception_Number.Underflow =>
                raise Underflow;
            when others =>
                raise Rpc.Other_Error;

        end case;
    end Raise_Exception;

    procedure End_Request is
       new Rpc_Client.End_Request_With_Exception (Raise_Exception);

    procedure Finalize is
    begin
        Transport_Stream.Finalize;
    end Finalize;

    function Make (Real, Imag : Float) return Complex_Number.Number is
        Stream : Transport_Stream.Stream_Id;
        Return_Number : Complex_Number.Number;

    begin
        Start_Request (Stream, Complex_Number_Rpc_Defs.Procedure_Number.Make);

        Transport_Interchange.Put (Into => Stream,
                                   Data => Interchange.Float (Real));
        Transport_Interchange.Put (Into => Stream,
                                   Data => Interchange.Float (Imag));
        End_Request (Stream);

        Complex_Number_Interchange.Get (From => Stream, Data => Return_Number);
        Rpc_Client.End_Response (Stream);

        return Return_Number;
    end Make;

    function Real_Part (X : Complex_Number.Number) return Float is
        Stream : Transport_Stream.Stream_Id;
        Return_Float : Float;

    begin
        Start_Request (Stream, Complex_Number_Rpc_Defs.
                                  Procedure_Number.Real_Part);

        Complex_Number_Interchange.Put (Into => Stream, Data => X);
        End_Request (Stream);

        Transport_Interchange.Get (From => Stream,
                                   Data => Interchange.Float (Return_Float));
        Rpc_Client.End_Response (Stream);

        return Return_Float;
    end Real_Part;

    function Imaginary_Part (X : Complex_Number.Number) return Float is
        Stream : Transport_Stream.Stream_Id;
        Return_Float : Float;

    begin
        Start_Request (Stream, Complex_Number_Rpc_Defs.
                                  Procedure_Number.Imaginary_Part);

        Complex_Number_Interchange.Put (Into => Stream, Data => X);
        End_Request (Stream);

        Transport_Interchange.Get (From => Stream,
                                   Data => Interchange.Float (Return_Float));
        Rpc_Client.End_Response (Stream);

        return Return_Float;
    end Imaginary_Part;

    function Plus (Left, Right : Complex_Number.Number)
                  return Complex_Number.Number is
        Stream : Transport_Stream.Stream_Id;
        Return_Number : Complex_Number.Number;

    begin
        Start_Request (Stream, Complex_Number_Rpc_Defs.Procedure_Number.Plus);

        Complex_Number_Interchange.Put (Into => Stream, Data => Left);
        Complex_Number_Interchange.Put (Into => Stream, Data => Right);
        End_Request (Stream);

        Complex_Number_Interchange.Get (From => Stream, Data => Return_Number);
        Rpc_Client.End_Response (Stream);

        return Return_Number;
    end Plus;

    function Minus (Left, Right : Complex_Number.Number)
                   return Complex_Number.Number is
        Stream : Transport_Stream.Stream_Id;
        Return_Number : Complex_Number.Number;

    begin
        Start_Request (Stream, Complex_Number_Rpc_Defs.Procedure_Number.Minus);

        Complex_Number_Interchange.Put (Into => Stream, Data => Left);
        Complex_Number_Interchange.Put (Into => Stream, Data => Right);
        End_Request (Stream);

        Complex_Number_Interchange.Get (From => Stream, Data => Return_Number);
        Rpc_Client.End_Response (Stream);

        return Return_Number;
    end Minus;

    function Image (X : Complex_Number.Number) return String is
        Stream : Transport_Stream.Stream_Id;
    begin
        Start_Request (Stream, Complex_Number_Rpc_Defs.Procedure_Number.Image);

        Complex_Number_Interchange.Put (Into => Stream, Data => X);
        End_Request (Stream);

        declare
            Return_String : constant String :=
               Transport_Interchange.Get_String (From => Stream);
        begin
            Rpc_Client.End_Response (Stream);

            return Return_String;
        end;
    end Image;

    function Value (S : String) return Complex_Number.Number is
        Stream : Transport_Stream.Stream_Id;
        Return_Number : Complex_Number.Number;

    begin
        Start_Request (Stream, Complex_Number_Rpc_Defs.Procedure_Number.Value);

        Transport_Interchange.Put_String (Into => Stream, Data => S);
        End_Request (Stream);

        Complex_Number_Interchange.Get (From => Stream, Data => Return_Number);
        Rpc_Client.End_Response (Stream);

        return Return_Number;
    end Value;

end Complex_Number;