DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

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

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦0fd5eeee7⟧ Ada Source

    Length: 19456 (0x4c00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Xlbmp_Network_Interface, seg_004f0d

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



--/ if R1000 then
with Transport;
--/ elsif Cdf_Hpux then
--// with System_Interface;
--/ elsif TeleGen2 and then Unix then
--// with Error_Messages;
--/ end if;

with Xlbt_Arithmetic;  
use Xlbt_Arithmetic;

with Xlbmt_Network_Types;  
use Xlbmt_Network_Types;
--/ if Cdf_Hpux then
--// with Xlbmt_Transport_Defs;
--// use Xlbmt_Transport_Defs;
--/ elsif TeleGen2 and then Unix then
--// with Xlbmt_Transport_Defs;
--// use Xlbmt_Transport_Defs;
--/ end if;

package body Xlbmp_Network_Interface is
------------------------------------------------------------------------------
-- X Library Machine Network Interfaces
--
-- Xlbmp_Network_Interface - Machine/Compiler dependent network interfaces.
------------------------------------------------------------------------------
-- Copyright 1989 - 1991 by Rational, Santa Clara, California.
--
--                  All Rights Reserved.
--
-- Permission to use, copy, modify, and distribute this software and its
-- documentation for any purpose and without fee is hereby granted,
-- provided that the above copyright notice(s) appear in all copies and that
-- both that copyright notice(s) and this permission notice appear in
-- supporting documentation, and that the name of Rational not be used in
-- advertising or publicity pertaining to distribution of the software
-- without specific, written prior permission.
--
-- Rational disclaims all warranties with regard to this software, including
-- all implied warranties of merchantability and fitness, in no event shall
-- Rational be liable for any special, indirect or consequential damages or
-- any damages whatsoever resulting from loss of use, data or profits, whether
-- in an action of contract, negligence or other tortious action, arising out
-- of or in connection with the use or performance of this software.
------------------------------------------------------------------------------

--/ if Cdf_Hpux then
--//     use System_Interface.Error;     -- Eintr and friends
--/ end if;

--\x0c
    procedure Receive_Maybe (Connection :        Connection_Id;  
                             Status     : out    Status_Code;  
                             Data       : in out X_Raw_Data_Array;  
                             Count      : out    X_Raw_Data_Index) is
------------------------------------------------------------------------------
--  Connection  - Specifies the connection to use for reading
--  Status      - Receives the final status of the operation
--  Data        - Receives the data
--  Count       - Receives the length of the data
--
-- Called when we are ready to receive something from the network connection
-- but we won't be upset if there isn't anything to receive.
------------------------------------------------------------------------------
--/ if R1000 and R1000_Xlib_Only then
--//
--//     begin
--//
--//         Transport.Receive (Connection => Connection,
--//                            Status     => Status,
--//                            Data       => Data,
--//                            Count      => Count,
--//                            Max_Wait   => 0.0);
--//
--//
--/ elsif R1000 and not R1000_Xlib_Only then

    begin

        select  
            Connection.Reader.Receive_Maybe (Status => Status,  
                                             Data   => Data,  
                                             Count  => Count);  
        else  
            Status := Timed_Out;  
            Count  := 0;  
        end select;


--/ elsif Unix then
--//
--//        Result  : S_Long;
--//        Timeout : Timeval := (0, 0);
--//        Fdset   : Fd_Set_Rec;
--//        Lstatus : Status_Code;
--//    begin
--//
--// ----See if there is something to receive.
--//
--//         Fd_Clr( Fdset );
--//         Fd_Set( Fdset, Connection );
--//         Result := Unix_Select (Fdset'Size,
--//                               Fdset(Fdset'First)'Address,
--//                                None_System_Address,
--//                                None_System_Address,
--//                                Timeout'Address);
--//         if Result = 0 then
--//             Status := Ok;
--//             Count := 0;
--//             return;
--//         elsif Result < 0 then
--//             Status := Get_Errno;
--//             Count  := 0;
--//             return;
--//         end if;
--//
--// ----Read whatever we can get; we know something is out there.
--//
--//        Result := Read (Connection, Data (Data'First)'Address, Data'Length);
--//        if Result = -1 then
--//            Count  := 0;
--//            Lstatus := Get_Errno;
--//            if Lstatus = Eintr then
--//                Status := Timed_Out;
--//            else
--//                Status := Lstatus;
--//            end if;
--//        else
--//            Count  := X_Raw_Data_Index (Result);
--//            Status := Ok;
--//        end if;
--//
--/ else
--//    begin
--//      Something_Needed_Here;
--/ end if;

    end Receive_Maybe;

--\x0c
    --/ if R1000 and not R1000_Xlib_Only then

    procedure Receive_Queue (Connection :        Connection_Id;  
                             Status     : out    Status_Code;  
                             Data       : in out X_Raw_Data_Array;  
                             Count      : out    X_Raw_Data_Index;  
                             Notify     :        Notify_Complete) is
------------------------------------------------------------------------------
--  Connection  - Specifies the connection to use for reading
--  Status      - Receives the final status of the operation
--  Data        - Receives the data
--  Count       - Receives the length of the data
--  Notify      - Specifies the notification task to use
--
-- Called when we are ready to receive something from the network connection
-- but we won't be upset if there isn't anything to receive.
------------------------------------------------------------------------------
    begin

        Connection.Reader.Receive_Queue (Status => Status,  
                                         Data   => Data,  
                                         Count  => Count,  
                                         Notify => Notify);

    end Receive_Queue;

--/ end if;

--\x0c
    --/ if R1000 and R1000_Xlib_Only then
--//
--//     procedure Receive_Must (Connection :        Connection_Id;
--//                             Status     : out    Status_Code;
--//                             Data       : in out X_Raw_Data_Array;
--//                             Count      : out    X_Raw_Data_Index) is
--// ------------------------------------------------------------------------------
--// --  Connection  - Specifies the connection to use for reading
--// --  Status      - Receives the final status of the operation
--// --  Data        - Receives the data
--// --  Count       - Receives the length of the data
--// --
--// -- Called when we are ready to receive some specific number of bytes from the
--// -- network connection and we will wait forever if necessary in order to get
--// -- exactly that many bytes.
--// ------------------------------------------------------------------------------
--//         Need_Count : constant X_Raw_Data_Index := Data'Length;
--//         Tmp_Status : Transport_Defs.Status_Code;
--//         Tmp_Count  : X_Raw_Data_Index;
--//         Total      : X_Raw_Data_Index;
--//         First      : X_Raw_Data_Index;
--//     begin
--//
--// ----Do an initial receive.  See if we get what we wanted without further
--// --  effort.
--//
--//         Transport.Receive (Connection => Connection,
--//                            Status     => Tmp_Status,
--//                            Data       => Data,
--//                            Count      => Tmp_Count,
--//                            Max_Wait   => Duration'Last);
--//
--// ----If we got it then return it all to the caller.
--//
--//         if Tmp_Count = Need_Count or else
--//            Tmp_Status /= Transport_Defs.Ok then
--//             Status := Tmp_Status;
--//             Count  := Tmp_Count;
--//             return;
--//         end if;
--//
--// ----Set up to loop until we get what we wanted.
--//
--//         Total := Tmp_Count;
--//         First := Data'First + Tmp_Count;
--//         loop
--//
--// ----Receive what we can this time.
--//
--//             Transport.Receive (Connection => Connection,
--//                                Status     => Tmp_Status,
--//                                Data       => Data (First .. Data'Last),
--//                                Count      => Tmp_Count,
--//                                Max_Wait   => Duration'Last);
--//
--// ----If we got all we asked for then return to the caller.
--//
--//             Total := Total + Tmp_Count;
--//             if Total = Need_Count or else
--//                Tmp_Status /= Transport_Defs.Ok then
--//                 Status := Tmp_Status;
--//                 Count  := Total;
--//                 return;
--//             end if;
--//
--// ----Record what we got and continue trying.
--//
--//             First := First + Tmp_Count;
--//         end loop;
--//
--//     end Receive_Must;
--//
--/ elsif R1000 and not R1000_Xlib_Only then

    procedure Receive_Must (Connection :        Connection_Id;  
                            Status     : out    Status_Code;  
                            Data       : in out X_Raw_Data_Array;  
                            Count      : out    X_Raw_Data_Index) is
------------------------------------------------------------------------------
--  Connection  - Specifies the connection to use for reading
--  Status      - Receives the final status of the operation
--  Data        - Receives the data
--  Count       - Receives the length of the data
--
-- Called when we are ready to receive some specific number of bytes from the
-- network connection and we will wait forever if necessary in order to get
-- exactly that many bytes.
------------------------------------------------------------------------------
    begin

        Connection.Reader.Receive_Must (Status => Status,  
                                        Data   => Data,  
                                        Count  => Count);

    end Receive_Must;

--/ end if;  -- R1000

--\x0c
    --/ if Unix then
--//
--//     procedure Receive_Must (Connection :        Connection_Id;
--//                             Status     : out    Status_Code;
--//                             Data       : in out X_Raw_Data_Array;
--//                             Count      : out    X_Raw_Data_Index) is
--// ------------------------------------------------------------------------------
--// --  Connection  - Specifies the connection to use for reading
--// --  Status      - Receives the final status of the operation
--// --  Data        - Receives the data
--// --  Count       - Receives the length of the data
--// --
--// -- Called when we are ready to receive some specific number of bytes from the
--// -- network connection and we will wait forever if necessary in order to get
--// -- exactly that many bytes.
--// ------------------------------------------------------------------------------
--//         Result     : S_Long;
--//         Need_Count : constant X_Raw_Data_Index := Data'Length;
--//         Tmp_Count  : X_Raw_Data_Index;
--//         Total      : X_Raw_Data_Index;
--//         First      : X_Raw_Data_Index;
--//         Fdset      : Fd_Set_Rec;
--//     begin
--//
--// ----Do an initial receive.  See if we get what we wanted without further
--// --  effort.
--//
--//         Result := Read (Connection, Data (Data'First)'Address, Data'Length);
--//
--// ----If we got it then return it all to the caller.
--//
--//         if Result = -1 then
--//             Count  := 0;
--//             Status := Get_Errno;
--//         elsif X_Raw_Data_Index (Result) = Need_Count then
--//             Count  := X_Raw_Data_Index (Result);
--//             Status := Ok;
--//             return;
--//         end if;
--//
--// ----Set up to loop until we get what we wanted.
--//
--//         Total := X_Raw_Data_Index (Result);
--//         First := Data'First + Total;
--//         Fd_Clr( Fdset );
--//         Fd_Set( Fdset, Connection );
--//         loop
--//
--// ----Wait until there is something to receive.
--//
--//             Result := Unix_Select (Fdset'Size,
--//                                    Fdset (Fdset'First)'Address,
--//                                    None_System_Address,
--//                                    None_System_Address,
--//                                    None_System_Address);
--//             if Result <= 0 and then
--//                Get_Errno /= Eintr then
--//                 Status := Get_Errno;
--//                 Count  := Total;
--//                 return;
--//             end if;
--//
--// ----Receive what we can this time.
--//
--//             Result := Read (Connection, Data (First)'Address,
--//                             Data'Last - First + 1);
--//
--// ----If we got all we asked for then return to the caller.
--//
--//             if Result = -1 then
--//                 Status := Get_Errno;
--//                 Count  := Total;
--//             end if;
--//             Total := Total + X_Raw_Data_Index (Result);
--//             if Total = Need_Count then
--//                 Status := Ok;
--//                 Count  := Total;
--//                 return;
--//             end if;
--//
--// ----Record what we got and continue trying.
--//
--//             First := First + X_Raw_Data_Index (Result);
--//         end loop;
--//
--//     end Receive_Must;
--//
--/ end if;  -- TeleGen2 and Unix

--\x0c
    procedure Transmit_Maybe (Connection :     Connection_Id;  
                              Status     : out Status_Code;  
                              Data       :     X_Raw_Data_Array;  
                              Count      : out X_Raw_Data_Index) is
------------------------------------------------------------------------------
--  Connection  - Specifies the connection to use for writing
--  Status      - Receives the final status of  operation
--  Data        - Specifies the data
--  Count       - Receives the length of the data actually sent
--
-- Called when we want to transmit something on the network and we have other
-- things we could be doing if the transmit would block for some reason.  We
-- send out as much as possible and return.
------------------------------------------------------------------------------
--/ if R1000 and R1000_Xlib_Only then
--//
--//     begin
--//
--//         Transport.Transmit (Connection => Connection,
--//                             Status     => Status,
--//                             Data       => Data,
--//                             Count      => Count,
--//                             Max_Wait   => 0.25,
--//                             More       => False);
--//
--/ elsif R1000 and not R1000_Xlib_Only then

    begin

        Transport.Transmit (Connection => Connection.Connection,  
                            Status     => Status,  
                            Data       => Data,  
                            Count      => Count,  
                            Max_Wait   => 0.25,  
                            More       => False);

--/ elsif Unix then
--//
--//        Result  : S_Long;
--//        Lstatus : Status_Code;
--//    begin
--//
--//         loop
--//             Result := Write (Connection,
--//                              Data (Data'First)'Address,
--//                              Data'Length);
--//             if Result = -1 then
--//                 Lstatus := Get_Errno;
--//                 if Lstatus /= Eintr then
--//                     Count  := 0;
--//                     Status := Lstatus;
--//                     return;
--//                 end if;
--//             else
--//                 Count  := X_Raw_Data_Index (Result);
--//                 Status := Ok;
--//                 return;
--//             end if;
--//         end loop;
--//
--/ else
--//    begin
--//      Something_Needed_Here;
--/ end if;

    end Transmit_Maybe;

--\x0c
end Xlbmp_Network_Interface;  

E3 Meta Data

    nblk1=12
    nid=0
    hdr6=24
        [0x00] rec0=21 rec1=00 rec2=01 rec3=082
        [0x01] rec0=11 rec1=00 rec2=02 rec3=012
        [0x02] rec0=16 rec1=00 rec2=03 rec3=00a
        [0x03] rec0=21 rec1=00 rec2=04 rec3=01a
        [0x04] rec0=00 rec1=00 rec2=12 rec3=002
        [0x05] rec0=1a rec1=00 rec2=05 rec3=054
        [0x06] rec0=1a rec1=00 rec2=06 rec3=08c
        [0x07] rec0=17 rec1=00 rec2=07 rec3=06c
        [0x08] rec0=15 rec1=00 rec2=08 rec3=048
        [0x09] rec0=1a rec1=00 rec2=09 rec3=064
        [0x0a] rec0=19 rec1=00 rec2=0a rec3=062
        [0x0b] rec0=19 rec1=00 rec2=0b rec3=07c
        [0x0c] rec0=15 rec1=00 rec2=0c rec3=056
        [0x0d] rec0=1b rec1=00 rec2=0d rec3=01e
        [0x0e] rec0=1c rec1=00 rec2=0e rec3=01e
        [0x0f] rec0=15 rec1=00 rec2=0f rec3=086
        [0x10] rec0=1e rec1=00 rec2=10 rec3=056
        [0x11] rec0=1a rec1=00 rec2=11 rec3=000
    tail 0x21700650081978066e5c7 0x42a00088462063203