--------------------------------
-- Ivan Levashew aka OCTAGRAM --
--         Barnaul, 2009-2010 --
--------------------------------

-- Convenient definitions initially
-- inspired by Turbo Pascal (and Delphi)

with
   System, Interfaces, Turbo_Private.Bits,
   Turbo_Private.Atomic, Turbo_Private.Common,
   System.Storage_Elements;

use
   System, Interfaces;

package Turbo is
   pragma Preelaborate;

   ------------------
   -- Integer_Addr --
   ------------------

   subtype Integer_Addr  is Turbo_Private.Bits.Integer_Addr;

   function "="  (Left, Right : Integer_Addr'Base)
      return Boolean renames Turbo_Private.Bits."=";
--   function "/=" (Left, Right : Integer_Addr'Base)
--      return Boolean renames Turbo_Private.Bits."/=";
   function "<"  (Left, Right : Integer_Addr'Base)
      return Boolean renames Turbo_Private.Bits."<";
   function "<=" (Left, Right : Integer_Addr'Base)
      return Boolean renames Turbo_Private.Bits."<=";
   function ">"  (Left, Right : Integer_Addr'Base)
      return Boolean renames Turbo_Private.Bits.">";
   function ">=" (Left, Right : Integer_Addr'Base)
      return Boolean renames Turbo_Private.Bits.">=";

   function "+" (Right : Integer_Addr'Base)
      return Integer_Addr'Base renames Turbo_Private.Bits."+";
   function "-" (Right : Integer_Addr'Base)
      return Integer_Addr'Base renames Turbo_Private.Bits."-";
   function "abs" (Right : Integer_Addr'Base)
      return Integer_Addr'Base renames Turbo_Private.Bits."abs";

   function "+" (Left, Right : Integer_Addr'Base)
      return Integer_Addr'Base renames Turbo_Private.Bits."+";
   function "-" (Left, Right : Integer_Addr'Base)
      return Integer_Addr'Base renames Turbo_Private.Bits."-";
   function "*" (Left, Right : Integer_Addr'Base)
      return Integer_Addr'Base renames Turbo_Private.Bits."*";
   function "/" (Left, Right : Integer_Addr'Base)
      return Integer_Addr'Base renames Turbo_Private.Bits."/";
   function "rem" (Left, Right : Integer_Addr'Base)
      return Integer_Addr'Base renames Turbo_Private.Bits."rem";
   function "mod" (Left, Right : Integer_Addr'Base)
      return Integer_Addr'Base renames Turbo_Private.Bits."mod";

   function "**" (Left : Integer_Addr'Base; Right : Natural)
      return Integer_Addr'Base renames Turbo_Private.Bits."**";

   function "+" (Item : Integer_Addr) return System.Storage_Elements.Storage_Offset
      renames Turbo_Private.Bits."+";
   function "+" (Item : System.Storage_Elements.Storage_Offset) return Integer_Addr
      renames Turbo_Private.Bits."+";

   subtype Unsigned_Addr is Turbo_Private.Bits.Unsigned_Addr;

   function "="  (Left, Right : Unsigned_Addr'Base)
      return Boolean renames Turbo_Private.Bits."=";
--   function "/=" (Left, Right : Unsigned_Addr'Base)
--      return Boolean renames Turbo_Private.Bits."/=";
   function "<"  (Left, Right : Unsigned_Addr'Base)
      return Boolean renames Turbo_Private.Bits."<";
   function "<=" (Left, Right : Unsigned_Addr'Base)
      return Boolean renames Turbo_Private.Bits."<=";
   function ">"  (Left, Right : Unsigned_Addr'Base)
      return Boolean renames Turbo_Private.Bits.">";
   function ">=" (Left, Right : Unsigned_Addr'Base)
      return Boolean renames Turbo_Private.Bits.">=";

   function "+" (Right : Unsigned_Addr'Base)
      return Unsigned_Addr'Base renames Turbo_Private.Bits."+";
   function "-" (Right : Unsigned_Addr'Base)
      return Unsigned_Addr'Base renames Turbo_Private.Bits."-";
   function "abs" (Right : Unsigned_Addr'Base)
      return Unsigned_Addr'Base renames Turbo_Private.Bits."abs";

   function "+" (Left, Right : Unsigned_Addr'Base)
      return Unsigned_Addr'Base renames Turbo_Private.Bits."+";
   function "-" (Left, Right : Unsigned_Addr'Base)
      return Unsigned_Addr'Base renames Turbo_Private.Bits."-";
   function "*" (Left, Right : Unsigned_Addr'Base)
      return Unsigned_Addr'Base renames Turbo_Private.Bits."*";
   function "/" (Left, Right : Unsigned_Addr'Base)
      return Unsigned_Addr'Base renames Turbo_Private.Bits."/";
   function "rem" (Left, Right : Unsigned_Addr'Base)
      return Unsigned_Addr'Base renames Turbo_Private.Bits."rem";
   function "mod" (Left, Right : Unsigned_Addr'Base)
      return Unsigned_Addr'Base renames Turbo_Private.Bits."mod";

   function "**" (Left : Unsigned_Addr'Base; Right : Natural)
      return Unsigned_Addr'Base renames Turbo_Private.Bits."**";

   function "and" (Left, Right : Unsigned_Addr'Base)
      return Unsigned_Addr'Base renames Turbo_Private.Bits."and";
   function "or" (Left, Right : Unsigned_Addr'Base)
      return Unsigned_Addr'Base renames Turbo_Private.Bits."or";
   function "xor" (Left, Right : Unsigned_Addr'Base)
      return Unsigned_Addr'Base renames Turbo_Private.Bits."xor";

   function "not" (Right : Unsigned_Addr'Base)
      return Unsigned_Addr'Base renames Turbo_Private.Bits."not";

   function Shift_Left  (Value : Unsigned_Addr; Amount : Natural)
      return Unsigned_Addr renames Turbo_Private.Bits.Shift_Left;
   function Shift_Right (Value : Unsigned_Addr; Amount : Natural)
      return Unsigned_Addr renames Turbo_Private.Bits.Shift_Right;
   function Shift_Right_Arithmetic (Value : Unsigned_Addr; Amount : Natural)
      return Unsigned_Addr renames Turbo_Private.Bits.Shift_Right_Arithmetic;
   function Rotate_Left  (Value : Unsigned_Addr; Amount : Natural)
      return Unsigned_Addr renames Turbo_Private.Bits.Rotate_Left;
   function Rotate_Right (Value : Unsigned_Addr; Amount : Natural)
      return Unsigned_Addr renames Turbo_Private.Bits.Rotate_Right;

   ---------------------------------------------------
   -- Natural_ and Positive_ types for Interfaces.* --
   ---------------------------------------------------

   subtype Natural_8     is Turbo_Private.Common.Natural_8;
   subtype Natural_16    is Turbo_Private.Common.Natural_16;
   subtype Natural_32    is Turbo_Private.Common.Natural_32;
   subtype Natural_64    is Turbo_Private.Common.Natural_64;
   subtype Natural_Addr  is Turbo_Private.Common.Natural_Addr;

   subtype Positive_8    is Turbo_Private.Common.Positive_8;
   subtype Positive_16   is Turbo_Private.Common.Positive_16;
   subtype Positive_32   is Turbo_Private.Common.Positive_32;
   subtype Positive_64   is Turbo_Private.Common.Positive_64;
   subtype Positive_Addr is Turbo_Private.Common.Positive_Addr;

   --------------------
   -- Inc, Dec, etc. --
   --------------------

   procedure Inc (Addend : in out Integer_8);
   procedure Inc (Addend : not null access Integer_8);

   procedure Inc (Addend : in out Integer_8;
      Item : Integer_8);
   procedure Inc (Addend : not null access Integer_8;
      Item : Integer_8);

   procedure Dec (Addend : in out Integer_8);
   procedure Dec (Addend : not null access Integer_8);

   procedure Dec (Addend : in out Integer_8;
      Item : Integer_8);
   procedure Dec (Addend : not null access Integer_8;
      Item : Integer_8);

   procedure Inc (Addend : in out Unsigned_8);
   procedure Inc (Addend : not null access Unsigned_8);

   procedure Inc (Addend : in out Unsigned_8;
      Item : Unsigned_8);
   procedure Inc (Addend : not null access Unsigned_8;
      Item : Unsigned_8);

   procedure Dec (Addend : in out Unsigned_8);
   procedure Dec (Addend : not null access Unsigned_8);

   procedure Dec (Addend : in out Unsigned_8;
      Item : Unsigned_8);
   procedure Dec (Addend : not null access Unsigned_8;
      Item : Unsigned_8);

   procedure Do_And (Multipliee : in out Unsigned_8;
      Item : Unsigned_8);
   procedure Do_And (Multipliee : not null access Unsigned_8;
      Item : Unsigned_8);

   procedure Do_Or (Multipliee : in out Unsigned_8;
      Item : Unsigned_8);
   procedure Do_Or (Multipliee : not null access Unsigned_8;
      Item : Unsigned_8);

   procedure Do_Xor (Multipliee : in out Unsigned_8;
      Item : Unsigned_8);
   procedure Do_Xor (Multipliee : not null access Unsigned_8;
      Item : Unsigned_8);

   procedure Inc (Addend : in out Integer_16);
   procedure Inc (Addend : not null access Integer_16);

   procedure Inc (Addend : in out Integer_16;
      Item : Integer_16);
   procedure Inc (Addend : not null access Integer_16;
      Item : Integer_16);

   procedure Dec (Addend : in out Integer_16);
   procedure Dec (Addend : not null access Integer_16);

   procedure Dec (Addend : in out Integer_16;
      Item : Integer_16);
   procedure Dec (Addend : not null access Integer_16;
      Item : Integer_16);

   procedure Inc (Addend : in out Unsigned_16);
   procedure Inc (Addend : not null access Unsigned_16);

   procedure Inc (Addend : in out Unsigned_16;
      Item : Unsigned_16);
   procedure Inc (Addend : not null access Unsigned_16;
      Item : Unsigned_16);

   procedure Dec (Addend : in out Unsigned_16);
   procedure Dec (Addend : not null access Unsigned_16);

   procedure Dec (Addend : in out Unsigned_16;
      Item : Unsigned_16);
   procedure Dec (Addend : not null access Unsigned_16;
      Item : Unsigned_16);

   procedure Do_And (Multipliee : in out Unsigned_16;
      Item : Unsigned_16);
   procedure Do_And (Multipliee : not null access Unsigned_16;
      Item : Unsigned_16);

   procedure Do_Or (Multipliee : in out Unsigned_16;
      Item : Unsigned_16);
   procedure Do_Or (Multipliee : not null access Unsigned_16;
      Item : Unsigned_16);

   procedure Do_Xor (Multipliee : in out Unsigned_16;
      Item : Unsigned_16);
   procedure Do_Xor (Multipliee : not null access Unsigned_16;
      Item : Unsigned_16);

   procedure Inc (Addend : in out Integer_32);
   procedure Inc (Addend : not null access Integer_32);

   procedure Inc (Addend : in out Integer_32;
      Item : Integer_32);
   procedure Inc (Addend : not null access Integer_32;
      Item : Integer_32);

   procedure Dec (Addend : in out Integer_32);
   procedure Dec (Addend : not null access Integer_32);

   procedure Dec (Addend : in out Integer_32;
      Item : Integer_32);
   procedure Dec (Addend : not null access Integer_32;
      Item : Integer_32);

   procedure Inc (Addend : in out Unsigned_32);
   procedure Inc (Addend : not null access Unsigned_32);

   procedure Inc (Addend : in out Unsigned_32;
      Item : Unsigned_32);
   procedure Inc (Addend : not null access Unsigned_32;
      Item : Unsigned_32);

   procedure Dec (Addend : in out Unsigned_32);
   procedure Dec (Addend : not null access Unsigned_32);

   procedure Dec (Addend : in out Unsigned_32;
      Item : Unsigned_32);
   procedure Dec (Addend : not null access Unsigned_32;
      Item : Unsigned_32);

   procedure Do_And (Multipliee : in out Unsigned_32;
      Item : Unsigned_32);
   procedure Do_And (Multipliee : not null access Unsigned_32;
      Item : Unsigned_32);

   procedure Do_Or (Multipliee : in out Unsigned_32;
      Item : Unsigned_32);
   procedure Do_Or (Multipliee : not null access Unsigned_32;
      Item : Unsigned_32);

   procedure Do_Xor (Multipliee : in out Unsigned_32;
      Item : Unsigned_32);
   procedure Do_Xor (Multipliee : not null access Unsigned_32;
      Item : Unsigned_32);

   procedure Inc (Addend : in out Integer_64);
   procedure Inc (Addend : not null access Integer_64);

   procedure Inc (Addend : in out Integer_64;
      Item : Integer_64);
   procedure Inc (Addend : not null access Integer_64;
      Item : Integer_64);

   procedure Dec (Addend : in out Integer_64);
   procedure Dec (Addend : not null access Integer_64);

   procedure Dec (Addend : in out Integer_64;
      Item : Integer_64);
   procedure Dec (Addend : not null access Integer_64;
      Item : Integer_64);

   procedure Inc (Addend : in out Unsigned_64);
   procedure Inc (Addend : not null access Unsigned_64);

   procedure Inc (Addend : in out Unsigned_64;
      Item : Unsigned_64);
   procedure Inc (Addend : not null access Unsigned_64;
      Item : Unsigned_64);

   procedure Dec (Addend : in out Unsigned_64);
   procedure Dec (Addend : not null access Unsigned_64);

   procedure Dec (Addend : in out Unsigned_64;
      Item : Unsigned_64);
   procedure Dec (Addend : not null access Unsigned_64;
      Item : Unsigned_64);

   procedure Do_And (Multipliee : in out Unsigned_64;
      Item : Unsigned_64);
   procedure Do_And (Multipliee : not null access Unsigned_64;
      Item : Unsigned_64);

   procedure Do_Or (Multipliee : in out Unsigned_64;
      Item : Unsigned_64);
   procedure Do_Or (Multipliee : not null access Unsigned_64;
      Item : Unsigned_64);

   procedure Do_Xor (Multipliee : in out Unsigned_64;
      Item : Unsigned_64);
   procedure Do_Xor (Multipliee : not null access Unsigned_64;
      Item : Unsigned_64);

   procedure Inc (Addend : in out Integer_Addr);
   procedure Inc (Addend : not null access Integer_Addr);

   procedure Inc (Addend : in out Integer_Addr;
      Item : Integer_Addr);
   procedure Inc (Addend : not null access Integer_Addr;
      Item : Integer_Addr);

   procedure Dec (Addend : in out Integer_Addr);
   procedure Dec (Addend : not null access Integer_Addr);

   procedure Dec (Addend : in out Integer_Addr;
      Item : Integer_Addr);
   procedure Dec (Addend : not null access Integer_Addr;
      Item : Integer_Addr);

   procedure Inc (Addend : in out Unsigned_Addr);
   procedure Inc (Addend : not null access Unsigned_Addr);

   procedure Inc (Addend : in out Unsigned_Addr;
      Item : Unsigned_Addr);
   procedure Inc (Addend : not null access Unsigned_Addr;
      Item : Unsigned_Addr);

   procedure Dec (Addend : in out Unsigned_Addr);
   procedure Dec (Addend : not null access Unsigned_Addr);

   procedure Dec (Addend : in out Unsigned_Addr;
      Item : Unsigned_Addr);
   procedure Dec (Addend : not null access Unsigned_Addr;
      Item : Unsigned_Addr);

   procedure Do_And (Multipliee : in out Unsigned_Addr;
      Item : Unsigned_Addr);
   procedure Do_And (Multipliee : not null access Unsigned_Addr;
      Item : Unsigned_Addr);

   procedure Do_Or (Multipliee : in out Unsigned_Addr;
      Item : Unsigned_Addr);
   procedure Do_Or (Multipliee : not null access Unsigned_Addr;
      Item : Unsigned_Addr);

   procedure Do_Xor (Multipliee : in out Unsigned_Addr;
      Item : Unsigned_Addr);
   procedure Do_Xor (Multipliee : not null access Unsigned_Addr;
      Item : Unsigned_Addr);

   -----------------------------------
   -- Access types for Interfaces.* --
   -----------------------------------

   type A_Integer_8     is access all Integer_8;
   type A_Integer_16    is access all Integer_16;
   type A_Integer_32    is access all Integer_32;
   type A_Integer_64    is access all Integer_64;
   type A_Integer_Addr  is access all Integer_Addr;

   type A_Unsigned_8    is access all Unsigned_8;
   type A_Unsigned_16   is access all Unsigned_16;
   type A_Unsigned_32   is access all Unsigned_32;
   type A_Unsigned_64   is access all Unsigned_64;
   type A_Unsigned_Addr is access all Unsigned_Addr;

   -- I have decided to omit A_Natural_* because
   -- one shouldn't use access all types here, there, everywhere
   -- A_* types are mostly for interfacing needs

   ----------------
   -- Boolean_32 --
   ----------------

   type Boolean_32 is private;
   type A_Boolean_32 is access all Boolean_32;

   False_32 : constant Boolean_32;
   True_32  : constant Boolean_32;

   function "+" (Item : Boolean_32) return Boolean;

   function "+" (Item : Boolean_32) return Integer_32;

   function "+" (Item : Boolean) return Boolean_32;

   function "+" (Item : Integer_32) return Boolean_32;

   function "=" (Left : Boolean_32; Right : Boolean) return Boolean;
   function "=" (Left : Boolean; Right : Boolean_32) return Boolean;
   function "=" (Left, Right : Boolean_32) return Boolean;

   function ">" (Left : Boolean_32; Right : Boolean) return Boolean;
   function ">" (Left : Boolean; Right : Boolean_32) return Boolean;
   function ">" (Left, Right : Boolean_32) return Boolean;

   function "<" (Left : Boolean_32; Right : Boolean) return Boolean;
   function "<" (Left : Boolean; Right : Boolean_32) return Boolean;
   function "<" (Left, Right : Boolean_32) return Boolean;

   function ">=" (Left : Boolean_32; Right : Boolean) return Boolean;
   function ">=" (Left : Boolean; Right : Boolean_32) return Boolean;
   function ">=" (Left, Right : Boolean_32) return Boolean;

   function "<=" (Left : Boolean_32; Right : Boolean) return Boolean;
   function "<=" (Left : Boolean; Right : Boolean_32) return Boolean;
   function "<=" (Left, Right : Boolean_32) return Boolean;

   function "and" (Left : Boolean_32; Right : Boolean) return Boolean;
   function "and" (Left : Boolean; Right : Boolean_32) return Boolean;
   function "and" (Left, Right : Boolean_32) return Boolean;

   function "or" (Left : Boolean_32; Right : Boolean) return Boolean;
   function "or" (Left : Boolean; Right : Boolean_32) return Boolean;
   function "or" (Left, Right : Boolean_32) return Boolean;

   function "xor" (Left : Boolean_32; Right : Boolean) return Boolean;
   function "xor" (Left : Boolean; Right : Boolean_32) return Boolean;
   function "xor" (Left, Right : Boolean_32) return Boolean;

   function "not" (Item : Boolean_32) return Boolean;

   pragma Inline ("=", ">", "<", ">=", "<=", "+", "and", "or", "xor", "not");

   ----------------
   -- Boolean_16 --
   ----------------

   type Boolean_16 is private;
   type A_Boolean_16 is access all Boolean_16;

   False_16 : constant Boolean_16;
   True_16  : constant Boolean_16;

   function "+" (Item : Boolean_16) return Boolean;

   function "+" (Item : Boolean_16) return Integer_16;

   function "+" (Item : Boolean) return Boolean_16;

   function "+" (Item : Integer_16) return Boolean_16;

   function "=" (Left : Boolean_16; Right : Boolean) return Boolean;
   function "=" (Left : Boolean; Right : Boolean_16) return Boolean;
   function "=" (Left, Right : Boolean_16) return Boolean;

   function ">" (Left : Boolean_16; Right : Boolean) return Boolean;
   function ">" (Left : Boolean; Right : Boolean_16) return Boolean;
   function ">" (Left, Right : Boolean_16) return Boolean;

   function "<" (Left : Boolean_16; Right : Boolean) return Boolean;
   function "<" (Left : Boolean; Right : Boolean_16) return Boolean;
   function "<" (Left, Right : Boolean_16) return Boolean;

   function ">=" (Left : Boolean_16; Right : Boolean) return Boolean;
   function ">=" (Left : Boolean; Right : Boolean_16) return Boolean;
   function ">=" (Left, Right : Boolean_16) return Boolean;

   function "<=" (Left : Boolean_16; Right : Boolean) return Boolean;
   function "<=" (Left : Boolean; Right : Boolean_16) return Boolean;
   function "<=" (Left, Right : Boolean_16) return Boolean;

   function "and" (Left : Boolean_16; Right : Boolean) return Boolean;
   function "and" (Left : Boolean; Right : Boolean_16) return Boolean;
   function "and" (Left, Right : Boolean_16) return Boolean;

   function "or" (Left : Boolean_16; Right : Boolean) return Boolean;
   function "or" (Left : Boolean; Right : Boolean_16) return Boolean;
   function "or" (Left, Right : Boolean_16) return Boolean;

   function "xor" (Left : Boolean_16; Right : Boolean) return Boolean;
   function "xor" (Left : Boolean; Right : Boolean_16) return Boolean;
   function "xor" (Left, Right : Boolean_16) return Boolean;

   function "not" (Item : Boolean_16) return Boolean;

   pragma Inline ("=", ">", "<", ">=", "<=", "+", "and", "or", "xor", "not");

   ---------------
   -- Boolean_8 --
   ---------------

   type Boolean_8 is private;
   type A_Boolean_8 is access all Boolean_8;

   False_8 : constant Boolean_8;
   True_8  : constant Boolean_8;

   function "+" (Item : Boolean_8) return Boolean;

   function "+" (Item : Boolean_8) return Integer_8;

   function "+" (Item : Boolean) return Boolean_8;

   function "+" (Item : Integer_8) return Boolean_8;

   function "=" (Left : Boolean_8; Right : Boolean) return Boolean;
   function "=" (Left : Boolean; Right : Boolean_8) return Boolean;
   function "=" (Left, Right : Boolean_8) return Boolean;

   function ">" (Left : Boolean_8; Right : Boolean) return Boolean;
   function ">" (Left : Boolean; Right : Boolean_8) return Boolean;
   function ">" (Left, Right : Boolean_8) return Boolean;

   function "<" (Left : Boolean_8; Right : Boolean) return Boolean;
   function "<" (Left : Boolean; Right : Boolean_8) return Boolean;
   function "<" (Left, Right : Boolean_8) return Boolean;

   function ">=" (Left : Boolean_8; Right : Boolean) return Boolean;
   function ">=" (Left : Boolean; Right : Boolean_8) return Boolean;
   function ">=" (Left, Right : Boolean_8) return Boolean;

   function "<=" (Left : Boolean_8; Right : Boolean) return Boolean;
   function "<=" (Left : Boolean; Right : Boolean_8) return Boolean;
   function "<=" (Left, Right : Boolean_8) return Boolean;

   function "and" (Left : Boolean_8; Right : Boolean) return Boolean;
   function "and" (Left : Boolean; Right : Boolean_8) return Boolean;
   function "and" (Left, Right : Boolean_8) return Boolean;

   function "or" (Left : Boolean_8; Right : Boolean) return Boolean;
   function "or" (Left : Boolean; Right : Boolean_8) return Boolean;
   function "or" (Left, Right : Boolean_8) return Boolean;

   function "xor" (Left : Boolean_8; Right : Boolean) return Boolean;
   function "xor" (Left : Boolean; Right : Boolean_8) return Boolean;
   function "xor" (Left, Right : Boolean_8) return Boolean;

   function "not" (Item : Boolean_8) return Boolean;

   pragma Inline ("=", ">", "<", ">=", "<=", "+", "and", "or", "xor", "not");

   -------------
   -- Strings --
   -------------

   type Buffer_8 is new String;
   type Buffer_16 is new Wide_String;
   type Buffer_32 is new Wide_Wide_String;

   subtype Char_8 is Character;
   subtype Char_16 is Wide_Character;
   subtype Char_32 is Wide_Wide_Character;

   NUL_8 : constant Char_8 := Char_8'Val (0);
   NUL_16 : constant Char_16 := Char_16'Val (0);
   NUL_32 : constant Char_32 := Char_32'Val (0);

   type A_Char_8 is new System.Address;
   type A_Char_16 is new System.Address;
   type A_Char_32 is new System.Address;

   type A_A_Char_8 is access all A_Char_8;
   type A_A_Char_16 is access all A_Char_16;
   type A_A_Char_32 is access all A_Char_32;

   ---------------
   -- A_Address --
   ---------------

   type A_Address is access all System.Address;
--   type P_P_Address is access all P_Address;

--   No GUID in Turbo!
--     ----------
--     -- GUID --
--     ----------
--
--     type T_GUID_D4 is
--       array (0 .. 7) of Unsigned_8;
--     pragma Pack (T_GUID_D4);
--
--     type T_GUID is record
--        D1 : Unsigned_32;
--        D2 : Unsigned_16;
--        D3 : Unsigned_16;
--        D4 : T_GUID_D4;
--     end record;
--     pragma Pack (T_GUID);
--
--     type A_GUID is access all T_GUID;

   -- type T_Handle is new Integer_Ptr; -- no T_Handle in Turbo!
   -- type A_Handle is access all T_Handle;
   -- TODO: deny most integer operations

private

   type Boolean_32 is new Integer_32;

   False_32 : constant Boolean_32 := 0;
   True_32  : constant Boolean_32 := 1;

   type Boolean_16 is new Integer_16;

   False_16 : constant Boolean_16 := 0;
   True_16  : constant Boolean_16 := 1;

   type Boolean_8 is new Integer_8;

   False_8 : constant Boolean_8 := 0;
   True_8  : constant Boolean_8 := 1;

end Turbo;
