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

⟦2cbf6ff9b⟧ TextFile

    Length: 4101 (0x1005)
    Types: TextFile
    Names: »B«

Derivation

└─⟦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 System;
WITH Unchecked_Conversion;
PACKAGE BODY Socket_System_Interface IS

   No_Linger    : CONSTANT Linger_Structure_Ptr := NEW Linger_Structure'(1, 1);
   System_Error : CONSTANT Unix_Base_Types.Int  := -1;

   PACKAGE Resolve_Overloading IS

      FUNCTION Socket (Af          : IN Unix_Base_Types.Int;
                       Socket_Type : IN Unix_Base_Types.Int;
                       Protocol    : IN Unix_Base_Types.Int)
                      RETURN Unix_Base_Types.Int;
      PRAGMA Interface (C, Socket);
      PRAGMA Interface_Name (Socket, "_socket");

      FUNCTION Bind (S       : IN Unix_Base_Types.Int;
                     Addr    : IN Sockaddr_In_Ptr;
                     Addrlen : IN Unix_Base_Types.Int)
                    RETURN Unix_Base_Types.Int;
      PRAGMA Interface (C, Bind);
      PRAGMA Interface_Name (Bind, "_bind");


      FUNCTION Getsockopt (S       : IN Unix_Base_Types.Int;
                           Level   : IN Unix_Base_Types.Int;
                           Optname : IN Unix_Base_Types.Int;
                           Optval  : IN Unix_Base_Types.Char_Ptr;
                           Optlen  : IN Unix_Base_Types.Int_Ptr)
                          RETURN Unix_Base_Types.Int;
      PRAGMA Interface (C, Getsockopt);
      PRAGMA Interface_Name (Getsockopt, "_getsockopt");

   END Resolve_Overloading;




   FUNCTION Linger_Struct_To_Char_Ptr IS
      NEW Unchecked_Conversion (Source => Linger_Structure_Ptr,
                                Target => Unix_Base_Types.Char_Ptr);


   FUNCTION Int_Ptr_To_Char_Ptr IS NEW Unchecked_Conversion
                                          (Source => Unix_Base_Types.Int_Ptr,
                                           Target => Unix_Base_Types.Char_Ptr);




   FUNCTION Socket (Af          : IN Unix_Base_Types.Int;
                    Socket_Type : IN Unix_Base_Types.Int;
                    Protocol    : IN Unix_Base_Types.Int)
                   RETURN Unix_Base_Types.Int IS

      Return_Value : Unix_Base_Types.Int;

   BEGIN
      Return_Value := Resolve_Overloading.Socket (Af          => Af,
                                                  Socket_Type => Socket_Type,
                                                  Protocol    => Protocol);
      RETURN Return_Value;
   END Socket;


   FUNCTION Bind (S       : IN Unix_Base_Types.Int;
                  Addr    : IN Sockaddr_In_Ptr;
                  Addrlen : IN Unix_Base_Types.Int)
                 RETURN Unix_Base_Types.Int IS

      Return_Value : Unix_Base_Types.Int;

   BEGIN

      Return_Value :=  
         Resolve_Overloading.Bind (S => S, Addr => Addr, Addrlen => Addrlen);

      DECLARE

         Allow_Reuse : CONSTANT Unix_Base_Types.Int_Ptr :=
            NEW Unix_Base_Types.Int'(1);

      BEGIN

         IF Return_Value /= System_Error THEN

            Return_Value :=
               Setsockopt (S => S,
                           Level => Sol_Socket,
                           Optname => So_Linger,
                           Optval => Linger_Struct_To_Char_Ptr (No_Linger),
                           Optlen => No_Linger.ALL'Size / System.Storage_Unit);
         END IF;

         IF Return_Value /= System_Error THEN

            Return_Value :=  
               Setsockopt
                  (S       => S,
                   Level   => Sol_Socket,
                   Optname => So_Reuseaddr,
                   Optval  => Int_Ptr_To_Char_Ptr (Allow_Reuse),
                   Optlen  => Allow_Reuse.ALL'Size / System.Storage_Unit);
         END IF;

         -- IF Return_Value /= System_Error THEN
         --    Return_Value :=
         --       Resolve_Overloading.Getsockopt (S => S,
         --                                       Level => Sol_Socket,
         --                                       Optname => So_@,
         --                                       Optval => [CHAR_PTR-expression],
         --                                       Optlen => [INT_PTR-expression]);
         -- END IF;
         --
      END;

      RETURN Return_Value;

   END Bind;
END Socket_System_Interface;