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

⟦1009ef597⟧ TextFile

    Length: 4949 (0x1355)
    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.R1000_Address;
--   Remote_Host : CONSTANT Transport_Defs.Host_Id := Net_Info.Sparc_Address;

   Remote_Socket : CONSTANT Transport_Defs.Socket_Id := Net_Info.R1000_Socket;
--   Remote_Socket : CONSTANT Transport_Defs.Socket_Id := Net_Info.Sparc_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 => Stream,  
          Proc   => 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 => Stream,  
          Proc   => 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 => Stream,  
          Proc   => 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 => Stream,  
          Proc   => 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 => Stream,  
          Proc   => 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 => Stream,  
          Proc   => 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 => Stream,  
          Proc   => 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;