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

⟦ccfa49c5d⟧ TextFile

    Length: 4458 (0x116a)
    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 Transport_Complex;
WITH Text_Io;
WITH Complex_Service;
WITH Interchange;
WITH Transport_Interchange;
PACKAGE BODY Complex_Server IS

   PROCEDURE Process_Call (Stream  : Transport_Stream.Stream_Id;
                           Id      : Rpc.Transaction_Id;
                           Version : Rpc.Version_Number;
                           Proc    : Rpc.Procedure_Number) IS
   BEGIN
      CASE Proc IS
         WHEN Complex_Defs.Proc_Number.Make =>
            DECLARE
               Real, Imag : Float;
               Answer     : Complex_Defs.Number;
            BEGIN
               Transport_Interchange.Get (Stream, Interchange.Float (Real));
               Transport_Interchange.Get (Stream, Interchange.Float (Imag));
               Answer := Complex_Service.Make (Real, Imag);
               Rpc_Server.Begin_Response (Stream, Id);
               Transport_Complex.Put (Stream, Answer);
            END;
         WHEN Complex_Defs.Proc_Number.Real_Part =>
            DECLARE
               X      : Complex_Defs.Number;
               Answer : Float;
            BEGIN
               Transport_Complex.Get (Stream, X);
               Answer := Complex_Service.Real_Part (X);
               Rpc_Server.Begin_Response (Stream, Id);
               Transport_Interchange.Put (Stream, Interchange.Float (Answer));
            END;
         WHEN Complex_Defs.Proc_Number.Imaginary_Part =>
            DECLARE
               X      : Complex_Defs.Number;
               Answer : Float;
            BEGIN
               Transport_Complex.Get (Stream, X);
               Answer := Complex_Service.Imaginary_Part (X);
               Rpc_Server.Begin_Response (Stream, Id);
               Transport_Interchange.Put (Stream, Interchange.Float (Answer));
            END;

         WHEN Complex_Defs.Proc_Number.Plus =>
            DECLARE
               Left, Right : Complex_Defs.Number;
               Answer      : Complex_Defs.Number;
            BEGIN
               Transport_Complex.Get (Stream, Left);
               Transport_Complex.Get (Stream, Right);
               Answer := Complex_Service.Plus (Left, Right);
               Rpc_Server.Begin_Response (Stream, Id);
               Transport_Complex.Put (Stream, Answer);
            END;
         WHEN Complex_Defs.Proc_Number.Minus =>
            DECLARE
               Left, Right : Complex_Defs.Number;
               Answer      : Complex_Defs.Number;
            BEGIN
               Transport_Complex.Get (Stream, Left);
               Transport_Complex.Get (Stream, Right);
               Answer := Complex_Service.Minus (Left, Right);
               Rpc_Server.Begin_Response (Stream, Id);
               Transport_Complex.Put (Stream, (Answer));
            END;

         WHEN Complex_Defs.Proc_Number.Image =>
            DECLARE
               X : Complex_Defs.Number;
            BEGIN
               Transport_Complex.Get (Stream, X);
               DECLARE
                  Answer : CONSTANT String := Complex_Service.Image (X);
               BEGIN
                  Rpc_Server.Begin_Response (Stream, Id);
                  Transport_Interchange.Put_String (Stream, Answer);
               END;
            END;
         WHEN Complex_Defs.Proc_Number.Value =>
            DECLARE
               X      : CONSTANT String :=
                  Transport_Interchange.Get_String (Stream);
               Answer : Complex_Defs.Number;
            BEGIN
               Answer := Complex_Service.Value (X);
               Rpc_Server.Begin_Response (Stream, Id);
               Transport_Complex.Put (Stream, Answer);
            END;
         WHEN OTHERS =>
            RAISE Rpc.No_Such_Procedure;
      END CASE;
   EXCEPTION
      WHEN Complex_Service.Overflow =>
         Rpc_Server.Return_Exception (Stream, Id,
                                      Complex_Defs.Exception_Number.Overflow);
      WHEN Complex_Service.Underflow =>
         Rpc_Server.Return_Exception (Stream, Id,
                                      Complex_Defs.Exception_Number.Underflow);
   END Process_Call;

   PROCEDURE Serve_Gets IS NEW Rpc_Server.Serve
                                  (Program => Complex_Defs.Program,
                                   Supported => (0, Rpc.Version_Number'Last),
                                   Process_Call => Process_Call);
   PROCEDURE Serve (Connection : Transport.Connection_Id) IS
   BEGIN
      Serve_Gets (Connection);
   END Serve;
END Complex_Server;