File : net-portability.ads


with Interfaces.C;

package Net.Portability is
   do_debug : Debug_Mode := Inherit;
   
   subtype Interface is Interfaces.C.int;
   
   Open_Error : exception;
   function Open_Interface (i : Natural) return Interface;

   Read_Error : exception;
   function Receive_Blob (i : Interface) return Payload_Type;
   
   type  Two_Int_8 is array (1 .. 2) of Integer_8;
   type Four_Int_8 is array (1 .. 4) of Integer_8;
   pragma Pack (Two_Int_8);
   pragma Pack (Four_Int_8);
   
   function to_word  (i :  Two_Int_8) return Integer_16;
   function to_dword (i : Four_Int_8) return Integer_32;
   pragma Inline (to_word, to_dword);
   
   function from_word  (i : Integer_16) return  Two_Int_8;
   function from_dword (i : Integer_32) return Four_Int_8;
   pragma Inline (from_word, from_dword);
end Net.Portability;