with Interfaces;

use Interfaces;

package FILO is

   type Blockdev_Length is range 0 .. Interfaces.Integer_64'Last;
   subtype Blockdev_Offset is Blockdev_Length range 0 .. Blockdev_Length'Last - 1;
   subtype Partition_Length is Blockdev_Length;
   subtype Partition_Offset is Blockdev_Offset;

   BLOCK_SIZE : constant := 512;
   type Block_Offset is range 0 .. Partition_Offset'Last / BLOCK_SIZE;

   subtype Index_Type is Natural range 0 .. Natural'Last - 1;
   subtype Index_Type16 is Index_Type range 0 .. Index_Type'Last - 1;
   subtype Index_Type32 is Index_Type16 range 0 .. Index_Type16'Last - 2;

   type Buffer_Type is array (Index_Type range <>) of Unsigned_8;

   function Read_LE16 (Buf : Buffer_Type; Off : Index_Type16) return Unsigned_16
   is
     (Shift_Left (Unsigned_16 (Buf (Buf'First + Off + 1)), 8) or
      Unsigned_16 (Buf (Buf'First + Off)))
   with
      Pre =>
         Buf'First <= Index_Type16'Last - Off and
         Buf'First + Off + 1 <= Buf'Last;

   function Read_LE32 (Buf : Buffer_Type; Off : Index_Type32) return Unsigned_32
   is
     (Shift_Left (Unsigned_32 (Buf (Buf'First + Off + 3)), 24) or
      Shift_Left (Unsigned_32 (Buf (Buf'First + Off + 2)), 16) or
      Shift_Left (Unsigned_32 (Buf (Buf'First + Off + 1)),  8) or
      Unsigned_32 (Buf (Buf'First + Off)))
   with
      Pre =>
         Buf'First <= Index_Type32'Last - Off and
         Buf'First + Off + 3 <= Buf'Last;

   generic
      type T is mod <>;
   function Gen_Is_Power_Of_2 (Val : T) return Boolean;
   function Gen_Is_Power_Of_2 (Val : T) return Boolean
   is
      (Val /= 0 and (Val and (Val - 1)) = 0);

   function Is_Power_Of_2 is new Gen_Is_Power_Of_2 (Unsigned_16);
   function Is_Power_Of_2 is new Gen_Is_Power_Of_2 (Unsigned_32);

   Space             : constant Character := ' ';
   Form_Feed         : constant Character := Character'Val (16#0c#);
   New_Line          : constant Character := Character'Val (16#0a#);
   Carriage_Return   : constant Character := Character'Val (16#0d#);
   Tab               : constant Character := Character'Val (16#09#);
   Vertical_Tab      : constant Character := Character'Val (16#0b#);

   function Is_Space (Ch : Character) return Boolean
   is
      (Ch = ' ' or (Tab <= Ch and Ch <= Carriage_Return));

end FILO;
