DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: ┃ B T ┃
Length: 4453 (0x1165) Types: TextFile Names: »B«
└─⟦bad92a95e⟧ Bits:30000535 8mm tape, Rational 1000, RPC 1_0_2 └─ ⟦bb34fe6e2⟧ »DATA« └─⟦15d8b76c6⟧ └─⟦this⟧
with Complex_Defs; with Interchange; 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 := (1, 2, 3, 4); procedure Start_Request is new Rpc_Client.Start_Request_Generic (Complex_Defs.Network, Remote_Host, Complex_Defs.Socket, Complex_Defs.Program, 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;