CombinedText stringlengths 4 3.42M |
|---|
-- Copyright (c) 2019 Maxim Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Program.Elements.Access_Types;
with Program.Lexical_Elements;
with Program.Elements.Parameter_Specifications;
package Program.Elements.Function_Access_Types is
pragma Pure (Program.Elements.Function_Access_Types);
type Function_Access_Type is
limited interface and Program.Elements.Access_Types.Access_Type;
type Function_Access_Type_Access is access all Function_Access_Type'Class
with Storage_Size => 0;
not overriding function Parameters
(Self : Function_Access_Type)
return Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access is abstract;
not overriding function Result_Subtype
(Self : Function_Access_Type)
return not null Program.Elements.Element_Access is abstract;
not overriding function Has_Not_Null
(Self : Function_Access_Type)
return Boolean is abstract;
not overriding function Has_Protected
(Self : Function_Access_Type)
return Boolean is abstract;
not overriding function Has_Not_Null_2
(Self : Function_Access_Type)
return Boolean is abstract;
type Function_Access_Type_Text is limited interface;
type Function_Access_Type_Text_Access is
access all Function_Access_Type_Text'Class with Storage_Size => 0;
not overriding function To_Function_Access_Type_Text
(Self : aliased in out Function_Access_Type)
return Function_Access_Type_Text_Access is abstract;
not overriding function Not_Token
(Self : Function_Access_Type_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Null_Token
(Self : Function_Access_Type_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Access_Token
(Self : Function_Access_Type_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Protected_Token
(Self : Function_Access_Type_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Function_Token
(Self : Function_Access_Type_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Left_Bracket_Token
(Self : Function_Access_Type_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Right_Bracket_Token
(Self : Function_Access_Type_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Return_Token
(Self : Function_Access_Type_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Not_Token_2
(Self : Function_Access_Type_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Null_Token_2
(Self : Function_Access_Type_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
end Program.Elements.Function_Access_Types;
|
pragma License (Unrestricted);
-- implementation unit required by compiler
package System.Finalization_Root is
pragma Pure;
-- required for controlled type by compiler (s-finroo.ads)
type Root_Controlled is abstract tagged null record;
procedure Adjust (Object : in out Root_Controlled) is null;
procedure Initialize (Object : in out Root_Controlled) is null;
procedure Finalize (Object : in out Root_Controlled) is null;
end System.Finalization_Root;
|
-----------------------------------------------------------------------
-- components-util -- ASF Util Components
-- Copyright (C) 2009, 2010, 2011, 2013, 2015 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Beans.Objects;
with ASF.Views;
with ASF.Views.Nodes;
package body ASF.Components.Utils is
function Get_Line_Info (UI : in Base.UIComponent'Class) return Views.Line_Info;
-- ------------------------------
-- Get the line information where the component is defined.
-- ------------------------------
function Get_Line_Info (UI : in Base.UIComponent'Class) return Views.Line_Info is
Tag : constant access ASF.Views.Nodes.Tag_Node'Class := UI.Get_Tag;
begin
if Tag /= null then
return Tag.Get_Line_Info;
else
return Tag.Get_Line_Info;
end if;
end Get_Line_Info;
pragma Unreferenced (Get_Line_Info);
-- ------------------------------
-- Get the line information where the component is defined.
-- ------------------------------
function Get_Line_Info (UI : in Base.UIComponent'Class) return String is
Tag : constant access ASF.Views.Nodes.Tag_Node'Class := UI.Get_Tag;
begin
if Tag /= null then
return Tag.Get_Line_Info;
else
return "?";
end if;
end Get_Line_Info;
-- ------------------------------
-- Get the component attribute that implements the <tt>List_Bean</tt> interface.
-- Returns null if the attribute is not found or does not implement the interface.
-- ------------------------------
function Get_List_Bean (UI : in Base.UIComponent'Class;
Name : in String;
Context : in ASF.Contexts.Faces.Faces_Context'Class)
return Util.Beans.Basic.List_Bean_Access is
use type Util.Beans.Objects.Data_Type;
Value : constant Util.Beans.Objects.Object := UI.Get_Attribute (Context, Name);
Kind : constant Util.Beans.Objects.Data_Type := Util.Beans.Objects.Get_Type (Value);
Bean : access Util.Beans.Basic.Readonly_Bean'Class;
List : Util.Beans.Basic.List_Bean_Access;
begin
-- Check that we have a List_Bean but do not complain if we have a null value.
if Kind /= Util.Beans.Objects.TYPE_BEAN then
if Kind /= Util.Beans.Objects.TYPE_NULL then
ASF.Components.Base.Log_Error (UI, "Invalid list bean (found a {0})",
Util.Beans.Objects.Get_Type_Name (Value));
end if;
return null;
end if;
Bean := Util.Beans.Objects.To_Bean (Value);
if Bean = null or else not (Bean.all in Util.Beans.Basic.List_Bean'Class) then
ASF.Components.Base.Log_Error (UI, "Invalid list bean: it does not implement"
& " 'List_Bean' interface");
return null;
end if;
List := Util.Beans.Basic.List_Bean'Class (Bean.all)'Unchecked_Access;
return List;
end Get_List_Bean;
end ASF.Components.Utils;
|
-- { dg-do compile }
package body Pack15 is
procedure Transfer is
begin
O.Status_Flags := Status_Flags;
end;
end Pack15;
|
with AUnit.Reporter.Text;
with AUnit.Run;
with Test.Test_Suite;
procedure Test.Main is
procedure Run is new AUnit.Run.Test_Runner (Test_Suite.Suite);
Reporter : AUnit.Reporter.Text.Text_Reporter;
begin
Run (Reporter);
end Test.Main;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.Elements.Generic_Hash;
function AMF.Standard_Profile_L2.Types.Hash is
new AMF.Elements.Generic_Hash (Standard_Profile_L2_Type, Standard_Profile_L2_Type_Access);
|
--
-- Jan & Uwe R. Zimmer, Australia, July 2011
--
with GL, GL.Materials, GLOBE_3D.Math;
package body Duck_P is
-- Pretty output: FALSE
use GL, GL.Materials, GLOBE_3D, GLOBE_3D.Math;
-- begin Separator # 1
-- VRML: [# triangle mesh
-- ]
matos_1 : constant Material_type := (
ambient => (0.0, 0.0, 0.0, 1.0),
specular => (0.0, 0.0, 0.0, 1.0),
diffuse => (1.0, 1.0, 1.0, 1.0),
emission => (0.0, 0.0, 0.0, 1.0),
shininess => 128.0
);
coord_1 : constant Point_3D_array :=
((-0.820852, -2.0, 25.392281), -- VRML: [# coord point 0
-- ]
(1.945565, -2.0, 24.677994), (-2.253384, -2.0, 19.844109), (0.513033, -2.0, 19.129824), (3.27945, -2.0, 18.415537),
(-3.685915, -2.0, 14.295938), (-0.919498, -2.0, 13.581653), (1.846919, -2.0, 12.867367), (4.613336, -2.0, 12.153081), (-5.118447, -2.0, 8.747767),
(-2.35203, -2.0, 8.033482), (0.414387, -2.0, 7.319196), (3.180804, -2.0, 6.60491), (5.947221, -2.0, 5.890624), (-6.550979, -2.0, 3.199596),
(-3.784562, -2.0, 2.485311), (-1.018144, -2.0, 1.771025), (1.748273, -2.0, 1.056739), (4.51469, -2.0, 0.342453), (7.281107, -2.0, -0.371833),
(-7.98351, -2.0, -2.348575), (-5.217093, -2.0, -3.06286), (-2.450676, -2.0, -3.777146), (0.315741, -2.0, -4.491432), (3.082158, -2.0, -5.205718),
(5.848576, -2.0, -5.920004), -- VRML: [# coord point 25
-- ]
(-10.0, -2.0, -0.0), (-9.780878, -2.0, -2.08193), (-9.113341, -2.0, -4.116675), (-8.027896, -2.0, -5.962624),
(-6.610581, -2.0, -7.503347), (-4.903584, -2.0, -8.715209), (-2.935564, -2.0, -9.559418), (-0.832943, -2.0, -9.96525), (1.260043, -2.0, -9.920297),
(3.29777, -2.0, -9.440589), (5.232184, -2.0, -8.521986), (6.926649, -2.0, -7.212595), (8.276505, -2.0, -5.612439), (9.263618, -2.0, -3.766347),
(9.85312, -2.0, -1.707639), (9.990779, -2.0, 0.42936), (9.682458, -2.0, 2.5), (8.835243, -2.0, 5.78125), (7.988028, -2.0, 9.0625),
(7.140813, -2.0, 12.34375), (6.293598, -2.0, 15.625), (5.446383, -2.0, 18.90625), (4.599168, -2.0, 22.1875), (3.751953, -2.0, 25.46875),
(2.904737, -2.0, 28.75), -- VRML: [# coord point 50
-- ]
(2.520814, -2.0, 29.626503), (1.83712, -2.0, 30.371706), (0.944662, -2.0, 30.847389), (-0.0, -2.0, 31.0),
(-0.944652, -2.0, 30.847391), (-1.837115, -2.0, 30.37171), (-2.520808, -2.0, 29.626513), (-2.904737, -2.0, 28.75), (-3.751953, -2.0, 25.46875),
(-4.599168, -2.0, 22.1875), (-5.446383, -2.0, 18.90625), (-6.293598, -2.0, 15.625), (-7.140813, -2.0, 12.34375), (-7.988028, -2.0, 9.0625),
(-8.835243, -2.0, 5.78125), (-9.682458, -2.0, 2.5), (-9.920285, -2.0, 1.260044), (-10.0, 2.0, -0.0), (-9.780878, 2.0, -2.08193),
(-9.113341, 2.0, -4.116675), (-8.027896, 2.0, -5.962624), (-6.610581, 2.0, -7.503347), (-4.903584, 2.0, -8.715209), (-2.935564, 2.0, -9.559418),
(-0.832943, 2.0, -9.96525), -- VRML: [# coord point 75
-- ]
(1.260043, 2.0, -9.920297), (3.29777, 2.0, -9.440589), (5.232184, 2.0, -8.521986), (6.926649, 2.0, -7.212595),
(8.276505, 2.0, -5.612439), (9.263618, 2.0, -3.766347), (9.85312, 2.0, -1.707639), (9.990779, 2.0, 0.42936), (9.682458, 2.0, 2.5),
(8.835243, 2.0, 5.78125), (7.988028, 2.0, 9.0625), (7.140813, 2.0, 12.34375), (6.293598, 2.0, 15.625), (5.446383, 2.0, 18.90625),
(4.599168, 2.0, 22.1875), (3.751953, 2.0, 25.46875), (2.904737, 2.0, 28.75), (2.520814, 2.0, 29.626503), (1.83712, 2.0, 30.371706),
(0.944662, 2.0, 30.847389), (-0.0, 2.0, 31.0), (-0.944652, 2.0, 30.847391), (-1.837115, 2.0, 30.37171), (-2.520808, 2.0, 29.626513),
(-2.904737, 2.0, 28.75), -- VRML: [# coord point 100
-- ]
(-3.751953, 2.0, 25.46875), (-4.599168, 2.0, 22.1875), (-5.446383, 2.0, 18.90625), (-6.293598, 2.0, 15.625),
(-7.140813, 2.0, 12.34375), (-7.988028, 2.0, 9.0625), (-8.835243, 2.0, 5.78125), (-9.682458, 2.0, 2.5), (-9.920285, 2.0, 1.260044),
(8.714212, 2.0, 2.25), (8.996537, 2.0, 0.249666), (8.814853, 2.0, -1.81614), (8.165142, 2.0, -3.785558), (7.115125, 2.0, -5.511352),
(5.706609, 2.0, -6.959498), (3.962188, 2.0, -8.080908), (2.007362, 2.0, -8.773284), (-0.0, 2.0, -9.0), (-2.007396, 2.0, -8.773275),
(-3.962183, 2.0, -8.08091), (-5.706637, 2.0, -6.959476), (-7.11514, 2.0, -5.511357), (-7.906799, 2.0, -4.299133), (-8.505519, 2.0, -2.942135),
(-8.875903, 2.0, -1.489408), -- VRML: [# coord point 125
-- ]
(-9.0, 2.0, 0.0), (4.64758, 2.0, 18.0), (5.155909, 2.0, 16.03125), (5.664238, 2.0, 14.0625),
(6.172567, 2.0, 12.09375), (6.680896, 2.0, 10.125), (7.189225, 2.0, 8.15625), (7.697555, 2.0, 6.1875), (8.205883, 2.0, 4.21875),
(-4.64758, 2.0, 18.0), (-4.396681, 2.0, 18.725855), (-4.033293, 2.0, 19.40242), (-3.536783, 2.0, 20.044878), (-2.939384, 2.0, 20.594736),
(-2.257642, 2.0, 21.035728), (-1.511443, 2.0, 21.355827), (-0.765503, 2.0, 21.538439), (-0.0, 2.0, 21.6), (0.76551, 2.0, 21.538435),
(1.511459, 2.0, 21.355822), (2.257656, 2.0, 21.035723), (2.939392, 2.0, 20.59473), (3.536792, 2.0, 20.044868), (4.033303, 2.0, 19.402407),
(4.396687, 2.0, 18.725843), -- VRML: [# coord point 150
-- ]
(-8.928257, 2.0, 1.134039), (-8.714212, 2.0, 2.25), (-8.205883, 2.0, 4.21875), (-7.697555, 2.0, 6.1875),
(-7.189225, 2.0, 8.15625), (-6.680896, 2.0, 10.125), (-6.172567, 2.0, 12.09375), (-5.664238, 2.0, 14.0625), (-5.155909, 2.0, 16.03125),
(-10.0, 2.0, -0.0), (-10.73619, 1.859577, -0.0), (-11.414213, 1.414214, -0.0), (-11.859576, 0.736189, -0.0), (-12.0, 0.0, -0.0),
(-11.859576, -0.736189, -0.0), (-11.414213, -1.414214, -0.0), (-10.73619, -1.859577, -0.0), (-10.0, -2.0, -0.0), (-9.113341, 2.0, -4.116675),
(-9.784256, 1.859577, -4.41974), (-10.402163, 1.414214, -4.698861), (-10.808037, 0.736189, -4.882202), (-10.936009, 0.0, -4.94001), (-10.808037, -0.736189, -4.882202),
(-10.402163, -1.414214, -4.698861), -- VRML: [# coord point 175
-- ]
(-9.784256, -1.859577, -4.41974), (-7.097245, 1.859577, -8.055736), (-7.545459, 1.414214, -8.564481), (-7.839869, 0.736189, -8.898652),
(-7.932698, 0.0, -9.004016), (-7.839869, -0.736189, -8.898652), (-7.545459, -1.414214, -8.564481), (-7.097245, -1.859577, -8.055736), (-3.151677, 1.859577, -10.263172),
(-3.350716, 1.414214, -10.911324), (-3.481455, 0.736189, -11.337065), (-3.522677, 0.0, -11.471301), (-3.481455, -0.736189, -11.337065), (-3.350716, -1.414214, -10.911324),
(-3.151677, -1.859577, -10.263172), (1.260043, 2.0, -9.920297), (1.352806, 1.859577, -10.650619), (1.43824, 1.414214, -11.323238), (1.494358, 0.736189, -11.765052),
(1.512051, 0.0, -11.904356), (1.494358, -0.736189, -11.765052), (1.43824, -1.414214, -11.323238), (1.352806, -1.859577, -10.650619), (1.260043, -2.0, -9.920297),
(5.617372, 1.859577, -9.149366), -- VRML: [# coord point 200
-- ]
(5.972126, 1.414214, -9.727178), (6.205149, 0.736189, -10.106715), (6.278621, 0.0, -10.226383), (6.205149, -0.736189, -10.106715),
(5.972126, -1.414214, -9.727178), (5.617372, -1.859577, -9.149366), (8.276505, 2.0, -5.612439), (8.885812, 1.859577, -6.025621), (9.44698, 1.414214, -6.406158),
(9.815584, 0.736189, -6.656115), (9.931806, 0.0, -6.734927), (9.815584, -0.736189, -6.656115), (9.44698, -1.414214, -6.406158), (8.885812, -1.859577, -6.025621),
(8.276505, -2.0, -5.612439), (9.85312, 2.0, -1.707639), (10.578496, 1.859577, -1.833354), (11.246561, 1.414214, -1.949136), (11.685383, 0.736189, -2.025188),
(11.823744, 0.0, -2.049167), (11.685383, -0.736189, -2.025188), (11.246561, -1.414214, -1.949136), (10.578496, -1.859577, -1.833354), (9.85312, -2.0, -1.707639),
(9.682458, 2.0, 2.5), -- VRML: [# coord point 225
-- ]
(10.39527, 1.859577, 2.684047), (11.051764, 1.414214, 2.853553), (11.482985, 0.736189, 2.964894), (11.61895, 0.0, 3.0),
(11.482985, -0.736189, 2.964894), (11.051764, -1.414214, 2.853553), (10.39527, -1.859577, 2.684047), (9.682458, -2.0, 2.5), (-9.780878, 2.0, -2.08193),
(-8.027896, 2.0, -5.962624), (-6.610581, 2.0, -7.503347), (-4.903584, 2.0, -8.715209), (-2.935564, 2.0, -9.559418), (-0.832943, 2.0, -9.96525),
(3.29777, 2.0, -9.440589), (5.232184, 2.0, -8.521986), (6.926649, 2.0, -7.212595), (9.263618, 2.0, -3.766347), (9.990779, 2.0, 0.42936),
(9.990779, -2.0, 0.42936), (9.263618, -2.0, -3.766347), (6.926649, -2.0, -7.212595), (5.232184, -2.0, -8.521986), (3.29777, -2.0, -9.440589),
(-0.832943, -2.0, -9.96525), -- VRML: [# coord point 250
-- ]
(-2.935564, -2.0, -9.559418), (-4.903584, -2.0, -8.715209), (-6.610581, -2.0, -7.503347), (-8.027896, -2.0, -5.962624),
(-9.113341, -2.0, -4.116675), (-9.780878, -2.0, -2.08193), (9.682458, 2.0, 2.5), (10.39527, 1.859577, 2.684047), (11.051764, 1.414214, 2.853553),
(11.482985, 0.736189, 2.964894), (11.61895, 0.0, 3.0), (11.482985, -0.736189, 2.964894), (11.051764, -1.414214, 2.853553), (9.682458, -2.0, 2.5),
(2.904737, 2.0, 28.75), (4.274044, 1.414214, 29.103554), (4.705265, 0.736189, 29.214893), (4.841229, 0.0, 29.25), (4.705265, -0.736189, 29.214893),
(4.274044, -1.414214, 29.103554), (3.61755, -1.859577, 28.934048), (2.904737, -2.0, 28.75), (10.39527, -1.859577, 2.684047), (8.835243, 2.0, 5.78125),
(7.988028, 2.0, 9.0625), -- VRML: [# coord point 275
-- ]
(7.140813, 2.0, 12.34375), (6.293598, 2.0, 15.625), (5.446383, 2.0, 18.90625), (4.599168, 2.0, 22.1875),
(3.751953, 2.0, 25.46875), (3.61755, 1.859577, 28.934048), (3.751953, -2.0, 25.46875), (4.599168, -2.0, 22.1875), (5.446383, -2.0, 18.90625),
(6.293598, -2.0, 15.625), (7.140813, -2.0, 12.34375), (7.988028, -2.0, 9.0625), (8.835243, -2.0, 5.78125), (2.904737, 2.0, 28.75),
(3.61755, 1.859577, 28.934048), (4.274044, 1.414214, 29.103554), (4.705265, 0.736189, 29.214893), (4.841229, 0.0, 29.25), (4.274044, -1.414214, 29.103554),
(2.904737, -2.0, 28.75), (2.520814, 2.0, 29.626503), (3.139413, 1.859577, 30.025642), (3.709137, 1.414214, 30.393246), (4.083363, 0.736189, 30.634706),
(4.201357, 0.0, 30.71084), -- VRML: [# coord point 300
-- ]
(4.083363, -0.736189, 30.634706), (3.709137, -1.414214, 30.393246), (3.139413, -1.859577, 30.025642), (1.83712, 2.0, 30.371706),
(2.287942, 1.859577, 30.953714), (2.703146, 1.414214, 31.48974), (2.975875, 0.736189, 31.841829), (3.061866, 0.0, 31.952845), (2.975875, -0.736189, 31.841829),
(2.703146, -1.414214, 31.48974), (2.287942, -1.859577, 30.953714), (1.83712, -2.0, 30.371706), (0.944662, 2.0, 30.847389), (1.176479, 1.859577, 31.546127),
(1.38998, 1.414214, 32.189659), (1.530219, 0.736189, 32.612366), (1.574436, 0.0, 32.745647), (1.530219, -0.736189, 32.612366), (1.38998, -1.414214, 32.189659),
(1.176479, -1.859577, 31.546127), (0.944662, -2.0, 30.847389), (-0.0, 2.0, 31.0), (-0.0, 1.859577, 31.736189), (-0.0, 1.414214, 32.414215),
(-0.0, 0.736189, 32.859577), -- VRML: [# coord point 325
-- ]
(-0.0, 0.0, 33.0), (-0.0, -0.736189, 32.859577), (-0.0, -1.414214, 32.414215), (-0.0, -1.859577, 31.736189),
(-0.0, -2.0, 31.0), (-1.176466, 1.859577, 31.546131), (-1.389965, 1.414214, 32.189667), (-1.530202, 0.736189, 32.612373), (-1.574419, 0.0, 32.745655),
(-1.530202, -0.736189, 32.612373), (-1.389965, -1.414214, 32.189667), (-1.176466, -1.859577, 31.546131), (-2.287936, 1.859577, 30.95372), (-2.703139, 1.414214, 31.489744),
(-2.975867, 0.736189, 31.841835), (-3.061858, 0.0, 31.95285), (-2.975867, -0.736189, 31.841835), (-2.703139, -1.414214, 31.489744), (-2.287936, -1.859577, 30.95372),
(-2.520808, 2.0, 29.626513), (-3.139406, 1.859577, 30.025654), (-3.709129, 1.414214, 30.393259), (-4.083354, 0.736189, 30.634722), (-4.201347, 0.0, 30.710855),
(-4.083354, -0.736189, 30.634722), -- VRML: [# coord point 350
-- ]
(-3.709129, -1.414214, 30.393259), (-3.139406, -1.859577, 30.025654), (-2.520808, -2.0, 29.626513), (-2.904737, 2.0, 28.75),
(-3.61755, 1.859577, 28.934048), (-4.274044, 1.414214, 29.103554), (-4.841229, 0.0, 29.25), (-4.274044, -1.414214, 29.103554), (-3.61755, -1.859577, 28.934048),
(-2.904737, -2.0, 28.75), (3.61755, -1.859577, 28.934048), (4.705265, -0.736189, 29.214893), (-0.944652, 2.0, 30.847391), (-1.837115, 2.0, 30.37171),
(-4.705265, 0.736189, 29.214893), (-4.705265, -0.736189, 29.214893), (-1.837115, -2.0, 30.37171), (-0.944652, -2.0, 30.847391), (2.520814, -2.0, 29.626503),
(-2.904737, 2.0, 28.75), (-3.61755, 1.859577, 28.934048), (-4.274044, 1.414214, 29.103554), (-4.705265, 0.736189, 29.214893), (-4.841229, 0.0, 29.25),
(-4.705265, -0.736189, 29.214893), -- VRML: [# coord point 375
-- ]
(-4.274044, -1.414214, 29.103554), (-3.61755, -1.859577, 28.934048), (-2.904737, -2.0, 28.75), (-9.682458, 2.0, 2.5),
(-11.051764, 1.414214, 2.853553), (-11.482985, 0.736189, 2.964894), (-11.61895, 0.0, 3.0), (-11.482985, -0.736189, 2.964894), (-11.051764, -1.414214, 2.853553),
(-10.39527, -1.859577, 2.684047), (-9.682458, -2.0, 2.5), (-3.751953, 2.0, 25.46875), (-4.599168, 2.0, 22.1875), (-5.446383, 2.0, 18.90625),
(-6.293598, 2.0, 15.625), (-7.140813, 2.0, 12.34375), (-7.988028, 2.0, 9.0625), (-8.835243, 2.0, 5.78125), (-10.39527, 1.859577, 2.684047),
(-8.835243, -2.0, 5.78125), (-7.988028, -2.0, 9.0625), (-7.140813, -2.0, 12.34375), (-6.293598, -2.0, 15.625), (-5.446383, -2.0, 18.90625),
(-4.599168, -2.0, 22.1875), -- VRML: [# coord point 400
-- ]
(-3.751953, -2.0, 25.46875), (-9.682458, 2.0, 2.5), (-10.39527, 1.859577, 2.684047), (-11.051764, 1.414214, 2.853553),
(-11.482985, 0.736189, 2.964894), (-11.61895, 0.0, 3.0), (-11.482985, -0.736189, 2.964894), (-11.051764, -1.414214, 2.853553), (-9.682458, -2.0, 2.5),
(-10.0, 2.0, -0.0), (-10.73619, 1.859577, -0.0), (-11.414213, 1.414214, -0.0), (-11.859576, 0.736189, -0.0), (-12.0, 0.0, -0.0),
(-11.859576, -0.736189, -0.0), (-11.414213, -1.414214, -0.0), (-10.73619, -1.859577, -0.0), (-10.0, -2.0, -0.0), (-10.39527, -1.859577, 2.684047),
(-9.920285, 2.0, 1.260044), (-9.920285, -2.0, 1.260044), (-2.908902, 5.0, -0.733827), (-0.004168, 5.0, 0.016172), (2.900566, 5.0, 0.766171),
(-1.508332, 5.0, 5.841776), -- VRML: [# coord point 425
-- ]
(1.396402, 5.0, 6.591775), (5.809475, 5.0, 1.5), (5.876569, 5.0, -1.21076), (4.743416, 5.0, -3.674235),
(2.641459, 5.0, -5.387271), (-0.0, 5.0, -6.0), (-2.641456, 5.0, -5.387273), (-4.743427, 5.0, -3.674238), (-5.670346, 5.0, -1.961423),
(-6.0, 5.0, 0.0), (1.742843, 5.0, 17.25), (2.759501, 5.0, 13.3125), (3.776159, 5.0, 9.375), (4.792817, 5.0, 5.4375),
(-1.742843, 5.0, 17.25), (-1.512485, 5.0, 17.775908), (-1.102269, 5.0, 18.223026), (-0.566791, 5.0, 18.508434), (-0.0, 5.0, 18.6),
(0.566797, 5.0, 18.508432), (1.102272, 5.0, 18.223024), (1.512488, 5.0, 17.775902), (-5.809475, 5.0, 1.5), (-4.792817, 5.0, 5.4375),
(-3.776159, 5.0, 9.375), -- VRML: [# coord point 450
-- ]
(-2.759501, 5.0, 13.3125), (-6.0, 5.0, 0.0), (-7.394682, 4.052142, 0.0), (-7.93934, 2.43934, 0.0),
(-8.447858, 2.105318, 0.0), (-9.0, 2.0, 0.0), (-5.756274, 4.894682, -3.129836), (-6.203024, 4.56066, -3.372746), (-6.496474, 4.052142, -3.532302),
(-6.588999, 3.5, -3.582611), (-6.681524, 2.947858, -3.632919), (-6.974974, 2.43934, -3.792475), (-7.421723, 2.105318, -4.035385), (-4.154521, 4.894682, -5.066608),
(-4.476958, 4.56066, -5.459832), (-4.688752, 4.052142, -5.718123), (-4.75553, 3.5, -5.799563), (-4.822309, 2.947858, -5.881002), (-5.034103, 2.43934, -6.139294),
(-5.35654, 2.105318, -6.532518), (-1.461416, 4.894682, -6.387083), (-1.574838, 4.56066, -6.882791), (-1.64934, 4.052142, -7.208398), (-1.67283, 3.5, -7.311063),
(-1.696321, 2.947858, -7.413727), -- VRML: [# coord point 475
-- ]
(-1.770822, 2.43934, -7.739335), (-1.884244, 2.105318, -8.235043), (-2.007396, 2.0, -8.773275), (1.461391, 4.894682, -6.387089),
(1.574811, 4.56066, -6.882797), (1.649311, 4.052142, -7.208405), (1.672801, 3.5, -7.311069), (1.696291, 2.947858, -7.413734), (1.770792, 2.43934, -7.739342),
(1.884212, 2.105318, -8.23505), (2.007362, 2.0, -8.773284), (4.154501, 4.894682, -5.066625), (4.476936, 4.56066, -5.45985), (4.688729, 4.052142, -5.718142),
(4.755507, 3.5, -5.799582), (4.822286, 2.947858, -5.881021), (5.034079, 2.43934, -6.139313), (5.356514, 2.105318, -6.532539), (5.706609, 2.0, -6.959498),
(5.944353, 4.894682, -2.755946), (6.4057, 4.56066, -2.969838), (6.708737, 4.052142, -3.110333), (6.804286, 3.5, -3.154632), (6.899834, 2.947858, -3.19893),
(7.202871, 2.43934, -3.339426), -- VRML: [# coord point 500
-- ]
(7.664218, 2.105318, -3.553318), (8.165142, 2.0, -3.785558), (6.549621, 4.894682, 0.181761), (7.057943, 4.56066, 0.195867),
(7.391837, 4.052142, 0.205133), (7.497114, 3.5, 0.208055), (7.602391, 2.947858, 0.210976), (7.936285, 2.43934, 0.220242), (8.444608, 2.105318, 0.234349),
(8.996537, 2.0, 0.249666), (5.809475, 5.0, 1.5), (6.836455, 4.56066, 1.765165), (7.261844, 3.5, 1.875), (7.687233, 2.43934, 1.984835),
(8.179604, 2.105318, 2.111964), (8.714212, 2.0, 2.25), (-5.670346, 5.0, -1.961423), (-4.743427, 5.0, -3.674238), (-2.641456, 5.0, -5.387273),
(-0.0, 5.0, -6.0), (2.641459, 5.0, -5.387271), (4.743416, 5.0, -3.674235), (5.876569, 5.0, -1.21076), (6.344084, 4.894682, 1.638036),
(7.159871, 4.052142, 1.848671), -- VRML: [# coord point 525
-- ]
(7.363817, 2.947858, 1.901329), (-7.605318, 2.947858, 0.0), (-7.5, 3.5, 0.0), (-7.06066, 4.56066, 0.0),
(-6.552142, 4.894682, 0.0), (8.814853, 2.0, -1.81614), (7.115125, 2.0, -5.511352), (3.962188, 2.0, -8.080908), (-0.0, 2.0, -9.0),
(-3.962183, 2.0, -8.08091), (-5.706637, 2.0, -6.959476), (-7.11514, 2.0, -5.511357), (-7.906799, 2.0, -4.299133), (-8.505519, 2.0, -2.942135),
(-8.875903, 2.0, -1.489408), (5.809475, 5.0, 1.5), (7.363817, 2.947858, 1.901329), (7.687233, 2.43934, 1.984835), (8.179604, 2.105318, 2.111964),
(8.714212, 2.0, 2.25), (1.742843, 5.0, 17.25), (2.769822, 4.56066, 17.515165), (3.093238, 4.052142, 17.598671), (3.195211, 3.5, 17.625),
(3.297184, 2.947858, 17.651329), -- VRML: [# coord point 550
-- ]
(3.6206, 2.43934, 17.734835), (4.64758, 2.0, 18.0), (7.261844, 3.5, 1.875), (7.159871, 4.052142, 1.848671),
(6.836455, 4.56066, 1.765165), (6.344084, 4.894682, 1.638036), (4.792817, 5.0, 5.4375), (3.776159, 5.0, 9.375), (2.759501, 5.0, 13.3125),
(2.277452, 4.894682, 17.388035), (4.112971, 2.105318, 17.861965), (5.155909, 2.0, 16.03125), (5.664238, 2.0, 14.0625), (6.172567, 2.0, 12.09375),
(6.680896, 2.0, 10.125), (7.189225, 2.0, 8.15625), (7.697555, 2.0, 6.1875), (8.205883, 2.0, 4.21875), (1.742843, 5.0, 17.25),
(3.6206, 2.43934, 17.734835), (4.64758, 2.0, 18.0), (1.512488, 5.0, 17.775902), (1.976438, 4.894682, 18.075256), (2.403731, 4.56066, 18.350958),
(2.6844, 4.052142, 18.532055), -- VRML: [# coord point 575
-- ]
(2.772896, 3.5, 18.589153), (2.861391, 2.947858, 18.646254), (3.14206, 2.43934, 18.827351), (3.569354, 2.105318, 19.103052),
(4.033303, 2.0, 19.402407), (1.102272, 5.0, 18.223024), (1.440389, 4.894682, 18.659531), (1.751792, 4.56066, 19.061548), (1.956338, 4.052142, 19.325617),
(2.020832, 3.5, 19.408876), (2.085325, 2.947858, 19.492138), (2.289872, 2.43934, 19.756205), (2.601274, 2.105318, 20.158224), (2.939392, 2.0, 20.59473),
(0.74066, 4.894682, 19.032488), (0.900786, 4.56066, 19.515137), (1.005965, 4.052142, 19.832167), (1.039128, 3.5, 19.932127), (1.072291, 2.947858, 20.032087),
(1.177471, 2.43934, 20.349117), (1.337596, 2.105318, 20.831768), (-0.0, 5.0, 18.6), (-0.0, 4.894682, 19.152142), (-0.0, 4.56066, 19.66066),
(-0.0, 4.052142, 19.994682), -- VRML: [# coord point 600
-- ]
(-0.0, 3.5, 20.1), (-0.0, 2.947858, 20.205318), (-0.0, 2.43934, 20.539339), (-0.0, 2.105318, 21.047857),
(-0.0, 2.0, 21.6), (-0.566791, 5.0, 18.508434), (-0.740652, 4.894682, 19.03249), (-0.900776, 4.56066, 19.515141), (-1.005954, 4.052142, 19.83217),
(-1.039117, 3.5, 19.932131), (-1.07228, 2.947858, 20.032091), (-1.177458, 2.43934, 20.349121), (-1.337582, 2.105318, 20.831772), (-1.511443, 2.0, 21.355827),
(-1.440385, 4.894682, 18.659533), (-1.751787, 4.56066, 19.061552), (-1.956333, 4.052142, 19.325621), (-2.020826, 3.5, 19.40888), (-2.08532, 2.947858, 19.492142),
(-2.289865, 2.43934, 19.75621), (-2.601268, 2.105318, 20.15823), (-1.512485, 5.0, 17.775908), (-1.976433, 4.894682, 18.075264), (-2.403725, 4.56066, 18.350967),
(-2.684394, 4.052142, 18.532064), -- VRML: [# coord point 625
-- ]
(-2.772889, 3.5, 18.589165), (-2.861384, 2.947858, 18.646265), (-3.142053, 2.43934, 18.827362), (-3.569345, 2.105318, 19.103065),
(-4.033293, 2.0, 19.40242), (-1.742843, 5.0, 17.25), (-3.297184, 2.947858, 17.651329), (-4.64758, 2.0, 18.0), (4.112971, 2.105318, 17.861965),
(3.297184, 2.947858, 17.651329), (3.195211, 3.5, 17.625), (3.093238, 4.052142, 17.598671), (2.769822, 4.56066, 17.515165), (2.277452, 4.894682, 17.388035),
(0.566797, 5.0, 18.508432), (-1.102269, 5.0, 18.223026), (-2.277452, 4.894682, 17.388035), (-2.769822, 4.56066, 17.515165), (-3.093238, 4.052142, 17.598671),
(-3.195211, 3.5, 17.625), (-3.6206, 2.43934, 17.734835), (-4.112971, 2.105318, 17.861965), (-4.396681, 2.0, 18.725855), (-3.536783, 2.0, 20.044878),
(-2.939384, 2.0, 20.594736), -- VRML: [# coord point 650
-- ]
(-2.257642, 2.0, 21.035728), (-0.765503, 2.0, 21.538439), (0.76551, 2.0, 21.538435), (1.511459, 2.0, 21.355822),
(2.257656, 2.0, 21.035723), (3.536792, 2.0, 20.044868), (4.396687, 2.0, 18.725843), (-1.742843, 5.0, 17.25), (-3.093238, 4.052142, 17.598671),
(-3.6206, 2.43934, 17.734835), (-4.64758, 2.0, 18.0), (-5.809475, 5.0, 1.5), (-6.836455, 4.56066, 1.765165), (-7.159871, 4.052142, 1.848671),
(-7.261844, 3.5, 1.875), (-7.687233, 2.43934, 1.984835), (-8.179604, 2.105318, 2.111964), (-8.714212, 2.0, 2.25), (-4.112971, 2.105318, 17.861965),
(-3.297184, 2.947858, 17.651329), (-3.195211, 3.5, 17.625), (-2.769822, 4.56066, 17.515165), (-2.277452, 4.894682, 17.388035), (-2.759501, 5.0, 13.3125),
(-3.776159, 5.0, 9.375), -- VRML: [# coord point 675
-- ]
(-4.792817, 5.0, 5.4375), (-6.344084, 4.894682, 1.638036), (-7.363817, 2.947858, 1.901329), (-8.205883, 2.0, 4.21875),
(-7.697555, 2.0, 6.1875), (-7.189225, 2.0, 8.15625), (-6.680896, 2.0, 10.125), (-6.172567, 2.0, 12.09375), (-5.664238, 2.0, 14.0625),
(-5.155909, 2.0, 16.03125), (-5.809475, 5.0, 1.5), (-7.363817, 2.947858, 1.901329), (-8.714212, 2.0, 2.25), (-6.0, 5.0, 0.0),
(-7.06066, 4.56066, 0.0), (-7.5, 3.5, 0.0), (-7.605318, 2.947858, 0.0), (-9.0, 2.0, 0.0), (-6.552142, 4.894682, 0.0),
(-7.394682, 4.052142, 0.0), (-7.93934, 2.43934, 0.0), (-8.447858, 2.105318, 0.0), (-8.179604, 2.105318, 2.111964), (-7.687233, 2.43934, 1.984835),
(-7.261844, 3.5, 1.875), -- VRML: [# coord point 700
-- ]
(-7.159871, 4.052142, 1.848671), (-6.836455, 4.56066, 1.765165), (-6.344084, 4.894682, 1.638036), (-8.928257, 2.0, 1.134039) -- 705
);
-- VRML: [# 705 vertices
-- ]
-- begin Separator # 2
-- VRML: [#triangle mesh
-- ]
idx_2 : constant Idx_4_array_array :=
((4, 2, 1, 0), -- VRML: [# triangle 0
-- ]
(4, 1, 3, 0), (7, 4, 3, 0), (7, 3, 6, 0), (8, 5, 4, 0), (8, 4, 7, 0), (11, 7, 6, 0), (11, 6, 10, 0),
(12, 8, 7, 0), (12, 7, 11, 0), (13, 9, 8, 0), (13, 8, 12, 0), (16, 11, 10, 0), (16, 10, 15, 0), (17, 12, 11, 0), (17, 11, 16, 0),
(18, 13, 12, 0), (18, 12, 17, 0), (19, 14, 13, 0), (19, 13, 18, 0), (22, 16, 15, 0), (22, 15, 21, 0), (23, 17, 16, 0), (23, 16, 22, 0),
(24, 18, 17, 0), (24, 17, 23, 0), -- VRML: [# triangle 25
-- ]
(25, 19, 18, 0), (25, 18, 24, 0), (26, 20, 19, 0), (26, 19, 25, 0), (59, 57, 58, 0), (1, 57, 59, 0),
(1, 54, 55, 0), (55, 56, 1, 0), (57, 1, 56, 0), (1, 53, 54, 0), (1, 59, 60, 0), (1, 61, 3, 0), (6, 62, 63, 0), (3, 61, 62, 0),
(6, 3, 62, 0), (6, 64, 10, 0), (65, 10, 64, 0), (6, 63, 64, 0), (60, 61, 1, 0), (52, 53, 1, 0), (50, 51, 2, 0), (52, 2, 51, 0),
(1, 2, 52, 0), (49, 50, 2, 0), (4, 5, 49, 0), -- VRML: [# triangle 50
-- ]
(48, 49, 5, 0), (49, 2, 4, 0), (48, 8, 9, 0), (14, 46, 9, 0), (48, 9, 47, 0),
(46, 47, 9, 0), (45, 14, 44, 0), (45, 46, 14, 0), (9, 13, 14, 0), (8, 48, 5, 0), (10, 66, 15, 0), (15, 66, 67, 0), (27, 15, 68, 0),
(67, 68, 15, 0), (15, 27, 21, 0), (28, 21, 27, 0), (21, 29, 30, 0), (22, 21, 30, 0), (31, 22, 30, 0), (32, 23, 22, 0), (23, 32, 33, 0),
(32, 22, 31, 0), (24, 23, 33, 0), (28, 29, 21, 0), (14, 20, 44, 0), -- VRML: [# triangle 75
-- ]
(43, 44, 20, 0), (14, 19, 20, 0), (26, 39, 20, 0), (42, 43, 20, 0),
(41, 42, 20, 0), (40, 41, 20, 0), (40, 20, 39, 0), (35, 25, 24, 0), (24, 34, 35, 0), (34, 24, 33, 0), (36, 25, 35, 0), (39, 26, 38, 0),
(37, 38, 26, 0), (26, 36, 37, 0), (36, 26, 25, 0), (66, 10, 65, 0), (101, 100, 99, 0), (98, 101, 99, 0), (102, 101, 98, 0), (102, 141, 140, 0),
(97, 96, 142, 0), (102, 98, 97, 0), (96, 143, 142, 0), (142, 102, 97, 0), (142, 141, 102, 0), -- VRML: [# triangle 100
-- ]
(95, 143, 96, 0), (140, 103, 102, 0), (105, 104, 136, 0),
(106, 105, 159, 0), (159, 105, 160, 0), (158, 157, 106, 0), (107, 106, 157, 0), (159, 158, 106, 0), (139, 103, 140, 0), (138, 103, 139, 0), (104, 137, 136, 0),
(105, 136, 160, 0), (137, 104, 138, 0), (138, 104, 103, 0), (144, 95, 94, 0), (145, 144, 93, 0), (94, 93, 144, 0), (92, 145, 93, 0), (144, 143, 95, 0),
(148, 92, 91, 0), (145, 92, 146, 0), (146, 92, 147, 0), (91, 149, 148, 0), (92, 148, 147, 0), (150, 149, 91, 0), -- VRML: [# triangle 125
-- ]
(91, 90, 151, 0), (128, 151, 90, 0),
(150, 91, 151, 0), (89, 129, 90, 0), (90, 129, 128, 0), (130, 129, 89, 0), (88, 131, 89, 0), (130, 89, 131, 0), (132, 131, 88, 0), (87, 133, 132, 0),
(134, 133, 87, 0), (88, 87, 132, 0), (108, 107, 156, 0), (110, 109, 153, 0), (154, 109, 108, 0), (152, 69, 110, 0), (156, 155, 108, 0), (154, 108, 155, 0),
(110, 153, 152, 0), (69, 152, 127, 0), (153, 109, 154, 0), (127, 70, 69, 0), (71, 126, 125, 0), (127, 126, 70, 0), (70, 126, 71, 0), -- VRML: [# triangle 150
-- ]
(72, 71, 124, 0),
(125, 124, 71, 0), (123, 72, 124, 0), (73, 123, 122, 0), (74, 122, 121, 0), (121, 75, 74, 0), (73, 122, 74, 0), (73, 72, 123, 0), (75, 121, 120, 0),
(87, 86, 134, 0), (135, 134, 86, 0), (85, 111, 86, 0), (86, 111, 135, 0), (112, 111, 85, 0), (83, 113, 84, 0), (112, 85, 84, 0), (82, 114, 113, 0),
(113, 112, 84, 0), (81, 114, 82, 0), (83, 82, 113, 0), (77, 118, 78, 0), (119, 118, 77, 0), (117, 78, 118, 0), (119, 77, 76, 0), (75, 120, 76, 0),
-- VRML: [# triangle 175
-- ]
(120, 119, 76, 0), (80, 115, 81, 0), (114, 81, 115, 0), (116, 115, 80, 0), (79, 117, 116, 0), (78, 117, 79, 0), (80, 79, 116, 0), (107, 157, 156, 0),
(179, 172, 171, 0), (179, 171, 178, 0), (180, 173, 172, 0), (180, 172, 179, 0), (181, 174, 173, 0), (181, 173, 180, 0), (182, 175, 174, 0), (182, 174, 181, 0),
(183, 176, 175, 0), (183, 175, 182, 0), (184, 177, 176, 0), (184, 176, 183, 0), (186, 179, 178, 0), (186, 178, 185, 0), (187, 180, 179, 0), (187, 179, 186, 0),
(188, 181, 180, 0), -- VRML: [# triangle 200
-- ]
(188, 180, 187, 0), (189, 182, 181, 0), (189, 181, 188, 0), (190, 183, 182, 0), (190, 182, 189, 0), (191, 184, 183, 0), (191, 183, 190, 0),
(194, 186, 185, 0), (194, 185, 193, 0), (195, 187, 186, 0), (195, 186, 194, 0), (196, 188, 187, 0), (196, 187, 195, 0), (197, 189, 188, 0), (197, 188, 196, 0),
(198, 190, 189, 0), (198, 189, 197, 0), (199, 191, 190, 0), (199, 190, 198, 0), (202, 194, 193, 0), (202, 193, 201, 0), (203, 195, 194, 0), (203, 194, 202, 0),
(204, 196, 195, 0), (204, 195, 203, 0), -- VRML: [# triangle 225
-- ]
(205, 197, 196, 0), (205, 196, 204, 0), (206, 198, 197, 0), (206, 197, 205, 0), (207, 199, 198, 0), (207, 198, 206, 0),
(210, 202, 201, 0), (210, 201, 209, 0), (211, 203, 202, 0), (211, 202, 210, 0), (212, 204, 203, 0), (212, 203, 211, 0), (213, 205, 204, 0), (213, 204, 212, 0),
(214, 206, 205, 0), (214, 205, 213, 0), (215, 207, 206, 0), (215, 206, 214, 0), (219, 210, 209, 0), (219, 209, 218, 0), (220, 211, 210, 0), (220, 210, 219, 0),
(221, 212, 211, 0), (221, 211, 220, 0), (222, 213, 212, 0), -- VRML: [# triangle 250
-- ]
(222, 212, 221, 0), (223, 214, 213, 0), (223, 213, 222, 0), (224, 215, 214, 0), (224, 214, 223, 0),
(235, 162, 161, 0), (171, 162, 235, 0), (170, 171, 235, 0), (172, 164, 163, 0), (163, 171, 172, 0), (164, 172, 173, 0), (171, 163, 162, 0), (174, 164, 173, 0),
(171, 170, 236, 0), (178, 236, 237, 0), (185, 238, 239, 0), (178, 237, 238, 0), (185, 178, 238, 0), (193, 240, 192, 0), (241, 193, 192, 0), (185, 240, 193, 0),
(185, 239, 240, 0), (171, 236, 178, 0), (174, 166, 165, 0), (166, 174, 175, 0), -- VRML: [# triangle 275
-- ]
(174, 165, 164, 0), (167, 166, 175, 0), (176, 168, 167, 0), (168, 257, 169, 0),
(257, 177, 256, 0), (177, 257, 168, 0), (175, 176, 167, 0), (168, 176, 177, 0), (253, 184, 191, 0), (255, 177, 184, 0), (184, 254, 255, 0), (191, 252, 253, 0),
(191, 251, 252, 0), (253, 254, 184, 0), (199, 251, 191, 0), (256, 177, 255, 0), (201, 241, 242, 0), (209, 243, 208, 0), (201, 242, 243, 0), (209, 201, 243, 0),
(218, 244, 217, 0), (245, 218, 217, 0), (209, 244, 218, 0), (209, 208, 244, 0), (219, 218, 227, 0), -- VRML: [# triangle 300
-- ]
(245, 227, 218, 0), (245, 226, 227, 0), (228, 219, 227, 0),
(229, 221, 220, 0), (220, 228, 229, 0), (221, 229, 230, 0), (228, 220, 219, 0), (231, 221, 230, 0), (251, 199, 200, 0), (199, 250, 200, 0), (207, 250, 199, 0),
(215, 248, 207, 0), (207, 249, 250, 0), (215, 216, 248, 0), (215, 247, 216, 0), (248, 249, 207, 0), (247, 215, 224, 0), (231, 223, 222, 0), (223, 231, 232, 0),
(231, 222, 221, 0), (233, 223, 232, 0), (247, 224, 225, 0), (246, 225, 224, 0), (234, 246, 233, 0), (224, 233, 246, 0), -- VRML: [# triangle 325
-- ]
(233, 224, 223, 0), (241, 201, 193, 0),
(275, 259, 258, 0), (261, 260, 267, 0), (261, 267, 268, 0), (260, 259, 282, 0), (260, 282, 267, 0), (259, 275, 276, 0), (259, 277, 278, 0), (259, 276, 277, 0),
(262, 261, 268, 0), (262, 268, 269, 0), (264, 263, 270, 0), (264, 270, 271, 0), (286, 287, 274, 0), (274, 264, 271, 0), (274, 271, 272, 0), (274, 289, 265, 0),
(274, 287, 288, 0), (288, 289, 274, 0), (263, 262, 269, 0), (263, 269, 270, 0), (282, 259, 278, 0), (282, 279, 280, 0), (282, 281, 266, 0), -- VRML: [# triangle 350
-- ]
(282, 280, 281, 0),
(272, 285, 286, 0), (272, 283, 284, 0), (284, 285, 272, 0), (283, 272, 273, 0), (274, 272, 286, 0), (279, 282, 278, 0), (307, 299, 298, 0), (307, 298, 306, 0),
(308, 300, 299, 0), (308, 299, 307, 0), (309, 301, 300, 0), (309, 300, 308, 0), (310, 302, 301, 0), (310, 301, 309, 0), (311, 303, 302, 0), (311, 302, 310, 0),
(312, 304, 303, 0), (312, 303, 311, 0), (316, 307, 306, 0), (316, 306, 315, 0), (317, 308, 307, 0), (317, 307, 316, 0), (318, 309, 308, 0), (318, 308, 317, 0),
-- VRML: [# triangle 375
-- ]
(319, 310, 309, 0), (319, 309, 318, 0), (320, 311, 310, 0), (320, 310, 319, 0), (321, 312, 311, 0), (321, 311, 320, 0), (325, 316, 315, 0), (325, 315, 324, 0),
(326, 317, 316, 0), (326, 316, 325, 0), (327, 318, 317, 0), (327, 317, 326, 0), (328, 319, 318, 0), (328, 318, 327, 0), (329, 320, 319, 0), (329, 319, 328, 0),
(330, 321, 320, 0), (330, 320, 329, 0), (333, 325, 324, 0), (333, 324, 332, 0), (334, 326, 325, 0), (334, 325, 333, 0), (335, 327, 326, 0), (335, 326, 334, 0),
(336, 328, 327, 0), -- VRML: [# triangle 400
-- ]
(336, 327, 335, 0), (337, 329, 328, 0), (337, 328, 336, 0), (338, 330, 329, 0), (338, 329, 337, 0), (340, 333, 332, 0), (340, 332, 339, 0),
(341, 334, 333, 0), (341, 333, 340, 0), (342, 335, 334, 0), (342, 334, 341, 0), (343, 336, 335, 0), (343, 335, 342, 0), (344, 337, 336, 0), (344, 336, 343, 0),
(345, 338, 337, 0), (345, 337, 344, 0), (348, 340, 339, 0), (348, 339, 347, 0), (349, 341, 340, 0), (349, 340, 348, 0), (350, 342, 341, 0), (350, 341, 349, 0),
(351, 343, 342, 0), (351, 342, 350, 0), -- VRML: [# triangle 425
-- ]
(352, 344, 343, 0), (352, 343, 351, 0), (353, 345, 344, 0), (353, 344, 352, 0), (291, 290, 297, 0), (298, 291, 297, 0),
(299, 293, 292, 0), (292, 298, 299, 0), (298, 292, 291, 0), (300, 293, 299, 0), (298, 297, 305, 0), (315, 305, 314, 0), (324, 314, 323, 0), (314, 324, 315, 0),
(315, 306, 305, 0), (324, 323, 332, 0), (305, 306, 298, 0), (301, 293, 300, 0), (363, 294, 301, 0), (293, 301, 294, 0), (302, 363, 301, 0), (295, 303, 362, 0),
(295, 302, 303, 0), (296, 362, 304, 0), (302, 295, 363, 0), -- VRML: [# triangle 450
-- ]
(370, 304, 312, 0), (362, 303, 304, 0), (313, 370, 312, 0), (313, 321, 322, 0), (321, 330, 322, 0),
(313, 312, 321, 0), (296, 304, 370, 0), (339, 364, 365, 0), (347, 365, 346, 0), (364, 339, 332, 0), (356, 348, 347, 0), (347, 339, 365, 0), (347, 346, 355, 0),
(356, 357, 348, 0), (357, 366, 348, 0), (358, 350, 349, 0), (349, 366, 358, 0), (349, 348, 366, 0), (351, 350, 358, 0), (355, 356, 347, 0), (331, 330, 338, 0),
(369, 331, 338, 0), (369, 345, 368, 0), (345, 353, 368, 0), (369, 338, 345, 0), -- VRML: [# triangle 475
-- ]
(322, 330, 331, 0), (359, 352, 367, 0), (351, 367, 352, 0), (360, 352, 359, 0),
(368, 353, 354, 0), (360, 354, 353, 0), (354, 360, 361, 0), (360, 353, 352, 0), (367, 351, 358, 0), (364, 332, 323, 0), (388, 372, 371, 0), (374, 373, 381, 0),
(374, 381, 382, 0), (373, 372, 395, 0), (373, 395, 381, 0), (372, 388, 389, 0), (372, 390, 391, 0), (372, 389, 390, 0), (375, 374, 382, 0), (375, 382, 383, 0),
(377, 376, 384, 0), (377, 384, 385, 0), (399, 400, 378, 0), (378, 377, 385, 0), (378, 385, 386, 0), -- VRML: [# triangle 500
-- ]
(378, 402, 379, 0), (378, 400, 401, 0), (401, 402, 378, 0),
(376, 375, 383, 0), (376, 383, 384, 0), (395, 372, 391, 0), (395, 392, 393, 0), (395, 394, 380, 0), (395, 393, 394, 0), (386, 398, 399, 0), (386, 396, 397, 0),
(397, 398, 386, 0), (396, 386, 387, 0), (378, 386, 399, 0), (392, 395, 391, 0), (421, 404, 403, 0), (413, 406, 405, 0), (405, 404, 412, 0), (414, 407, 406, 0),
(407, 415, 408, 0), (409, 417, 420, 0), (420, 422, 410, 0), (416, 409, 408, 0), (412, 404, 421, 0), (412, 413, 405, 0), -- VRML: [# triangle 525
-- ]
(414, 415, 407, 0), (415, 416, 408, 0),
(413, 414, 406, 0), (420, 417, 418, 0), (417, 409, 416, 0), (420, 418, 422, 0), (422, 418, 419, 0), (411, 412, 421, 0), (426, 424, 423, 0), (427, 425, 424, 0),
(427, 424, 426, 0), (433, 423, 432, 0), (434, 423, 433, 0), (423, 435, 436, 0), (450, 426, 423, 0), (436, 449, 423, 0), (434, 435, 423, 0), (424, 432, 423, 0),
(430, 425, 429, 0), (429, 425, 428, 0), (425, 430, 431, 0), (428, 425, 440, 0), (425, 427, 440, 0), (431, 424, 425, 0), (424, 431, 432, 0), -- VRML: [# triangle 550
-- ]
(450, 423, 449, 0),
(426, 451, 452, 0), (450, 451, 426, 0), (427, 426, 452, 0), (441, 438, 452, 0), (441, 442, 443, 0), (427, 452, 438, 0), (443, 438, 441, 0), (445, 437, 438, 0),
(427, 438, 439, 0), (447, 448, 437, 0), (445, 446, 437, 0), (446, 447, 437, 0), (444, 445, 438, 0), (438, 443, 444, 0), (440, 427, 439, 0), (466, 459, 458, 0),
(466, 458, 465, 0), (467, 460, 459, 0), (467, 459, 466, 0), (468, 461, 460, 0), (468, 460, 467, 0), (469, 462, 461, 0), (469, 461, 468, 0), (470, 463, 462, 0),
-- VRML: [# triangle 575
-- ]
(470, 462, 469, 0), (471, 464, 463, 0), (471, 463, 470, 0), (473, 466, 465, 0), (473, 465, 472, 0), (474, 467, 466, 0), (474, 466, 473, 0), (475, 468, 467, 0),
(475, 467, 474, 0), (476, 469, 468, 0), (476, 468, 475, 0), (477, 470, 469, 0), (477, 469, 476, 0), (478, 471, 470, 0), (478, 470, 477, 0), (481, 473, 472, 0),
(481, 472, 480, 0), (482, 474, 473, 0), (482, 473, 481, 0), (483, 475, 474, 0), (483, 474, 482, 0), (484, 476, 475, 0), (484, 475, 483, 0), (485, 477, 476, 0),
(485, 476, 484, 0), -- VRML: [# triangle 600
-- ]
(486, 478, 477, 0), (486, 477, 485, 0), (489, 481, 480, 0), (489, 480, 488, 0), (490, 482, 481, 0), (490, 481, 489, 0), (491, 483, 482, 0),
(491, 482, 490, 0), (492, 484, 483, 0), (492, 483, 491, 0), (493, 485, 484, 0), (493, 484, 492, 0), (494, 486, 485, 0), (494, 485, 493, 0), (497, 489, 488, 0),
(497, 488, 496, 0), (498, 490, 489, 0), (498, 489, 497, 0), (499, 491, 490, 0), (499, 490, 498, 0), (500, 492, 491, 0), (500, 491, 499, 0), (501, 493, 492, 0),
(501, 492, 500, 0), (502, 494, 493, 0), -- VRML: [# triangle 625
-- ]
(502, 493, 501, 0), (505, 497, 496, 0), (505, 496, 504, 0), (506, 498, 497, 0), (506, 497, 505, 0), (507, 499, 498, 0),
(507, 498, 506, 0), (508, 500, 499, 0), (508, 499, 507, 0), (509, 501, 500, 0), (509, 500, 508, 0), (510, 502, 501, 0), (510, 501, 509, 0), (518, 531, 453, 0),
(531, 518, 458, 0), (519, 458, 518, 0), (530, 531, 458, 0), (530, 460, 454, 0), (530, 459, 460, 0), (529, 454, 460, 0), (459, 530, 458, 0), (520, 465, 519, 0),
(472, 465, 520, 0), (521, 472, 520, 0), (529, 460, 461, 0), -- VRML: [# triangle 650
-- ]
(529, 461, 462, 0), (519, 465, 458, 0), (528, 529, 462, 0), (463, 455, 528, 0), (464, 456, 463, 0),
(455, 463, 456, 0), (528, 462, 463, 0), (541, 457, 456, 0), (539, 540, 464, 0), (541, 464, 540, 0), (541, 456, 464, 0), (538, 539, 464, 0), (537, 538, 471, 0),
(538, 464, 471, 0), (478, 536, 471, 0), (471, 536, 537, 0), (478, 535, 479, 0), (479, 536, 478, 0), (486, 535, 478, 0), (521, 480, 472, 0), (522, 488, 480, 0),
(521, 522, 480, 0), (523, 488, 522, 0), (524, 496, 523, 0), (523, 496, 488, 0), -- VRML: [# triangle 675
-- ]
(525, 505, 504, 0), (504, 496, 524, 0), (504, 524, 512, 0), (525, 513, 505, 0),
(505, 526, 506, 0), (513, 526, 505, 0), (514, 507, 506, 0), (527, 508, 514, 0), (507, 514, 508, 0), (514, 506, 526, 0), (512, 525, 504, 0), (535, 486, 487, 0),
(486, 534, 487, 0), (494, 534, 486, 0), (502, 533, 494, 0), (494, 495, 534, 0), (502, 503, 533, 0), (533, 495, 494, 0), (503, 502, 532, 0), (502, 510, 532, 0),
(515, 510, 509, 0), (509, 527, 515, 0), (516, 510, 515, 0), (511, 532, 510, 0), (511, 516, 517, 0), -- VRML: [# triangle 700
-- ]
(511, 510, 516, 0), (508, 527, 509, 0), (558, 557, 542, 0),
(556, 557, 561, 0), (556, 561, 548, 0), (555, 556, 548, 0), (555, 548, 549, 0), (554, 555, 549, 0), (554, 549, 550, 0), (543, 554, 550, 0), (543, 550, 551, 0),
(558, 559, 557, 0), (545, 544, 552, 0), (545, 552, 562, 0), (566, 567, 545, 0), (545, 569, 546, 0), (545, 567, 568, 0), (568, 569, 545, 0), (544, 543, 551, 0),
(544, 551, 552, 0), (561, 557, 559, 0), (561, 560, 547, 0), (562, 565, 566, 0), (562, 564, 565, 0), (564, 562, 563, 0), -- VRML: [# triangle 725
-- ]
(562, 553, 563, 0), (562, 566, 545, 0),
(559, 560, 561, 0), (584, 575, 574, 0), (584, 574, 583, 0), (585, 576, 575, 0), (585, 575, 584, 0), (586, 577, 576, 0), (586, 576, 585, 0), (587, 578, 577, 0),
(587, 577, 586, 0), (588, 579, 578, 0), (588, 578, 587, 0), (589, 580, 579, 0), (589, 579, 588, 0), (592, 584, 583, 0), (592, 583, 591, 0), (593, 585, 584, 0),
(593, 584, 592, 0), (594, 586, 585, 0), (594, 585, 593, 0), (595, 587, 586, 0), (595, 586, 594, 0), (596, 588, 587, 0), (596, 587, 595, 0), -- VRML: [# triangle 750
-- ]
(597, 589, 588, 0),
(597, 588, 596, 0), (600, 592, 591, 0), (600, 591, 599, 0), (601, 593, 592, 0), (601, 592, 600, 0), (602, 594, 593, 0), (602, 593, 601, 0), (603, 595, 594, 0),
(603, 594, 602, 0), (604, 596, 595, 0), (604, 595, 603, 0), (605, 597, 596, 0), (605, 596, 604, 0), (609, 600, 599, 0), (609, 599, 608, 0), (610, 601, 600, 0),
(610, 600, 609, 0), (611, 602, 601, 0), (611, 601, 610, 0), (612, 603, 602, 0), (612, 602, 611, 0), (613, 604, 603, 0), (613, 603, 612, 0), (614, 605, 604, 0),
-- VRML: [# triangle 775
-- ]
(614, 604, 613, 0), (617, 609, 608, 0), (617, 608, 616, 0), (618, 610, 609, 0), (618, 609, 617, 0), (619, 611, 610, 0), (619, 610, 618, 0), (620, 612, 611, 0),
(620, 611, 619, 0), (621, 613, 612, 0), (621, 612, 620, 0), (622, 614, 613, 0), (622, 613, 621, 0), (625, 617, 616, 0), (625, 616, 624, 0), (626, 618, 617, 0),
(626, 617, 625, 0), (627, 619, 618, 0), (627, 618, 626, 0), (628, 620, 619, 0), (628, 619, 627, 0), (629, 621, 620, 0), (629, 620, 628, 0), (630, 622, 621, 0),
(630, 621, 629, 0), -- VRML: [# triangle 800
-- ]
(574, 640, 570, 0), (570, 573, 574, 0), (582, 574, 573, 0), (575, 640, 574, 0), (575, 638, 639, 0), (575, 576, 638, 0), (637, 638, 576, 0),
(575, 639, 640, 0), (582, 591, 583, 0), (641, 591, 582, 0), (598, 599, 641, 0), (637, 576, 577, 0), (641, 599, 591, 0), (599, 598, 607, 0), (582, 583, 574, 0),
(578, 637, 577, 0), (579, 571, 636, 0), (636, 578, 579, 0), (578, 636, 637, 0), (635, 571, 579, 0), (658, 572, 635, 0), (581, 658, 580, 0), (635, 580, 658, 0),
(580, 635, 579, 0), (657, 581, 580, 0), -- VRML: [# triangle 825
-- ]
(590, 657, 589, 0), (657, 580, 589, 0), (597, 656, 589, 0), (589, 656, 590, 0), (597, 654, 655, 0), (655, 656, 597, 0),
(605, 654, 597, 0), (642, 608, 607, 0), (616, 608, 642, 0), (623, 616, 642, 0), (623, 624, 616, 0), (645, 626, 625, 0), (625, 624, 644, 0), (624, 623, 643, 0),
(643, 644, 624, 0), (626, 645, 627, 0), (644, 645, 625, 0), (646, 628, 627, 0), (628, 646, 633, 0), (646, 627, 645, 0), (647, 628, 633, 0), (632, 643, 623, 0),
(654, 605, 606, 0), (605, 653, 606, 0), (614, 653, 605, 0), -- VRML: [# triangle 850
-- ]
(622, 652, 614, 0), (614, 615, 653, 0), (622, 651, 652, 0), (652, 615, 614, 0), (651, 622, 650, 0),
(622, 630, 650, 0), (647, 630, 629, 0), (630, 647, 648, 0), (647, 629, 628, 0), (649, 630, 648, 0), (630, 631, 650, 0), (648, 634, 649, 0), (649, 631, 630, 0),
(607, 608, 599, 0), (675, 674, 659, 0), (673, 674, 678, 0), (673, 678, 664, 0), (660, 673, 664, 0), (660, 664, 665, 0), (672, 660, 665, 0), (672, 665, 666, 0),
(671, 672, 666, 0), (671, 666, 679, 0), (675, 676, 674, 0), (670, 661, 667, 0), -- VRML: [# triangle 875
-- ]
(670, 667, 668, 0), (683, 684, 670, 0), (670, 686, 662, 0), (670, 684, 685, 0),
(685, 686, 670, 0), (661, 671, 679, 0), (661, 679, 667, 0), (678, 674, 676, 0), (678, 677, 663, 0), (668, 682, 683, 0), (668, 681, 682, 0), (681, 668, 680, 0),
(668, 669, 680, 0), (668, 683, 670, 0), (676, 677, 678, 0), (690, 704, 687, 0), (691, 702, 703, 0), (703, 704, 695, 0), (692, 688, 701, 0), (697, 699, 700, 0),
(705, 689, 699, 0), (700, 688, 693, 0), (701, 702, 696, 0), (695, 691, 703, 0), (696, 692, 701, 0), -- VRML: [# triangle 900
-- ]
(692, 693, 688, 0), (691, 696, 702, 0), (699, 697, 698, 0),
(697, 700, 693, 0), (699, 698, 705, 0), (705, 698, 694, 0), (690, 695, 704, 0) -- 908
);
-- VRML: [# 908 triangles
-- ]
-- last index now: 0
-- end Separator # 2
-- VRML: [#triangle mesh
-- ]
-- last index now: 0
-- end Separator # 2
-- VRML: [# triangle mesh
-- ]
procedure Create (
object : in out GLOBE_3D.p_Object_3D;
object_scale : GLOBE_3D.Real;
centre : GLOBE_3D.Point_3D
)
is
face_0 : Face_type; -- takes defaults values
begin
object :=
new Object_3D (Max_points => 705, Max_faces => 908);
object.all.Centre := centre;
Set_name (object.all, "insect_body");
face_0.skin := material_only;
face_0.material := VRML_Defaults;
-- Creating separator # 1
if Almost_zero (object_scale - 1.0) then
object.all.Point (1 .. 705) := coord_1;
else
for p in 1 .. 705 loop
object.all.Point (0 + p) := object_scale * coord_1 (p);
end loop;
end if;
face_0.material := matos_1;
-- Creating separator # 2
for f in 1 .. 908 loop
face_0.P := idx_2 (f);
object.all.face (0 + f) := face_0;
end loop;
end Create;
end Duck_P;
-- Converted by Wrl2Ada
|
--
-- Copyright 2022 (C) Nicolas Pinault (aka DrPi)
--
-- SPDX-License-Identifier: BSD-3-Clause
--
with Interfaces; use Interfaces;
package Uf2 is
MAGIC_START0 : constant := 16#0A324655#;
MAGIC_START1 : constant := 16#9E5D5157#;
MAGIC_END : constant := 16#0AB16F30#;
FLAG_NOT_MAIN_FLASH : constant := 16#00000001#;
FLAG_FILE_CONTAINER : constant := 16#00001000#;
FLAG_FAMILY_ID_PRESENT : constant := 16#00002000#;
FLAG_MD5_PRESENT : constant := 16#00004000#;
RP2040_FAMILY_ID : constant := 16#e48bff56#;
type Uf2_Block_Data_Array is array (Unsigned_32 range <>) of Unsigned_8;
type Uf2_Block is record
-- 32 byte header
Magic_Start0 : Unsigned_32;-- := MAGIC_START0;
Magic_Start1 : Unsigned_32;-- := MAGIC_START1;
Flags : Unsigned_32;
Target_Addr : Unsigned_32;
Payload_Size : Unsigned_32;
Block_No : Unsigned_32;
Num_Blocks : Unsigned_32;
File_Size : Unsigned_32; -- or familyID;
Data : Uf2_Block_Data_Array (1 .. 476);
Magic_End : Unsigned_32;-- := MAGIC_END;
end record
with Size => 512*8;
for Uf2_Block use record
Magic_Start0 at 0 range 0 .. 31;
Magic_Start1 at 4 range 0 .. 31;
Flags at 8 range 0 .. 31;
Target_Addr at 12 range 0 .. 31;
Payload_Size at 16 range 0 .. 31;
Block_No at 20 range 0 .. 31;
Num_Blocks at 24 range 0 .. 31;
File_Size at 28 range 0 .. 31;
Data at 32 range 0 .. 476*8-1;
Magic_End at 508 range 0 .. 31;
end record;
end Uf2; |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
-- A loop node is a structured activity node that represents a loop with
-- setup, test, and body sections.
------------------------------------------------------------------------------
limited with AMF.UML.Executable_Nodes.Collections;
limited with AMF.UML.Input_Pins.Collections;
limited with AMF.UML.Output_Pins.Collections;
with AMF.UML.Structured_Activity_Nodes;
package AMF.UML.Loop_Nodes is
pragma Preelaborate;
type UML_Loop_Node is limited interface
and AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node;
type UML_Loop_Node_Access is
access all UML_Loop_Node'Class;
for UML_Loop_Node_Access'Storage_Size use 0;
not overriding function Get_Body_Output
(Self : not null access constant UML_Loop_Node)
return AMF.UML.Output_Pins.Collections.Ordered_Set_Of_UML_Output_Pin is abstract;
-- Getter of LoopNode::bodyOutput.
--
-- A list of output pins within the body fragment the values of which are
-- moved to the loop variable pins after completion of execution of the
-- body, before the next iteration of the loop begins or before the loop
-- exits.
not overriding function Get_Body_Part
(Self : not null access constant UML_Loop_Node)
return AMF.UML.Executable_Nodes.Collections.Set_Of_UML_Executable_Node is abstract;
-- Getter of LoopNode::bodyPart.
--
-- The set of nodes and edges that perform the repetitive computations of
-- the loop. The body section is executed as long as the test section
-- produces a true value.
not overriding function Get_Decider
(Self : not null access constant UML_Loop_Node)
return AMF.UML.Output_Pins.UML_Output_Pin_Access is abstract;
-- Getter of LoopNode::decider.
--
-- An output pin within the test fragment the value of which is examined
-- after execution of the test to determine whether to execute the loop
-- body.
not overriding procedure Set_Decider
(Self : not null access UML_Loop_Node;
To : AMF.UML.Output_Pins.UML_Output_Pin_Access) is abstract;
-- Setter of LoopNode::decider.
--
-- An output pin within the test fragment the value of which is examined
-- after execution of the test to determine whether to execute the loop
-- body.
not overriding function Get_Is_Tested_First
(Self : not null access constant UML_Loop_Node)
return Boolean is abstract;
-- Getter of LoopNode::isTestedFirst.
--
-- If true, the test is performed before the first execution of the body.
-- If false, the body is executed once before the test is performed.
not overriding procedure Set_Is_Tested_First
(Self : not null access UML_Loop_Node;
To : Boolean) is abstract;
-- Setter of LoopNode::isTestedFirst.
--
-- If true, the test is performed before the first execution of the body.
-- If false, the body is executed once before the test is performed.
not overriding function Get_Loop_Variable
(Self : not null access constant UML_Loop_Node)
return AMF.UML.Output_Pins.Collections.Ordered_Set_Of_UML_Output_Pin is abstract;
-- Getter of LoopNode::loopVariable.
--
-- A list of output pins that hold the values of the loop variables during
-- an execution of the loop. When the test fails, the values are movied to
-- the result pins of the loop.
not overriding function Get_Loop_Variable_Input
(Self : not null access constant UML_Loop_Node)
return AMF.UML.Input_Pins.Collections.Ordered_Set_Of_UML_Input_Pin is abstract;
-- Getter of LoopNode::loopVariableInput.
--
-- A list of values that are moved into the loop variable pins before the
-- first iteration of the loop.
not overriding function Get_Result
(Self : not null access constant UML_Loop_Node)
return AMF.UML.Output_Pins.Collections.Ordered_Set_Of_UML_Output_Pin is abstract;
-- Getter of LoopNode::result.
--
-- A list of output pins that constitute the data flow output of the
-- entire loop.
not overriding function Get_Setup_Part
(Self : not null access constant UML_Loop_Node)
return AMF.UML.Executable_Nodes.Collections.Set_Of_UML_Executable_Node is abstract;
-- Getter of LoopNode::setupPart.
--
-- The set of nodes and edges that initialize values or perform other
-- setup computations for the loop.
not overriding function Get_Test
(Self : not null access constant UML_Loop_Node)
return AMF.UML.Executable_Nodes.Collections.Set_Of_UML_Executable_Node is abstract;
-- Getter of LoopNode::test.
--
-- The set of nodes, edges, and designated value that compute a Boolean
-- value to determine if another execution of the body will be performed.
end AMF.UML.Loop_Nodes;
|
with Ada.Containers.Indefinite_Hashed_Maps,
Ada.Containers.Indefinite_Hashed_Sets,
Ada.Containers.Indefinite_Vectors,
Ada.Containers.Synchronized_Queue_Interfaces,
Ada.Containers.Unbounded_Synchronized_Queues,
Ada.Execution_Time,
Ada.Integer_Text_IO,
Ada.Real_Time,
Ada.Strings.Fixed,
Ada.Strings.Hash,
Ada.Strings.Unbounded,
Ada.Text_IO;
with Utils;
procedure Main is
use Ada.Execution_Time,
Ada.Real_Time,
Ada.Strings.Unbounded,
Ada.Text_IO;
use Utils;
subtype Big_Cave_Character is Character range 'A' .. 'Z';
subtype Small_Cave_Character is Character range 'a' .. 'z';
package Cave_Vectors is new Ada.Containers.Indefinite_Vectors (Index_Type => Positive,
Element_Type => String,
"=" => "=");
use Cave_Vectors;
type Cave_Kind is (K_Start, K_Big, K_Small, K_End);
Start_Name : constant String := "start";
End_Name : constant String := "end";
-- Given the name of a node, it retreive the corresponding kind
function Get_Kind (Name : String) return Cave_Kind;
--------------
-- Get_Kind --
--------------
function Get_Kind (Name : String) return Cave_Kind is
begin
if Name = Start_Name then
return K_Start;
elsif Name = End_Name then
return K_End;
elsif Name (Name'First) in Big_Cave_Character then
return K_Big;
elsif Name (Name'First) in Small_Cave_Character then
return K_Small;
end if;
raise Constraint_Error with "Unexpected cave name: " & Name;
end Get_Kind;
type Cave_Info (Length : Positive) is record
Name : String (1 .. Length);
Kind : Cave_Kind;
Adjacent : Vector;
end record;
package Cave_Maps is new Ada.Containers.Indefinite_Hashed_Maps
(Key_Type => String,
Element_Type => Cave_Info,
Hash => Ada.Strings.Hash,
Equivalent_Keys => "=");
package String_Sets is new Ada.Containers.Indefinite_Hashed_Sets (Element_Type => String,
Hash => Ada.Strings.Hash,
Equivalent_Elements => "=",
"=" => "=");
type Cave_Explorer is record
Name : Unbounded_String;
Already_Visited_Small_Cave_Name : Unbounded_String;
Already_Visited_Small_Cave : String_Sets.Set;
end record;
package Explored_Cave_Interfaces is
new Ada.Containers.Synchronized_Queue_Interfaces
(Element_Type => Cave_Explorer);
package Explored_Cave_Queue is new Ada.Containers.Unbounded_Synchronized_Queues
(Queue_Interfaces => Explored_Cave_Interfaces);
File : File_Type;
Start_Time, End_Time : CPU_Time;
Execution_Duration : Time_Span;
File_Is_Empty : Boolean := True;
Result : Natural := Natural'First;
Nodes : Cave_Maps.Map := Cave_Maps.Empty_Map;
begin
Get_File (File);
-- Get all values
begin
while not End_Of_File (File) loop
declare
Str : constant String := Get_Line (File);
Separator_Index : constant Integer :=
Ada.Strings.Fixed.Index (Source => Str (1 .. Str'Last), Pattern => "-");
Node_1 : constant String := Str (1 .. Separator_Index - 1);
Node_2 : constant String := Str (Separator_Index + 1 .. Str'Last);
begin
declare
Cave_Node_1 : Cave_Info := (Length => Node_1'Length,
Name => Node_1,
Kind => Get_Kind (Node_1),
Adjacent => Empty_Vector);
Cave_Node_2 : Cave_Info := (Length => Node_2'Length,
Name => Node_2,
Kind => Get_Kind (Node_2),
Adjacent => Empty_Vector);
begin
if Nodes.Contains (Node_1) then
Cave_Node_1 := Nodes.Element (Node_1);
end if;
if Nodes.Contains (Node_2) then
Cave_Node_2 := Nodes.Element (Node_2);
end if;
Cave_Node_1.Adjacent.Append (Node_2);
Cave_Node_2.Adjacent.Append (Node_1);
Nodes.Include (Node_1, Cave_Node_1);
Nodes.Include (Node_2, Cave_Node_2);
end;
File_Is_Empty := False;
end;
end loop;
end;
-- Exit the program if there is no values
if File_Is_Empty then
Close_If_Open (File);
Put_Line ("The input file is empty.");
return;
end if;
-- Do the puzzle
Start_Time := Ada.Execution_Time.Clock;
Solve_Puzzle : declare
use Ada.Containers, Explored_Cave_Queue;
Current_Cave : Cave_Explorer;
Cave_Explorer_Queue : Explored_Cave_Queue.Queue;
begin
Current_Cave.Name := To_Unbounded_String (Start_Name);
Current_Cave.Already_Visited_Small_Cave_Name := Null_Unbounded_String;
Current_Cave.Already_Visited_Small_Cave.Include (Start_Name);
Cave_Explorer_Queue.Enqueue (Current_Cave);
while Cave_Explorer_Queue.Current_Use > 0 loop
Cave_Explorer_Queue.Dequeue (Current_Cave);
if Nodes.Element (To_String (Current_Cave.Name)).Kind = K_End then
Result := Result + 1;
goto Continue;
end if;
-- Get all adjacent nodes (cave) to explore them
for Node of Nodes.Element (To_String (Current_Cave.Name)).Adjacent loop
if not Current_Cave.Already_Visited_Small_Cave.Contains (Node) then
declare
Next_Already_Visited_Small_Cave : String_Sets.Set :=
String_Sets.Copy (Current_Cave.Already_Visited_Small_Cave);
begin
if Get_Kind (Node) = K_Small then
Next_Already_Visited_Small_Cave.Include (Node);
end if;
Cave_Explorer_Queue.Enqueue
((Name => To_Unbounded_String (Node),
Already_Visited_Small_Cave_Name => Current_Cave.Already_Visited_Small_Cave_Name,
Already_Visited_Small_Cave => Next_Already_Visited_Small_Cave));
end;
elsif Current_Cave.Already_Visited_Small_Cave_Name = Null_Unbounded_String
and Get_Kind (Node) = K_Small
then
Cave_Explorer_Queue.Enqueue
((Name => To_Unbounded_String (Node),
Already_Visited_Small_Cave_Name => To_Unbounded_String (Node),
Already_Visited_Small_Cave => Current_Cave.Already_Visited_Small_Cave));
end if;
end loop;
<<Continue>>
end loop;
end Solve_Puzzle;
End_Time := Ada.Execution_Time.Clock;
Execution_Duration := End_Time - Start_Time;
Put ("Result: ");
Ada.Integer_Text_IO.Put (Item => Result,
Width => 0);
New_Line;
Put_Line ("(Took " & Duration'Image (To_Duration (Execution_Duration) * 1_000_000) & "µs)");
exception
when others =>
Close_If_Open (File);
raise;
end Main;
|
-- The Village of Vampire by YT, このソースコードはNYSLです
with Ada.Calendar;
with Ada.Characters.Latin_1;
with Ada.Directories;
with Ada.IO_Exceptions;
with Ada.Streams.Stream_IO.Standard_Files;
with Web;
with Tabula.Debug;
procedure Tabula.Unlock (
Lock_Name : in not null Static_String_Access;
Debug_Log_File_Name : in not null Static_String_Access)
is
Now : constant Ada.Calendar.Time := Ada.Calendar.Clock;
Output : not null Ada.Streams.Stream_IO.Stream_Access :=
Ada.Streams.Stream_IO.Stream (
Ada.Streams.Stream_IO.Standard_Files.Standard_Output.all);
Count : Natural := 0;
begin
Debug.Hook (Debug_Log_File_Name, Now);
Deleting : loop
begin
Ada.Directories.Delete_Tree (Lock_Name.all);
delay 0.1;
Count := Count + 1;
exception
when Ada.IO_Exceptions.Name_Error => exit Deleting;
end;
end loop Deleting;
declare
Message : constant String := Natural'Image (Count) & " OK.";
begin
Ada.Debug.Put (Message);
Web.Header_Content_Type (Output, Web.Text_Plain);
Web.Header_Break (Output);
String'Write (Output, Message);
Character'Write (Output, Ada.Characters.Latin_1.LF);
end;
end Tabula.Unlock;
|
-- Spécification du module Piles.
generic
type T_Element is private; -- Type des éléments de la pile
package Piles is
type T_Pile is limited private;
-- Initilaiser une pile. La pile est vide.
procedure Initialiser (Pile : out T_Pile) with
Post => Est_Vide (Pile);
-- Est-ce que la pile est vide ?
function Est_Vide (Pile : in T_Pile) return Boolean;
-- L'élément en sommet de la pile.
function Sommet (Pile : in T_Pile) return T_Element with
Pre => not Est_Vide (Pile);
-- Empiler l'élément en somment de la pile.
-- Exception : Storage_Exception s'il n'y a plus de mémoire.
procedure Empiler (Pile : in out T_Pile; Element : in T_Element) with
Post => Sommet (Pile) = Element;
-- Supprimer l'élément en sommet de pile
procedure Depiler (Pile : in out T_Pile) with
Pre => not Est_Vide (Pile);
-- Détruire la pile.
-- Elle ne doit plus être utilisée sauf à être de nouveau initialisée.
procedure Detruire (P: in out T_Pile);
-- Afficher les éléments de la pile
generic
with procedure Afficher_Element (Un_Element: in T_Element);
procedure Afficher (Pile : in T_Pile);
private
type T_Cellule;
type T_Pile is access T_Cellule;
type T_Cellule is
record
Element: T_Element;
Suivant: T_Pile;
end record;
end Piles;
|
-----------------------------------------------------------------------
-- events-tests -- Unit tests for AWA events
-- Copyright (C) 2012 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Tests;
with AWA.Tests;
package AWA.Events.Services.Tests is
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite);
type Test is new AWA.Tests.Test with null record;
-- Test searching an event name in the definition list.
procedure Test_Find_Event (T : in out Test);
-- Test the Get_Event_Type_Name internal operation.
procedure Test_Get_Event_Name (T : in out Test);
-- Test creation and initialization of event manager.
procedure Test_Initialize (T : in out Test);
-- Test adding an action.
procedure Test_Add_Action (T : in out Test);
-- Test dispatching synchronous event to a global bean.
procedure Test_Dispatch_Synchronous (T : in out Test);
-- Test dispatching event through a fifo queue.
procedure Test_Dispatch_Fifo (T : in out Test);
-- Test dispatching event through a database queue.
procedure Test_Dispatch_Persist (T : in out Test);
-- Test dispatching synchronous event to a dynamic bean (created on demand).
procedure Test_Dispatch_Synchronous_Dyn (T : in out Test);
-- Test dispatching synchronous event to a dynamic bean and raise an exception in the action.
procedure Test_Dispatch_Synchronous_Raise (T : in out Test);
procedure Dispatch_Event (T : in out Test;
Kind : in Event_Index;
Expect_Count : in Natural;
Expect_Prio : in Natural);
end AWA.Events.Services.Tests;
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE boost_serialization>
<boost_serialization signature="serialization::archive" version="15">
<syndb class_id="0" tracking_level="0" version="0">
<userIPLatency>-1</userIPLatency>
<userIPName></userIPName>
<cdfg class_id="1" tracking_level="1" version="0" object_id="_0">
<name>Tema1Func</name>
<ret_bitwidth>0</ret_bitwidth>
<ports class_id="2" tracking_level="0" version="0">
<count>7</count>
<item_version>0</item_version>
<item class_id="3" tracking_level="1" version="0" object_id="_1">
<Value class_id="4" tracking_level="0" version="0">
<Obj class_id="5" tracking_level="0" version="0">
<type>1</type>
<id>1</id>
<name>E</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<contextNormFuncName></contextNormFuncName>
<inlineStackInfo class_id="6" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>E</originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>4294967292</coreId>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs class_id="7" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_2">
<Value>
<Obj>
<type>1</type>
<id>2</id>
<name>S</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<contextNormFuncName></contextNormFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>S</originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>25</coreId>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_3">
<Value>
<Obj>
<type>1</type>
<id>3</id>
<name>V</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<contextNormFuncName></contextNormFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>V</originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>4</coreId>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_4">
<Value>
<Obj>
<type>1</type>
<id>4</id>
<name>N</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<contextNormFuncName></contextNormFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>N</originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>585</coreId>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_5">
<Value>
<Obj>
<type>1</type>
<id>5</id>
<name>rule</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<contextNormFuncName></contextNormFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>rule</originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>763721081</coreId>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_6">
<Value>
<Obj>
<type>1</type>
<id>6</id>
<name>EW</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<contextNormFuncName></contextNormFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>EW</originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>1021029246</coreId>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_7">
<Value>
<Obj>
<type>1</type>
<id>7</id>
<name>NS</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<contextNormFuncName></contextNormFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>NS</originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>539107436</coreId>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
</ports>
<nodes class_id="8" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="9" tracking_level="1" version="0" object_id="_8">
<Value>
<Obj>
<type>0</type>
<id>24</id>
<name>_ln12</name>
<fileName>Tema1CN/tema1Curs.cpp</fileName>
<fileDirectory>C:\Users\Catalin\Desktop\CN2CURS</fileDirectory>
<lineNumber>12</lineNumber>
<contextFuncName>Tema1Func</contextFuncName>
<contextNormFuncName>Tema1Func</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item class_id="10" tracking_level="0" version="0">
<first>C:\Users\Catalin\Desktop\CN2CURS</first>
<second class_id="11" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="12" tracking_level="0" version="0">
<first class_id="13" tracking_level="0" version="0">
<first>Tema1CN/tema1Curs.cpp</first>
<second>Tema1Func</second>
</first>
<second>12</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>540684654</coreId>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>0</count>
<item_version>0</item_version>
</oprand_edges>
<opcode>ret</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>1</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
</nodes>
<consts class_id="15" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</consts>
<blocks class_id="16" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="17" tracking_level="1" version="0" object_id="_9">
<Obj>
<type>3</type>
<id>25</id>
<name>Tema1Func</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<contextNormFuncName></contextNormFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>1815806096</coreId>
</Obj>
<node_objs>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</node_objs>
</item>
</blocks>
<edges class_id="18" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</edges>
</cdfg>
<cdfg_regions class_id="19" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="20" tracking_level="1" version="0" object_id="_10">
<mId>1</mId>
<mTag>Tema1Func</mTag>
<mNormTag>Tema1Func</mNormTag>
<mType>0</mType>
<sub_regions>
<count>0</count>
<item_version>0</item_version>
</sub_regions>
<basic_blocks>
<count>1</count>
<item_version>0</item_version>
<item>25</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>0</mMinLatency>
<mMaxLatency>0</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
</cdfg_regions>
<fsm class_id="22" tracking_level="1" version="0" object_id="_11">
<states class_id="23" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="24" tracking_level="1" version="0" object_id="_12">
<id>1</id>
<operations class_id="25" tracking_level="0" version="0">
<count>17</count>
<item_version>0</item_version>
<item class_id="26" tracking_level="1" version="0" object_id="_13">
<id>8</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="26" object_id="_14">
<id>9</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="26" object_id="_15">
<id>10</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="26" object_id="_16">
<id>11</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="26" object_id="_17">
<id>12</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="26" object_id="_18">
<id>13</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="26" object_id="_19">
<id>14</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="26" object_id="_20">
<id>15</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="26" object_id="_21">
<id>16</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="26" object_id="_22">
<id>17</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="26" object_id="_23">
<id>18</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="26" object_id="_24">
<id>19</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="26" object_id="_25">
<id>20</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="26" object_id="_26">
<id>21</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="26" object_id="_27">
<id>22</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="26" object_id="_28">
<id>23</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="26" object_id="_29">
<id>24</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
</states>
<transitions class_id="27" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</transitions>
</fsm>
<res class_id="-1"></res>
<node_label_latency class_id="29" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="30" tracking_level="0" version="0">
<first>24</first>
<second class_id="31" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
</node_label_latency>
<bblk_ent_exit class_id="32" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="33" tracking_level="0" version="0">
<first>25</first>
<second class_id="34" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
</bblk_ent_exit>
<regions class_id="35" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</regions>
<dp_fu_nodes class_id="36" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes>
<dp_fu_nodes_expression class_id="37" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_expression>
<dp_fu_nodes_module>
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_module>
<dp_fu_nodes_io>
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_io>
<return_ports>
<count>0</count>
<item_version>0</item_version>
</return_ports>
<dp_mem_port_nodes class_id="38" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_mem_port_nodes>
<dp_reg_nodes>
<count>0</count>
<item_version>0</item_version>
</dp_reg_nodes>
<dp_regname_nodes>
<count>0</count>
<item_version>0</item_version>
</dp_regname_nodes>
<dp_reg_phi>
<count>0</count>
<item_version>0</item_version>
</dp_reg_phi>
<dp_regname_phi>
<count>0</count>
<item_version>0</item_version>
</dp_regname_phi>
<dp_port_io_nodes class_id="39" tracking_level="0" version="0">
<count>7</count>
<item_version>0</item_version>
<item class_id="40" tracking_level="0" version="0">
<first>E</first>
<second>
<count>0</count>
<item_version>0</item_version>
</second>
</item>
<item>
<first>EW</first>
<second>
<count>0</count>
<item_version>0</item_version>
</second>
</item>
<item>
<first>N</first>
<second>
<count>0</count>
<item_version>0</item_version>
</second>
</item>
<item>
<first>NS</first>
<second>
<count>0</count>
<item_version>0</item_version>
</second>
</item>
<item>
<first>S</first>
<second>
<count>0</count>
<item_version>0</item_version>
</second>
</item>
<item>
<first>V</first>
<second>
<count>0</count>
<item_version>0</item_version>
</second>
</item>
<item>
<first>rule</first>
<second>
<count>0</count>
<item_version>0</item_version>
</second>
</item>
</dp_port_io_nodes>
<port2core>
<count>0</count>
<item_version>0</item_version>
</port2core>
<node2core>
<count>0</count>
<item_version>0</item_version>
</node2core>
</syndb>
</boost_serialization>
|
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2016, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with nRF51.GPIO; use nRF51.GPIO;
with nRF51.RTC; use nRF51.RTC;
with NRF51_SVD.RTC;
with nRF51.TWI; use nRF51.TWI;
with NRF51_SVD.TWI;
with nRF51.Timers; use nRF51.Timers;
with NRF51_SVD.TIMER;
package nRF51.Device is
P00 : aliased GPIO_Point := (Pin => 00);
P01 : aliased GPIO_Point := (Pin => 01);
P02 : aliased GPIO_Point := (Pin => 02);
P03 : aliased GPIO_Point := (Pin => 03);
P04 : aliased GPIO_Point := (Pin => 04);
P05 : aliased GPIO_Point := (Pin => 05);
P06 : aliased GPIO_Point := (Pin => 06);
P07 : aliased GPIO_Point := (Pin => 07);
P08 : aliased GPIO_Point := (Pin => 08);
P09 : aliased GPIO_Point := (Pin => 09);
P10 : aliased GPIO_Point := (Pin => 10);
P11 : aliased GPIO_Point := (Pin => 11);
P12 : aliased GPIO_Point := (Pin => 12);
P13 : aliased GPIO_Point := (Pin => 13);
P14 : aliased GPIO_Point := (Pin => 14);
P15 : aliased GPIO_Point := (Pin => 15);
P16 : aliased GPIO_Point := (Pin => 16);
P17 : aliased GPIO_Point := (Pin => 17);
P18 : aliased GPIO_Point := (Pin => 18);
P19 : aliased GPIO_Point := (Pin => 19);
P20 : aliased GPIO_Point := (Pin => 20);
P21 : aliased GPIO_Point := (Pin => 21);
P22 : aliased GPIO_Point := (Pin => 22);
P23 : aliased GPIO_Point := (Pin => 23);
P24 : aliased GPIO_Point := (Pin => 24);
P25 : aliased GPIO_Point := (Pin => 25);
P26 : aliased GPIO_Point := (Pin => 26);
P27 : aliased GPIO_Point := (Pin => 27);
P28 : aliased GPIO_Point := (Pin => 28);
P29 : aliased GPIO_Point := (Pin => 29);
P30 : aliased GPIO_Point := (Pin => 30);
P31 : aliased GPIO_Point := (Pin => 31);
RTC_0 : aliased Real_Time_Counter (NRF51_SVD.RTC.RTC0_Periph'Access);
RTC_1 : aliased Real_Time_Counter (NRF51_SVD.RTC.RTC1_Periph'Access);
TWI_0 : aliased TWI_Master (NRF51_SVD.TWI.TWI0_Periph'Access);
TWI_1 : aliased TWI_Master (NRF51_SVD.TWI.TWI1_Periph'Access);
Timer_0 : aliased Timer (NRF51_SVD.TIMER.TIMER0_Periph'Access);
Timer_1 : aliased Timer (NRF51_SVD.TIMER.TIMER1_Periph'Access);
Timer_2 : aliased Timer (NRF51_SVD.TIMER.TIMER2_Periph'Access);
end nRF51.Device;
|
------------------------------------------------------------------------------
-- --
-- GNAT EXAMPLE --
-- --
-- Copyright (C) 2013, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
procedure Testfpu (Arg : access Float);
|
-- Copyright 2012-2015 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with Pck; use Pck;
procedure Foo is
begin
Do_Something (My_Global_Variable);
end Foo;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . R A N D O M _ N U M B E R S --
-- --
-- B o d y --
-- --
-- Copyright (C) 2007-2020, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- --
-- The implementation here is derived from a C-program for MT19937, with --
-- initialization improved 2002/1/26. As required, the following notice is --
-- copied from the original program. --
-- --
-- Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution.--
-- --
-- 3. The names of its contributors may not be used to endorse or promote --
-- products derived from this software without specific prior written --
-- permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- --
-- This is an implementation of the Mersenne Twister, twisted generalized --
-- feedback shift register of rational normal form, with state-bit --
-- reflection and tempering. This version generates 32-bit integers with a --
-- period of 2**19937 - 1 (a Mersenne prime, hence the name). For --
-- applications requiring more than 32 bits (up to 64), we concatenate two --
-- 32-bit numbers. --
-- --
-- See http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html for --
-- details. --
-- --
-- In contrast to the original code, we do not generate random numbers in --
-- batches of N. Measurement seems to show this has very little if any --
-- effect on performance, and it may be marginally better for real-time --
-- applications with hard deadlines. --
-- --
------------------------------------------------------------------------------
with Ada.Strings.Text_Output.Utils;
with Ada.Unchecked_Conversion;
with System.Random_Seed;
with Interfaces; use Interfaces;
use Ada;
package body System.Random_Numbers with
SPARK_Mode => Off
is
Image_Numeral_Length : constant := Max_Image_Width / N;
subtype Image_String is String (1 .. Max_Image_Width);
----------------------------
-- Algorithmic Parameters --
----------------------------
Lower_Mask : constant := 2**31 - 1;
Upper_Mask : constant := 2**31;
Matrix_A : constant array (State_Val range 0 .. 1) of State_Val
:= (0, 16#9908b0df#);
-- The twist transformation is represented by a matrix of the form
--
-- [ 0 I(31) ]
-- [ _a ]
--
-- where 0 is a 31x31 block of 0s, I(31) is the 31x31 identity matrix and
-- _a is a particular bit row-vector, represented here by a 32-bit integer.
-- If integer x represents a row vector of bits (with x(0), the units bit,
-- last), then
-- x * A = [0 x(31..1)] xor Matrix_A(x(0)).
U : constant := 11;
S : constant := 7;
B_Mask : constant := 16#9d2c5680#;
T : constant := 15;
C_Mask : constant := 16#efc60000#;
L : constant := 18;
-- The tempering shifts and bit masks, in the order applied
Seed0 : constant := 5489;
-- Default seed, used to initialize the state vector when Reset not called
Seed1 : constant := 19650218;
-- Seed used to initialize the state vector when calling Reset with an
-- initialization vector.
Mult0 : constant := 1812433253;
-- Multiplier for a modified linear congruential generator used to
-- initialize the state vector when calling Reset with a single integer
-- seed.
Mult1 : constant := 1664525;
Mult2 : constant := 1566083941;
-- Multipliers for two modified linear congruential generators used to
-- initialize the state vector when calling Reset with an initialization
-- vector.
-----------------------
-- Local Subprograms --
-----------------------
procedure Init (Gen : Generator; Initiator : Unsigned_32);
-- Perform a default initialization of the state of Gen. The resulting
-- state is identical for identical values of Initiator.
procedure Insert_Image
(S : in out Image_String;
Index : Integer;
V : State_Val);
-- Insert image of V into S, in the Index'th 11-character substring
function Extract_Value (S : String; Index : Integer) return State_Val;
-- Treat S as a sequence of 11-character decimal numerals and return
-- the result of converting numeral #Index (numbering from 0)
function To_Unsigned is
new Unchecked_Conversion (Integer_32, Unsigned_32);
function To_Unsigned is
new Unchecked_Conversion (Integer_64, Unsigned_64);
------------
-- Random --
------------
function Random (Gen : Generator) return Unsigned_32 is
G : Generator renames Gen.Writable.Self.all;
Y : State_Val;
I : Integer; -- should avoid use of identifier I ???
begin
I := G.I;
if I < N - M then
Y := (G.S (I) and Upper_Mask) or (G.S (I + 1) and Lower_Mask);
Y := G.S (I + M) xor Shift_Right (Y, 1) xor Matrix_A (Y and 1);
I := I + 1;
elsif I < N - 1 then
Y := (G.S (I) and Upper_Mask) or (G.S (I + 1) and Lower_Mask);
Y := G.S (I + (M - N))
xor Shift_Right (Y, 1)
xor Matrix_A (Y and 1);
I := I + 1;
elsif I = N - 1 then
Y := (G.S (I) and Upper_Mask) or (G.S (0) and Lower_Mask);
Y := G.S (M - 1) xor Shift_Right (Y, 1) xor Matrix_A (Y and 1);
I := 0;
else
Init (G, Seed0);
return Random (Gen);
end if;
G.S (G.I) := Y;
G.I := I;
Y := Y xor Shift_Right (Y, U);
Y := Y xor (Shift_Left (Y, S) and B_Mask);
Y := Y xor (Shift_Left (Y, T) and C_Mask);
Y := Y xor Shift_Right (Y, L);
return Y;
end Random;
generic
type Unsigned is mod <>;
type Real is digits <>;
with function Random (G : Generator) return Unsigned is <>;
function Random_Float_Template (Gen : Generator) return Real;
pragma Inline (Random_Float_Template);
-- Template for a random-number generator implementation that delivers
-- values of type Real in the range [0 .. 1], using values from Gen,
-- assuming that Unsigned is large enough to hold the bits of a mantissa
-- for type Real.
---------------------------
-- Random_Float_Template --
---------------------------
function Random_Float_Template (Gen : Generator) return Real is
pragma Compile_Time_Error
(Unsigned'Last <= 2**(Real'Machine_Mantissa - 1),
"insufficiently large modular type used to hold mantissa");
begin
-- This code generates random floating-point numbers from unsigned
-- integers. Assuming that Real'Machine_Radix = 2, it can deliver all
-- machine values of type Real (as implied by Real'Machine_Mantissa and
-- Real'Machine_Emin), which is not true of the standard method (to
-- which we fall back for nonbinary radix): computing Real(<random
-- integer>) / (<max random integer>+1). To do so, we first extract an
-- (M-1)-bit significand (where M is Real'Machine_Mantissa), and then
-- decide on a normalized exponent by repeated coin flips, decrementing
-- from 0 as long as we flip heads (1 bits). This process yields the
-- proper geometric distribution for the exponent: in a uniformly
-- distributed set of floating-point numbers, 1/2 of them will be in
-- (0.5, 1], 1/4 will be in (0.25, 0.5], and so forth. It makes a
-- further adjustment at binade boundaries (see comments below) to give
-- the effect of selecting a uniformly distributed real deviate in
-- [0..1] and then rounding to the nearest representable floating-point
-- number. The algorithm attempts to be stingy with random integers. In
-- the worst case, it can consume roughly -Real'Machine_Emin/32 32-bit
-- integers, but this case occurs with probability around
-- 2**Machine_Emin, and the expected number of calls to integer-valued
-- Random is 1. For another discussion of the issues addressed by this
-- process, see Allen Downey's unpublished paper at
-- http://allendowney.com/research/rand/downey07randfloat.pdf.
if Real'Machine_Radix /= 2 then
return Real'Machine
(Real (Unsigned'(Random (Gen))) * 2.0**(-Unsigned'Size));
else
declare
type Bit_Count is range 0 .. 4;
subtype T is Real'Base;
Trailing_Ones : constant array (Unsigned_32 range 0 .. 15)
of Bit_Count :=
(2#00000# => 0, 2#00001# => 1, 2#00010# => 0, 2#00011# => 2,
2#00100# => 0, 2#00101# => 1, 2#00110# => 0, 2#00111# => 3,
2#01000# => 0, 2#01001# => 1, 2#01010# => 0, 2#01011# => 2,
2#01100# => 0, 2#01101# => 1, 2#01110# => 0, 2#01111# => 4);
Pow_Tab : constant array (Bit_Count range 0 .. 3) of Real
:= (0 => 2.0**(0 - T'Machine_Mantissa),
1 => 2.0**(-1 - T'Machine_Mantissa),
2 => 2.0**(-2 - T'Machine_Mantissa),
3 => 2.0**(-3 - T'Machine_Mantissa));
Extra_Bits : constant Natural :=
(Unsigned'Size - T'Machine_Mantissa + 1);
-- Random bits left over after selecting mantissa
Mantissa : Unsigned;
X : Real; -- Scaled mantissa
R : Unsigned_32; -- Supply of random bits
R_Bits : Natural; -- Number of bits left in R
K : Bit_Count; -- Next decrement to exponent
begin
K := 0;
Mantissa := Random (Gen) / 2**Extra_Bits;
R := Unsigned_32 (Mantissa mod 2**Extra_Bits);
R_Bits := Extra_Bits;
X := Real (2**(T'Machine_Mantissa - 1) + Mantissa); -- Exact
if Extra_Bits < 4 and then R < 2 ** Extra_Bits - 1 then
-- We got lucky and got a zero in our few extra bits
K := Trailing_Ones (R);
else
Find_Zero : loop
-- R has R_Bits unprocessed random bits, a multiple of 4.
-- X needs to be halved for each trailing one bit. The
-- process stops as soon as a 0 bit is found. If R_Bits
-- becomes zero, reload R.
-- Process 4 bits at a time for speed: the two iterations
-- on average with three tests each was still too slow,
-- probably because the branches are not predictable.
-- This loop now will only execute once 94% of the cases,
-- doing more bits at a time will not help.
while R_Bits >= 4 loop
K := Trailing_Ones (R mod 16);
exit Find_Zero when K < 4; -- Exits 94% of the time
R_Bits := R_Bits - 4;
X := X / 16.0;
R := R / 16;
end loop;
-- Do not allow us to loop endlessly even in the (very
-- unlikely) case that Random (Gen) keeps yielding all ones.
exit Find_Zero when X = 0.0;
R := Random (Gen);
R_Bits := 32;
end loop Find_Zero;
end if;
-- K has the count of trailing ones not reflected yet in X. The
-- following multiplication takes care of that, as well as the
-- correction to move the radix point to the left of the mantissa.
-- Doing it at the end avoids repeated rounding errors in the
-- exceedingly unlikely case of ever having a subnormal result.
X := X * Pow_Tab (K);
-- The smallest value in each binade is rounded to by 0.75 of
-- the span of real numbers as its next larger neighbor, and
-- 1.0 is rounded to by half of the span of real numbers as its
-- next smaller neighbor. To account for this, when we encounter
-- the smallest number in a binade, we substitute the smallest
-- value in the next larger binade with probability 1/2.
if Mantissa = 0 and then Unsigned_32'(Random (Gen)) mod 2 = 0 then
X := 2.0 * X;
end if;
return X;
end;
end if;
end Random_Float_Template;
------------
-- Random --
------------
function Random (Gen : Generator) return Float is
function F is new Random_Float_Template (Unsigned_32, Float);
begin
return F (Gen);
end Random;
function Random (Gen : Generator) return Long_Float is
function F is new Random_Float_Template (Unsigned_64, Long_Float);
begin
return F (Gen);
end Random;
function Random (Gen : Generator) return Unsigned_64 is
begin
return Shift_Left (Unsigned_64 (Unsigned_32'(Random (Gen))), 32)
or Unsigned_64 (Unsigned_32'(Random (Gen)));
end Random;
---------------------
-- Random_Discrete --
---------------------
function Random_Discrete
(Gen : Generator;
Min : Result_Subtype := Default_Min;
Max : Result_Subtype := Result_Subtype'Last) return Result_Subtype
is
begin
if Max = Min then
return Max;
elsif Max < Min then
raise Constraint_Error;
-- In the 64-bit case, we have to be careful since not all 64-bit
-- unsigned values are representable in GNAT's universal integer.
elsif Result_Subtype'Base'Size > 32 then
declare
-- Ignore unequal-size warnings since GNAT's handling is correct.
pragma Warnings ("Z");
function Conv_To_Unsigned is
new Unchecked_Conversion (Result_Subtype'Base, Unsigned_64);
function Conv_To_Result is
new Unchecked_Conversion (Unsigned_64, Result_Subtype'Base);
pragma Warnings ("z");
N : constant Unsigned_64 :=
Conv_To_Unsigned (Max) - Conv_To_Unsigned (Min) + 1;
X, Slop : Unsigned_64;
begin
if N = 0 then
return Conv_To_Result (Conv_To_Unsigned (Min) + Random (Gen));
else
Slop := Unsigned_64'Last rem N + 1;
loop
X := Random (Gen);
exit when Slop = N or else X <= Unsigned_64'Last - Slop;
end loop;
return Conv_To_Result (Conv_To_Unsigned (Min) + X rem N);
end if;
end;
-- In the 32-bit case, we need to handle both integer and enumeration
-- types and, therefore, rely on 'Pos and 'Val in the computation.
elsif Result_Subtype'Pos (Max) - Result_Subtype'Pos (Min) = 2 ** 32 - 1
then
return Result_Subtype'Val
(Result_Subtype'Pos (Min) + Unsigned_32'Pos (Random (Gen)));
else
declare
N : constant Unsigned_32 :=
Unsigned_32 (Result_Subtype'Pos (Max) -
Result_Subtype'Pos (Min) + 1);
Slop : constant Unsigned_32 := Unsigned_32'Last rem N + 1;
X : Unsigned_32;
begin
loop
X := Random (Gen);
exit when Slop = N or else X <= Unsigned_32'Last - Slop;
end loop;
return
Result_Subtype'Val
(Result_Subtype'Pos (Min) + Unsigned_32'Pos (X rem N));
end;
end if;
end Random_Discrete;
------------------
-- Random_Float --
------------------
function Random_Float (Gen : Generator) return Result_Subtype is
begin
if Result_Subtype'Base'Digits > Float'Digits then
return Result_Subtype'Machine (Result_Subtype
(Long_Float'(Random (Gen))));
else
return Result_Subtype'Machine (Result_Subtype
(Float'(Random (Gen))));
end if;
end Random_Float;
-----------
-- Reset --
-----------
procedure Reset (Gen : Generator) is
begin
Init (Gen, Unsigned_32'Mod (Random_Seed.Get_Seed));
end Reset;
procedure Reset (Gen : Generator; Initiator : Integer_32) is
begin
Init (Gen, To_Unsigned (Initiator));
end Reset;
procedure Reset (Gen : Generator; Initiator : Unsigned_32) is
begin
Init (Gen, Initiator);
end Reset;
procedure Reset (Gen : Generator; Initiator : Integer) is
begin
-- This is probably an unnecessary precaution against future change, but
-- since the test is a static expression, no extra code is involved.
if Integer'Size <= 32 then
Init (Gen, To_Unsigned (Integer_32 (Initiator)));
else
declare
Initiator1 : constant Unsigned_64 :=
To_Unsigned (Integer_64 (Initiator));
Init0 : constant Unsigned_32 :=
Unsigned_32 (Initiator1 mod 2 ** 32);
Init1 : constant Unsigned_32 :=
Unsigned_32 (Shift_Right (Initiator1, 32));
begin
Reset (Gen, Initialization_Vector'(Init0, Init1));
end;
end if;
end Reset;
procedure Reset (Gen : Generator; Initiator : Initialization_Vector) is
G : Generator renames Gen.Writable.Self.all;
I, J : Integer;
begin
Init (G, Seed1);
I := 1;
J := 0;
if Initiator'Length > 0 then
for K in reverse 1 .. Integer'Max (N, Initiator'Length) loop
G.S (I) :=
(G.S (I) xor ((G.S (I - 1)
xor Shift_Right (G.S (I - 1), 30)) * Mult1))
+ Initiator (J + Initiator'First) + Unsigned_32 (J);
I := I + 1;
J := J + 1;
if I >= N then
G.S (0) := G.S (N - 1);
I := 1;
end if;
if J >= Initiator'Length then
J := 0;
end if;
end loop;
end if;
for K in reverse 1 .. N - 1 loop
G.S (I) :=
(G.S (I) xor ((G.S (I - 1)
xor Shift_Right (G.S (I - 1), 30)) * Mult2))
- Unsigned_32 (I);
I := I + 1;
if I >= N then
G.S (0) := G.S (N - 1);
I := 1;
end if;
end loop;
G.S (0) := Upper_Mask;
end Reset;
procedure Reset (Gen : Generator; From_State : Generator) is
G : Generator renames Gen.Writable.Self.all;
begin
G.S := From_State.S;
G.I := From_State.I;
end Reset;
procedure Reset (Gen : Generator; From_State : State) is
G : Generator renames Gen.Writable.Self.all;
begin
G.I := 0;
G.S := From_State;
end Reset;
procedure Reset (Gen : Generator; From_Image : String) is
G : Generator renames Gen.Writable.Self.all;
begin
G.I := 0;
for J in 0 .. N - 1 loop
G.S (J) := Extract_Value (From_Image, J);
end loop;
end Reset;
----------
-- Save --
----------
procedure Save (Gen : Generator; To_State : out State) is
Gen2 : Generator;
begin
if Gen.I = N then
Init (Gen2, 5489);
To_State := Gen2.S;
else
To_State (0 .. N - 1 - Gen.I) := Gen.S (Gen.I .. N - 1);
To_State (N - Gen.I .. N - 1) := Gen.S (0 .. Gen.I - 1);
end if;
end Save;
-----------
-- Image --
-----------
function Image (Of_State : State) return String is
Result : Image_String;
begin
Result := (others => ' ');
for J in Of_State'Range loop
Insert_Image (Result, J, Of_State (J));
end loop;
return Result;
end Image;
function Image (Gen : Generator) return String is
Result : Image_String;
begin
Result := (others => ' ');
for J in 0 .. N - 1 loop
Insert_Image (Result, J, Gen.S ((J + Gen.I) mod N));
end loop;
return Result;
end Image;
---------------
-- Put_Image --
---------------
procedure Put_Image
(S : in out Strings.Text_Output.Sink'Class; V : State) is
begin
Strings.Text_Output.Utils.Put_String (S, Image (V));
end Put_Image;
-----------
-- Value --
-----------
function Value (Coded_State : String) return State is
Gen : Generator;
S : State;
begin
Reset (Gen, Coded_State);
Save (Gen, S);
return S;
end Value;
----------
-- Init --
----------
procedure Init (Gen : Generator; Initiator : Unsigned_32) is
G : Generator renames Gen.Writable.Self.all;
begin
G.S (0) := Initiator;
for I in 1 .. N - 1 loop
G.S (I) :=
(G.S (I - 1) xor Shift_Right (G.S (I - 1), 30)) * Mult0
+ Unsigned_32 (I);
end loop;
G.I := 0;
end Init;
------------------
-- Insert_Image --
------------------
procedure Insert_Image
(S : in out Image_String;
Index : Integer;
V : State_Val)
is
Value : constant String := State_Val'Image (V);
begin
S (Index * 11 + 1 .. Index * 11 + Value'Length) := Value;
end Insert_Image;
-------------------
-- Extract_Value --
-------------------
function Extract_Value (S : String; Index : Integer) return State_Val is
Start : constant Integer := S'First + Index * Image_Numeral_Length;
begin
return State_Val'Value (S (Start .. Start + Image_Numeral_Length - 1));
end Extract_Value;
end System.Random_Numbers;
|
with Warn10_Pkg; use Warn10_Pkg;
package Warn10 is
type My_Driver is new Root with record
Extra : Natural;
end record;
procedure Do_Something(Driver : My_Driver);
end Warn10;
|
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2017, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
package body SSD1306_SPI is
procedure Write_Command (This : SSD1306_SPI_Screen;
Cmd : UInt8);
procedure Write_Data (This : SSD1306_SPI_Screen;
Data : UInt8_Array);
-------------------
-- Write_Command --
-------------------
procedure Write_Command (This : SSD1306_SPI_Screen;
Cmd : UInt8)
is
Status : SPI_Status;
Cmd_A : HAL.SPI.SPI_Data_8b (1 .. 1);
begin
This.DC.Clear; -- its D/C_ (cmd is low)
This.CS.Clear;
Cmd_A (1) := Cmd;
This.Port.Transmit (Cmd_A, Status => Status);
This.CS.Set;
if Status /= Ok then
-- No error handling...
raise Program_Error;
end if;
end Write_Command;
----------------
-- Write_Data --
----------------
procedure Write_Data (This : SSD1306_SPI_Screen;
Data : UInt8_Array)
is
Status : SPI_Status;
begin
This.DC.Set; -- its D/C_ (Data is high)
This.CS.Clear;
This.Port.Transmit (SPI_Data_8b (Data), Status => Status);
This.CS.Set;
if Status /= Ok then
-- No error handling...
raise Program_Error;
end if;
end Write_Data;
----------------
-- Initialize --
----------------
procedure Initialize (This : in out SSD1306_SPI_Screen;
External_VCC : Boolean)
is
begin
if This.Width * This.Height /= (This.Buffer_Size_In_Byte * 8) then
raise Program_Error with "Invalid screen parameters";
end if;
This.RST.Clear;
This.Time.Delay_Milliseconds (100);
This.RST.Set;
This.Time.Delay_Milliseconds (100);
Write_Command (This, DISPLAY_OFF);
Write_Command (This, SET_DISPLAY_CLOCK_DIV);
Write_Command (This, 16#80#);
Write_Command (This, SET_MULTIPLEX);
Write_Command (This, UInt8 (This.Height - 1));
Write_Command (This, SET_DISPLAY_OFFSET);
Write_Command (This, 16#00#);
Write_Command (This, SET_START_LINE or 0);
Write_Command (This, CHARGE_PUMP);
Write_Command (This, (if External_VCC then 16#10# else 16#14#));
Write_Command (This, MEMORY_MODE);
Write_Command (This, 16#00#);
Write_Command (This, SEGREMAP or 1);
Write_Command (This, COM_SCAN_DEC);
Write_Command (This, SET_COMPINS);
Write_Command (This, 16#12#);
Write_Command (This, SET_CONTRAST);
Write_Command (This, (if External_VCC then 16#9F# else 16#CF#));
Write_Command (This, SET_PRECHARGE);
Write_Command (This, (if External_VCC then 16#22# else 16#F1#));
Write_Command (This, SET_VCOM_DETECT);
Write_Command (This, 16#40#);
Write_Command (This, DISPLAY_ALL_ON_RESUME);
Write_Command (This, NORMAL_DISPLAY);
Write_Command (This, DEACTIVATE_SCROLL);
for I in This.Memory_Layer.Data'Range loop
This.Memory_Layer.Data (I) := 0;
end loop;
This.Device_Initialized := True;
end Initialize;
-----------------
-- Initialized --
-----------------
overriding
function Initialized (This : SSD1306_SPI_Screen) return Boolean is
(This.Device_Initialized);
-------------
-- Turn_On --
-------------
procedure Turn_On (This : SSD1306_SPI_Screen)
is
begin
Write_Command (This, DISPLAY_ON);
end Turn_On;
--------------
-- Turn_Off --
--------------
procedure Turn_Off (This : SSD1306_SPI_Screen)
is
begin
Write_Command (This, DISPLAY_OFF);
end Turn_Off;
--------------------------
-- Display_Inversion_On --
--------------------------
procedure Display_Inversion_On (This : SSD1306_SPI_Screen)
is
begin
Write_Command (This, INVERT_DISPLAY);
end Display_Inversion_On;
---------------------------
-- Display_Inversion_Off --
---------------------------
procedure Display_Inversion_Off (This : SSD1306_SPI_Screen)
is
begin
Write_Command (This, NORMAL_DISPLAY);
end Display_Inversion_Off;
----------------------
-- Write_Raw_Pixels --
----------------------
procedure Write_Raw_Pixels (This : SSD1306_SPI_Screen;
Data : HAL.UInt8_Array)
is
begin
Write_Command (This, COLUMN_ADDR);
Write_Command (This, 0); -- from
Write_Command (This, UInt8 (This.Width - 1)); -- to
Write_Command (This, PAGE_ADDR);
Write_Command (This, 0); -- from
Write_Command (This, UInt8 (This.Height / 8) - 1); -- to
-- Write_Data (This, (1 => 16#40#) & Data);
Write_Data (This, Data);
end Write_Raw_Pixels;
procedure Fill_Region (This : in out SSD1306_SPI_Screen;
X_Start, X_End, Y_Start, Y_End : Natural;
Colour : UInt32)
is
begin
Set_Native_Source (This, Colour);
for Row in Y_Start .. Y_End loop
for Col in X_Start .. X_End loop
Set_Pixel (This.Memory_Layer, Pt => (X => Col, Y => Row));
end loop;
end loop;
Update_Layers (This);
end Fill_Region;
--------------------
-- Get_Max_Layers --
--------------------
overriding
function Max_Layers
(This : SSD1306_SPI_Screen) return Positive is (1);
------------------
-- Is_Supported --
------------------
overriding
function Supported
(This : SSD1306_SPI_Screen;
Mode : FB_Color_Mode) return Boolean is
(Mode = HAL.Bitmap.RGB_565);
---------------------
-- Set_Orientation --
---------------------
overriding
procedure Set_Orientation
(This : in out SSD1306_SPI_Screen;
Orientation : Display_Orientation)
is
begin
null;
end Set_Orientation;
--------------
-- Set_Mode --
--------------
overriding
procedure Set_Mode
(This : in out SSD1306_SPI_Screen;
Mode : Wait_Mode)
is
begin
null;
end Set_Mode;
---------------
-- Get_Width --
---------------
overriding
function Width
(This : SSD1306_SPI_Screen) return Positive is (This.Width);
----------------
-- Get_Height --
----------------
overriding
function Height
(This : SSD1306_SPI_Screen) return Positive is (This.Height);
----------------
-- Is_Swapped --
----------------
overriding
function Swapped
(This : SSD1306_SPI_Screen) return Boolean is (False);
--------------------
-- Set_Background --
--------------------
overriding
procedure Set_Background
(This : SSD1306_SPI_Screen; R, G, B : UInt8)
is
begin
-- Does it make sense when there's no alpha channel...
raise Program_Error;
end Set_Background;
----------------------
-- Initialize_Layer --
----------------------
overriding
procedure Initialize_Layer
(This : in out SSD1306_SPI_Screen;
Layer : Positive;
Mode : FB_Color_Mode;
X : Natural := 0;
Y : Natural := 0;
Width : Positive := Positive'Last;
Height : Positive := Positive'Last)
is
pragma Unreferenced (X, Y, Width, Height);
begin
if Layer /= 1 or else Mode /= M_1 then
raise Program_Error;
end if;
This.Memory_Layer.Actual_Width := This.Width;
This.Memory_Layer.Actual_Height := This.Height;
This.Memory_Layer.Addr := This.Memory_Layer.Data'Address;
This.Memory_Layer.Actual_Color_Mode := Mode;
This.Layer_Initialized := True;
end Initialize_Layer;
-----------------
-- Initialized --
-----------------
overriding
function Initialized
(This : SSD1306_SPI_Screen;
Layer : Positive) return Boolean
is
begin
return Layer = 1 and then This.Layer_Initialized;
end Initialized;
------------------
-- Update_Layer --
------------------
overriding
procedure Update_Layer
(This : in out SSD1306_SPI_Screen;
Layer : Positive;
Copy_Back : Boolean := False)
is
pragma Unreferenced (Copy_Back);
begin
if Layer /= 1 then
raise Program_Error;
end if;
This.Write_Raw_Pixels (This.Memory_Layer.Data);
end Update_Layer;
-------------------
-- Update_Layers --
-------------------
overriding
procedure Update_Layers
(This : in out SSD1306_SPI_Screen)
is
begin
This.Update_Layer (1);
end Update_Layers;
--------------------
-- Get_Color_Mode --
--------------------
overriding
function Color_Mode
(This : SSD1306_SPI_Screen;
Layer : Positive) return FB_Color_Mode
is
pragma Unreferenced (This);
begin
if Layer /= 1 then
raise Program_Error;
end if;
return M_1;
end Color_Mode;
-----------------------
-- Get_Hidden_Buffer --
-----------------------
overriding
function Hidden_Buffer
(This : in out SSD1306_SPI_Screen;
Layer : Positive) return not null HAL.Bitmap.Any_Bitmap_Buffer
is
begin
if Layer /= 1 then
raise Program_Error;
end if;
return This.Memory_Layer'Unchecked_Access;
end Hidden_Buffer;
--------------------
-- Get_Pixel_Size --
--------------------
overriding
function Pixel_Size
(This : SSD1306_SPI_Screen;
Layer : Positive) return Positive is (1);
procedure Set_Pixel
(This : in out SSD1306_SPI_Screen;
Pt : Point)
is
begin
Set_Pixel (This.Memory_Layer, Pt);
end Set_Pixel;
---------------
-- Set_Pixel --
---------------
overriding
procedure Set_Pixel
(Buffer : in out SSD1306_SPI_Bitmap_Buffer;
Pt : Point)
is
Index : constant Natural := Pt.X + (Pt.Y / 8) * Buffer.Actual_Width;
Byte : UInt8 renames Buffer.Data (Buffer.Data'First + Index);
begin
if Buffer.Native_Source = 0 then
Byte := Byte and not (Shift_Left (1, Pt.Y mod 8));
else
Byte := Byte or Shift_Left (1, Pt.Y mod 8);
end if;
end Set_Pixel;
procedure Set_Native_Source (This : in out SSD1306_SPI_Screen;
Colour : UInt32)
is
begin
This.Memory_Layer.Native_Source := Colour;
end Set_Native_Source;
-----------
-- Pixel --
-----------
overriding
function Pixel
(Buffer : SSD1306_SPI_Bitmap_Buffer;
Pt : Point)
return Bitmap_Color
is
Index : constant Natural := Pt.X + (Pt.Y / 8) * Buffer.Actual_Width;
Byte : UInt8 renames Buffer.Data (Buffer.Data'First + Index);
begin
return (if Byte = 0 then Black else White);
end Pixel;
end SSD1306_SPI;
|
-- MIT License
-- Copyright (c) 2021 Stephen Merrony
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
-- The above copyright notice and this permission notice shall be included in all
-- copies or substantial portions of the Software.
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
with Ada.Exceptions; use Ada.Exceptions;
with Ada.Text_IO;
with Debug_Logs; use Debug_Logs;
with Devices;
with Devices.Bus;
with Memory; use Memory;
with Memory_Channels; use Memory_Channels;
with Status_Monitor;
package body Devices.Disk6061 is
protected body Drives is
procedure Init (Debug_Logging : in Boolean) is
begin
State.Debug_Logging := Debug_Logging;
Devices.Bus.Actions.Set_Reset_Proc (Devices.DPF, Reset'Access);
Devices.Bus.Actions.Set_Data_In_Proc (Devices.DPF, Data_In'Access);
Devices.Bus.Actions.Set_Data_Out_Proc (Devices.DPF, Data_Out'Access);
State.Image_Attached := False;
State.Map_Enabled := False;
Reset;
Status_Sender.Start;
end Init;
procedure Set_Logging (Log : in Boolean) is
begin
State.Debug_Logging := Log;
end Set_Logging;
function Printable_Addr return String is
begin
return "DRV: " & State.Drive'Image &
", CYL:" & State.Cylinder'Image &
", SURF:" & State.Surface'Image &
", SECT:" & State.Sector'Image &
", SECCNT:" & State.Sector_Cnt'Image &
", Mem Addr: " & Dword_To_String (Dword_T(State.Mem_Addr), Octal, 9, true);
end Printable_Addr;
procedure Reset is
begin
State.RW_Status := 0;
State.Instruction_Mode := Normal;
State.Command := 0;
State.Cylinder := 0;
State.Surface := 0;
State.Sector := 0;
State.Sector_Cnt := 0;
State.Drive_Status := Drive_Stat_Ready;
Loggers.Debug_Print (Dpf_Log, "INFO: RESET (IORST) done " & Printable_Addr);
Ada.Text_IO.Put_Line("INFO: DPF Reset");
end Reset;
procedure Attach
(Unit : in Natural; Image_Name : in String; OK : out Boolean)
is
begin
if Unit /= 0 then
raise Not_Yet_Implemented
with "DPF - Multiple disks not yet supported";
end if;
Sector_IO.Open (State.Image_File, Inout_File, Image_Name);
State.Image_Filename := To_Unbounded_String (Image_Name);
State.Image_Attached := True;
Devices.Bus.Actions.Set_Image_Attached (Devices.DPF, Image_Name);
OK := True;
exception
when Error : others =>
Loggers.Debug_Print
(Debug_Log,
"WARNING: Could not open disk image due to " &
Exception_Information (Error));
OK := False;
end Attach;
function Get_Status return Status_Rec is
Stat : Status_Rec;
begin
Stat.Image_Attached := State.Image_Attached;
Stat.Image_Filename := State.Image_Filename;
Stat.Cylinder := State.Cylinder;
Stat.Surface := State.Surface;
Stat.Sector := State.Sector;
Stat.Reads := State.Reads;
Stat.Writes := State.Writes;
return Stat;
end Get_Status;
procedure Position_Image is
Offset : Integer;
begin
Offset := ((Integer(State.Cylinder) * Surfaces_Per_Disk) +
(Integer(State.Surface) * Sectors_Per_Track) +
Integer(State.Sector))
+ 1;
Sector_IO.Set_Index (State.Image_File, Sector_IO.Count(Offset));
end Position_Image;
procedure Do_Command is
begin
State.Instruction_Mode := Normal; -- ??? is this right ???
case State.Command is
when Cmd_T'Pos(Recal) =>
State.Cylinder := 0;
State.Surface := 0;
State.Sector := 0;
Position_Image;
State.Drive_Status := Drive_Stat_Ready;
State.RW_Status := RW_Stat_RW_Done or RW_Stat_Drive_0_Done;
if State.Debug_Logging then
Loggers.Debug_Print (Dpf_Log, "... RECAL done " & Printable_Addr);
end if;
when Cmd_T'Pos(Seek) =>
Position_Image;
State.RW_Status := RW_Stat_RW_Done or RW_Stat_Drive_0_Done;
State.Drive_Status := Drive_Stat_Ready;
if State.Debug_Logging then
Loggers.Debug_Print (Dpf_Log, "... SEEK done " & Printable_Addr);
end if;
when Cmd_T'Pos(Read) =>
if State.Debug_Logging then
Loggers.Debug_Print (Dpf_Log, "... READ called " & Printable_Addr);
end if;
State.RW_Status := 0;
while State.Sector_Cnt /= 0 loop
if State.Cylinder >= Word_T(Cylinders_Per_Disk) then
State.Drive_Status := Drive_Stat_Ready;
State.RW_Status := RW_Stat_RW_Done or RW_Stat_RW_Fault or RW_Stat_Cylinder;
return;
end if;
if State.Sector >= Word_T(Sectors_Per_Track) then
State.Sector := 0;
State.Surface := State.Surface + 1;
end if;
if State.Surface >= Word_T(Surfaces_Per_Disk) then
State.Drive_Status := Drive_Stat_Ready;
State.RW_Status := RW_Stat_RW_Done or RW_Stat_RW_Fault or RW_Stat_Illegal_Sector;
return;
end if;
Position_Image;
Sector_IO.Read(State.Image_File, State.Read_Buff);
for W_Ix in 0 .. Words_Per_Sector - 1 loop
BMC_DCH.Write_Word_BMC_16(State.Mem_Addr, State.Read_Buff(W_Ix));
end loop;
State.Sector := State.Sector + 1;
State.Sector_Cnt := State.Sector_Cnt + 1;
State.Reads := State.Reads + 1;
end loop;
State.RW_Status := RW_Stat_RW_Done or RW_Stat_Drive_0_Done;
if State.Debug_Logging then
Loggers.Debug_Print (Dpf_Log, "... READ done " & Printable_Addr);
end if;
when Cmd_T'Pos(Release) =>
-- I think this is a No-Op on a single CPU machine
null;
when Cmd_T'Pos(Write) =>
declare
Datum : Word_T;
begin
if State.Debug_Logging then
Loggers.Debug_Print (Dpf_Log, "... WRITE called " & Printable_Addr);
end if;
State.RW_Status := 0;
while State.Sector_Cnt /= 0 loop
if State.Cylinder >= Word_T(Cylinders_Per_Disk) then
State.Drive_Status := Drive_Stat_Ready;
State.RW_Status := RW_Stat_RW_Done or RW_Stat_RW_Fault or RW_Stat_Cylinder;
return;
end if;
if State.Sector >= Word_T(Sectors_Per_Track) then
State.Sector := 0;
State.Surface := State.Surface + 1;
end if;
if State.Surface >= Word_T(Surfaces_Per_Disk) then
State.Drive_Status := Drive_Stat_Ready;
State.RW_Status := RW_Stat_RW_Done or RW_Stat_RW_Fault or RW_Stat_Illegal_Sector;
return;
end if;
Position_Image;
for W_Ix in 0 .. Words_Per_Sector - 1 loop
BMC_DCH.Read_Word_BMC_16 (State.Mem_Addr, Datum);
State.Write_Buff(W_Ix) := Datum;
end loop;
Sector_IO.Write(State.Image_File, State.Write_Buff);
State.Sector := State.Sector + 1;
State.Sector_Cnt := State.Sector_Cnt + 1;
State.Writes := State.Writes + 1;
end loop;
if State.Debug_Logging then
Loggers.Debug_Print (Dpf_Log, "... WRITE done " & Printable_Addr);
end if;
State.Drive_Status := Drive_Stat_Ready;
State.RW_Status := RW_Stat_RW_Done; -- or RW_Stat_Drive_0_Done;
end;
when others =>
raise Not_Yet_Implemented with State.Command'Image;
end case;
end Do_Command;
procedure Handle_Flag (IO_Flag : in IO_Flag_T) is
begin
case IO_Flag is
when S =>
Devices.Bus.States.Set_Busy (Devices.DPF, true);
Devices.Bus.States.Set_Done (Devices.DPF, false);
-- TODO stop any I/O
State.RW_Status := 0;
-- TODO start I/O timeout
Do_Command;
Devices.Bus.States.Set_Busy (Devices.DPF, false);
Devices.Bus.States.Set_Done (Devices.DPF, true);
Devices.Bus.States.Send_Interrupt (Devices.DPF);
when C =>
Devices.Bus.States.Set_Busy (Devices.DPF, false);
Devices.Bus.States.Set_Done (Devices.DPF, false);
State.RW_Status := 0;
when P => -- 'Reserved...'
Devices.Bus.States.Set_Busy (Devices.DPF, false);
State.RW_Status := 0;
Do_Command;
Devices.Bus.States.Send_Interrupt (Devices.DPF);
when None =>
null;
end case;
end Handle_Flag;
-- Data_In services the DIA/B/C I/O instructions
procedure Data_In
(ABC : in IO_Reg_T; IO_Flag : in IO_Flag_T; Datum : out Word_T)
is
begin
case ABC is
when A =>
case State.Instruction_Mode is
when Normal =>
Datum := State.RW_Status;
when Alt_1 =>
Datum := State.Mem_Addr;
when Alt_2 =>
Datum := 0; -- return 0 for ECC
end case;
when B =>
case State.Instruction_Mode is
when Normal =>
Datum := State.Drive_Status and 16#feff#;
when Alt_1 =>
Datum := 16#8000# or (State.EMA and 16#001f#);
when Alt_2 =>
Datum := 0; -- return 0 for ECC
end case;
when C =>
Datum := 0;
if State.Map_Enabled then
Datum := 16#8000#;
end if;
Datum := Datum or Shift_Left(State.Surface and 16#001f#,10);
Datum := Datum or Shift_Left(State.Sector and 16#001f#,5);
Datum := Datum or (Word_T(State.Sector_Cnt) and 16#001f#);
when N =>
raise Not_Yet_Implemented with "N flag on data in to DPF";
end case;
if State.Debug_Logging then
Loggers.Debug_Print (Dpf_Log, "DI" & ABC'Image & " [" & State.Instruction_Mode'Image &
"] Returning: " & Dword_To_String(Dword_T(Datum), Binary, 16, true));
end if;
Handle_Flag (IO_Flag);
end Data_In;
-- Data_Out implements the DOA/B/C instructions
-- NIO is also routed here with a dummy abc flag value of N
procedure Data_Out (Datum : in Word_T; ABC : in IO_Reg_T; IO_Flag : in IO_Flag_T) is
begin
case ABC is
when A =>
State.Command := Shift_Right (Datum and 16#0780#, 7);
State.Drive := Shift_Right (Datum and 16#0060#, 5);
State.EMA := Shift_Right (Datum and 16#0060#, 5);
if State.Debug_Logging then
Loggers.Debug_Print (Dpf_Log, "DOA [Specify Cmd,Drv,EMA] to DRV:" & State.Drive'Image &
" with data: " & Dword_To_String(Dword_T(Datum), Binary, 16, true));
end if;
if Test_W_Bit(Datum, 0) then
State.RW_Status := State.RW_Status and 2#1011_1100_0000_0100#; -- clear R/W status
if State.Debug_Logging then
Loggers.Debug_Print (Dpf_Log, "... Clear R/W Done etc.");
end if;
end if;
if Test_W_Bit(Datum, 1) then
State.RW_Status := State.RW_Status and not RW_Stat_Drive_0_Done;
end if;
if Test_W_Bit(Datum, 2) then
State.RW_Status := State.RW_Status and not RW_Stat_Drive_1_Done;
end if;
if Test_W_Bit(Datum, 3) then
State.RW_Status := State.RW_Status and not RW_Stat_Drive_2_Done;
end if;
if Test_W_Bit(Datum, 4) then
State.RW_Status := State.RW_Status and not RW_Stat_Drive_3_Done;
end if;
State.Instruction_Mode := Normal;
if State.Command = Cmd_T'Pos (Set_Alt_Mode_1) then
State.Instruction_Mode := Alt_1;
if State.Debug_Logging then
Loggers.Debug_Print (Dpf_Log, "... Alt Mode 1 set");
end if;
elsif State.Command = Cmd_T'Pos (Set_Alt_Mode_2) then
State.Instruction_Mode := Alt_2;
if State.Debug_Logging then
Loggers.Debug_Print (Dpf_Log, "... Alt Mode 2 set");
end if;
end if;
if State.Command = Cmd_T'Pos (No_Op) then
State.Instruction_Mode := Normal;
State.RW_Status := 0;
State.Drive_Status := Drive_Stat_Ready;
if State.Debug_Logging then
Loggers.Debug_Print (Dpf_Log, "... NO OP command done");
end if;
end if;
State.Last_DOA_Was_Seek := State.Command = Cmd_T'Pos (Seek);
if State.Debug_Logging then
Loggers.Debug_Print (Dpf_Log, "... CMD: " & Cmd_T'Val(State.Command)'Image &
", DRV:" & State.Drive'Image &
", EMA: " & Dword_To_String(Dword_T(State.EMA), Octal, 10, false));
end if;
when B =>
if Test_W_Bit (Datum, 0) then
State.EMA := State.EMA or 16#01#;
else
State.EMA := State.EMA and 16#fe#;
end if;
State.Mem_Addr := Datum and 16#7fff#;
if State.Debug_Logging then
Loggers.Debug_Print (Dpf_Log, "DOB [Specify Memory Addr] with data " &
Dword_To_String(Dword_T(Datum), Binary, 16, true) & Dasher_NL &
"... MEM Addr: " & Dword_To_String(Dword_T(State.Mem_Addr), Octal, 10) & Dasher_NL &
"... EMA: " & Dword_To_String(Dword_T(State.EMA), Octal, 10));
end if;
when C =>
if State.Last_DOA_Was_Seek then
State.Cylinder := Datum and 16#03ff#; -- mask off lower 10 bits
if State.Debug_Logging then
Loggers.Debug_Print (Dpf_Log, "DOC [Specify Cylinder] after SEEK with data " &
Dword_To_String(Dword_T(Datum), Binary, 16, true) & Dasher_NL &
"... CYL:" & State.Cylinder'Image);
end if;
else
declare
Tmp_Byte : Byte_T;
begin
State.Map_Enabled := Test_W_Bit (Datum, 0);
State.Surface := Shift_Right(Datum and 16#7c00#, 10);
State.Sector := Shift_Right(Datum and 16#03e0#, 5);
Tmp_Byte := Byte_T(Datum and 16#001f#);
if Tmp_Byte /= 0 then
Tmp_Byte := Tmp_Byte or 16#e0#; -- sign extend
end if;
State.Sector_Cnt := Byte_To_Integer_8(Tmp_Byte);
if State.Debug_Logging then
Loggers.Debug_Print (Dpf_Log, "DOC [Specify Surf,Sect,Cnt] with data " &
Dword_To_String(Dword_T(Datum), Binary, 16, true) & Dasher_NL &
"... MAP: " & Boolean_To_YN (State.Map_Enabled) &
", SURF:" & State.Surface'Image &
"., SECT:" & State.Sector'Image &
"., SECCNT:" & State.Sector_Cnt'Image);
end if;
end;
end if;
when N => -- dummy value for NIO - we just handle the flag below
null;
end case;
Handle_Flag (IO_Flag);
end Data_Out;
procedure Load_DKBT is
-- Load_DKBT - This proc mimics a system ROM routine to boot from disk.
-- Rather than copying a ROM routine (!) we simply mimic its basic actions...
-- Load 1st block from disk into location 0
begin
Ada.Text_IO.Put_Line ("INFO: Load_DKBT called");
State.Command := Cmd_T'Pos(Recal);
Do_Command;
State.Mem_Addr := 0;
State.Sector_Cnt := -1;
State.Command := Cmd_T'Pos(Read);
Do_Command;
Loggers.Debug_Print (Dpf_Log, "INFO: Load_DKBT complete - " & Printable_Addr);
Ada.Text_IO.Put_Line ("INFO: Load_DKBT completed");
end Load_DKBT;
end Drives;
-- Create_Blank creates an empty disk file of the correct size for the disk6061 emulator to use
procedure Create_Blank (Image_Name : in String; OK : out Boolean) is
Tmp_File : Sector_IO.File_Type;
Empty_Sector : constant Sector := (others => 0);
begin
Sector_IO.Create (Tmp_File, Out_File, Image_Name);
for S in 1 .. Sectors_Per_Disk loop
Sector_IO.Write (Tmp_File, Empty_Sector);
end loop;
Sector_IO.Close (Tmp_File);
OK := True;
exception
when Error : others =>
Loggers.Debug_Print
(Debug_Log,
"WARNING: Could not create disk image due to " &
Exception_Information (Error));
OK := False;
end Create_Blank;
task body Status_Sender is
Status : Status_Rec;
begin
accept Start do
Ada.Text_IO.Put_Line ("INFO: DPF Status Sender started");
end Start;
loop
Status := Drives.Get_Status;
Status_Monitor.Monitor.DPF_Update (Status);
delay 0.5;
end loop;
end Status_Sender;
end Devices.Disk6061;
|
-----------------------------------------------------------------------
-- json -- JSON Reader
-- Copyright (C) 2010, 2011, 2014, 2017 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Strings.Unbounded;
with Ada.Text_IO;
with Ada.Command_Line;
with Util.Serialize.IO.JSON;
with Ada.Containers;
with Mapping;
with Util.Serialize.Mappers.Vector_Mapper;
with Util.Streams.Texts;
with Util.Streams.Buffered;
procedure Json is
use Util.Streams.Buffered;
use Ada.Strings.Unbounded;
use type Ada.Containers.Count_Type;
use Mapping;
Reader : Util.Serialize.IO.JSON.Parser;
Mapper : Util.Serialize.Mappers.Processing;
Count : constant Natural := Ada.Command_Line.Argument_Count;
package Person_Vector_Mapper is
new Util.Serialize.Mappers.Vector_Mapper (Vectors => Person_Vector,
Element_Mapper => Person_Mapper);
-- Mapping for a list of Person records (stored as a Vector).
Person_Vector_Mapping : aliased Person_Vector_Mapper.Mapper;
procedure Print (P : in Mapping.Person_Vector.Cursor);
procedure Print (P : in Mapping.Person);
procedure Print (P : in Mapping.Person) is
begin
Ada.Text_IO.Put_Line ("Name : " & To_String (P.Name));
Ada.Text_IO.Put_Line ("first_name : " & To_String (P.First_Name));
Ada.Text_IO.Put_Line ("last_name : " & To_String (P.Last_Name));
Ada.Text_IO.Put_Line ("Age : " & Natural'Image (P.Age));
Ada.Text_IO.Put_Line ("Street : " & To_String (P.Addr.Street));
Ada.Text_IO.Put_Line ("City : " & To_String (P.Addr.City));
Ada.Text_IO.Put_Line ("Zip : " & Natural'Image (P.Addr.Zip));
Ada.Text_IO.Put_Line ("Country : " & To_String (P.Addr.Country));
Ada.Text_IO.Put_Line ("Info : " & To_String (P.Addr.Info.Name)
& "=" & To_String (P.Addr.Info.Value));
end Print;
procedure Print (P : in Mapping.Person_Vector.Cursor) is
begin
Print (Mapping.Person_Vector.Element (P));
end Print;
begin
if Count = 0 then
Ada.Text_IO.Put_Line ("Usage: json file...");
return;
end if;
Person_Vector_Mapping.Set_Mapping (Mapping.Get_Person_Mapper);
Mapper.Add_Mapping ("/list", Person_Vector_Mapping'Unchecked_Access);
Mapper.Add_Mapping ("/person", Mapping.Get_Person_Mapper.all'Access);
for I in 1 .. Count loop
declare
S : constant String := Ada.Command_Line.Argument (I);
List : aliased Mapping.Person_Vector.Vector;
P : aliased Mapping.Person;
begin
Person_Vector_Mapper.Set_Context (Mapper, List'Unchecked_Access);
Mapping.Person_Mapper.Set_Context (Mapper, P'Unchecked_Access);
Reader.Parse (S, Mapper);
-- The list now contains our elements.
List.Iterate (Process => Print'Access);
if List.Length = 0 then
Print (P);
end if;
declare
Buffer : aliased Util.Streams.Buffered.Output_Buffer_Stream;
Print : aliased Util.Streams.Texts.Print_Stream;
Output : Util.Serialize.IO.JSON.Output_Stream;
begin
Buffer.Initialize (Size => 10000);
Print.Initialize (Buffer'Unchecked_Access);
Output.Initialize (Print'Unchecked_Access);
Mapping.Get_Person_Mapper.Write (Output, P);
Ada.Text_IO.Put_Line ("Person: "
& Util.Streams.Texts.To_String (Print));
end;
declare
Buffer : aliased Util.Streams.Buffered.Output_Buffer_Stream;
Print : aliased Util.Streams.Texts.Print_Stream;
Output : Util.Serialize.IO.JSON.Output_Stream;
begin
Buffer.Initialize (Size => 10000);
Print.Initialize (Buffer'Unchecked_Access);
Output.Initialize (Print'Unchecked_Access);
Output.Write ("{""list"":");
Person_Vector_Mapping.Write (Output, List);
Output.Write ("}");
Ada.Text_IO.Put_Line ("IO:");
Ada.Text_IO.Put_Line (Util.Streams.Texts.To_String (Print));
end;
end;
end loop;
end Json;
|
pragma Ada_2005;
pragma Style_Checks (Off);
pragma Warnings (Off);
with Interfaces.C; use Interfaces.C;
-- with GStreamer.GST_Low_Level.glib_2_0_glib_gquark_h;
with glib;
with glib;
with glib.Values;
with System;
-- limited with GStreamer.GST_Low_Level.glib_2_0_glib_garray_h;
with System;
with Interfaces.C.Strings;
with GLIB; -- with GStreamer.GST_Low_Level.glibconfig_h;
with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h;
package GStreamer.GST_Low_Level.gstreamer_0_10_gst_gststructure_h is
-- unsupported macro: GST_TYPE_STRUCTURE (gst_structure_get_type ())
-- arg-macro: function GST_STRUCTURE (object)
-- return (GstStructure *)(object);
-- arg-macro: function GST_IS_STRUCTURE (object)
-- return (object) and then (GST_STRUCTURE(object).type = GST_TYPE_STRUCTURE);
-- GStreamer
-- * Copyright (C) 2003 David A. Schleef <ds@schleef.org>
-- *
-- * This library is free software; you can redistribute it and/or
-- * modify it under the terms of the GNU Library General Public
-- * License as published by the Free Software Foundation; either
-- * version 2 of the License, or (at your option) any later version.
-- *
-- * This library is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- * Library General Public License for more details.
-- *
-- * You should have received a copy of the GNU Library General Public
-- * License along with this library; if not, write to the
-- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-- * Boston, MA 02111-1307, USA.
--
type GstStructure;
--subtype GstStructure is u_GstStructure; -- gst/gststructure.h:35
--*
-- * GstStructureForeachFunc:
-- * @field_id: the #GQuark of the field name
-- * @value: the #GValue of the field
-- * @user_data: user data
-- *
-- * A function that will be called in gst_structure_foreach(). The function may
-- * not modify @value.
-- *
-- * Returns: TRUE if the foreach operation should continue, FALSE if
-- * the foreach operation should stop with FALSE.
--
type GstStructureForeachFunc is access function
(arg1 : Glib.GQuark;
arg2 : access constant Glib.Values.GValue;
arg3 : System.Address) return GLIB.gboolean;
pragma Convention (C, GstStructureForeachFunc); -- gst/gststructure.h:49
--*
-- * GstStructureMapFunc:
-- * @field_id: the #GQuark of the field name
-- * @value: the #GValue of the field
-- * @user_data: user data
-- *
-- * A function that will be called in gst_structure_map_in_place(). The function
-- * may modify @value.
-- *
-- * Returns: TRUE if the map operation should continue, FALSE if
-- * the map operation should stop with FALSE.
--
type GstStructureMapFunc is access function
(arg1 : Glib.GQuark;
arg2 : access Glib.Values.GValue;
arg3 : System.Address) return GLIB.gboolean;
pragma Convention (C, GstStructureMapFunc); -- gst/gststructure.h:65
--*
-- * GstStructure:
-- * @type: the GType of a structure
-- *
-- * The GstStructure object. Most fields are private.
--
type GstStructure is record
c_type : aliased GLIB.GType; -- gst/gststructure.h:76
name : aliased Glib.GQuark; -- gst/gststructure.h:79
parent_refcount : access GLIB.gint; -- gst/gststructure.h:82
fields : System.Address; -- access GStreamer.GST_Low_Level.glib_2_0_glib_garray_h.GArray -- gst/gststructure.h:84
u_gst_reserved : System.Address; -- gst/gststructure.h:86
end record;
pragma Convention (C_Pass_By_Copy, GstStructure); -- gst/gststructure.h:75
--< private >
-- owned by parent structure, NULL if no parent
function gst_structure_get_type return GLIB.GType; -- gst/gststructure.h:89
pragma Import (C, gst_structure_get_type, "gst_structure_get_type");
function gst_structure_empty_new (name : access GLIB.gchar) return access GstStructure; -- gst/gststructure.h:91
pragma Import (C, gst_structure_empty_new, "gst_structure_empty_new");
function gst_structure_id_empty_new (quark : Glib.GQuark) return access GstStructure; -- gst/gststructure.h:92
pragma Import (C, gst_structure_id_empty_new, "gst_structure_id_empty_new");
function gst_structure_new (name : access GLIB.gchar; firstfield : access GLIB.gchar -- , ...
) return access GstStructure; -- gst/gststructure.h:93
pragma Import (C, gst_structure_new, "gst_structure_new");
function gst_structure_new_valist
(name : access GLIB.gchar;
firstfield : access GLIB.gchar;
varargs : access System.Address) return access GstStructure; -- gst/gststructure.h:96
pragma Import (C, gst_structure_new_valist, "gst_structure_new_valist");
function gst_structure_id_new (name_quark : Glib.GQuark; field_quark : Glib.GQuark -- , ...
) return access GstStructure; -- gst/gststructure.h:99
pragma Import (C, gst_structure_id_new, "gst_structure_id_new");
function gst_structure_copy (structure : access constant GstStructure) return access GstStructure; -- gst/gststructure.h:102
pragma Import (C, gst_structure_copy, "gst_structure_copy");
procedure gst_structure_set_parent_refcount (structure : access GstStructure; refcount : access GLIB.gint); -- gst/gststructure.h:103
pragma Import (C, gst_structure_set_parent_refcount, "gst_structure_set_parent_refcount");
procedure gst_structure_free (structure : access GstStructure); -- gst/gststructure.h:105
pragma Import (C, gst_structure_free, "gst_structure_free");
function gst_structure_get_name (structure : access constant GstStructure) return access GLIB.gchar; -- gst/gststructure.h:107
pragma Import (C, gst_structure_get_name, "gst_structure_get_name");
function gst_structure_get_name_id (structure : access constant GstStructure) return Glib.GQuark; -- gst/gststructure.h:108
pragma Import (C, gst_structure_get_name_id, "gst_structure_get_name_id");
function gst_structure_has_name (structure : access constant GstStructure; name : access GLIB.gchar) return GLIB.gboolean; -- gst/gststructure.h:109
pragma Import (C, gst_structure_has_name, "gst_structure_has_name");
procedure gst_structure_set_name (structure : access GstStructure; name : access GLIB.gchar); -- gst/gststructure.h:111
pragma Import (C, gst_structure_set_name, "gst_structure_set_name");
procedure gst_structure_id_set_value
(structure : access GstStructure;
field : Glib.GQuark;
value : access constant Glib.Values.GValue); -- gst/gststructure.h:114
pragma Import (C, gst_structure_id_set_value, "gst_structure_id_set_value");
procedure gst_structure_set_value
(structure : access GstStructure;
fieldname : access GLIB.gchar;
value : access constant Glib.Values.GValue); -- gst/gststructure.h:117
pragma Import (C, gst_structure_set_value, "gst_structure_set_value");
procedure gst_structure_id_take_value
(structure : access GstStructure;
field : Glib.GQuark;
value : access Glib.Values.GValue); -- gst/gststructure.h:120
pragma Import (C, gst_structure_id_take_value, "gst_structure_id_take_value");
procedure gst_structure_take_value
(structure : access GstStructure;
fieldname : access GLIB.gchar;
value : access Glib.Values.GValue); -- gst/gststructure.h:123
pragma Import (C, gst_structure_take_value, "gst_structure_take_value");
procedure gst_structure_set (structure : access GstStructure; fieldname : access GLIB.gchar -- , ...
); -- gst/gststructure.h:126
pragma Import (C, gst_structure_set, "gst_structure_set");
procedure gst_structure_set_valist
(structure : access GstStructure;
fieldname : access GLIB.gchar;
varargs : access System.Address); -- gst/gststructure.h:130
pragma Import (C, gst_structure_set_valist, "gst_structure_set_valist");
procedure gst_structure_id_set (structure : access GstStructure; fieldname : Glib.GQuark -- , ...
); -- gst/gststructure.h:134
pragma Import (C, gst_structure_id_set, "gst_structure_id_set");
procedure gst_structure_id_set_valist
(structure : access GstStructure;
fieldname : Glib.GQuark;
varargs : access System.Address); -- gst/gststructure.h:138
pragma Import (C, gst_structure_id_set_valist, "gst_structure_id_set_valist");
function gst_structure_get_valist
(structure : access constant GstStructure;
first_fieldname : Interfaces.C.Strings.chars_ptr;
args : access System.Address) return GLIB.gboolean; -- gst/gststructure.h:142
pragma Import (C, gst_structure_get_valist, "gst_structure_get_valist");
function gst_structure_get (structure : access constant GstStructure; first_fieldname : Interfaces.C.Strings.chars_ptr -- , ...
) return GLIB.gboolean; -- gst/gststructure.h:146
pragma Import (C, gst_structure_get, "gst_structure_get");
function gst_structure_id_get_valist
(structure : access constant GstStructure;
first_field_id : Glib.GQuark;
args : access System.Address) return GLIB.gboolean; -- gst/gststructure.h:150
pragma Import (C, gst_structure_id_get_valist, "gst_structure_id_get_valist");
function gst_structure_id_get (structure : access constant GstStructure; first_field_id : Glib.GQuark -- , ...
) return GLIB.gboolean; -- gst/gststructure.h:154
pragma Import (C, gst_structure_id_get, "gst_structure_id_get");
function gst_structure_id_get_value (structure : access constant GstStructure; field : Glib.GQuark) return access constant Glib.Values.GValue; -- gst/gststructure.h:158
pragma Import (C, gst_structure_id_get_value, "gst_structure_id_get_value");
function gst_structure_get_value (structure : access constant GstStructure; fieldname : access GLIB.gchar) return access constant Glib.Values.GValue; -- gst/gststructure.h:160
pragma Import (C, gst_structure_get_value, "gst_structure_get_value");
procedure gst_structure_remove_field (structure : access GstStructure; fieldname : access GLIB.gchar); -- gst/gststructure.h:162
pragma Import (C, gst_structure_remove_field, "gst_structure_remove_field");
procedure gst_structure_remove_fields (structure : access GstStructure; fieldname : access GLIB.gchar -- , ...
); -- gst/gststructure.h:164
pragma Import (C, gst_structure_remove_fields, "gst_structure_remove_fields");
procedure gst_structure_remove_fields_valist
(structure : access GstStructure;
fieldname : access GLIB.gchar;
varargs : access System.Address); -- gst/gststructure.h:167
pragma Import (C, gst_structure_remove_fields_valist, "gst_structure_remove_fields_valist");
procedure gst_structure_remove_all_fields (structure : access GstStructure); -- gst/gststructure.h:170
pragma Import (C, gst_structure_remove_all_fields, "gst_structure_remove_all_fields");
function gst_structure_get_field_type (structure : access constant GstStructure; fieldname : access GLIB.gchar) return GLIB.GType; -- gst/gststructure.h:172
pragma Import (C, gst_structure_get_field_type, "gst_structure_get_field_type");
function gst_structure_foreach
(structure : access constant GstStructure;
func : GstStructureForeachFunc;
user_data : System.Address) return GLIB.gboolean; -- gst/gststructure.h:174
pragma Import (C, gst_structure_foreach, "gst_structure_foreach");
function gst_structure_map_in_place
(structure : access GstStructure;
func : GstStructureMapFunc;
user_data : System.Address) return GLIB.gboolean; -- gst/gststructure.h:177
pragma Import (C, gst_structure_map_in_place, "gst_structure_map_in_place");
function gst_structure_n_fields (structure : access constant GstStructure) return GLIB.gint; -- gst/gststructure.h:180
pragma Import (C, gst_structure_n_fields, "gst_structure_n_fields");
function gst_structure_nth_field_name (structure : access constant GstStructure; index : GLIB.guint) return access GLIB.gchar; -- gst/gststructure.h:181
pragma Import (C, gst_structure_nth_field_name, "gst_structure_nth_field_name");
function gst_structure_id_has_field (structure : access constant GstStructure; field : Glib.GQuark) return GLIB.gboolean; -- gst/gststructure.h:182
pragma Import (C, gst_structure_id_has_field, "gst_structure_id_has_field");
function gst_structure_id_has_field_typed
(structure : access constant GstStructure;
field : Glib.GQuark;
c_type : GLIB.GType) return GLIB.gboolean; -- gst/gststructure.h:184
pragma Import (C, gst_structure_id_has_field_typed, "gst_structure_id_has_field_typed");
function gst_structure_has_field (structure : access constant GstStructure; fieldname : access GLIB.gchar) return GLIB.gboolean; -- gst/gststructure.h:187
pragma Import (C, gst_structure_has_field, "gst_structure_has_field");
function gst_structure_has_field_typed
(structure : access constant GstStructure;
fieldname : access GLIB.gchar;
c_type : GLIB.GType) return GLIB.gboolean; -- gst/gststructure.h:189
pragma Import (C, gst_structure_has_field_typed, "gst_structure_has_field_typed");
-- utility functions
function gst_structure_get_boolean
(structure : access constant GstStructure;
fieldname : access GLIB.gchar;
value : access GLIB.gboolean) return GLIB.gboolean; -- gst/gststructure.h:194
pragma Import (C, gst_structure_get_boolean, "gst_structure_get_boolean");
function gst_structure_get_int
(structure : access constant GstStructure;
fieldname : access GLIB.gchar;
value : access GLIB.gint) return GLIB.gboolean; -- gst/gststructure.h:197
pragma Import (C, gst_structure_get_int, "gst_structure_get_int");
function gst_structure_get_uint
(structure : access constant GstStructure;
fieldname : access GLIB.gchar;
value : access GLIB.guint) return GLIB.gboolean; -- gst/gststructure.h:200
pragma Import (C, gst_structure_get_uint, "gst_structure_get_uint");
function gst_structure_get_fourcc
(structure : access constant GstStructure;
fieldname : access GLIB.gchar;
value : access GLIB.guint32) return GLIB.gboolean; -- gst/gststructure.h:203
pragma Import (C, gst_structure_get_fourcc, "gst_structure_get_fourcc");
function gst_structure_get_double
(structure : access constant GstStructure;
fieldname : access GLIB.gchar;
value : access GLIB.gdouble) return GLIB.gboolean; -- gst/gststructure.h:206
pragma Import (C, gst_structure_get_double, "gst_structure_get_double");
function gst_structure_get_date
(structure : access constant GstStructure;
fieldname : access GLIB.gchar;
value : System.Address) return GLIB.gboolean; -- gst/gststructure.h:209
pragma Import (C, gst_structure_get_date, "gst_structure_get_date");
function gst_structure_get_date_time
(structure : access constant GstStructure;
fieldname : access GLIB.gchar;
value : System.Address) return GLIB.gboolean; -- gst/gststructure.h:212
pragma Import (C, gst_structure_get_date_time, "gst_structure_get_date_time");
function gst_structure_get_clock_time
(structure : access constant GstStructure;
fieldname : access GLIB.gchar;
value : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h.GstClockTime) return GLIB.gboolean; -- gst/gststructure.h:215
pragma Import (C, gst_structure_get_clock_time, "gst_structure_get_clock_time");
function gst_structure_get_string (structure : access constant GstStructure; fieldname : access GLIB.gchar) return access GLIB.gchar; -- gst/gststructure.h:218
pragma Import (C, gst_structure_get_string, "gst_structure_get_string");
function gst_structure_get_enum
(structure : access constant GstStructure;
fieldname : access GLIB.gchar;
enumtype : GLIB.GType;
value : access GLIB.gint) return GLIB.gboolean; -- gst/gststructure.h:220
pragma Import (C, gst_structure_get_enum, "gst_structure_get_enum");
function gst_structure_get_fraction
(structure : access constant GstStructure;
fieldname : access GLIB.gchar;
value_numerator : access GLIB.gint;
value_denominator : access GLIB.gint) return GLIB.gboolean; -- gst/gststructure.h:224
pragma Import (C, gst_structure_get_fraction, "gst_structure_get_fraction");
function gst_structure_to_string (structure : access constant GstStructure) return access GLIB.gchar; -- gst/gststructure.h:229
pragma Import (C, gst_structure_to_string, "gst_structure_to_string");
function gst_structure_from_string (string : access GLIB.gchar; c_end : System.Address) return access GstStructure; -- gst/gststructure.h:230
pragma Import (C, gst_structure_from_string, "gst_structure_from_string");
function gst_structure_fixate_field_nearest_int
(structure : access GstStructure;
field_name : Interfaces.C.Strings.chars_ptr;
target : int) return GLIB.gboolean; -- gst/gststructure.h:233
pragma Import (C, gst_structure_fixate_field_nearest_int, "gst_structure_fixate_field_nearest_int");
function gst_structure_fixate_field_nearest_double
(structure : access GstStructure;
field_name : Interfaces.C.Strings.chars_ptr;
target : double) return GLIB.gboolean; -- gst/gststructure.h:236
pragma Import (C, gst_structure_fixate_field_nearest_double, "gst_structure_fixate_field_nearest_double");
function gst_structure_fixate_field_boolean
(structure : access GstStructure;
field_name : Interfaces.C.Strings.chars_ptr;
target : GLIB.gboolean) return GLIB.gboolean; -- gst/gststructure.h:240
pragma Import (C, gst_structure_fixate_field_boolean, "gst_structure_fixate_field_boolean");
function gst_structure_fixate_field_string
(structure : access GstStructure;
field_name : Interfaces.C.Strings.chars_ptr;
target : access GLIB.gchar) return GLIB.gboolean; -- gst/gststructure.h:243
pragma Import (C, gst_structure_fixate_field_string, "gst_structure_fixate_field_string");
function gst_structure_fixate_field_nearest_fraction
(structure : access GstStructure;
field_name : Interfaces.C.Strings.chars_ptr;
target_numerator : GLIB.gint;
target_denominator : GLIB.gint) return GLIB.gboolean; -- gst/gststructure.h:246
pragma Import (C, gst_structure_fixate_field_nearest_fraction, "gst_structure_fixate_field_nearest_fraction");
function gst_structure_is_equal (structure1 : access constant GstStructure; structure2 : access constant GstStructure) return GLIB.gboolean; -- gst/gststructure.h:251
pragma Import (C, gst_structure_is_equal, "gst_structure_is_equal");
function gst_structure_is_subset (subset : access constant GstStructure; superset : access constant GstStructure) return GLIB.gboolean; -- gst/gststructure.h:253
pragma Import (C, gst_structure_is_subset, "gst_structure_is_subset");
function gst_structure_can_intersect (struct1 : access constant GstStructure; struct2 : access constant GstStructure) return GLIB.gboolean; -- gst/gststructure.h:255
pragma Import (C, gst_structure_can_intersect, "gst_structure_can_intersect");
function gst_structure_intersect (struct1 : access constant GstStructure; struct2 : access constant GstStructure) return access GstStructure; -- gst/gststructure.h:257
pragma Import (C, gst_structure_intersect, "gst_structure_intersect");
end GStreamer.GST_Low_Level.gstreamer_0_10_gst_gststructure_h;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
limited with AMF.UML.Read_Structural_Feature_Actions;
package AMF.Utp.Timer_Running_Actions is
pragma Preelaborate;
type Utp_Timer_Running_Action is limited interface;
type Utp_Timer_Running_Action_Access is
access all Utp_Timer_Running_Action'Class;
for Utp_Timer_Running_Action_Access'Storage_Size use 0;
not overriding function Get_Base_Read_Structural_Feature_Action
(Self : not null access constant Utp_Timer_Running_Action)
return AMF.UML.Read_Structural_Feature_Actions.UML_Read_Structural_Feature_Action_Access is abstract;
-- Getter of TimerRunningAction::base_ReadStructuralFeatureAction.
--
not overriding procedure Set_Base_Read_Structural_Feature_Action
(Self : not null access Utp_Timer_Running_Action;
To : AMF.UML.Read_Structural_Feature_Actions.UML_Read_Structural_Feature_Action_Access) is abstract;
-- Setter of TimerRunningAction::base_ReadStructuralFeatureAction.
--
end AMF.Utp.Timer_Running_Actions;
|
-- This spec has been automatically generated from STM32WB55x.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package STM32_SVD.FLASH is
pragma Preelaborate;
---------------
-- Registers --
---------------
subtype ACR_LATENCY_Field is HAL.UInt3;
type ACR_Register is record
LATENCY : ACR_LATENCY_Field := 16#0#;
-- unspecified
Reserved_3_7 : HAL.UInt5 := 16#0#;
PRFTEN : Boolean := False;
ICEN : Boolean := False;
DCEN : Boolean := False;
ICRST : Boolean := False;
DCRST : Boolean := False;
-- unspecified
Reserved_13_14 : HAL.UInt2 := 16#0#;
PES : Boolean := False;
EMPTY : Boolean := False;
-- unspecified
Reserved_17_31 : HAL.UInt15 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for ACR_Register use record
LATENCY at 0 range 0 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
PRFTEN at 0 range 8 .. 8;
ICEN at 0 range 9 .. 9;
DCEN at 0 range 10 .. 10;
ICRST at 0 range 11 .. 11;
DCRST at 0 range 12 .. 12;
Reserved_13_14 at 0 range 13 .. 14;
PES at 0 range 15 .. 15;
EMPTY at 0 range 16 .. 16;
Reserved_17_31 at 0 range 17 .. 31;
end record;
type SR_Register is record
EOP : Boolean := False;
OPERR : Boolean := False;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
PROGERR : Boolean := False;
WRPERR : Boolean := False;
PGAERR : Boolean := False;
SIZERR : Boolean := False;
PGSERR : Boolean := False;
MISERR : Boolean := False;
FASTERR : Boolean := False;
-- unspecified
Reserved_10_12 : HAL.UInt3 := 16#0#;
OPTNV : Boolean := False;
RDERR : Boolean := False;
OPTVERR : Boolean := False;
BSY : Boolean := False;
-- unspecified
Reserved_17_17 : HAL.Bit := 16#0#;
CFGBSY : Boolean := False;
PESD : Boolean := False;
-- unspecified
Reserved_20_31 : HAL.UInt12 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SR_Register use record
EOP at 0 range 0 .. 0;
OPERR at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
PROGERR at 0 range 3 .. 3;
WRPERR at 0 range 4 .. 4;
PGAERR at 0 range 5 .. 5;
SIZERR at 0 range 6 .. 6;
PGSERR at 0 range 7 .. 7;
MISERR at 0 range 8 .. 8;
FASTERR at 0 range 9 .. 9;
Reserved_10_12 at 0 range 10 .. 12;
OPTNV at 0 range 13 .. 13;
RDERR at 0 range 14 .. 14;
OPTVERR at 0 range 15 .. 15;
BSY at 0 range 16 .. 16;
Reserved_17_17 at 0 range 17 .. 17;
CFGBSY at 0 range 18 .. 18;
PESD at 0 range 19 .. 19;
Reserved_20_31 at 0 range 20 .. 31;
end record;
subtype CR_PNB_Field is HAL.UInt8;
type CR_Register is record
PG : Boolean := False;
PER : Boolean := False;
MER : Boolean := False;
PNB : CR_PNB_Field := 16#0#;
-- unspecified
Reserved_11_15 : HAL.UInt5 := 16#0#;
STRT : Boolean := False;
OPTSTRT : Boolean := False;
FSTPG : Boolean := False;
-- unspecified
Reserved_19_23 : HAL.UInt5 := 16#0#;
EOPIE : Boolean := False;
ERRIE : Boolean := False;
RDERRIE : Boolean := False;
OBL_LAUNCH : Boolean := False;
-- unspecified
Reserved_28_29 : HAL.UInt2 := 16#0#;
OPTLOCK : Boolean := False;
LOCK : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CR_Register use record
PG at 0 range 0 .. 0;
PER at 0 range 1 .. 1;
MER at 0 range 2 .. 2;
PNB at 0 range 3 .. 10;
Reserved_11_15 at 0 range 11 .. 15;
STRT at 0 range 16 .. 16;
OPTSTRT at 0 range 17 .. 17;
FSTPG at 0 range 18 .. 18;
Reserved_19_23 at 0 range 19 .. 23;
EOPIE at 0 range 24 .. 24;
ERRIE at 0 range 25 .. 25;
RDERRIE at 0 range 26 .. 26;
OBL_LAUNCH at 0 range 27 .. 27;
Reserved_28_29 at 0 range 28 .. 29;
OPTLOCK at 0 range 30 .. 30;
LOCK at 0 range 31 .. 31;
end record;
subtype ECCR_ADDR_ECC_Field is HAL.UInt17;
subtype ECCR_CPUID_Field is HAL.UInt3;
type ECCR_Register is record
ADDR_ECC : ECCR_ADDR_ECC_Field := 16#0#;
-- unspecified
Reserved_17_19 : HAL.UInt3 := 16#0#;
SYSF_ECC : Boolean := False;
-- unspecified
Reserved_21_23 : HAL.UInt3 := 16#0#;
ECCCIE : Boolean := False;
-- unspecified
Reserved_25_25 : HAL.Bit := 16#0#;
CPUID : ECCR_CPUID_Field := 16#0#;
-- unspecified
Reserved_29_29 : HAL.Bit := 16#0#;
ECCC : Boolean := False;
ECCD : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for ECCR_Register use record
ADDR_ECC at 0 range 0 .. 16;
Reserved_17_19 at 0 range 17 .. 19;
SYSF_ECC at 0 range 20 .. 20;
Reserved_21_23 at 0 range 21 .. 23;
ECCCIE at 0 range 24 .. 24;
Reserved_25_25 at 0 range 25 .. 25;
CPUID at 0 range 26 .. 28;
Reserved_29_29 at 0 range 29 .. 29;
ECCC at 0 range 30 .. 30;
ECCD at 0 range 31 .. 31;
end record;
subtype OPTR_RDP_Field is HAL.UInt8;
subtype OPTR_BOR_LEV_Field is HAL.UInt3;
subtype OPTR_AGC_TRIM_Field is HAL.UInt3;
type OPTR_Register is record
RDP : OPTR_RDP_Field := 16#0#;
ESE : Boolean := False;
BOR_LEV : OPTR_BOR_LEV_Field := 16#0#;
nRST_STOP : Boolean := False;
nRST_STDBY : Boolean := False;
nRST_SHDW : Boolean := False;
-- unspecified
Reserved_15_15 : HAL.Bit := 16#0#;
IWDG_SW : Boolean := False;
IWDG_STOP : Boolean := False;
IWDG_STBY : Boolean := False;
WWDG_SW : Boolean := False;
-- unspecified
Reserved_20_22 : HAL.UInt3 := 16#0#;
nBOOT1 : Boolean := False;
SRAM2_PE : Boolean := False;
SRAM2_RST : Boolean := False;
nSWBOOT0 : Boolean := False;
nBOOT0 : Boolean := False;
-- unspecified
Reserved_28_28 : HAL.Bit := 16#0#;
AGC_TRIM : OPTR_AGC_TRIM_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for OPTR_Register use record
RDP at 0 range 0 .. 7;
ESE at 0 range 8 .. 8;
BOR_LEV at 0 range 9 .. 11;
nRST_STOP at 0 range 12 .. 12;
nRST_STDBY at 0 range 13 .. 13;
nRST_SHDW at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
IWDG_SW at 0 range 16 .. 16;
IWDG_STOP at 0 range 17 .. 17;
IWDG_STBY at 0 range 18 .. 18;
WWDG_SW at 0 range 19 .. 19;
Reserved_20_22 at 0 range 20 .. 22;
nBOOT1 at 0 range 23 .. 23;
SRAM2_PE at 0 range 24 .. 24;
SRAM2_RST at 0 range 25 .. 25;
nSWBOOT0 at 0 range 26 .. 26;
nBOOT0 at 0 range 27 .. 27;
Reserved_28_28 at 0 range 28 .. 28;
AGC_TRIM at 0 range 29 .. 31;
end record;
subtype PCROP1ASR_PCROP1A_STRT_Field is HAL.UInt9;
type PCROP1ASR_Register is record
PCROP1A_STRT : PCROP1ASR_PCROP1A_STRT_Field := 16#0#;
-- unspecified
Reserved_9_31 : HAL.UInt23 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for PCROP1ASR_Register use record
PCROP1A_STRT at 0 range 0 .. 8;
Reserved_9_31 at 0 range 9 .. 31;
end record;
subtype PCROP1AER_PCROP1A_END_Field is HAL.UInt9;
type PCROP1AER_Register is record
PCROP1A_END : PCROP1AER_PCROP1A_END_Field := 16#0#;
-- unspecified
Reserved_9_30 : HAL.UInt22 := 16#0#;
PCROP_RDP : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for PCROP1AER_Register use record
PCROP1A_END at 0 range 0 .. 8;
Reserved_9_30 at 0 range 9 .. 30;
PCROP_RDP at 0 range 31 .. 31;
end record;
subtype WRP1AR_WRP1A_STRT_Field is HAL.UInt8;
subtype WRP1AR_WRP1A_END_Field is HAL.UInt8;
type WRP1AR_Register is record
WRP1A_STRT : WRP1AR_WRP1A_STRT_Field := 16#0#;
-- unspecified
Reserved_8_15 : HAL.UInt8 := 16#0#;
WRP1A_END : WRP1AR_WRP1A_END_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for WRP1AR_Register use record
WRP1A_STRT at 0 range 0 .. 7;
Reserved_8_15 at 0 range 8 .. 15;
WRP1A_END at 0 range 16 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype WRP1BR_WRP1B_STRT_Field is HAL.UInt8;
subtype WRP1BR_WRP1B_END_Field is HAL.UInt8;
type WRP1BR_Register is record
WRP1B_STRT : WRP1BR_WRP1B_STRT_Field := 16#0#;
-- unspecified
Reserved_8_15 : HAL.UInt8 := 16#0#;
WRP1B_END : WRP1BR_WRP1B_END_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for WRP1BR_Register use record
WRP1B_STRT at 0 range 0 .. 7;
Reserved_8_15 at 0 range 8 .. 15;
WRP1B_END at 0 range 16 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype PCROP1BSR_PCROP1B_STRT_Field is HAL.UInt9;
type PCROP1BSR_Register is record
PCROP1B_STRT : PCROP1BSR_PCROP1B_STRT_Field := 16#0#;
-- unspecified
Reserved_9_31 : HAL.UInt23 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for PCROP1BSR_Register use record
PCROP1B_STRT at 0 range 0 .. 8;
Reserved_9_31 at 0 range 9 .. 31;
end record;
subtype PCROP1BER_PCROP1B_END_Field is HAL.UInt9;
type PCROP1BER_Register is record
PCROP1B_END : PCROP1BER_PCROP1B_END_Field := 16#0#;
-- unspecified
Reserved_9_31 : HAL.UInt23 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for PCROP1BER_Register use record
PCROP1B_END at 0 range 0 .. 8;
Reserved_9_31 at 0 range 9 .. 31;
end record;
subtype IPCCBR_IPCCDBA_Field is HAL.UInt14;
type IPCCBR_Register is record
IPCCDBA : IPCCBR_IPCCDBA_Field := 16#0#;
-- unspecified
Reserved_14_31 : HAL.UInt18 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for IPCCBR_Register use record
IPCCDBA at 0 range 0 .. 13;
Reserved_14_31 at 0 range 14 .. 31;
end record;
type C2ACR_Register is record
-- unspecified
Reserved_0_7 : HAL.UInt8 := 16#0#;
PRFTEN : Boolean := False;
ICEN : Boolean := False;
-- unspecified
Reserved_10_10 : HAL.Bit := 16#0#;
ICRST : Boolean := False;
-- unspecified
Reserved_12_14 : HAL.UInt3 := 16#0#;
PES : Boolean := False;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for C2ACR_Register use record
Reserved_0_7 at 0 range 0 .. 7;
PRFTEN at 0 range 8 .. 8;
ICEN at 0 range 9 .. 9;
Reserved_10_10 at 0 range 10 .. 10;
ICRST at 0 range 11 .. 11;
Reserved_12_14 at 0 range 12 .. 14;
PES at 0 range 15 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
type C2SR_Register is record
EOP : Boolean := False;
OPERR : Boolean := False;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
PROGERR : Boolean := False;
WRPERR : Boolean := False;
PGAERR : Boolean := False;
SIZERR : Boolean := False;
PGSERR : Boolean := False;
MISERR : Boolean := False;
FASTERR : Boolean := False;
-- unspecified
Reserved_10_13 : HAL.UInt4 := 16#0#;
RDERR : Boolean := False;
-- unspecified
Reserved_15_15 : HAL.Bit := 16#0#;
BSY : Boolean := False;
-- unspecified
Reserved_17_17 : HAL.Bit := 16#0#;
CFGBSY : Boolean := False;
PESD : Boolean := False;
-- unspecified
Reserved_20_31 : HAL.UInt12 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for C2SR_Register use record
EOP at 0 range 0 .. 0;
OPERR at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
PROGERR at 0 range 3 .. 3;
WRPERR at 0 range 4 .. 4;
PGAERR at 0 range 5 .. 5;
SIZERR at 0 range 6 .. 6;
PGSERR at 0 range 7 .. 7;
MISERR at 0 range 8 .. 8;
FASTERR at 0 range 9 .. 9;
Reserved_10_13 at 0 range 10 .. 13;
RDERR at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
BSY at 0 range 16 .. 16;
Reserved_17_17 at 0 range 17 .. 17;
CFGBSY at 0 range 18 .. 18;
PESD at 0 range 19 .. 19;
Reserved_20_31 at 0 range 20 .. 31;
end record;
subtype C2CR_PNB_Field is HAL.UInt8;
type C2CR_Register is record
PG : Boolean := False;
PER : Boolean := False;
MER : Boolean := False;
PNB : C2CR_PNB_Field := 16#0#;
-- unspecified
Reserved_11_15 : HAL.UInt5 := 16#0#;
STRT : Boolean := False;
-- unspecified
Reserved_17_17 : HAL.Bit := 16#0#;
FSTPG : Boolean := False;
-- unspecified
Reserved_19_23 : HAL.UInt5 := 16#0#;
EOPIE : Boolean := False;
ERRIE : Boolean := False;
RDERRIE : Boolean := False;
-- unspecified
Reserved_27_31 : HAL.UInt5 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for C2CR_Register use record
PG at 0 range 0 .. 0;
PER at 0 range 1 .. 1;
MER at 0 range 2 .. 2;
PNB at 0 range 3 .. 10;
Reserved_11_15 at 0 range 11 .. 15;
STRT at 0 range 16 .. 16;
Reserved_17_17 at 0 range 17 .. 17;
FSTPG at 0 range 18 .. 18;
Reserved_19_23 at 0 range 19 .. 23;
EOPIE at 0 range 24 .. 24;
ERRIE at 0 range 25 .. 25;
RDERRIE at 0 range 26 .. 26;
Reserved_27_31 at 0 range 27 .. 31;
end record;
subtype SFR_SFSA_Field is HAL.UInt8;
type SFR_Register is record
SFSA : SFR_SFSA_Field := 16#0#;
FSD : Boolean := False;
-- unspecified
Reserved_9_11 : HAL.UInt3 := 16#0#;
DDS : Boolean := False;
-- unspecified
Reserved_13_31 : HAL.UInt19 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SFR_Register use record
SFSA at 0 range 0 .. 7;
FSD at 0 range 8 .. 8;
Reserved_9_11 at 0 range 9 .. 11;
DDS at 0 range 12 .. 12;
Reserved_13_31 at 0 range 13 .. 31;
end record;
subtype SRRVR_SBRV_Field is HAL.UInt18;
subtype SRRVR_SBRSA_Field is HAL.UInt5;
subtype SRRVR_SNBRSA_Field is HAL.UInt5;
type SRRVR_Register is record
SBRV : SRRVR_SBRV_Field := 16#0#;
SBRSA : SRRVR_SBRSA_Field := 16#0#;
BRSD : Boolean := False;
-- unspecified
Reserved_24_24 : HAL.Bit := 16#0#;
SNBRSA : SRRVR_SNBRSA_Field := 16#0#;
NBRSD : Boolean := False;
C2OPT : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SRRVR_Register use record
SBRV at 0 range 0 .. 17;
SBRSA at 0 range 18 .. 22;
BRSD at 0 range 23 .. 23;
Reserved_24_24 at 0 range 24 .. 24;
SNBRSA at 0 range 25 .. 29;
NBRSD at 0 range 30 .. 30;
C2OPT at 0 range 31 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
type FLASH_Peripheral is record
ACR : aliased ACR_Register;
KEYR : aliased HAL.UInt32;
OPTKEYR : aliased HAL.UInt32;
SR : aliased SR_Register;
CR : aliased CR_Register;
ECCR : aliased ECCR_Register;
OPTR : aliased OPTR_Register;
PCROP1ASR : aliased PCROP1ASR_Register;
PCROP1AER : aliased PCROP1AER_Register;
WRP1AR : aliased WRP1AR_Register;
WRP1BR : aliased WRP1BR_Register;
PCROP1BSR : aliased PCROP1BSR_Register;
PCROP1BER : aliased PCROP1BER_Register;
IPCCBR : aliased IPCCBR_Register;
C2ACR : aliased C2ACR_Register;
C2SR : aliased C2SR_Register;
C2CR : aliased C2CR_Register;
SFR : aliased SFR_Register;
SRRVR : aliased SRRVR_Register;
end record
with Volatile;
for FLASH_Peripheral use record
ACR at 16#0# range 0 .. 31;
KEYR at 16#8# range 0 .. 31;
OPTKEYR at 16#C# range 0 .. 31;
SR at 16#10# range 0 .. 31;
CR at 16#14# range 0 .. 31;
ECCR at 16#18# range 0 .. 31;
OPTR at 16#20# range 0 .. 31;
PCROP1ASR at 16#24# range 0 .. 31;
PCROP1AER at 16#28# range 0 .. 31;
WRP1AR at 16#2C# range 0 .. 31;
WRP1BR at 16#30# range 0 .. 31;
PCROP1BSR at 16#34# range 0 .. 31;
PCROP1BER at 16#38# range 0 .. 31;
IPCCBR at 16#3C# range 0 .. 31;
C2ACR at 16#5C# range 0 .. 31;
C2SR at 16#60# range 0 .. 31;
C2CR at 16#64# range 0 .. 31;
SFR at 16#80# range 0 .. 31;
SRRVR at 16#84# range 0 .. 31;
end record;
FLASH_Periph : aliased FLASH_Peripheral
with Import, Address => System'To_Address (16#58004000#);
end STM32_SVD.FLASH;
|
-- SPDX-FileCopyrightText: 2019 Max Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with Program.Elements.Anonymous_Access_Definitions;
with Program.Lexical_Elements;
with Program.Elements.Parameter_Specifications;
package Program.Elements.Anonymous_Access_To_Functions is
pragma Pure (Program.Elements.Anonymous_Access_To_Functions);
type Anonymous_Access_To_Function is
limited interface
and Program.Elements.Anonymous_Access_Definitions
.Anonymous_Access_Definition;
type Anonymous_Access_To_Function_Access is
access all Anonymous_Access_To_Function'Class with Storage_Size => 0;
not overriding function Parameters
(Self : Anonymous_Access_To_Function)
return Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access is abstract;
not overriding function Result_Subtype
(Self : Anonymous_Access_To_Function)
return not null Program.Elements.Element_Access is abstract;
not overriding function Has_Not_Null
(Self : Anonymous_Access_To_Function)
return Boolean is abstract;
not overriding function Has_Protected
(Self : Anonymous_Access_To_Function)
return Boolean is abstract;
not overriding function Has_Not_Null_2
(Self : Anonymous_Access_To_Function)
return Boolean is abstract;
type Anonymous_Access_To_Function_Text is limited interface;
type Anonymous_Access_To_Function_Text_Access is
access all Anonymous_Access_To_Function_Text'Class with Storage_Size => 0;
not overriding function To_Anonymous_Access_To_Function_Text
(Self : in out Anonymous_Access_To_Function)
return Anonymous_Access_To_Function_Text_Access is abstract;
not overriding function Not_Token
(Self : Anonymous_Access_To_Function_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Null_Token
(Self : Anonymous_Access_To_Function_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Access_Token
(Self : Anonymous_Access_To_Function_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Protected_Token
(Self : Anonymous_Access_To_Function_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Function_Token
(Self : Anonymous_Access_To_Function_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Left_Bracket_Token
(Self : Anonymous_Access_To_Function_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Right_Bracket_Token
(Self : Anonymous_Access_To_Function_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Return_Token
(Self : Anonymous_Access_To_Function_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Not_Token_2
(Self : Anonymous_Access_To_Function_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Null_Token_2
(Self : Anonymous_Access_To_Function_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
end Program.Elements.Anonymous_Access_To_Functions;
|
generic
type Element_T is private;
package Opt27_Pkg is
type Node_T is private;
type List_T is private;
function Is_Null (Node : in Node_T) return Boolean;
generic
type Template_T is private;
with function Is_Match
(Element : in Element_T;
Template : in Template_T) return Boolean is <>;
function Find_Elem (Template : Template_T; List : List_T) return Node_T;
private
type Node_Rec_T;
type Node_T is access Node_Rec_T;
type List_T is record
First_Node : Node_T := null;
Last_Node : Node_T := null;
end record;
end Opt27_Pkg;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . W I D E _ T E X T _ I O . T E X T _ S T R E A M S --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2020, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with System.File_IO;
package body Ada.Wide_Text_IO.Text_Streams is
------------
-- Stream --
------------
function Stream (File : File_Type) return Stream_Access is
begin
System.File_IO.Check_File_Open (FCB.AFCB_Ptr (File));
return Stream_Access (File);
end Stream;
end Ada.Wide_Text_IO.Text_Streams;
|
with
Interfaces.C.Strings,
System;
use type
System.Address;
package body FLTK.Widgets.Valuators.Sliders is
procedure slider_set_draw_hook
(W, D : in System.Address);
pragma Import (C, slider_set_draw_hook, "slider_set_draw_hook");
pragma Inline (slider_set_draw_hook);
procedure slider_set_handle_hook
(W, H : in System.Address);
pragma Import (C, slider_set_handle_hook, "slider_set_handle_hook");
pragma Inline (slider_set_handle_hook);
function new_fl_slider
(X, Y, W, H : in Interfaces.C.int;
Text : in Interfaces.C.char_array)
return System.Address;
pragma Import (C, new_fl_slider, "new_fl_slider");
pragma Inline (new_fl_slider);
procedure free_fl_slider
(D : in System.Address);
pragma Import (C, free_fl_slider, "free_fl_slider");
pragma Inline (free_fl_slider);
function fl_slider_get_type
(S : in System.Address)
return Interfaces.C.int;
pragma Import (C, fl_slider_get_type, "fl_slider_get_type");
pragma Inline (fl_slider_get_type);
procedure fl_slider_set_type
(S : in System.Address;
T : in Interfaces.C.int);
pragma Import (C, fl_slider_set_type, "fl_slider_set_type");
pragma Inline (fl_slider_set_type);
procedure fl_slider_set_bounds
(S : in System.Address;
A, B : in Interfaces.C.double);
pragma Import (C, fl_slider_set_bounds, "fl_slider_set_bounds");
pragma Inline (fl_slider_set_bounds);
function fl_slider_get_slider
(S : in System.Address)
return Interfaces.C.int;
pragma Import (C, fl_slider_get_slider, "fl_slider_get_slider");
pragma Inline (fl_slider_get_slider);
procedure fl_slider_set_slider
(S : in System.Address;
T : in Interfaces.C.int);
pragma Import (C, fl_slider_set_slider, "fl_slider_set_slider");
pragma Inline (fl_slider_set_slider);
function fl_slider_get_slider_size
(S : in System.Address)
return Interfaces.C.C_float;
pragma Import (C, fl_slider_get_slider_size, "fl_slider_get_slider_size");
pragma Inline (fl_slider_get_slider_size);
procedure fl_slider_set_slider_size
(S : in System.Address;
T : in Interfaces.C.C_float);
pragma Import (C, fl_slider_set_slider_size, "fl_slider_set_slider_size");
pragma Inline (fl_slider_set_slider_size);
function fl_slider_scrollvalue
(S : in System.Address;
P, Z, F, T : in Interfaces.C.int)
return Interfaces.C.int;
pragma Import (C, fl_slider_scrollvalue, "fl_slider_scrollvalue");
pragma Inline (fl_slider_scrollvalue);
procedure fl_slider_draw
(W : in System.Address);
pragma Import (C, fl_slider_draw, "fl_slider_draw");
pragma Inline (fl_slider_draw);
function fl_slider_handle
(W : in System.Address;
E : in Interfaces.C.int)
return Interfaces.C.int;
pragma Import (C, fl_slider_handle, "fl_slider_handle");
pragma Inline (fl_slider_handle);
procedure Finalize
(This : in out Slider) is
begin
if This.Void_Ptr /= System.Null_Address and then
This in Slider'Class
then
free_fl_slider (This.Void_Ptr);
This.Void_Ptr := System.Null_Address;
end if;
Finalize (Valuator (This));
end Finalize;
package body Forge is
function Create
(X, Y, W, H : in Integer;
Text : in String)
return Slider is
begin
return This : Slider do
This.Void_Ptr := new_fl_slider
(Interfaces.C.int (X),
Interfaces.C.int (Y),
Interfaces.C.int (W),
Interfaces.C.int (H),
Interfaces.C.To_C (Text));
fl_widget_set_user_data
(This.Void_Ptr,
Widget_Convert.To_Address (This'Unchecked_Access));
slider_set_draw_hook (This.Void_Ptr, Draw_Hook'Address);
slider_set_handle_hook (This.Void_Ptr, Handle_Hook'Address);
end return;
end Create;
end Forge;
function Get_Slider_Type
(This : in Slider)
return Slider_Kind is
begin
return Slider_Kind'Val (fl_slider_get_type (This.Void_Ptr));
end Get_Slider_Type;
procedure Set_Bounds
(This : in out Slider;
Min, Max : in Long_Float) is
begin
fl_slider_set_bounds
(This.Void_Ptr,
Interfaces.C.double (Min),
Interfaces.C.double (Max));
end Set_Bounds;
function Get_Box
(This : in Slider)
return Box_Kind is
begin
return Box_Kind'Val (fl_slider_get_slider (This.Void_Ptr));
end Get_Box;
procedure Set_Box
(This : in out Slider;
To : in Box_Kind) is
begin
fl_slider_set_slider (This.Void_Ptr, Box_Kind'Pos (To));
end Set_Box;
function Get_Slide_Size
(This : in Slider)
return Float is
begin
return Float (fl_slider_get_slider_size (This.Void_Ptr));
end Get_Slide_Size;
procedure Set_Slide_Size
(This : in out Slider;
To : in Float) is
begin
fl_slider_set_slider_size (This.Void_Ptr, Interfaces.C.C_float (To));
end Set_Slide_Size;
procedure Set_Scrollvalue
(This : in out Slider;
Pos_First_Line : in Natural;
Lines_In_Window : in Natural;
First_Line_Num : in Natural;
Total_Lines : in Natural)
is
Ignore_Me : Interfaces.C.int;
begin
Ignore_Me := fl_slider_scrollvalue
(This.Void_Ptr,
Interfaces.C.int (Pos_First_Line),
Interfaces.C.int (Lines_In_Window),
Interfaces.C.int (First_Line_Num),
Interfaces.C.int (Total_Lines));
end Set_Scrollvalue;
procedure Draw
(This : in out Slider) is
begin
fl_slider_draw (This.Void_Ptr);
end Draw;
function Handle
(This : in out Slider;
Event : in Event_Kind)
return Event_Outcome is
begin
return Event_Outcome'Val
(fl_slider_handle (This.Void_Ptr, Event_Kind'Pos (Event)));
end Handle;
package body Extra is
procedure Set_Slider_Type
(This : in out Slider;
To : in Slider_Kind) is
begin
fl_slider_set_type (This.Void_Ptr, Slider_Kind'Pos (To));
end Set_Slider_Type;
pragma Inline (Set_Slider_Type);
end Extra;
end FLTK.Widgets.Valuators.Sliders;
|
-----------------------------------------------------------------------
-- awa-wikis-modules-tests -- Unit tests for wikis service
-- Copyright (C) 2015 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Measures;
with Util.Test_Caller;
with AWA.Tests.Helpers;
with AWA.Tests.Helpers.Users;
with AWA.Services.Contexts;
with AWA.Counters.Definition;
with AWA.Users.Models;
with Security.Contexts;
package body AWA.Counters.Modules.Tests is
package User_Counter is
new AWA.Counters.Definition (AWA.Users.Models.USER_TABLE);
package Session_Counter is
new AWA.Counters.Definition (AWA.Users.Models.SESSION_TABLE);
package Global_Counter is
new AWA.Counters.Definition (null, "count");
package Caller is new Util.Test_Caller (Test, "Counters.Modules");
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is
begin
Caller.Add_Test (Suite, "Test AWA.Counters.Modules.Increment",
Test_Increment'Access);
Caller.Add_Test (Suite, "Test AWA.Counters.Modules.Increment (global counter)",
Test_Global_Counter'Access);
end Add_Tests;
-- ------------------------------
-- Test incrementing counters and flushing.
-- ------------------------------
procedure Test_Increment (T : in out Test) is
Sec_Ctx : Security.Contexts.Security_Context;
Context : AWA.Services.Contexts.Service_Context;
Before : Integer;
After : Integer;
begin
AWA.Tests.Helpers.Users.Login (Context, Sec_Ctx, "test-wiki@test.com");
T.Manager := AWA.Counters.Modules.Get_Counter_Module;
T.Assert (T.Manager /= null, "There is no counter plugin");
T.Manager.Get_Counter (User_Counter.Index, Context.Get_User, Before);
AWA.Counters.Increment (User_Counter.Index, Context.Get_User);
T.Manager.Flush;
T.Manager.Get_Counter (User_Counter.Index, Context.Get_User, After);
Util.Tests.Assert_Equals (T, Before + 1, After, "The counter must have been incremented");
declare
S : Util.Measures.Stamp;
begin
for I in 1 .. 1_000 loop
AWA.Counters.Increment (User_Counter.Index, Context.Get_User);
end loop;
Util.Measures.Report (S, "AWA.Counters.Increment", 1000);
end;
AWA.Counters.Increment (User_Counter.Index, Context.Get_User);
declare
S : Util.Measures.Stamp;
begin
T.Manager.Flush;
Util.Measures.Report (S, "AWA.Counters.Flush");
end;
T.Manager.Get_Counter (User_Counter.Index, Context.Get_User, After);
Util.Tests.Assert_Equals (T, Before + 2 + 1_000, After,
"The counter must have been incremented");
end Test_Increment;
-- ------------------------------
-- Test creation of a wiki page.
-- ------------------------------
-- Test incrementing a global counter.
procedure Test_Global_Counter (T : in out Test) is
Sec_Ctx : Security.Contexts.Security_Context;
Context : AWA.Services.Contexts.Service_Context;
begin
AWA.Tests.Helpers.Users.Login (Context, Sec_Ctx, "test-wiki@test.com");
T.Manager := AWA.Counters.Modules.Get_Counter_Module;
T.Assert (T.Manager /= null, "There is no counter plugin");
-- T.Manager.Get_Counter (Global_Counter.Index, Before);
AWA.Counters.Increment (Global_Counter.Index);
T.Manager.Flush;
end Test_Global_Counter;
end AWA.Counters.Modules.Tests;
|
with Ada.Exception_Identification.From_Here;
with Ada.Hierarchical_File_Names;
with System.Address_To_Named_Access_Conversions;
with System.Zero_Terminated_Strings;
with C.errno;
with C.stdlib;
with C.unistd;
package body System.Native_Directories.Temporary is
use Ada.Exception_Identification.From_Here;
use type C.char;
use type C.char_array;
use type C.char_ptr;
use type C.signed_int;
use type C.size_t;
package char_ptr_Conv is
new Address_To_Named_Access_Conversions (C.char, C.char_ptr);
Temp_Variable : constant C.char_array := "TMPDIR" & C.char'Val (0);
Temp_Template : constant C.char_array := "ADAXXXXXX" & C.char'Val (0);
procedure Put_Template (
Directory : String;
Template : not null C.char_ptr;
Length : out C.size_t);
procedure Put_Template (
Directory : String;
Template : not null C.char_ptr;
Length : out C.size_t)
is
Template_All : C.char_array (
0 ..
Directory'Length * Zero_Terminated_Strings.Expanding
+ 1 -- '/'
+ Temp_Template'Length);
for Template_All'Address use char_ptr_Conv.To_Address (Template);
begin
if Directory'Length = 0
or else Ada.Hierarchical_File_Names.Is_Current_Directory_Name (
Directory)
then
Length := 0;
else
Zero_Terminated_Strings.To_C (Directory, Template, Length);
if not Ada.Hierarchical_File_Names.Is_Path_Delimiter (
Character (Template_All (Length - 1))) -- Length > 0
then
Template_All (Length) :=
C.char (Ada.Hierarchical_File_Names.Default_Path_Delimiter);
Length := Length + 1;
end if;
end if;
Template_All (Length .. Length + (Temp_Template'Length - 1)) :=
Temp_Template;
Length := Length + (Temp_Template'Length - 1); -- exclude NUL
end Put_Template;
-- implementation
function Temporary_Directory return String is
Temp_Dir : C.char_ptr;
begin
Temp_Dir := C.stdlib.getenv (
Temp_Variable (Temp_Variable'First)'Access);
if Temp_Dir = null or else Temp_Dir.all = C.char'Val (0) then
return "."; -- Is_Current_Directory_Name (".") = True
else
return Zero_Terminated_Strings.Value (Temp_Dir);
end if;
end Temporary_Directory;
procedure Set_Temporary_Directory (Name : String) is
C_Name : C.char_array (
0 ..
Name'Length * Zero_Terminated_Strings.Expanding);
begin
Zero_Terminated_Strings.To_C (Name, C_Name (0)'Access);
if C.stdlib.setenv (
Temp_Variable (Temp_Variable'First)'Access,
C_Name (C_Name'First)'Access,
1) < 0
then
Raise_Exception (Use_Error'Identity);
end if;
end Set_Temporary_Directory;
function Create_Temporary_File (Directory : String) return String is
Template : C.char_array (
0 ..
Directory'Length * Zero_Terminated_Strings.Expanding
+ 1 -- '/'
+ Temp_Template'Length);
Length : C.size_t;
begin
Put_Template (Directory, Template (0)'Unchecked_Access, Length);
declare
Handle : C.signed_int;
begin
declare -- mkstemp where
use C.stdlib; -- Linux, POSIX.1-2008
use C.unistd; -- Darwin, FreeBSD
begin
Handle := mkstemp (Template (0)'Access);
end;
if Handle < 0 then
Raise_Exception (Named_IO_Exception_Id (C.errno.errno));
end if;
if C.unistd.close (Handle) < 0 then
Raise_Exception (IO_Exception_Id (C.errno.errno));
end if;
end;
return Zero_Terminated_Strings.Value (
Template (0)'Access,
Length);
end Create_Temporary_File;
function Create_Temporary_Directory (Directory : String) return String is
Template : C.char_array (
0 ..
Directory'Length * Zero_Terminated_Strings.Expanding
+ 1 -- '/'
+ Temp_Template'Length);
Length : C.size_t;
begin
Put_Template (Directory, Template (0)'Unchecked_Access, Length);
declare
Name : C.char_ptr;
begin
declare -- mkdtemp where
use C.stdlib; -- Linux, POSIX.1-2008
use C.unistd; -- Darwin, FreeBSD
begin
Name := mkdtemp (Template (0)'Access);
end;
if Name = null then
Raise_Exception (Named_IO_Exception_Id (C.errno.errno));
end if;
return Zero_Terminated_Strings.Value (Name, Length);
end;
end Create_Temporary_Directory;
end System.Native_Directories.Temporary;
|
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Command_Line; use Ada.Command_Line;
with Arbitrary; use Arbitrary;
with Arbitrary.Const; use Arbitrary.Const;
procedure Golden_Ratio is
precision : integer;
begin
if Argument_Count /= 1 then
Put_Line("usage: " & Command_Name & " <digits>");
return;
end if;
precision := integer'value(Argument(1));
declare
result : Arbitrary_Type(precision);
begin
result := Golden_Ratio(precision);
Display(result);
end;
end Golden_Ratio;
|
pragma Warnings (Off);
pragma Ada_95;
with System;
with System.Parameters;
with System.Secondary_Stack;
package ada_main is
gnat_argc : Integer;
gnat_argv : System.Address;
gnat_envp : System.Address;
pragma Import (C, gnat_argc);
pragma Import (C, gnat_argv);
pragma Import (C, gnat_envp);
gnat_exit_status : Integer;
pragma Import (C, gnat_exit_status);
GNAT_Version : constant String :=
"GNAT Version: Community 2020 (20200429-93)" & ASCII.NUL;
pragma Export (C, GNAT_Version, "__gnat_version");
Ada_Main_Program_Name : constant String := "_ada_crea_tarea_de_tipo" & ASCII.NUL;
pragma Export (C, Ada_Main_Program_Name, "__gnat_ada_main_program_name");
procedure adainit;
pragma Export (C, adainit, "adainit");
procedure adafinal;
pragma Export (C, adafinal, "adafinal");
function main
(argc : Integer;
argv : System.Address;
envp : System.Address)
return Integer;
pragma Export (C, main, "main");
type Version_32 is mod 2 ** 32;
u00001 : constant Version_32 := 16#f869088d#;
pragma Export (C, u00001, "crea_tarea_de_tipoB");
u00002 : constant Version_32 := 16#67c8d842#;
pragma Export (C, u00002, "system__standard_libraryB");
u00003 : constant Version_32 := 16#5741b5a5#;
pragma Export (C, u00003, "system__standard_libraryS");
u00004 : constant Version_32 := 16#ae860117#;
pragma Export (C, u00004, "system__soft_linksB");
u00005 : constant Version_32 := 16#4d9536d3#;
pragma Export (C, u00005, "system__soft_linksS");
u00006 : constant Version_32 := 16#32a08138#;
pragma Export (C, u00006, "systemS");
u00007 : constant Version_32 := 16#59d61025#;
pragma Export (C, u00007, "system__secondary_stackB");
u00008 : constant Version_32 := 16#c30bb6bc#;
pragma Export (C, u00008, "system__secondary_stackS");
u00009 : constant Version_32 := 16#76789da1#;
pragma Export (C, u00009, "adaS");
u00010 : constant Version_32 := 16#f34ff985#;
pragma Export (C, u00010, "ada__exceptionsB");
u00011 : constant Version_32 := 16#cfbb5cc5#;
pragma Export (C, u00011, "ada__exceptionsS");
u00012 : constant Version_32 := 16#35e1815f#;
pragma Export (C, u00012, "ada__exceptions__last_chance_handlerB");
u00013 : constant Version_32 := 16#cfec26ee#;
pragma Export (C, u00013, "ada__exceptions__last_chance_handlerS");
u00014 : constant Version_32 := 16#34742901#;
pragma Export (C, u00014, "system__exception_tableB");
u00015 : constant Version_32 := 16#0dc9c2c8#;
pragma Export (C, u00015, "system__exception_tableS");
u00016 : constant Version_32 := 16#ce4af020#;
pragma Export (C, u00016, "system__exceptionsB");
u00017 : constant Version_32 := 16#5ac3ecce#;
pragma Export (C, u00017, "system__exceptionsS");
u00018 : constant Version_32 := 16#69416224#;
pragma Export (C, u00018, "system__exceptions__machineB");
u00019 : constant Version_32 := 16#5c74e542#;
pragma Export (C, u00019, "system__exceptions__machineS");
u00020 : constant Version_32 := 16#aa0563fc#;
pragma Export (C, u00020, "system__exceptions_debugB");
u00021 : constant Version_32 := 16#2eed524e#;
pragma Export (C, u00021, "system__exceptions_debugS");
u00022 : constant Version_32 := 16#6c2f8802#;
pragma Export (C, u00022, "system__img_intB");
u00023 : constant Version_32 := 16#307b61fa#;
pragma Export (C, u00023, "system__img_intS");
u00024 : constant Version_32 := 16#ced09590#;
pragma Export (C, u00024, "system__storage_elementsB");
u00025 : constant Version_32 := 16#1f63cb3c#;
pragma Export (C, u00025, "system__storage_elementsS");
u00026 : constant Version_32 := 16#39df8c17#;
pragma Export (C, u00026, "system__tracebackB");
u00027 : constant Version_32 := 16#6c825ffc#;
pragma Export (C, u00027, "system__tracebackS");
u00028 : constant Version_32 := 16#9ed49525#;
pragma Export (C, u00028, "system__traceback_entriesB");
u00029 : constant Version_32 := 16#32fb7748#;
pragma Export (C, u00029, "system__traceback_entriesS");
u00030 : constant Version_32 := 16#3f39e75e#;
pragma Export (C, u00030, "system__traceback__symbolicB");
u00031 : constant Version_32 := 16#46491211#;
pragma Export (C, u00031, "system__traceback__symbolicS");
u00032 : constant Version_32 := 16#179d7d28#;
pragma Export (C, u00032, "ada__containersS");
u00033 : constant Version_32 := 16#701f9d88#;
pragma Export (C, u00033, "ada__exceptions__tracebackB");
u00034 : constant Version_32 := 16#ae2d2db5#;
pragma Export (C, u00034, "ada__exceptions__tracebackS");
u00035 : constant Version_32 := 16#e865e681#;
pragma Export (C, u00035, "system__bounded_stringsB");
u00036 : constant Version_32 := 16#455da021#;
pragma Export (C, u00036, "system__bounded_stringsS");
u00037 : constant Version_32 := 16#7b499e82#;
pragma Export (C, u00037, "system__crtlS");
u00038 : constant Version_32 := 16#896564a3#;
pragma Export (C, u00038, "system__parametersB");
u00039 : constant Version_32 := 16#75f245f3#;
pragma Export (C, u00039, "system__parametersS");
u00040 : constant Version_32 := 16#641e2245#;
pragma Export (C, u00040, "system__dwarf_linesB");
u00041 : constant Version_32 := 16#40ce1ea3#;
pragma Export (C, u00041, "system__dwarf_linesS");
u00042 : constant Version_32 := 16#5b4659fa#;
pragma Export (C, u00042, "ada__charactersS");
u00043 : constant Version_32 := 16#8f637df8#;
pragma Export (C, u00043, "ada__characters__handlingB");
u00044 : constant Version_32 := 16#3b3f6154#;
pragma Export (C, u00044, "ada__characters__handlingS");
u00045 : constant Version_32 := 16#4b7bb96a#;
pragma Export (C, u00045, "ada__characters__latin_1S");
u00046 : constant Version_32 := 16#e6d4fa36#;
pragma Export (C, u00046, "ada__stringsS");
u00047 : constant Version_32 := 16#96df1a3f#;
pragma Export (C, u00047, "ada__strings__mapsB");
u00048 : constant Version_32 := 16#1e526bec#;
pragma Export (C, u00048, "ada__strings__mapsS");
u00049 : constant Version_32 := 16#465aa89c#;
pragma Export (C, u00049, "system__bit_opsB");
u00050 : constant Version_32 := 16#0765e3a3#;
pragma Export (C, u00050, "system__bit_opsS");
u00051 : constant Version_32 := 16#6c6ff32a#;
pragma Export (C, u00051, "system__unsigned_typesS");
u00052 : constant Version_32 := 16#92f05f13#;
pragma Export (C, u00052, "ada__strings__maps__constantsS");
u00053 : constant Version_32 := 16#5ab55268#;
pragma Export (C, u00053, "interfacesS");
u00054 : constant Version_32 := 16#a0d3d22b#;
pragma Export (C, u00054, "system__address_imageB");
u00055 : constant Version_32 := 16#934c1c02#;
pragma Export (C, u00055, "system__address_imageS");
u00056 : constant Version_32 := 16#8631cc2e#;
pragma Export (C, u00056, "system__img_unsB");
u00057 : constant Version_32 := 16#f39bcfdd#;
pragma Export (C, u00057, "system__img_unsS");
u00058 : constant Version_32 := 16#20ec7aa3#;
pragma Export (C, u00058, "system__ioB");
u00059 : constant Version_32 := 16#ace27677#;
pragma Export (C, u00059, "system__ioS");
u00060 : constant Version_32 := 16#3080f2ca#;
pragma Export (C, u00060, "system__mmapB");
u00061 : constant Version_32 := 16#9ad4d587#;
pragma Export (C, u00061, "system__mmapS");
u00062 : constant Version_32 := 16#92d882c5#;
pragma Export (C, u00062, "ada__io_exceptionsS");
u00063 : constant Version_32 := 16#a8ba7b3b#;
pragma Export (C, u00063, "system__mmap__os_interfaceB");
u00064 : constant Version_32 := 16#8f4541b8#;
pragma Export (C, u00064, "system__mmap__os_interfaceS");
u00065 : constant Version_32 := 16#657efc5a#;
pragma Export (C, u00065, "system__os_libB");
u00066 : constant Version_32 := 16#d872da39#;
pragma Export (C, u00066, "system__os_libS");
u00067 : constant Version_32 := 16#ec4d5631#;
pragma Export (C, u00067, "system__case_utilB");
u00068 : constant Version_32 := 16#0d75376c#;
pragma Export (C, u00068, "system__case_utilS");
u00069 : constant Version_32 := 16#2a8e89ad#;
pragma Export (C, u00069, "system__stringsB");
u00070 : constant Version_32 := 16#52b6adad#;
pragma Export (C, u00070, "system__stringsS");
u00071 : constant Version_32 := 16#e49bce3e#;
pragma Export (C, u00071, "interfaces__cB");
u00072 : constant Version_32 := 16#dbc36ce0#;
pragma Export (C, u00072, "interfaces__cS");
u00073 : constant Version_32 := 16#c83ab8ef#;
pragma Export (C, u00073, "system__object_readerB");
u00074 : constant Version_32 := 16#f6d45c39#;
pragma Export (C, u00074, "system__object_readerS");
u00075 : constant Version_32 := 16#914b0305#;
pragma Export (C, u00075, "system__val_lliB");
u00076 : constant Version_32 := 16#5ece13c8#;
pragma Export (C, u00076, "system__val_lliS");
u00077 : constant Version_32 := 16#d2ae2792#;
pragma Export (C, u00077, "system__val_lluB");
u00078 : constant Version_32 := 16#01a17ec8#;
pragma Export (C, u00078, "system__val_lluS");
u00079 : constant Version_32 := 16#269742a9#;
pragma Export (C, u00079, "system__val_utilB");
u00080 : constant Version_32 := 16#9e0037c6#;
pragma Export (C, u00080, "system__val_utilS");
u00081 : constant Version_32 := 16#b578159b#;
pragma Export (C, u00081, "system__exception_tracesB");
u00082 : constant Version_32 := 16#167fa1a2#;
pragma Export (C, u00082, "system__exception_tracesS");
u00083 : constant Version_32 := 16#e1282880#;
pragma Export (C, u00083, "system__win32S");
u00084 : constant Version_32 := 16#8c33a517#;
pragma Export (C, u00084, "system__wch_conB");
u00085 : constant Version_32 := 16#29dda3ea#;
pragma Export (C, u00085, "system__wch_conS");
u00086 : constant Version_32 := 16#9721e840#;
pragma Export (C, u00086, "system__wch_stwB");
u00087 : constant Version_32 := 16#04cc8feb#;
pragma Export (C, u00087, "system__wch_stwS");
u00088 : constant Version_32 := 16#a831679c#;
pragma Export (C, u00088, "system__wch_cnvB");
u00089 : constant Version_32 := 16#266a1919#;
pragma Export (C, u00089, "system__wch_cnvS");
u00090 : constant Version_32 := 16#ece6fdb6#;
pragma Export (C, u00090, "system__wch_jisB");
u00091 : constant Version_32 := 16#a61a0038#;
pragma Export (C, u00091, "system__wch_jisS");
u00092 : constant Version_32 := 16#ce3e0e21#;
pragma Export (C, u00092, "system__soft_links__initializeB");
u00093 : constant Version_32 := 16#5697fc2b#;
pragma Export (C, u00093, "system__soft_links__initializeS");
u00094 : constant Version_32 := 16#41837d1e#;
pragma Export (C, u00094, "system__stack_checkingB");
u00095 : constant Version_32 := 16#bc1fead0#;
pragma Export (C, u00095, "system__stack_checkingS");
u00096 : constant Version_32 := 16#0d140719#;
pragma Export (C, u00096, "system__taskingB");
u00097 : constant Version_32 := 16#c6674d66#;
pragma Export (C, u00097, "system__taskingS");
u00098 : constant Version_32 := 16#dc410cef#;
pragma Export (C, u00098, "system__task_primitivesS");
u00099 : constant Version_32 := 16#4cfe4fc8#;
pragma Export (C, u00099, "system__os_interfaceS");
u00100 : constant Version_32 := 16#1d638357#;
pragma Export (C, u00100, "interfaces__c__stringsB");
u00101 : constant Version_32 := 16#f239f79c#;
pragma Export (C, u00101, "interfaces__c__stringsS");
u00102 : constant Version_32 := 16#152ee045#;
pragma Export (C, u00102, "system__task_primitives__operationsB");
u00103 : constant Version_32 := 16#5a0b0d58#;
pragma Export (C, u00103, "system__task_primitives__operationsS");
u00104 : constant Version_32 := 16#1b28662b#;
pragma Export (C, u00104, "system__float_controlB");
u00105 : constant Version_32 := 16#d25cc204#;
pragma Export (C, u00105, "system__float_controlS");
u00106 : constant Version_32 := 16#6387a759#;
pragma Export (C, u00106, "system__interrupt_managementB");
u00107 : constant Version_32 := 16#246e2885#;
pragma Export (C, u00107, "system__interrupt_managementS");
u00108 : constant Version_32 := 16#64507e17#;
pragma Export (C, u00108, "system__multiprocessorsB");
u00109 : constant Version_32 := 16#0a0c1e4b#;
pragma Export (C, u00109, "system__multiprocessorsS");
u00110 : constant Version_32 := 16#24ec69e6#;
pragma Export (C, u00110, "system__os_primitivesB");
u00111 : constant Version_32 := 16#355de4ce#;
pragma Export (C, u00111, "system__os_primitivesS");
u00112 : constant Version_32 := 16#05c60a38#;
pragma Export (C, u00112, "system__task_lockB");
u00113 : constant Version_32 := 16#532ab656#;
pragma Export (C, u00113, "system__task_lockS");
u00114 : constant Version_32 := 16#b8c476a4#;
pragma Export (C, u00114, "system__win32__extS");
u00115 : constant Version_32 := 16#ce7dfb56#;
pragma Export (C, u00115, "system__task_infoB");
u00116 : constant Version_32 := 16#4713b9b1#;
pragma Export (C, u00116, "system__task_infoS");
u00117 : constant Version_32 := 16#1bbc5086#;
pragma Export (C, u00117, "system__tasking__debugB");
u00118 : constant Version_32 := 16#48f9280e#;
pragma Export (C, u00118, "system__tasking__debugS");
u00119 : constant Version_32 := 16#fd83e873#;
pragma Export (C, u00119, "system__concat_2B");
u00120 : constant Version_32 := 16#300056e8#;
pragma Export (C, u00120, "system__concat_2S");
u00121 : constant Version_32 := 16#2b70b149#;
pragma Export (C, u00121, "system__concat_3B");
u00122 : constant Version_32 := 16#39d0dd9d#;
pragma Export (C, u00122, "system__concat_3S");
u00123 : constant Version_32 := 16#b31a5821#;
pragma Export (C, u00123, "system__img_enum_newB");
u00124 : constant Version_32 := 16#53ec87f8#;
pragma Export (C, u00124, "system__img_enum_newS");
u00125 : constant Version_32 := 16#617d5887#;
pragma Export (C, u00125, "system__stack_usageB");
u00126 : constant Version_32 := 16#3a3ac346#;
pragma Export (C, u00126, "system__stack_usageS");
u00127 : constant Version_32 := 16#7d29cee1#;
pragma Export (C, u00127, "system__tasking__stagesB");
u00128 : constant Version_32 := 16#6153a6f3#;
pragma Export (C, u00128, "system__tasking__stagesS");
u00129 : constant Version_32 := 16#f9576a72#;
pragma Export (C, u00129, "ada__tagsB");
u00130 : constant Version_32 := 16#b6661f55#;
pragma Export (C, u00130, "ada__tagsS");
u00131 : constant Version_32 := 16#796f31f1#;
pragma Export (C, u00131, "system__htableB");
u00132 : constant Version_32 := 16#b66232d2#;
pragma Export (C, u00132, "system__htableS");
u00133 : constant Version_32 := 16#089f5cd0#;
pragma Export (C, u00133, "system__string_hashB");
u00134 : constant Version_32 := 16#143c59ac#;
pragma Export (C, u00134, "system__string_hashS");
u00135 : constant Version_32 := 16#100eaf58#;
pragma Export (C, u00135, "system__restrictionsB");
u00136 : constant Version_32 := 16#dbc9df38#;
pragma Export (C, u00136, "system__restrictionsS");
u00137 : constant Version_32 := 16#b19e9df1#;
pragma Export (C, u00137, "system__tasking__initializationB");
u00138 : constant Version_32 := 16#cd0eb8a9#;
pragma Export (C, u00138, "system__tasking__initializationS");
u00139 : constant Version_32 := 16#215cb8f4#;
pragma Export (C, u00139, "system__soft_links__taskingB");
u00140 : constant Version_32 := 16#e939497e#;
pragma Export (C, u00140, "system__soft_links__taskingS");
u00141 : constant Version_32 := 16#3880736e#;
pragma Export (C, u00141, "ada__exceptions__is_null_occurrenceB");
u00142 : constant Version_32 := 16#6fde25af#;
pragma Export (C, u00142, "ada__exceptions__is_null_occurrenceS");
u00143 : constant Version_32 := 16#d798575d#;
pragma Export (C, u00143, "system__tasking__task_attributesB");
u00144 : constant Version_32 := 16#7dbadc03#;
pragma Export (C, u00144, "system__tasking__task_attributesS");
u00145 : constant Version_32 := 16#db326703#;
pragma Export (C, u00145, "system__tasking__queuingB");
u00146 : constant Version_32 := 16#73e13001#;
pragma Export (C, u00146, "system__tasking__queuingS");
u00147 : constant Version_32 := 16#3af67f9c#;
pragma Export (C, u00147, "system__tasking__protected_objectsB");
u00148 : constant Version_32 := 16#242da0e0#;
pragma Export (C, u00148, "system__tasking__protected_objectsS");
u00149 : constant Version_32 := 16#119b2d0b#;
pragma Export (C, u00149, "system__tasking__protected_objects__entriesB");
u00150 : constant Version_32 := 16#7daf93e7#;
pragma Export (C, u00150, "system__tasking__protected_objects__entriesS");
u00151 : constant Version_32 := 16#86c56e5a#;
pragma Export (C, u00151, "ada__finalizationS");
u00152 : constant Version_32 := 16#10558b11#;
pragma Export (C, u00152, "ada__streamsB");
u00153 : constant Version_32 := 16#67e31212#;
pragma Export (C, u00153, "ada__streamsS");
u00154 : constant Version_32 := 16#95817ed8#;
pragma Export (C, u00154, "system__finalization_rootB");
u00155 : constant Version_32 := 16#7d52f2a8#;
pragma Export (C, u00155, "system__finalization_rootS");
u00156 : constant Version_32 := 16#72e59739#;
pragma Export (C, u00156, "system__tasking__rendezvousB");
u00157 : constant Version_32 := 16#e93c6c5f#;
pragma Export (C, u00157, "system__tasking__rendezvousS");
u00158 : constant Version_32 := 16#4cd3ce3b#;
pragma Export (C, u00158, "system__tasking__entry_callsB");
u00159 : constant Version_32 := 16#526fb901#;
pragma Export (C, u00159, "system__tasking__entry_callsS");
u00160 : constant Version_32 := 16#ad55c617#;
pragma Export (C, u00160, "system__tasking__protected_objects__operationsB");
u00161 : constant Version_32 := 16#343fde45#;
pragma Export (C, u00161, "system__tasking__protected_objects__operationsS");
u00162 : constant Version_32 := 16#1d9c679e#;
pragma Export (C, u00162, "system__tasking__utilitiesB");
u00163 : constant Version_32 := 16#a65de031#;
pragma Export (C, u00163, "system__tasking__utilitiesS");
u00164 : constant Version_32 := 16#553ad4ac#;
pragma Export (C, u00164, "ada__real_timeB");
u00165 : constant Version_32 := 16#1ad7dfc0#;
pragma Export (C, u00165, "ada__real_timeS");
u00166 : constant Version_32 := 16#0c4f7c61#;
pragma Export (C, u00166, "tipos_tareaB");
u00167 : constant Version_32 := 16#3627d180#;
pragma Export (C, u00167, "tipos_tareaS");
u00168 : constant Version_32 := 16#ffaa9e94#;
pragma Export (C, u00168, "ada__calendar__delaysB");
u00169 : constant Version_32 := 16#d86d2f1d#;
pragma Export (C, u00169, "ada__calendar__delaysS");
u00170 : constant Version_32 := 16#57c21ad4#;
pragma Export (C, u00170, "ada__calendarB");
u00171 : constant Version_32 := 16#31350a81#;
pragma Export (C, u00171, "ada__calendarS");
u00172 : constant Version_32 := 16#f4e097a7#;
pragma Export (C, u00172, "ada__text_ioB");
u00173 : constant Version_32 := 16#03e83e15#;
pragma Export (C, u00173, "ada__text_ioS");
u00174 : constant Version_32 := 16#73d2d764#;
pragma Export (C, u00174, "interfaces__c_streamsB");
u00175 : constant Version_32 := 16#b1330297#;
pragma Export (C, u00175, "interfaces__c_streamsS");
u00176 : constant Version_32 := 16#ec9c64c3#;
pragma Export (C, u00176, "system__file_ioB");
u00177 : constant Version_32 := 16#95d1605d#;
pragma Export (C, u00177, "system__file_ioS");
u00178 : constant Version_32 := 16#cf3f1b90#;
pragma Export (C, u00178, "system__file_control_blockS");
u00179 : constant Version_32 := 16#eca5ecae#;
pragma Export (C, u00179, "system__memoryB");
u00180 : constant Version_32 := 16#6bdde70c#;
pragma Export (C, u00180, "system__memoryS");
-- BEGIN ELABORATION ORDER
-- ada%s
-- ada.characters%s
-- ada.characters.latin_1%s
-- interfaces%s
-- system%s
-- system.float_control%s
-- system.float_control%b
-- system.img_enum_new%s
-- system.img_enum_new%b
-- system.img_int%s
-- system.img_int%b
-- system.io%s
-- system.io%b
-- system.parameters%s
-- system.parameters%b
-- system.crtl%s
-- interfaces.c_streams%s
-- interfaces.c_streams%b
-- system.restrictions%s
-- system.restrictions%b
-- system.storage_elements%s
-- system.storage_elements%b
-- system.stack_checking%s
-- system.stack_checking%b
-- system.stack_usage%s
-- system.stack_usage%b
-- system.string_hash%s
-- system.string_hash%b
-- system.htable%s
-- system.htable%b
-- system.strings%s
-- system.strings%b
-- system.traceback_entries%s
-- system.traceback_entries%b
-- system.unsigned_types%s
-- system.img_uns%s
-- system.img_uns%b
-- system.wch_con%s
-- system.wch_con%b
-- system.wch_jis%s
-- system.wch_jis%b
-- system.wch_cnv%s
-- system.wch_cnv%b
-- system.concat_2%s
-- system.concat_2%b
-- system.concat_3%s
-- system.concat_3%b
-- system.traceback%s
-- system.traceback%b
-- ada.characters.handling%s
-- system.case_util%s
-- system.os_lib%s
-- system.secondary_stack%s
-- system.standard_library%s
-- ada.exceptions%s
-- system.exceptions_debug%s
-- system.exceptions_debug%b
-- system.soft_links%s
-- system.val_lli%s
-- system.val_llu%s
-- system.val_util%s
-- system.val_util%b
-- system.wch_stw%s
-- system.wch_stw%b
-- ada.exceptions.last_chance_handler%s
-- ada.exceptions.last_chance_handler%b
-- ada.exceptions.traceback%s
-- ada.exceptions.traceback%b
-- system.address_image%s
-- system.address_image%b
-- system.bit_ops%s
-- system.bit_ops%b
-- system.bounded_strings%s
-- system.bounded_strings%b
-- system.case_util%b
-- system.exception_table%s
-- system.exception_table%b
-- ada.containers%s
-- ada.io_exceptions%s
-- ada.strings%s
-- ada.strings.maps%s
-- ada.strings.maps%b
-- ada.strings.maps.constants%s
-- interfaces.c%s
-- interfaces.c%b
-- system.exceptions%s
-- system.exceptions%b
-- system.exceptions.machine%s
-- system.exceptions.machine%b
-- system.win32%s
-- ada.characters.handling%b
-- system.exception_traces%s
-- system.exception_traces%b
-- system.memory%s
-- system.memory%b
-- system.mmap%s
-- system.mmap.os_interface%s
-- system.mmap.os_interface%b
-- system.mmap%b
-- system.object_reader%s
-- system.object_reader%b
-- system.dwarf_lines%s
-- system.dwarf_lines%b
-- system.os_lib%b
-- system.secondary_stack%b
-- system.soft_links.initialize%s
-- system.soft_links.initialize%b
-- system.soft_links%b
-- system.standard_library%b
-- system.traceback.symbolic%s
-- system.traceback.symbolic%b
-- ada.exceptions%b
-- system.val_lli%b
-- system.val_llu%b
-- ada.exceptions.is_null_occurrence%s
-- ada.exceptions.is_null_occurrence%b
-- ada.tags%s
-- ada.tags%b
-- ada.streams%s
-- ada.streams%b
-- interfaces.c.strings%s
-- interfaces.c.strings%b
-- system.file_control_block%s
-- system.finalization_root%s
-- system.finalization_root%b
-- ada.finalization%s
-- system.file_io%s
-- system.file_io%b
-- system.multiprocessors%s
-- system.multiprocessors%b
-- system.os_interface%s
-- system.interrupt_management%s
-- system.interrupt_management%b
-- system.task_info%s
-- system.task_info%b
-- system.task_lock%s
-- system.task_lock%b
-- system.task_primitives%s
-- system.win32.ext%s
-- system.os_primitives%s
-- system.os_primitives%b
-- system.tasking%s
-- system.task_primitives.operations%s
-- system.tasking.debug%s
-- system.tasking.debug%b
-- system.task_primitives.operations%b
-- system.tasking%b
-- ada.calendar%s
-- ada.calendar%b
-- ada.calendar.delays%s
-- ada.calendar.delays%b
-- ada.real_time%s
-- ada.real_time%b
-- ada.text_io%s
-- ada.text_io%b
-- system.soft_links.tasking%s
-- system.soft_links.tasking%b
-- system.tasking.initialization%s
-- system.tasking.task_attributes%s
-- system.tasking.task_attributes%b
-- system.tasking.initialization%b
-- system.tasking.protected_objects%s
-- system.tasking.protected_objects%b
-- system.tasking.protected_objects.entries%s
-- system.tasking.protected_objects.entries%b
-- system.tasking.queuing%s
-- system.tasking.queuing%b
-- system.tasking.utilities%s
-- system.tasking.utilities%b
-- system.tasking.entry_calls%s
-- system.tasking.rendezvous%s
-- system.tasking.protected_objects.operations%s
-- system.tasking.protected_objects.operations%b
-- system.tasking.entry_calls%b
-- system.tasking.rendezvous%b
-- system.tasking.stages%s
-- system.tasking.stages%b
-- tipos_tarea%s
-- tipos_tarea%b
-- crea_tarea_de_tipo%b
-- END ELABORATION ORDER
end ada_main;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2010-2015, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Matreshka.Internals.Stream_Element_Vectors;
package League.Stream_Element_Vectors.Internals is
pragma Preelaborate;
package MISEV renames Matreshka.Internals.Stream_Element_Vectors;
function Wrap
(Item : not null MISEV.Shared_Stream_Element_Vector_Access)
return Stream_Element_Vector;
-- Creates Stream_Element_Vector as wrapper for the specified shared data.
-- Reference counter is not changed.
function Internal
(Item : Stream_Element_Vector)
return MISEV.Shared_Stream_Element_Vector_Access
with Inline;
-- Returns internal shared segment of stream element vector.
procedure Replace
(Vector : in out Stream_Element_Vector;
Item : not null MISEV.Shared_Stream_Element_Vector_Access);
-- Replaces internal shared element by new one. Reference counter of
-- old element has been decremented, but reference counter of new element
-- is not touched.
end League.Stream_Element_Vectors.Internals;
|
------------------------------------------------------------------------------
-- Copyright (c) 2011, Natacha Porté --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Natools.Tests is an abstract interface for objects holding the results --
-- of a series of tests. --
-- --
-- Each test can have one of the following results: --
-- * Success, when everything goes well, --
-- * Fail, when the test itself went fine the but the result is wrong, --
-- * Error, when the test itself went wrong, which does not tell whether --
-- the tested thing is fine or not, --
-- * Skipped, when for any reason the test has not been performed --
-- (e.g. missing dependency). --
-- --
-- Tests are gathered into sections, which can be nested. What a section --
-- exactly means is left to the implementation of this interface. --
------------------------------------------------------------------------------
with Ada.Exceptions;
private with Ada.Finalization;
private with Ada.Strings.Unbounded;
private with Ada.Containers.Indefinite_Doubly_Linked_Lists;
package Natools.Tests is
pragma Preelaborate (Tests);
type Reporter is interface;
type Result is (Success, Fail, Error, Skipped);
type Result_Summary is array (Result) of Natural;
procedure Section (Report : in out Reporter; Name : String) is abstract;
procedure End_Section (Report : in out Reporter) is abstract;
-- These procedures change the internal state of Report to respectively
-- enter and leave a (sub)section.
procedure Item
(Report : in out Reporter;
Name : in String;
Outcome : in Result)
is abstract;
-- Append a new test item (with its outcome) to the current section
-- of Report.
procedure Info (Report : in out Reporter; Text : String) is abstract;
-- Append free informational text related to the previous Item appended.
function Current_Results (Report : Reporter) return Result_Summary
is abstract;
-- Return the number of each result type in the current section.
function Total_Results (Report : Reporter) return Result_Summary
is abstract;
-- Return the total number of each result type in the current section.
function To_Result (Succeeded : Boolean) return Result;
-- Return Success or Fail depending on the Boolean input.
Max_Result_String_Size : constant Positive := 7;
-- Maximum length of any string returned by Result'Image.
------------------------
-- Helper subprograms --
------------------------
procedure Report_Exception
(Report : in out Reporter'Class;
Test_Name : String;
Ex : Ada.Exceptions.Exception_Occurrence;
Code : Result := Error);
-- Append to Report a new Item, whose result is Code, along with
-- a description of the exception Ex as Info entries.
-----------------
-- Test Object --
-----------------
type Test (<>) is tagged limited private;
-- An object of type Test hold information about a single test.
-- It contains a reference to a Reporter object, which is filled with
-- held info when the Test object is finalized.
function Item
(Report : access Reporter'Class;
Name : String;
Default_Outcome : Result := Success)
return Test;
-- Create a new Test object with the given Name
procedure Set_Result (Object : in out Test; Outcome : in Result);
-- Set the test result
procedure Info (Object : in out Test; Text : in String);
-- Append the given text as extra information related to the test
procedure Report_Exception
(Object : in out Test;
Ex : in Ada.Exceptions.Exception_Occurrence;
Code : in Result := Error);
-- Append information about Ex to the test and set its result state
procedure Fail (Object : in out Test; Text : in String := "");
procedure Error (Object : in out Test; Text : in String := "");
procedure Skip (Object : in out Test; Text : in String := "");
-- Set the result state and append Text info in a single call
generic
type Result (<>) is limited private;
with function "=" (Left, Right : Result) return Boolean is <>;
with function Image (Object : Result) return String is <>;
Multiline : Boolean := True;
procedure Generic_Check
(Object : in out Test;
Expected : in Result;
Found : in Result;
Label : in String := "");
private
package Info_Lists is new Ada.Containers.Indefinite_Doubly_Linked_Lists
(String);
type Test (Report : access Reporter'Class) is
new Ada.Finalization.Limited_Controlled with record
Name : Ada.Strings.Unbounded.Unbounded_String;
Info : Info_Lists.List;
Outcome : Result;
Finalized : Boolean := False;
end record;
overriding procedure Finalize (Object : in out Test);
end Natools.Tests;
|
package ADMBase.Runge is
procedure set_time_step;
procedure set_time_step_min;
procedure rk_step
(ct : Real;
cw : Real;
params : SlaveParams);
procedure beg_runge_kutta
(params : SlaveParams);
procedure end_runge_kutta
(params : SlaveParams);
end ADMBase.Runge;
|
WITH TileADT, Text_IO;
PACKAGE BODY Input_Line IS
--
-- IMPLEMENTATION of Input_Line ADT
--
-- Maintenance Note
-- To add or modify commands, you'll need to change:
-- Case statement in Get_Command
-- enumerated type Command in specification
-- Legal_Commands constant in specification
TYPE Move is RECORD -- an abstraction for a MOVE
Col1: TileADT.Col;
Row1: TileADT.Row;
Col2: TileADT.Col;
Row2: TileADT.Row;
END RECORD;
The_Line : STRING (1..80); -- The user's input stored here by Get
Line_Length : NATURAL; -- Number of characters read
FUNCTION Char_to_Int (Letter: CHARACTER) RETURN INTEGER IS
-- Purpose: Local function to convert a digit to an integer
-- Assumes: Letter is in range '0' to '9'
-- Returns: Integer equivalent of digit.
BEGIN
RETURN CHARACTER'POS(Letter) - CHARACTER'POS('0');
END Char_to_Int;
FUNCTION Convert_to_Move RETURN Move IS
-- Purpose: Local function to convert the user input into a move.
-- Assumes: IsMove is true.
-- Returns: a move.
BEGIN
RETURN ( The_Line(1),
Char_to_Int(The_Line(2)),
The_Line(3),
Char_to_Int(The_Line(4)) );
END Convert_to_Move;
-------------------------------------------------------------------------------
PROCEDURE Get IS
-- Purpose: A line of user's input (terminated by Enter) is read from keyboard.
-- Assumes: At least one character must be typed.
-- Exception: Constraint Error is raised if length > 80.
BEGIN
Text_IO.Get_Line ( The_Line, Line_Length);
END Get;
FUNCTION IsCommand RETURN BOOLEAN IS
-- Purpose: Determine if the user's input was a legal command.
-- Assumes: Get has been completed.
-- Returns: TRUE if only a single character was entered and it's a legal command
-- (More than one character will be assumed to be a move, not a command.)
BEGIN
RETURN Line_Length = 1;
END IsCommand;
FUNCTION IsMove RETURN BOOLEAN IS
-- Purpose: Determine if the user's input was a move (2 board locations).
-- E.g., D3H8
-- Assumes: Get has been completed.
-- Returns: TRUE if user input is syntactically correct for a move.
-- Returns FALSE if
-- a) columns are not valid COL type
-- b) rows are not valid ROW type
-- c) length of user input /= 4
BEGIN
RETURN Line_Length = 4;
END IsMove;
FUNCTION Get_Command RETURN Command IS
-- Purpose: Converts the user input into a value of command type.
-- Assumes: Get has been completed, and Is_Command is TRUE.
-- Returns: the command type value corresponding to user's input.
-- This implementation assumes the letters in Legal_Commands are in same order
-- as corresponding values in Commands enumerated type.
BEGIN
IF The_Line(1) = 'Q' THEN
RETURN Quit;
ELSE
RETURN Load;
END IF;
END Get_Command;
FUNCTION Validate_Move RETURN BOOLEAN IS
-- Purpose: Determine if the users_input is really a valid move. I.e., the
-- tiles are matching and removable.
-- Assumes: Get has been completed, and Is_Move is true.
-- Return: TRUE if it is a valid move.
-- Otherwise, display error and return FALSE.
-- USED BY: Take_Turn
-- Note: Valid move means
-- 1) both locations really contain a tile
-- 2) both tiles can match and can be removed
-- 3) the tiles are in two different locations (they aren't
-- the same tile).
BEGIN
RETURN TRUE;
END Validate_Move;
-------------------------------------------------------------------------------
PROCEDURE Make_Move IS
-- Purpose: Process the player's move, remove the tiles from the board.
-- Take the two matching tiles off the board and update the screen
-- Assumes: Validate_Move is TRUE.
-- Returns: nothing. The Board and screen are updated.
-- USED BY: Take_Turn
-- PSEUDOCODE:
-- Reset hints.
-- Remove the matching tiles from the board.
-- display the updated board.
-- Decrement tiles remaining.
-- add tiles to move history.
-- If no tiles left, display win message.
BEGIN
null;
END Make_Move;
--------------------------------------------------------------------------------
PROCEDURE Undo_Move IS
-- PURPOSE: Restore a pair of tiles to the board that were just removed.
-- Pop a move off the stack and return those two tiles to the board.
-- Update the display and # tiles remaining.
-- Assumes: nothing.
-- Returns: nothing. The most recent move is "undone" and the board
-- and screen restored to their previous state.
-- Note: Undo can be invoked multiple times, backing up until the
-- board is in it's original state.
--
-- USED BY: Dispatch_Command
--
BEGIN
null;
END Undo_Move;
END Input_Line;
|
-- This file provides interfaces for the operational amplifiers on the
-- STM32G4 (ARM Cortex M4F) microcontrollers from ST Microelectronics.
private with STM32_SVD.OPAMP;
package STM32.OPAMP is
type Operational_Amplifier is limited private;
procedure Enable (This : in out Operational_Amplifier)
with Post => Enabled (This);
procedure Disable (This : in out Operational_Amplifier)
with Post => not Enabled (This);
function Enabled (This : Operational_Amplifier) return Boolean;
type NI_Input_Mode is (Normal, Calibration);
procedure Set_NI_Input_Mode
(This : in out Operational_Amplifier;
Input : NI_Input_Mode)
with Post => Get_NI_Input_Mode (This) = Input;
-- Select a calibration reference voltage on non-inverting input and
-- disables external connections.
function Get_NI_Input_Mode
(This : Operational_Amplifier) return NI_Input_Mode;
-- Return the source connected to the non-inverting input of the
-- operational amplifier.
type NI_Input_Port is (VINP0, VINP1, VINP2, Option_4);
-- These bits allows to select the source connected to the non-inverting
-- input of the operational amplifier. The first 3 options are common, the
-- last option change for each OPAMP:
-- Option OPAMP1 OPAMP2 OPAMP3 OPAMP4 OPAMP5 OPAMP6
-- 4 DAC3_CH1 VIMP3 DAC3_CH2 DAC4_CH1 DAC4_CH2 DAC3_CH1
procedure Set_NI_Input_Port
(This : in out Operational_Amplifier;
Input : NI_Input_Port)
with Post => Get_NI_Input_Port (This) = Input;
-- Select the source connected to the non-inverting input of the
-- operational amplifier.
function Get_NI_Input_Port
(This : Operational_Amplifier) return NI_Input_Port;
-- Return the source connected to the non-inverting input of the
-- operational amplifier.
type NI_Sec_Input_Port is (VINP0, VINP1, VINP2, Option_4);
-- These bits allows to select the source connected to the non-inverting
-- input of the operational amplifier. The first 3 options are common, the
-- last option change for each OPAMP:
-- Option OPAMP1 OPAMP2 OPAMP3 OPAMP4 OPAMP5 OPAMP6
-- 4 DAC3_CH1 VIMP3 DAC3_CH2 DAC4_CH1 DAC4_CH2 DAC3_CH1
procedure Set_NI_Sec_Input_Port
(This : in out Operational_Amplifier;
Input : NI_Sec_Input_Port)
with Post => Get_NI_Sec_Input_Port (This) = Input;
-- Select the secondary source connected to the non-inverting input
-- of the operational amplifier when the controlled mux mode is enabled
-- (T1CM_EN = 1 or T8CM_EN = 1 or T20CM_EN = 1).
function Get_NI_Sec_Input_Port
(This : Operational_Amplifier) return NI_Sec_Input_Port;
-- Return the secondary source connected to the non-inverting input
-- of the operational amplifier.
type I_Input_Port is
(VINM0,
VINM1,
Feedback_Resistor_PGA_Mode,
Follower_Mode);
procedure Set_I_Input_Port
(This : in out Operational_Amplifier;
Input : I_Input_Port)
with Post => Get_I_Input_Port (This) = Input;
-- Select the source connected to the inverting input of the
-- operational amplifier.
function Get_I_Input_Port
(This : Operational_Amplifier) return I_Input_Port;
-- Return the source connected to the inverting input of the
-- operational amplifier.
type I_Sec_Input_Port is
(VINM0_Or_Feedback_Resistor_PGA_Mode,
VINM1_Or_Follower_Mode);
-- When standalone mode is used (i.e. VM_SEL = “00” or “01”):
-- 0: Input from VINM0
-- 1: Input from VINM1
-- When PGA (VM_SEL = “10”) or Follower mode (VM_SEL = “11”) is used:
-- 0: Resistor feedback output selected (PGA mode)
-- 1: VOUT selected as input minus (follower mode)
procedure Set_I_Sec_Input_Port
(This : in out Operational_Amplifier;
Input : I_Sec_Input_Port)
with Post => Get_I_Sec_Input_Port (This) = Input;
-- Select the secondary source connected to the inverting input of the
-- operational amplifier when the controlled mux mode is enabled
-- (T1CM_EN = 1 or T8CM_EN = 1 or T20CM_EN = 1).
function Get_I_Sec_Input_Port
(This : Operational_Amplifier) return I_Sec_Input_Port;
-- Return the secondary source connected to the inverting input of the
-- operational amplifier.
type Input_Mux_Mode is (Manual, Automatic);
-- Timer controlled mux mode.
type Input_Mux_Timer is (TIM1, TIM8, TIM20);
-- Timer that constrols the mux mode.
procedure Set_Input_Mux_Mode
(This : in out Operational_Amplifier;
Timer : Input_Mux_Timer;
Mode : Input_Mux_Mode)
with Post => Get_Input_Mux_Mode (This, Timer) = Mode;
-- Select automatically the switch between the default selection
-- (VP_SEL and VM_SEL) and the secondary selection (VPS_SEL and VMS_SEL)
-- of the inverting and non inverting inputs of the operational amplifier.
-- This automatic switch is triggered by the TIMx CC6 output arriving on
-- the OPAMPx input multiplexers.
function Get_Input_Mux_Mode
(This : Operational_Amplifier;
Timer : Input_Mux_Timer) return Input_Mux_Mode;
-- Return the selection of the selection between the default and the
-- secondary inputs of the inverting and non inverting inputs of the
-- operational amplifier.
type PGA_Mode_Gain is
(NI_Gain_2,
NI_Gain_4,
NI_Gain_8,
NI_Gain_16,
NI_Gain_32,
NI_Gain_64,
I_Gain_1_NI_Gain_2_VINM0,
I_Gain_3_NI_Gain_4_VINM0,
I_Gain_7_NI_Gain_8_VINM0,
I_Gain_15_NI_Gain_16_VINM0,
I_Gain_31_NI_Gain_32_VINM0,
I_Gain_63_NI_Gain_64_VINM0,
NI_Gain_2_Filtering_VINM0,
NI_Gain_4_Filtering_VINM0,
NI_Gain_8_Filtering_VINM0,
NI_Gain_16_Filtering_VINM0,
NI_Gain_32_Filtering_VINM0,
NI_Gain_64_Filtering_VINM0,
I_Gain_1_NI_Gain_2_VINM0_VINM1,
I_Gain_3_NI_Gain_4_VINM0_VINM1,
I_Gain_7_NI_Gain_8_VINM0_VINM1,
I_Gain_15_NI_Gain_16_VINM0_VINM1,
I_Gain_31_NI_Gain_32_VINM0_VINM1,
I_Gain_63_NI_Gain_64_VINM0_VINM1)
with Size => 5;
-- Gain in PGA mode.
for PGA_Mode_Gain use
(NI_Gain_2 => 2#00000#,
NI_Gain_4 => 2#00001#,
NI_Gain_8 => 2#00010#,
NI_Gain_16 => 2#00011#,
NI_Gain_32 => 2#00100#,
NI_Gain_64 => 2#00101#,
I_Gain_1_NI_Gain_2_VINM0 => 2#01000#,
I_Gain_3_NI_Gain_4_VINM0 => 2#01001#,
I_Gain_7_NI_Gain_8_VINM0 => 2#01010#,
I_Gain_15_NI_Gain_16_VINM0 => 2#01011#,
I_Gain_31_NI_Gain_32_VINM0 => 2#01100#,
I_Gain_63_NI_Gain_64_VINM0 => 2#01101#,
NI_Gain_2_Filtering_VINM0 => 2#10000#,
NI_Gain_4_Filtering_VINM0 => 2#10001#,
NI_Gain_8_Filtering_VINM0 => 2#10010#,
NI_Gain_16_Filtering_VINM0 => 2#10011#,
NI_Gain_32_Filtering_VINM0 => 2#10100#,
NI_Gain_64_Filtering_VINM0 => 2#10101#,
I_Gain_1_NI_Gain_2_VINM0_VINM1 => 2#11000#,
I_Gain_3_NI_Gain_4_VINM0_VINM1 => 2#11001#,
I_Gain_7_NI_Gain_8_VINM0_VINM1 => 2#11010#,
I_Gain_15_NI_Gain_16_VINM0_VINM1 => 2#11011#,
I_Gain_31_NI_Gain_32_VINM0_VINM1 => 2#11100#,
I_Gain_63_NI_Gain_64_VINM0_VINM1 => 2#11101#);
procedure Set_PGA_Mode_Gain
(This : in out Operational_Amplifier;
Input : PGA_Mode_Gain)
with Post => Get_PGA_Mode_Gain (This) = Input;
-- Select the gain in PGA mode.
function Get_PGA_Mode_Gain
(This : Operational_Amplifier) return PGA_Mode_Gain;
-- Return the gain in PGA mode.
type Speed_Mode is (Normal_Mode, HighSpeed_Mode);
procedure Set_Speed_Mode
(This : in out Operational_Amplifier;
Input : Speed_Mode)
with Pre => not Enabled (This),
Post => Get_Speed_Mode (This) = Input;
-- OPAMP in normal or high-speed mode.
function Get_Speed_Mode
(This : Operational_Amplifier) return Speed_Mode;
-- Return the OPAMP speed mode.
type Init_Parameters is record
Input_Minus : I_Input_Port;
Input_Sec_Minus : I_Sec_Input_Port;
Input_Plus : NI_Input_Port;
Input_Sec_Plus : NI_Sec_Input_Port;
Mux_Timer : Input_Mux_Timer;
Mux_Mode : Input_Mux_Mode;
PGA_Mode : PGA_Mode_Gain;
Power_Mode : Speed_Mode;
end record;
procedure Configure_Opamp
(This : in out Operational_Amplifier;
Param : Init_Parameters);
procedure Set_User_Trimming
(This : in out Operational_Amplifier;
Enabled : Boolean)
with Post => Get_User_Trimming (This) = Enabled;
-- Allows to switch from ‘factory’ AOP offset trimmed values to ‘user’ AOP
-- offset trimmed values.
function Get_User_Trimming
(This : Operational_Amplifier) return Boolean;
-- Return the state of user trimming.
type Differential_Pair is (NMOS, PMOS);
procedure Set_Offset_Trimming
(This : in out Operational_Amplifier;
Pair : Differential_Pair;
Input : UInt5)
with Post => Get_Offset_Trimming (This, Pair) = Input;
-- Select the offset trimming value for NMOS or PMOS.
function Get_Offset_Trimming
(This : Operational_Amplifier;
Pair : Differential_Pair) return UInt5;
-- Return the offset trimming value for NMOS or PMOS.
procedure Set_Calibration_Mode
(This : in out Operational_Amplifier;
Enabled : Boolean)
with Post => Get_Calibration_Mode (This);
-- Select the calibration mode connecting VM and VP to the OPAMP
-- internal reference voltage.
function Get_Calibration_Mode
(This : Operational_Amplifier) return Boolean;
-- Return the calibration mode.
type Calibration_Value is
(VREFOPAMP_Is_3_3_VDDA, -- 3.3%
VREFOPAMP_Is_10_VDDA, -- 10%
VREFOPAMP_Is_50_VDDA, -- 50%
VREFOPAMP_Is_90_VDDA -- 90%
);
-- Offset calibration bus to generate the internal reference voltage.
procedure Set_Calibration_Value
(This : in out Operational_Amplifier;
Input : Calibration_Value)
with Post => Get_Calibration_Value (This) = Input;
-- Select the offset calibration bus used to generate the internal
-- reference voltage when CALON = 1 or FORCE_VP = 1.
function Get_Calibration_Value
(This : Operational_Amplifier) return Calibration_Value;
-- Return the offset calibration bus voltage.
procedure Calibrate (This : in out Operational_Amplifier);
-- Calibrate the NMOS and PMOS differential pair. This routine
-- is described in the RM0440 rev 6 pg. 797. The offset trim time,
-- during calibration, must respect the minimum time needed
-- between two steps to have 1 mV accuracy.
-- This routine must be executed first with normal speed mode, then with
-- high-speed mode, if used.
type Internal_Output is
(Is_Output,
Is_Not_Output);
procedure Set_Internal_Output
(This : in out Operational_Amplifier;
Input : Internal_Output)
with Post => Get_Internal_Output (This) = Input;
-- Connect the internal OPAMP output to output pin or internally to an ADC
-- channel and disconnected from the output pin.
function Get_Internal_Output
(This : Operational_Amplifier) return Internal_Output;
-- Return the internal output reference voltage state.
type Output_Status_Flag is
(NI_Lesser_Then_I,
NI_Greater_Then_I);
function Get_Output_Status_Flag
(This : Operational_Amplifier) return Output_Status_Flag;
-- Return the output status flag when the OPAMP is used as comparator
-- during calibration.
procedure Set_Lock_OpAmp (This : in out Operational_Amplifier)
with Post => Get_Lock_OpAmp (This) = True;
-- Allows to have OPAMPx_CSR register as read-only. It can only be cleared
-- by a system reset.
function Get_Lock_OpAmp (This : Operational_Amplifier) return Boolean;
-- Return the OPAMP lock bit state.
private
-- representation for the whole Operationa Amplifier type -----------------
type Operational_Amplifier is limited record
CSR : STM32_SVD.OPAMP.OPAMP1_CSR_Register;
TCMR : STM32_SVD.OPAMP.OPAMP1_TCMR_Register;
end record with Volatile, Size => 7 * 32;
for Operational_Amplifier use record
CSR at 16#00# range 0 .. 31;
TCMR at 16#18# range 0 .. 31;
end record;
end STM32.OPAMP;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012-2015, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
pragma Restrictions (No_Elaboration_Code);
-- GNAT: enforce generation of preinitialized data section instead of
-- generation of elaboration code.
package Matreshka.Internals.Unicode.Ucd.Core_0023 is
pragma Preelaborate;
Group_0023 : aliased constant Core_Second_Stage
:= (16#08# => -- 2308
(Open_Punctuation, Neutral,
Other, Other, Close, Open_Punctuation,
(Other_Math
| Pattern_Syntax
| Grapheme_Base
| Math => True,
others => False)),
16#09# => -- 2309
(Close_Punctuation, Neutral,
Other, Other, Close, Close_Punctuation,
(Other_Math
| Pattern_Syntax
| Grapheme_Base
| Math => True,
others => False)),
16#0A# => -- 230A
(Open_Punctuation, Neutral,
Other, Other, Close, Open_Punctuation,
(Other_Math
| Pattern_Syntax
| Grapheme_Base
| Math => True,
others => False)),
16#0B# => -- 230B
(Close_Punctuation, Neutral,
Other, Other, Close, Close_Punctuation,
(Other_Math
| Pattern_Syntax
| Grapheme_Base
| Math => True,
others => False)),
16#12# => -- 2312
(Other_Symbol, Ambiguous,
Other, Other, Other, Ambiguous,
(Pattern_Syntax
| Grapheme_Base => True,
others => False)),
16#1A# .. 16#1B# => -- 231A .. 231B
(Other_Symbol, Neutral,
Other, Other, Other, Ideographic,
(Pattern_Syntax
| Grapheme_Base => True,
others => False)),
16#20# .. 16#21# => -- 2320 .. 2321
(Math_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Pattern_Syntax
| Grapheme_Base
| Math => True,
others => False)),
16#29# => -- 2329
(Open_Punctuation, Wide,
Other, Other, Close, Open_Punctuation,
(Deprecated
| Pattern_Syntax
| Grapheme_Base
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#2A# => -- 232A
(Close_Punctuation, Wide,
Other, Other, Close, Close_Punctuation,
(Deprecated
| Pattern_Syntax
| Grapheme_Base
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#7C# => -- 237C
(Math_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Pattern_Syntax
| Grapheme_Base
| Math => True,
others => False)),
16#9B# .. 16#B3# => -- 239B .. 23B3
(Math_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Pattern_Syntax
| Grapheme_Base
| Math => True,
others => False)),
16#B4# .. 16#B5# => -- 23B4 .. 23B5
(Other_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Other_Math
| Pattern_Syntax
| Grapheme_Base
| Math => True,
others => False)),
16#B7# => -- 23B7
(Other_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Other_Math
| Pattern_Syntax
| Grapheme_Base
| Math => True,
others => False)),
16#D0# => -- 23D0
(Other_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Other_Math
| Pattern_Syntax
| Grapheme_Base
| Math => True,
others => False)),
16#DC# .. 16#E1# => -- 23DC .. 23E1
(Math_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Pattern_Syntax
| Grapheme_Base
| Math => True,
others => False)),
16#E2# => -- 23E2
(Other_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Other_Math
| Pattern_Syntax
| Grapheme_Base
| Math => True,
others => False)),
16#F0# .. 16#F3# => -- 23F0 .. 23F3
(Other_Symbol, Neutral,
Other, Other, Other, Ideographic,
(Pattern_Syntax
| Grapheme_Base => True,
others => False)),
16#FB# .. 16#FF# => -- 23FB .. 23FF
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(Pattern_Syntax => True,
others => False)),
others =>
(Other_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Pattern_Syntax
| Grapheme_Base => True,
others => False)));
end Matreshka.Internals.Unicode.Ucd.Core_0023;
|
with
ada.unchecked_Deallocation;
package body openGL.Model
is
---------
--- Forge
--
procedure define (Self : out Item) is null;
procedure deallocate is new ada.unchecked_Deallocation (Geometry.views,
access_Geometry_views);
procedure destroy (Self : in out Item)
is
begin
if Self.opaque_Geometries /= null
then
for i in Self.opaque_Geometries'Range
loop
Geometry.free (Self.opaque_Geometries (i));
end loop;
deallocate (Self.opaque_Geometries);
end if;
if Self.lucid_Geometries /= null
then
for i in Self.lucid_Geometries'Range
loop
Geometry.free (Self.lucid_Geometries (i));
end loop;
deallocate (Self.lucid_Geometries);
end if;
end destroy;
procedure free (Self : in out View)
is
procedure deallocate is new ada.unchecked_Deallocation (Model.item'Class,
Model.view);
begin
Self.destroy;
deallocate (Self);
end free;
--------------
--- Attributes
--
function Id (Self : in Item'Class) return Model_Id
is
begin
return Self.Id;
end Id;
procedure Id_is (Self : in out Item'Class; Now : in Model_Id)
is
begin
Self.Id := Now;
end Id_is;
procedure set_Bounds (Self : in out Item)
is
begin
Self.Bounds := null_Bounds;
if Self.opaque_Geometries /= null
then
for Each of Self.opaque_Geometries.all
loop
Self.Bounds.Box := Self.Bounds.Box
or Each.Bounds.Box;
Self.Bounds.Ball := Real'Max (Self.Bounds.Ball,
Each.Bounds.Ball);
end loop;
end if;
if Self.lucid_Geometries /= null
then
for Each of Self.lucid_Geometries.all
loop
Self.Bounds.Box := Self.Bounds.Box
or Each.Bounds.Box;
Self.Bounds.Ball := Real'Max (Self.Bounds.Ball,
Each.Bounds.Ball);
end loop;
end if;
end set_Bounds;
procedure create_GL_Geometries (Self : in out Item'Class; Textures : access Texture.name_Map_of_texture'Class;
Fonts : in Font.font_id_Map_of_font)
is
all_Geometries : constant Geometry.views := Self.to_GL_Geometries (Textures, Fonts);
opaque_Faces : Geometry.views (1 .. all_Geometries'Length);
opaque_Count : Index_t := 0;
lucid_Faces : Geometry.views (1 .. all_Geometries'Length);
lucid_Count : Index_t := 0;
begin
Self.Bounds := null_Bounds;
-- Separate lucid and opaque geometries.
--
for i in all_Geometries'Range
loop
if all_Geometries (i).is_Transparent
then
lucid_Count := lucid_Count + 1;
lucid_Faces (lucid_Count) := all_Geometries (i);
else
opaque_Count := opaque_Count + 1;
opaque_Faces (opaque_Count) := all_Geometries (i);
end if;
Self.Bounds.Box := Self.Bounds.Box
or all_Geometries (i).Bounds.Box;
Self.Bounds.Ball:= Real'Max (Self.Bounds.Ball,
all_Geometries (i).Bounds.Ball);
end loop;
-- Free any existing geometries.
--
if Self.opaque_Geometries /= null
then
for i in Self.opaque_Geometries'Range
loop
Geometry.free (Self.opaque_Geometries (i));
end loop;
deallocate (Self.opaque_Geometries);
end if;
if Self.lucid_Geometries /= null
then
for i in Self.lucid_Geometries'Range
loop
Geometry.free (Self.lucid_Geometries (i));
end loop;
deallocate (Self.lucid_Geometries);
end if;
-- Create new gemometries.
--
Self.opaque_Geometries := new Geometry.views' (opaque_Faces (1 .. opaque_Count));
Self. lucid_Geometries := new Geometry.views' ( lucid_Faces (1 .. lucid_Count));
Self.needs_Rebuild := False;
end create_GL_Geometries;
function is_Modified (Self : in Item) return Boolean
is
pragma unreferenced (Self);
begin
return False;
end is_Modified;
function Bounds (Self : in Item) return openGL.Bounds
is
begin
return Self.Bounds;
end Bounds;
function opaque_Geometries (Self : in Item) return access_Geometry_views
is
begin
return Self.opaque_Geometries;
end opaque_Geometries;
function lucid_Geometries (Self : in Item) return access_Geometry_views
is
begin
return Self.lucid_Geometries;
end lucid_Geometries;
function needs_Rebuild (Self : in Item) return Boolean
is
begin
return Boolean (Self.needs_Rebuild);
end needs_Rebuild;
procedure needs_Rebuild (Self : in out Item)
is
begin
Self.needs_Rebuild := True;
end needs_Rebuild;
end openGL.Model;
|
pragma Ada_2005;
pragma Style_Checks (Off);
with Interfaces.C; use Interfaces.C;
with Interfaces.C.Extensions;
package stdint_h is
subtype int8_t is signed_char; -- c:\home\ochem\install\bin\../lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/include/stdint.h:35
subtype uint8_t is unsigned_char; -- c:\home\ochem\install\bin\../lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/include/stdint.h:36
subtype int16_t is short; -- c:\home\ochem\install\bin\../lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/include/stdint.h:37
subtype uint16_t is unsigned_short; -- c:\home\ochem\install\bin\../lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/include/stdint.h:38
subtype int32_t is int; -- c:\home\ochem\install\bin\../lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/include/stdint.h:39
subtype uint32_t is unsigned; -- c:\home\ochem\install\bin\../lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/include/stdint.h:40
subtype int64_t is Long_Long_Integer; -- c:\home\ochem\install\bin\../lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/include/stdint.h:41
subtype uint64_t is Extensions.unsigned_long_long; -- c:\home\ochem\install\bin\../lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/include/stdint.h:42
subtype int_least8_t is signed_char; -- c:\home\ochem\install\bin\../lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/include/stdint.h:45
subtype uint_least8_t is unsigned_char; -- c:\home\ochem\install\bin\../lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/include/stdint.h:46
subtype int_least16_t is short; -- c:\home\ochem\install\bin\../lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/include/stdint.h:47
subtype uint_least16_t is unsigned_short; -- c:\home\ochem\install\bin\../lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/include/stdint.h:48
subtype int_least32_t is int; -- c:\home\ochem\install\bin\../lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/include/stdint.h:49
subtype uint_least32_t is unsigned; -- c:\home\ochem\install\bin\../lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/include/stdint.h:50
subtype int_least64_t is Long_Long_Integer; -- c:\home\ochem\install\bin\../lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/include/stdint.h:51
subtype uint_least64_t is Extensions.unsigned_long_long; -- c:\home\ochem\install\bin\../lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/include/stdint.h:52
subtype int_fast8_t is signed_char; -- c:\home\ochem\install\bin\../lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/include/stdint.h:58
subtype uint_fast8_t is unsigned_char; -- c:\home\ochem\install\bin\../lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/include/stdint.h:59
subtype int_fast16_t is short; -- c:\home\ochem\install\bin\../lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/include/stdint.h:60
subtype uint_fast16_t is unsigned_short; -- c:\home\ochem\install\bin\../lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/include/stdint.h:61
subtype int_fast32_t is int; -- c:\home\ochem\install\bin\../lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/include/stdint.h:62
subtype uint_fast32_t is unsigned; -- c:\home\ochem\install\bin\../lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/include/stdint.h:63
subtype int_fast64_t is Long_Long_Integer; -- c:\home\ochem\install\bin\../lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/include/stdint.h:64
subtype uint_fast64_t is Extensions.unsigned_long_long; -- c:\home\ochem\install\bin\../lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/include/stdint.h:65
subtype intmax_t is Long_Long_Integer; -- c:\home\ochem\install\bin\../lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/include/stdint.h:68
subtype uintmax_t is Extensions.unsigned_long_long; -- c:\home\ochem\install\bin\../lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/include/stdint.h:69
end stdint_h;
|
------------------------------------------------------------------------------
-- --
-- GNU ADA RUNTIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . T A S K _ P R I M I T I V E S --
-- --
-- S p e c --
-- --
-- $Revision: 1.1 $ --
-- --
-- Copyright (C) 1991,1992,1993,1994,1995,1996 Florida State University --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNARL; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. It is --
-- now maintained by Ada Core Technologies Inc. in cooperation with Florida --
-- State University (http://www.gnat.com). --
-- --
------------------------------------------------------------------------------
with Interfaces.C;
-- Used for Size_t;
with Interfaces.C.Pthreads;
-- Used for, size_t,
-- pthread_mutex_t,
-- pthread_cond_t,
-- pthread_t
with Interfaces.C.POSIX_RTE;
-- Used for, Signal,
-- siginfo_ptr,
with System.Task_Clock;
-- Used for, Stimespec
with Unchecked_Conversion;
pragma Elaborate_All (Interfaces.C.Pthreads);
with System.Task_Info;
package System.Task_Primitives is
-- Low level Task size and state definition
type LL_Task_Procedure_Access is access procedure (Arg : System.Address);
type Pre_Call_State is new System.Address;
type Task_Storage_Size is new Interfaces.C.size_t;
type Machine_Exceptions is new Interfaces.C.POSIX_RTE.Signal;
type Error_Information is new Interfaces.C.POSIX_RTE.siginfo_ptr;
type Lock is private;
type Condition_Variable is private;
-- The above types should both be limited. They are not due to a hack in
-- ATCB allocation which allocates a block of the correct size and then
-- assigns an initialized ATCB to it. This won't work with limited types.
-- When allocation is done with new, these can become limited once again.
-- ???
type Task_Control_Block is record
LL_Entry_Point : LL_Task_Procedure_Access;
LL_Arg : System.Address;
Thread : aliased Interfaces.C.Pthreads.pthread_t;
Stack_Size : Task_Storage_Size;
Stack_Limit : System.Address;
end record;
type TCB_Ptr is access all Task_Control_Block;
-- Task ATCB related and variables.
function Address_To_TCB_Ptr is new
Unchecked_Conversion (System.Address, TCB_Ptr);
procedure Initialize_LL_Tasks (T : TCB_Ptr);
-- Initialize GNULLI. T points to the Task Control Block that should
-- be initialized for use by the environment task.
function Self return TCB_Ptr;
-- Return a pointer to the Task Control Block of the calling task.
procedure Initialize_Lock (Prio : System.Any_Priority; L : in out Lock);
-- Initialize a lock object. Prio is the ceiling priority associated
-- with the lock.
procedure Finalize_Lock (L : in out Lock);
-- Finalize a lock object, freeing any resources allocated by the
-- corresponding Initialize_Lock.
procedure Write_Lock (L : in out Lock; Ceiling_Violation : out Boolean);
pragma Inline (Write_Lock);
-- Lock a lock object for write access to a critical section. After
-- this operation returns, the calling task owns the lock, and
-- no other Write_Lock or Read_Lock operation on the same object will
-- return the owner executes an Unlock operation on the same object.
procedure Read_Lock (L : in out Lock; Ceiling_Violation : out Boolean);
pragma Inline (Read_Lock);
-- Lock a lock object for read access to a critical section. After
-- this operation returns, the calling task owns the lock, and
-- no other Write_Lock operation on the same object will return until
-- the owner(s) execute Unlock operation(s) on the same object.
-- A Read_Lock to an owned lock object may return while the lock is
-- still owned, though an implementation may also implement
-- Read_Lock to have the same semantics.
procedure Unlock (L : in out Lock);
pragma Inline (Unlock);
-- Unlock a locked lock object. The results are undefined if the
-- calling task does not own the lock. Lock/Unlock operations must
-- be nested, that is, the argument to Unlock must be the object
-- most recently locked.
procedure Initialize_Cond (Cond : in out Condition_Variable);
-- Initialize a condition variable object.
procedure Finalize_Cond (Cond : in out Condition_Variable);
-- Finalize a condition variable object, recovering any resources
-- allocated for it by Initialize_Cond.
procedure Cond_Wait (Cond : in out Condition_Variable; L : in out Lock);
pragma Inline (Cond_Wait);
-- Wait on a condition variable. The mutex object L is unlocked
-- atomically, such that another task that is able to lock the mutex
-- can be assured that the wait has actually commenced, and that
-- a Cond_Signal operation will cause the waiting task to become
-- eligible for execution once again. Before Cond_Wait returns,
-- the waiting task will again lock the mutex. The waiting task may become
-- eligible for execution at any time, but will become eligible for
-- execution when a Cond_Signal operation is performed on the
-- same condition variable object. The effect of more than one
-- task waiting on the same condition variable is unspecified.
procedure Cond_Timed_Wait
(Cond : in out Condition_Variable;
L : in out Lock; Abs_Time : System.Task_Clock.Stimespec;
Timed_Out : out Boolean);
pragma Inline (Cond_Timed_Wait);
-- Wait on a condition variable, as for Cond_Wait, above. In addition,
-- the waiting task will become eligible for execution again
-- when the absolute time specified by Timed_Out arrives.
procedure Cond_Signal (Cond : in out Condition_Variable);
pragma Inline (Cond_Signal);
-- Wake up a task waiting on the condition variable object specified
-- by Cond, making it eligible for execution once again.
procedure Set_Priority (T : TCB_Ptr; Prio : System.Any_Priority);
pragma Inline (Set_Priority);
-- Set the priority of the task specified by T to P.
procedure Set_Own_Priority (Prio : System.Any_Priority);
pragma Inline (Set_Own_Priority);
-- Set the priority of the calling task to P.
function Get_Priority (T : TCB_Ptr) return System.Any_Priority;
pragma Inline (Get_Priority);
-- Return the priority of the task specified by T.
function Get_Own_Priority return System.Any_Priority;
pragma Inline (Get_Own_Priority);
-- Return the priority of the calling task.
procedure Create_LL_Task
(Priority : System.Any_Priority;
Stack_Size : Task_Storage_Size;
Task_Info : System.Task_Info.Task_Info_Type;
LL_Entry_Point : LL_Task_Procedure_Access;
Arg : System.Address;
T : TCB_Ptr);
-- Create a new low-level task with priority Priority. A new thread
-- of control is created with a stack size of at least Stack_Size,
-- and the procedure LL_Entry_Point is called with the argument Arg
-- from this new thread of control. The Task Control Block pointed
-- to by T is initialized to refer to this new task.
procedure Exit_LL_Task;
-- Exit a low-level task. The resources allocated for the task
-- by Create_LL_Task are recovered. The task no longer executes, and
-- the effects of further operations on task are unspecified.
procedure Abort_Task (T : TCB_Ptr);
-- Abort the task specified by T (the target task). This causes
-- the target task to asynchronously execute the handler procedure
-- installed by the target task using Install_Abort_Handler. The
-- effect of this operation is unspecified if there is no abort
-- handler procedure for the target task.
procedure Test_Abort;
-- ??? Obsolete? This is intended to allow implementation of
-- abortion and ATC in the absence of an asynchronous Abort_Task,
-- but I think that we decided that GNARL can handle this on
-- its own by making sure that there is an Undefer_Abortion at
-- every abortion synchronization point.
type Abort_Handler_Pointer is access procedure (Context : Pre_Call_State);
procedure Install_Abort_Handler (Handler : Abort_Handler_Pointer);
-- Install an abort handler procedure. This procedure is called
-- asynchronously by the calling task whenever a call to Abort_Task
-- specifies the calling task as the target. If the abort handler
-- procedure is asynchronously executed during a GNULLI operation
-- and then calls some other GNULLI operation, the effect is unspecified.
procedure Install_Error_Handler (Handler : System.Address);
-- Install an error handler for the calling task. The handler will
-- be called synchronously if an error is encountered during the
-- execution of the calling task.
procedure LL_Assert (B : Boolean; M : String);
-- If B is False, print the string M to the console and halt the
-- program.
Task_Wrapper_Frame : constant Integer := 72;
-- This is the size of the frame for the Pthread_Wrapper procedure.
type Proc is access procedure (Addr : System.Address);
-- Test and Set support
type TAS_Cell is private;
-- On some systems we can not assume that an arbitrary memory location
-- can be used in an atomic test and set instruction (e.g. on some
-- multiprocessor machines, only memory regions are cache interlocked).
-- TAS_Cell is private to facilitate adaption to a variety of
-- implementations.
procedure Initialize_TAS_Cell (Cell : out TAS_Cell);
pragma Inline (Initialize_TAS_Cell);
-- Initialize a Test And Set Cell. On some targets this will allocate
-- a system-level lock object from a special pool. For most systems,
-- this is a nop.
procedure Finalize_TAS_Cell (Cell : in out TAS_Cell);
pragma Inline (Finalize_TAS_Cell);
-- Finalize a Test and Set cell, freeing any resources allocated by the
-- corresponding Initialize_TAS_Cell.
procedure Clear (Cell : in out TAS_Cell);
pragma Inline (Clear);
-- Set the state of the named TAS_Cell such that a subsequent call to
-- Is_Set will return False. This operation must be atomic with
-- respect to the Is_Set and Test_And_Set operations for the same
-- cell.
procedure Test_And_Set (Cell : in out TAS_Cell; Result : out Boolean);
pragma Inline (Test_And_Set);
-- Modify the state of the named TAS_Cell such that a subsequent call
-- to Is_Set will return True. Result is set to True if Is_Set
-- was False prior to the call, False otherwise. This operation must
-- be atomic with respect to the Clear and Is_Set operations for the
-- same cell.
function Is_Set (Cell : in TAS_Cell) return Boolean;
pragma Inline (Is_Set);
-- Returns the current value of the named TAS_Cell. This operation
-- must be atomic with respect to the Clear and Test_And_Set operations
-- for the same cell.
private
type Lock is
record
mutex : aliased Interfaces.C.Pthreads.pthread_mutex_t;
end record;
type Condition_Variable is
record
CV : aliased Interfaces.C.Pthreads.pthread_cond_t;
end record;
type TAS_Cell is
record
Value : aliased Interfaces.C.unsigned := 0;
end record;
end System.Task_Primitives;
|
-----------------------------------------------------------------------
-- asf.beans -- Bean Registration and Factory
-- Copyright (C) 2009, 2010, 2011 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Strings.Hash;
with Ada.Strings.Unbounded;
with Util.Beans.Basic;
with Util.Refs;
with EL.Beans;
with EL.Contexts;
with Ada.Containers.Hashed_Maps;
with Ada.Containers.Indefinite_Hashed_Maps;
private with Ada.Strings.Unbounded.Hash;
-- The <b>ASF.Beans</b> package is a registry for creating request, session
-- and application beans.
--
-- First, an application or a module registers in a class factory the class
-- of objects that can be created. Each class is represented by a <b>Class_Binding</b>
-- interface that allows to create instances of the given class. Each class
-- is associated with a unique name in the class factory (ie, the class name).
-- This step is done when the application or module is initialized.
--
-- Second, a set of application configuration files define the runtime bean objects
-- that can be created automatically when a request is processed. Each runtime bean
-- object is associated with a bean name, a bean type identifying the class of object,
-- and a scope that identifies the lifespan of the object.
--
-- When a request is processed and a bean must be created, the bean factory is
-- searched to find a the object class and object scope (a <b>Bean_Binding</b>).
-- The <b>Class_Binding</b> associated with the <b>Bean_Binding</b> is then used
-- to create the object.
package ASF.Beans is
-- Defines the scope of the bean instance.
type Scope_Type is
(
-- Application scope means the bean is shared by all sessions and requests
APPLICATION_SCOPE,
-- Session scope means the bean is created one for each session.
SESSION_SCOPE,
-- Request scope means the bean is created for each request
REQUEST_SCOPE,
ANY_SCOPE);
-- ------------------------------
-- Class Binding
-- ------------------------------
-- The <b>Class_Binding</b> provides an operation to create objects of a given class.
type Class_Binding is abstract new Util.Refs.Ref_Entity with null record;
type Class_Binding_Access is access all Class_Binding'Class;
procedure Create (Factory : in Class_Binding;
Name : in Ada.Strings.Unbounded.Unbounded_String;
Result : out Util.Beans.Basic.Readonly_Bean_Access) is abstract;
-- Simplified bean creation. A <b>Create_Bean_Access</b> function can be registered
-- as a simplified class binding to create bean instances.
type Create_Bean_Access is access function return Util.Beans.Basic.Readonly_Bean_Access;
-- ------------------------------
-- Bean initialization
-- ------------------------------
-- After a bean object is created, it can be initialized with a set of values defined
-- by the <b>EL.Beans.Param_Value</b> type which holds the bean property name as well
-- as an EL expression that will be evaluated to get the property value.
type Parameter_Bean is new Util.Refs.Ref_Entity with record
Params : EL.Beans.Param_Vectors.Vector;
end record;
type Parameter_Bean_Access is access all Parameter_Bean;
package Parameter_Bean_Ref is
new Util.Refs.Indefinite_References (Element_Type => Parameter_Bean,
Element_Access => Parameter_Bean_Access);
-- ------------------------------
-- Bean Factory
-- ------------------------------
-- The registry maintains a list of creation bindings which allow to create
-- a bean object of a particular type.
type Bean_Factory is limited private;
-- Register under the name identified by <b>Name</b> the class instance <b>Class</b>.
procedure Register_Class (Factory : in out Bean_Factory;
Name : in String;
Class : in Class_Binding_Access);
-- Register under the name identified by <b>Name</b> a function to create a bean.
-- This is a simplified class registration.
procedure Register_Class (Factory : in out Bean_Factory;
Name : in String;
Handler : in Create_Bean_Access);
-- Register all the definitions from a factory to a main factory.
procedure Register (Factory : in out Bean_Factory;
From : in Bean_Factory);
-- Register the bean identified by <b>Name</b> and associated with the class <b>Class</b>.
-- The class must have been registered by using the <b>Register</b> class operation.
-- The scope defines the scope of the bean.
procedure Register (Factory : in out Bean_Factory;
Name : in String;
Class : in String;
Params : in Parameter_Bean_Ref.Ref;
Scope : in Scope_Type := REQUEST_SCOPE);
-- Register the bean identified by <b>Name</b> and associated with the class <b>Class</b>.
-- The class must have been registered by using the <b>Register</b> class operation.
-- The scope defines the scope of the bean.
procedure Register (Factory : in out Bean_Factory;
Name : in String;
Class : in Class_Binding_Access;
Params : in Parameter_Bean_Ref.Ref;
Scope : in Scope_Type := REQUEST_SCOPE);
-- Create a bean by using the create operation registered for the name
procedure Create (Factory : in Bean_Factory;
Name : in Ada.Strings.Unbounded.Unbounded_String;
Context : in EL.Contexts.ELContext'Class;
Result : out Util.Beans.Basic.Readonly_Bean_Access;
Scope : out Scope_Type);
private
use Ada.Strings.Unbounded;
package Class_Binding_Ref is
new Util.Refs.Indefinite_References (Element_Type => Class_Binding'Class,
Element_Access => Class_Binding_Access);
package Registry_Maps is
new Ada.Containers.Indefinite_Hashed_Maps (Key_Type => String,
Element_Type => Class_Binding_Ref.Ref,
Hash => Ada.Strings.Hash,
Equivalent_Keys => "=",
"=" => Class_Binding_Ref."=");
-- ------------------------------
-- Default class binding record
-- ------------------------------
type Default_Class_Binding is new Class_Binding with record
Create : Create_Bean_Access;
end record;
type Default_Class_Binding_Access is access all Default_Class_Binding'Class;
-- Create a bean by using the registered create function.
procedure Create (Factory : in Default_Class_Binding;
Name : in Ada.Strings.Unbounded.Unbounded_String;
Result : out Util.Beans.Basic.Readonly_Bean_Access);
type Bean_Binding is record
Scope : Scope_Type;
Create : Class_Binding_Ref.Ref;
Params : Parameter_Bean_Ref.Ref;
end record;
package Bean_Maps is new
Ada.Containers.Hashed_Maps (Key_Type => Unbounded_String,
Element_Type => Bean_Binding,
Hash => Ada.Strings.Unbounded.Hash,
Equivalent_Keys => "=");
type Bean_Factory is limited record
Registry : Registry_Maps.Map;
Map : Bean_Maps.Map;
end record;
end ASF.Beans;
|
-- Copyright 2009-2017 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with System;
package Pck is
procedure Do_Nothing (A : System.Address);
end Pck;
|
with MPFR.Generic_FR;
with MPC.Root_C;
generic
with package Real_FR is new MPFR.Generic_FR (others => <>);
with package Imaginary_FR is new MPFR.Generic_FR (others => <>);
package MPC.Generic_C is
pragma Preelaborate;
function Rounding return MPC.Rounding;
pragma Inline (Rounding);
type MP_Complex is
new Root_C.MP_Complex (Real_FR.Precision, Imaginary_FR.Precision);
type MP_Imaginary is private;
function i return MP_Imaginary;
function j return MP_Imaginary renames i;
pragma Inline (i);
function Re (X : MP_Complex) return Real_FR.MP_Float;
function Im (X : MP_Complex) return Imaginary_FR.MP_Float;
pragma Inline (Re);
pragma Inline (Im);
function Compose (Re : Real_FR.MP_Float; Im : Imaginary_FR.MP_Float)
return MP_Complex;
pragma Inline (Compose);
-- formatting
function Image (Value : MP_Complex; Base : Number_Base := 10) return String;
function Value (Image : String; Base : Number_Base := 10) return MP_Complex;
pragma Inline (Image);
pragma Inline (Value);
-- relational operators of complex are inherited
-- unary adding operators of complex
function "+" (Right : MP_Complex) return MP_Complex;
function "-" (Right : MP_Complex) return MP_Complex;
pragma Inline ("+");
pragma Inline ("-");
-- binary adding operators of complex
function "+" (Left, Right : MP_Complex) return MP_Complex;
function "+" (Left : Long_Long_Float; Right : MP_Imaginary)
return MP_Complex;
function "-" (Left, Right : MP_Complex) return MP_Complex;
function "-" (Left : Long_Long_Float; Right : MP_Imaginary)
return MP_Complex;
pragma Inline ("+");
pragma Inline ("-");
-- multiplying operators of complex
function "*" (Left, Right : MP_Complex) return MP_Complex;
function "/" (Left, Right : MP_Complex) return MP_Complex;
pragma Inline ("*");
pragma Inline ("/");
-- highest precedence operators of complex
function "**" (Left : MP_Complex; Right : Integer) return MP_Complex;
pragma Inline ("**");
-- multiplying operators of imaginary
function "*" (Left : Long_Long_Float; Right : MP_Imaginary)
return MP_Imaginary;
pragma Inline ("*");
private
type MP_Imaginary is new Imaginary_FR.MP_Float;
end MPC.Generic_C;
|
with Libadalang.Analysis;
package Offmt_Lib.Detection is
package LAL renames Libadalang.Analysis;
function Check_Defmt_Log_Call (Node : LAL.Call_Stmt'Class;
Call : out LAL.Call_Expr)
return Boolean;
-- Return True if Node is a valid Offmt.Log (<fmt>) call statement
end Offmt_Lib.Detection;
|
-- C45303A.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- CHECK THAT ADDITION AND SUBTRACTION YIELD RESULTS BELONGING TO THE
-- BASE TYPE.
-- JBG 2/24/84
-- JRL 03/30/93 REMOVED NUMERIC_ERROR FROM TEST.
-- JRL 10/13/96 Fixed static expressions which contained values outside
-- the base range.
WITH REPORT; USE REPORT;
PROCEDURE C45303A IS
TYPE INT IS RANGE 1..10;
X, Y : INT := INT(IDENT_INT(9));
BEGIN
TEST ("C45303A", "CHECK SUBTYPE OF INTEGER ADDITION/SUBTRACTION");
BEGIN
IF X + Y - 10 /= INT(IDENT_INT(8)) THEN
FAILED ("INCORRECT RESULT - ADDITION");
END IF;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
IF INT'POS(INT'BASE'LAST) >= 18 THEN
FAILED ("ADDITION DOES NOT YIELD RESULT " &
"BELONGING TO THE BASE TYPE");
ELSE
COMMENT ("BASE TYPE HAS RANGE LESS THAN 18 - ADD");
END IF;
END;
BEGIN
IF 2 - X - INT(IDENT_INT(1)) /= INT'VAL(IDENT_INT(-8)) THEN
FAILED ("INCORRECT RESULT - SUBTRACTION");
END IF;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
IF INT'POS(INT'BASE'FIRST) <= -8 THEN
FAILED ("SUBTRACTION DOES NOT YIELD RESULT " &
"BELONGING TO THE BASE TYPE");
ELSE
COMMENT ("BASE TYPE HAS RANGE GREATER THAN -8 - SUB");
END IF;
END;
RESULT;
END C45303A;
|
with Entities; use Entities;
package Links is
type LinkTypes is (LTRope, LTSpring);
type LinkTypesFactorsArr is array (LinkTypes) of Float;
type Link is record
A, B : EntityClassAcc;
LinkType : LinkTypes;
Factor, RestLen : Float;
end record;
pragma Pack(Link);
type LinkAcc is access all Link;
LinkTypesFactors : LinkTypesFactorsArr :=
(LTRope => 0.5,
LTSpring => 500.0);
function CreateLink(A, B : EntityClassAcc; LinkType : LinkTypes; Factor : Float := 0.0) return LinkAcc;
procedure FreeLink(This : in out LinkAcc);
end Links;
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE boost_serialization>
<boost_serialization signature="serialization::archive" version="11">
<syndb class_id="0" tracking_level="0" version="0">
<userIPLatency>-1</userIPLatency>
<userIPName></userIPName>
<cdfg class_id="1" tracking_level="1" version="0" object_id="_0">
<name>dct_dct_1d</name>
<ret_bitwidth>0</ret_bitwidth>
<ports class_id="2" tracking_level="0" version="0">
<count>11</count>
<item_version>0</item_version>
<item class_id="3" tracking_level="1" version="0" object_id="_1">
<Value class_id="4" tracking_level="0" version="0">
<Obj class_id="5" tracking_level="0" version="0">
<type>1</type>
<id>1</id>
<name>src</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo class_id="6" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<direction>0</direction>
<if_type>1</if_type>
<array_size>8</array_size>
<bit_vecs class_id="7" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_2">
<Value>
<Obj>
<type>1</type>
<id>2</id>
<name>src1</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<direction>0</direction>
<if_type>1</if_type>
<array_size>8</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_3">
<Value>
<Obj>
<type>1</type>
<id>3</id>
<name>src2</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<direction>0</direction>
<if_type>1</if_type>
<array_size>8</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_4">
<Value>
<Obj>
<type>1</type>
<id>4</id>
<name>src3</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<direction>0</direction>
<if_type>1</if_type>
<array_size>8</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_5">
<Value>
<Obj>
<type>1</type>
<id>5</id>
<name>src4</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<direction>0</direction>
<if_type>1</if_type>
<array_size>8</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_6">
<Value>
<Obj>
<type>1</type>
<id>6</id>
<name>src5</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<direction>0</direction>
<if_type>1</if_type>
<array_size>8</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_7">
<Value>
<Obj>
<type>1</type>
<id>7</id>
<name>src6</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<direction>0</direction>
<if_type>1</if_type>
<array_size>8</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_8">
<Value>
<Obj>
<type>1</type>
<id>8</id>
<name>src7</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<direction>0</direction>
<if_type>1</if_type>
<array_size>8</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_9">
<Value>
<Obj>
<type>1</type>
<id>9</id>
<name>tmp_1</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_10">
<Value>
<Obj>
<type>1</type>
<id>10</id>
<name>dst</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>dst</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<direction>1</direction>
<if_type>1</if_type>
<array_size>64</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_11">
<Value>
<Obj>
<type>1</type>
<id>11</id>
<name>tmp_11</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
</ports>
<nodes class_id="8" tracking_level="0" version="0">
<count>83</count>
<item_version>0</item_version>
<item class_id="9" tracking_level="1" version="0" object_id="_12">
<Value>
<Obj>
<type>0</type>
<id>20</id>
<name>tmp_11_read</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>113</item>
<item>114</item>
</oprand_edges>
<opcode>read</opcode>
</item>
<item class_id_reference="9" object_id="_13">
<Value>
<Obj>
<type>0</type>
<id>21</id>
<name>tmp_1_read</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>115</item>
<item>116</item>
</oprand_edges>
<opcode>read</opcode>
</item>
<item class_id_reference="9" object_id="_14">
<Value>
<Obj>
<type>0</type>
<id>22</id>
<name>tmp_1_cast</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>117</item>
</oprand_edges>
<opcode>zext</opcode>
</item>
<item class_id_reference="9" object_id="_15">
<Value>
<Obj>
<type>0</type>
<id>23</id>
<name>src_addr</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>118</item>
<item>120</item>
<item>121</item>
</oprand_edges>
<opcode>getelementptr</opcode>
</item>
<item class_id_reference="9" object_id="_16">
<Value>
<Obj>
<type>0</type>
<id>24</id>
<name>src1_addr</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>122</item>
<item>123</item>
<item>124</item>
</oprand_edges>
<opcode>getelementptr</opcode>
</item>
<item class_id_reference="9" object_id="_17">
<Value>
<Obj>
<type>0</type>
<id>25</id>
<name>src2_addr</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>125</item>
<item>126</item>
<item>127</item>
</oprand_edges>
<opcode>getelementptr</opcode>
</item>
<item class_id_reference="9" object_id="_18">
<Value>
<Obj>
<type>0</type>
<id>26</id>
<name>src3_addr</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>128</item>
<item>129</item>
<item>130</item>
</oprand_edges>
<opcode>getelementptr</opcode>
</item>
<item class_id_reference="9" object_id="_19">
<Value>
<Obj>
<type>0</type>
<id>27</id>
<name>src4_addr</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>131</item>
<item>132</item>
<item>133</item>
</oprand_edges>
<opcode>getelementptr</opcode>
</item>
<item class_id_reference="9" object_id="_20">
<Value>
<Obj>
<type>0</type>
<id>28</id>
<name>src5_addr</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>134</item>
<item>135</item>
<item>136</item>
</oprand_edges>
<opcode>getelementptr</opcode>
</item>
<item class_id_reference="9" object_id="_21">
<Value>
<Obj>
<type>0</type>
<id>29</id>
<name>src6_addr</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>137</item>
<item>138</item>
<item>139</item>
</oprand_edges>
<opcode>getelementptr</opcode>
</item>
<item class_id_reference="9" object_id="_22">
<Value>
<Obj>
<type>0</type>
<id>30</id>
<name>src7_addr</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>140</item>
<item>141</item>
<item>142</item>
</oprand_edges>
<opcode>getelementptr</opcode>
</item>
<item class_id_reference="9" object_id="_23">
<Value>
<Obj>
<type>0</type>
<id>31</id>
<name>tmp_5</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>7</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>144</item>
<item>145</item>
<item>147</item>
</oprand_edges>
<opcode>bitconcatenate</opcode>
</item>
<item class_id_reference="9" object_id="_24">
<Value>
<Obj>
<type>0</type>
<id>32</id>
<name>p_addr_cast</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>57</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item class_id="11" tracking_level="0" version="0">
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second class_id="12" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="13" tracking_level="0" version="0">
<first class_id="14" tracking_level="0" version="0">
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>57</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>148</item>
</oprand_edges>
<opcode>zext</opcode>
</item>
<item class_id_reference="9" object_id="_25">
<Value>
<Obj>
<type>0</type>
<id>33</id>
<name></name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>57</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>57</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>149</item>
</oprand_edges>
<opcode>br</opcode>
</item>
<item class_id_reference="9" object_id="_26">
<Value>
<Obj>
<type>0</type>
<id>35</id>
<name>k</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>k</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>151</item>
<item>152</item>
<item>153</item>
<item>154</item>
</oprand_edges>
<opcode>phi</opcode>
</item>
<item class_id_reference="9" object_id="_27">
<Value>
<Obj>
<type>0</type>
<id>36</id>
<name>exitcond1</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>57</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>57</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>155</item>
<item>157</item>
</oprand_edges>
<opcode>icmp</opcode>
</item>
<item class_id_reference="9" object_id="_28">
<Value>
<Obj>
<type>0</type>
<id>37</id>
<name>k_1</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>57</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>57</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>k</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>158</item>
<item>160</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_29">
<Value>
<Obj>
<type>0</type>
<id>38</id>
<name></name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>57</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>57</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>161</item>
<item>162</item>
<item>163</item>
</oprand_edges>
<opcode>br</opcode>
</item>
<item class_id_reference="9" object_id="_30">
<Value>
<Obj>
<type>0</type>
<id>44</id>
<name>tmp</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>60</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>60</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>164</item>
</oprand_edges>
<opcode>zext</opcode>
</item>
<item class_id_reference="9" object_id="_31">
<Value>
<Obj>
<type>0</type>
<id>45</id>
<name>dct_coeff_table_0_addr</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>60</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>60</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>165</item>
<item>166</item>
<item>167</item>
</oprand_edges>
<opcode>getelementptr</opcode>
</item>
<item class_id_reference="9" object_id="_32">
<Value>
<Obj>
<type>0</type>
<id>46</id>
<name>dct_coeff_table_0_load</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>60</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>60</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>14</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>168</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_33">
<Value>
<Obj>
<type>0</type>
<id>47</id>
<name>coeff_cast</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>60</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>60</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>169</item>
</oprand_edges>
<opcode>zext</opcode>
</item>
<item class_id_reference="9" object_id="_34">
<Value>
<Obj>
<type>0</type>
<id>48</id>
<name>src_load</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>170</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_35">
<Value>
<Obj>
<type>0</type>
<id>49</id>
<name>tmp_7_cast</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>61</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>61</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>171</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_36">
<Value>
<Obj>
<type>0</type>
<id>50</id>
<name>tmp_8</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>61</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>61</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>172</item>
<item>173</item>
</oprand_edges>
<opcode>mul</opcode>
</item>
<item class_id_reference="9" object_id="_37">
<Value>
<Obj>
<type>0</type>
<id>51</id>
<name>dct_coeff_table_1_addr</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>60</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>60</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>174</item>
<item>175</item>
<item>176</item>
</oprand_edges>
<opcode>getelementptr</opcode>
</item>
<item class_id_reference="9" object_id="_38">
<Value>
<Obj>
<type>0</type>
<id>52</id>
<name>dct_coeff_table_1_load</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>60</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>60</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>15</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>177</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_39">
<Value>
<Obj>
<type>0</type>
<id>53</id>
<name>coeff_1_cast</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>60</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>60</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>178</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_40">
<Value>
<Obj>
<type>0</type>
<id>54</id>
<name>src1_load</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>179</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_41">
<Value>
<Obj>
<type>0</type>
<id>55</id>
<name>tmp_7_1_cast</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>61</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>61</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>180</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_42">
<Value>
<Obj>
<type>0</type>
<id>56</id>
<name>tmp_8_1</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>61</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>61</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>181</item>
<item>182</item>
</oprand_edges>
<opcode>mul</opcode>
</item>
<item class_id_reference="9" object_id="_43">
<Value>
<Obj>
<type>0</type>
<id>57</id>
<name>dct_coeff_table_2_addr</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>60</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>60</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>183</item>
<item>184</item>
<item>185</item>
</oprand_edges>
<opcode>getelementptr</opcode>
</item>
<item class_id_reference="9" object_id="_44">
<Value>
<Obj>
<type>0</type>
<id>58</id>
<name>dct_coeff_table_2_load</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>60</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>60</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>15</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>186</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_45">
<Value>
<Obj>
<type>0</type>
<id>59</id>
<name>coeff_2_cast</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>60</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>60</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>187</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_46">
<Value>
<Obj>
<type>0</type>
<id>60</id>
<name>src2_load</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>188</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_47">
<Value>
<Obj>
<type>0</type>
<id>61</id>
<name>tmp_7_2_cast</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>61</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>61</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>189</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_48">
<Value>
<Obj>
<type>0</type>
<id>62</id>
<name>tmp_8_2</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>61</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>61</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>190</item>
<item>191</item>
</oprand_edges>
<opcode>mul</opcode>
</item>
<item class_id_reference="9" object_id="_49">
<Value>
<Obj>
<type>0</type>
<id>63</id>
<name>dct_coeff_table_3_addr</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>60</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>60</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>192</item>
<item>193</item>
<item>194</item>
</oprand_edges>
<opcode>getelementptr</opcode>
</item>
<item class_id_reference="9" object_id="_50">
<Value>
<Obj>
<type>0</type>
<id>64</id>
<name>dct_coeff_table_3_load</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>60</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>60</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>15</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>195</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_51">
<Value>
<Obj>
<type>0</type>
<id>65</id>
<name>coeff_3_cast</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>60</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>60</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>196</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_52">
<Value>
<Obj>
<type>0</type>
<id>66</id>
<name>src3_load</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>197</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_53">
<Value>
<Obj>
<type>0</type>
<id>67</id>
<name>tmp_7_3_cast</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>61</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>61</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>198</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_54">
<Value>
<Obj>
<type>0</type>
<id>68</id>
<name>tmp_8_3</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>61</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>61</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>199</item>
<item>200</item>
</oprand_edges>
<opcode>mul</opcode>
</item>
<item class_id_reference="9" object_id="_55">
<Value>
<Obj>
<type>0</type>
<id>69</id>
<name>dct_coeff_table_4_addr</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>60</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>60</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>201</item>
<item>202</item>
<item>203</item>
</oprand_edges>
<opcode>getelementptr</opcode>
</item>
<item class_id_reference="9" object_id="_56">
<Value>
<Obj>
<type>0</type>
<id>70</id>
<name>dct_coeff_table_4_load</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>60</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>60</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>15</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>204</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_57">
<Value>
<Obj>
<type>0</type>
<id>71</id>
<name>coeff_4_cast</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>60</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>60</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>205</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_58">
<Value>
<Obj>
<type>0</type>
<id>72</id>
<name>src4_load</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>206</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_59">
<Value>
<Obj>
<type>0</type>
<id>73</id>
<name>tmp_7_4_cast</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>61</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>61</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>207</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_60">
<Value>
<Obj>
<type>0</type>
<id>74</id>
<name>tmp_8_4</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>61</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>61</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>208</item>
<item>209</item>
</oprand_edges>
<opcode>mul</opcode>
</item>
<item class_id_reference="9" object_id="_61">
<Value>
<Obj>
<type>0</type>
<id>75</id>
<name>dct_coeff_table_5_addr</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>60</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>60</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>210</item>
<item>211</item>
<item>212</item>
</oprand_edges>
<opcode>getelementptr</opcode>
</item>
<item class_id_reference="9" object_id="_62">
<Value>
<Obj>
<type>0</type>
<id>76</id>
<name>dct_coeff_table_5_load</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>60</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>60</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>15</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>213</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_63">
<Value>
<Obj>
<type>0</type>
<id>77</id>
<name>coeff_5_cast</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>60</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>60</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>214</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_64">
<Value>
<Obj>
<type>0</type>
<id>78</id>
<name>src5_load</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>215</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_65">
<Value>
<Obj>
<type>0</type>
<id>79</id>
<name>tmp_7_5_cast</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>61</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>61</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>216</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_66">
<Value>
<Obj>
<type>0</type>
<id>80</id>
<name>tmp_8_5</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>61</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>61</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>217</item>
<item>218</item>
</oprand_edges>
<opcode>mul</opcode>
</item>
<item class_id_reference="9" object_id="_67">
<Value>
<Obj>
<type>0</type>
<id>81</id>
<name>dct_coeff_table_6_addr</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>60</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>60</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>219</item>
<item>220</item>
<item>221</item>
</oprand_edges>
<opcode>getelementptr</opcode>
</item>
<item class_id_reference="9" object_id="_68">
<Value>
<Obj>
<type>0</type>
<id>82</id>
<name>dct_coeff_table_6_load</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>60</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>60</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>15</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>222</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_69">
<Value>
<Obj>
<type>0</type>
<id>83</id>
<name>coeff_6_cast</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>60</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>60</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>223</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_70">
<Value>
<Obj>
<type>0</type>
<id>84</id>
<name>src6_load</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>224</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_71">
<Value>
<Obj>
<type>0</type>
<id>85</id>
<name>tmp_7_6_cast</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>61</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>61</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>225</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_72">
<Value>
<Obj>
<type>0</type>
<id>86</id>
<name>tmp_8_6</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>61</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>61</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>226</item>
<item>227</item>
</oprand_edges>
<opcode>mul</opcode>
</item>
<item class_id_reference="9" object_id="_73">
<Value>
<Obj>
<type>0</type>
<id>87</id>
<name>dct_coeff_table_7_addr</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>60</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>60</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>228</item>
<item>229</item>
<item>230</item>
</oprand_edges>
<opcode>getelementptr</opcode>
</item>
<item class_id_reference="9" object_id="_74">
<Value>
<Obj>
<type>0</type>
<id>88</id>
<name>dct_coeff_table_7_load</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>60</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>60</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>15</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>231</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_75">
<Value>
<Obj>
<type>0</type>
<id>89</id>
<name>coeff_7_cast</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>60</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>60</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>232</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_76">
<Value>
<Obj>
<type>0</type>
<id>90</id>
<name>src7_load</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>233</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_77">
<Value>
<Obj>
<type>0</type>
<id>91</id>
<name>tmp_7_7_cast</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>61</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>61</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>234</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_78">
<Value>
<Obj>
<type>0</type>
<id>92</id>
<name>tmp_8_7</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>61</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>61</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>235</item>
<item>236</item>
</oprand_edges>
<opcode>mul</opcode>
</item>
<item class_id_reference="9" object_id="_79">
<Value>
<Obj>
<type>0</type>
<id>93</id>
<name>tmp2</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>63</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>63</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>237</item>
<item>238</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_80">
<Value>
<Obj>
<type>0</type>
<id>94</id>
<name>tmp3</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>63</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>63</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>239</item>
<item>240</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_81">
<Value>
<Obj>
<type>0</type>
<id>95</id>
<name>tmp1</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>63</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>63</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>241</item>
<item>242</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_82">
<Value>
<Obj>
<type>0</type>
<id>96</id>
<name>tmp5</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>63</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>63</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>243</item>
<item>244</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_83">
<Value>
<Obj>
<type>0</type>
<id>97</id>
<name>tmp7</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>63</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>63</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>245</item>
<item>247</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_84">
<Value>
<Obj>
<type>0</type>
<id>98</id>
<name>tmp6</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>63</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>63</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>248</item>
<item>249</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_85">
<Value>
<Obj>
<type>0</type>
<id>99</id>
<name>tmp4</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>63</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>63</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>250</item>
<item>251</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_86">
<Value>
<Obj>
<type>0</type>
<id>100</id>
<name>tmp_2</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>63</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>63</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>252</item>
<item>253</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_87">
<Value>
<Obj>
<type>0</type>
<id>101</id>
<name>tmp_4</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>63</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>63</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>255</item>
<item>256</item>
<item>258</item>
<item>260</item>
</oprand_edges>
<opcode>partselect</opcode>
</item>
<item class_id_reference="9" object_id="_88">
<Value>
<Obj>
<type>0</type>
<id>102</id>
<name>tmp_trn_cast</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>63</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>63</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>261</item>
</oprand_edges>
<opcode>zext</opcode>
</item>
<item class_id_reference="9" object_id="_89">
<Value>
<Obj>
<type>0</type>
<id>103</id>
<name>p_addr1</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>63</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>63</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>262</item>
<item>263</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_90">
<Value>
<Obj>
<type>0</type>
<id>104</id>
<name>tmp_6</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>63</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>63</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>264</item>
</oprand_edges>
<opcode>zext</opcode>
</item>
<item class_id_reference="9" object_id="_91">
<Value>
<Obj>
<type>0</type>
<id>105</id>
<name>dst_addr</name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>63</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>63</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>265</item>
<item>266</item>
<item>267</item>
</oprand_edges>
<opcode>getelementptr</opcode>
</item>
<item class_id_reference="9" object_id="_92">
<Value>
<Obj>
<type>0</type>
<id>106</id>
<name></name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>63</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>63</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>268</item>
<item>269</item>
</oprand_edges>
<opcode>store</opcode>
</item>
<item class_id_reference="9" object_id="_93">
<Value>
<Obj>
<type>0</type>
<id>108</id>
<name></name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>57</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>57</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>270</item>
</oprand_edges>
<opcode>br</opcode>
</item>
<item class_id_reference="9" object_id="_94">
<Value>
<Obj>
<type>0</type>
<id>110</id>
<name></name>
<fileName>dct.cpp</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory>
<lineNumber>65</lineNumber>
<contextFuncName>dct_1d</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.cpp</first>
<second>dct_1d</second>
</first>
<second>65</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>0</count>
<item_version>0</item_version>
</oprand_edges>
<opcode>ret</opcode>
</item>
</nodes>
<consts class_id="15" tracking_level="0" version="0">
<count>8</count>
<item_version>0</item_version>
<item class_id="16" tracking_level="1" version="0" object_id="_95">
<Value>
<Obj>
<type>2</type>
<id>119</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_96">
<Value>
<Obj>
<type>2</type>
<id>146</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_97">
<Value>
<Obj>
<type>2</type>
<id>150</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_98">
<Value>
<Obj>
<type>2</type>
<id>156</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<const_type>0</const_type>
<content>8</content>
</item>
<item class_id_reference="16" object_id="_99">
<Value>
<Obj>
<type>2</type>
<id>159</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<const_type>0</const_type>
<content>1</content>
</item>
<item class_id_reference="16" object_id="_100">
<Value>
<Obj>
<type>2</type>
<id>246</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<const_type>0</const_type>
<content>4096</content>
</item>
<item class_id_reference="16" object_id="_101">
<Value>
<Obj>
<type>2</type>
<id>257</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>13</content>
</item>
<item class_id_reference="16" object_id="_102">
<Value>
<Obj>
<type>2</type>
<id>259</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>28</content>
</item>
</consts>
<blocks class_id="17" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="18" tracking_level="1" version="0" object_id="_103">
<Obj>
<type>3</type>
<id>34</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>14</count>
<item_version>0</item_version>
<item>20</item>
<item>21</item>
<item>22</item>
<item>23</item>
<item>24</item>
<item>25</item>
<item>26</item>
<item>27</item>
<item>28</item>
<item>29</item>
<item>30</item>
<item>31</item>
<item>32</item>
<item>33</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_104">
<Obj>
<type>3</type>
<id>39</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>4</count>
<item_version>0</item_version>
<item>35</item>
<item>36</item>
<item>37</item>
<item>38</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_105">
<Obj>
<type>3</type>
<id>109</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>64</count>
<item_version>0</item_version>
<item>44</item>
<item>45</item>
<item>46</item>
<item>47</item>
<item>48</item>
<item>49</item>
<item>50</item>
<item>51</item>
<item>52</item>
<item>53</item>
<item>54</item>
<item>55</item>
<item>56</item>
<item>57</item>
<item>58</item>
<item>59</item>
<item>60</item>
<item>61</item>
<item>62</item>
<item>63</item>
<item>64</item>
<item>65</item>
<item>66</item>
<item>67</item>
<item>68</item>
<item>69</item>
<item>70</item>
<item>71</item>
<item>72</item>
<item>73</item>
<item>74</item>
<item>75</item>
<item>76</item>
<item>77</item>
<item>78</item>
<item>79</item>
<item>80</item>
<item>81</item>
<item>82</item>
<item>83</item>
<item>84</item>
<item>85</item>
<item>86</item>
<item>87</item>
<item>88</item>
<item>89</item>
<item>90</item>
<item>91</item>
<item>92</item>
<item>93</item>
<item>94</item>
<item>95</item>
<item>96</item>
<item>97</item>
<item>98</item>
<item>99</item>
<item>100</item>
<item>101</item>
<item>102</item>
<item>103</item>
<item>104</item>
<item>105</item>
<item>106</item>
<item>108</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_106">
<Obj>
<type>3</type>
<id>111</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>1</count>
<item_version>0</item_version>
<item>110</item>
</node_objs>
</item>
</blocks>
<edges class_id="19" tracking_level="0" version="0">
<count>148</count>
<item_version>0</item_version>
<item class_id="20" tracking_level="1" version="0" object_id="_107">
<id>114</id>
<edge_type>1</edge_type>
<source_obj>11</source_obj>
<sink_obj>20</sink_obj>
</item>
<item class_id_reference="20" object_id="_108">
<id>116</id>
<edge_type>1</edge_type>
<source_obj>9</source_obj>
<sink_obj>21</sink_obj>
</item>
<item class_id_reference="20" object_id="_109">
<id>117</id>
<edge_type>1</edge_type>
<source_obj>21</source_obj>
<sink_obj>22</sink_obj>
</item>
<item class_id_reference="20" object_id="_110">
<id>118</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>23</sink_obj>
</item>
<item class_id_reference="20" object_id="_111">
<id>120</id>
<edge_type>1</edge_type>
<source_obj>119</source_obj>
<sink_obj>23</sink_obj>
</item>
<item class_id_reference="20" object_id="_112">
<id>121</id>
<edge_type>1</edge_type>
<source_obj>22</source_obj>
<sink_obj>23</sink_obj>
</item>
<item class_id_reference="20" object_id="_113">
<id>122</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>24</sink_obj>
</item>
<item class_id_reference="20" object_id="_114">
<id>123</id>
<edge_type>1</edge_type>
<source_obj>119</source_obj>
<sink_obj>24</sink_obj>
</item>
<item class_id_reference="20" object_id="_115">
<id>124</id>
<edge_type>1</edge_type>
<source_obj>22</source_obj>
<sink_obj>24</sink_obj>
</item>
<item class_id_reference="20" object_id="_116">
<id>125</id>
<edge_type>1</edge_type>
<source_obj>3</source_obj>
<sink_obj>25</sink_obj>
</item>
<item class_id_reference="20" object_id="_117">
<id>126</id>
<edge_type>1</edge_type>
<source_obj>119</source_obj>
<sink_obj>25</sink_obj>
</item>
<item class_id_reference="20" object_id="_118">
<id>127</id>
<edge_type>1</edge_type>
<source_obj>22</source_obj>
<sink_obj>25</sink_obj>
</item>
<item class_id_reference="20" object_id="_119">
<id>128</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>26</sink_obj>
</item>
<item class_id_reference="20" object_id="_120">
<id>129</id>
<edge_type>1</edge_type>
<source_obj>119</source_obj>
<sink_obj>26</sink_obj>
</item>
<item class_id_reference="20" object_id="_121">
<id>130</id>
<edge_type>1</edge_type>
<source_obj>22</source_obj>
<sink_obj>26</sink_obj>
</item>
<item class_id_reference="20" object_id="_122">
<id>131</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>27</sink_obj>
</item>
<item class_id_reference="20" object_id="_123">
<id>132</id>
<edge_type>1</edge_type>
<source_obj>119</source_obj>
<sink_obj>27</sink_obj>
</item>
<item class_id_reference="20" object_id="_124">
<id>133</id>
<edge_type>1</edge_type>
<source_obj>22</source_obj>
<sink_obj>27</sink_obj>
</item>
<item class_id_reference="20" object_id="_125">
<id>134</id>
<edge_type>1</edge_type>
<source_obj>6</source_obj>
<sink_obj>28</sink_obj>
</item>
<item class_id_reference="20" object_id="_126">
<id>135</id>
<edge_type>1</edge_type>
<source_obj>119</source_obj>
<sink_obj>28</sink_obj>
</item>
<item class_id_reference="20" object_id="_127">
<id>136</id>
<edge_type>1</edge_type>
<source_obj>22</source_obj>
<sink_obj>28</sink_obj>
</item>
<item class_id_reference="20" object_id="_128">
<id>137</id>
<edge_type>1</edge_type>
<source_obj>7</source_obj>
<sink_obj>29</sink_obj>
</item>
<item class_id_reference="20" object_id="_129">
<id>138</id>
<edge_type>1</edge_type>
<source_obj>119</source_obj>
<sink_obj>29</sink_obj>
</item>
<item class_id_reference="20" object_id="_130">
<id>139</id>
<edge_type>1</edge_type>
<source_obj>22</source_obj>
<sink_obj>29</sink_obj>
</item>
<item class_id_reference="20" object_id="_131">
<id>140</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>30</sink_obj>
</item>
<item class_id_reference="20" object_id="_132">
<id>141</id>
<edge_type>1</edge_type>
<source_obj>119</source_obj>
<sink_obj>30</sink_obj>
</item>
<item class_id_reference="20" object_id="_133">
<id>142</id>
<edge_type>1</edge_type>
<source_obj>22</source_obj>
<sink_obj>30</sink_obj>
</item>
<item class_id_reference="20" object_id="_134">
<id>145</id>
<edge_type>1</edge_type>
<source_obj>20</source_obj>
<sink_obj>31</sink_obj>
</item>
<item class_id_reference="20" object_id="_135">
<id>147</id>
<edge_type>1</edge_type>
<source_obj>146</source_obj>
<sink_obj>31</sink_obj>
</item>
<item class_id_reference="20" object_id="_136">
<id>148</id>
<edge_type>1</edge_type>
<source_obj>31</source_obj>
<sink_obj>32</sink_obj>
</item>
<item class_id_reference="20" object_id="_137">
<id>149</id>
<edge_type>2</edge_type>
<source_obj>39</source_obj>
<sink_obj>33</sink_obj>
</item>
<item class_id_reference="20" object_id="_138">
<id>151</id>
<edge_type>1</edge_type>
<source_obj>150</source_obj>
<sink_obj>35</sink_obj>
</item>
<item class_id_reference="20" object_id="_139">
<id>152</id>
<edge_type>2</edge_type>
<source_obj>34</source_obj>
<sink_obj>35</sink_obj>
</item>
<item class_id_reference="20" object_id="_140">
<id>153</id>
<edge_type>1</edge_type>
<source_obj>37</source_obj>
<sink_obj>35</sink_obj>
</item>
<item class_id_reference="20" object_id="_141">
<id>154</id>
<edge_type>2</edge_type>
<source_obj>109</source_obj>
<sink_obj>35</sink_obj>
</item>
<item class_id_reference="20" object_id="_142">
<id>155</id>
<edge_type>1</edge_type>
<source_obj>35</source_obj>
<sink_obj>36</sink_obj>
</item>
<item class_id_reference="20" object_id="_143">
<id>157</id>
<edge_type>1</edge_type>
<source_obj>156</source_obj>
<sink_obj>36</sink_obj>
</item>
<item class_id_reference="20" object_id="_144">
<id>158</id>
<edge_type>1</edge_type>
<source_obj>35</source_obj>
<sink_obj>37</sink_obj>
</item>
<item class_id_reference="20" object_id="_145">
<id>160</id>
<edge_type>1</edge_type>
<source_obj>159</source_obj>
<sink_obj>37</sink_obj>
</item>
<item class_id_reference="20" object_id="_146">
<id>161</id>
<edge_type>1</edge_type>
<source_obj>36</source_obj>
<sink_obj>38</sink_obj>
</item>
<item class_id_reference="20" object_id="_147">
<id>162</id>
<edge_type>2</edge_type>
<source_obj>109</source_obj>
<sink_obj>38</sink_obj>
</item>
<item class_id_reference="20" object_id="_148">
<id>163</id>
<edge_type>2</edge_type>
<source_obj>111</source_obj>
<sink_obj>38</sink_obj>
</item>
<item class_id_reference="20" object_id="_149">
<id>164</id>
<edge_type>1</edge_type>
<source_obj>35</source_obj>
<sink_obj>44</sink_obj>
</item>
<item class_id_reference="20" object_id="_150">
<id>165</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>45</sink_obj>
</item>
<item class_id_reference="20" object_id="_151">
<id>166</id>
<edge_type>1</edge_type>
<source_obj>119</source_obj>
<sink_obj>45</sink_obj>
</item>
<item class_id_reference="20" object_id="_152">
<id>167</id>
<edge_type>1</edge_type>
<source_obj>44</source_obj>
<sink_obj>45</sink_obj>
</item>
<item class_id_reference="20" object_id="_153">
<id>168</id>
<edge_type>1</edge_type>
<source_obj>45</source_obj>
<sink_obj>46</sink_obj>
</item>
<item class_id_reference="20" object_id="_154">
<id>169</id>
<edge_type>1</edge_type>
<source_obj>46</source_obj>
<sink_obj>47</sink_obj>
</item>
<item class_id_reference="20" object_id="_155">
<id>170</id>
<edge_type>1</edge_type>
<source_obj>23</source_obj>
<sink_obj>48</sink_obj>
</item>
<item class_id_reference="20" object_id="_156">
<id>171</id>
<edge_type>1</edge_type>
<source_obj>48</source_obj>
<sink_obj>49</sink_obj>
</item>
<item class_id_reference="20" object_id="_157">
<id>172</id>
<edge_type>1</edge_type>
<source_obj>47</source_obj>
<sink_obj>50</sink_obj>
</item>
<item class_id_reference="20" object_id="_158">
<id>173</id>
<edge_type>1</edge_type>
<source_obj>49</source_obj>
<sink_obj>50</sink_obj>
</item>
<item class_id_reference="20" object_id="_159">
<id>174</id>
<edge_type>1</edge_type>
<source_obj>13</source_obj>
<sink_obj>51</sink_obj>
</item>
<item class_id_reference="20" object_id="_160">
<id>175</id>
<edge_type>1</edge_type>
<source_obj>119</source_obj>
<sink_obj>51</sink_obj>
</item>
<item class_id_reference="20" object_id="_161">
<id>176</id>
<edge_type>1</edge_type>
<source_obj>44</source_obj>
<sink_obj>51</sink_obj>
</item>
<item class_id_reference="20" object_id="_162">
<id>177</id>
<edge_type>1</edge_type>
<source_obj>51</source_obj>
<sink_obj>52</sink_obj>
</item>
<item class_id_reference="20" object_id="_163">
<id>178</id>
<edge_type>1</edge_type>
<source_obj>52</source_obj>
<sink_obj>53</sink_obj>
</item>
<item class_id_reference="20" object_id="_164">
<id>179</id>
<edge_type>1</edge_type>
<source_obj>24</source_obj>
<sink_obj>54</sink_obj>
</item>
<item class_id_reference="20" object_id="_165">
<id>180</id>
<edge_type>1</edge_type>
<source_obj>54</source_obj>
<sink_obj>55</sink_obj>
</item>
<item class_id_reference="20" object_id="_166">
<id>181</id>
<edge_type>1</edge_type>
<source_obj>53</source_obj>
<sink_obj>56</sink_obj>
</item>
<item class_id_reference="20" object_id="_167">
<id>182</id>
<edge_type>1</edge_type>
<source_obj>55</source_obj>
<sink_obj>56</sink_obj>
</item>
<item class_id_reference="20" object_id="_168">
<id>183</id>
<edge_type>1</edge_type>
<source_obj>14</source_obj>
<sink_obj>57</sink_obj>
</item>
<item class_id_reference="20" object_id="_169">
<id>184</id>
<edge_type>1</edge_type>
<source_obj>119</source_obj>
<sink_obj>57</sink_obj>
</item>
<item class_id_reference="20" object_id="_170">
<id>185</id>
<edge_type>1</edge_type>
<source_obj>44</source_obj>
<sink_obj>57</sink_obj>
</item>
<item class_id_reference="20" object_id="_171">
<id>186</id>
<edge_type>1</edge_type>
<source_obj>57</source_obj>
<sink_obj>58</sink_obj>
</item>
<item class_id_reference="20" object_id="_172">
<id>187</id>
<edge_type>1</edge_type>
<source_obj>58</source_obj>
<sink_obj>59</sink_obj>
</item>
<item class_id_reference="20" object_id="_173">
<id>188</id>
<edge_type>1</edge_type>
<source_obj>25</source_obj>
<sink_obj>60</sink_obj>
</item>
<item class_id_reference="20" object_id="_174">
<id>189</id>
<edge_type>1</edge_type>
<source_obj>60</source_obj>
<sink_obj>61</sink_obj>
</item>
<item class_id_reference="20" object_id="_175">
<id>190</id>
<edge_type>1</edge_type>
<source_obj>59</source_obj>
<sink_obj>62</sink_obj>
</item>
<item class_id_reference="20" object_id="_176">
<id>191</id>
<edge_type>1</edge_type>
<source_obj>61</source_obj>
<sink_obj>62</sink_obj>
</item>
<item class_id_reference="20" object_id="_177">
<id>192</id>
<edge_type>1</edge_type>
<source_obj>15</source_obj>
<sink_obj>63</sink_obj>
</item>
<item class_id_reference="20" object_id="_178">
<id>193</id>
<edge_type>1</edge_type>
<source_obj>119</source_obj>
<sink_obj>63</sink_obj>
</item>
<item class_id_reference="20" object_id="_179">
<id>194</id>
<edge_type>1</edge_type>
<source_obj>44</source_obj>
<sink_obj>63</sink_obj>
</item>
<item class_id_reference="20" object_id="_180">
<id>195</id>
<edge_type>1</edge_type>
<source_obj>63</source_obj>
<sink_obj>64</sink_obj>
</item>
<item class_id_reference="20" object_id="_181">
<id>196</id>
<edge_type>1</edge_type>
<source_obj>64</source_obj>
<sink_obj>65</sink_obj>
</item>
<item class_id_reference="20" object_id="_182">
<id>197</id>
<edge_type>1</edge_type>
<source_obj>26</source_obj>
<sink_obj>66</sink_obj>
</item>
<item class_id_reference="20" object_id="_183">
<id>198</id>
<edge_type>1</edge_type>
<source_obj>66</source_obj>
<sink_obj>67</sink_obj>
</item>
<item class_id_reference="20" object_id="_184">
<id>199</id>
<edge_type>1</edge_type>
<source_obj>65</source_obj>
<sink_obj>68</sink_obj>
</item>
<item class_id_reference="20" object_id="_185">
<id>200</id>
<edge_type>1</edge_type>
<source_obj>67</source_obj>
<sink_obj>68</sink_obj>
</item>
<item class_id_reference="20" object_id="_186">
<id>201</id>
<edge_type>1</edge_type>
<source_obj>16</source_obj>
<sink_obj>69</sink_obj>
</item>
<item class_id_reference="20" object_id="_187">
<id>202</id>
<edge_type>1</edge_type>
<source_obj>119</source_obj>
<sink_obj>69</sink_obj>
</item>
<item class_id_reference="20" object_id="_188">
<id>203</id>
<edge_type>1</edge_type>
<source_obj>44</source_obj>
<sink_obj>69</sink_obj>
</item>
<item class_id_reference="20" object_id="_189">
<id>204</id>
<edge_type>1</edge_type>
<source_obj>69</source_obj>
<sink_obj>70</sink_obj>
</item>
<item class_id_reference="20" object_id="_190">
<id>205</id>
<edge_type>1</edge_type>
<source_obj>70</source_obj>
<sink_obj>71</sink_obj>
</item>
<item class_id_reference="20" object_id="_191">
<id>206</id>
<edge_type>1</edge_type>
<source_obj>27</source_obj>
<sink_obj>72</sink_obj>
</item>
<item class_id_reference="20" object_id="_192">
<id>207</id>
<edge_type>1</edge_type>
<source_obj>72</source_obj>
<sink_obj>73</sink_obj>
</item>
<item class_id_reference="20" object_id="_193">
<id>208</id>
<edge_type>1</edge_type>
<source_obj>71</source_obj>
<sink_obj>74</sink_obj>
</item>
<item class_id_reference="20" object_id="_194">
<id>209</id>
<edge_type>1</edge_type>
<source_obj>73</source_obj>
<sink_obj>74</sink_obj>
</item>
<item class_id_reference="20" object_id="_195">
<id>210</id>
<edge_type>1</edge_type>
<source_obj>17</source_obj>
<sink_obj>75</sink_obj>
</item>
<item class_id_reference="20" object_id="_196">
<id>211</id>
<edge_type>1</edge_type>
<source_obj>119</source_obj>
<sink_obj>75</sink_obj>
</item>
<item class_id_reference="20" object_id="_197">
<id>212</id>
<edge_type>1</edge_type>
<source_obj>44</source_obj>
<sink_obj>75</sink_obj>
</item>
<item class_id_reference="20" object_id="_198">
<id>213</id>
<edge_type>1</edge_type>
<source_obj>75</source_obj>
<sink_obj>76</sink_obj>
</item>
<item class_id_reference="20" object_id="_199">
<id>214</id>
<edge_type>1</edge_type>
<source_obj>76</source_obj>
<sink_obj>77</sink_obj>
</item>
<item class_id_reference="20" object_id="_200">
<id>215</id>
<edge_type>1</edge_type>
<source_obj>28</source_obj>
<sink_obj>78</sink_obj>
</item>
<item class_id_reference="20" object_id="_201">
<id>216</id>
<edge_type>1</edge_type>
<source_obj>78</source_obj>
<sink_obj>79</sink_obj>
</item>
<item class_id_reference="20" object_id="_202">
<id>217</id>
<edge_type>1</edge_type>
<source_obj>77</source_obj>
<sink_obj>80</sink_obj>
</item>
<item class_id_reference="20" object_id="_203">
<id>218</id>
<edge_type>1</edge_type>
<source_obj>79</source_obj>
<sink_obj>80</sink_obj>
</item>
<item class_id_reference="20" object_id="_204">
<id>219</id>
<edge_type>1</edge_type>
<source_obj>18</source_obj>
<sink_obj>81</sink_obj>
</item>
<item class_id_reference="20" object_id="_205">
<id>220</id>
<edge_type>1</edge_type>
<source_obj>119</source_obj>
<sink_obj>81</sink_obj>
</item>
<item class_id_reference="20" object_id="_206">
<id>221</id>
<edge_type>1</edge_type>
<source_obj>44</source_obj>
<sink_obj>81</sink_obj>
</item>
<item class_id_reference="20" object_id="_207">
<id>222</id>
<edge_type>1</edge_type>
<source_obj>81</source_obj>
<sink_obj>82</sink_obj>
</item>
<item class_id_reference="20" object_id="_208">
<id>223</id>
<edge_type>1</edge_type>
<source_obj>82</source_obj>
<sink_obj>83</sink_obj>
</item>
<item class_id_reference="20" object_id="_209">
<id>224</id>
<edge_type>1</edge_type>
<source_obj>29</source_obj>
<sink_obj>84</sink_obj>
</item>
<item class_id_reference="20" object_id="_210">
<id>225</id>
<edge_type>1</edge_type>
<source_obj>84</source_obj>
<sink_obj>85</sink_obj>
</item>
<item class_id_reference="20" object_id="_211">
<id>226</id>
<edge_type>1</edge_type>
<source_obj>83</source_obj>
<sink_obj>86</sink_obj>
</item>
<item class_id_reference="20" object_id="_212">
<id>227</id>
<edge_type>1</edge_type>
<source_obj>85</source_obj>
<sink_obj>86</sink_obj>
</item>
<item class_id_reference="20" object_id="_213">
<id>228</id>
<edge_type>1</edge_type>
<source_obj>19</source_obj>
<sink_obj>87</sink_obj>
</item>
<item class_id_reference="20" object_id="_214">
<id>229</id>
<edge_type>1</edge_type>
<source_obj>119</source_obj>
<sink_obj>87</sink_obj>
</item>
<item class_id_reference="20" object_id="_215">
<id>230</id>
<edge_type>1</edge_type>
<source_obj>44</source_obj>
<sink_obj>87</sink_obj>
</item>
<item class_id_reference="20" object_id="_216">
<id>231</id>
<edge_type>1</edge_type>
<source_obj>87</source_obj>
<sink_obj>88</sink_obj>
</item>
<item class_id_reference="20" object_id="_217">
<id>232</id>
<edge_type>1</edge_type>
<source_obj>88</source_obj>
<sink_obj>89</sink_obj>
</item>
<item class_id_reference="20" object_id="_218">
<id>233</id>
<edge_type>1</edge_type>
<source_obj>30</source_obj>
<sink_obj>90</sink_obj>
</item>
<item class_id_reference="20" object_id="_219">
<id>234</id>
<edge_type>1</edge_type>
<source_obj>90</source_obj>
<sink_obj>91</sink_obj>
</item>
<item class_id_reference="20" object_id="_220">
<id>235</id>
<edge_type>1</edge_type>
<source_obj>89</source_obj>
<sink_obj>92</sink_obj>
</item>
<item class_id_reference="20" object_id="_221">
<id>236</id>
<edge_type>1</edge_type>
<source_obj>91</source_obj>
<sink_obj>92</sink_obj>
</item>
<item class_id_reference="20" object_id="_222">
<id>237</id>
<edge_type>1</edge_type>
<source_obj>56</source_obj>
<sink_obj>93</sink_obj>
</item>
<item class_id_reference="20" object_id="_223">
<id>238</id>
<edge_type>1</edge_type>
<source_obj>50</source_obj>
<sink_obj>93</sink_obj>
</item>
<item class_id_reference="20" object_id="_224">
<id>239</id>
<edge_type>1</edge_type>
<source_obj>68</source_obj>
<sink_obj>94</sink_obj>
</item>
<item class_id_reference="20" object_id="_225">
<id>240</id>
<edge_type>1</edge_type>
<source_obj>62</source_obj>
<sink_obj>94</sink_obj>
</item>
<item class_id_reference="20" object_id="_226">
<id>241</id>
<edge_type>1</edge_type>
<source_obj>93</source_obj>
<sink_obj>95</sink_obj>
</item>
<item class_id_reference="20" object_id="_227">
<id>242</id>
<edge_type>1</edge_type>
<source_obj>94</source_obj>
<sink_obj>95</sink_obj>
</item>
<item class_id_reference="20" object_id="_228">
<id>243</id>
<edge_type>1</edge_type>
<source_obj>80</source_obj>
<sink_obj>96</sink_obj>
</item>
<item class_id_reference="20" object_id="_229">
<id>244</id>
<edge_type>1</edge_type>
<source_obj>74</source_obj>
<sink_obj>96</sink_obj>
</item>
<item class_id_reference="20" object_id="_230">
<id>245</id>
<edge_type>1</edge_type>
<source_obj>92</source_obj>
<sink_obj>97</sink_obj>
</item>
<item class_id_reference="20" object_id="_231">
<id>247</id>
<edge_type>1</edge_type>
<source_obj>246</source_obj>
<sink_obj>97</sink_obj>
</item>
<item class_id_reference="20" object_id="_232">
<id>248</id>
<edge_type>1</edge_type>
<source_obj>86</source_obj>
<sink_obj>98</sink_obj>
</item>
<item class_id_reference="20" object_id="_233">
<id>249</id>
<edge_type>1</edge_type>
<source_obj>97</source_obj>
<sink_obj>98</sink_obj>
</item>
<item class_id_reference="20" object_id="_234">
<id>250</id>
<edge_type>1</edge_type>
<source_obj>96</source_obj>
<sink_obj>99</sink_obj>
</item>
<item class_id_reference="20" object_id="_235">
<id>251</id>
<edge_type>1</edge_type>
<source_obj>98</source_obj>
<sink_obj>99</sink_obj>
</item>
<item class_id_reference="20" object_id="_236">
<id>252</id>
<edge_type>1</edge_type>
<source_obj>95</source_obj>
<sink_obj>100</sink_obj>
</item>
<item class_id_reference="20" object_id="_237">
<id>253</id>
<edge_type>1</edge_type>
<source_obj>99</source_obj>
<sink_obj>100</sink_obj>
</item>
<item class_id_reference="20" object_id="_238">
<id>256</id>
<edge_type>1</edge_type>
<source_obj>100</source_obj>
<sink_obj>101</sink_obj>
</item>
<item class_id_reference="20" object_id="_239">
<id>258</id>
<edge_type>1</edge_type>
<source_obj>257</source_obj>
<sink_obj>101</sink_obj>
</item>
<item class_id_reference="20" object_id="_240">
<id>260</id>
<edge_type>1</edge_type>
<source_obj>259</source_obj>
<sink_obj>101</sink_obj>
</item>
<item class_id_reference="20" object_id="_241">
<id>261</id>
<edge_type>1</edge_type>
<source_obj>35</source_obj>
<sink_obj>102</sink_obj>
</item>
<item class_id_reference="20" object_id="_242">
<id>262</id>
<edge_type>1</edge_type>
<source_obj>32</source_obj>
<sink_obj>103</sink_obj>
</item>
<item class_id_reference="20" object_id="_243">
<id>263</id>
<edge_type>1</edge_type>
<source_obj>102</source_obj>
<sink_obj>103</sink_obj>
</item>
<item class_id_reference="20" object_id="_244">
<id>264</id>
<edge_type>1</edge_type>
<source_obj>103</source_obj>
<sink_obj>104</sink_obj>
</item>
<item class_id_reference="20" object_id="_245">
<id>265</id>
<edge_type>1</edge_type>
<source_obj>10</source_obj>
<sink_obj>105</sink_obj>
</item>
<item class_id_reference="20" object_id="_246">
<id>266</id>
<edge_type>1</edge_type>
<source_obj>119</source_obj>
<sink_obj>105</sink_obj>
</item>
<item class_id_reference="20" object_id="_247">
<id>267</id>
<edge_type>1</edge_type>
<source_obj>104</source_obj>
<sink_obj>105</sink_obj>
</item>
<item class_id_reference="20" object_id="_248">
<id>268</id>
<edge_type>1</edge_type>
<source_obj>101</source_obj>
<sink_obj>106</sink_obj>
</item>
<item class_id_reference="20" object_id="_249">
<id>269</id>
<edge_type>1</edge_type>
<source_obj>105</source_obj>
<sink_obj>106</sink_obj>
</item>
<item class_id_reference="20" object_id="_250">
<id>270</id>
<edge_type>2</edge_type>
<source_obj>39</source_obj>
<sink_obj>108</sink_obj>
</item>
<item class_id_reference="20" object_id="_251">
<id>298</id>
<edge_type>2</edge_type>
<source_obj>34</source_obj>
<sink_obj>39</sink_obj>
</item>
<item class_id_reference="20" object_id="_252">
<id>299</id>
<edge_type>2</edge_type>
<source_obj>39</source_obj>
<sink_obj>111</sink_obj>
</item>
<item class_id_reference="20" object_id="_253">
<id>300</id>
<edge_type>2</edge_type>
<source_obj>39</source_obj>
<sink_obj>109</sink_obj>
</item>
<item class_id_reference="20" object_id="_254">
<id>301</id>
<edge_type>2</edge_type>
<source_obj>109</source_obj>
<sink_obj>39</sink_obj>
</item>
</edges>
</cdfg>
<cdfg_regions class_id="21" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="22" tracking_level="1" version="0" object_id="_255">
<mId>1</mId>
<mTag>dct_dct_1d</mTag>
<mType>0</mType>
<sub_regions>
<count>3</count>
<item_version>0</item_version>
<item>2</item>
<item>3</item>
<item>4</item>
</sub_regions>
<basic_blocks>
<count>0</count>
<item_version>0</item_version>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>13</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_256">
<mId>2</mId>
<mTag>Entry</mTag>
<mType>0</mType>
<sub_regions>
<count>0</count>
<item_version>0</item_version>
</sub_regions>
<basic_blocks>
<count>1</count>
<item_version>0</item_version>
<item>34</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>0</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_257">
<mId>3</mId>
<mTag>DCT_Outer_Loop</mTag>
<mType>1</mType>
<sub_regions>
<count>0</count>
<item_version>0</item_version>
</sub_regions>
<basic_blocks>
<count>2</count>
<item_version>0</item_version>
<item>39</item>
<item>109</item>
</basic_blocks>
<mII>1</mII>
<mDepth>5</mDepth>
<mMinTripCount>8</mMinTripCount>
<mMaxTripCount>8</mMaxTripCount>
<mMinLatency>11</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_258">
<mId>4</mId>
<mTag>Return</mTag>
<mType>0</mType>
<sub_regions>
<count>0</count>
<item_version>0</item_version>
</sub_regions>
<basic_blocks>
<count>1</count>
<item_version>0</item_version>
<item>111</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>0</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
</cdfg_regions>
<fsm class_id="-1"></fsm>
<res class_id="25" tracking_level="1" version="0" object_id="_259">
<dp_component_resource class_id="26" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_component_resource>
<dp_expression_resource>
<count>0</count>
<item_version>0</item_version>
</dp_expression_resource>
<dp_fifo_resource>
<count>0</count>
<item_version>0</item_version>
</dp_fifo_resource>
<dp_memory_resource>
<count>0</count>
<item_version>0</item_version>
</dp_memory_resource>
<dp_multiplexer_resource>
<count>0</count>
<item_version>0</item_version>
</dp_multiplexer_resource>
<dp_register_resource>
<count>0</count>
<item_version>0</item_version>
</dp_register_resource>
<dp_component_map class_id="27" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_component_map>
<dp_expression_map>
<count>0</count>
<item_version>0</item_version>
</dp_expression_map>
<dp_fifo_map>
<count>0</count>
<item_version>0</item_version>
</dp_fifo_map>
<dp_memory_map>
<count>0</count>
<item_version>0</item_version>
</dp_memory_map>
</res>
<node_label_latency class_id="28" tracking_level="0" version="0">
<count>83</count>
<item_version>0</item_version>
<item class_id="29" tracking_level="0" version="0">
<first>20</first>
<second class_id="30" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>21</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>22</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>23</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>24</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>25</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>26</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>27</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>28</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>29</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>30</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>31</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>32</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>33</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>35</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>36</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>37</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>38</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>44</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>45</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>46</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>47</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>48</first>
<second>
<first>2</first>
<second>1</second>
</second>
</item>
<item>
<first>49</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>50</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>51</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>52</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>53</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>54</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>55</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>56</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>57</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>58</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>59</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>60</first>
<second>
<first>2</first>
<second>1</second>
</second>
</item>
<item>
<first>61</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>62</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>63</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>64</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>65</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>66</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>67</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>68</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>69</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>70</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>71</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>72</first>
<second>
<first>2</first>
<second>1</second>
</second>
</item>
<item>
<first>73</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>74</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>75</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>76</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>77</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>78</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>79</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>80</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>81</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>82</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>83</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>84</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>85</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>86</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>87</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>88</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>89</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>90</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>91</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>92</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>93</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>94</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>95</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>96</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>97</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>98</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>99</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>100</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>101</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>102</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>103</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>104</first>
<second>
<first>5</first>
<second>0</second>
</second>
</item>
<item>
<first>105</first>
<second>
<first>5</first>
<second>0</second>
</second>
</item>
<item>
<first>106</first>
<second>
<first>5</first>
<second>0</second>
</second>
</item>
<item>
<first>108</first>
<second>
<first>5</first>
<second>0</second>
</second>
</item>
<item>
<first>110</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
</node_label_latency>
<bblk_ent_exit class_id="31" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="32" tracking_level="0" version="0">
<first>34</first>
<second class_id="33" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>39</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>109</first>
<second>
<first>1</first>
<second>5</second>
</second>
</item>
<item>
<first>111</first>
<second>
<first>2</first>
<second>2</second>
</second>
</item>
</bblk_ent_exit>
<regions class_id="34" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="35" tracking_level="1" version="0" object_id="_260">
<region_name>DCT_Outer_Loop</region_name>
<basic_blocks>
<count>2</count>
<item_version>0</item_version>
<item>39</item>
<item>109</item>
</basic_blocks>
<nodes>
<count>0</count>
<item_version>0</item_version>
</nodes>
<anchor_node>-1</anchor_node>
<region_type>8</region_type>
<interval>1</interval>
<pipe_depth>5</pipe_depth>
</item>
</regions>
<dp_fu_nodes class_id="36" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes>
<dp_fu_nodes_expression class_id="37" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_expression>
<dp_fu_nodes_module>
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_module>
<dp_fu_nodes_io>
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_io>
<return_ports>
<count>0</count>
<item_version>0</item_version>
</return_ports>
<dp_mem_port_nodes class_id="38" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_mem_port_nodes>
<dp_reg_nodes>
<count>0</count>
<item_version>0</item_version>
</dp_reg_nodes>
<dp_regname_nodes>
<count>0</count>
<item_version>0</item_version>
</dp_regname_nodes>
<dp_reg_phi>
<count>0</count>
<item_version>0</item_version>
</dp_reg_phi>
<dp_regname_phi>
<count>0</count>
<item_version>0</item_version>
</dp_regname_phi>
<dp_port_io_nodes class_id="39" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_port_io_nodes>
<port2core class_id="40" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</port2core>
<node2core>
<count>0</count>
<item_version>0</item_version>
</node2core>
</syndb>
</boost_serialization>
|
-----------------------------------------------------------------------
-- decompress -- Decompress file using Util.Streams.Buffered.LZMA
-- Copyright (C) 2019 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Text_IO;
with Ada.Command_Line;
with Ada.Streams.Stream_IO;
with Util.Streams.Files;
with Util.Streams.Buffered.Lzma;
procedure Decompress is
procedure Decompress_File (Source : in String;
Destination : in String);
procedure Decompress_File (Source : in String;
Destination : in String) is
In_Stream : aliased Util.Streams.Files.File_Stream;
Out_Stream : aliased Util.Streams.Files.File_Stream;
Decompressor : aliased Util.Streams.Buffered.Lzma.Decompress_Stream;
begin
In_Stream.Open (Mode => Ada.Streams.Stream_IO.In_File, Name => Source);
Out_Stream.Create (Mode => Ada.Streams.Stream_IO.Out_File, Name => Destination);
Decompressor.Initialize (Input => In_Stream'Access, Size => 32768);
Util.Streams.Copy (From => Decompressor, Into => Out_Stream);
end Decompress_File;
begin
if Ada.Command_Line.Argument_Count /= 2 then
Ada.Text_IO.Put_Line ("Usage: decompress source destination");
return;
end if;
Decompress_File (Source => Ada.Command_Line.Argument (1),
Destination => Ada.Command_Line.Argument (2));
end Decompress;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
-- A port is a property of a classifier that specifies a distinct interaction
-- point between that classifier and its environment or between the (behavior
-- of the) classifier and its internal parts. Ports are connected to
-- properties of the classifier by connectors through which requests can be
-- made to invoke the behavioral features of a classifier. A Port may specify
-- the services a classifier provides (offers) to its environment as well as
-- the services that a classifier expects (requires) of its environment.
--
-- A port has an associated protocol state machine.
------------------------------------------------------------------------------
limited with AMF.UML.Interfaces.Collections;
limited with AMF.UML.Ports.Collections;
with AMF.UML.Properties;
limited with AMF.UML.Protocol_State_Machines;
package AMF.UML.Ports is
pragma Preelaborate;
type UML_Port is limited interface
and AMF.UML.Properties.UML_Property;
type UML_Port_Access is
access all UML_Port'Class;
for UML_Port_Access'Storage_Size use 0;
not overriding function Get_Is_Behavior
(Self : not null access constant UML_Port)
return Boolean is abstract;
-- Getter of Port::isBehavior.
--
-- Specifies whether requests arriving at this port are sent to the
-- classifier behavior of this classifier. Such ports are referred to as
-- behavior port. Any invocation of a behavioral feature targeted at a
-- behavior port will be handled by the instance of the owning classifier
-- itself, rather than by any instances that this classifier may contain.
not overriding procedure Set_Is_Behavior
(Self : not null access UML_Port;
To : Boolean) is abstract;
-- Setter of Port::isBehavior.
--
-- Specifies whether requests arriving at this port are sent to the
-- classifier behavior of this classifier. Such ports are referred to as
-- behavior port. Any invocation of a behavioral feature targeted at a
-- behavior port will be handled by the instance of the owning classifier
-- itself, rather than by any instances that this classifier may contain.
not overriding function Get_Is_Conjugated
(Self : not null access constant UML_Port)
return Boolean is abstract;
-- Getter of Port::isConjugated.
--
-- Specifies the way that the provided and required interfaces are derived
-- from the Port’s Type. The default value is false.
not overriding procedure Set_Is_Conjugated
(Self : not null access UML_Port;
To : Boolean) is abstract;
-- Setter of Port::isConjugated.
--
-- Specifies the way that the provided and required interfaces are derived
-- from the Port’s Type. The default value is false.
not overriding function Get_Is_Service
(Self : not null access constant UML_Port)
return Boolean is abstract;
-- Getter of Port::isService.
--
-- If true indicates that this port is used to provide the published
-- functionality of a classifier; if false, this port is used to implement
-- the classifier but is not part of the essential externally-visible
-- functionality of the classifier and can, therefore, be altered or
-- deleted along with the internal implementation of the classifier and
-- other properties that are considered part of its implementation.
not overriding procedure Set_Is_Service
(Self : not null access UML_Port;
To : Boolean) is abstract;
-- Setter of Port::isService.
--
-- If true indicates that this port is used to provide the published
-- functionality of a classifier; if false, this port is used to implement
-- the classifier but is not part of the essential externally-visible
-- functionality of the classifier and can, therefore, be altered or
-- deleted along with the internal implementation of the classifier and
-- other properties that are considered part of its implementation.
not overriding function Get_Protocol
(Self : not null access constant UML_Port)
return AMF.UML.Protocol_State_Machines.UML_Protocol_State_Machine_Access is abstract;
-- Getter of Port::protocol.
--
-- References an optional protocol state machine which describes valid
-- interactions at this interaction point.
not overriding procedure Set_Protocol
(Self : not null access UML_Port;
To : AMF.UML.Protocol_State_Machines.UML_Protocol_State_Machine_Access) is abstract;
-- Setter of Port::protocol.
--
-- References an optional protocol state machine which describes valid
-- interactions at this interaction point.
not overriding function Get_Provided
(Self : not null access constant UML_Port)
return AMF.UML.Interfaces.Collections.Set_Of_UML_Interface is abstract;
-- Getter of Port::provided.
--
-- References the interfaces specifying the set of operations and
-- receptions that the classifier offers to its environment via this port,
-- and which it will handle either directly or by forwarding it to a part
-- of its internal structure. This association is derived according to the
-- value of isConjugated. If isConjugated is false, provided is derived as
-- the union of the sets of interfaces realized by the type of the port
-- and its supertypes, or directly from the type of the port if the port
-- is typed by an interface. If isConjugated is true, it is derived as the
-- union of the sets of interfaces used by the type of the port and its
-- supertypes.
not overriding function Get_Redefined_Port
(Self : not null access constant UML_Port)
return AMF.UML.Ports.Collections.Set_Of_UML_Port is abstract;
-- Getter of Port::redefinedPort.
--
-- A port may be redefined when its containing classifier is specialized.
-- The redefining port may have additional interfaces to those that are
-- associated with the redefined port or it may replace an interface by
-- one of its subtypes.
not overriding function Get_Required
(Self : not null access constant UML_Port)
return AMF.UML.Interfaces.Collections.Set_Of_UML_Interface is abstract;
-- Getter of Port::required.
--
-- References the interfaces specifying the set of operations and
-- receptions that the classifier expects its environment to handle via
-- this port. This association is derived according to the value of
-- isConjugated. If isConjugated is false, required is derived as the
-- union of the sets of interfaces used by the type of the port and its
-- supertypes. If isConjugated is true, it is derived as the union of the
-- sets of interfaces realized by the type of the port and its supertypes,
-- or directly from the type of the port if the port is typed by an
-- interface.
not overriding function Provided
(Self : not null access constant UML_Port)
return AMF.UML.Interfaces.Collections.Set_Of_UML_Interface is abstract;
-- Operation Port::provided.
--
-- Missing derivation for Port::/provided : Interface
not overriding function Required
(Self : not null access constant UML_Port)
return AMF.UML.Interfaces.Collections.Set_Of_UML_Interface is abstract;
-- Operation Port::required.
--
-- Missing derivation for Port::/required : Interface
end AMF.UML.Ports;
|
------------------------------------------------------------------------------
-- A d a r u n - t i m e s p e c i f i c a t i o n --
-- ASIS implementation for Gela project, a portable Ada compiler --
-- http://gela.ada-ru.org --
-- - - - - - - - - - - - - - - - --
-- Read copyright and license at the end of ada.ads file --
------------------------------------------------------------------------------
-- $Revision: 209 $ $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $
with Ada.Numerics.Generic_Real_Arrays;
with Ada.Numerics.Generic_Complex_Types;
generic
with package Real_Arrays is new Ada.Numerics.Generic_Real_Arrays (<>);
with package Complex_Types is
new Ada.Numerics.Generic_Complex_Types (Real_Arrays.Real);
package Ada.Numerics.Generic_Complex_Arrays is
pragma Pure (Generic_Complex_Arrays);
-- Types
type Complex_Vector is array (Integer range <>) of Complex_Types.Complex;
type Complex_Matrix is
array (Integer range <>, Integer range <>) of Complex_Types.Complex;
-- Subprograms for Complex_Vector types
-- Complex_Vector selection, conversion and composition operations
function Re (X : in Complex_Vector) return Real_Arrays.Real_Vector;
function Im (X : in Complex_Vector) return Real_Arrays.Real_Vector;
procedure Set_Re (X : in out Complex_Vector;
Re : in Real_Arrays.Real_Vector);
procedure Set_Im (X : in out Complex_Vector;
Im : in Real_Arrays.Real_Vector);
function Compose_From_Cartesian (Re : in Real_Arrays.Real_Vector)
return Complex_Vector;
function Compose_From_Cartesian (Re : in Real_Arrays.Real_Vector;
Im : in Real_Arrays.Real_Vector)
return Complex_Vector;
function Modulus (X : in Complex_Vector) return Real_Arrays.Real_Vector;
function "abs" (Right : in Complex_Vector) return Real_Arrays.Real_Vector
renames Modulus;
function Argument (X : in Complex_Vector) return Real_Arrays.Real_Vector;
function Argument (X : in Complex_Vector;
Cycle : in Real_Arrays.Real'Base)
return Real_Arrays.Real_Vector;
function Compose_From_Polar (Modulus : in Real_Arrays.Real_Vector;
Argument : in Real_Arrays.Real_Vector)
return Complex_Vector;
function Compose_From_Polar (Modulus : in Real_Arrays.Real_Vector;
Argument : in Real_Arrays.Real_Vector;
Cycle : in Real_Arrays.Real'Base)
return Complex_Vector;
-- Complex_Vector arithmetic operations
function "+" (Right : in Complex_Vector) return Complex_Vector;
function "-" (Right : in Complex_Vector) return Complex_Vector;
function Conjugate (X : in Complex_Vector) return Complex_Vector;
function "+" (Left : in Complex_Vector;
Right : in Complex_Vector)
return Complex_Vector;
function "-" (Left : in Complex_Vector;
Right : in Complex_Vector)
return Complex_Vector;
function "*" (Left : in Complex_Vector;
Right : Complex_Vector)
return Complex_Types.Complex;
function "abs" (Right : in Complex_Vector) return Complex_Types.Complex;
-- Mixed Real_Arrays.Real_Vector and Complex_Vector arithmetic operations
function "+" (Left : in Real_Arrays.Real_Vector;
Right : in Complex_Vector)
return Complex_Vector;
function "+" (Left : in Complex_Vector;
Right : in Real_Arrays.Real_Vector)
return Complex_Vector;
function "-" (Left : in Real_Arrays.Real_Vector;
Right : in Complex_Vector)
return Complex_Vector;
function "-" (Left : in Complex_Vector;
Right : in Real_Arrays.Real_Vector)
return Complex_Vector;
function "*" (Left : in Real_Arrays.Real_Vector;
Right : in Complex_Vector)
return Complex_Types.Complex;
function "*" (Left : in Complex_Vector;
Right : in Real_Arrays.Real_Vector)
return Complex_Types.Complex;
-- Complex_Vector scaling operations
function "*" (Left : in Complex_Types.Complex;
Right : in Complex_Vector)
return Complex_Vector;
function "*" (Left : in Complex_Vector;
Right : in Complex_Types.Complex)
return Complex_Vector;
function "/" (Left : in Complex_Vector;
Right : in Complex_Types.Complex)
return Complex_Vector;
function "*" (Left : in Real_Arrays.Real'Base;
Right : in Complex_Vector)
return Complex_Vector;
function "*" (Left : in Complex_Vector;
Right : in Real_Arrays.Real'Base)
return Complex_Vector;
function "/" (Left : in Complex_Vector;
Right : in Real_Arrays.Real'Base)
return Complex_Vector;
-- Other Complex_Vector operations
function Unit_Vector (Index : in Integer;
Order : in Positive;
First : in Integer := 1)
return Complex_Vector;
-- Subprograms for Complex_Matrix types
-- Complex_Matrix selection, conversion and composition operations
function Re (X : in Complex_Matrix) return Real_Arrays.Real_Matrix;
function Im (X : in Complex_Matrix) return Real_Arrays.Real_Matrix;
procedure Set_Re (X : in out Complex_Matrix;
Re : in Real_Arrays.Real_Matrix);
procedure Set_Im (X : in out Complex_Matrix;
Im : in Real_Arrays.Real_Matrix);
function Compose_From_Cartesian (Re : in Real_Arrays.Real_Matrix)
return Complex_Matrix;
function Compose_From_Cartesian (Re : in Real_Arrays.Real_Matrix;
Im : in Real_Arrays.Real_Matrix)
return Complex_Matrix;
function Modulus (X : in Complex_Matrix) return Real_Arrays.Real_Matrix;
function "abs" (Right : in Complex_Matrix) return Real_Arrays.Real_Matrix
renames Modulus;
function Argument (X : in Complex_Matrix) return Real_Arrays.Real_Matrix;
function Argument (X : in Complex_Matrix;
Cycle : in Real_Arrays.Real'Base)
return Real_Arrays.Real_Matrix;
function Compose_From_Polar (Modulus : in Real_Arrays.Real_Matrix;
Argument : in Real_Arrays.Real_Matrix)
return Complex_Matrix;
function Compose_From_Polar (Modulus : in Real_Arrays.Real_Matrix;
Argument : in Real_Arrays.Real_Matrix;
Cycle : in Real_Arrays.Real'Base)
return Complex_Matrix;
-- Complex_Matrix arithmetic operations
function "+" (Right : in Complex_Matrix) return Complex_Matrix;
function "-" (Right : in Complex_Matrix) return Complex_Matrix;
function Conjugate (X : in Complex_Matrix) return Complex_Matrix;
function Transpose (X : in Complex_Matrix) return Complex_Matrix;
function "+" (Left : in Complex_Matrix;
Right : in Complex_Matrix)
return Complex_Matrix;
function "-" (Left : in Complex_Matrix;
Right : in Complex_Matrix)
return Complex_Matrix;
function "*" (Left : in Complex_Matrix;
Right : in Complex_Matrix)
return Complex_Matrix;
function "*" (Left : in Complex_Vector;
Right : in Complex_Vector)
return Complex_Matrix;
function "*" (Left : in Complex_Vector;
Right : in Complex_Matrix)
return Complex_Vector;
function "*" (Left : in Complex_Matrix;
Right : in Complex_Vector)
return Complex_Vector;
-- Mixed Real_Arrays.Real_Matrix and Complex_Matrix arithmetic operations
function "+" (Left : in Real_Arrays.Real_Matrix;
Right : in Complex_Matrix)
return Complex_Matrix;
function "+" (Left : in Complex_Matrix;
Right : in Real_Arrays.Real_Matrix)
return Complex_Matrix;
function "-" (Left : in Real_Arrays.Real_Matrix;
Right : in Complex_Matrix)
return Complex_Matrix;
function "-" (Left : in Complex_Matrix;
Right : in Real_Arrays.Real_Matrix)
return Complex_Matrix;
function "*" (Left : in Real_Arrays.Real_Matrix;
Right : in Complex_Matrix)
return Complex_Matrix;
function "*" (Left : in Complex_Matrix;
Right : in Real_Arrays.Real_Matrix)
return Complex_Matrix;
function "*" (Left : in Real_Arrays.Real_Vector;
Right : in Complex_Vector)
return Complex_Matrix;
function "*" (Left : in Complex_Vector;
Right : in Real_Arrays.Real_Vector)
return Complex_Matrix;
function "*" (Left : in Real_Arrays.Real_Vector;
Right : in Complex_Matrix)
return Complex_Vector;
function "*" (Left : in Complex_Vector;
Right : in Real_Arrays.Real_Matrix)
return Complex_Vector;
function "*" (Left : in Real_Arrays.Real_Matrix;
Right : in Complex_Vector)
return Complex_Vector;
function "*" (Left : in Complex_Matrix;
Right : in Real_Arrays.Real_Vector)
return Complex_Vector;
-- Complex_Matrix scaling operations
function "*" (Left : in Complex_Types.Complex;
Right : in Complex_Matrix)
return Complex_Matrix;
function "*" (Left : in Complex_Matrix;
Right : in Complex_Types.Complex)
return Complex_Matrix;
function "/" (Left : in Complex_Matrix;
Right : in Complex_Types.Complex)
return Complex_Matrix;
function "*" (Left : in Real_Arrays.Real'Base;
Right : in Complex_Matrix)
return Complex_Matrix;
function "*" (Left : in Complex_Matrix;
Right : in Real_Arrays.Real'Base)
return Complex_Matrix;
function "/" (Left : in Complex_Matrix;
Right : in Real_Arrays.Real'Base)
return Complex_Matrix;
-- Complex_Matrix inversion and related operations
function Solve (A : in Complex_Matrix;
X : in Complex_Vector)
return Complex_Vector;
function Solve (A : in Complex_Matrix;
X : in Complex_Matrix)
return Complex_Matrix;
function Inverse (A : in Complex_Matrix) return Complex_Matrix;
function Determinant (A : in Complex_Matrix) return Complex_Types.Complex;
-- Eigenvalues and vectors of a Hermitian matrix
function Eigenvalues (A : in Complex_Matrix) return Real_Arrays.Real_Vector;
procedure Eigensystem (A : in Complex_Matrix;
Values : out Real_Arrays.Real_Vector;
Vectors : out Complex_Matrix);
-- Other Complex_Matrix operations
function Unit_Matrix (Order : in Positive;
First_1 : in Integer := 1;
First_2 : in Integer := 1)
return Complex_Matrix;
end Ada.Numerics.Generic_Complex_Arrays;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . T E X T _ I O . C O M P L E X _ A U X --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains the routines for Ada.Text_IO.Complex_IO that are
-- shared among separate instantiations of this package. The routines in
-- this package are identical semantically to those in Complex_IO itself,
-- except that the generic parameter Complex has been replaced by separate
-- real and imaginary values of type Long_Long_Float, and default parameters
-- have been removed because they are supplied explicitly by the calls from
-- within the generic template.
package Ada.Text_IO.Complex_Aux is
procedure Get
(File : File_Type;
ItemR : out Long_Long_Float;
ItemI : out Long_Long_Float;
Width : Field);
procedure Put
(File : File_Type;
ItemR : Long_Long_Float;
ItemI : Long_Long_Float;
Fore : Field;
Aft : Field;
Exp : Field);
procedure Gets
(From : String;
ItemR : out Long_Long_Float;
ItemI : out Long_Long_Float;
Last : out Positive);
procedure Puts
(To : out String;
ItemR : Long_Long_Float;
ItemI : Long_Long_Float;
Aft : Field;
Exp : Field);
end Ada.Text_IO.Complex_Aux;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- G N A T . B Y T E _ S W A P P I N G --
-- --
-- S p e c --
-- --
-- Copyright (C) 2006-2020, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Simple routines for swapping the bytes of 16-, 32-, and 64-bit objects
-- The generic functions should be instantiated with types that are of a size
-- in bytes corresponding to the name of the generic. For example, a 2-byte
-- integer type would be compatible with Swapped2, 4-byte integer with
-- Swapped4, and so on. Failure to do so will result in a warning when
-- compiling the instantiation; this warning should be heeded. Ignoring this
-- warning can result in unexpected results.
-- An example of proper usage follows:
-- declare
-- type Short_Integer is range -32768 .. 32767;
-- for Short_Integer'Size use 16; -- for confirmation
-- X : Short_Integer := 16#7FFF#;
-- function Swapped is new Byte_Swapping.Swapped2 (Short_Integer);
-- begin
-- Put_Line (X'Img);
-- X := Swapped (X);
-- Put_Line (X'Img);
-- end;
-- Note that the generic actual types need not be scalars, but must be
-- 'definite' types. They can, for example, be constrained subtypes of
-- unconstrained array types as long as the size is correct. For instance,
-- a subtype of String with length of 4 would be compatible with the
-- Swapped4 generic:
-- declare
-- subtype String4 is String (1 .. 4);
-- function Swapped is new Byte_Swapping.Swapped4 (String4);
-- S : String4 := "ABCD";
-- for S'Alignment use 4;
-- begin
-- Put_Line (S);
-- S := Swapped (S);
-- Put_Line (S);
-- end;
-- Similarly, a constrained array type is also acceptable:
-- declare
-- type Mask is array (0 .. 15) of Boolean;
-- for Mask'Alignment use 2;
-- for Mask'Component_Size use Boolean'Size;
-- X : Mask := (0 .. 7 => True, others => False);
-- function Swapped is new Byte_Swapping.Swapped2 (Mask);
-- begin
-- ...
-- X := Swapped (X);
-- ...
-- end;
-- A properly-sized record type will also be acceptable, and so forth
-- However, as described, a size mismatch must be avoided. In the following we
-- instantiate one of the generics with a type that is too large. The result
-- of the function call is undefined, such that assignment to an object can
-- result in garbage values.
-- Wrong: declare
-- subtype String16 is String (1 .. 16);
-- function Swapped is new Byte_Swapping.Swapped8 (String16);
-- -- Instantiation generates a compiler warning about
-- -- mismatched sizes
-- S : String16;
-- begin
-- S := "ABCDEFGHDEADBEEF";
--
-- Put_Line (S);
--
-- -- the following assignment results in garbage in S after the
-- -- first 8 bytes
--
-- S := Swapped (S);
--
-- Put_Line (S);
-- end Wrong;
-- When the size of the type is larger than 8 bytes, the use of the non-
-- generic procedures is an alternative because no function result is
-- involved; manipulation of the object is direct.
-- The procedures are passed the address of an object to manipulate. They will
-- swap the first N bytes of that object corresponding to the name of the
-- procedure. For example:
-- declare
-- S2 : String := "AB";
-- for S2'Alignment use 2;
-- S4 : String := "ABCD";
-- for S4'Alignment use 4;
-- S8 : String := "ABCDEFGH";
-- for S8'Alignment use 8;
-- begin
-- Swap2 (S2'Address);
-- Put_Line (S2);
-- Swap4 (S4'Address);
-- Put_Line (S4);
-- Swap8 (S8'Address);
-- Put_Line (S8);
-- end;
-- If an object of a type larger than N is passed, the remaining bytes of the
-- object are undisturbed. For example:
-- declare
-- subtype String16 is String (1 .. 16);
-- S : String16;
-- for S'Alignment use 8;
-- begin
-- S := "ABCDEFGHDEADBEEF";
-- Put_Line (S);
-- Swap8 (S'Address);
-- Put_Line (S);
-- end;
with System;
package GNAT.Byte_Swapping is
pragma Pure;
-- NB: all the routines in this package treat the application objects as
-- unsigned (modular) types of a size in bytes corresponding to the routine
-- name. For example, the generic function Swapped2 manipulates the object
-- passed to the formal parameter Input as a value of an unsigned type that
-- is 2 bytes long. Therefore clients are responsible for the compatibility
-- of application types manipulated by these routines and these modular
-- types, in terms of both size and alignment. This requirement applies to
-- the generic actual type passed to the generic formal type Item in the
-- generic functions, as well as to the type of the object implicitly
-- designated by the address passed to the non-generic procedures. Use of
-- incompatible types can result in implementation- defined effects.
generic
type Item is limited private;
function Swapped2 (Input : Item) return Item;
-- Return the 2-byte value of Input with the bytes swapped
generic
type Item is limited private;
function Swapped4 (Input : Item) return Item;
-- Return the 4-byte value of Input with the bytes swapped
generic
type Item is limited private;
function Swapped8 (Input : Item) return Item;
-- Return the 8-byte value of Input with the bytes swapped
procedure Swap2 (Location : System.Address);
-- Swap the first 2 bytes of the object starting at the address specified
-- by Location.
procedure Swap4 (Location : System.Address);
-- Swap the first 4 bytes of the object starting at the address specified
-- by Location.
procedure Swap8 (Location : System.Address);
-- Swap the first 8 bytes of the object starting at the address specified
-- by Location.
pragma Inline (Swap2, Swap4, Swap8, Swapped2, Swapped4, Swapped8);
end GNAT.Byte_Swapping;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with AMF.Elements;
with AMF.Internals.Element_Collections;
with AMF.Internals.Helpers;
with AMF.Internals.Tables.UML_Attributes;
with AMF.Visitors.UML_Iterators;
with AMF.Visitors.UML_Visitors;
with League.Strings.Internals;
with Matreshka.Internals.Strings;
package body AMF.Internals.UML_Execution_Environments is
-------------------
-- Enter_Element --
-------------------
overriding procedure Enter_Element
(Self : not null access constant UML_Execution_Environment_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
AMF.Visitors.UML_Visitors.UML_Visitor'Class
(Visitor).Enter_Execution_Environment
(AMF.UML.Execution_Environments.UML_Execution_Environment_Access (Self),
Control);
end if;
end Enter_Element;
-------------------
-- Leave_Element --
-------------------
overriding procedure Leave_Element
(Self : not null access constant UML_Execution_Environment_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
AMF.Visitors.UML_Visitors.UML_Visitor'Class
(Visitor).Leave_Execution_Environment
(AMF.UML.Execution_Environments.UML_Execution_Environment_Access (Self),
Control);
end if;
end Leave_Element;
-------------------
-- Visit_Element --
-------------------
overriding procedure Visit_Element
(Self : not null access constant UML_Execution_Environment_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Iterator in AMF.Visitors.UML_Iterators.UML_Iterator'Class then
AMF.Visitors.UML_Iterators.UML_Iterator'Class
(Iterator).Visit_Execution_Environment
(Visitor,
AMF.UML.Execution_Environments.UML_Execution_Environment_Access (Self),
Control);
end if;
end Visit_Element;
---------------------
-- Get_Nested_Node --
---------------------
overriding function Get_Nested_Node
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Nodes.Collections.Set_Of_UML_Node is
begin
return
AMF.UML.Nodes.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Nested_Node
(Self.Element)));
end Get_Nested_Node;
-------------------
-- Get_Extension --
-------------------
overriding function Get_Extension
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Extensions.Collections.Set_Of_UML_Extension is
begin
return
AMF.UML.Extensions.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Extension
(Self.Element)));
end Get_Extension;
---------------------
-- Get_Is_Abstract --
---------------------
overriding function Get_Is_Abstract
(Self : not null access constant UML_Execution_Environment_Proxy)
return Boolean is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Abstract
(Self.Element);
end Get_Is_Abstract;
-------------------
-- Get_Is_Active --
-------------------
overriding function Get_Is_Active
(Self : not null access constant UML_Execution_Environment_Proxy)
return Boolean is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Active
(Self.Element);
end Get_Is_Active;
-------------------
-- Set_Is_Active --
-------------------
overriding procedure Set_Is_Active
(Self : not null access UML_Execution_Environment_Proxy;
To : Boolean) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Active
(Self.Element, To);
end Set_Is_Active;
---------------------------
-- Get_Nested_Classifier --
---------------------------
overriding function Get_Nested_Classifier
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Classifiers.Collections.Ordered_Set_Of_UML_Classifier is
begin
return
AMF.UML.Classifiers.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Nested_Classifier
(Self.Element)));
end Get_Nested_Classifier;
-------------------------
-- Get_Owned_Attribute --
-------------------------
overriding function Get_Owned_Attribute
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Properties.Collections.Ordered_Set_Of_UML_Property is
begin
return
AMF.UML.Properties.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Attribute
(Self.Element)));
end Get_Owned_Attribute;
-------------------------
-- Get_Owned_Operation --
-------------------------
overriding function Get_Owned_Operation
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Operations.Collections.Ordered_Set_Of_UML_Operation is
begin
return
AMF.UML.Operations.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Operation
(Self.Element)));
end Get_Owned_Operation;
-------------------------
-- Get_Owned_Reception --
-------------------------
overriding function Get_Owned_Reception
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Receptions.Collections.Set_Of_UML_Reception is
begin
return
AMF.UML.Receptions.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Reception
(Self.Element)));
end Get_Owned_Reception;
---------------------
-- Get_Super_Class --
---------------------
overriding function Get_Super_Class
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Classes.Collections.Set_Of_UML_Class is
begin
return
AMF.UML.Classes.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Super_Class
(Self.Element)));
end Get_Super_Class;
-----------------------------
-- Get_Classifier_Behavior --
-----------------------------
overriding function Get_Classifier_Behavior
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Behaviors.UML_Behavior_Access is
begin
return
AMF.UML.Behaviors.UML_Behavior_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Classifier_Behavior
(Self.Element)));
end Get_Classifier_Behavior;
-----------------------------
-- Set_Classifier_Behavior --
-----------------------------
overriding procedure Set_Classifier_Behavior
(Self : not null access UML_Execution_Environment_Proxy;
To : AMF.UML.Behaviors.UML_Behavior_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Classifier_Behavior
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Classifier_Behavior;
-------------------------------
-- Get_Interface_Realization --
-------------------------------
overriding function Get_Interface_Realization
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Interface_Realizations.Collections.Set_Of_UML_Interface_Realization is
begin
return
AMF.UML.Interface_Realizations.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Interface_Realization
(Self.Element)));
end Get_Interface_Realization;
------------------------
-- Get_Owned_Behavior --
------------------------
overriding function Get_Owned_Behavior
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Behaviors.Collections.Set_Of_UML_Behavior is
begin
return
AMF.UML.Behaviors.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Behavior
(Self.Element)));
end Get_Owned_Behavior;
-------------------
-- Get_Attribute --
-------------------
overriding function Get_Attribute
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Properties.Collections.Set_Of_UML_Property is
begin
return
AMF.UML.Properties.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Attribute
(Self.Element)));
end Get_Attribute;
---------------------------
-- Get_Collaboration_Use --
---------------------------
overriding function Get_Collaboration_Use
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Collaboration_Uses.Collections.Set_Of_UML_Collaboration_Use is
begin
return
AMF.UML.Collaboration_Uses.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Collaboration_Use
(Self.Element)));
end Get_Collaboration_Use;
-----------------
-- Get_Feature --
-----------------
overriding function Get_Feature
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Features.Collections.Set_Of_UML_Feature is
begin
return
AMF.UML.Features.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Feature
(Self.Element)));
end Get_Feature;
-----------------
-- Get_General --
-----------------
overriding function Get_General
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier is
begin
return
AMF.UML.Classifiers.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_General
(Self.Element)));
end Get_General;
------------------------
-- Get_Generalization --
------------------------
overriding function Get_Generalization
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Generalizations.Collections.Set_Of_UML_Generalization is
begin
return
AMF.UML.Generalizations.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Generalization
(Self.Element)));
end Get_Generalization;
--------------------------
-- Get_Inherited_Member --
--------------------------
overriding function Get_Inherited_Member
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is
begin
return
AMF.UML.Named_Elements.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Inherited_Member
(Self.Element)));
end Get_Inherited_Member;
---------------------------------
-- Get_Is_Final_Specialization --
---------------------------------
overriding function Get_Is_Final_Specialization
(Self : not null access constant UML_Execution_Environment_Proxy)
return Boolean is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Final_Specialization
(Self.Element);
end Get_Is_Final_Specialization;
---------------------------------
-- Set_Is_Final_Specialization --
---------------------------------
overriding procedure Set_Is_Final_Specialization
(Self : not null access UML_Execution_Environment_Proxy;
To : Boolean) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Final_Specialization
(Self.Element, To);
end Set_Is_Final_Specialization;
----------------------------------
-- Get_Owned_Template_Signature --
----------------------------------
overriding function Get_Owned_Template_Signature
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Redefinable_Template_Signatures.UML_Redefinable_Template_Signature_Access is
begin
return
AMF.UML.Redefinable_Template_Signatures.UML_Redefinable_Template_Signature_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Template_Signature
(Self.Element)));
end Get_Owned_Template_Signature;
----------------------------------
-- Set_Owned_Template_Signature --
----------------------------------
overriding procedure Set_Owned_Template_Signature
(Self : not null access UML_Execution_Environment_Proxy;
To : AMF.UML.Redefinable_Template_Signatures.UML_Redefinable_Template_Signature_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Owned_Template_Signature
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Owned_Template_Signature;
------------------------
-- Get_Owned_Use_Case --
------------------------
overriding function Get_Owned_Use_Case
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Use_Cases.Collections.Set_Of_UML_Use_Case is
begin
return
AMF.UML.Use_Cases.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Use_Case
(Self.Element)));
end Get_Owned_Use_Case;
--------------------------
-- Get_Powertype_Extent --
--------------------------
overriding function Get_Powertype_Extent
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Generalization_Sets.Collections.Set_Of_UML_Generalization_Set is
begin
return
AMF.UML.Generalization_Sets.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Powertype_Extent
(Self.Element)));
end Get_Powertype_Extent;
------------------------------
-- Get_Redefined_Classifier --
------------------------------
overriding function Get_Redefined_Classifier
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier is
begin
return
AMF.UML.Classifiers.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefined_Classifier
(Self.Element)));
end Get_Redefined_Classifier;
------------------------
-- Get_Representation --
------------------------
overriding function Get_Representation
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Collaboration_Uses.UML_Collaboration_Use_Access is
begin
return
AMF.UML.Collaboration_Uses.UML_Collaboration_Use_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Representation
(Self.Element)));
end Get_Representation;
------------------------
-- Set_Representation --
------------------------
overriding procedure Set_Representation
(Self : not null access UML_Execution_Environment_Proxy;
To : AMF.UML.Collaboration_Uses.UML_Collaboration_Use_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Representation
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Representation;
----------------------
-- Get_Substitution --
----------------------
overriding function Get_Substitution
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Substitutions.Collections.Set_Of_UML_Substitution is
begin
return
AMF.UML.Substitutions.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Substitution
(Self.Element)));
end Get_Substitution;
----------------------------
-- Get_Template_Parameter --
----------------------------
overriding function Get_Template_Parameter
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Classifier_Template_Parameters.UML_Classifier_Template_Parameter_Access is
begin
return
AMF.UML.Classifier_Template_Parameters.UML_Classifier_Template_Parameter_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Template_Parameter
(Self.Element)));
end Get_Template_Parameter;
----------------------------
-- Set_Template_Parameter --
----------------------------
overriding procedure Set_Template_Parameter
(Self : not null access UML_Execution_Environment_Proxy;
To : AMF.UML.Classifier_Template_Parameters.UML_Classifier_Template_Parameter_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Template_Parameter
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Template_Parameter;
------------------
-- Get_Use_Case --
------------------
overriding function Get_Use_Case
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Use_Cases.Collections.Set_Of_UML_Use_Case is
begin
return
AMF.UML.Use_Cases.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Use_Case
(Self.Element)));
end Get_Use_Case;
------------------------
-- Get_Element_Import --
------------------------
overriding function Get_Element_Import
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Element_Imports.Collections.Set_Of_UML_Element_Import is
begin
return
AMF.UML.Element_Imports.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Element_Import
(Self.Element)));
end Get_Element_Import;
-------------------------
-- Get_Imported_Member --
-------------------------
overriding function Get_Imported_Member
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element is
begin
return
AMF.UML.Packageable_Elements.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Imported_Member
(Self.Element)));
end Get_Imported_Member;
----------------
-- Get_Member --
----------------
overriding function Get_Member
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is
begin
return
AMF.UML.Named_Elements.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Member
(Self.Element)));
end Get_Member;
----------------------
-- Get_Owned_Member --
----------------------
overriding function Get_Owned_Member
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is
begin
return
AMF.UML.Named_Elements.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Member
(Self.Element)));
end Get_Owned_Member;
--------------------
-- Get_Owned_Rule --
--------------------
overriding function Get_Owned_Rule
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint is
begin
return
AMF.UML.Constraints.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Rule
(Self.Element)));
end Get_Owned_Rule;
------------------------
-- Get_Package_Import --
------------------------
overriding function Get_Package_Import
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Package_Imports.Collections.Set_Of_UML_Package_Import is
begin
return
AMF.UML.Package_Imports.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Package_Import
(Self.Element)));
end Get_Package_Import;
---------------------------
-- Get_Client_Dependency --
---------------------------
overriding function Get_Client_Dependency
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency is
begin
return
AMF.UML.Dependencies.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Client_Dependency
(Self.Element)));
end Get_Client_Dependency;
-------------------------
-- Get_Name_Expression --
-------------------------
overriding function Get_Name_Expression
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.String_Expressions.UML_String_Expression_Access is
begin
return
AMF.UML.String_Expressions.UML_String_Expression_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Name_Expression
(Self.Element)));
end Get_Name_Expression;
-------------------------
-- Set_Name_Expression --
-------------------------
overriding procedure Set_Name_Expression
(Self : not null access UML_Execution_Environment_Proxy;
To : AMF.UML.String_Expressions.UML_String_Expression_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Name_Expression
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Name_Expression;
-------------------
-- Get_Namespace --
-------------------
overriding function Get_Namespace
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access is
begin
return
AMF.UML.Namespaces.UML_Namespace_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Namespace
(Self.Element)));
end Get_Namespace;
------------------------
-- Get_Qualified_Name --
------------------------
overriding function Get_Qualified_Name
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.Optional_String is
begin
declare
use type Matreshka.Internals.Strings.Shared_String_Access;
Aux : constant Matreshka.Internals.Strings.Shared_String_Access
:= AMF.Internals.Tables.UML_Attributes.Internal_Get_Qualified_Name (Self.Element);
begin
if Aux = null then
return (Is_Empty => True);
else
return (False, League.Strings.Internals.Create (Aux));
end if;
end;
end Get_Qualified_Name;
-----------------
-- Get_Package --
-----------------
overriding function Get_Package
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Packages.UML_Package_Access is
begin
return
AMF.UML.Packages.UML_Package_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Package
(Self.Element)));
end Get_Package;
-----------------
-- Set_Package --
-----------------
overriding procedure Set_Package
(Self : not null access UML_Execution_Environment_Proxy;
To : AMF.UML.Packages.UML_Package_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Package
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Package;
-----------------------------------
-- Get_Owning_Template_Parameter --
-----------------------------------
overriding function Get_Owning_Template_Parameter
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Template_Parameters.UML_Template_Parameter_Access is
begin
return
AMF.UML.Template_Parameters.UML_Template_Parameter_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owning_Template_Parameter
(Self.Element)));
end Get_Owning_Template_Parameter;
-----------------------------------
-- Set_Owning_Template_Parameter --
-----------------------------------
overriding procedure Set_Owning_Template_Parameter
(Self : not null access UML_Execution_Environment_Proxy;
To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Owning_Template_Parameter
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Owning_Template_Parameter;
----------------------------
-- Get_Template_Parameter --
----------------------------
overriding function Get_Template_Parameter
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Template_Parameters.UML_Template_Parameter_Access is
begin
return
AMF.UML.Template_Parameters.UML_Template_Parameter_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Template_Parameter
(Self.Element)));
end Get_Template_Parameter;
----------------------------
-- Set_Template_Parameter --
----------------------------
overriding procedure Set_Template_Parameter
(Self : not null access UML_Execution_Environment_Proxy;
To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Template_Parameter
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Template_Parameter;
----------------------------------
-- Get_Owned_Template_Signature --
----------------------------------
overriding function Get_Owned_Template_Signature
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Template_Signatures.UML_Template_Signature_Access is
begin
return
AMF.UML.Template_Signatures.UML_Template_Signature_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Template_Signature
(Self.Element)));
end Get_Owned_Template_Signature;
----------------------------------
-- Set_Owned_Template_Signature --
----------------------------------
overriding procedure Set_Owned_Template_Signature
(Self : not null access UML_Execution_Environment_Proxy;
To : AMF.UML.Template_Signatures.UML_Template_Signature_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Owned_Template_Signature
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Owned_Template_Signature;
--------------------------
-- Get_Template_Binding --
--------------------------
overriding function Get_Template_Binding
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Template_Bindings.Collections.Set_Of_UML_Template_Binding is
begin
return
AMF.UML.Template_Bindings.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Template_Binding
(Self.Element)));
end Get_Template_Binding;
-----------------
-- Get_Is_Leaf --
-----------------
overriding function Get_Is_Leaf
(Self : not null access constant UML_Execution_Environment_Proxy)
return Boolean is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Leaf
(Self.Element);
end Get_Is_Leaf;
-----------------
-- Set_Is_Leaf --
-----------------
overriding procedure Set_Is_Leaf
(Self : not null access UML_Execution_Environment_Proxy;
To : Boolean) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Leaf
(Self.Element, To);
end Set_Is_Leaf;
---------------------------
-- Get_Redefined_Element --
---------------------------
overriding function Get_Redefined_Element
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Redefinable_Elements.Collections.Set_Of_UML_Redefinable_Element is
begin
return
AMF.UML.Redefinable_Elements.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefined_Element
(Self.Element)));
end Get_Redefined_Element;
------------------------------
-- Get_Redefinition_Context --
------------------------------
overriding function Get_Redefinition_Context
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier is
begin
return
AMF.UML.Classifiers.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefinition_Context
(Self.Element)));
end Get_Redefinition_Context;
--------------------
-- Get_Owned_Port --
--------------------
overriding function Get_Owned_Port
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Ports.Collections.Set_Of_UML_Port is
begin
return
AMF.UML.Ports.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Port
(Self.Element)));
end Get_Owned_Port;
-------------------------
-- Get_Owned_Connector --
-------------------------
overriding function Get_Owned_Connector
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Connectors.Collections.Set_Of_UML_Connector is
begin
return
AMF.UML.Connectors.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Connector
(Self.Element)));
end Get_Owned_Connector;
--------------
-- Get_Part --
--------------
overriding function Get_Part
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Properties.Collections.Set_Of_UML_Property is
begin
return
AMF.UML.Properties.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Part
(Self.Element)));
end Get_Part;
--------------
-- Get_Role --
--------------
overriding function Get_Role
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Connectable_Elements.Collections.Set_Of_UML_Connectable_Element is
begin
return
AMF.UML.Connectable_Elements.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Role
(Self.Element)));
end Get_Role;
--------------------------
-- Get_Deployed_Element --
--------------------------
overriding function Get_Deployed_Element
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element is
begin
return
AMF.UML.Packageable_Elements.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Deployed_Element
(Self.Element)));
end Get_Deployed_Element;
--------------------
-- Get_Deployment --
--------------------
overriding function Get_Deployment
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Deployments.Collections.Set_Of_UML_Deployment is
begin
return
AMF.UML.Deployments.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Deployment
(Self.Element)));
end Get_Deployment;
---------------
-- Extension --
---------------
overriding function Extension
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Extensions.Collections.Set_Of_UML_Extension is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Extension unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.Extension";
return Extension (Self);
end Extension;
-------------
-- Inherit --
-------------
overriding function Inherit
(Self : not null access constant UML_Execution_Environment_Proxy;
Inhs : AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Inherit unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.Inherit";
return Inherit (Self, Inhs);
end Inherit;
-----------------
-- Super_Class --
-----------------
overriding function Super_Class
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Classes.Collections.Set_Of_UML_Class is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Super_Class unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.Super_Class";
return Super_Class (Self);
end Super_Class;
------------------
-- All_Features --
------------------
overriding function All_Features
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Features.Collections.Set_Of_UML_Feature is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "All_Features unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.All_Features";
return All_Features (Self);
end All_Features;
-----------------
-- Conforms_To --
-----------------
overriding function Conforms_To
(Self : not null access constant UML_Execution_Environment_Proxy;
Other : AMF.UML.Classifiers.UML_Classifier_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Conforms_To unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.Conforms_To";
return Conforms_To (Self, Other);
end Conforms_To;
-------------
-- General --
-------------
overriding function General
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "General unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.General";
return General (Self);
end General;
-----------------------
-- Has_Visibility_Of --
-----------------------
overriding function Has_Visibility_Of
(Self : not null access constant UML_Execution_Environment_Proxy;
N : AMF.UML.Named_Elements.UML_Named_Element_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Has_Visibility_Of unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.Has_Visibility_Of";
return Has_Visibility_Of (Self, N);
end Has_Visibility_Of;
-------------------------
-- Inheritable_Members --
-------------------------
overriding function Inheritable_Members
(Self : not null access constant UML_Execution_Environment_Proxy;
C : AMF.UML.Classifiers.UML_Classifier_Access)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Inheritable_Members unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.Inheritable_Members";
return Inheritable_Members (Self, C);
end Inheritable_Members;
----------------------
-- Inherited_Member --
----------------------
overriding function Inherited_Member
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Inherited_Member unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.Inherited_Member";
return Inherited_Member (Self);
end Inherited_Member;
-----------------
-- Is_Template --
-----------------
overriding function Is_Template
(Self : not null access constant UML_Execution_Environment_Proxy)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Template unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.Is_Template";
return Is_Template (Self);
end Is_Template;
-------------------------
-- May_Specialize_Type --
-------------------------
overriding function May_Specialize_Type
(Self : not null access constant UML_Execution_Environment_Proxy;
C : AMF.UML.Classifiers.UML_Classifier_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "May_Specialize_Type unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.May_Specialize_Type";
return May_Specialize_Type (Self, C);
end May_Specialize_Type;
------------------------
-- Exclude_Collisions --
------------------------
overriding function Exclude_Collisions
(Self : not null access constant UML_Execution_Environment_Proxy;
Imps : AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element)
return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Exclude_Collisions unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.Exclude_Collisions";
return Exclude_Collisions (Self, Imps);
end Exclude_Collisions;
-------------------------
-- Get_Names_Of_Member --
-------------------------
overriding function Get_Names_Of_Member
(Self : not null access constant UML_Execution_Environment_Proxy;
Element : AMF.UML.Named_Elements.UML_Named_Element_Access)
return AMF.String_Collections.Set_Of_String is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Get_Names_Of_Member unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.Get_Names_Of_Member";
return Get_Names_Of_Member (Self, Element);
end Get_Names_Of_Member;
--------------------
-- Import_Members --
--------------------
overriding function Import_Members
(Self : not null access constant UML_Execution_Environment_Proxy;
Imps : AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element)
return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Import_Members unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.Import_Members";
return Import_Members (Self, Imps);
end Import_Members;
---------------------
-- Imported_Member --
---------------------
overriding function Imported_Member
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Imported_Member unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.Imported_Member";
return Imported_Member (Self);
end Imported_Member;
---------------------------------
-- Members_Are_Distinguishable --
---------------------------------
overriding function Members_Are_Distinguishable
(Self : not null access constant UML_Execution_Environment_Proxy)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Members_Are_Distinguishable unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.Members_Are_Distinguishable";
return Members_Are_Distinguishable (Self);
end Members_Are_Distinguishable;
------------------
-- Owned_Member --
------------------
overriding function Owned_Member
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Owned_Member unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.Owned_Member";
return Owned_Member (Self);
end Owned_Member;
-------------------------
-- All_Owning_Packages --
-------------------------
overriding function All_Owning_Packages
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Packages.Collections.Set_Of_UML_Package is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "All_Owning_Packages unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.All_Owning_Packages";
return All_Owning_Packages (Self);
end All_Owning_Packages;
-----------------------------
-- Is_Distinguishable_From --
-----------------------------
overriding function Is_Distinguishable_From
(Self : not null access constant UML_Execution_Environment_Proxy;
N : AMF.UML.Named_Elements.UML_Named_Element_Access;
Ns : AMF.UML.Namespaces.UML_Namespace_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Distinguishable_From unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.Is_Distinguishable_From";
return Is_Distinguishable_From (Self, N, Ns);
end Is_Distinguishable_From;
---------------
-- Namespace --
---------------
overriding function Namespace
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Namespace unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.Namespace";
return Namespace (Self);
end Namespace;
-----------------
-- Conforms_To --
-----------------
overriding function Conforms_To
(Self : not null access constant UML_Execution_Environment_Proxy;
Other : AMF.UML.Types.UML_Type_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Conforms_To unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.Conforms_To";
return Conforms_To (Self, Other);
end Conforms_To;
------------------------
-- Is_Compatible_With --
------------------------
overriding function Is_Compatible_With
(Self : not null access constant UML_Execution_Environment_Proxy;
P : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Compatible_With unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.Is_Compatible_With";
return Is_Compatible_With (Self, P);
end Is_Compatible_With;
---------------------------
-- Is_Template_Parameter --
---------------------------
overriding function Is_Template_Parameter
(Self : not null access constant UML_Execution_Environment_Proxy)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Template_Parameter unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.Is_Template_Parameter";
return Is_Template_Parameter (Self);
end Is_Template_Parameter;
----------------------------
-- Parameterable_Elements --
----------------------------
overriding function Parameterable_Elements
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Parameterable_Elements.Collections.Set_Of_UML_Parameterable_Element is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Parameterable_Elements unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.Parameterable_Elements";
return Parameterable_Elements (Self);
end Parameterable_Elements;
------------------------
-- Is_Consistent_With --
------------------------
overriding function Is_Consistent_With
(Self : not null access constant UML_Execution_Environment_Proxy;
Redefinee : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Consistent_With unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.Is_Consistent_With";
return Is_Consistent_With (Self, Redefinee);
end Is_Consistent_With;
-----------------------------------
-- Is_Redefinition_Context_Valid --
-----------------------------------
overriding function Is_Redefinition_Context_Valid
(Self : not null access constant UML_Execution_Environment_Proxy;
Redefined : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Redefinition_Context_Valid unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.Is_Redefinition_Context_Valid";
return Is_Redefinition_Context_Valid (Self, Redefined);
end Is_Redefinition_Context_Valid;
----------------
-- Owned_Port --
----------------
overriding function Owned_Port
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Ports.Collections.Set_Of_UML_Port is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Owned_Port unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.Owned_Port";
return Owned_Port (Self);
end Owned_Port;
----------
-- Part --
----------
overriding function Part
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Properties.Collections.Set_Of_UML_Property is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Part unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.Part";
return Part (Self);
end Part;
----------------------
-- Deployed_Element --
----------------------
overriding function Deployed_Element
(Self : not null access constant UML_Execution_Environment_Proxy)
return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Deployed_Element unimplemented");
raise Program_Error with "Unimplemented procedure UML_Execution_Environment_Proxy.Deployed_Element";
return Deployed_Element (Self);
end Deployed_Element;
end AMF.Internals.UML_Execution_Environments;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- G N A T . S I G N A L S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2003-2005, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
--
--
--
--
--
--
--
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package provides operations for querying and setting the blocked
-- status of signals.
-- This package is supported only on targets where Ada.Interrupts.Interrupt_ID
-- corresponds to software signals on the target, and where System.Interrupts
-- provides the ability to block and unblock signals.
with Ada.Interrupts;
package GNAT.Signals is
procedure Block_Signal (Signal : Ada.Interrupts.Interrupt_ID);
-- Block "Signal" at the process level
procedure Unblock_Signal (Signal : Ada.Interrupts.Interrupt_ID);
-- Unblock "Signal" at the process level
function Is_Blocked (Signal : Ada.Interrupts.Interrupt_ID) return Boolean;
-- "Signal" blocked at the process level?
end GNAT.Signals;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- I N T E R F A C E S . C --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
package body Interfaces.C is
-----------------------
-- Is_Nul_Terminated --
-----------------------
-- Case of char_array
function Is_Nul_Terminated (Item : char_array) return Boolean is
begin
for J in Item'Range loop
if Item (J) = nul then
return True;
end if;
end loop;
return False;
end Is_Nul_Terminated;
-- Case of wchar_array
function Is_Nul_Terminated (Item : wchar_array) return Boolean is
begin
for J in Item'Range loop
if Item (J) = wide_nul then
return True;
end if;
end loop;
return False;
end Is_Nul_Terminated;
-- Case of char16_array
function Is_Nul_Terminated (Item : char16_array) return Boolean is
begin
for J in Item'Range loop
if Item (J) = char16_nul then
return True;
end if;
end loop;
return False;
end Is_Nul_Terminated;
-- Case of char32_array
function Is_Nul_Terminated (Item : char32_array) return Boolean is
begin
for J in Item'Range loop
if Item (J) = char32_nul then
return True;
end if;
end loop;
return False;
end Is_Nul_Terminated;
------------
-- To_Ada --
------------
-- Convert char to Character
function To_Ada (Item : char) return Character is
begin
return Character'Val (char'Pos (Item));
end To_Ada;
-- Convert char_array to String (function form)
function To_Ada
(Item : char_array;
Trim_Nul : Boolean := True) return String
is
Count : Natural;
From : size_t;
begin
if Trim_Nul then
From := Item'First;
loop
if From > Item'Last then
raise Terminator_Error;
elsif Item (From) = nul then
exit;
else
From := From + 1;
end if;
end loop;
Count := Natural (From - Item'First);
else
Count := Item'Length;
end if;
declare
R : String (1 .. Count);
begin
for J in R'Range loop
R (J) := To_Ada (Item (size_t (J) + (Item'First - 1)));
end loop;
return R;
end;
end To_Ada;
-- Convert char_array to String (procedure form)
procedure To_Ada
(Item : char_array;
Target : out String;
Count : out Natural;
Trim_Nul : Boolean := True)
is
From : size_t;
To : Positive;
begin
if Trim_Nul then
From := Item'First;
loop
if From > Item'Last then
raise Terminator_Error;
elsif Item (From) = nul then
exit;
else
From := From + 1;
end if;
end loop;
Count := Natural (From - Item'First);
else
Count := Item'Length;
end if;
if Count > Target'Length then
raise Constraint_Error;
else
From := Item'First;
To := Target'First;
for J in 1 .. Count loop
Target (To) := Character (Item (From));
From := From + 1;
To := To + 1;
end loop;
end if;
end To_Ada;
-- Convert wchar_t to Wide_Character
function To_Ada (Item : wchar_t) return Wide_Character is
begin
return Wide_Character (Item);
end To_Ada;
-- Convert wchar_array to Wide_String (function form)
function To_Ada
(Item : wchar_array;
Trim_Nul : Boolean := True) return Wide_String
is
Count : Natural;
From : size_t;
begin
if Trim_Nul then
From := Item'First;
loop
if From > Item'Last then
raise Terminator_Error;
elsif Item (From) = wide_nul then
exit;
else
From := From + 1;
end if;
end loop;
Count := Natural (From - Item'First);
else
Count := Item'Length;
end if;
declare
R : Wide_String (1 .. Count);
begin
for J in R'Range loop
R (J) := To_Ada (Item (size_t (J) + (Item'First - 1)));
end loop;
return R;
end;
end To_Ada;
-- Convert wchar_array to Wide_String (procedure form)
procedure To_Ada
(Item : wchar_array;
Target : out Wide_String;
Count : out Natural;
Trim_Nul : Boolean := True)
is
From : size_t;
To : Positive;
begin
if Trim_Nul then
From := Item'First;
loop
if From > Item'Last then
raise Terminator_Error;
elsif Item (From) = wide_nul then
exit;
else
From := From + 1;
end if;
end loop;
Count := Natural (From - Item'First);
else
Count := Item'Length;
end if;
if Count > Target'Length then
raise Constraint_Error;
else
From := Item'First;
To := Target'First;
for J in 1 .. Count loop
Target (To) := To_Ada (Item (From));
From := From + 1;
To := To + 1;
end loop;
end if;
end To_Ada;
-- Convert char16_t to Wide_Character
function To_Ada (Item : char16_t) return Wide_Character is
begin
return Wide_Character'Val (char16_t'Pos (Item));
end To_Ada;
-- Convert char16_array to Wide_String (function form)
function To_Ada
(Item : char16_array;
Trim_Nul : Boolean := True) return Wide_String
is
Count : Natural;
From : size_t;
begin
if Trim_Nul then
From := Item'First;
loop
if From > Item'Last then
raise Terminator_Error;
elsif Item (From) = char16_t'Val (0) then
exit;
else
From := From + 1;
end if;
end loop;
Count := Natural (From - Item'First);
else
Count := Item'Length;
end if;
declare
R : Wide_String (1 .. Count);
begin
for J in R'Range loop
R (J) := To_Ada (Item (size_t (J) + (Item'First - 1)));
end loop;
return R;
end;
end To_Ada;
-- Convert char16_array to Wide_String (procedure form)
procedure To_Ada
(Item : char16_array;
Target : out Wide_String;
Count : out Natural;
Trim_Nul : Boolean := True)
is
From : size_t;
To : Positive;
begin
if Trim_Nul then
From := Item'First;
loop
if From > Item'Last then
raise Terminator_Error;
elsif Item (From) = char16_t'Val (0) then
exit;
else
From := From + 1;
end if;
end loop;
Count := Natural (From - Item'First);
else
Count := Item'Length;
end if;
if Count > Target'Length then
raise Constraint_Error;
else
From := Item'First;
To := Target'First;
for J in 1 .. Count loop
Target (To) := To_Ada (Item (From));
From := From + 1;
To := To + 1;
end loop;
end if;
end To_Ada;
-- Convert char32_t to Wide_Wide_Character
function To_Ada (Item : char32_t) return Wide_Wide_Character is
begin
return Wide_Wide_Character'Val (char32_t'Pos (Item));
end To_Ada;
-- Convert char32_array to Wide_Wide_String (function form)
function To_Ada
(Item : char32_array;
Trim_Nul : Boolean := True) return Wide_Wide_String
is
Count : Natural;
From : size_t;
begin
if Trim_Nul then
From := Item'First;
loop
if From > Item'Last then
raise Terminator_Error;
elsif Item (From) = char32_t'Val (0) then
exit;
else
From := From + 1;
end if;
end loop;
Count := Natural (From - Item'First);
else
Count := Item'Length;
end if;
declare
R : Wide_Wide_String (1 .. Count);
begin
for J in R'Range loop
R (J) := To_Ada (Item (size_t (J) + (Item'First - 1)));
end loop;
return R;
end;
end To_Ada;
-- Convert char32_array to Wide_Wide_String (procedure form)
procedure To_Ada
(Item : char32_array;
Target : out Wide_Wide_String;
Count : out Natural;
Trim_Nul : Boolean := True)
is
From : size_t;
To : Positive;
begin
if Trim_Nul then
From := Item'First;
loop
if From > Item'Last then
raise Terminator_Error;
elsif Item (From) = char32_t'Val (0) then
exit;
else
From := From + 1;
end if;
end loop;
Count := Natural (From - Item'First);
else
Count := Item'Length;
end if;
if Count > Target'Length then
raise Constraint_Error;
else
From := Item'First;
To := Target'First;
for J in 1 .. Count loop
Target (To) := To_Ada (Item (From));
From := From + 1;
To := To + 1;
end loop;
end if;
end To_Ada;
----------
-- To_C --
----------
-- Convert Character to char
function To_C (Item : Character) return char is
begin
return char'Val (Character'Pos (Item));
end To_C;
-- Convert String to char_array (function form)
function To_C
(Item : String;
Append_Nul : Boolean := True) return char_array
is
begin
if Append_Nul then
declare
R : char_array (0 .. Item'Length);
begin
for J in Item'Range loop
R (size_t (J - Item'First)) := To_C (Item (J));
end loop;
R (R'Last) := nul;
return R;
end;
-- Append_Nul False
else
-- A nasty case, if the string is null, we must return a null
-- char_array. The lower bound of this array is required to be zero
-- (RM B.3(50)) but that is of course impossible given that size_t
-- is unsigned. According to Ada 2005 AI-258, the result is to raise
-- Constraint_Error. This is also the appropriate behavior in Ada 95,
-- since nothing else makes sense.
if Item'Length = 0 then
raise Constraint_Error;
-- Normal case
else
declare
R : char_array (0 .. Item'Length - 1);
begin
for J in Item'Range loop
R (size_t (J - Item'First)) := To_C (Item (J));
end loop;
return R;
end;
end if;
end if;
end To_C;
-- Convert String to char_array (procedure form)
procedure To_C
(Item : String;
Target : out char_array;
Count : out size_t;
Append_Nul : Boolean := True)
is
To : size_t;
begin
if Target'Length < Item'Length then
raise Constraint_Error;
else
To := Target'First;
for From in Item'Range loop
Target (To) := char (Item (From));
To := To + 1;
end loop;
if Append_Nul then
if To > Target'Last then
raise Constraint_Error;
else
Target (To) := nul;
Count := Item'Length + 1;
end if;
else
Count := Item'Length;
end if;
end if;
end To_C;
-- Convert Wide_Character to wchar_t
function To_C (Item : Wide_Character) return wchar_t is
begin
return wchar_t (Item);
end To_C;
-- Convert Wide_String to wchar_array (function form)
function To_C
(Item : Wide_String;
Append_Nul : Boolean := True) return wchar_array
is
begin
if Append_Nul then
declare
R : wchar_array (0 .. Item'Length);
begin
for J in Item'Range loop
R (size_t (J - Item'First)) := To_C (Item (J));
end loop;
R (R'Last) := wide_nul;
return R;
end;
else
-- A nasty case, if the string is null, we must return a null
-- wchar_array. The lower bound of this array is required to be zero
-- (RM B.3(50)) but that is of course impossible given that size_t
-- is unsigned. According to Ada 2005 AI-258, the result is to raise
-- Constraint_Error. This is also the appropriate behavior in Ada 95,
-- since nothing else makes sense.
if Item'Length = 0 then
raise Constraint_Error;
else
declare
R : wchar_array (0 .. Item'Length - 1);
begin
for J in size_t range 0 .. Item'Length - 1 loop
R (J) := To_C (Item (Integer (J) + Item'First));
end loop;
return R;
end;
end if;
end if;
end To_C;
-- Convert Wide_String to wchar_array (procedure form)
procedure To_C
(Item : Wide_String;
Target : out wchar_array;
Count : out size_t;
Append_Nul : Boolean := True)
is
To : size_t;
begin
if Target'Length < Item'Length then
raise Constraint_Error;
else
To := Target'First;
for From in Item'Range loop
Target (To) := To_C (Item (From));
To := To + 1;
end loop;
if Append_Nul then
if To > Target'Last then
raise Constraint_Error;
else
Target (To) := wide_nul;
Count := Item'Length + 1;
end if;
else
Count := Item'Length;
end if;
end if;
end To_C;
-- Convert Wide_Character to char16_t
function To_C (Item : Wide_Character) return char16_t is
begin
return char16_t'Val (Wide_Character'Pos (Item));
end To_C;
-- Convert Wide_String to char16_array (function form)
function To_C
(Item : Wide_String;
Append_Nul : Boolean := True) return char16_array
is
begin
if Append_Nul then
declare
R : char16_array (0 .. Item'Length);
begin
for J in Item'Range loop
R (size_t (J - Item'First)) := To_C (Item (J));
end loop;
R (R'Last) := char16_t'Val (0);
return R;
end;
else
-- A nasty case, if the string is null, we must return a null
-- char16_array. The lower bound of this array is required to be zero
-- (RM B.3(50)) but that is of course impossible given that size_t
-- is unsigned. According to Ada 2005 AI-258, the result is to raise
-- Constraint_Error. This is also the appropriate behavior in Ada 95,
-- since nothing else makes sense.
if Item'Length = 0 then
raise Constraint_Error;
else
declare
R : char16_array (0 .. Item'Length - 1);
begin
for J in size_t range 0 .. Item'Length - 1 loop
R (J) := To_C (Item (Integer (J) + Item'First));
end loop;
return R;
end;
end if;
end if;
end To_C;
-- Convert Wide_String to char16_array (procedure form)
procedure To_C
(Item : Wide_String;
Target : out char16_array;
Count : out size_t;
Append_Nul : Boolean := True)
is
To : size_t;
begin
if Target'Length < Item'Length then
raise Constraint_Error;
else
To := Target'First;
for From in Item'Range loop
Target (To) := To_C (Item (From));
To := To + 1;
end loop;
if Append_Nul then
if To > Target'Last then
raise Constraint_Error;
else
Target (To) := char16_t'Val (0);
Count := Item'Length + 1;
end if;
else
Count := Item'Length;
end if;
end if;
end To_C;
-- Convert Wide_Character to char32_t
function To_C (Item : Wide_Wide_Character) return char32_t is
begin
return char32_t'Val (Wide_Wide_Character'Pos (Item));
end To_C;
-- Convert Wide_Wide_String to char32_array (function form)
function To_C
(Item : Wide_Wide_String;
Append_Nul : Boolean := True) return char32_array
is
begin
if Append_Nul then
declare
R : char32_array (0 .. Item'Length);
begin
for J in Item'Range loop
R (size_t (J - Item'First)) := To_C (Item (J));
end loop;
R (R'Last) := char32_t'Val (0);
return R;
end;
else
-- A nasty case, if the string is null, we must return a null
-- char32_array. The lower bound of this array is required to be zero
-- (RM B.3(50)) but that is of course impossible given that size_t
-- is unsigned. According to Ada 2005 AI-258, the result is to raise
-- Constraint_Error.
if Item'Length = 0 then
raise Constraint_Error;
else
declare
R : char32_array (0 .. Item'Length - 1);
begin
for J in size_t range 0 .. Item'Length - 1 loop
R (J) := To_C (Item (Integer (J) + Item'First));
end loop;
return R;
end;
end if;
end if;
end To_C;
-- Convert Wide_Wide_String to char32_array (procedure form)
procedure To_C
(Item : Wide_Wide_String;
Target : out char32_array;
Count : out size_t;
Append_Nul : Boolean := True)
is
To : size_t;
begin
if Target'Length < Item'Length then
raise Constraint_Error;
else
To := Target'First;
for From in Item'Range loop
Target (To) := To_C (Item (From));
To := To + 1;
end loop;
if Append_Nul then
if To > Target'Last then
raise Constraint_Error;
else
Target (To) := char32_t'Val (0);
Count := Item'Length + 1;
end if;
else
Count := Item'Length;
end if;
end if;
end To_C;
end Interfaces.C;
|
-- { dg-do compile }
-- { dg-options "-gnat12 -gnato" }
package Cond_Expr1 is
function Tail (S : String) return String is
(if S'Last <= S'First then "" else S (S'First + 1 .. S'Last));
end Cond_Expr1;
|
-- This file is generated by SWIG. Please do not modify by hand.
--
with Interfaces;
with Interfaces.C;
with Interfaces.C.Pointers;
package xcb.xcb_big_requests_enable_request_t is
-- Item
--
type Item is record
major_opcode : aliased Interfaces.Unsigned_8;
minor_opcode : aliased Interfaces.Unsigned_8;
length : aliased Interfaces.Unsigned_16;
end record;
-- Item_Array
--
type Item_Array is
array
(Interfaces.C
.size_t range <>) of aliased xcb.xcb_big_requests_enable_request_t
.Item;
-- Pointer
--
package C_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_big_requests_enable_request_t.Item,
Element_Array => xcb.xcb_big_requests_enable_request_t.Item_Array,
Default_Terminator => (others => <>));
subtype Pointer is C_Pointers.Pointer;
-- Pointer_Array
--
type Pointer_Array is
array
(Interfaces.C
.size_t range <>) of aliased xcb.xcb_big_requests_enable_request_t
.Pointer;
-- Pointer_Pointer
--
package C_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_big_requests_enable_request_t.Pointer,
Element_Array => xcb.xcb_big_requests_enable_request_t.Pointer_Array,
Default_Terminator => null);
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
end xcb.xcb_big_requests_enable_request_t;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . T R A C E S . F O R M A T --
-- --
-- S p e c --
-- --
-- Copyright (C) 2001-2005 Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNARL; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package implements functions to format run-time traces
package System.Traces.Format is
pragma Preelaborate;
Max_Size : constant Integer := 128;
-- Event messages' maximum size.
subtype String_Trace is String (1 .. Max_Size);
-- Specific type in which trace information is stored. An ASCII.NUL
-- character ends the string so that it is compatible with C strings
-- which is useful on some targets (eg. VxWorks)
-- These private functions handles String_Trace formatting
function Format_Trace (Source : String) return String_Trace;
-- Put a String in a String_Trace, truncates the string if necessary.
-- Similar to Head( .. ) found in Ada.Strings.Bounded
function Append
(Source : String_Trace;
Annex : String)
return String_Trace;
pragma Inline (Append);
-- Concatenates two string, similar to & operator from Ada.String.Unbounded
procedure Send_Trace (Id : Trace_T; Info : String);
-- This function (which is a subunit) send messages to external programs
end System.Traces.Format;
|
with
openGL.Camera,
openGL.Texture,
ada.unchecked_Deallocation;
package body openGL.Impostor.simple
is
procedure free (Self : in out View)
is
procedure deallocate is new ada.unchecked_Deallocation (Item'Class, View);
begin
if Self /= null
then
destroy (Self.all);
deallocate (Self);
end if;
end free;
overriding
function current_Camera_look_at_Rotation (Self : in Item) return Matrix_3x3
is
begin
return Self.current_Camera_look_at_Rotation;
end current_Camera_look_at_Rotation;
overriding
function update_Required (Self : access Item; the_Camera : access Camera.item'Class) return Boolean
is
use linear_Algebra_3d;
begin
-- Look directly at target so it will be rendered in the centre of the viewport.
--
Self.current_Camera_look_at_Rotation := get_Rotation (look_at (the_Camera.Site,
get_Translation (Self.Target.Transform),
-- get_Translation (Self.Target.model_Transform),
(0.0, 1.0, 0.0)));
Self.current_pixel_Region := Self.get_pixel_Region (camera_Spin => Self.current_Camera_look_at_Rotation,
camera_Site => the_Camera.Site,
camera_projection_Transform => the_Camera.projection_Transform,
camera_Viewport => the_Camera.Viewport);
declare
update_Required : Boolean := Self.general_Update_required (the_Camera.Site,
Self.current_pixel_Region);
begin
if not update_Required
and then Self.size_Update_required (Self.current_pixel_Region)
then
update_Required := True;
end if;
if Update_required
then
Self.current_Width_pixels := Self.current_pixel_Region.Width; -- Cache current state.
Self.current_Height_pixels := Self.current_pixel_Region.Height;
Self.current_copy_X := Self.current_pixel_Region.X;
Self.current_copy_Y := Self.current_pixel_Region.Y;
Self.current_copy_Width := Self.current_pixel_Region.Width;
Self.current_copy_Height := Self.current_pixel_Region.Height;
end if;
return update_Required;
end;
end update_Required;
overriding
procedure pre_update (Self : in out Item; the_Camera : access Camera.item'Class)
is
begin
Self.camera_world_Rotation_original := the_Camera.Spin;
the_Camera.Spin_is (Self.current_Camera_look_at_Rotation);
end pre_update;
overriding
procedure update (Self : in out Item; the_Camera : access Camera.item'Class;
texture_Pool : in Texture.Pool_view)
is
world_Rotation_original : constant Matrix_3x3 := the_Camera.Spin;
begin
the_Camera.Spin_is (Self.current_Camera_look_at_Rotation);
Impostor.item (Self).update (the_Camera, texture_Pool); -- Base class 'update'.
the_Camera.Spin_is (world_Rotation_original);
end update;
overriding
procedure post_update (Self : in out Item; the_Camera : access Camera.item'Class)
is
begin
the_Camera.Spin_is (Self.camera_world_Rotation_original);
end post_update;
end openGL.Impostor.simple;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . W I D E _ W I D E _ T E X T _ I O . E N U M E R A T I O N _ A U X--
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Ada.Wide_Wide_Text_IO.Generic_Aux; use Ada.Wide_Wide_Text_IO.Generic_Aux;
with Ada.Characters.Conversions; use Ada.Characters.Conversions;
with Ada.Characters.Handling; use Ada.Characters.Handling;
with Interfaces.C_Streams; use Interfaces.C_Streams;
with System.WCh_Con; use System.WCh_Con;
package body Ada.Wide_Wide_Text_IO.Enumeration_Aux is
subtype TFT is Ada.Wide_Wide_Text_IO.File_Type;
-- File type required for calls to routines in Aux
-----------------------
-- Local Subprograms --
-----------------------
procedure Store_Char
(WC : Wide_Wide_Character;
Buf : out Wide_Wide_String;
Ptr : in out Integer);
-- Store a single character in buffer, checking for overflow
-- These definitions replace the ones in Ada.Characters.Handling, which
-- do not seem to work for some strange not understood reason ??? at
-- least in the OS/2 version.
function To_Lower (C : Character) return Character;
------------------
-- Get_Enum_Lit --
------------------
procedure Get_Enum_Lit
(File : File_Type;
Buf : out Wide_Wide_String;
Buflen : out Natural)
is
ch : int;
WC : Wide_Wide_Character;
begin
Buflen := 0;
Load_Skip (TFT (File));
ch := Nextc (TFT (File));
-- Character literal case. If the initial character is a quote, then
-- we read as far as we can without backup (see ACVC test CE3905L)
if ch = Character'Pos (''') then
Get (File, WC);
Store_Char (WC, Buf, Buflen);
ch := Nextc (TFT (File));
if ch = LM or else ch = EOF then
return;
end if;
Get (File, WC);
Store_Char (WC, Buf, Buflen);
ch := Nextc (TFT (File));
if ch /= Character'Pos (''') then
return;
end if;
Get (File, WC);
Store_Char (WC, Buf, Buflen);
-- Similarly for identifiers, read as far as we can, in particular,
-- do read a trailing underscore (again see ACVC test CE3905L to
-- understand why we do this, although it seems somewhat peculiar).
else
-- Identifier must start with a letter. Any wide character value
-- outside the normal Latin-1 range counts as a letter for this.
if ch < 255 and then not Is_Letter (Character'Val (ch)) then
return;
end if;
-- If we do have a letter, loop through the characters quitting on
-- the first non-identifier character (note that this includes the
-- cases of hitting a line mark or page mark).
loop
Get (File, WC);
Store_Char (WC, Buf, Buflen);
ch := Nextc (TFT (File));
exit when ch = EOF;
if ch = Character'Pos ('_') then
exit when Buf (Buflen) = '_';
elsif ch = Character'Pos (ASCII.ESC) then
null;
elsif File.WC_Method in WC_Upper_Half_Encoding_Method
and then ch > 127
then
null;
else
exit when not Is_Letter (Character'Val (ch))
and then
not Is_Digit (Character'Val (ch));
end if;
end loop;
end if;
end Get_Enum_Lit;
---------
-- Put --
---------
procedure Put
(File : File_Type;
Item : Wide_Wide_String;
Width : Field;
Set : Type_Set)
is
Actual_Width : constant Integer :=
Integer'Max (Integer (Width), Item'Length);
begin
Check_On_One_Line (TFT (File), Actual_Width);
if Set = Lower_Case and then Item (1) /= ''' then
declare
Iteml : Wide_Wide_String (Item'First .. Item'Last);
begin
for J in Item'Range loop
if Is_Character (Item (J)) then
Iteml (J) :=
To_Wide_Wide_Character
(To_Lower (To_Character (Item (J))));
else
Iteml (J) := Item (J);
end if;
end loop;
Put (File, Iteml);
end;
else
Put (File, Item);
end if;
for J in 1 .. Actual_Width - Item'Length loop
Put (File, ' ');
end loop;
end Put;
----------
-- Puts --
----------
procedure Puts
(To : out Wide_Wide_String;
Item : Wide_Wide_String;
Set : Type_Set)
is
Ptr : Natural;
begin
if Item'Length > To'Length then
raise Layout_Error;
else
Ptr := To'First;
for J in Item'Range loop
if Set = Lower_Case
and then Item (1) /= '''
and then Is_Character (Item (J))
then
To (Ptr) :=
To_Wide_Wide_Character (To_Lower (To_Character (Item (J))));
else
To (Ptr) := Item (J);
end if;
Ptr := Ptr + 1;
end loop;
while Ptr <= To'Last loop
To (Ptr) := ' ';
Ptr := Ptr + 1;
end loop;
end if;
end Puts;
-------------------
-- Scan_Enum_Lit --
-------------------
procedure Scan_Enum_Lit
(From : Wide_Wide_String;
Start : out Natural;
Stop : out Natural)
is
WC : Wide_Wide_Character;
-- Processing for Scan_Enum_Lit
begin
Start := From'First;
loop
if Start > From'Last then
raise End_Error;
elsif Is_Character (From (Start))
and then not Is_Blank (To_Character (From (Start)))
then
exit;
else
Start := Start + 1;
end if;
end loop;
-- Character literal case. If the initial character is a quote, then
-- we read as far as we can without backup (see ACVC test CE3905L
-- which is for the analogous case for reading from a file).
if From (Start) = ''' then
Stop := Start;
if Stop = From'Last then
raise Data_Error;
else
Stop := Stop + 1;
end if;
if From (Stop) in ' ' .. '~'
or else From (Stop) >= Wide_Wide_Character'Val (16#80#)
then
if Stop = From'Last then
raise Data_Error;
else
Stop := Stop + 1;
if From (Stop) = ''' then
return;
end if;
end if;
end if;
raise Data_Error;
-- Similarly for identifiers, read as far as we can, in particular,
-- do read a trailing underscore (again see ACVC test CE3905L to
-- understand why we do this, although it seems somewhat peculiar).
else
-- Identifier must start with a letter, any wide character outside
-- the normal Latin-1 range is considered a letter for this test.
if Is_Character (From (Start))
and then not Is_Letter (To_Character (From (Start)))
then
raise Data_Error;
end if;
-- If we do have a letter, loop through the characters quitting on
-- the first non-identifier character (note that this includes the
-- cases of hitting a line mark or page mark).
Stop := Start + 1;
while Stop < From'Last loop
WC := From (Stop + 1);
exit when
Is_Character (WC)
and then
not Is_Letter (To_Character (WC))
and then
not Is_Letter (To_Character (WC))
and then
(WC /= '_' or else From (Stop - 1) = '_');
Stop := Stop + 1;
end loop;
end if;
end Scan_Enum_Lit;
----------------
-- Store_Char --
----------------
procedure Store_Char
(WC : Wide_Wide_Character;
Buf : out Wide_Wide_String;
Ptr : in out Integer)
is
begin
if Ptr = Buf'Last then
raise Data_Error;
else
Ptr := Ptr + 1;
Buf (Ptr) := WC;
end if;
end Store_Char;
--------------
-- To_Lower --
--------------
function To_Lower (C : Character) return Character is
begin
if C in 'A' .. 'Z' then
return Character'Val (Character'Pos (C) + 32);
else
return C;
end if;
end To_Lower;
end Ada.Wide_Wide_Text_IO.Enumeration_Aux;
|
-- Taken from altivec of GNAT examples (http://www.adacore.com/developers/code-samples/gnat-examples/)
-- ====================================================================================================
-- This example shows how to create and manipulate vectors by the mean of high
-- level views.
with GNAT.Altivec; use GNAT.Altivec;
with GNAT.Altivec.Conversions; use GNAT.Altivec.Conversions;
with GNAT.Altivec.Vector_Operations; use GNAT.Altivec.Vector_Operations;
with GNAT.Altivec.Vector_Types; use GNAT.Altivec.Vector_Types;
with GNAT.Altivec.Vector_Views; use GNAT.Altivec.Vector_Views;
with GNAT.IO; use GNAT.IO;
procedure Altivec is
View_A : constant VUI_View := (Values => (1, 2, 3, 4));
Vector_A : constant vector_unsigned_int := To_Vector (View_A);
View_B : constant VUI_View := (Values => (1, 1, 1, 1));
Vector_B : constant vector_unsigned_int := To_Vector (View_B);
Vector_C : vector_unsigned_int;
View_C : VUI_View;
begin
Vector_C := vec_add (Vector_A, Vector_B);
-- C = A + B
View_C := To_View (Vector_C);
for I in View_C.Values'Range loop
Put_Line (unsigned_int'Image (View_C.Values (I)));
end loop;
end Altivec;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . W C H _ C N V --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2021, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains generic subprograms used for converting between
-- sequences of Character and Wide_Character. Wide_Wide_Character values
-- are also handled, but represented using integer range types defined in
-- this package, so that this package can be used from applications that
-- are restricted to Ada 95 compatibility (such as the compiler itself).
-- All the algorithms for encoding and decoding are isolated in this package
-- and in System.WCh_JIS and should not be duplicated elsewhere. The only
-- exception to this is that GNAT.Decode_String and GNAT.Encode_String have
-- their own circuits for UTF-8 conversions, for improved efficiency.
-- This unit may be used directly from an application program by providing
-- an appropriate WITH, and the interface can be expected to remain stable.
pragma Compiler_Unit_Warning;
with System.WCh_Con;
package System.WCh_Cnv is
pragma Pure;
type UTF_32_Code is range 0 .. 16#7FFF_FFFF#;
for UTF_32_Code'Size use 32;
-- Range of allowed UTF-32 encoding values
type UTF_32_String is array (Positive range <>) of UTF_32_Code;
generic
with function In_Char return Character;
function Char_Sequence_To_Wide_Char
(C : Character;
EM : System.WCh_Con.WC_Encoding_Method) return Wide_Character;
-- C is the first character of a sequence of one or more characters which
-- represent a wide character sequence. Calling the function In_Char for
-- additional characters as required, Char_To_Wide_Char returns the
-- corresponding wide character value. Constraint_Error is raised if the
-- sequence of characters encountered is not a valid wide character
-- sequence for the given encoding method.
--
-- Note on the use of brackets encoding (WCEM_Brackets). The brackets
-- encoding method is ambiguous in the context of this function, since
-- there is no way to tell if ["1234"] is eight unencoded characters or
-- one encoded character. In the context of Ada sources, any sequence
-- starting [" must be the start of an encoding (since that sequence is
-- not valid in Ada source otherwise). The routines in this package use
-- the same approach. If the input string contains the sequence [" then
-- this is assumed to be the start of a brackets encoding sequence, and
-- if it does not match the syntax, an error is raised.
generic
with function In_Char return Character;
function Char_Sequence_To_UTF_32
(C : Character;
EM : System.WCh_Con.WC_Encoding_Method) return UTF_32_Code;
-- This is similar to the above, but the function returns a code from
-- the full UTF_32 code set, which covers the full range of possible
-- values in Wide_Wide_Character. The result can be converted to
-- Wide_Wide_Character form using Wide_Wide_Character'Val.
generic
with procedure Out_Char (C : Character);
procedure Wide_Char_To_Char_Sequence
(WC : Wide_Character;
EM : System.WCh_Con.WC_Encoding_Method);
-- Given a wide character, converts it into a sequence of one or
-- more characters, calling the given Out_Char procedure for each.
-- Constraint_Error is raised if the given wide character value is
-- not a valid value for the given encoding method.
--
-- Note on brackets encoding (WCEM_Brackets). For the input routines above,
-- upper half characters can be represented as ["hh"] but this procedure
-- will only use brackets encodings for codes higher than 16#FF#, so upper
-- half characters will be output as single Character values.
generic
with procedure Out_Char (C : Character);
procedure UTF_32_To_Char_Sequence
(Val : UTF_32_Code;
EM : System.WCh_Con.WC_Encoding_Method);
-- This is similar to the above, but the input value is a code from the
-- full UTF_32 code set, which covers the full range of possible values
-- in Wide_Wide_Character. To convert a Wide_Wide_Character value, the
-- caller can use Wide_Wide_Character'Pos in the call.
end System.WCh_Cnv;
|
with
openGL.Primitive.indexed,
openGL.IO;
package body openGL.Model.billboard.colored_textured
is
type Geometry_view is access all Geometry.colored_textured.item'Class;
---------
--- Forge
--
function new_Billboard (Size : in Size_t := default_Size;
Plane : in billboard.Plane;
Color : in lucid_Color;
Texture : in asset_Name) return View
is
Self : constant View := new Item;
begin
Self.define (Size);
Self.Plane := Plane;
Self.Color := Color;
Self.Texture_Name := Texture;
return Self;
end new_Billboard;
--------------
--- Attributes
--
overriding
function to_GL_Geometries (Self : access Item; Textures : access Texture.name_Map_of_texture'Class;
Fonts : in Font.font_id_Map_of_font) return Geometry.views
is
pragma unreferenced (Textures, Fonts);
use Geometry,
Geometry.colored_textured,
Texture;
the_Indices : aliased constant Indices := (1, 2, 3, 4);
the_Sites : constant billboard.Sites := vertex_Sites (Self.Plane,
Self.Width,
Self.Height);
function new_Face (Vertices : access Geometry.colored_textured.Vertex_array) return Geometry_view
is
use openGL.Primitive;
the_Geometry : constant Geometry_view := Geometry.colored_textured.new_Geometry;
the_Primitive : constant Primitive.view := Primitive.indexed.new_Primitive (triangle_Fan,
the_Indices).all'Access;
begin
the_Geometry.Vertices_are (Vertices.all);
the_Geometry.add (the_Primitive);
the_Geometry.is_Transparent;
return the_Geometry;
end new_Face;
Color : constant rgba_Color := +Self.Color;
the_Face : Geometry_view;
begin
declare
the_Vertices : constant access Geometry.colored_textured.Vertex_array := Self.Vertices;
begin
the_Vertices.all := Geometry.colored_textured.Vertex_array'
(1 => (site => the_Sites (1), color => Color, coords => (Self.texture_Coords (1))),
2 => (site => the_Sites (2), color => Color, coords => (Self.texture_Coords (2))),
3 => (site => the_Sites (3), color => Color, coords => (Self.texture_Coords (3))),
4 => (site => the_Sites (4), color => Color, coords => (Self.texture_Coords (4))));
the_Face := new_Face (Vertices => the_Vertices);
if Self.texture_Name /= null_Asset
then
Self.Texture := IO.to_Texture (Self.texture_Name);
end if;
if Self.Texture /= null_Object
then
the_Face.Texture_is (Self.Texture);
end if;
end;
Self.Geometry := the_Face;
return (1 => Geometry.view (the_Face));
end to_GL_Geometries;
procedure Color_is (Self : in out Item; Now : in lucid_Color)
is
begin
Self.Color := Now;
for i in Self.Vertices'Range
loop
Self.Vertices (i).Color := +Now;
end loop;
Self.is_Modified := True;
end Color_is;
procedure Texture_Coords_are (Self : in out Item; Now : in Coordinates)
is
begin
Self.texture_Coords := Now;
Self.needs_Rebuild := True;
end Texture_Coords_are;
overriding
procedure modify (Self : in out Item)
is
begin
Self.Geometry.Vertices_are (Self.Vertices.all);
Self.is_Modified := False;
end modify;
overriding
function is_Modified (Self : in Item) return Boolean
is
begin
return Self.is_Modified;
end is_Modified;
end openGL.Model.billboard.colored_textured;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- V A S T --
-- --
-- S p e c --
-- --
-- Copyright (C) 2020, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package is the entry point for VAST: Verifier for the Ada Semantic
-- Tree.
with Types; use Types;
package VAST is
procedure Check_Tree (GNAT_Root : Node_Id);
-- Check the validity of the given Root tree
end VAST;
|
--
-- \brief AUnit test program
-- \author Alexander Senier
-- \date 2019-01-03
--
with GNAT.IO;
with AUnit;
procedure Main is
use GNAT.IO;
begin
Put_Line ("No AUnit test, yet.");
end Main;
|
------------------------------------------------------------------------------
-- --
-- Ada User Repository Annex (AURA) --
-- Reference Implementation --
-- --
-- ------------------------------------------------------------------------ --
-- --
-- Copyright (C) 2020, ANNEXI-STRAYLINE Trans-Human Ltd. --
-- All rights reserved. --
-- --
-- Original Contributors: --
-- * Richard Wai (ANNEXI-STRAYLINE) --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- --
-- * Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A --
-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- This package handles all actions related to the AURA repositories registered
-- in a given AURA project, including checking-out subsystems, and verifying
-- previously checked-out subsystems
with Ada.Assertions;
with Ada.Strings.Unbounded;
with Ada.Containers.Vectors;
with Progress;
package Repositories is
type Repository_Count is new Natural;
subtype Repository_Index is Repository_Count
range 1 .. Repository_Count'Last;
Root_Repository: constant Repository_Index := Repository_Index'First;
-- This repository automatically exists in all AURA projects, and is used to
-- detach subsystems from any upstream repository, or to handle locally
-- created subsystems
type Repository_Format is
(System,
-- System repositories are special kinds of "local" repositories that
-- have been precompiled into a set of per-subsystem shared libraries.
--
-- The central repository location (which may not be the current
-- directory) is expected to contain .ali files for all units within
-- each subsystem, and a shared library file corresponding to each
-- subsystem in a directory named "aura_lib".
--
-- Central repositories are always cached (checked for changes). Any
-- changes must be explicitly accepted by the user for any build process
-- to succeed.
--
-- Checked-out subsystems from System repositories are formed as
-- symbolic links, and are never compiled.
--
-- Subsystems checked-out from a System repository shall not have any
-- dependencies on subsystems from any other repository. This is checked
-- after all subsystems are checked-out, so it is up to the user to
-- ensure that requisite subsystems are checkedout out from the same
-- repository, or the process will fail.
Local,
-- Local repositories are simply a directory containing some set of
-- AURA Subsystems (in their respective sub-directories).
--
-- Snapshot is a recursive SHA1 hash of all files (except "dot files") in
-- the repository path, in lexicographical order
Git);
-- A git repository. Snapshot is the full commit hash.
type Repository_Cache_State is
(Standby,
-- The repository has been loaded but has not yet been needed, hence the
-- cache state has not yet been evaluated
Requested,
-- The repository is needed to aquire some subsystems
Available);
-- Repository is cached (git), or exists and has been verified (local)
package UBS renames Ada.Strings.Unbounded;
type Repository (Format: Repository_Format := Local) is
record
Location : UBS.Unbounded_String;
Snapshot : UBS.Unbounded_String;
Cache_State : Repository_Cache_State := Standby;
Cache_Path : UBS.Unbounded_String;
-- Full path to the directory containing the repository
case Format is
when Local | System =>
null;
when Git =>
Tracking_Branch: UBS.Unbounded_String;
end case;
end record;
package Repository_Vectors is new Ada.Containers.Vectors
(Index_Type => Repository_Index,
Element_Type => Repository);
---------------------------
-- Repository Operations --
---------------------------
procedure Initialize_Repositories;
Initialize_Repositories_Tracker: aliased Progress.Progress_Tracker;
-- Shall be called after the Registrar has completed entery of the project
-- root directory
--
-- Initialize_Repositories takes the following actions:
--
-- 1. Clears the existing repository vector.
--
-- 2. Checks for the existence of the root AURA package (aura.ads).
-- - If it exists, it is checked for compatibility with this
-- implementation
-- - If it does not exist, it is generated, and then entered to the
-- Registrar.
-- * Note, the package will be inserted into the "Current Directory"
--
-- 3. Checks for all AURA.Respository_X packages, processes them,
-- and loads them into the internal list
--
-- 4. Verifies the "local" repository (Index 1), and generates the spec
-- if it does not already exist
--
-- Initialize_Repositories is a sequential operation (and generally very
-- quick), and so does not submit work orders or have a tracker.
--
-- After calling Initialize_Repositories, any invalid specifications can
-- be queried through the Repo's Valid component, and the error message
-- can be extracted from the Parse_Errors component.
--
-- The procedure Check_Repositories and it's associated tracker can be
-- used to verify
--
-- Initialize_Repositories may enter new units with the registrar.
------------------------
-- Repository Queries --
------------------------
-- The following operations are all task-safe
function Total_Repositories return Repository_Count;
function Extract_Repository (Index: Repository_Index)
return Repository;
function Extract_All return Repository_Vectors.Vector;
function Cache_State (Index: Repository_Index)
return Repository_Cache_State;
procedure Add_Repository (New_Repo : in Repository;
New_Index: out Repository_Index);
-- This also generates the associated spec file
procedure Update_Repository (Index : in Repository_Index;
Updated: in Repository);
-- The repository at index Index is replaced by Updated. And the
-- actual spec file is regenerated
procedure Request_Cache (Index: in Repository_Index);
-- Iff the current Cache is "Standby", it is set to "Requested"
private
procedure Update_Cache_State (Index : in Repository_Index;
New_State: in Repository_Cache_State);
-- Does not regenerate the spec file
procedure Generate_Repo_Spec (Index: Repository_Index);
-- Generates the corresponding Spec file for the repository at Index
-- of the All_Repositories vector. If a file already exists, it is replaced.
end Repositories;
|
-- CB2007A.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- CHECK THAT AN EXIT STATEMENT IN A HANDLER CAN TRANSFER CONTROL
-- OUT OF A LOOP.
-- DAT 4/13/81
-- RM 4/30/81
-- SPS 3/23/83
WITH REPORT; USE REPORT;
PROCEDURE CB2007A IS
BEGIN
TEST ("CB2007A", "EXIT STATEMENTS IN EXCEPTION HANDLERS");
DECLARE
FLOW_INDEX : INTEGER := 0 ;
BEGIN
FOR I IN 1 .. 10 LOOP
BEGIN
IF I = 1 THEN
RAISE CONSTRAINT_ERROR;
END IF;
FAILED ("WRONG CONTROL FLOW 1");
EXCEPTION
WHEN CONSTRAINT_ERROR => EXIT;
END;
FAILED ("WRONG CONTROL FLOW 2");
EXIT;
END LOOP;
FOR AAA IN 1..1 LOOP
FOR BBB IN 1..1 LOOP
FOR I IN 1 .. 10 LOOP
BEGIN
IF I = 1 THEN
RAISE CONSTRAINT_ERROR;
END IF;
FAILED ("WRONG CONTROL FLOW A1");
EXCEPTION
WHEN CONSTRAINT_ERROR => EXIT;
END;
FAILED ("WRONG CONTROL FLOW A2");
EXIT;
END LOOP;
FLOW_INDEX := FLOW_INDEX + 1 ;
END LOOP;
END LOOP;
LOOP1 :
FOR AAA IN 1..1 LOOP
LOOP2 :
FOR BBB IN 1..1 LOOP
LOOP3 :
FOR I IN 1 .. 10 LOOP
BEGIN
IF I = 1 THEN
RAISE CONSTRAINT_ERROR;
END IF;
FAILED ("WRONG CONTROL FLOW B1");
EXCEPTION
WHEN CONSTRAINT_ERROR => EXIT LOOP2 ;
END;
FAILED ("WRONG CONTROL FLOW B2");
EXIT LOOP2 ;
END LOOP LOOP3 ;
FAILED ("WRONG CONTROL FLOW B3");
END LOOP LOOP2 ;
FLOW_INDEX := FLOW_INDEX + 1 ;
END LOOP LOOP1 ;
IF FLOW_INDEX /= 2 THEN FAILED( "WRONG FLOW OF CONTROL" );
END IF;
END ;
RESULT;
END CB2007A;
|
------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright 2020 Thomas E. Dickey --
-- Copyright 2000 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control
-- $Revision: 1.2 $
-- Binding Version 01.00
------------------------------------------------------------------------------
procedure ncurses2.getch_test;
|
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2016, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with Bluetooth_Low_Energy.Packets; use Bluetooth_Low_Energy.Packets;
with Interfaces; use Interfaces;
package Bluetooth_Low_Energy.Beacon is
function Make_Beacon_Packet (MAC : UInt8_Array;
UUID : BLE_UUID;
Major, Minor : UInt16;
Power : Integer_8) return BLE_Packet;
end Bluetooth_Low_Energy.Beacon;
|
package Namet is
Hash_Num : constant Integer := 2**12;
subtype Hash_Index_Type is Integer range 0 .. Hash_Num - 1;
Name_Buffer : String (1 .. 16*1024);
Name_Len : Natural;
end Namet;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.Generic_Collections;
package AMF.UML.Extension_Ends.Collections is
pragma Preelaborate;
package UML_Extension_End_Collections is
new AMF.Generic_Collections
(UML_Extension_End,
UML_Extension_End_Access);
type Set_Of_UML_Extension_End is
new UML_Extension_End_Collections.Set with null record;
Empty_Set_Of_UML_Extension_End : constant Set_Of_UML_Extension_End;
type Ordered_Set_Of_UML_Extension_End is
new UML_Extension_End_Collections.Ordered_Set with null record;
Empty_Ordered_Set_Of_UML_Extension_End : constant Ordered_Set_Of_UML_Extension_End;
type Bag_Of_UML_Extension_End is
new UML_Extension_End_Collections.Bag with null record;
Empty_Bag_Of_UML_Extension_End : constant Bag_Of_UML_Extension_End;
type Sequence_Of_UML_Extension_End is
new UML_Extension_End_Collections.Sequence with null record;
Empty_Sequence_Of_UML_Extension_End : constant Sequence_Of_UML_Extension_End;
private
Empty_Set_Of_UML_Extension_End : constant Set_Of_UML_Extension_End
:= (UML_Extension_End_Collections.Set with null record);
Empty_Ordered_Set_Of_UML_Extension_End : constant Ordered_Set_Of_UML_Extension_End
:= (UML_Extension_End_Collections.Ordered_Set with null record);
Empty_Bag_Of_UML_Extension_End : constant Bag_Of_UML_Extension_End
:= (UML_Extension_End_Collections.Bag with null record);
Empty_Sequence_Of_UML_Extension_End : constant Sequence_Of_UML_Extension_End
:= (UML_Extension_End_Collections.Sequence with null record);
end AMF.UML.Extension_Ends.Collections;
|
with Ada; use Ada;
with Ada.Text_IO;
with Ada.Text_IO.Text_Streams; use Ada.Text_IO.Text_Streams;
with Ada.Streams;
with Ada.Streams.Stream_IO;
with Ada.Command_Line;
with Ada.Characters.Latin_1; use Ada.Characters.Latin_1;
with Ada.Strings.Fixed; use Ada.Strings.Fixed;
with Ada.Containers.Indefinite_Holders;
with Ada.Containers.Indefinite_Vectors;
with GNAT.Regpat;
procedure Css_Formatter is
function Current_Input return Text_IO.File_Type is
begin
return Ada.Text_IO.Current_Input;
end Current_Input;
function Current_Output return Text_IO.File_Type is
begin
return Ada.Text_IO.Current_Output;
end Current_Output;
package Text_Holder is new Ada.Containers.Indefinite_Holders (String);
use Text_Holder;
package Text_Vector is new Ada.Containers.Indefinite_Vectors
(Positive,
Character);
package Regex renames GNAT.Regpat;
use Regex;
procedure Put_Line (Text : in Holder) is
begin
Text_IO.Put_Line (Current_Output, Text.Element);
end Put_Line;
procedure Get_Line (Text : in out Holder) is
begin
Text.Assign (To_Holder (Text_IO.Get_Line (Current_Input)));
end Get_Line;
function Argument (Number : Positive) return String is
begin
if Number <= Command_Line.Argument_Count then
return Command_Line.Argument (Number => Number);
else
return "";
end if;
end Argument;
File_Too_Big : exception;
Malformed_CSS : exception;
Subject_File : Text_IO.File_Type;
Text : String (1 .. 1_000_000) := (others => Space);
First : Positive := 1;
Last : Natural := 0;
Index : Positive := 1;
Count : Natural := 0;
Indent : Natural := 0;
Not_Empty : Boolean := False;
procedure Read_File is
begin
loop
if Last < Text'Last then
Last := Last + 1;
Character'Read (Stream (Subject_File), Text (Last));
else
raise File_Too_Big;
end if;
exit when Text_IO.End_Of_File;
end loop;
end Read_File;
function Matched
(Match : Regex.Match_Location :=
(First => 1, Last => 0))
return String
is
begin
return Text (Match.First .. Match.Last);
end Matched;
-- Selector_Pattern : String :=
-- "\s*?((?:@?[a-zA-Z.#>~_-]|[[](?:"".*?""|.*?)[]]|\s*?|[(](?:[(](?:[(].*?[)]|.)*?[)]|.)*?[)])*?)\s*?";
Selector_Pattern : String :=
"\s*?((?:@?[a-zA-Z.#>~_-]|[[](?:"".*?""|.*?)[]]|\s*?|[(](?:[(](?:[(].*?[)]|.)*?[)]|.)*?[)])*?)\s*?";
-- Property_Pattern : String := "\s*?((?:[][a-zA-Z-])*)\s*?";
Property_Pattern : String := "\s*?((?:[][a-zA-Z-])*)\s*?";
-- Value_Pattern : String :=
-- "\s*?((?:[a-z]+[(].*?[)]|[a-zA-Z0-9.-]*?|"".*?""|\s*?)*)\s*?";
Value_Pattern : String :=
"\s*?((?:[a-z]+[(].*?[)]|[a-zA-Z0-9.-]*?|"".*?""|\s*?)*)\s*?";
Matches : Regex.Match_Array (0 .. 4);
Flags : Regex.Regexp_Flags :=
Regex.Case_Insensitive + Regex.Single_Line + Regex.Multiple_Lines;
Selector_Open : Regex.Pattern_Matcher :=
Regex.Compile ("^\s*" & Selector_Pattern & "\s*({)", Flags);
Selector_Close : Regex.Pattern_Matcher :=
Regex.Compile ("^\s*(})\s*", Flags);
Declaration : Regex.Pattern_Matcher :=
Regex.Compile
("\s*" & Property_Pattern & "^\s*:\s*" & Value_Pattern & "\s*;",
Flags);
function Parse_Open return Boolean is
Matches : Regex.Match_Array (0 .. 2);
begin
Regex.Match (Selector_Open, Text (First .. Last), Matches, Index);
if Regex.Match (Selector_Open, Text (First .. Last), Index)
then
--Matched (Matches (1)) /= "" and then Matched (Matches (2)) /= "";
String'Write
(Stream (Current_Output),
(Indent * HT) & Matched (Matches (1)) & " {" & LF);
Indent := Indent + 1;
Index := Matches (0).Last + 1;
return True;
else
return False;
end if;
end Parse_Open;
function Parse_Declaration return Boolean is
Matches : Regex.Match_Array (0 .. 2);
begin
Regex.Match (Declaration, Text (First .. Last), Matches, Index);
if Regex.Match (Declaration, Text (First .. Last), Index) then
String'Write
(Stream (Current_Output),
(Indent * HT) &
Matched (Matches (1)) &
": " &
Matched (Matches (2)) &
";" &
LF);
Index := Matches (0).Last + 1;
return True;
else
return False;
end if;
end Parse_Declaration;
function Parse_Close return Boolean is
Matches : Regex.Match_Array (0 .. 1);
begin
Regex.Match (Selector_Close, Text (First .. Last), Matches, Index);
if Regex.Match (Selector_Close, Text (First .. Last), Index) then
Indent := Indent - 1;
String'Write
(Stream (Current_Output),
(Indent * HT) & Matched (Matches (1)) & LF);
Index := Matches (0).Last + 1;
return True;
else
return False;
end if;
end Parse_Close;
begin
Text_IO.Open (Subject_File, Text_IO.In_File, Argument (1));
Text_IO.Set_Input (Subject_File);
Read_File;
Text_IO.Set_Input (Text_IO.Standard_Input);
Text_IO.Reset (Subject_File, Text_IO.Out_File);
Text_IO.Set_Output (Subject_File);
if Parse_Open then
null;
else
raise Malformed_CSS;
end if;
loop
if Parse_Declaration then
null;
elsif Parse_Open then
null;
elsif Parse_Close then
null;
else
Index := Index + 1;
end if;
exit when Index > Last;
end loop;
exception
when File_Too_Big =>
Text_IO.Put_Line
(Text_IO.Current_Error,
"File: " & Argument (1) & " is too big!");
end Css_Formatter;
|
-----------------------------------------------------------------------
-- util-http-clients-tests -- Unit tests for HTTP client
-- Copyright (C) 2012, 2020 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
with Util.Test_Caller;
with Util.Strings.Transforms;
with Util.Http.Tools;
with Util.Strings;
with Util.Log.Loggers;
package body Util.Http.Clients.Tests is
-- The logger
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Util.Http.Clients.Tests");
package body Http_Tests is
package Caller is new Util.Test_Caller (Http_Test, "Http-" & NAME);
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is
begin
Caller.Add_Test (Suite, "Test Util.Http.Clients." & NAME & ".Get",
Test_Http_Get'Access);
Caller.Add_Test (Suite, "Test Util.Http.Clients." & NAME & ".Head",
Test_Http_Head'Access);
Caller.Add_Test (Suite, "Test Util.Http.Clients." & NAME & ".Post",
Test_Http_Post'Access);
Caller.Add_Test (Suite, "Test Util.Http.Clients." & NAME & ".Put",
Test_Http_Put'Access);
Caller.Add_Test (Suite, "Test Util.Http.Clients." & NAME & ".Delete",
Test_Http_Delete'Access);
Caller.Add_Test (Suite, "Test Util.Http.Clients." & NAME & ".Options",
Test_Http_Options'Access);
Caller.Add_Test (Suite, "Test Util.Http.Clients." & NAME & ".Patch",
Test_Http_Patch'Access);
Caller.Add_Test (Suite, "Test Util.Http.Clients." & NAME & ".Get (timeout)",
Test_Http_Timeout'Access);
end Add_Tests;
overriding
procedure Set_Up (T : in out Http_Test) is
begin
Test (T).Set_Up;
Register;
end Set_Up;
end Http_Tests;
overriding
procedure Set_Up (T : in out Test) is
begin
Log.Info ("Starting test server");
T.Server := new Test_Server;
T.Server.Start;
end Set_Up;
overriding
procedure Tear_Down (T : in out Test) is
procedure Free is
new Ada.Unchecked_Deallocation (Object => Test_Server'Class,
Name => Test_Server_Access);
begin
if T.Server /= null then
Log.Info ("Stopping test server");
T.Server.Stop;
Free (T.Server);
T.Server := null;
end if;
end Tear_Down;
-- ------------------------------
-- Process the line received by the server.
-- ------------------------------
overriding
procedure Process_Line (Into : in out Test_Server;
Line : in Ada.Strings.Unbounded.Unbounded_String;
Stream : in out Util.Streams.Texts.Reader_Stream'Class;
Client : in out Util.Streams.Sockets.Socket_Stream'Class) is
L : constant String := Ada.Strings.Unbounded.To_String (Line);
Pos : Natural := Util.Strings.Index (L, ' ');
begin
if Pos > 0 and Into.Method = UNKNOWN then
if L (L'First .. Pos - 1) = "GET" then
Into.Method := GET;
elsif L (L'First .. Pos - 1) = "HEAD" then
Into.Method := HEAD;
elsif L (L'First .. Pos - 1) = "POST" then
Into.Method := POST;
elsif L (L'First .. Pos - 1) = "PUT" then
Into.Method := PUT;
elsif L (L'First .. Pos - 1) = "DELETE" then
Into.Method := DELETE;
elsif L (L'First .. Pos - 1) = "OPTIONS" then
Into.Method := OPTIONS;
elsif L (L'First .. Pos - 1) = "PATCH" then
Into.Method := PATCH;
else
Into.Method := UNKNOWN;
end if;
end if;
Pos := Util.Strings.Index (L, ':');
if Pos > 0 then
if L (L'First .. Pos) = "Content-Type:" then
Into.Content_Type
:= Ada.Strings.Unbounded.To_Unbounded_String (L (Pos + 2 .. L'Last - 2));
elsif L (L'First .. Pos) = "Content-Length:" then
Into.Length := Natural'Value (L (Pos + 1 .. L'Last - 2));
end if;
end if;
-- Don't answer if we check the timeout.
if Into.Test_Timeout then
return;
end if;
if L'Length = 2 and then Into.Length > 0 then
for I in 1 .. Into.Length loop
declare
C : Character;
begin
Stream.Read (C);
Ada.Strings.Unbounded.Append (Into.Result, C);
end;
end loop;
declare
Output : Util.Streams.Texts.Print_Stream;
begin
Output.Initialize (Client'Unchecked_Access);
Output.Write ("HTTP/1.1 200 Found" & ASCII.CR & ASCII.LF);
Output.Write ("Content-Length: 4" & ASCII.CR & ASCII.LF);
Output.Write (ASCII.CR & ASCII.LF);
Output.Write ("OK" & ASCII.CR & ASCII.LF);
Output.Flush;
end;
elsif L'Length = 2 then
declare
Output : Util.Streams.Texts.Print_Stream;
begin
Output.Initialize (Client'Unchecked_Access);
Output.Write ("HTTP/1.1 204 No Content" & ASCII.CR & ASCII.LF);
Output.Write (ASCII.CR & ASCII.LF);
Output.Flush;
end;
end if;
Log.Info ("Received: {0}", L);
end Process_Line;
-- ------------------------------
-- Get the test server base URI.
-- ------------------------------
function Get_Uri (T : in Test) return String is
begin
return "http://" & T.Server.Get_Host & ":" & Util.Strings.Image (T.Server.Get_Port);
end Get_Uri;
-- ------------------------------
-- Test the http Get operation.
-- ------------------------------
procedure Test_Http_Get (T : in out Test) is
Request : Client;
Reply : Response;
begin
Request.Get ("http://www.google.com", Reply);
Request.Set_Timeout (5.0);
T.Assert (Reply.Get_Status = 200 or Reply.Get_Status = 302,
"Get status is invalid: " & Natural'Image (Reply.Get_Status));
Util.Http.Tools.Save_Response (Util.Tests.Get_Test_Path ("http_get.txt"), Reply, True);
-- Check the content.
declare
Content : constant String := Util.Strings.Transforms.To_Lower_Case (Reply.Get_Body);
begin
Util.Tests.Assert_Matches (T, ".*html.*", Content, "Invalid GET content");
end;
T.Assert (Reply.Contains_Header ("Content-Type"), "Header Content-Type not found");
T.Assert (not Reply.Contains_Header ("Content-Type-Invalid-Missing"),
"Some invalid header found");
-- Check one header.
declare
Content : constant String := Reply.Get_Header ("Content-Type");
begin
T.Assert (Content'Length > 0, "Empty Content-Type header");
Util.Tests.Assert_Matches (T, ".*text/html.*", Content, "Invalid content type");
end;
end Test_Http_Get;
-- ------------------------------
-- Test the http HEAD operation.
-- ------------------------------
procedure Test_Http_Head (T : in out Test) is
Request : Client;
Reply : Response;
begin
Request.Head ("http://www.google.com", Reply);
Request.Set_Timeout (5.0);
T.Assert (Reply.Get_Status = 200 or Reply.Get_Status = 302,
"Get status is invalid: " & Natural'Image (Reply.Get_Status));
Util.Http.Tools.Save_Response (Util.Tests.Get_Test_Path ("http_head.txt"), Reply, True);
T.Assert (Reply.Contains_Header ("Content-Type"), "Header Content-Type not found");
T.Assert (not Reply.Contains_Header ("Content-Type-Invalid-Missing"),
"Some invalid header found");
-- Check one header.
declare
Content : constant String := Reply.Get_Header ("Content-Type");
begin
T.Assert (Content'Length > 0, "Empty Content-Type header");
Util.Tests.Assert_Matches (T, ".*text/html.*", Content, "Invalid content type");
end;
end Test_Http_Head;
-- ------------------------------
-- Test the http POST operation.
-- ------------------------------
procedure Test_Http_Post (T : in out Test) is
Request : Client;
Reply : Response;
Uri : constant String := T.Get_Uri;
begin
Log.Info ("Post on " & Uri);
T.Server.Method := UNKNOWN;
Request.Post (Uri & "/post",
"p1=1", Reply);
T.Assert (T.Server.Method = POST, "Invalid method received by server");
Util.Tests.Assert_Equals (T, "application/x-www-form-urlencoded", T.Server.Content_Type,
"Invalid content type received by server");
Util.Tests.Assert_Equals (T, "OK" & ASCII.CR & ASCII.LF, Reply.Get_Body, "Invalid response");
Util.Http.Tools.Save_Response (Util.Tests.Get_Test_Path ("http_post.txt"), Reply, True);
end Test_Http_Post;
-- ------------------------------
-- Test the http PUT operation.
-- ------------------------------
procedure Test_Http_Put (T : in out Test) is
Request : Client;
Reply : Response;
Uri : constant String := T.Get_Uri;
begin
Log.Info ("Put on " & Uri);
T.Server.Method := UNKNOWN;
Request.Add_Header ("Content-Type", "application/x-www-form-urlencoded");
Request.Set_Timeout (1.0);
T.Assert (Request.Contains_Header ("Content-Type"), "Missing Content-Type");
Request.Put (Uri & "/put",
"p1=1", Reply);
T.Assert (T.Server.Method = PUT, "Invalid method received by server");
Util.Tests.Assert_Equals (T, "application/x-www-form-urlencoded", T.Server.Content_Type,
"Invalid content type received by server");
Util.Tests.Assert_Equals (T, "OK" & ASCII.CR & ASCII.LF, Reply.Get_Body, "Invalid response");
Util.Http.Tools.Save_Response (Util.Tests.Get_Test_Path ("http_put.txt"), Reply, True);
end Test_Http_Put;
-- ------------------------------
-- Test the http DELETE operation.
-- ------------------------------
procedure Test_Http_Delete (T : in out Test) is
Request : Client;
Reply : Response;
Uri : constant String := T.Get_Uri;
begin
Log.Info ("Delete on " & Uri);
T.Server.Method := UNKNOWN;
Request.Add_Header ("Content-Type", "application/x-www-form-urlencoded");
Request.Set_Timeout (1.0);
T.Assert (Request.Contains_Header ("Content-Type"), "Missing Content-Type");
Request.Delete (Uri & "/delete", Reply);
T.Assert (T.Server.Method = DELETE, "Invalid method received by server");
Util.Tests.Assert_Equals (T, "application/x-www-form-urlencoded", T.Server.Content_Type,
"Invalid content type received by server");
Util.Tests.Assert_Equals (T, "", Reply.Get_Body, "Invalid response");
Util.Tests.Assert_Equals (T, 204, Reply.Get_Status, "Invalid status response");
end Test_Http_Delete;
-- ------------------------------
-- Test the http OPTIONS operation.
-- ------------------------------
procedure Test_Http_Options (T : in out Test) is
Request : Client;
Reply : Response;
Uri : constant String := T.Get_Uri;
begin
Log.Info ("Delete on " & Uri);
T.Server.Method := UNKNOWN;
Request.Add_Header ("Content-Type", "application/x-www-form-urlencoded");
Request.Set_Timeout (1.0);
T.Assert (Request.Contains_Header ("Content-Type"), "Missing Content-Type");
Request.Options (Uri & "/options", Reply);
T.Assert (T.Server.Method = OPTIONS, "Invalid method received by server");
Util.Tests.Assert_Equals (T, "application/x-www-form-urlencoded", T.Server.Content_Type,
"Invalid content type received by server");
Util.Tests.Assert_Equals (T, "", Reply.Get_Body, "Invalid response");
Util.Tests.Assert_Equals (T, 204, Reply.Get_Status, "Invalid status response");
end Test_Http_Options;
-- ------------------------------
-- Test the http PATCH operation.
-- ------------------------------
procedure Test_Http_Patch (T : in out Test) is
Request : Client;
Reply : Response;
Uri : constant String := T.Get_Uri;
begin
Log.Info ("Patch on " & Uri);
T.Server.Method := UNKNOWN;
Request.Add_Header ("Content-Type", "application/x-www-form-urlencoded");
Request.Set_Timeout (1.0);
T.Assert (Request.Contains_Header ("Content-Type"), "Missing Content-Type");
Request.Patch (Uri & "/patch", "patch-content", Reply);
T.Assert (T.Server.Method = PATCH, "Invalid method received by server");
Util.Tests.Assert_Equals (T, "application/x-www-form-urlencoded", T.Server.Content_Type,
"Invalid content type received by server");
Util.Tests.Assert_Equals (T, 200, Reply.Get_Status, "Invalid status response");
Util.Tests.Assert_Equals (T, "OK" & ASCII.CR & ASCII.LF, Reply.Get_Body, "Invalid response");
end Test_Http_Patch;
-- ------------------------------
-- Test the http timeout.
-- ------------------------------
procedure Test_Http_Timeout (T : in out Test) is
Request : Client;
Reply : Response;
Uri : constant String := T.Get_Uri;
begin
Log.Info ("Timeout on " & Uri);
T.Server.Test_Timeout := True;
T.Server.Method := UNKNOWN;
Request.Set_Timeout (0.5);
begin
Request.Get (Uri & "/timeout", Reply);
T.Fail ("No Connection_Error exception raised");
exception
when Connection_Error =>
null;
end;
end Test_Http_Timeout;
end Util.Http.Clients.Tests;
|
-- Standard Ada library specification
-- Copyright (c) 2003-2018 Maxim Reznik <reznikmm@gmail.com>
-- Copyright (c) 2004-2016 AXE Consultants
-- Copyright (c) 2004, 2005, 2006 Ada-Europe
-- Copyright (c) 2000 The MITRE Corporation, Inc.
-- Copyright (c) 1992, 1993, 1994, 1995 Intermetrics, Inc.
-- SPDX-License-Identifier: BSD-3-Clause and LicenseRef-AdaReferenceManual
---------------------------------------------------------------------------
with Ada.Iterator_Interfaces;
generic
type Element_Type (<>) is private;
with function "=" (Left, Right : Element_Type)
return Boolean is <>;
package Ada.Containers.Indefinite_Doubly_Linked_Lists is
pragma Preelaborate(Indefinite_Doubly_Linked_Lists);
pragma Remote_Types(Indefinite_Doubly_Linked_Lists);
type List is tagged private
with Constant_Indexing => Constant_Reference,
Variable_Indexing => Reference,
Default_Iterator => Iterate,
Iterator_Element => Element_Type;
pragma Preelaborable_Initialization(List);
type Cursor is private;
pragma Preelaborable_Initialization(Cursor);
Empty_List : constant List;
No_Element : constant Cursor;
function Has_Element (Position : Cursor) return Boolean;
package List_Iterator_Interfaces is new
Ada.Iterator_Interfaces (Cursor, Has_Element);
function "=" (Left, Right : List) return Boolean;
function Length (Container : List) return Count_Type;
function Is_Empty (Container : List) return Boolean;
procedure Clear (Container : in out List);
function Element (Position : Cursor)
return Element_Type;
procedure Replace_Element (Container : in out List;
Position : in Cursor;
New_Item : in Element_Type);
procedure Query_Element
(Position : in Cursor;
Process : not null access procedure (Element : in Element_Type));
procedure Update_Element
(Container : in out List;
Position : in Cursor;
Process : not null access procedure
(Element : in out Element_Type));
type Constant_Reference_Type
(Element : not null access constant Element_Type) is private
with Implicit_Dereference => Element;
type Reference_Type (Element : not null access Element_Type) is private
with Implicit_Dereference => Element;
function Constant_Reference (Container : aliased in List;
Position : in Cursor)
return Constant_Reference_Type;
function Reference (Container : aliased in out List;
Position : in Cursor)
return Reference_Type;
procedure Assign (Target : in out List; Source : in List);
function Copy (Source : List) return List;
procedure Move (Target : in out List;
Source : in out List);
procedure Insert (Container : in out List;
Before : in Cursor;
New_Item : in Element_Type;
Count : in Count_Type := 1);
procedure Insert (Container : in out List;
Before : in Cursor;
New_Item : in Element_Type;
Position : out Cursor;
Count : in Count_Type := 1);
procedure Insert (Container : in out List;
Before : in Cursor;
Position : out Cursor;
Count : in Count_Type := 1);
procedure Prepend (Container : in out List;
New_Item : in Element_Type;
Count : in Count_Type := 1);
procedure Append (Container : in out List;
New_Item : in Element_Type;
Count : in Count_Type := 1);
procedure Delete (Container : in out List;
Position : in out Cursor;
Count : in Count_Type := 1);
procedure Delete_First (Container : in out List;
Count : in Count_Type := 1);
procedure Delete_Last (Container : in out List;
Count : in Count_Type := 1);
procedure Reverse_Elements (Container : in out List);
procedure Swap (Container : in out List;
I, J : in Cursor);
procedure Swap_Links (Container : in out List;
I, J : in Cursor);
procedure Splice (Target : in out List;
Before : in Cursor;
Source : in out List);
procedure Splice (Target : in out List;
Before : in Cursor;
Source : in out List;
Position : in out Cursor);
procedure Splice (Container: in out List;
Before : in Cursor;
Position : in Cursor);
function First (Container : List) return Cursor;
function First_Element (Container : List)
return Element_Type;
function Last (Container : List) return Cursor;
function Last_Element (Container : List)
return Element_Type;
function Next (Position : Cursor) return Cursor;
function Previous (Position : Cursor) return Cursor;
procedure Next (Position : in out Cursor);
procedure Previous (Position : in out Cursor);
function Find (Container : List;
Item : Element_Type;
Position : Cursor := No_Element)
return Cursor;
function Reverse_Find (Container : List;
Item : Element_Type;
Position : Cursor := No_Element)
return Cursor;
function Contains (Container : List;
Item : Element_Type) return Boolean;
procedure Iterate
(Container : in List;
Process : not null access procedure (Position : in Cursor));
procedure Reverse_Iterate
(Container : in List;
Process : not null access procedure (Position : in Cursor));
function Iterate (Container : in List)
return List_Iterator_Interfaces.Reversible_Iterator'Class;
function Iterate (Container : in List; Start : in Cursor)
return List_Iterator_Interfaces.Reversible_Iterator'Class;
generic
with function "<" (Left, Right : Element_Type)
return Boolean is <>;
package Generic_Sorting is
function Is_Sorted (Container : List) return Boolean;
procedure Sort (Container : in out List);
procedure Merge (Target : in out List;
Source : in out List);
end Generic_Sorting;
private
-- not specified by the language
end Ada.Containers.Indefinite_Doubly_Linked_Lists;
|
------------------------------------------------------------------------------
-- --
-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . O S _ I N T E R F A C E --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 1997-2001 Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNARL; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This is a OpenNT/Interix (FSU THREADS) version of this package.
-- This package encapsulates all direct interfaces to OS services
-- that are needed by children of System.
-- PLEASE DO NOT add any with-clauses to this package
-- or remove the pragma Elaborate_Body.
-- It is designed to be a bottom-level (leaf) package.
with Interfaces.C;
package System.OS_Interface is
pragma Preelaborate;
pragma Linker_Options ("-lgthreads");
pragma Linker_Options ("-lmalloc");
subtype int is Interfaces.C.int;
subtype short is Interfaces.C.short;
subtype long is Interfaces.C.long;
subtype unsigned is Interfaces.C.unsigned;
subtype unsigned_short is Interfaces.C.unsigned_short;
subtype unsigned_long is Interfaces.C.unsigned_long;
subtype unsigned_char is Interfaces.C.unsigned_char;
subtype plain_char is Interfaces.C.plain_char;
subtype size_t is Interfaces.C.size_t;
-----------
-- Errno --
-----------
function errno return int;
pragma Import (C, errno, "__get_errno");
EAGAIN : constant := 11;
EINTR : constant := 4;
EINVAL : constant := 22;
ENOMEM : constant := 12;
ETIMEDOUT : constant := 60;
-------------
-- Signals --
-------------
Max_Interrupt : constant := 31;
type Signal is new int range 0 .. Max_Interrupt;
for Signal'Size use int'Size;
SIGHUP : constant := 1; -- hangup
SIGINT : constant := 2; -- interrupt (rubout)
SIGQUIT : constant := 3; -- quit (ASCD FS)
SIGILL : constant := 4; -- illegal instruction (not reset)
SIGTRAP : constant := 5; -- trace trap (not reset)
SIGIOT : constant := 6; -- IOT instruction
SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future
SIGEMT : constant := 0; -- EMT instruction
SIGFPE : constant := 8; -- floating point exception
SIGKILL : constant := 9; -- kill (cannot be caught or ignored)
SIGBUS : constant := 10; -- bus error
SIGSEGV : constant := 11; -- segmentation violation
SIGSYS : constant := 12; -- bad argument to system call
SIGPIPE : constant := 13; -- write on a pipe with no one to read it
SIGALRM : constant := 14; -- alarm clock
SIGTERM : constant := 15; -- software termination signal from kill
SIGUSR1 : constant := 16; -- user defined signal 1
SIGUSR2 : constant := 17; -- user defined signal 2
SIGCLD : constant := 18; -- alias for SIGCHLD
SIGCHLD : constant := 18; -- child status change
SIGPWR : constant := 0; -- power-fail restart
SIGWINCH : constant := 20; -- window size change
SIGURG : constant := 21; -- urgent condition on IO channel
SIGPOLL : constant := 22; -- pollable event occurred
SIGIO : constant := 19; -- I/O possible (Solaris SIGPOLL alias)
SIGSTOP : constant := 23; -- stop (cannot be caught or ignored)
SIGTSTP : constant := 24; -- user stop requested from tty
SIGCONT : constant := 25; -- stopped process has been continued
SIGTTIN : constant := 26; -- background tty read attempted
SIGTTOU : constant := 27; -- background tty write attempted
SIGVTALRM : constant := 28; -- virtual timer expired
SIGPROF : constant := 29; -- profiling timer expired
SIGXCPU : constant := 30; -- CPU time limit exceeded
SIGXFSZ : constant := 31; -- filesize limit exceeded
SIGADAABORT : constant := SIGABRT;
type Signal_Set is array (Natural range <>) of Signal;
Unmasked : constant Signal_Set :=
(SIGTRAP, SIGALRM, SIGVTALRM, SIGTTIN, SIGTTOU, SIGTSTP, SIGPROF);
Reserved : constant Signal_Set := (SIGKILL, SIGSTOP);
type sigset_t is private;
function sigaddset (set : access sigset_t; sig : Signal) return int;
pragma Import (C, sigaddset, "sigaddset");
function sigdelset (set : access sigset_t; sig : Signal) return int;
pragma Import (C, sigdelset, "sigdelset");
function sigfillset (set : access sigset_t) return int;
pragma Import (C, sigfillset, "sigfillset");
function sigismember (set : access sigset_t; sig : Signal) return int;
pragma Import (C, sigismember, "sigismember");
function sigemptyset (set : access sigset_t) return int;
pragma Import (C, sigemptyset, "sigemptyset");
type struct_sigaction is record
sa_handler : System.Address;
sa_mask : sigset_t;
sa_flags : int;
sa_restorer : System.Address;
end record;
pragma Convention (C, struct_sigaction);
type struct_sigaction_ptr is access all struct_sigaction;
SIG_BLOCK : constant := 1;
SIG_UNBLOCK : constant := 2;
SIG_SETMASK : constant := 3;
SIG_DFL : constant := 0;
SIG_IGN : constant := 1;
function sigaction
(sig : Signal;
act : struct_sigaction_ptr;
oact : struct_sigaction_ptr) return int;
-- FSU pthreads redefines sigaction and then uses a special syscall
-- API to call the system version. Doing syscalls on OpenNT is very
-- difficult, so we rename the pthread version instead.
pragma Import (C, sigaction, "pthread_wrapper_sigaction");
----------
-- Time --
----------
Time_Slice_Supported : constant Boolean := False;
-- Indicates wether time slicing is supported (i.e FSU threads have been
-- compiled with DEF_RR)
type timespec is private;
type clockid_t is private;
CLOCK_REALTIME : constant clockid_t;
function clock_gettime
(clock_id : clockid_t;
tp : access timespec) return int;
pragma Import (C, clock_gettime, "clock_gettime");
function To_Duration (TS : timespec) return Duration;
pragma Inline (To_Duration);
function To_Timespec (D : Duration) return timespec;
pragma Inline (To_Timespec);
type struct_timeval is private;
function To_Duration (TV : struct_timeval) return Duration;
pragma Inline (To_Duration);
function To_Timeval (D : Duration) return struct_timeval;
pragma Inline (To_Timeval);
-------------------------
-- Priority Scheduling --
-------------------------
SCHED_FIFO : constant := 0;
SCHED_RR : constant := 1;
SCHED_OTHER : constant := 2;
-------------
-- Process --
-------------
type pid_t is private;
function kill (pid : pid_t; sig : Signal) return int;
pragma Import (C, kill, "kill");
function getpid return pid_t;
pragma Import (C, getpid, "getpid");
---------
-- LWP --
---------
function lwp_self return System.Address;
-- lwp_self does not exist on this thread library, revert to pthread_self
-- which is the closest approximation (with getpid). This function is
-- needed to share 7staprop.adb across POSIX-like targets.
pragma Import (C, lwp_self, "pthread_self");
-------------
-- Threads --
-------------
type Thread_Body is access
function (arg : System.Address) return System.Address;
type pthread_t is private;
subtype Thread_Id is pthread_t;
type pthread_mutex_t is limited private;
type pthread_cond_t is limited private;
type pthread_attr_t is limited private;
type pthread_mutexattr_t is limited private;
type pthread_condattr_t is limited private;
type pthread_key_t is private;
PTHREAD_CREATE_DETACHED : constant := 1;
PTHREAD_CREATE_JOINABLE : constant := 0;
-----------
-- Stack --
-----------
Stack_Base_Available : constant Boolean := False;
-- Indicates wether the stack base is available on this target.
-- This allows us to share s-osinte.adb between all the FSU run time.
-- Note that this value can only be true if pthread_t has a complete
-- definition that corresponds exactly to the C header files.
function Get_Stack_Base (thread : pthread_t) return Address;
pragma Inline (Get_Stack_Base);
-- returns the stack base of the specified thread.
-- Only call this function when Stack_Base_Available is True.
function Get_Page_Size return size_t;
function Get_Page_Size return Address;
pragma Import (C, Get_Page_Size, "getpagesize");
-- returns the size of a page, or 0 if this is not relevant on this
-- target
PROT_NONE : constant := 0;
PROT_READ : constant := 1;
PROT_WRITE : constant := 2;
PROT_EXEC : constant := 4;
PROT_ALL : constant := PROT_READ + PROT_WRITE + PROT_EXEC;
PROT_ON : constant := PROT_NONE;
PROT_OFF : constant := PROT_ALL;
function mprotect (addr : Address; len : size_t; prot : int) return int;
pragma Import (C, mprotect);
---------------------------------------
-- Nonstandard Thread Initialization --
---------------------------------------
procedure pthread_init;
-- FSU_THREADS requires pthread_init, which is nonstandard
-- and this should be invoked during the elaboration of s-taprop.adb
pragma Import (C, pthread_init, "pthread_init");
-------------------------
-- POSIX.1c Section 3 --
-------------------------
function sigwait
(set : access sigset_t;
sig : access Signal) return int;
-- FSU_THREADS has a nonstandard sigwait
function pthread_kill
(thread : pthread_t;
sig : Signal) return int;
pragma Import (C, pthread_kill, "pthread_kill");
type sigset_t_ptr is access all sigset_t;
function pthread_sigmask
(how : int;
set : sigset_t_ptr;
oset : sigset_t_ptr) return int;
pragma Import (C, pthread_sigmask, "pthread_wrapper_sigprocmask");
--------------------------
-- POSIX.1c Section 11 --
--------------------------
function pthread_mutexattr_init
(attr : access pthread_mutexattr_t) return int;
pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init");
function pthread_mutexattr_destroy
(attr : access pthread_mutexattr_t) return int;
pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy");
function pthread_mutex_init
(mutex : access pthread_mutex_t;
attr : access pthread_mutexattr_t) return int;
pragma Import (C, pthread_mutex_init, "pthread_mutex_init");
function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int;
pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy");
function pthread_mutex_lock (mutex : access pthread_mutex_t) return int;
-- FSU_THREADS has nonstandard pthread_mutex_lock
function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int;
-- FSU_THREADS has nonstandard pthread_mutex_lock
function pthread_condattr_init
(attr : access pthread_condattr_t) return int;
pragma Import (C, pthread_condattr_init, "pthread_condattr_init");
function pthread_condattr_destroy
(attr : access pthread_condattr_t) return int;
pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy");
function pthread_cond_init
(cond : access pthread_cond_t;
attr : access pthread_condattr_t) return int;
pragma Import (C, pthread_cond_init, "pthread_cond_init");
function pthread_cond_destroy (cond : access pthread_cond_t) return int;
pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy");
function pthread_cond_signal (cond : access pthread_cond_t) return int;
pragma Import (C, pthread_cond_signal, "pthread_cond_signal");
function pthread_cond_wait
(cond : access pthread_cond_t;
mutex : access pthread_mutex_t) return int;
-- FSU_THREADS has a nonstandard pthread_cond_wait
function pthread_cond_timedwait
(cond : access pthread_cond_t;
mutex : access pthread_mutex_t;
abstime : access timespec) return int;
-- FSU_THREADS has a nonstandard pthread_cond_timedwait
Relative_Timed_Wait : constant Boolean := False;
-- pthread_cond_timedwait requires an absolute delay time
--------------------------
-- POSIX.1c Section 13 --
--------------------------
PTHREAD_PRIO_NONE : constant := 0;
PTHREAD_PRIO_PROTECT : constant := 2;
PTHREAD_PRIO_INHERIT : constant := 1;
function pthread_mutexattr_setprotocol
(attr : access pthread_mutexattr_t;
protocol : int) return int;
pragma Import (C, pthread_mutexattr_setprotocol);
function pthread_mutexattr_setprioceiling
(attr : access pthread_mutexattr_t;
prioceiling : int) return int;
pragma Import
(C, pthread_mutexattr_setprioceiling,
"pthread_mutexattr_setprio_ceiling");
type struct_sched_param is record
sched_priority : int; -- scheduling priority
end record;
function pthread_setschedparam
(thread : pthread_t;
policy : int;
param : access struct_sched_param) return int;
-- FSU_THREADS does not have pthread_setschedparam
function pthread_attr_setscope
(attr : access pthread_attr_t;
contentionscope : int) return int;
pragma Import (C, pthread_attr_setscope, "pthread_attr_setscope");
function pthread_attr_setinheritsched
(attr : access pthread_attr_t;
inheritsched : int) return int;
pragma Import (C, pthread_attr_setinheritsched);
function pthread_attr_setschedpolicy
(attr : access pthread_attr_t;
policy : int) return int;
pragma Import
(C, pthread_attr_setschedpolicy, "pthread_attr_setsched");
function sched_yield return int;
-- FSU_THREADS does not have sched_yield;
---------------------------
-- P1003.1c - Section 16 --
---------------------------
function pthread_attr_init (attributes : access pthread_attr_t) return int;
pragma Import (C, pthread_attr_init, "pthread_attr_init");
function pthread_attr_destroy
(attributes : access pthread_attr_t) return int;
pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy");
function pthread_attr_setdetachstate
(attr : access pthread_attr_t;
detachstate : int) return int;
-- FSU_THREADS has a nonstandard pthread_attr_setdetachstate
function pthread_attr_setstacksize
(attr : access pthread_attr_t;
stacksize : size_t) return int;
pragma Import (C, pthread_attr_setstacksize);
function pthread_create
(thread : access pthread_t;
attributes : access pthread_attr_t;
start_routine : Thread_Body;
arg : System.Address) return int;
pragma Import (C, pthread_create, "pthread_create");
procedure pthread_exit (status : System.Address);
pragma Import (C, pthread_exit, "pthread_exit");
function pthread_self return pthread_t;
pragma Import (C, pthread_self, "pthread_self");
--------------------------
-- POSIX.1c Section 17 --
--------------------------
function pthread_setspecific
(key : pthread_key_t;
value : System.Address) return int;
pragma Import (C, pthread_setspecific, "pthread_setspecific");
function pthread_getspecific (key : pthread_key_t) return System.Address;
-- FSU_THREADS has a nonstandard pthread_getspecific
type destructor_pointer is access procedure (arg : System.Address);
function pthread_key_create
(key : access pthread_key_t;
destructor : destructor_pointer) return int;
pragma Import (C, pthread_key_create, "pthread_key_create");
private
type sigset_t is new unsigned_long;
pragma Convention (C, sigset_t);
type pid_t is new int;
subtype time_t is long;
type timespec is record
tv_sec : time_t;
tv_nsec : long;
end record;
pragma Convention (C, timespec);
type clockid_t is new int;
CLOCK_REALTIME : constant clockid_t := 0;
type struct_timeval is record
tv_sec : time_t;
tv_usec : long;
end record;
pragma Convention (C, struct_timeval);
type pthread_attr_t is record
flags : int;
stacksize : int;
contentionscope : int;
inheritsched : int;
detachstate : int;
sched : int;
prio : int;
starttime : timespec;
deadline : timespec;
period : timespec;
end record;
pragma Convention (C_Pass_By_Copy, pthread_attr_t);
type pthread_condattr_t is record
flags : int;
end record;
pragma Convention (C, pthread_condattr_t);
type pthread_mutexattr_t is record
flags : int;
prio_ceiling : int;
protocol : int;
end record;
pragma Convention (C, pthread_mutexattr_t);
type sigjmp_buf is array (Integer range 0 .. 17) of int;
type pthread_t_struct is record
context : sigjmp_buf;
pbody : sigjmp_buf;
errno : int;
ret : int;
stack_base : System.Address;
end record;
pragma Convention (C, pthread_t_struct);
type pthread_t is access all pthread_t_struct;
type queue_t is record
head : System.Address;
tail : System.Address;
end record;
pragma Convention (C, queue_t);
type pthread_mutex_t is record
queue : queue_t;
lock : plain_char;
owner : System.Address;
flags : int;
prio_ceiling : int;
protocol : int;
prev_max_ceiling_prio : int;
end record;
pragma Convention (C, pthread_mutex_t);
type pthread_cond_t is record
queue : queue_t;
flags : int;
waiters : int;
mutex : System.Address;
end record;
pragma Convention (C, pthread_cond_t);
type pthread_key_t is new int;
end System.OS_Interface;
|
------------------------------------------------------------------------------
-- Copyright (c) 2016, Natacha Porté --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
with Ada.Calendar;
with Ada.Directories;
with Ada.Streams.Stream_IO;
with Ada.Strings.Fixed;
with Ada.IO_Exceptions;
with AWS.Messages;
with AWS.MIME;
with AWS.Parameters;
with AWS.Response.Set;
with Natools.File_Streams;
with Natools.GNAT_HMAC.SHA256;
with Natools.S_Expressions.Atom_Ref_Constructors;
with Natools.S_Expressions.Encodings;
with Natools.S_Expressions.File_Readers;
with Natools.S_Expressions.File_Writers;
with Natools.S_Expressions.Interpreter_Loop;
with Natools.S_Expressions.Printers.Pretty.Config;
with Natools.Time_IO.RFC_3339;
with Simple_Webapps.Commands.Append_Servers;
with Templates_Parser;
package body Simple_Webapps.Append_Servers is
package Commands renames Simple_Webapps.Commands.Append_Servers;
package Constructors renames Natools.S_Expressions.Atom_Ref_Constructors;
package HMAC renames Natools.GNAT_HMAC.SHA256;
function Simple_Response
(Code : AWS.Messages.Status_Code;
Template : String := "";
Location : String := "";
Allow : String := "")
return AWS.Response.Data;
procedure Set
(State : in out Endpoint;
Context : in String;
Name : in Sx.Atom;
Arguments : in out Sx.Lockable.Descriptor'Class);
procedure Set
(State : in out Endpoint_Maps.Unsafe_Maps.Map;
Context : in Sx.Printers.Pretty.Parameters;
Name : in Sx.Atom;
Arguments : in out Sx.Lockable.Descriptor'Class);
procedure Set
(State : in out Server_Data;
Context : in String;
Name : in Sx.Atom;
Arguments : in out Sx.Lockable.Descriptor'Class);
procedure Interpreter is new Sx.Interpreter_Loop
(Endpoint, String, Set);
procedure Interpreter is new Sx.Interpreter_Loop
(Endpoint_Maps.Unsafe_Maps.Map, Sx.Printers.Pretty.Parameters, Set);
procedure Interpreter is new Sx.Interpreter_Loop
(Server_Data, String, Set);
------------------------
-- Execution Endpoint --
------------------------
procedure Append_Data
(Self : in Endpoint;
Data : in Sx.Atom)
is
function Open_File (Name : String)
return Natools.File_Streams.File_Stream;
function Open_File (Name : String)
return Natools.File_Streams.File_Stream is
begin
return Natools.File_Streams.Open
(Ada.Streams.Stream_IO.Append_File, Name);
exception
when Ada.IO_Exceptions.Name_Error =>
return Natools.File_Streams.Create
(Ada.Streams.Stream_IO.Append_File, Name);
end Open_File;
File : Natools.File_Streams.File_Stream
:= Open_File (To_String (Self.Data_Path));
begin
File.Write (Data);
end Append_Data;
procedure Log_Invalid
(Self : in Endpoint;
Data : in Sx.Atom;
Given_Signature : in Sx.Atom;
Expected_Signature : in Sx.Atom) is
begin
if To_String (Self.Invalid_Log) = "" then
Log ("Invalid signature for data posted to "
& To_String (Self.Data_Path));
return;
end if;
declare
Log_File : Sx.File_Writers.Writer
:= Sx.File_Writers.Open (To_String (Self.Invalid_Log));
begin
Log_File.Set_Parameters (Self.Pretty_Printer);
Log_File.Open_List;
Log_File.Append_String (Natools.Time_IO.RFC_3339.Image
(Ada.Calendar.Clock, Subsecond_Digits => 3));
Log_File.Open_List;
Log_File.Append_String ("endpoint");
Log_File.Append_String (To_String (Self.Data_Path));
Log_File.Close_List;
Log_File.Open_List;
Log_File.Append_String ("data");
Log_File.Append_Atom (Data);
Log_File.Close_List;
Log_File.Open_List;
Log_File.Append_String ("expected-signature");
Log_File.Append_Atom (Expected_Signature);
Log_File.Close_List;
Log_File.Open_List;
Log_File.Append_String ("given-signature");
Log_File.Append_Atom (Given_Signature);
Log_File.Close_List;
Log_File.Close_List;
if Self.Pretty_Printer.Newline_At
(Sx.Printers.Pretty.Closing, Sx.Printers.Pretty.Opening)
then
Log_File.Newline;
end if;
end;
end Log_Invalid;
function Execute
(Self : in Endpoint;
Data : in Sx.Atom;
Signature : in Sx.Atom)
return Execution_Results.Data
is
use type Sx.Atom;
begin
Signature_Check :
declare
Expected_Signature : constant Sx.Atom
:= HMAC.Digest (Self.Key.Query, Data);
begin
if Expected_Signature /= Signature then
Log_Invalid (Self, Data, Signature, Expected_Signature);
return (State => Execution_Results.Invalid_Signature);
end if;
end Signature_Check;
case Self.Separator.Action is
when No_Separator =>
Append_Data (Self, Data);
when Force_Separator =>
Append_Data (Self, Data & Self.Separator.Data.Query);
when Separator_If_Needed =>
declare
use type Sx.Offset;
Sep : constant Sx.Atom := Self.Separator.Data.Query;
begin
if Data'Length >= Sep'Length
and then Data (Data'Last - Sep'Length + 1 .. Data'Last) = Sep
then
Append_Data (Self, Data);
else
Append_Data (Self, Data & Sep);
end if;
end;
end case;
return (State => Execution_Results.OK, Redirect => Self.Redirect);
end Execute;
procedure Set
(State : in out Endpoint;
Context : in String;
Name : in Sx.Atom;
Arguments : in out Sx.Lockable.Descriptor'Class)
is
Event : Sx.Events.Event;
use type Sx.Events.Event;
begin
case Commands.To_Endpoint_Command (Sx.To_String (Name)) is
when Commands.Endpoint_Error =>
Log ("Unknown command """ & Sx.To_String (Name)
& """ for endpoint """ & Context & '"');
when Commands.Data_Path =>
if Arguments.Current_Event = Sx.Events.Add_Atom then
State.Data_Path := Hold (Sx.To_String (Arguments.Current_Atom));
end if;
when Commands.Force_Separator =>
if Arguments.Current_Event = Sx.Events.Add_Atom then
State.Separator
:= (Action => Force_Separator,
Data => Constructors.Create (Arguments.Current_Atom));
end if;
when Commands.Invalid_Log =>
if Arguments.Current_Event = Sx.Events.Add_Atom then
State.Invalid_Log
:= Hold (Sx.To_String (Arguments.Current_Atom));
Arguments.Next (Event);
case (Event) is
when Sx.Events.Add_Atom | Sx.Events.Open_List =>
Sx.Printers.Pretty.Config.Update
(State.Pretty_Printer, Arguments);
when Sx.Events.Close_List | Sx.Events.End_Of_Input
| Sx.Events.Error =>
null;
end case;
end if;
when Commands.Key =>
if Arguments.Current_Event = Sx.Events.Add_Atom then
State.Key := Constructors.Create (Arguments.Current_Atom);
end if;
when Commands.No_Separator =>
State.Separator := (Action => No_Separator);
when Commands.Redirect =>
if Arguments.Current_Event = Sx.Events.Add_Atom then
State.Redirect := Hold (Sx.To_String (Arguments.Current_Atom));
end if;
when Commands.Separator_If_Needed =>
if Arguments.Current_Event = Sx.Events.Add_Atom then
State.Separator
:= (Action => Separator_If_Needed,
Data => Constructors.Create (Arguments.Current_Atom));
end if;
end case;
end Set;
-----------------------------
-- Server-Wide Subprograms --
-----------------------------
procedure Set
(State : in out Endpoint_Maps.Unsafe_Maps.Map;
Context : in Sx.Printers.Pretty.Parameters;
Name : in Sx.Atom;
Arguments : in out Sx.Lockable.Descriptor'Class)
is
use type Sx.Events.Event;
S_Name : constant String := Sx.To_String (Name);
Item : Endpoint;
begin
Item.Pretty_Printer := Context;
Interpreter (Arguments, Item, S_Name);
if Item.Key.Is_Empty or else To_String (Item.Data_Path) = "" then
return;
end if;
State.Include (S_Name, Item);
end Set;
procedure Set
(State : in out Server_Data;
Context : in String;
Name : in Sx.Atom;
Arguments : in out Sx.Lockable.Descriptor'Class)
is
use type Sx.Events.Event;
begin
case Commands.To_Server_Command (Sx.To_String (Name)) is
when Commands.Server_Error =>
Log ("Unknown command """ & Sx.To_String (Name)
& """ for server data in """ & Context & '"');
when Commands.Default_Printer =>
Sx.Printers.Pretty.Config.Update
(State.Default_Printer, Arguments);
when Commands.Endpoints =>
declare
New_Map : Endpoint_Maps.Unsafe_Maps.Map;
begin
Interpreter (Arguments, New_Map, State.Default_Printer);
State.Endpoints := Endpoint_Maps.Create (New_Map);
end;
when Commands.Static_Path =>
if Arguments.Current_Event = Sx.Events.Add_Atom then
State.Static_Path
:= Hold (Sx.To_String (Arguments.Current_Atom));
end if;
when Commands.Template =>
if Arguments.Current_Event = Sx.Events.Add_Atom then
State.Template := Hold (Sx.To_String (Arguments.Current_Atom));
end if;
end case;
end Set;
-----------------
-- AWS Handler --
-----------------
overriding function Dispatch
(Dispatcher : in Handler;
Request : in AWS.Status.Data)
return AWS.Response.Data
is
Accessor : constant Server_Refs.Accessor := Dispatcher.Ref.Query;
URI : constant String := AWS.Status.URI (Request);
Cursor : constant Endpoint_Maps.Cursor := Accessor.Endpoints.Find (URI);
use type AWS.Status.Request_Method;
begin
if not Endpoint_Maps.Has_Element (Cursor) then
Dispatch_Static_File :
declare
Path : constant String := To_String (Accessor.Static_Path) & URI;
begin
if Ada.Strings.Fixed.Index (URI, "/.") /= 0
or else not Ada.Directories.Exists (Path)
then
return Simple_Response
(AWS.Messages.S404, To_String (Accessor.Template));
elsif AWS.Status.Method (Request) /= AWS.Status.GET then
return Simple_Response
(AWS.Messages.S405,
To_String (Accessor.Template),
Allow => "GET");
else
return AWS.Response.File (AWS.MIME.Content_Type (Path), Path);
end if;
end Dispatch_Static_File;
end if;
if AWS.Status.Method (Request) /= AWS.Status.POST then
return Simple_Response
(AWS.Messages.S405, To_String (Accessor.Template), Allow => "POST");
end if;
declare
Parameters : constant AWS.Parameters.List
:= AWS.Status.Parameters (Request);
Data : constant Sx.Atom
:= Sx.To_Atom (AWS.Parameters.Get (Parameters, "data"));
Signature : constant Sx.Atom
:= Sx.To_Atom (AWS.Parameters.Get (Parameters, "signature"));
Result : constant Execution_Results.Data := Execute
(Accessor.Endpoints.Constant_Reference (Cursor),
Data,
Sx.Encodings.Decode_Hex (Signature));
begin
case Result.State is
when Execution_Results.OK =>
if To_String (Result.Redirect) /= "" then
return Simple_Response
(AWS.Messages.S303, To_String (Accessor.Template),
Location => To_String (Result.Redirect));
else
return Simple_Response
(AWS.Messages.S200, To_String (Accessor.Template));
end if;
when Execution_Results.Invalid_Signature =>
return Simple_Response
(AWS.Messages.S403, To_String (Accessor.Template));
when Execution_Results.File_Error =>
return Simple_Response
(AWS.Messages.S500, To_String (Accessor.Template));
end case;
end;
end Dispatch;
overriding function Clone (Dispatcher : in Handler) return Handler is
begin
return Dispatcher;
end Clone;
not overriding procedure Reset
(Dispatcher : in out Handler;
Config_File : in String)
is
Reader : Sx.File_Readers.S_Reader
:= Sx.File_Readers.Reader (Config_File);
begin
Reset (Dispatcher, Reader, Config_File);
end Reset;
not overriding procedure Reset
(Dispatcher : in out Handler;
Config : in out Natools.S_Expressions.Lockable.Descriptor'Class;
File_Name : in String)
is
New_Server : constant Server_Refs.Data_Access := new Server_Data;
New_Ref : constant Server_Refs.Immutable_Reference
:= Server_Refs.Create (New_Server);
begin
Interpreter (Config, New_Server.all, File_Name);
Dispatcher.Ref := New_Ref;
end Reset;
function Simple_Response
(Code : AWS.Messages.Status_Code;
Template : String := "";
Location : String := "";
Allow : String := "")
return AWS.Response.Data
is
function Response_Body return String;
Image : constant String := AWS.Messages.Image (Code);
Message : constant String := AWS.Messages.Reason_Phrase (Code);
function Response_Body return String is
begin
if Template = "" then
return "<html><head><title>" & Image & ' ' & Message
& "</title></head>"
& "<body><h1>" & Image & ' ' & Message & "</h1></body></html>";
else
return Templates_Parser.Parse (Template,
(Templates_Parser.Assoc ("CODE", Image),
Templates_Parser.Assoc ("MESSAGE", Message)));
end if;
end Response_Body;
Result : AWS.Response.Data := AWS.Response.Build
("text/html", Response_Body, Code);
begin
if Allow /= "" then
AWS.Response.Set.Add_Header
(Result,
AWS.Messages.Allow_Token,
Allow);
end if;
if Location /= "" then
AWS.Response.Set.Add_Header
(Result,
AWS.Messages.Location_Token,
Location);
end if;
return Result;
end Simple_Response;
end Simple_Webapps.Append_Servers;
|
pragma Ada_2012;
with Protypo.Api.Engine_Values.Constant_Wrappers;
package body Protypo.Api.Engine_Values.Handlers is
function Create (Val : Array_Interface_Access) return Engine_Value
is (Engine_Value'(Class => Array_Handler,
Array_Object => Val));
function Create (Val : Record_Interface_Access) return Engine_Value
is (Engine_Value'(Class => Record_Handler,
Record_Object => Val));
function Create (Val : Ambivalent_Interface_Access) return Engine_Value
is (Engine_Value'(Class => Ambivalent_Handler,
Ambivalent_Object => Val));
function Create (Val : Iterator_Interface_Access) return Engine_Value
is (Engine_Value'(Class => Iterator,
Iteration_Object => Val));
function Create (Val : Function_Interface_Access) return Engine_Value
is (Engine_Value'(Class => Function_Handler,
Function_Object => Val));
function Create (Val : Callback_Function_Access;
N_Parameters : Natural := 1)
return Engine_Value
is (Create (new Callback_Based_Handler'(Callback => Val,
Min_Parameters => N_Parameters,
Max_Parameters => N_Parameters,
With_Varargin => False)));
function Create (Val : Callback_Function_Access;
Min_Parameters : Natural;
Max_Parameters : Natural;
With_Varargin : Boolean := False) return Engine_Value
is (Create (new Callback_Based_Handler'(Callback => Val,
Min_Parameters => Min_Parameters,
Max_Parameters => Max_Parameters,
With_Varargin => With_Varargin)));
function Create (Val : Reference_Interface_Access) return Engine_Value
is (Engine_Value'(Class => Reference_Handler,
Reference_Object => Val));
function Create (Val : Constant_Interface_Access) return Engine_Value
is (Engine_Value'(Class => Constant_Handler,
Constant_Object => Val));
function Get_Array (Val : Array_Value) return Array_Interface_Access
is (Val.Array_Object);
function Get_Record (Val : Record_Value) return Record_Interface_Access
is (Val.Record_Object);
function Get_Ambivalent (Val : Ambivalent_Value) return Ambivalent_Interface_Access
is (Val.Ambivalent_Object);
function Get_Iterator (Val : Iterator_Value) return Iterator_Interface_Access
is (Val.Iteration_Object);
function Get_Function (Val : Function_Value) return Function_Interface_Access
is (Val.Function_Object);
function Get_Reference (Val : Reference_Value) return Reference_Interface_Access
is (Val.Reference_Object);
function Get_Constant (Val : Constant_Value) return Constant_Interface_Access
is (Val.Constant_Object);
function Force_Handler (Item : Engine_Value) return Handler_Value
is (case Item.Class is
when Handler_Classes =>
Item,
when Int =>
Constant_Wrappers.To_Handler_Value (Get_Integer (Item)),
when Real =>
Constant_Wrappers.To_Handler_Value (Get_Float (Item)),
when Text =>
Constant_Wrappers.To_Handler_Value (Get_String (Item)),
when Void | Iterator =>
raise Constraint_Error);
---------------
function Signature (Fun : Callback_Based_Handler)
return Parameter_Signature
is
Tot_Parameters : constant Natural :=
Fun.Max_Parameters
+ (if Fun.With_Varargin then 1 else 0);
Result : Parameter_Signature (2 .. Tot_Parameters + 1) :=
(others => No_Spec);
-- Result is initialized to an invalid Parameter_Signature, so that
-- if there is some bug, it will be (with large probability)
-- caught by the contract of Signature
Last_Mandatory : constant Natural := Result'First + Fun.Min_Parameters - 1;
Last_Optional : constant Natural := Result'First + Fun.Max_Parameters - 1;
begin
if Fun.Min_Parameters > 0 then
Result (Result'First .. Last_Mandatory) :=
(others => Mandatory);
end if;
if Fun.Max_Parameters > Fun.Min_Parameters then
Result (Last_Mandatory + 1 .. Last_Optional) :=
(others => Optional (Void_Value));
end if;
if Fun.With_Varargin then
Result (Result'Last) := Varargin;
end if;
return Result;
end Signature;
end Protypo.Api.Engine_Values.Handlers;
|
package Memory.DRAM is
type DRAM_Type is new Memory_Type with private;
type DRAM_Pointer is access all DRAM_Type'Class;
function Create_DRAM(cas_cycles : Time_Type; -- CAS latency
rcd_cycles : Time_Type; -- RCD latency
rp_cycles : Time_Type; -- Precharge latency
wb_cycles : Time_Type; -- Write-back latency
multiplier : Time_Type; -- Clock multiplier
word_size : Positive; -- Word size in bytes
page_size : Positive; -- Page size in bytes
page_count : Positive; -- Pages per bank
width : Positive; -- Channel width in bytes
burst_size : Positive; -- Burst size
open_page_mode : Boolean) -- Open or closed page
return DRAM_Pointer;
overriding
function Clone(mem : DRAM_Type) return Memory_Pointer;
overriding
procedure Reset(mem : in out DRAM_Type;
context : in Natural);
overriding
procedure Read(mem : in out DRAM_Type;
address : in Address_Type;
size : in Positive);
overriding
procedure Write(mem : in out DRAM_Type;
address : in Address_Type;
size : in Positive);
overriding
procedure Idle(mem : in out DRAM_Type;
cycles : in Time_Type);
overriding
function To_String(mem : DRAM_Type) return Unbounded_String;
overriding
function Get_Cost(mem : DRAM_Type) return Cost_Type;
overriding
function Get_Writes(mem : DRAM_Type) return Long_Integer;
overriding
function Get_Word_Size(mem : DRAM_Type) return Positive;
overriding
function Get_Ports(mem : DRAM_Type) return Port_Vector_Type;
overriding
procedure Generate(mem : in DRAM_Type;
sigs : in out Unbounded_String;
code : in out Unbounded_String);
private
type Bank_Type is record
page : Address_Type := Address_Type'Last;
dirty : Boolean := False;
pending : Time_Type := 0;
end record;
package Bank_Vectors is new Vectors(Natural, Bank_Type);
type DRAM_Type is new Memory_Type with record
banks : Bank_Vectors.Vector;
bank_size : Positive;
cas_cycles : Time_Type;
rcd_cycles : Time_Type;
rp_cycles : Time_Type;
wb_cycles : Time_Type;
access_cycles : Time_Type;
multiplier : Time_Type;
word_size : Positive;
page_size : Positive;
page_count : Positive;
width : Positive;
burst_size : Positive;
open_page_mode : Boolean;
writes : Long_Integer := 0;
end record;
end Memory.DRAM;
|
-----------------------------------------------------------------------
-- awa-comments -- Comments module
-- Copyright (C) 2009, 2010, 2011, 2014 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
-- == Introduction ==
-- The <b>Comments</b> module is a general purpose module that allows to associate user comments
-- to any database entity. The module defines several bean types that allow to display a list
-- of comments or edit and publish a new comment.
--
-- == Model ==
-- The database model is generic and it uses the <tt>Entity_Type</tt> provided by
-- [http://ada-ado.googlecode.com ADO] to associate a comment to entities stored in different
-- tables. The <tt>Entity_Type</tt> identifies the database table and the stored identifier
-- in <tt>for_entity_id</tt> defines the entity in that table.
--
-- [http://ada-awa.googlecode.com/svn/wiki/awa_comments_model.png]
--
-- @include awa-comments-modules.ads
-- @include awa-comments-beans.ads
--
package AWA.Comments is
end AWA.Comments;
|
package body Xmlhelpers is
procedure Add_Node
(Node_Name, Node_Value : String; Parent_Node : DOM.Core.Element;
Feed : Node)
is
Feed_Text : Text;
Feed_Data : DOM.Core.Element;
begin
Feed_Data :=
Append_Child (Parent_Node, Create_Element (Feed, Node_Name));
Feed_Text := Create_Text_Node (Feed, Node_Value);
if Append_Child (Feed_Data, Feed_Text) /= null then
return;
end if;
end Add_Node;
procedure Add_Link
(Parent_Node : DOM.Core.Element; Url, Relationship : String; Feed : Node)
is
Link_Node : DOM.Core.Element;
begin
Link_Node := Append_Child (Parent_Node, Create_Element (Feed, "link"));
Set_Attribute (Link_Node, "rel", Relationship);
Set_Attribute (Link_Node, "href", Url);
end Add_Link;
procedure Add_Generator (Parent_Node : DOM.Core.Element; Feed : Node) is
Generator_Node : DOM.Core.Element;
Feed_Text : Text;
begin
Generator_Node :=
Append_Child (Parent_Node, Create_Element (Feed, "generator"));
Set_Attribute (Generator_Node, "uri", Version.Link);
Set_Attribute (Generator_Node, "version", Version.Current);
Feed_Text := Create_Text_Node (Feed, Version.Name);
if Append_Child (Generator_Node, Feed_Text) /= null then
return;
end if;
end Add_Generator;
procedure Add_Author
(Parent_Node : DOM.Core.Element; Name, Email : String; Feed : Node)
is
Author_Node : DOM.Core.Element;
begin
Author_Node :=
Append_Child (Parent_Node, Create_Element (Feed, "author"));
if Name'Length > 0 then
Add_Node ("name", Name, Author_Node, Feed);
end if;
if Email'Length > 0 then
Add_Node ("email", Email, Author_Node, Feed);
end if;
end Add_Author;
end Xmlhelpers;
|
with
openGL.Palette,
mmi.Camera.forge,
mmi.Sprite,
mmi.Events,
lace.Observer,
lace.event.Utility.local,
ada.Unchecked_Deallocation;
package body mmi.Applet.gasp
is
use Math;
package std_Gasp renames standard.Gasp;
gasp_world_Id : constant mmi. world_Id := 1;
gasp_camera_Id : constant mmi.camera_Id := 1;
procedure define (Self : in View; Name : in String)
is
use openGL.Palette,
lace.event.Utility;
the_world_Info : constant world_Info_view := new world_Info;
the_World : constant std_Gasp.World.view := std_Gasp.World.forge.new_World (Name,
Self.Renderer);
the_Camera : constant mmi.Camera.View := mmi.Camera.forge.new_Camera;
begin
the_World.restore;
the_world_Info.World := mmi.World.view (the_World);
the_Camera.set_viewport_Size (Self.Window.Width, Self.Window.Height);
the_Camera.Renderer_is (Self.Renderer);
the_Camera.Site_is ((0.0, 0.0, 100.0));
the_world_Info.Cameras.append (the_Camera);
Self.Worlds .append (the_world_Info);
Self.Renderer.Background_is (Black);
end define;
package body Forge
is
function new_Applet (Name : in String;
use_Window : in mmi.Window.view) return View
is
Self : constant View := new Item' (mmi.Applet.Forge.to_Applet (Name, use_Window)
with others => <>);
begin
define (Self, Name);
return Self;
end new_Applet;
end Forge;
procedure free (Self : in out View)
is
procedure deallocate is new ada.Unchecked_Deallocation (Item'Class, View);
begin
Self.gasp_World.store;
Self.destroy;
deallocate (Self);
end free;
function gasp_World (Self : in Item) return standard.gasp.World.view
is
begin
return standard.gasp.World.view (Self.World (gasp_world_Id));
end gasp_World;
function mmi_World (Self : in Item) return mmi.World.view
is
begin
return Self.World (gasp_world_Id);
end mmi_World;
function mmi_Camera (Self : in Item) return mmi.Camera.view
is
begin
return Self.Camera (gasp_world_Id, gasp_camera_Id);
end mmi_Camera;
overriding
procedure freshen (Self : in out Item)
is
use MMI.Keyboard, linear_Algebra, Algebra_3d;
begin
freshen (mmi.Applet.item (Self));
if Self.gasp_World.Pod.Speed /= (0.0, 0.0, 0.0)
then
if Self.pod_Direction /= Normalised (Self.gasp_World.Pod.Speed)
then
Self.pod_Direction := Normalised (Self.gasp_World.Pod.Speed);
end if;
end if;
Self.gasp_World.Pod.Spin_is (get_Rotation (Look_at (Eye => Self.gasp_World.Pod.Site,
Center => Self.gasp_World.Pod.Site + Self.pod_Direction * 10.0,
Up => z_Rotation_from (Self.pod_Roll) * (0.0, 1.0, 0.0))));
Self.Camera (1, 1).Site_is (Self.gasp_World.Pod.Site);
Self.Camera (1, 1).world_Rotation_is (Self.gasp_World.Pod.Spin);
case Self.last_Keypress
is
when KP1 => Self.pod_Roll := Self.pod_Roll + 0.05;
when KP2 => null;
when KP3 => Self.pod_Roll := Self.pod_Roll - 0.05;
when KP4 => Self.gasp_World.Pod.apply_Force ( ((-1.0, 0.0, 0.0) * 0.02) * (Self.gasp_World.Pod.Spin));
when KP5 => Self.gasp_World.Pod.apply_Force ( (( 0.0, 0.0, 1.0) * 0.1) * (Self.gasp_World.Pod.Spin));
when KP6 => Self.gasp_World.Pod.apply_Force ( (( 1.0, 0.0, 0.0) * 0.02) * (Self.gasp_World.Pod.Spin));
when KP8 => Self.gasp_World.Pod.apply_Force ( (( 0.0, 0.0, -1.0) * 0.1) * (Self.gasp_World.Pod.Spin));
when KP7 => Self.gasp_World.Pod.apply_Torque_impulse (0.005 * ( 0.0, -1.0, 0.0));
when KP9 => Self.gasp_World.Pod.apply_Torque_impulse (0.005 * ( 0.0, 1.0, 0.0));
when KP_PLUS => Self.gasp_World.Pod.apply_Force ( (( 0.0, 1.0, 0.0) * 0.02) * (Self.gasp_World.Pod.Spin));
when ENTER => Self.gasp_World.Pod.apply_Force ( (( 0.0, -1.0, 0.0) * 0.02) * (Self.gasp_World.Pod.Spin));
when others => null;
end case;
end freshen;
end mmi.Applet.gasp;
|
-- ________ ___ ______ ______ ___
-- /___ .. ._/ |.| |.___.\ /. __ .\ __|.| ____
-- / .. / |.| |.____/ |.|__|.| / .. ..| __\ .. \
-- _/ .. /___ |.| |.| === | .. __ .. ||. = .| | = .. |
-- /_______/ |_| /__| /__| |_| \__\_| \__\_|
-- UnZip
--------
-- This library allows to uncompress deflated, enhanced deflated, bzip2 - ed,
-- imploded, reduced, shrunk and stored streams from a Zip archive stream.
--
-- Pure Ada 95 code, 100% portable : OS - , CPU - and compiler - independent.
-- Ada translation and substantial rewriting by Gautier de Montmollin
-- On the web : see the Zip.web constant below.
-- based on Pascal version 2.10 by Abimbola A Olowofoyeku,
-- http://www.greatchief.plus.com/
-- itself based on Pascal version by Christian Ghisler,
-- itself based on C code by Info - Zip group (Mark Adler et al.)
-- http://www.info - zip.org/UnZip.html
-- Technical documentation : read appnote.txt
-- Legal licensing note:
-- Copyright (c) 1999 .. 2010 Gautier de Montmollin
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-- THE SOFTWARE.
-- NB : this is the MIT License, as found 12 - Sep - 2007 on the site
-- http://www.opensource.org/licenses/mit - license.php
with Zip;
with Ada.Calendar, Ada.Streams, Ada.Strings.Unbounded;
package UnZip is
type option is (
test_only, -- test .zip file integrity, no write
junk_directories, -- ignore directory info - > extract to current one
case_sensitive_match, -- case sensitive name matching
extract_as_text -- files will be written with native line endings
);
type Option_set is array (option) of Boolean;
no_option : constant Option_set := (others => False);
-- Ada 2005's Ada.Directories.Create_Path.
-- For Ada 95 compatibility we pass it as an optional procedure access.
type Create_Path_proc is access
procedure (New_Directory : String;
Form : String := "");
-- This is system - dependent (or in a future Ada)
type Set_Time_Stamp_proc is access
procedure (file_name : String; stamp : Ada.Calendar.Time);
-- Alternatively, you can use Zip.Time to set file time stamps
type Set_ZTime_Stamp_proc is access
procedure (file_name : String; stamp : Zip.Time);
-- NB : you can use Zip.Convert to change Ada.Calendar.Time from/to Zip.Time
-- or use our Split to avoid using Ada.Calendar at all.
-- This is for modifying output file names (e.g. adding a
-- work directory, modifying the archived path, etc.)
type Compose_func is access function (File_Name : String) return String;
-- File System dependent settings
type FS_routines_type is record
Create_Path : Create_Path_proc;
Set_Time_Stamp : Set_Time_Stamp_proc;
Compose_File_Name : Compose_func;
Set_ZTime_Stamp : Set_ZTime_Stamp_proc; -- alt. to Set_Time_Stamp
end record;
null_routines : constant FS_routines_type := (null, null, null, null);
----------------------------------
-- Simple extraction procedures --
----------------------------------
-- Extract all files from an archive (from)
procedure Extract (from : String;
options : Option_set := no_option;
password : String := "";
file_system_routines : FS_routines_type := null_routines
);
-- Extract one precise file (what) from an archive (from)
procedure Extract (from : String;
what : String;
options : Option_set := no_option;
password : String := "";
file_system_routines : FS_routines_type := null_routines
);
-- Extract one precise file (what) from an archive (from),
-- but save under a new name (rename)
procedure Extract (from : String;
what : String;
rename : String;
options : Option_set := no_option;
password : String := "";
file_system_routines : FS_routines_type := null_routines
);
-------------------------------------------------------------------------
-- Simple extraction procedures without re - searching central directory --
-------------------------------------------------------------------------
-- Extract all files from an archive (from)
-- Needs Zip.Load (from, . .. ) prior to the extraction
procedure Extract (from : Zip.Zip_info;
options : Option_set := no_option;
password : String := "";
file_system_routines : FS_routines_type := null_routines
);
-- Extract one precise file (what) from an archive (from)
-- Needs Zip.Load (from, . .. ) prior to the extraction
procedure Extract (from : Zip.Zip_info;
what : String;
options : Option_set := no_option;
password : String := "";
file_system_routines : FS_routines_type := null_routines
);
-- Extract one precise file (what) from an archive (from),
-- but save under a new name (rename)
-- Needs Zip.Load (from, . .. ) prior to the extraction
procedure Extract (from : Zip.Zip_info;
what : String;
rename : String;
options : Option_set := no_option;
password : String := "";
file_system_routines : FS_routines_type := null_routines
);
subtype PKZip_method is Zip.PKZip_method;
----------------------------------------------
-- Extraction procedures for user interface --
----------------------------------------------
-- NB : the *_proc types are accesses to procedures - their usage
-- may require the non - standard attribute "unrestricted_access",
-- or some changes.
-- Read unzipada.adb for details and examples.
type Name_conflict_intervention is
(yes, no, yes_to_all, none, rename_it, abort_now);
current_user_attitude : Name_conflict_intervention := yes;
-- reset to "yes" for a new session (in case of yes_to_all / none state!)
type Resolve_conflict_proc is access
procedure (name : String;
action : out Name_conflict_intervention;
new_name : out String;
new_name_length : out Natural);
type Get_password_proc is access
procedure (password : out Ada.Strings.Unbounded.Unbounded_String);
-- Data sizes in archive
subtype File_size_type is Zip.File_size_type;
-- Inform user about some archive data
type Tell_data_proc is access
procedure (name : String;
compressed_bytes : File_size_type;
uncompressed_bytes : File_size_type;
method : PKZip_method);
-- Extract all files from an archive (from)
procedure Extract (from : String;
feedback : Zip.Feedback_proc;
help_the_file_exists : Resolve_conflict_proc;
tell_data : Tell_data_proc;
get_pwd : Get_password_proc;
options : Option_set := no_option;
password : String := "";
file_system_routines : FS_routines_type := null_routines
);
-- Extract one precise file (what) from an archive (from)
procedure Extract (from : String;
what : String;
feedback : Zip.Feedback_proc;
help_the_file_exists : Resolve_conflict_proc;
tell_data : Tell_data_proc;
get_pwd : Get_password_proc;
options : Option_set := no_option;
password : String := "";
file_system_routines : FS_routines_type := null_routines
);
-- Extract one precise file (what) from an archive (from),
-- but save under a new name (rename)
procedure Extract (from : String;
what : String;
rename : String;
feedback : Zip.Feedback_proc;
tell_data : Tell_data_proc;
get_pwd : Get_password_proc;
options : Option_set := no_option;
password : String := "";
file_system_routines : FS_routines_type := null_routines
);
-- Using Zip_info structure:
-- Extract all files from an archive (from)
-- Needs Zip.Load (from, . .. ) prior to the extraction
procedure Extract (from : Zip.Zip_info;
feedback : Zip.Feedback_proc;
help_the_file_exists : Resolve_conflict_proc;
tell_data : Tell_data_proc;
get_pwd : Get_password_proc;
options : Option_set := no_option;
password : String := "";
file_system_routines : FS_routines_type := null_routines
);
-- Extract one precise file (what) from an archive (from)
-- Needs Zip.Load (from, . .. ) prior to the extraction
procedure Extract (from : Zip.Zip_info;
what : String;
feedback : Zip.Feedback_proc;
help_the_file_exists : Resolve_conflict_proc;
tell_data : Tell_data_proc;
get_pwd : Get_password_proc;
options : Option_set := no_option;
password : String := "";
file_system_routines : FS_routines_type := null_routines
);
-- Extract one precise file (what) from an archive (from),
-- but save under a new name (rename)
-- Needs Zip.Load (from, . .. ) prior to the extraction
procedure Extract (from : Zip.Zip_info;
what : String;
rename : String;
feedback : Zip.Feedback_proc;
tell_data : Tell_data_proc;
get_pwd : Get_password_proc;
options : Option_set := no_option;
password : String := "";
file_system_routines : FS_routines_type := null_routines
);
-- Errors
CRC_Error,
Uncompressed_size_Error,
Write_Error,
Read_Error,
Wrong_password,
User_abort,
Not_supported,
Unsupported_method,
Wrong_or_no_password,
Internal_Error : exception;
private
type Write_mode is
(write_to_binary_file,
write_to_text_file,
write_to_memory,
just_test
);
subtype Write_to_file is Write_mode
range write_to_binary_file .. write_to_text_file;
type p_Stream_Element_Array is access all Ada.Streams.Stream_Element_Array;
end UnZip;
|
with Ada.Text_IO;
use Ada.Text_IO;
procedure CipoPor is
-- task Por
task Por is
entry labnyom;
end Por;
task body Por is
begin
for I in 1..10 loop
accept labnyom do
Put_Line("Labnyom a homokban");
end labnyom;
end loop;
end Por;
-- end task Por
-- task type Cipo
task type Cipo;
task body Cipo is
begin
Por.labnyom;
Put_Line("Lepek");
delay 0.1;
loop
Por.labnyom;
Put_Line("Lepek");
delay 0.1;
end loop;
end Cipo;
-- end task type Cipo
type Cipo_Access is access Cipo;
C: Cipo_Access;
begin
for I in 1..5 loop
delay 3.0;
Put_Line("Egy cipo a porban");
C := new Cipo;
end loop;
end CipoPor;
|
with BitOperations.Types;
with BitOperations.Shift;
with BitOperations.Mask;
with BitOperations.Extract;
with BitOperations.Search;
with BitOperations.Shift.Axiom;
with BitOperations.Search.Axiom;
generic
type Modular is mod <>;
package Bits with SPARK_Mode, Pure, Preelaborate is
package Types is new BitOperations.Types(Modular);
package Shifts is new BitOperations.Shift(Types);
package Mask is new BitOperations.Mask(Types);
package Extract_Pkg is new BitOperations.Extract(Types);
package Search is new BitOperations.Search(Types);
subtype Bit_Position is Types.Bit_Position;
subtype Mask_Size is Types.Mask_Size;
function Logic_Left (Value : Modular; Amount : Natural) return Modular
renames Shifts.Logic_Left;
function Logic_Right (Value : Modular; Amount : Natural) return Modular
renames Shifts.Logic_Right;
function Make_Mask (Size : Mask_Size) return Modular
renames Mask.Make;
function Extract (Value : Modular; From, To: Bit_Position) return Modular
renames Extract_Pkg.Extract;
function Most_Significant_Bit (Value : Modular) return Bit_Position
renames Search.Most_Significant_Bit;
end Bits;
|
with Interfaces; use Interfaces;
package Flash is
pragma Preelaborate;
procedure Init
with Inline_Always;
procedure Unlock
with Inline_Always;
procedure Lock
with Inline_Always;
procedure Enable_Erase
with Inline_Always;
procedure Enable_Write
with Inline_Always;
procedure Write (Addr : Unsigned_16; Value : Unsigned_16)
with Inline_Always;
function Read (Addr : Unsigned_16) return Unsigned_16
with Inline_Always;
procedure Erase (Addr : Unsigned_16)
with Inline_Always;
procedure Wait_Until_Ready
with Inline_Always;
end Flash;
|
-- This spec has been automatically generated from STM32L5x2.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package STM32_SVD.NVIC is
pragma Preelaborate;
---------------
-- Registers --
---------------
-- IPR_IPR_N array element
subtype IPR_IPR_N_Element is HAL.UInt8;
-- IPR_IPR_N array
type IPR_IPR_N_Field_Array is array (0 .. 3) of IPR_IPR_N_Element
with Component_Size => 8, Size => 32;
-- Interrupt Priority Register
type IPR_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- IPR_N as a value
Val : HAL.UInt32;
when True =>
-- IPR_N as an array
Arr : IPR_IPR_N_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for IPR_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
subtype STIR_INTID_Field is HAL.UInt9;
-- Software trigger interrupt register
type STIR_Register is record
-- Software generated interrupt ID
INTID : STIR_INTID_Field := 16#0#;
-- unspecified
Reserved_9_31 : HAL.UInt23 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for STIR_Register use record
INTID at 0 range 0 .. 8;
Reserved_9_31 at 0 range 9 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- Nested Vectored Interrupt Controller
type NVIC_Peripheral is record
-- Interrupt Set-Enable Register
ISER0 : aliased HAL.UInt32;
-- Interrupt Set-Enable Register
ISER1 : aliased HAL.UInt32;
-- Interrupt Set-Enable Register
ISER2 : aliased HAL.UInt32;
-- Interrupt Set-Enable Register
ISER3 : aliased HAL.UInt32;
-- Interrupt Clear-Enable Register
ICER0 : aliased HAL.UInt32;
-- Interrupt Clear-Enable Register
ICER1 : aliased HAL.UInt32;
-- Interrupt Clear-Enable Register
ICER2 : aliased HAL.UInt32;
-- Interrupt Clear-Enable Register
ICER3 : aliased HAL.UInt32;
-- Interrupt Set-Pending Register
ISPR0 : aliased HAL.UInt32;
-- Interrupt Set-Pending Register
ISPR1 : aliased HAL.UInt32;
-- Interrupt Set-Pending Register
ISPR2 : aliased HAL.UInt32;
-- Interrupt Set-Pending Register
ISPR3 : aliased HAL.UInt32;
-- Interrupt Clear-Pending Register
ICPR0 : aliased HAL.UInt32;
-- Interrupt Clear-Pending Register
ICPR1 : aliased HAL.UInt32;
-- Interrupt Clear-Pending Register
ICPR2 : aliased HAL.UInt32;
-- Interrupt Clear-Pending Register
ICPR3 : aliased HAL.UInt32;
-- Interrupt Active Bit Register
IABR0 : aliased HAL.UInt32;
-- Interrupt Active Bit Register
IABR1 : aliased HAL.UInt32;
-- Interrupt Active Bit Register
IABR2 : aliased HAL.UInt32;
-- Interrupt Active Bit Register
IABR3 : aliased HAL.UInt32;
-- ITNS0
ITNS0 : aliased HAL.UInt32;
-- ITNS1
ITNS1 : aliased HAL.UInt32;
-- ITNS2
ITNS2 : aliased HAL.UInt32;
-- ITNS3
ITNS3 : aliased HAL.UInt32;
-- ITNS4
ITNS4 : aliased HAL.UInt32;
-- ITNS5
ITNS5 : aliased HAL.UInt32;
-- ITNS6
ITNS6 : aliased HAL.UInt32;
-- ITNS7
ITNS7 : aliased HAL.UInt32;
-- ITNS8
ITNS8 : aliased HAL.UInt32;
-- ITNS9
ITNS9 : aliased HAL.UInt32;
-- ITNS10
ITNS10 : aliased HAL.UInt32;
-- ITNS11
ITNS11 : aliased HAL.UInt32;
-- ITNS12
ITNS12 : aliased HAL.UInt32;
-- ITNS13
ITNS13 : aliased HAL.UInt32;
-- ITNS14
ITNS14 : aliased HAL.UInt32;
-- ITNS15
ITNS15 : aliased HAL.UInt32;
-- Interrupt Priority Register
IPR0 : aliased IPR_Register;
-- Interrupt Priority Register
IPR1 : aliased IPR_Register;
-- Interrupt Priority Register
IPR2 : aliased IPR_Register;
-- Interrupt Priority Register
IPR3 : aliased IPR_Register;
-- Interrupt Priority Register
IPR4 : aliased IPR_Register;
-- Interrupt Priority Register
IPR5 : aliased IPR_Register;
-- Interrupt Priority Register
IPR6 : aliased IPR_Register;
-- Interrupt Priority Register
IPR7 : aliased IPR_Register;
-- Interrupt Priority Register
IPR8 : aliased IPR_Register;
-- Interrupt Priority Register
IPR9 : aliased IPR_Register;
-- Interrupt Priority Register
IPR10 : aliased IPR_Register;
-- Interrupt Priority Register
IPR11 : aliased IPR_Register;
-- Interrupt Priority Register
IPR12 : aliased IPR_Register;
-- Interrupt Priority Register
IPR13 : aliased IPR_Register;
-- Interrupt Priority Register
IPR14 : aliased IPR_Register;
-- Interrupt Priority Register
IPR15 : aliased IPR_Register;
-- Interrupt Priority Register
IPR16 : aliased IPR_Register;
-- Interrupt Priority Register
IPR17 : aliased IPR_Register;
-- Interrupt Priority Register
IPR18 : aliased IPR_Register;
-- Interrupt Priority Register
IPR19 : aliased IPR_Register;
-- Interrupt Priority Register
IPR20 : aliased IPR_Register;
-- IPR21
IPR21 : aliased HAL.UInt32;
-- IPR22
IPR22 : aliased HAL.UInt32;
-- IPR23
IPR23 : aliased HAL.UInt32;
-- IPR24
IPR24 : aliased HAL.UInt32;
-- IPR25
IPR25 : aliased HAL.UInt32;
-- IPR26
IPR26 : aliased HAL.UInt32;
-- IPR27
IPR27 : aliased HAL.UInt32;
-- IPR28
IPR28 : aliased HAL.UInt32;
-- IPR29
IPR29 : aliased HAL.UInt32;
end record
with Volatile;
for NVIC_Peripheral use record
ISER0 at 16#0# range 0 .. 31;
ISER1 at 16#4# range 0 .. 31;
ISER2 at 16#8# range 0 .. 31;
ISER3 at 16#C# range 0 .. 31;
ICER0 at 16#80# range 0 .. 31;
ICER1 at 16#84# range 0 .. 31;
ICER2 at 16#88# range 0 .. 31;
ICER3 at 16#8C# range 0 .. 31;
ISPR0 at 16#100# range 0 .. 31;
ISPR1 at 16#104# range 0 .. 31;
ISPR2 at 16#108# range 0 .. 31;
ISPR3 at 16#10C# range 0 .. 31;
ICPR0 at 16#180# range 0 .. 31;
ICPR1 at 16#184# range 0 .. 31;
ICPR2 at 16#188# range 0 .. 31;
ICPR3 at 16#18C# range 0 .. 31;
IABR0 at 16#200# range 0 .. 31;
IABR1 at 16#204# range 0 .. 31;
IABR2 at 16#208# range 0 .. 31;
IABR3 at 16#20C# range 0 .. 31;
ITNS0 at 16#280# range 0 .. 31;
ITNS1 at 16#284# range 0 .. 31;
ITNS2 at 16#288# range 0 .. 31;
ITNS3 at 16#28C# range 0 .. 31;
ITNS4 at 16#290# range 0 .. 31;
ITNS5 at 16#294# range 0 .. 31;
ITNS6 at 16#298# range 0 .. 31;
ITNS7 at 16#29C# range 0 .. 31;
ITNS8 at 16#2A0# range 0 .. 31;
ITNS9 at 16#2A4# range 0 .. 31;
ITNS10 at 16#2A8# range 0 .. 31;
ITNS11 at 16#2AC# range 0 .. 31;
ITNS12 at 16#2B0# range 0 .. 31;
ITNS13 at 16#2B4# range 0 .. 31;
ITNS14 at 16#2B8# range 0 .. 31;
ITNS15 at 16#2BC# range 0 .. 31;
IPR0 at 16#300# range 0 .. 31;
IPR1 at 16#304# range 0 .. 31;
IPR2 at 16#308# range 0 .. 31;
IPR3 at 16#30C# range 0 .. 31;
IPR4 at 16#310# range 0 .. 31;
IPR5 at 16#314# range 0 .. 31;
IPR6 at 16#318# range 0 .. 31;
IPR7 at 16#31C# range 0 .. 31;
IPR8 at 16#320# range 0 .. 31;
IPR9 at 16#324# range 0 .. 31;
IPR10 at 16#328# range 0 .. 31;
IPR11 at 16#32C# range 0 .. 31;
IPR12 at 16#330# range 0 .. 31;
IPR13 at 16#334# range 0 .. 31;
IPR14 at 16#338# range 0 .. 31;
IPR15 at 16#33C# range 0 .. 31;
IPR16 at 16#340# range 0 .. 31;
IPR17 at 16#344# range 0 .. 31;
IPR18 at 16#348# range 0 .. 31;
IPR19 at 16#34C# range 0 .. 31;
IPR20 at 16#350# range 0 .. 31;
IPR21 at 16#354# range 0 .. 31;
IPR22 at 16#358# range 0 .. 31;
IPR23 at 16#35C# range 0 .. 31;
IPR24 at 16#360# range 0 .. 31;
IPR25 at 16#364# range 0 .. 31;
IPR26 at 16#368# range 0 .. 31;
IPR27 at 16#36C# range 0 .. 31;
IPR28 at 16#370# range 0 .. 31;
IPR29 at 16#374# range 0 .. 31;
end record;
-- Nested Vectored Interrupt Controller
NVIC_Periph : aliased NVIC_Peripheral
with Import, Address => System'To_Address (16#E000E100#);
-- Nested vectored interrupt controller
type NVIC_STIR_Peripheral is record
-- Software trigger interrupt register
STIR : aliased STIR_Register;
end record
with Volatile;
for NVIC_STIR_Peripheral use record
STIR at 0 range 0 .. 31;
end record;
-- Nested vectored interrupt controller
NVIC_STIR_Periph : aliased NVIC_STIR_Peripheral
with Import, Address => System'To_Address (16#E000EF00#);
end STM32_SVD.NVIC;
|
with Ada.Integer_Text_IO;
with Ada.Text_IO;
package body Problem_01 is
package IO renames Ada.Text_IO;
package I_IO renames Ada.Integer_Text_IO;
procedure Solve is
sum : Integer := 0;
begin
for i in 1 .. 999 loop
if i mod 3 = 0 or i mod 5 = 0 then
sum := sum + i;
end if;
end loop;
I_IO.Put(sum);
IO.New_Line;
end Solve;
end Problem_01;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with AMF.CMOF.Elements;
with AMF.DI.Styles;
with AMF.Internals.UMLDI_UML_Diagrams;
with AMF.UML.Comments.Collections;
with AMF.UML.Dependencies.Collections;
with AMF.UML.Elements.Collections;
with AMF.UML.Named_Elements;
with AMF.UML.Namespaces.Collections;
with AMF.UML.Packages.Collections;
with AMF.UML.Parameterable_Elements;
with AMF.UML.String_Expressions;
with AMF.UML.Template_Parameters;
with AMF.UMLDI.UML_Composite_Structure_Diagrams;
with AMF.UMLDI.UML_Labels;
with AMF.UMLDI.UML_Styles;
with AMF.Visitors;
with League.Strings;
package AMF.Internals.UMLDI_UML_Composite_Structure_Diagrams is
type UMLDI_UML_Composite_Structure_Diagram_Proxy is
limited new AMF.Internals.UMLDI_UML_Diagrams.UMLDI_UML_Diagram_Proxy
and AMF.UMLDI.UML_Composite_Structure_Diagrams.UMLDI_UML_Composite_Structure_Diagram with null record;
overriding function Get_Is_Association_Dot_Shown
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return Boolean;
-- Getter of UMLClassOrCompositeStructureDiagram::isAssociationDotShown.
--
-- Indicates whether dot notation for associations shall be used.
overriding procedure Set_Is_Association_Dot_Shown
(Self : not null access UMLDI_UML_Composite_Structure_Diagram_Proxy;
To : Boolean);
-- Setter of UMLClassOrCompositeStructureDiagram::isAssociationDotShown.
--
-- Indicates whether dot notation for associations shall be used.
overriding function Get_Navigability_Notation
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return AMF.UMLDI.UMLDI_UML_Navigability_Notation_Kind;
-- Getter of UMLClassOrCompositeStructureDiagram::navigabilityNotation.
--
-- Indicates when to show navigability of associations or connectors typed
-- by associations.
overriding procedure Set_Navigability_Notation
(Self : not null access UMLDI_UML_Composite_Structure_Diagram_Proxy;
To : AMF.UMLDI.UMLDI_UML_Navigability_Notation_Kind);
-- Setter of UMLClassOrCompositeStructureDiagram::navigabilityNotation.
--
-- Indicates when to show navigability of associations or connectors typed
-- by associations.
overriding function Get_Non_Navigability_Notation
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return AMF.UMLDI.UMLDI_UML_Navigability_Notation_Kind;
-- Getter of UMLClassOrCompositeStructureDiagram::nonNavigabilityNotation.
--
-- Indicates when to show non-navigability of associations or connectors
-- typed by associations.
overriding procedure Set_Non_Navigability_Notation
(Self : not null access UMLDI_UML_Composite_Structure_Diagram_Proxy;
To : AMF.UMLDI.UMLDI_UML_Navigability_Notation_Kind);
-- Setter of UMLClassOrCompositeStructureDiagram::nonNavigabilityNotation.
--
-- Indicates when to show non-navigability of associations or connectors
-- typed by associations.
overriding function Get_Heading
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return AMF.UMLDI.UML_Labels.UMLDI_UML_Label_Access;
-- Getter of UMLDiagram::heading.
--
overriding procedure Set_Heading
(Self : not null access UMLDI_UML_Composite_Structure_Diagram_Proxy;
To : AMF.UMLDI.UML_Labels.UMLDI_UML_Label_Access);
-- Setter of UMLDiagram::heading.
--
overriding function Get_Is_Frame
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return Boolean;
-- Getter of UMLDiagram::isFrame.
--
-- Indicates when diagram frames shall be shown.
overriding procedure Set_Is_Frame
(Self : not null access UMLDI_UML_Composite_Structure_Diagram_Proxy;
To : Boolean);
-- Setter of UMLDiagram::isFrame.
--
-- Indicates when diagram frames shall be shown.
overriding function Get_Is_Iso
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return Boolean;
-- Getter of UMLDiagram::isIso.
--
-- Indicate when ISO notation rules shall be followed.
overriding procedure Set_Is_Iso
(Self : not null access UMLDI_UML_Composite_Structure_Diagram_Proxy;
To : Boolean);
-- Setter of UMLDiagram::isIso.
--
-- Indicate when ISO notation rules shall be followed.
overriding function Get_Is_Icon
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return Boolean;
-- Getter of UMLDiagramElement::isIcon.
--
-- For modelElements that have an option to be shown with shapes other
-- than rectangles, such as Actors, or with other identifying shapes
-- inside them, such as arrows distinguishing InputPins and OutputPins, or
-- edges that have an option to be shown with lines other than solid with
-- open arrow heads, such as Realization. A value of true for isIcon
-- indicates the alternative notation shall be shown.
overriding procedure Set_Is_Icon
(Self : not null access UMLDI_UML_Composite_Structure_Diagram_Proxy;
To : Boolean);
-- Setter of UMLDiagramElement::isIcon.
--
-- For modelElements that have an option to be shown with shapes other
-- than rectangles, such as Actors, or with other identifying shapes
-- inside them, such as arrows distinguishing InputPins and OutputPins, or
-- edges that have an option to be shown with lines other than solid with
-- open arrow heads, such as Realization. A value of true for isIcon
-- indicates the alternative notation shall be shown.
overriding function Get_Local_Style
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return AMF.UMLDI.UML_Styles.UMLDI_UML_Style_Access;
-- Getter of UMLDiagramElement::localStyle.
--
-- Restricts owned styles to UMLStyles.
overriding procedure Set_Local_Style
(Self : not null access UMLDI_UML_Composite_Structure_Diagram_Proxy;
To : AMF.UMLDI.UML_Styles.UMLDI_UML_Style_Access);
-- Setter of UMLDiagramElement::localStyle.
--
-- Restricts owned styles to UMLStyles.
overriding function Get_Model_Element
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return AMF.UML.Elements.Collections.Set_Of_UML_Element;
-- Getter of UMLDiagramElement::modelElement.
--
-- Restricts UMLDiagramElements to show UML Elements, rather than other
-- language elements.
overriding function Get_Model_Element
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return AMF.CMOF.Elements.CMOF_Element_Access;
-- Getter of DiagramElement::modelElement.
--
-- a reference to a depicted model element, which can be any MOF-based
-- element
overriding function Get_Local_Style
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return AMF.DI.Styles.DI_Style_Access;
-- Getter of DiagramElement::localStyle.
--
-- a reference to an optional locally-owned style for this diagram element.
overriding procedure Set_Local_Style
(Self : not null access UMLDI_UML_Composite_Structure_Diagram_Proxy;
To : AMF.DI.Styles.DI_Style_Access);
-- Setter of DiagramElement::localStyle.
--
-- a reference to an optional locally-owned style for this diagram element.
overriding function Get_Name
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return League.Strings.Universal_String;
-- Getter of Diagram::name.
--
-- the name of the diagram.
overriding procedure Set_Name
(Self : not null access UMLDI_UML_Composite_Structure_Diagram_Proxy;
To : League.Strings.Universal_String);
-- Setter of Diagram::name.
--
-- the name of the diagram.
overriding function Get_Documentation
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return League.Strings.Universal_String;
-- Getter of Diagram::documentation.
--
-- the documentation of the diagram.
overriding procedure Set_Documentation
(Self : not null access UMLDI_UML_Composite_Structure_Diagram_Proxy;
To : League.Strings.Universal_String);
-- Setter of Diagram::documentation.
--
-- the documentation of the diagram.
overriding function Get_Resolution
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return AMF.Real;
-- Getter of Diagram::resolution.
--
-- the resolution of the diagram expressed in user units per inch.
overriding procedure Set_Resolution
(Self : not null access UMLDI_UML_Composite_Structure_Diagram_Proxy;
To : AMF.Real);
-- Setter of Diagram::resolution.
--
-- the resolution of the diagram expressed in user units per inch.
overriding function Get_Client_Dependency
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency;
-- Getter of NamedElement::clientDependency.
--
-- Indicates the dependencies that reference the client.
overriding function Get_Name
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return AMF.Optional_String;
-- Getter of NamedElement::name.
--
-- The name of the NamedElement.
overriding procedure Set_Name
(Self : not null access UMLDI_UML_Composite_Structure_Diagram_Proxy;
To : AMF.Optional_String);
-- Setter of NamedElement::name.
--
-- The name of the NamedElement.
overriding function Get_Name_Expression
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return AMF.UML.String_Expressions.UML_String_Expression_Access;
-- Getter of NamedElement::nameExpression.
--
-- The string expression used to define the name of this named element.
overriding procedure Set_Name_Expression
(Self : not null access UMLDI_UML_Composite_Structure_Diagram_Proxy;
To : AMF.UML.String_Expressions.UML_String_Expression_Access);
-- Setter of NamedElement::nameExpression.
--
-- The string expression used to define the name of this named element.
overriding function Get_Namespace
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access;
-- Getter of NamedElement::namespace.
--
-- Specifies the namespace that owns the NamedElement.
overriding function Get_Qualified_Name
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return AMF.Optional_String;
-- Getter of NamedElement::qualifiedName.
--
-- A name which allows the NamedElement to be identified within a
-- hierarchy of nested Namespaces. It is constructed from the names of the
-- containing namespaces starting at the root of the hierarchy and ending
-- with the name of the NamedElement itself.
overriding function Get_Owned_Comment
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return AMF.UML.Comments.Collections.Set_Of_UML_Comment;
-- Getter of Element::ownedComment.
--
-- The Comments owned by this element.
overriding function Get_Owned_Element
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return AMF.UML.Elements.Collections.Set_Of_UML_Element;
-- Getter of Element::ownedElement.
--
-- The Elements owned by this element.
overriding function Get_Owner
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return AMF.UML.Elements.UML_Element_Access;
-- Getter of Element::owner.
--
-- The Element that owns this element.
overriding function Get_Owning_Template_Parameter
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return AMF.UML.Template_Parameters.UML_Template_Parameter_Access;
-- Getter of ParameterableElement::owningTemplateParameter.
--
-- The formal template parameter that owns this element.
overriding procedure Set_Owning_Template_Parameter
(Self : not null access UMLDI_UML_Composite_Structure_Diagram_Proxy;
To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access);
-- Setter of ParameterableElement::owningTemplateParameter.
--
-- The formal template parameter that owns this element.
overriding function Get_Template_Parameter
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return AMF.UML.Template_Parameters.UML_Template_Parameter_Access;
-- Getter of ParameterableElement::templateParameter.
--
-- The template parameter that exposes this element as a formal parameter.
overriding procedure Set_Template_Parameter
(Self : not null access UMLDI_UML_Composite_Structure_Diagram_Proxy;
To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access);
-- Setter of ParameterableElement::templateParameter.
--
-- The template parameter that exposes this element as a formal parameter.
overriding function All_Namespaces
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return AMF.UML.Namespaces.Collections.Ordered_Set_Of_UML_Namespace;
-- Operation NamedElement::allNamespaces.
--
-- The query allNamespaces() gives the sequence of namespaces in which the
-- NamedElement is nested, working outwards.
overriding function All_Owning_Packages
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return AMF.UML.Packages.Collections.Set_Of_UML_Package;
-- Operation NamedElement::allOwningPackages.
--
-- The query allOwningPackages() returns all the directly or indirectly
-- owning packages.
overriding function Is_Distinguishable_From
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy;
N : AMF.UML.Named_Elements.UML_Named_Element_Access;
Ns : AMF.UML.Namespaces.UML_Namespace_Access)
return Boolean;
-- Operation NamedElement::isDistinguishableFrom.
--
-- The query isDistinguishableFrom() determines whether two NamedElements
-- may logically co-exist within a Namespace. By default, two named
-- elements are distinguishable if (a) they have unrelated types or (b)
-- they have related types but different names.
overriding function Namespace
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access;
-- Operation NamedElement::namespace.
--
-- Missing derivation for NamedElement::/namespace : Namespace
overriding function Qualified_Name
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return League.Strings.Universal_String;
-- Operation NamedElement::qualifiedName.
--
-- When there is a name, and all of the containing namespaces have a name,
-- the qualified name is constructed from the names of the containing
-- namespaces.
overriding function Separator
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return League.Strings.Universal_String;
-- Operation NamedElement::separator.
--
-- The query separator() gives the string that is used to separate names
-- when constructing a qualified name.
overriding function All_Owned_Elements
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return AMF.UML.Elements.Collections.Set_Of_UML_Element;
-- Operation Element::allOwnedElements.
--
-- The query allOwnedElements() gives all of the direct and indirect owned
-- elements of an element.
overriding function Is_Compatible_With
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy;
P : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access)
return Boolean;
-- Operation ParameterableElement::isCompatibleWith.
--
-- The query isCompatibleWith() determines if this parameterable element
-- is compatible with the specified parameterable element. By default
-- parameterable element P is compatible with parameterable element Q if
-- the kind of P is the same or a subtype as the kind of Q. Subclasses
-- should override this operation to specify different compatibility
-- constraints.
overriding function Is_Template_Parameter
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy)
return Boolean;
-- Operation ParameterableElement::isTemplateParameter.
--
-- The query isTemplateParameter() determines if this parameterable
-- element is exposed as a formal template parameter.
overriding procedure Enter_Element
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
overriding procedure Leave_Element
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
overriding procedure Visit_Element
(Self : not null access constant UMLDI_UML_Composite_Structure_Diagram_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
end AMF.Internals.UMLDI_UML_Composite_Structure_Diagrams;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . G E N E R I C _ V E C T O R _ O P E R A T I O N S --
-- --
-- B o d y --
-- --
-- Copyright (C) 2002-2019, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with System; use System;
with System.Address_Operations; use System.Address_Operations;
with System.Storage_Elements; use System.Storage_Elements;
with Ada.Unchecked_Conversion;
package body System.Generic_Vector_Operations is
IU : constant Integer := Integer (Storage_Unit);
VU : constant Address := Address (Vectors.Vector'Size / IU);
EU : constant Address := Address (Element_Array'Component_Size / IU);
----------------------
-- Binary_Operation --
----------------------
procedure Binary_Operation
(R, X, Y : System.Address;
Length : System.Storage_Elements.Storage_Count)
is
RA : Address := R;
XA : Address := X;
YA : Address := Y;
-- Address of next element to process in R, X and Y
VI : constant Integer_Address := To_Integer (VU);
Unaligned : constant Integer_Address :=
Boolean'Pos (ModA (OrA (OrA (RA, XA), YA), VU) /= 0) - 1;
-- Zero iff one or more argument addresses is not aligned, else all 1's
type Vector_Ptr is access all Vectors.Vector;
type Element_Ptr is access all Element;
function VP is new Ada.Unchecked_Conversion (Address, Vector_Ptr);
function EP is new Ada.Unchecked_Conversion (Address, Element_Ptr);
SA : constant Address :=
AddA (XA, To_Address
((Integer_Address (Length) / VI * VI) and Unaligned));
-- First address of argument X to start serial processing
begin
while XA < SA loop
VP (RA).all := Vector_Op (VP (XA).all, VP (YA).all);
XA := AddA (XA, VU);
YA := AddA (YA, VU);
RA := AddA (RA, VU);
end loop;
while XA < X + Length loop
EP (RA).all := Element_Op (EP (XA).all, EP (YA).all);
XA := AddA (XA, EU);
YA := AddA (YA, EU);
RA := AddA (RA, EU);
end loop;
end Binary_Operation;
----------------------
-- Unary_Operation --
----------------------
procedure Unary_Operation
(R, X : System.Address;
Length : System.Storage_Elements.Storage_Count)
is
RA : Address := R;
XA : Address := X;
-- Address of next element to process in R and X
VI : constant Integer_Address := To_Integer (VU);
Unaligned : constant Integer_Address :=
Boolean'Pos (ModA (OrA (RA, XA), VU) /= 0) - 1;
-- Zero iff one or more argument addresses is not aligned, else all 1's
type Vector_Ptr is access all Vectors.Vector;
type Element_Ptr is access all Element;
function VP is new Ada.Unchecked_Conversion (Address, Vector_Ptr);
function EP is new Ada.Unchecked_Conversion (Address, Element_Ptr);
SA : constant Address :=
AddA (XA, To_Address
((Integer_Address (Length) / VI * VI) and Unaligned));
-- First address of argument X to start serial processing
begin
while XA < SA loop
VP (RA).all := Vector_Op (VP (XA).all);
XA := AddA (XA, VU);
RA := AddA (RA, VU);
end loop;
while XA < X + Length loop
EP (RA).all := Element_Op (EP (XA).all);
XA := AddA (XA, EU);
RA := AddA (RA, EU);
end loop;
end Unary_Operation;
end System.Generic_Vector_Operations;
|
-----------------------------------------------------------------------
-- Security-policies-tests - Unit tests for Security.Permissions
-- Copyright (C) 2011, 2012, 2013 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Tests;
with Util.Strings;
with Security.Policies.Roles;
package Security.Policies.Tests is
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite);
type Test is new Util.Tests.Test with null record;
-- Test Create_Role and Get_Role_Name
procedure Test_Create_Role (T : in out Test);
-- Test Set_Roles
procedure Test_Set_Roles (T : in out Test);
-- Test Set_Roles on an invalid role name
procedure Test_Set_Invalid_Roles (T : in out Test);
-- Test the Get_Policy, Get_Role_Policy and Add_Policy operations.
procedure Test_Get_Role_Policy (T : in out Test);
-- Test Has_Permission
procedure Test_Has_Permission (T : in out Test);
-- Test reading an empty policy file
procedure Test_Read_Empty_Policy (T : in out Test);
-- Test reading policy files
procedure Test_Read_Policy (T : in out Test);
-- Test reading policy files and using the <role-permission> controller
procedure Test_Role_Policy (T : in out Test);
-- Test anonymous users and permissions.
procedure Test_Anonymous_Permission (T : in out Test);
-- Read the policy file <b>File</b> and perform a test on the given URI
-- with a user having the given role.
procedure Check_Policy (T : in out Test;
File : in String;
Role : in String;
URL : in String;
Anonymous : in Boolean := False;
Granted : in Boolean := True);
type Test_Principal is new Principal and Roles.Role_Principal_Context with record
Name : Util.Strings.String_Ref;
Roles : Security.Policies.Roles.Role_Map := (others => False);
end record;
-- Get the roles assigned to the user.
overriding
function Get_Roles (User : in Test_Principal) return Roles.Role_Map;
-- Get the principal name.
function Get_Name (From : in Test_Principal) return String;
end Security.Policies.Tests;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- G N A T . S T R I N G S --
-- --
-- S p e c --
-- --
-- Copyright (C) 1995-2005, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
--
--
--
--
--
--
--
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Common String access types and related subprograms
with Unchecked_Deallocation;
package GNAT.Strings is
pragma Preelaborate;
type String_Access is access all String;
-- General purpose string access type. Note that the caller is
-- responsible for freeing allocated strings to avoid memory leaks.
procedure Free is new Unchecked_Deallocation
(Object => String, Name => String_Access);
-- This procedure is provided for freeing allocated values of type
-- String_Access.
type String_List is array (Positive range <>) of String_Access;
type String_List_Access is access all String_List;
-- General purpose array and pointer for list of string accesses
procedure Free (Arg : in out String_List_Access);
-- Frees the given array and all strings that its elements reference,
-- and then sets the argument to null. Provided for freeing allocated
-- values of this type.
end GNAT.Strings;
|
------------------------------------------------------------------------------
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
-- G N A T . S H A 2 5 6 --
-- --
-- S p e c --
-- --
-- Copyright (C) 2009-2011, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package implements the SHA-256 secure hash function as described in
-- FIPS PUB 180-3. The complete text of FIPS PUB 180-3 can be found at:
-- http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf
-- See the declaration of GNAT.Secure_Hashes.H in g-sechas.ads for complete
-- documentation.
with GNAT.Secure_Hashes.SHA2_Common;
with GNAT.Secure_Hashes.SHA2_32;
with System;
package GNAT.SHA256 is new GNAT.Secure_Hashes.H
(Block_Words => GNAT.Secure_Hashes.SHA2_Common.Block_Words,
State_Words => 8,
Hash_Words => 8,
Hash_Bit_Order => System.High_Order_First,
Hash_State => GNAT.Secure_Hashes.SHA2_32.Hash_State,
Initial_State => GNAT.Secure_Hashes.SHA2_32.SHA256_Init_State,
Transform => GNAT.Secure_Hashes.SHA2_32.Transform);
|
------------------------------------------------------------------------------
-- Copyright (c) 2014-2015, Natacha Porté --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Parts of this file were generated with vim in project root directory, --
-- using the following base: --
-- :r !grep -h function generated/*-t.ads --
-- Transforming base to with list: --
-- :s/^function\(.*\)$/with\1;/ --
-- Transforming base to (part of the) returned expression: --
-- :s/^function/ and/ --
------------------------------------------------------------------------------
with Natools.Static_Maps.Web.Comments.T;
with Natools.Static_Maps.Web.Error_Pages.T;
with Natools.Static_Maps.Web.Fallback_Render.T;
with Natools.Static_Maps.Web.List_Templates.T;
with Natools.Static_Maps.Web.Simple_Pages.T;
with Natools.Static_Maps.Web.Sites.T;
with Natools.Static_Maps.Web.Tag_Pages.T;
with Natools.Static_Maps.Web.Tags.T;
function Common.Test_Maps return Boolean is
begin
return Natools.Static_Maps.Web.Comments.T
and Natools.Static_Maps.Web.Error_Pages.T
and Natools.Static_Maps.Web.Fallback_Render.T
and Natools.Static_Maps.Web.List_Templates.T
and Natools.Static_Maps.Web.Simple_Pages.T
and Natools.Static_Maps.Web.Sites.T
and Natools.Static_Maps.Web.Tag_Pages.T
and Natools.Static_Maps.Web.Tags.T;
end Common.Test_Maps;
|
pragma License (Unrestricted);
with Ada.Numerics.Generic_Complex_Types;
with Ada.Text_IO.Complex_IO;
generic
with package Complex_Types is new Numerics.Generic_Complex_Types (<>);
package Ada.Wide_Wide_Text_IO.Complex_IO is
-- use Complex_Types;
-- for renaming
package Strings is new Text_IO.Complex_IO (Complex_Types);
Default_Fore : Field
renames Strings.Default_Fore; -- 2
Default_Aft : Field
renames Strings.Default_Aft; -- Complex_Types.Real'Digits - 1
Default_Exp : Field
renames Strings.Default_Exp; -- 3
procedure Get (
File : File_Type; -- Input_File_Type
Item : out Complex_Types.Complex;
Width : Field := 0)
renames Strings.Get;
procedure Get (
Item : out Complex_Types.Complex;
Width : Field := 0)
renames Strings.Get;
procedure Put (
File : File_Type; -- Output_File_Type
Item : Complex_Types.Complex;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp)
renames Strings.Put;
procedure Put (
Item : Complex_Types.Complex;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp)
renames Strings.Put;
procedure Get (
From : Wide_Wide_String;
Item : out Complex_Types.Complex;
Last : out Positive)
renames Strings.Overloaded_Get;
procedure Put (
To : out Wide_Wide_String;
Item : Complex_Types.Complex;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp)
renames Strings.Overloaded_Put;
end Ada.Wide_Wide_Text_IO.Complex_IO;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S Y S T E M . L I B M --
-- --
-- B o d y --
-- --
-- Copyright (C) 2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This is the Ada Cert Math specific version of s-libm.adb
-- When Cody and Waite implementation is cited, it refers to the
-- Software Manual for the Elementary Functions by William J. Cody, Jr.
-- and William Waite, published by Prentice-Hall Series in Computational
-- Mathematics. Version??? ISBN???
-- When Hart implementation is cited, it refers to
-- "The Computer Approximation" by John F. Hart, published by Krieger.
-- Version??? ISBN???
with Numerics; use Numerics;
with Libm; use Libm;
with Ada.Unchecked_Conversion;
with System.Machine_Code;
package body Libm_Double is
subtype LF is Long_Float;
pragma Assert (LF'Machine_Radix = 2);
pragma Assert (LF'Machine_Mantissa = 53);
LF_HM : constant Integer := Long_Float'Machine_Mantissa / 2;
Sqrt_Epsilon_LF : constant Long_Float :=
Sqrt_2 ** (1 - Long_Float'Machine_Mantissa);
type Long_Float_Table is array (Positive range <>) of Long_Float;
-- A1 (i) = Float (2**((1-i)/16))
A1_Tab_LF : constant Long_Float_Table :=
(1.0,
Long_Float'Machine (Root16_Half),
Long_Float'Machine (Root16_Half**2),
Long_Float'Machine (Root16_Half**3),
Long_Float'Machine (Root16_Half**4),
Long_Float'Machine (Root16_Half**5),
Long_Float'Machine (Root16_Half**6),
Long_Float'Machine (Root16_Half**7),
Long_Float'Machine (Root16_Half**8),
Long_Float'Machine (Root16_Half**9),
Long_Float'Machine (Root16_Half**10),
Long_Float'Machine (Root16_Half**11),
Long_Float'Machine (Root16_Half**12),
Long_Float'Machine (Root16_Half**13),
Long_Float'Machine (Root16_Half**14),
Long_Float'Machine (Root16_Half**15),
0.5);
-- A2 (i) = 2**((1-2i)/16) - A1(2i)
A2_Tab_LF : constant Long_Float_Table :=
(Root16_Half - Long_Float'Machine (Root16_Half),
Root16_Half**3 - Long_Float'Machine (Root16_Half**3),
Root16_Half**5 - Long_Float'Machine (Root16_Half**5),
Root16_Half**7 - Long_Float'Machine (Root16_Half**7),
Root16_Half**9 - Long_Float'Machine (Root16_Half**9),
Root16_Half**11 - Long_Float'Machine (Root16_Half**11),
Root16_Half**13 - Long_Float'Machine (Root16_Half**13),
Root16_Half**15 - Long_Float'Machine (Root16_Half**15));
-- Intermediary functions
function Reconstruct_Pow
(Z : Long_Float;
P : Integer;
M : Integer) return Long_Float;
procedure Reduce_044
(X : Long_Float;
Reduced_X : out Long_Float;
P : out Integer)
with Post => abs (Reduced_X) < 0.044;
function Reduce_1_16 (X : Long_Float) return Long_Float
with Post => abs (X - Reduce_1_16'Result) <= 0.0625;
function Reduce_1_16 (X : Long_Float) return Long_Float is
(LF'Machine_Rounding (X * 16.0) * (1.0 / 16.0));
package Long_Float_Approximations is
new Generic_Approximations (Long_Float, Mantissa => 53);
use Long_Float_Approximations;
-- Local declarations
procedure Reduce_Half_Pi_Large (X : in out LF; N : LF; Q : out Quadrant);
procedure Split_Veltkamp (X : Long_Float; X_Hi, X_Lo : out Long_Float)
with Post => X = X_Hi + X_Lo;
function Multiply_Add (X, Y, Z : LF) return LF is (X * Y + Z);
-- The following functions reduce a positive X into the range
-- -ln (2) / 2 .. ln (2) / 2
-- It returns a reduced X and an integer N such that:
-- X'Old = X'New + N * Log (2)
-- It is used by Exp function
-- The result should be correctly rounded
procedure Reduce_Ln_2 (X : in out Long_Float; N : out Integer)
with Pre => abs (X) <= Long_Float'Ceiling
(Long_Float'Pred (709.78271_28337_79350_29149_8) * Inv_Ln_2);
-- @llr Reduce_Ln_2 Long_Float
-- The following is postcondition doesn't hold. Suspicious "=" ???
-- Post => abs (X) <= Ln_2 / 2.0 and
-- X'Old = X + Long_Float (N) * Ln_2;
-- The reduction is used by the Sin, Cos and Tan functions.
procedure Reduce_Half_Pi (X : in out Long_Float; Q : out Quadrant)
with Pre => X >= 0.0,
Post => abs (X) <= Max_Red_Trig_Arg;
-- @llr Reduce_Half_Pi Long_Float
-- The following functions reduce a positive X into the range
-- -(Pi/4 + E) .. Pi/4 + E, with E a small fraction of Pi.
--
-- The reason the normalization is not strict is that the computation of
-- the number of times to subtract half Pi is not exact. The rounding
-- error is worst for large arguments, where the number of bits behind
-- the radix point reduces to half the mantissa bits.
-- While it would be possible to correct for this, the polynomial
-- approximations work well for values slightly outside the -Pi/4 .. Pi/4
-- interval, so it is easier for both error analysis and implementation
-- to leave the reduction non-strict, and assume the reduced argument is
-- within -0.26 * Pi .. 0.26 * Pi rather than a quarter of pi.
-- The reduction is guaranteed to be correct to within 0.501 ulp for
-- values of X for which Ada's accuracy guarantees apply:
-- abs X <= 2.0**(T'Machine_Mantissa / 2)
-- For values outside this range, an attempt is made to have significance
-- decrease only proportionally with increase of magnitued. In any case,
-- for all finite arguments, the reduction will succeed, though the reduced
-- value may not agree with the mathematically correct value in even its
-- sign.
---------------------
-- Reconstruct_Pow --
---------------------
function Reconstruct_Pow
(Z : Long_Float;
P : Integer;
M : Integer) return Long_Float
is
-- Cody and Waite implementation (in "**" function page 84)
-- The following computation is carried out in two steps. First add 1 to
-- Z and multiply by 2**(-P/16). Then multiply the result by 2**M.
Result : Long_Float;
begin
Result := A1_Tab_LF (P + 1) * Z;
return Long_Float'Scaling (Result, M);
end Reconstruct_Pow;
----------------
-- Reduce_044 --
----------------
procedure Reduce_044
(X : Long_Float;
Reduced_X : out Long_Float;
P : out Integer)
is
-- Cody and Waite implementation (in "**" function page 84)
-- The output is:
-- P is the biggest odd Integer in range 1 .. 15 such that
-- 2^((1-P)/16) <= X.
-- Reduced_X equals 2 * (X-2^(-P/16)) / (X + 2^(-P/16)).
-- abs (Reduced_X) <= max (2^(2-P/16)-2^(1-P/16)) <= 0.443.
begin
P := 1;
if X <= A1_Tab_LF (9) then
P := 9;
end if;
if X <= A1_Tab_LF (P + 4) then
P := P + 4;
end if;
if X <= A1_Tab_LF (P + 2) then
P := P + 2;
end if;
Reduced_X := (X - A1_Tab_LF (P + 1)) - A2_Tab_LF ((P + 1) / 2);
Reduced_X := Reduced_X / (X + A1_Tab_LF (P + 1));
Reduced_X := Reduced_X + Reduced_X;
end Reduce_044;
--------------------
-- Instantiations --
--------------------
package Instantiations is
function Acos is new Generic_Acos (LF);
function Atan2 is new Generic_Atan2 (LF);
end Instantiations;
--------------------
-- Split_Veltkamp --
--------------------
procedure Split_Veltkamp (X : Long_Float; X_Hi, X_Lo : out Long_Float) is
M : constant LF := 0.5 + 2.0**(1 - LF'Machine_Mantissa / 2);
begin
X_Hi := X * M - (X * M - X);
X_Lo := X - X_Hi;
end Split_Veltkamp;
-----------------
-- Reduce_Ln_2 --
-----------------
procedure Reduce_Ln_2 (X : in out Long_Float; N : out Integer) is
L1 : constant := Long_Float'Leading_Part (Ln_2, LF_HM);
L2 : constant := Long_Float'Leading_Part (Ln_2 - L1, LF_HM);
L3 : constant := Ln_2 - L2 - L1;
XN : constant Long_Float := Long_Float'Rounding (X * Inv_Ln_2);
begin
-- The argument passed to the function is smaller than Ymax * 1/log(2)
-- No overflow is possible for N (Ymax is the largest machine number
-- less than Log (LF'Last)).
N := Integer (XN);
X := ((X - XN * L1) - XN * L2) - XN * L3;
if X < -Ln_2 / 2.0 then
X := X + Ln_2;
N := N - 1;
end if;
if X > Ln_2 / 2.0 then
X := X - Ln_2;
N := N + 1;
end if;
end Reduce_Ln_2;
--------------------
-- Reduce_Half_Pi --
--------------------
procedure Reduce_Half_Pi (X : in out Long_Float; Q : out Quadrant) is
K : constant := Pi / 2.0;
Bits_N : constant := 3;
Max_N : constant := 2.0**Bits_N - 1.0;
Max_X : constant LF := LF'Pred (K * Max_N); -- About 3.5 * Pi
Bits_C : constant := LF'Machine_Mantissa - Bits_N;
C1 : constant LF := LF'Leading_Part (K, Bits_C);
C2 : constant LF := K - C1;
N : constant LF := LF'Machine_Rounding (X * K**(-1));
begin
if not X'Valid then
X := X - X;
Q := 0;
elsif abs X > Max_X then
Reduce_Half_Pi_Large (X, N, Q);
else
pragma Assert (if X'Valid then abs N <= Max_N);
X := (X - N * C1) - N * C2;
Q := Integer (N) mod 4;
end if;
end Reduce_Half_Pi;
--------------------------
-- Reduce_Half_Pi_Large --
--------------------------
procedure Reduce_Half_Pi_Large (X : in out LF; N : LF; Q : out Quadrant) is
type Int_64 is range -2**63 .. 2**63 - 1; -- used for conversions
HM : constant Positive := LF'Machine_Mantissa / 2;
C1 : constant LF := LF'Leading_Part (Half_Pi, HM);
C2 : constant LF := LF'Leading_Part (Half_Pi - C1, HM);
C3 : constant LF := LF'Leading_Part (Half_Pi - C1 - C2, HM);
C4 : constant LF := Half_Pi - C1 - C2 - C3;
K : LF := N;
K_Hi : LF;
K_Lo : LF;
begin
Q := 0;
loop
Split_Veltkamp (X => K, X_Hi => K_Hi, X_Lo => K_Lo);
X := Multiply_Add (-K_Hi, C1, X);
X := Multiply_Add (-K_Hi, C2, Multiply_Add (-K_Lo, C1, X));
X := Multiply_Add (-K_Hi, C3, Multiply_Add (-K_Lo, C2, X));
X := Multiply_Add (-K_Hi, C4, Multiply_Add (-K_Lo, C3, X));
X := Multiply_Add (-K_Lo, C4, X);
if abs K < 2.0**62 then
Q := Quadrant ((Int_64 (Q) + Int_64 (N)) mod 4);
elsif abs K_Lo <= 2.0**62 then
Q := Quadrant ((Int_64 (Q) + Int_64 (N)) mod 4);
end if;
exit when X in -0.26 * Pi .. 0.26 * Pi;
K := LF'Machine_Rounding (X * Half_Pi**(-1));
end loop;
end Reduce_Half_Pi_Large;
----------
-- Acos --
----------
function Acos (X : LF) return LF is (Instantiations.Acos (X));
-----------
-- Acosh --
-----------
function Acosh (X : LF) return LF is
-- Math based implementation using Log1p: x-> Log (1+x)
T : constant LF := X - 1.0;
begin
if X > 1.0 / Sqrt_Epsilon_LF then
return Log (X) + Ln_2;
elsif X < 2.0 then
return Log1p (T + Sqrt (2.0 * T + T * T));
else
return Log (X + Libm_Double.Sqrt ((X - 1.0) * (X + 1.0)));
end if;
end Acosh;
----------
-- Asin --
----------
function Asin (X : LF) return LF is (Long_Float_Approximations.Asin (X));
-----------
-- Asinh --
-----------
function Asinh (X : LF) return LF is
-- Math based implementation using Log1p: x-> Log (1+x)
Y : constant LF := abs X;
G : constant LF := X * X;
Res : LF;
begin
if Y < Sqrt_Epsilon_LF then
Res := Y;
elsif Y > 1.0 / Sqrt_Epsilon_LF then
Res := Log (Y) + Ln_2;
elsif Y < 2.0 then
Res := Log1p (Y + G / (1.0 + Sqrt (G + 1.0)));
else
Res := Log (Y + Sqrt (G + 1.0));
end if;
return LF'Copy_Sign (Res, X);
end Asinh;
----------
-- Atan --
----------
function Atan (X : LF) return LF is (Instantiations.Atan2 (X, 1.0));
-----------
-- Atan2 --
-----------
function Atan2 (Y, X : LF) return LF is (Instantiations.Atan2 (Y, X));
-----------
-- Atanh --
-----------
function Atanh (X : LF) return LF is
-- Math based implementation using Log1p: x-> Log (1+x)
(if X >= 0.0
then Log1p (2.0 * X / (1.0 - X)) / 2.0
else -Log1p (-2.0 * X / (1.0 + X)) / 2.0);
---------
-- Cos --
---------
function Cos (X : LF) return LF is
-- Math based implementation using Hart constants
Y : LF := abs (X);
Q : Quadrant;
Result : LF;
begin
Reduce_Half_Pi (Y, Q);
if Q mod 2 = 0 then
Result := Approx_Cos (Y);
else
Result := Approx_Sin (Y);
end if;
return (if Q = 1 or else Q = 2 then -Result else Result);
end Cos;
----------
-- Cosh --
----------
function Cosh (X : LF) return LF is
-- Cody and Waite implementation (page 217)
Y : constant LF := abs (X);
-- Because the overflow threshold for cosh(X) is beyond the overflow
-- threshold for exp(X), it appears natural to reformulate the
-- computation as:
-- Cosh (X) = Exp (X - Log (2))
-- But because Log (2) is not an exact machine number, the finite word
-- length of the machine implies that the absolute error in X - Log (2),
-- hence the transmitted error in Cosh (X) is proportional to the
-- magnitude of X even when X is error-free.
-- To avoid this problem, we revise the computation to
-- Cosh (X) = V/2 * exp(X - Log (V))
-- where Log (V) is an exact machine number slightly larger than Log (2)
-- with the last few digits of its significand zero.
Ln_V : constant := 8#0.542714#;
-- Machine value slightly above Ln_2
V_2 : constant := 0.24999_30850_04514_99336;
-- V**(-2)
V_2_1 : constant := 0.13830_27787_96019_02638E-4;
-- V / 2 - 1
Y_Bar : constant Long_Float := 709.78271_28933_83973_096;
-- Y_Bar is the last floating point for which exp (Y) does not overflow
-- and exp (-Y) does not underflow
W : LF;
Z : LF;
begin
if Y >= Y_Bar then
W := Y - Ln_V;
Z := Exp (W);
Z := Z + V_2 / Z;
return Z + V_2_1 * Z; -- rewriting of V/2 * Z
else
Z := Exp (Y);
return (Z + 1.0 / Z) / 2.0;
end if;
end Cosh;
---------
-- Exp --
---------
function Exp (X : LF) return LF is
-- Cody and Waite implementation (page 60)
N : Integer;
Y : LF := X;
R : LF;
Ymax : constant LF := LF'Pred (709.78271_28337_79350_29149_8);
-- The largest machine number less than Log (LF'Last)
begin
if abs (Y) < 2.0**(-LF'Machine_Mantissa - 1) then
return 1.0;
end if;
if abs Y > Ymax then
return (if Y > 0.0 then Infinity else 0.0);
end if;
Reduce_Ln_2 (Y, N);
R := Approx_Exp (Y);
return Long_Float'Scaling (R, N);
end Exp;
----------
-- Exp2 --
----------
function Exp2 (X : LF) return LF is
-- Implementation based on Cody and Waite Exp implementation (page 217)
-- but using Hart constants
N : Integer;
Y : LF := X;
R : LF;
Result : LF;
begin
if abs Y < 2.0**(-LF'Machine_Mantissa - 1) then
return 1.0;
end if;
if abs Y > LF'Pred (LF (LF'Machine_Emax)) then
return (if Y > 0.0 then Infinity else 0.0);
end if;
-- If X > Log(LF'Emax) ???
N := Integer (X);
Y := Y - Long_Float (N);
R := Approx_Exp2 (Y);
Result := Long_Float'Scaling (R, N + 1);
if Result /= Result then
Result := (if X < LF'First then 0.0 else Infinity);
end if;
return Result;
end Exp2;
---------
-- Log --
---------
function Log (X : LF) return LF is
-- Cody and Waite implementation (page 35)
Exponent_X : constant Integer := LF'Exponent (X);
XN : LF := LF (Exponent_X);
Mantissa_X : LF := LF'Scaling (X, -Exponent_X);
HM : constant Integer := LF'Machine_Mantissa / 2;
L1 : constant LF := LF'Leading_Part (Ln_2, HM);
L2 : constant LF := Ln_2 - L1;
Result : LF;
begin
if X <= 0.0 then
if X < 0.0 then
return NaN;
else
return -Infinity;
end if;
-- Making sure X is in Sqrt (0.5) .. Sqrt (2)
elsif X > Long_Float'Last then
return X;
elsif Mantissa_X <= Sqrt_Half then
XN := XN - 1.0;
Mantissa_X := Mantissa_X * 2.0;
end if;
Result := Approx_Log (Mantissa_X);
Result := (XN * L2 + Result) + XN * L1;
return Result;
end Log;
-----------
-- Log1p --
-----------
function Log1p (X : LF) return LF is
-- Quick implementation of Log1p not accurate to the Ada regular Log
-- requirements, but accurate enough to compute inverse hyperbolic
-- functions.
begin
if 1.0 + X = 1.0 then
return X;
elsif X > LF'Last then
return X;
else
return Log (1.0 + X) * (X / ((1.0 + X) - 1.0));
end if;
end Log1p;
----------
-- Log2 --
----------
function Log2 (X : LF) return LF is
-- Quick implementation of Log2 not accurate to the Ada regular Log
-- (base e) requirement on the whole definition interval but accurate
-- enough on 0 .. 2**(-1/16).
(Log (X) * (1.0 / Ln_2));
---------
-- Pow --
---------
function Pow (Left, Right : LF) return LF is
-- Cody and Waite implementation (page 84)
One_Over_Sixteen : constant := 0.0625;
M : constant Integer := LF'Exponent (Left);
G : constant LF := LF'Fraction (Left);
Y : constant LF := Right;
Z : LF;
P : Integer;
U2, U1, Y1, Y2, W1, W2, W : LF;
MM, PP, IW1, I : Integer;
Is_Special : Boolean;
Special_Result : LF;
procedure Pow_Special_Cases is new Generic_Pow_Special_Cases (LF);
begin
-- Special values
Pow_Special_Cases (Left, Right, Is_Special, Special_Result);
if Is_Special then
return Special_Result;
else
-- Left**Right is calculated using the formula
-- 2**(Right * Log2 (Left))
Reduce_044 (G, Z, P);
-- At this point, Z <= 0.044
U2 := Approx_Power_Log (Z);
U1 := LF (M * 16 - P) * 0.0625; -- U2 + U1 = Log2 (Left)
-- Forming the pseudo extended precision product of U * Right
Y1 := Reduce_1_16 (Y);
Y2 := Y - Y1;
W := U2 * Y + U1 * Y2;
W1 := Reduce_1_16 (W);
W2 := W - W1;
W := W1 + U1 * Y1;
W1 := Reduce_1_16 (W);
W2 := W2 + (W - W1);
W := Reduce_1_16 (W2);
IW1 := Integer (16.0 * (W1 + W));
W2 := W2 - W;
if W2 > 0.0 then
W2 := W2 - One_Over_Sixteen;
IW1 := 1 + IW1;
end if;
if IW1 < 0 then
I := 0;
else
I := 1;
end if;
MM := Integer (IW1 / 16) + I;
PP := 16 * MM - IW1;
Z := Approx_Exp2 (W2);
return Reconstruct_Pow (Z, PP, MM);
end if;
end Pow;
---------
-- Sin --
---------
function Sin (X : LF) return LF is
-- Math based implementation using Hart constants
Y : LF := abs X;
Q : Quadrant;
Result : LF;
begin
Reduce_Half_Pi (Y, Q);
if Q mod 2 = 0 then
Result := Approx_Sin (Y);
else
Result := Approx_Cos (Y);
end if;
return LF'Copy_Sign (1.0, X) * (if Q >= 2 then -Result else Result);
end Sin;
----------
-- Sinh --
----------
function Sinh (X : LF) return LF is
-- Cody and Waite implementation (page 217)
Sign : constant LF := LF'Copy_Sign (1.0, X);
Y : constant LF := abs X;
-- Because the overflow threshold for sinh(X) is beyond the overflow
-- threshold for exp(X), it appears natural to reformulate the
-- computation as:
-- Sinh (X) = Exp (X - Log (2))
-- But because Log (2) is not an exact machine number, the finite word
-- length of the machine implies that the absolute error in X - Log (2),
-- hence the transmitted error in Sinh (X) is proportional to the
-- magnitude of X even when X is error-free. To avoid this problem, we
-- revise the computation to:
-- Sinh (X) = V/2 * exp(X - Log (V))
-- where Log (V) is an exact machine number slightly larger than Log (2)
-- with the last few digits of its significand zero.
Ln_V : constant := 8#0.542714#;
-- Machine value slightly above Ln_2
V_2 : constant := 0.24999_30850_04514_99336;
-- V**(-2)
V_2_1 : constant := 0.13830_27787_96019_02638E-4;
-- V / 2 - 1
Y_Bar : constant Long_Float := 709.78271_28933_83973_096;
-- The last floating point for which exp (X) does not overflow and
-- exp (-x) does not underflow
W : LF;
Z : LF;
begin
if Y <= 1.0 then
return Approx_Sinh (X);
end if;
if Y >= Y_Bar then
W := Y - Ln_V;
Z := Exp (W);
Z := Z - V_2 / Z;
return Sign * (Z + V_2_1 * Z); -- rewriting of V/2 * Z
else
Z := Exp (Y);
return Sign * ((Z - 1.0 / Z) / 2.0);
end if;
end Sinh;
---------
-- Tan --
---------
function Tan (X : LF) return LF is
-- Math based implementation using Hart constants
Y : LF := abs X;
N : Integer;
begin
if abs X < LF'Last then
Reduce_Half_Pi (Y, N);
else
return Infinity / Infinity;
end if;
-- The reconstruction is included in the algebraic fraction in
-- Approx_Tan function.
if N mod 2 = 0 then
return Approx_Tan (Y) * LF'Copy_Sign (1.0, X);
else
return Approx_Cot (Y) * LF'Copy_Sign (1.0, X);
end if;
end Tan;
----------
-- Tanh --
----------
function Tanh (X : LF) return LF is
-- Cody and Waite implementation (page 239)
F : constant LF := abs (X);
Xbig : constant := Ln_2 * LF (1 + LF'Machine_Mantissa);
LN_3_2 : constant := 0.54930_61443_34054_84570;
Result : LF;
begin
if F > Xbig then
Result := 1.0;
else
if F > LN_3_2 then
Result := 1.0 - 2.0 / (Exp (2.0 * F) + 1.0);
else
Result := Approx_Tanh (F);
end if;
end if;
return LF'Copy_Sign (Result, X);
end Tanh;
function Rsqrt (X : Long_Float) return Long_Float;
-- Compute the reciprocal square root. There are two reasons for computing
-- the reciprocal square root instead of computing directly the square
-- root: PowerPc provides an instruction (fsqrte) to compute an estimate of
-- the reciprocal (with 5 bits of precision), and the Newton-Raphson method
-- is more efficient on the reciprocal than on the direct root (because the
-- direct root needs divisions, while the reciprocal does not). Note that
-- PowerPc core e300 doesn't support the direct square root operation.
-----------
-- Rsqrt --
-----------
function Rsqrt (X : Long_Float) return Long_Float is
X_Half : constant Long_Float := X * 0.5;
Y : Long_Float;
begin
if Standard'Target_Name = "powerpc-elf" then
-- On powerpc, the precision of fsqrte is at least 5 binary digits
System.Machine_Code.Asm ("frsqrte %0,%1",
Outputs => Long_Float'Asm_Output ("=f", Y),
Inputs => Long_Float'Asm_Input ("f", X));
else
-- Provide the exact result for 1.0
if X = 1.0 then
return X;
end if;
-- Use the method described in Fast Inverse Square Root article by
-- Chris Lomont (http://www.lomont.org/Math/Papers/2003/InvSqrt.pdf),
-- although the code was known before that article.
declare
type Unsigned_Long is mod 2**64;
function To_Unsigned_Long is new Ada.Unchecked_Conversion
(Long_Float, Unsigned_Long);
function From_Unsigned_Long is new Ada.Unchecked_Conversion
(Unsigned_Long, Long_Float);
U : Unsigned_Long;
begin
U := To_Unsigned_Long (X);
U := 16#5fe6ec85_e7de30da# - (U / 2);
Y := From_Unsigned_Long (U);
-- Precision is about 4 digits
end;
end if;
-- Newton iterations: X <- X - F(X)/F'(X)
-- Here F(X) = 1/X^2 - A, so F'(X) = -2/X^3
-- So: X <- X - (1/X^2 - A) / (-2/X^3)
-- <- X + .5(X - A*X^3)
-- <- X + .5*X*(1 - A*X^2)
-- <- X (1 + .5 - .5*A*X^2)
-- <- X(1.5 - .5*A*X^2)
-- Precision is doubled at each iteration.
-- Refine: 10 digits (PowerPc) or 8 digits (fast method)
Y := Y * (1.5 - X_Half * Y * Y);
-- Refine: 20 digits (PowerPc) or 16 digits (fast method)
Y := Y * (1.5 - X_Half * Y * Y);
-- Refine: 40 digits (PowerPc) or 32 digits (fast method)
Y := Y * (1.5 - X_Half * Y * Y);
-- Refine (beyond the precision of Long_Float)
Y := Y * (1.5 - X_Half * Y * Y);
return Y;
end Rsqrt;
----------
-- Sqrt --
----------
function Sqrt (X : Long_Float) return Long_Float is
begin
if X <= 0.0 then
if X = 0.0 then
return X;
else
return NaN;
end if;
elsif X = Infinity then
return X;
else
return X * Rsqrt (X);
end if;
end Sqrt;
end Libm_Double;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . B B . C P U _ P R I M I T I V E S --
-- --
-- B o d y --
-- --
-- Copyright (C) 1999-2002 Universidad Politecnica de Madrid --
-- Copyright (C) 2003-2005 The European Space Agency --
-- Copyright (C) 2003-2019, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
-- The port of GNARL to bare board targets was initially developed by the --
-- Real-Time Systems Group at the Technical University of Madrid. --
-- --
------------------------------------------------------------------------------
-- This package implements RISC-V architecture specific support for the GNAT
-- Ravenscar run time.
with System.Multiprocessors;
with System.BB.Threads.Queues;
with System.BB.Board_Support;
with System.BB.CPU_Specific; use System.BB.CPU_Specific;
package body System.BB.CPU_Primitives is
package SSE renames System.Storage_Elements;
use type SSE.Integer_Address;
use type SSE.Storage_Offset;
type Context_Switch_Params is record
Running_Thread_Address : Address;
-- Address of the running thread entry for the current cpu
First_Thread_Address : Address;
-- Address of the first read thread for the current cpu
end record;
pragma Convention (C, Context_Switch_Params);
pragma Suppress_Initialization (Context_Switch_Params);
-- This record describe data that are passed from Pre_Context_Switch
-- to Context_Switch. In the assembly code we take advantage of the ABI
-- so that the data returned are in the registers of the incoming call.
-- So there is no need to copy or to move the data between both calls.
function Pre_Context_Switch return Context_Switch_Params;
pragma Export (Asm, Pre_Context_Switch, "__gnat_pre_context_switch");
-- The full context switch is split in 2 stages:
-- - Pre_Context_Switch: adjust the current priority (but don't modify
-- the MSTATUS.MIE bit), and return the running and first thread queue
-- addresses.
-- - The assembly routine (context_switch) which does the real context
-- switch.
-- When called from interrupt handler, the stack pointer is saved before
-- and restore after the context switch. Therefore the context switch
-- cannot allocate a frame but only assembly code can guarantee that. We
-- also take advantage of this two stage call to extract queue pointers
-- in the Ada code.
------------------------
-- Pre_Context_Switch --
------------------------
function Pre_Context_Switch return Context_Switch_Params is
use System.BB.Threads.Queues;
use System.BB.Threads;
CPU_Id : constant System.Multiprocessors.CPU :=
Board_Support.Multiprocessors.Current_CPU;
New_Priority : constant Integer :=
First_Thread_Table (CPU_Id).Active_Priority;
begin
-- Called with interrupts disabled
-- Set interrupt priority. Unlike the SPARC implementation, the
-- interrupt priority is not part of the context (not in a register).
-- However full interrupt disabling is part of the context switch.
if New_Priority < Interrupt_Priority'Last then
Board_Support.Interrupts.Set_Current_Priority (New_Priority);
end if;
return (Running_Thread_Table (CPU_Id)'Address,
First_Thread_Table (CPU_Id)'Address);
end Pre_Context_Switch;
--------------------
-- Context_Switch --
--------------------
procedure Context_Switch is
procedure Context_Switch_Asm
(Running_Thread_Table_Element_Address : System.Address;
Ready_Thread_Table_Element_Address : System.Address);
pragma Import (Asm, Context_Switch_Asm, "__gnat_context_switch");
-- Real context switch in assembly code
Params : Context_Switch_Params;
begin
-- First set priority and get pointers
Params := Pre_Context_Switch;
-- Then the real context switch
Context_Switch_Asm (Params.Running_Thread_Address,
Params.First_Thread_Address);
end Context_Switch;
------------------------
-- Disable_Interrupts --
------------------------
procedure Disable_Interrupts is
begin
-- Clear the Machine Interrupt Enable (MIE) bit of the mstatus register
Clear_Mstatus_Bits (Mstatus_MIE);
end Disable_Interrupts;
-----------------------
-- Enable_Interrupts --
-----------------------
procedure Enable_Interrupts (Level : Integer) is
begin
if Level /= System.Interrupt_Priority'Last then
Board_Support.Interrupts.Set_Current_Priority (Level);
-- Really enable interrupts
-- Set the Machine Interrupt Enable (MIE) bit of the mstatus register
Set_Mstatus_Bits (Mstatus_MIE);
end if;
end Enable_Interrupts;
----------------------
-- Initialize_Stack --
----------------------
procedure Initialize_Stack
(Base : Address;
Size : Storage_Elements.Storage_Offset;
Stack_Pointer : out Address)
is
use System.Storage_Elements;
Minimum_Stack_Size_In_Bytes : constant Integer_Address :=
CPU_Specific.Stack_Alignment;
Initial_SP : constant System.Address :=
To_Address
(To_Integer (Base + Size) -
Minimum_Stack_Size_In_Bytes);
begin
Stack_Pointer := Initial_SP;
end Initialize_Stack;
------------------------
-- Initialize_Context --
------------------------
procedure Initialize_Context
(Buffer : not null access Context_Buffer;
Program_Counter : System.Address;
Argument : System.Address;
Stack_Pointer : System.Address)
is
procedure Start_Thread_Asm;
pragma Import (Asm, Start_Thread_Asm, "__gnat_start_thread");
Initial_SP : Address;
begin
-- No need to initialize the context of the environment task
if Program_Counter = Null_Address then
return;
end if;
-- We cheat as we don't know the stack size nor the stack base
Initialize_Stack (Stack_Pointer, 0, Initial_SP);
Buffer.RA := Start_Thread_Asm'Address;
Buffer.SP := Initial_SP;
-- Use callee saved registers to make sure the values are loaded during
-- the first context_switch.
Buffer.S1 := Argument;
Buffer.S2 := Program_Counter;
end Initialize_Context;
--------------------
-- Initialize_CPU --
--------------------
procedure Initialize_CPU is
begin
null;
end Initialize_CPU;
----------------------------
-- Install_Error_Handlers --
----------------------------
procedure Install_Error_Handlers is
begin
null;
end Install_Error_Handlers;
end System.BB.CPU_Primitives;
|
-----------------------------------------------------------------------
-- Sessions Tests - Unit tests for Servlet.Sessions
-- Copyright (C) 2010, 2011 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Test_Caller;
with Servlet.Sessions.Factory;
with Util.Measures;
with EL.Objects;
package body Servlet.Sessions.Tests is
use Util.Tests;
-- ------------------------------
-- Test session creation.
-- ------------------------------
procedure Test_Create_Session (T : in out Test) is
F : Servlet.Sessions.Factory.Session_Factory;
S : Servlet.Sessions.Session;
St : Util.Measures.Stamp;
begin
for I in 1 .. 10 loop
F.Create_Session (S);
end loop;
Util.Measures.Report (St, "10 Session create");
for I in 1 .. 100 loop
F.Create_Session (S);
T.Assert (S.Is_Valid, "Session should be valid");
T.Assert (S.Get_Id'Length = 32, "Session id has an invalid length");
-- Ada.Text_IO.Put_Line ("ID=" & S.Get_Id);
declare
S2 : Servlet.Sessions.Session;
begin
F.Find_Session (Id => S.Get_Id, Result => S2);
T.Assert (S2.Is_Valid, "Session was not found");
Assert_Equals (T, S.Get_Id, S2.Get_Id, "Invalid session id");
end;
end loop;
end Test_Create_Session;
-- ------------------------------
-- Tests on an empty session object.
-- ------------------------------
procedure Test_Empty_Session (T : in out Test) is
S : Servlet.Sessions.Session;
begin
T.Assert (not S.Is_Valid, "Session should be invalid");
S.Invalidate;
T.Assert (not S.Is_Valid, "Session should be invalid");
end Test_Empty_Session;
procedure Test_Session_Attributes (T : in out Test) is
F : Servlet.Sessions.Factory.Session_Factory;
S : Servlet.Sessions.Session;
begin
F.Create_Session (S);
S.Set_Attribute ("a1", EL.Objects.To_Object (Integer (234)));
S.Set_Attribute ("a2", EL.Objects.To_Object (String '("name")));
declare
Value : constant EL.Objects.Object := S.Get_Attribute ("a1");
begin
Assert_Equals (T, "234", EL.Objects.To_String (Value), "Invalid attribute a1");
end;
end Test_Session_Attributes;
package Caller is new Util.Test_Caller (Test, "Sessions");
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is
begin
-- To document what is tested, register the test methods for each
-- operation that is tested.
Caller.Add_Test (Suite, "Test Servlet.Sessions.Factory.Create_Session",
Test_Create_Session'Access);
Caller.Add_Test (Suite, "Test Servlet.Sessions.Factory.Find_Session",
Test_Create_Session'Access);
Caller.Add_Test (Suite, "Test Servlet.Sessions.Get_Id",
Test_Create_Session'Access);
Caller.Add_Test (Suite, "Test Servlet.Sessions.Is_Valid",
Test_Empty_Session'Access);
Caller.Add_Test (Suite, "Test Servlet.Sessions.Set_Attribute",
Test_Session_Attributes'Access);
Caller.Add_Test (Suite, "Test Servlet.Sessions.Get_Attribute",
Test_Session_Attributes'Access);
end Add_Tests;
end Servlet.Sessions.Tests;
|
-----------------------------------------------------------------------
-- keystore-buffers -- Buffer management for the keystore
-- Copyright (C) 2019, 2020 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Streams;
with Ada.Containers.Ordered_Maps;
with Util.Refs;
with Util.Strings;
private package Keystore.Buffers is
use Ada.Streams;
BT_HMAC_HEADER_SIZE : constant := 32;
-- Data block size defined to a 4K to map system page.
Block_Size : constant := 4096;
BT_DATA_SIZE : constant := Block_Size - BT_HMAC_HEADER_SIZE;
subtype Buffer_Size is Stream_Element_Offset range 0 .. BT_DATA_SIZE;
subtype Block_Index is Stream_Element_Offset range 1 .. BT_DATA_SIZE;
subtype IO_Block_Type is Stream_Element_Array (1 .. Block_Size);
subtype Block_Type is Stream_Element_Array (Block_Index);
function Image (Value : Block_Index) return String is
(Util.Strings.Image (Natural (Value)));
type Block_Count is new Interfaces.Unsigned_32;
subtype Block_Number is Block_Count range 1 .. Block_Count'Last;
type Storage_Identifier is new Interfaces.Unsigned_32;
type Storage_Block is record
Storage : Storage_Identifier := 0;
Block : Block_Number := Block_Number'First;
end record;
-- Get a printable representation of storage block for the logs.
function To_String (Value : in Storage_Block) return String;
-- Order the two values on the storage and block number.
function "<" (Left, Right : in Storage_Block) return Boolean is
(Left.Storage < Right.Storage or else
(Left.Storage = Right.Storage and then Left.Block < Right.Block));
type Data_Buffer_Type is limited record
Data : Block_Type;
end record;
package Buffer_Refs is new Util.Refs.General_References (Data_Buffer_Type);
subtype Buffer_Type is Buffer_Refs.Ref;
subtype Buffer_Accessor is Buffer_Refs.Element_Accessor;
type Storage_Buffer is record
Block : Storage_Block;
Data : Buffer_Type;
end record;
function Is_Null (Buffer : in Storage_Buffer) return Boolean is (Buffer.Data.Is_Null);
-- Order the two buffers on the storage and block number.
function "<" (Left, Right : in Storage_Buffer) return Boolean is (Left.Block < Right.Block);
-- A set of buffers ordered by storage and block number.
package Buffer_Maps is
new Ada.Containers.Ordered_Maps (Key_Type => Storage_Block,
Element_Type => Buffer_Type,
"<" => "<",
"=" => Buffer_Refs."=");
subtype Buffer_Map is Buffer_Maps.Map;
subtype Buffer_Cursor is Buffer_Maps.Cursor;
-- Find a buffer from the container.
function Find (Container : in Buffer_Map;
Block : in Storage_Block) return Storage_Buffer;
-- Allocate a buffer for the storage block.
function Allocate (Block : in Storage_Block) return Storage_Buffer;
end Keystore.Buffers;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.