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

⟦d8850d74b⟧ TextFile

    Length: 7046 (0x1b86)
    Types: TextFile
    Names: »B«

Derivation

└─⟦149519bd4⟧ Bits:30000546 8mm tape, Rational 1000, !projects 93-07-13
    └─ ⟦124ff5788⟧ »DATA« 
        └─⟦this⟧ 
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 
└─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16
    └─ ⟦6f12a12be⟧ »DATA« 
        └─⟦this⟧ 
└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
    └─ ⟦d65440be7⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with My_String;
with Socket_Defs;
with Socket_Port;
with System;
with Ada_C;


package body Physical_Layer is

    procedure Get_Host_Name_C (The_Buffer        : in System.Address;
                               The_Buffer_Length :    Integer);

    pragma Interface (C, Get_Host_Name_C);
    pragma Interface_Information (Get_Host_Name_C, ".gethostname");


    procedure Get_Host_Name (The_Host_Name : in out My_String.Object) is  
    begin  
        The_Host_Name := My_String.Object'
                            (The_Size   => Socket_Defs.Host_Name_Length,
                             The_String => (others => ' '));

        Get_Host_Name_C (The_Host_Name.The_String
                            (The_Host_Name.The_String'First)'Address,
                         Socket_Defs.Host_Name_Length);
    end Get_Host_Name;





    procedure Close_Socket_C (The_Socket_Id : Socket_Defs.Socket_Id);
    pragma Interface (C, Close_Socket_C);
    pragma Interface_Information (Close_Socket_C, ".Close_Socket");


    procedure Close_Socket (The_Socket_Id : Socket_Defs.Socket_Id) is
    begin
        Close_Socket_C (The_Socket_Id);
    end Close_Socket;





    procedure Create_Socket_C (The_Socket_Port : System.Address;
                               The_Socket_Type : Integer;
                               The_New_Socket  : System.Address);
    pragma Interface (C, Create_Socket_C);
    pragma Interface_Information (Create_Socket_C, ".Create_Socket");


    procedure Create_Socket (The_Socket_Port : in out Socket_Port.Object;
                             The_Socket_Type : in     Integer;
                             The_New_Socket  : out    Socket_Defs.Socket_Id) is
        The_Value_Of_The_Socket_Port : Natural;
    begin  
        The_Value_Of_The_Socket_Port := Socket_Port.Value (The_Socket_Port);
        Create_Socket_C (The_Value_Of_The_Socket_Port'Address,
                         The_Socket_Type, The_New_Socket'Address);  
        The_Socket_Port := Socket_Port.Create (The_Value_Of_The_Socket_Port);
    end Create_Socket;







    function Create_Server_C (The_Server_Socket_Port : Natural)
                             return Socket_Defs.Socket_Id;
    pragma Interface (C, Create_Server_C);
    pragma Interface_Information (Create_Server_C, ".Create_Server");


    function Create_Server (The_Server_Socket_Port : in Socket_Port.Object)
                           return Socket_Defs.Socket_Id is  
        The_Value_Of_The_Server_Socket_Port : Natural;
        The_Result                          : Socket_Defs.Socket_Id;
    begin
        The_Value_Of_The_Server_Socket_Port :=
           Socket_Port.Value (The_Server_Socket_Port);
        return Create_Server_C (The_Value_Of_The_Server_Socket_Port);
    end Create_Server;







    function Server_Wait_For_A_Connection_C
                (The_Listen_Socket : Socket_Defs.Socket_Id)
                return Socket_Defs.Socket_Id;
    pragma Interface (C, Server_Wait_For_A_Connection_C);
    pragma Interface_Information (Server_Wait_For_A_Connection_C,
                                  ".Server_Wait_For_A_Connection");


    function Server_Wait_For_A_Connection
                (The_Listen_Socket : in Socket_Defs.Socket_Id)
                return Socket_Defs.Socket_Id is
    begin
        return Server_Wait_For_A_Connection_C (The_Listen_Socket);
    end Server_Wait_For_A_Connection;






    function Join_Server_C (The_Server_Name        : System.Address;
                            The_Server_Socket_Port : Natural)
                           return Socket_Defs.Socket_Id;
    pragma Interface (C, Join_Server_C);
    pragma Interface_Information (Join_Server_C, ".Join_Server");


    function Join_Server (The_Server_Name        : in My_String.Object;
                          The_Server_Socket_Port : in Socket_Port.Object)
                         return Socket_Defs.Socket_Id is
        The_Value_Of_The_Server_Socket_Port : Natural;
    begin
        The_Value_Of_The_Server_Socket_Port :=
           Socket_Port.Value (The_Server_Socket_Port);
        return Join_Server_C (The_Server_Name.The_String
                                 (The_Server_Name.The_String'First)'Address,
                              The_Value_Of_The_Server_Socket_Port);
    end Join_Server;





    procedure Send_String_C (The_Remote_Socket_Id : Socket_Defs.Socket_Id;
                             The_Buffer_To_Send : System.Address;
                             The_Length_Of_Buffer_To_Send : Integer;
                             The_Number_Of_Characters_Sent : System.Address);
    pragma Interface (C, Send_String_C);
    pragma Interface_Information (Send_String_C, ".Send_String");


    procedure Send_String (The_Remote_Socket_Id : in Socket_Defs.Socket_Id;
                           The_Buffer_To_Send : in out My_String.Object;
                           The_Number_Of_Characters_Sent : out Integer  
                           ) is
        The_C_Buffer : constant String :=
           Ada_C.String_Ada_To_C (The_Buffer_To_Send.The_String);
    begin
        Send_String_C (The_Remote_Socket_Id,
                       The_C_Buffer (The_C_Buffer'First)'Address,
                       The_Buffer_To_Send.The_Size,
                       The_Number_Of_Characters_Sent'Address);
    end Send_String;





    procedure Receive_String_C
                 (The_Remote_Socket_Id              : Socket_Defs.Socket_Id;
                  The_Buffer_To_Receive             : System.Address;
                  The_Length_Of_Buffer_To_Receive   : Integer;  
                  The_Number_Of_Caracteres_Received : System.Address);
    pragma Interface (C, Receive_String_C);
    pragma Interface_Information (Receive_String_C, ".Receive_String");


    procedure Receive_String
                 (The_Remote_Socket_Id              : in Socket_Defs.Socket_Id;
                  The_Buffer_To_Receive             : in out My_String.Object;  
                  The_Number_Of_Characters_Received : in out Integer) is

        The_Tmp_Received_Buffer : My_String.Object (My_String.Max_Range'Last);

        -- The_C_Buffer            : constant String := Ada_C.String_Ada_To_C (The_Tmp_Received_Buffer);

    begin

        Receive_String_C (The_Remote_Socket_Id,
                          The_Tmp_Received_Buffer.The_String
                             (The_Tmp_Received_Buffer.The_String'First)'Address,
                          The_Tmp_Received_Buffer.The_Size,
                          The_Number_Of_Characters_Received'Address);

        The_Buffer_To_Receive :=
           My_String.Object'
              (The_Size   => The_Number_Of_Characters_Received,
               The_String => The_Tmp_Received_Buffer.The_String
                                (1 .. The_Number_Of_Characters_Received));

        -- Receive_String_C (The_Remote_Socket_Id, The_Buffer_To_Receive (The_Buffer_To_Receive'First)'Address,
        --                   The_Length_Of_Buffer_To_Receive, The_Number_Of_Caracteres_Received'Address);




    end Receive_String;

end Physical_Layer;