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

⟦47d0a47ca⟧ TextFile

    Length: 4851 (0x12f3)
    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 Complex_Defs;
with Interchange;
with Net_Info;
with Rpc;
with Rpc_Client;
with Transport_Complex;
with Transport_Defs;
with Transport_Interchange;
with Transport_Stream;
package body Complex_Client is

    Remote_Host : constant Transport_Defs.Host_Id := Net_Info.Sparc_Address;
    Remote_Socket : constant Transport_Defs.Socket_Id := Net_Info.Sparc_Socket;

--    Remote_Host : constant Transport_Defs.Host_Id := Net_Info.R1000_Address;
--    Remote_Socket : CONSTANT Transport_Defs.Socket_Id := Net_Info.R1000_Socket;

    procedure Start_Request is  
       new Rpc_Client.Start_Request_Generic
              (Default_Network => Complex_Defs.Network,
               Default_Host => Remote_Host,
               Default_Socket => Remote_Socket,
               Default_Program => Complex_Defs.Program,
               Default_Version => Complex_Defs.Version);


    procedure Raise_Exception (Excep : Rpc.Exception_Number) is
    begin
        case Excep is
            when Complex_Defs.Exception_Number.Overflow =>
                raise Overflow;
            when Complex_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);


    function Make (Real, Imag : Float) return Number is
        Stream : Transport_Stream.Stream_Id;
        Answer : Number;
    begin
        Start_Request (Stream, Complex_Defs.Proc_Number.Make);
        Transport_Interchange.Put (Stream, Interchange.Float (Real));
        Transport_Interchange.Put (Stream, Interchange.Float (Imag));
        End_Request (Stream);
        Transport_Complex.Get (Stream, Complex_Defs.Number (Answer));
        Rpc_Client.End_Response (Stream);
        return Answer;
    end Make;


    function Real_Part (X : Number) return Float is
        Stream : Transport_Stream.Stream_Id;
        Answer : Float;
    begin
        Start_Request (Stream, Complex_Defs.Proc_Number.Real_Part);
        Transport_Complex.Put (Stream, Complex_Defs.Number (X));
        End_Request (Stream);
        Transport_Interchange.Get (Stream, Interchange.Float (Answer));
        Rpc_Client.End_Response (Stream);
        return Answer;
    end Real_Part;


    function Imaginary_Part (X : Number) return Float is
        Stream : Transport_Stream.Stream_Id;
        Answer : Float;
    begin
        Start_Request (Stream, Complex_Defs.Proc_Number.Imaginary_Part);
        Transport_Complex.Put (Stream, Complex_Defs.Number (X));
        End_Request (Stream);
        Transport_Interchange.Get (Stream, Interchange.Float (Answer));
        Rpc_Client.End_Response (Stream);
        return Answer;
    end Imaginary_Part;


    function Plus (Left, Right : Number) return Number is
        Stream : Transport_Stream.Stream_Id;
        Answer : Number;
    begin
        Start_Request (Stream, Complex_Defs.Proc_Number.Plus);
        Transport_Complex.Put (Stream, Complex_Defs.Number (Left));
        Transport_Complex.Put (Stream, Complex_Defs.Number (Right));
        End_Request (Stream);
        Transport_Complex.Get (Stream, Complex_Defs.Number (Answer));
        Rpc_Client.End_Response (Stream);
        return Answer;
    end Plus;


    function Minus (Left, Right : Number) return Number is
        Stream : Transport_Stream.Stream_Id;
        Answer : Number;
    begin
        Start_Request (Stream, Complex_Defs.Proc_Number.Minus);
        Transport_Complex.Put (Stream, Complex_Defs.Number (Left));
        Transport_Complex.Put (Stream, Complex_Defs.Number (Right));
        End_Request (Stream);
        Transport_Complex.Get (Stream, Complex_Defs.Number (Answer));
        Rpc_Client.End_Response (Stream);
        return Answer;
    end Minus;


    function Image (X : Number) return String is
        Stream : Transport_Stream.Stream_Id;
    begin
        Start_Request (Stream, Complex_Defs.Proc_Number.Image);
        Transport_Complex.Put (Stream, Complex_Defs.Number (X));
        End_Request (Stream);
        declare
            Answer : constant String :=
               Transport_Interchange.Get_String (Stream);
        begin
            Rpc_Client.End_Response (Stream);
            return Answer;

            Rpc_Client.End_Response (Stream);
            return Answer;
        end;
    end Image;


    function Value (S : String) return Number is
        Stream : Transport_Stream.Stream_Id;
        Answer : Number;
    begin
        Start_Request (Stream, Complex_Defs.Proc_Number.Value);
        Transport_Interchange.Put_String (Stream, S);
        End_Request (Stream);
        Transport_Complex.Get (Stream, Complex_Defs.Number (Answer));
        Rpc_Client.End_Response (Stream);
        return Answer;

    end Value;
end Complex_Client;