
-- 1: --------------------------------
-- 2: -- Ivan Levashew aka OCTAGRAM --
-- 3: --              Barnaul, 2009 --
-- 4: --------------------------------

-- 5:

-- 6: with Interfaces; use Interfaces;

-- 7: with Turbo_Private.Common; use Turbo_Private.Common;

-- 8: with Ada.Finalization; use Ada.Finalization;
with ada;

-- 9: with System; use System;
with turbo_private;

-- 10:

-- 11: package Turbo_Private.Strings is
with turbo_private;
with ada;
with turbo_private;
with interfaces;
use interfaces;
with turbo_private.turbo_private__common;
use turbo_private.turbo_private__common;
with ada.ada__finalization;
use ada.ada__finalization;
with system;
use system;
with ada.ada__streams;
with system.system__finalization_root;
with ada.ada__tags;
with system;
with system.system__finalization_implementation;
with system.system__stream_attributes;
with system.system__secondary_stack;
with system.system__soft_links;
with system.system__storage_elements;
with ada.ada__exceptions;
with system.system__standard_library;
turbo_private__strings_E : boolean := false;
package turbo_private.turbo_private__strings is

-- 12:    pragma Preelaborate;
   pragma preelaborate;

-- 13:

-- 14:    subtype Char_8 is Character;
   subtype turbo_private__strings__char_8 is character;
-- 15: --   subtype Char_16 is Wide_Character;
-- 16: --   subtype Char_32 is Wide_Wide_Character;

-- 17:

-- 18:    type N_String_8  is private; -- Native String
   type turbo_private__strings__n_string_8 is private;

-- 19:    type NC_String_8 is private; -- Native Constant String
   type turbo_private__strings__nc_string_8 is private;

-- 20:
-- 21: --   type N_String_16  is private;
-- 22: --   type NC_String_16 is private;

-- 23:
-- 24: --   type N_String_32  is private;
-- 25: --   type NC_String_32 is private;

-- 26:
-- 27:    -- Linear Strings
-- 28:    -- Strings longer than 2Gb? Use ropes, Luke

-- 29:    type L_String_8  is array (Positive_32 range <>) of aliased Char_8;
   type turbo_private__strings__l_string_8 is array (1 ..
     16#7FFF_FFFF# range <>) of aliased turbo_private__strings__char_8;
-- 30: --   type L_String_16 is array (Positive_32 range <>) of aliased Char_16;
-- 31: --   type L_String_32 is array (Positive_32 range <>) of aliased Char_32;

-- 32:

-- 33:    type String_8 is tagged private;
   type turbo_private__strings__string_8 is tagged private;
-- 34: --   type String_16 is tagged private;
-- 35: --   type String_32 is tagged private;

-- 36:

-- 37: private
private

-- 38:

-- 39:    type N_String_8  is access all Char_8;
   type turbo_private__strings__n_string_8 is access all
     turbo_private__strings__char_8;

-- 40:    type NC_String_8 is access constant Char_8;
   type turbo_private__strings__nc_string_8 is access constant
     turbo_private__strings__char_8;

-- 41:
-- 42: --   type N_String_16  is access all Char_16;
-- 43: --   type NC_String_16 is access constant Char_16;

-- 44:
-- 45: --   type N_String_32  is access all Char_32;
-- 46: --   type NC_String_32 is access constant Char_32;

-- 47:

-- 48:    type String_8  is new Controlled with record
   type turbo_private__strings__string_8 is new
     ada__finalization__controlled with record
      _parent : ada__finalization__controlled;

-- 49:       Item : Address := Null_Address;
      item : system__address := system__null_address;

-- 50:    end record;
   end record;

-- 51:

-- 52:    overriding

-- 53:    procedure Adjust (Object : in out String_8);
   procedure turbo_private__strings__adjust__2 (object : in out
     turbo_private__strings__string_8);

-- 54:    overriding

-- 55:    procedure Finalize (Object : in out String_8);
   procedure turbo_private__strings__finalize__2 (object : in out
     turbo_private__strings__string_8);
   freeze turbo_private__strings__n_string_8 []
   freeze turbo_private__strings__nc_string_8 []
   freeze turbo_private__strings__l_string_8 [
      procedure turbo_private__strings__l_string_8IP (_init : in out
        turbo_private__strings__l_string_8) is
      begin
         null;
         return;
      end turbo_private__strings__l_string_8IP;
   ]
   function turbo_private__strings___size__2 (x :
     turbo_private__strings__string_8) return long_long_integer;
   function turbo_private__strings___alignment__2 (x :
     turbo_private__strings__string_8) return integer;
   procedure turbo_private__strings__string_8SR__2 (s : not null
     access ada__streams__Troot_stream_typeC; v : out
     turbo_private__strings__string_8);
   procedure turbo_private__strings__string_8SW__2 (s : not null
     access ada__streams__Troot_stream_typeC; v :
     turbo_private__strings__string_8);
   function turbo_private__strings__string_8SI__2 (s : not null access
     ada__streams__Troot_stream_typeC) return
     turbo_private__strings__string_8;
   procedure turbo_private__strings__string_8SO__2 (s : not null
     access ada__streams__Troot_stream_typeC; v :
     turbo_private__strings__string_8);
   function turbo_private__strings__Oeq__2 (x :
     turbo_private__strings__string_8; y :
     turbo_private__strings__string_8) return boolean;
   procedure turbo_private__strings___assign__2 (x : out
     turbo_private__strings__string_8; y :
     turbo_private__strings__string_8);
   procedure turbo_private__strings__string_8DA__2 (l : in out
     system__finalization_root__finalizable_ptr; v : in out
     turbo_private__strings__string_8; b : short_short_integer);
   procedure turbo_private__strings__string_8DF__2 (v : in out
     turbo_private__strings__string_8; b : boolean);
   freeze turbo_private__strings__string_8 [
      subtype turbo_private__strings__Tstring_8TS is
        ada__tags__dispatch_table_wrapper (3);
      turbo_private__strings__string_8T : aliased constant
        ada__tags__dispatch_table_wrapper (3);
      $pragma import (ada, turbo_private__strings__string_8T, "turbo_private__strings__string_8T");
      subtype turbo_private__strings__S8s is ada__tags__address_array (
        1 .. turbo_private__strings__string_8T.num_prims);
      null;
      turbo_private__strings__string_8P : static constant
        ada__tags__tag := ada__tags__tag!(
        turbo_private__strings__string_8T.prims_ptr'address);
      turbo_private__strings__string_8Y : constant system__address :=
        turbo_private__strings__string_8T.predef_prims'address;
      type turbo_private__strings__string_8G is array (1 .. 3) of
        ada__tags__prim_ptr;
      type turbo_private__strings__string_8H is access
        turbo_private__strings__string_8G;
      freeze turbo_private__strings__adjust__2 []
      freeze turbo_private__strings__finalize__2 []
      freeze turbo_private__strings___size__2 []
      freeze turbo_private__strings___alignment__2 []
      freeze turbo_private__strings__string_8SR__2 []
      freeze turbo_private__strings__string_8SW__2 []
      freeze turbo_private__strings__string_8SI__2 []
      freeze turbo_private__strings__string_8SO__2 []
      freeze turbo_private__strings__Oeq__2 []
      freeze turbo_private__strings___assign__2 []
      freeze turbo_private__strings__string_8DA__2 []
      freeze turbo_private__strings__string_8DF__2 []
      procedure turbo_private__strings__string_8IP (_init : in out
        turbo_private__strings__string_8; P11s : boolean := true) is
      begin
         if P11s then
            _init._tag := turbo_private__strings__string_8P;
         end if;
         $ada__finalization__controlledIP (_init._parent, false);
         _init.item := system__null_address;
         return;
      end turbo_private__strings__string_8IP;
      function turbo_private__strings___alignment (x :
        turbo_private__strings__string_8) return integer is
      begin
         return x'alignment;
      end turbo_private__strings___alignment;
      function turbo_private__strings___size (x :
        turbo_private__strings__string_8) return long_long_integer is
      begin
         return x'size;
      end turbo_private__strings___size;
      procedure turbo_private__strings__string_8SR (s : not null
        access ada__streams__Troot_stream_typeC; v : out
        turbo_private__strings__string_8) is
      begin
         $ada__finalization__controlledSR__2 (s, v._parent);
         v.item := system__address!($system__stream_attributes__i_u (s));
         return;
      end turbo_private__strings__string_8SR;
      procedure turbo_private__strings__string_8SW (s : not null
        access ada__streams__Troot_stream_typeC; v :
        turbo_private__strings__string_8) is
      begin
         $ada__finalization__controlledSW__2 (s, v._parent);
         $system__stream_attributes__w_u (s,
           system__unsigned_types__unsigned!(v.item));
         return;
      end turbo_private__strings__string_8SW;
      function turbo_private__strings__string_8SI (s : not null access
        ada__streams__Troot_stream_typeC) return
        turbo_private__strings__string_8 is
      begin
         R17s : declare
            F18s : system__finalization_root__finalizable_ptr := null;
            procedure
              turbo_private__strings__string_8SI__R17s___clean__2 is
            begin
               system__soft_links__abort_defer.all;
               $system__finalization_implementation__finalize_list (
                 F18s);
               system__soft_links__abort_undefer.all;
               return;
            end turbo_private__strings__string_8SI__R17s___clean__2;
         begin
            v : turbo_private__strings__string_8;
            turbo_private__strings__string_8IP (v, P11s => true);
            $ada__finalization__initialize (v);
            $system__finalization_implementation__attach_to_final_list
              (F18s, system__finalization_root__finalizable?(v), 1);
            B19s : declare
            begin
               turbo_private__strings__string_8SR__2 (s, v);
            end B19s;
            type turbo_private__strings__string_8SI__R17s__A22s__2 is
              access turbo_private__strings__string_8;
            freeze turbo_private__strings__string_8SI__R17s__A22s__2 []
            P24s : constant
              turbo_private__strings__string_8SI__R17s__A22s__2 := new
              turbo_private__strings__string_8'(v)[storage_pool =
              system__secondary_stack__ss_pool];
            P24s.all._tag := turbo_private__strings__string_8P;
            F25s : system__finalization_root__finalizable_ptr := null;
            turbo_private__strings__adjust__2 (P24s.all);
            $system__finalization_implementation__attach_to_final_list
              (F25s, system__finalization_root__finalizable?(P24s.all),
              1);
            R21s : turbo_private__strings__string_8SI__R17s__A22s__2 :=
              P24s;
            return R21s.all;
         at end
            turbo_private__strings__string_8SI__R17s___clean__2;
         end R17s;
      end turbo_private__strings__string_8SI;
      procedure turbo_private__strings__string_8SO (s : not null
        access ada__streams__Troot_stream_typeC; v :
        turbo_private__strings__string_8) is
      begin
         turbo_private__strings__string_8SW__2 (s, v);
         return;
      end turbo_private__strings__string_8SO;
      function turbo_private__strings__Oeq (x :
        turbo_private__strings__string_8; y :
        turbo_private__strings__string_8) return boolean is
      begin
         return $ada__finalization__Oeq__2 (x._parent, y._parent) and then
           x.item = y.item;
      end turbo_private__strings__Oeq;
      procedure turbo_private__strings___assign (x : out
        turbo_private__strings__string_8; y :
        turbo_private__strings__string_8) is
      begin
         B32s : begin
            system__soft_links__abort_defer.all;
            B33s : begin
               if not (x'address = y'address) then
                  turbo_private__strings__finalize__2 (x);
                  A28s : ada__tags__tag := x._tag;
                  subtype
                    turbo_private__strings___assign__B32s__B33s__G29s__2 is
                    system__storage_elements__storage_offset range
                    1 .. (turbo_private__strings__string_8'size + 7) /
                    8;
                  subtype
                    turbo_private__strings___assign__B32s__B33s__S30s__2 is
                    system__storage_elements__storage_array (
                    turbo_private__strings___assign__B32s__B33s__G29s__2);
                  type
                    turbo_private__strings___assign__B32s__B33s__A31s__2
                    is access
                    turbo_private__strings___assign__B32s__B33s__S30s__2;
                  freeze
                    turbo_private__strings___assign__B32s__B33s__A31s__2 []
                  [subtype
                    turbo_private__strings___assign__B32s__B33s__T37s__2 is
                  [subtype
                  [type system__storage_elements__Tstorage_offsetB is new
                    integer]
                    turbo_private__strings___assign__B32s__B33s__T36s__2 is
                    system__storage_elements__Tstorage_offsetB range
                    1 + system__finalization_root__root_controlled'size /
                    8 ..
                    turbo_private__strings___assign__B32s__B33s__G29s__2'
                    last]
                    system__storage_elements__storage_array (
                    turbo_private__strings___assign__B32s__B33s__T36s__2)]
                  reference
                    turbo_private__strings___assign__B32s__B33s__T37s__2
                  reference
                    turbo_private__strings___assign__B32s__B33s__T37s__2
                  turbo_private__strings___assign__B32s__B33s__A31s__2!
                    (x'address).all (1 +
                    system__finalization_root__root_controlled'size /
                    8 ..
                    turbo_private__strings___assign__B32s__B33s__G29s__2'
                    last) :=
                    turbo_private__strings___assign__B32s__B33s__A31s__2!
                    (y'address).all (1 +
                    system__finalization_root__root_controlled'size /
                    8 ..
                    turbo_private__strings___assign__B32s__B33s__G29s__2'
                    last);
                  x._tag := A28s;
                  turbo_private__strings__adjust__2 (x);
                  null;
               end if;
            exception
               when others =>
                  system__soft_links__abort_undefer.all;
                  B39s : declare
                     e : ada__exceptions__exception_occurrence;
                  begin
                     $ada__exceptions__save_occurrence (e,
                       system__soft_links__get_current_excep.all.all);
                     $ada__exceptions__raise_from_controlled_operation
                       (e);
                  end B39s;
            end B33s;
         at end
            system__standard_library__abort_undefer_direct;
         end B32s;
         return;
      end turbo_private__strings___assign;
      procedure turbo_private__strings__string_8DA (l : in out
        system__finalization_root__finalizable_ptr; v : in out
        turbo_private__strings__string_8; b : short_short_integer) is
      begin
         turbo_private__strings__adjust__2 (v);
         $system__finalization_implementation__attach_to_final_list (l,
           system__finalization_root__finalizable?(v), b);
         return;
      end turbo_private__strings__string_8DA;
      procedure turbo_private__strings__string_8DF (v : in out
        turbo_private__strings__string_8; b : boolean) is
      begin
         if b then
            $system__finalization_implementation__finalize_one (
              system__finalization_root__finalizable?(v));
         else
            turbo_private__strings__finalize__2 (v);
         end if;
         return;
      end turbo_private__strings__string_8DF;
   ]
   freeze turbo_private__strings__Tstring_8C []
   [type turbo_private__strings__Tstring_8GB is array (1 .. 3 range <>) of
     ada__tags__prim_ptr]
   freeze turbo_private__strings__Tstring_8GB []
   freeze turbo_private__strings__string_8G []
   freeze turbo_private__strings__string_8H []
   subtype turbo_private__strings__Tstring_8E41sS is string (1 .. 31);
   turbo_private__strings__string_8E41s : static constant string (1 ..
     31) := "TURBO_PRIVATE.STRINGS.STRING_8["00"]";
   turbo_private__strings__string_8H42s : ada__tags__tag :=
     ada__tags__tag!(ada__tags__tag'(null));
   subtype turbo_private__strings__Tstring_8B45sS is
     ada__tags__type_specific_data (3);
   [subtype turbo_private__strings__T54s is ada__tags__tag_table (0 ..
     3)]
   reference turbo_private__strings__T54s
   turbo_private__strings__string_8B45s : static aliased constant
     ada__tags__type_specific_data (3) := (
      idepth => 3,
      access_level => 0,
      expanded_name => ada__tags__cstring_ptr!(
        turbo_private__strings__string_8E41s'address),
      external_tag => ada__tags__cstring_ptr!(
        turbo_private__strings__string_8E41s'address),
      ht_link => ada__tags__tag_ptr!(
        turbo_private__strings__string_8H42s'address),
      transportable => false,
      rc_offset => 0,
      size_func => ada__tags__size_ptr!(
        turbo_private__strings___size__2'unrestricted_access),
      interfaces_table => null,
      ssd => null,
      tags_table => (turbo_private__strings__string_8P,
        ada__finalization__controlledP,
        system__finalization_root__root_controlledP,
        system__finalization_root__empty_root_controlledP));
   for turbo_private__strings__string_8B45s'alignment use 4;
   subtype turbo_private__strings__S46s is ada__tags__address_array;
   [subtype turbo_private__strings__T66s is ada__tags__address_array (
     1 .. 10)]
   turbo_private__strings__string_8R43s : static aliased constant
     turbo_private__strings__T66s := (turbo_private__strings___size__2'
     unrestricted_access, turbo_private__strings___alignment__2'
     unrestricted_access, turbo_private__strings__string_8SR__2'
     unrestricted_access, turbo_private__strings__string_8SW__2'
     unrestricted_access, turbo_private__strings__string_8SI__2'
     unrestricted_access, turbo_private__strings__string_8SO__2'
     unrestricted_access, turbo_private__strings__Oeq__2'
     unrestricted_access, turbo_private__strings___assign__2'
     unrestricted_access, turbo_private__strings__string_8DA__2'
     unrestricted_access, turbo_private__strings__string_8DF__2'
     unrestricted_access);
   for turbo_private__strings__string_8R43s'alignment use 4;
   subtype turbo_private__strings__Tstring_8T40sS is
     ada__tags__dispatch_table_wrapper (3);
   [subtype turbo_private__strings__T74s is ada__tags__address_array (
     1 .. 3)]
   reference turbo_private__strings__T74s
   turbo_private__strings__string_8T : static aliased constant
     ada__tags__dispatch_table_wrapper (3) := (
      num_prims => 3,
      signature => ada__tags__primary_dt,
      tag_kind => ada__tags__tk_tagged,
      predef_prims => turbo_private__strings__string_8R43s'address,
      offset_to_top => 0,
      tsd => turbo_private__strings__string_8B45s'address,
      prims_ptr => (ada__finalization__initialize'unrestricted_access,
        turbo_private__strings__finalize__2'unrestricted_access,
        turbo_private__strings__adjust__2'unrestricted_access));
   $pragma export (ada, turbo_private__strings__string_8T, "turbo_private__strings__string_8T");
   for turbo_private__strings__string_8T'alignment use 4;
   $ada__tags__register_tag (turbo_private__strings__string_8P);

-- 56:
-- 57: --   type String_16 is new Controlled with record
-- 58: --      Item : Address := Null_Address;
-- 59: --   end record;

-- 60:
-- 61: --   overriding
-- 62: --   procedure Adjust (Object : in out String_16);
-- 63: --   overriding
-- 64: --   procedure Finalize (Object : in out String_16);

-- 65:
-- 66: --   type String_32 is new Controlled with record
-- 67: --      Item : Address := Null_Address;
-- 68: --   end record;

-- 69:
-- 70: --   overriding
-- 71: --   procedure Adjust (Object : in out String_32);
-- 72: --   overriding
-- 73: --   procedure Finalize (Object : in out String_32);

-- 74:

-- 75: end Turbo_Private.Strings;
end turbo_private.turbo_private__strings;
